diff --git a/vue/src/page/fileTransfer/fullScreenContextMenu.vue b/vue/src/page/fileTransfer/fullScreenContextMenu.vue index 06c5dbe..19d1714 100644 --- a/vue/src/page/fileTransfer/fullScreenContextMenu.vue +++ b/vue/src/page/fileTransfer/fullScreenContextMenu.vue @@ -22,6 +22,7 @@ import { toRawFileUrl } from '@/util/file' import ContextMenu from '@/components/ContextMenu.vue' import { useWatchDocument } from 'vue3-ts-util' import { useTagStore } from '@/store/useTagStore' +import { parse } from 'stable-diffusion-image-metadata'; const global = useGlobalStore() @@ -36,6 +37,14 @@ const currImgResolution = ref('') const q = createReactiveQueue() const imageGenInfo = ref('') const geninfoFrags = computed(() => imageGenInfo.value.split('\n')) +const geninfoStruct = computed(() => parse(imageGenInfo.value)) + +const geninfoStructNoPrompts = computed(() => { + let p = parse(imageGenInfo.value); + delete p.prompt; + delete p.negativePrompt; + return p; +}) const emit = defineEmits<{ (type: 'contextMenuClick', e: MenuInfo, file: FileNodeInfo, idx: number): void }>() @@ -90,6 +99,26 @@ function getParNode (p: any) { return p.parentNode as HTMLDivElement } +function spanWrap(text: string) { + if (!text) { + return "" + } + let result = ''; + const values = text.split(/[\n,]+/); + let parenthesisActive = false; + for (let i = 0; i < values.length; i++) { + const trimmedValue = values[i].trim(); + if(!parenthesisActive) parenthesisActive = trimmedValue.includes("("); + const cssClass = parenthesisActive ? "has-parentheses" : ""; + result += `${trimmedValue}`; + if (i < values.length - 1) { + result += ","; + } + if(parenthesisActive) parenthesisActive = !trimmedValue.includes(")"); + } + return result; +} + useWatchDocument('load', e => { const el = e.target as HTMLImageElement if (el.className === 'ant-image-preview-img') { @@ -192,9 +221,26 @@ const copyPositivePrompt = () => { {{ tag.name }} -
- {{ txt }} -
+
+
+ | {{key}} | +
+ {{ txt }}
+ |
+ + {{ txt }} + | +