Add loggen related stuff and fix bugs

This commit is contained in:
kwaroran
2024-11-05 20:15:17 +09:00
parent d02d17f177
commit 4f69bb8880
11 changed files with 795 additions and 9 deletions

View File

@@ -1,11 +1,11 @@
<script lang="ts">
import { ArrowLeft, ArrowRight, PencilIcon, LanguagesIcon, RefreshCcwIcon, TrashIcon, CopyIcon, Volume2Icon, BotIcon, ArrowLeftRightIcon, UserIcon } from "lucide-svelte";
import { ArrowLeft, Sparkles, ArrowRight, PencilIcon, LanguagesIcon, RefreshCcwIcon, TrashIcon, CopyIcon, Volume2Icon, BotIcon, ArrowLeftRightIcon, UserIcon } from "lucide-svelte";
import { type CbsConditions, ParseMarkdown, postTranslationParse, type simpleCharacterArgument } from "../../ts/parser.svelte";
import AutoresizeArea from "../UI/GUI/TextAreaResizable.svelte";
import { alertConfirm, alertError, alertRequestData } from "../../ts/alert";
import { language } from "../../lang";
import { type MessageGenerationInfo } from "../../ts/storage/database.svelte";
import { DBState } from 'src/ts/stores.svelte';
import { alertStore, DBState } from 'src/ts/stores.svelte';
import { HideIconStore, ReloadGUIPointer, selIdState } from "../../ts/stores.svelte";
import { translateHTML } from "../../ts/translator/translator";
import { risuChatParser } from "src/ts/process/scripts";
@@ -18,7 +18,6 @@
import { ColorSchemeTypeStore } from "src/ts/gui/colorscheme";
import { ConnectionOpenStore } from "src/ts/sync/multiuser";
import { onDestroy, onMount } from "svelte";
import { PerformanceDebugger } from "src/ts/globalApi.svelte";
let translating = $state(false)
let editMode = $state(false)
let statusMessage:string = $state('')
@@ -274,6 +273,16 @@
{#snippet icons(options:{applyTextColors?:boolean} = {})}
<div class="flex-grow flex items-center justify-end" class:text-textcolor2={options?.applyTextColors !== false}>
<span class="text-xs">{statusMessage}</span>
{#if DBState.db.logShare}
<button class="ml-2 hover:text-blue-500 transition-colors" onclick={() => {
alertStore.set({
type: 'pukmakkurit',
msg: lastParsed,
})
}}>
<Sparkles size={22}/>
</button>
{/if}
{#if DBState.db.useChatCopy && !blankMessage}
<button class="ml-2 hover:text-blue-500 transition-colors" onclick={()=>{
window.navigator.clipboard.writeText(msgDisplay).then(() => {

View File

@@ -69,7 +69,7 @@
}
}}></svelte:window>
{#if $alertStore.type !== 'none' && $alertStore.type !== 'toast' && $alertStore.type !== 'cardexport' && $alertStore.type !== 'selectModule'}
{#if $alertStore.type !== 'none' && $alertStore.type !== 'toast' && $alertStore.type !== 'cardexport' && $alertStore.type !== 'selectModule' && $alertStore.type !== 'pukmakkurit'}
<div class="absolute w-full h-full z-50 bg-black bg-opacity-50 flex justify-center items-center" class:vis={ $alertStore.type === 'wait2'}>
<div class="bg-darkbg p-4 break-any rounded-md flex flex-col max-w-3xl max-h-full overflow-y-auto">
{#if $alertStore.type === 'error'}
@@ -544,6 +544,17 @@
msg: d
})
}} />
{:else if $alertStore.type === 'pukmakkurit'}
<!-- Log Generator by dootaang, GPL3 -->
<!-- Svelte, Typescript version by Kwaroran -->
<div class="absolute w-full h-full z-50 bg-black bg-opacity-50 flex justify-center items-center">
<div class="bg-darkbg p-4 break-any rounded-md flex flex-col max-w-3xl max-h-full overflow-y-auto">
<h2 class="text-green-700 mt-0 mb-2 w-40 max-w-full">{language.preview}</h2>
</div>
</div>
{/if}
<style>

View File

@@ -319,6 +319,10 @@
<Check bind:check={DBState.db.useChatCopy} name={language.useChatCopy}/>
</div>
<!-- <div class="flex items-center mt-2">
<Check bind:check={DBState.db.logShare} name={language.logShare}/>
</div> -->
<div class="flex items-center mt-2">
<Check bind:check={DBState.db.useAdditionalAssetsPreview} name={language.useAdditionalAssetsPreview}/>
</div>