diff --git a/ui/src/components/auto-tooltip/index.vue b/ui/src/components/auto-tooltip/index.vue new file mode 100644 index 000000000..cc29d99b0 --- /dev/null +++ b/ui/src/components/auto-tooltip/index.vue @@ -0,0 +1,39 @@ + + + diff --git a/ui/src/components/generate-related-dialog/index.vue b/ui/src/components/generate-related-dialog/index.vue new file mode 100644 index 000000000..dd507152e --- /dev/null +++ b/ui/src/components/generate-related-dialog/index.vue @@ -0,0 +1,203 @@ + + + diff --git a/ui/src/components/index.ts b/ui/src/components/index.ts index 2c07e4856..4fe7b5080 100644 --- a/ui/src/components/index.ts +++ b/ui/src/components/index.ts @@ -15,6 +15,7 @@ import CodemirrorEditor from './codemirror-editor/index.vue' import InfiniteScroll from './infinite-scroll/index.vue' import ModelSelect from './model-select/index.vue' import ReadWrite from './read-write/index.vue' +import AutoTooltip from './auto-tooltip/index.vue' export default { install(app: App) { app.component('LogoFull', LogoFull) @@ -33,5 +34,6 @@ export default { app.component('InfiniteScroll', InfiniteScroll) app.component('ModelSelect', ModelSelect) app.component('ReadWrite', ReadWrite) + app.component('AutoTooltip', AutoTooltip) }, } diff --git a/ui/src/layout/components/breadcrumb/index.vue b/ui/src/layout/components/breadcrumb/index.vue index ea3638d98..e872a05c5 100644 --- a/ui/src/layout/components/breadcrumb/index.vue +++ b/ui/src/layout/components/breadcrumb/index.vue @@ -81,15 +81,15 @@ shape="square" :size="24" /> - - - + - - + + - + {{ item?.name }} diff --git a/ui/src/stores/index.ts b/ui/src/stores/index.ts index f9eb95186..5a05dfdce 100644 --- a/ui/src/stores/index.ts +++ b/ui/src/stores/index.ts @@ -5,6 +5,7 @@ import useFolderStore from './modules/folder' import useThemeStore from './modules/theme' import useKnowledgeStore from './modules/knowledge' import useModelStore from './modules/model' +import usePromptStore from './modules/prompt' const useStore = () => ({ common: useCommonStore(), @@ -14,6 +15,7 @@ const useStore = () => ({ theme: useThemeStore(), knowledge: useKnowledgeStore(), model: useModelStore(), + prompt: usePromptStore(), }) export default useStore diff --git a/ui/src/stores/modules/prompt.ts b/ui/src/stores/modules/prompt.ts new file mode 100644 index 000000000..022a250a7 --- /dev/null +++ b/ui/src/stores/modules/prompt.ts @@ -0,0 +1,37 @@ +import { defineStore } from 'pinia' +import { t } from '@/locales' +export interface promptTypes { + user: string + formValue: { model_id: string; prompt: string } +} + +const usePromptStore = defineStore('prompt', { + state: (): promptTypes[] => JSON.parse(localStorage.getItem('PROMPT_CACHE') || '[]'), + actions: { + save(user: string, formValue: any) { + this.$state.forEach((item: any, index: number) => { + if (item.user === user) { + this.$state.splice(index, 1) + } + }) + this.$state.push({ user, formValue }) + localStorage.setItem('PROMPT_CACHE', JSON.stringify(this.$state)) + }, + get(user: string) { + for (let i = 0; i < this.$state.length; i++) { + if (this.$state[i].user === user) { + return this.$state[i].formValue + } + } + return { + model_id: '', + prompt: + t('views.document.generateQuestion.prompt1', { data: '{data}' }) + + '' + + t('views.document.generateQuestion.prompt2'), + } + }, + }, +}) + +export default usePromptStore diff --git a/ui/src/views/application-overview/component/EditAvatarDialog.vue b/ui/src/views/application-overview/component/EditAvatarDialog.vue index 978a8ba2a..35565f31b 100644 --- a/ui/src/views/application-overview/component/EditAvatarDialog.vue +++ b/ui/src/views/application-overview/component/EditAvatarDialog.vue @@ -9,7 +9,7 @@

{{ $t('views.applicationOverview.appInfo.EditAvatarDialog.default') }}

-

{{ $t('views.applicationOverview.appInfo.EditAvatarDialog.customizeUpload') }}

- - +
- - - +

- {{ detail?.name || $t('views.application.applicationForm.form.appName.label') }} + {{ detail?.name || $t('views.application.form.appName.label') }}

@@ -133,9 +133,9 @@ fit="cover" style="width: 28px; height: 28px; display: block" /> - + - +
diff --git a/ui/src/views/application-overview/index.vue b/ui/src/views/application-overview/index.vue index 5eb43925a..ed704e5be 100644 --- a/ui/src/views/application-overview/index.vue +++ b/ui/src/views/application-overview/index.vue @@ -12,22 +12,22 @@ @mouseenter="showEditIcon = true" @mouseleave="showEditIcon = false" > - - - + - - +

{{ detail?.name }}

diff --git a/ui/src/views/application-workflow/component/PublishHistory.vue b/ui/src/views/application-workflow/component/PublishHistory.vue index 3fc7748e3..2f82054bb 100644 --- a/ui/src/views/application-workflow/component/PublishHistory.vue +++ b/ui/src/views/application-workflow/component/PublishHistory.vue @@ -28,9 +28,9 @@ }} - + - + {{ row.publish_user_name }} diff --git a/ui/src/views/application-workflow/index.vue b/ui/src/views/application-workflow/index.vue index 157aabfc7..b2a15519c 100644 --- a/ui/src/views/application-workflow/index.vue +++ b/ui/src/views/application-workflow/index.vue @@ -84,15 +84,15 @@
- - - +

- {{ detail?.name || $t('views.application.applicationForm.form.appName.label') }} + {{ detail?.name || $t('views.application.form.appName.label') }}

diff --git a/ui/src/views/application/ApplicationSetting.vue b/ui/src/views/application/ApplicationSetting.vue index 2c6d0e7ef..c09047f19 100644 --- a/ui/src/views/application/ApplicationSetting.vue +++ b/ui/src/views/application/ApplicationSetting.vue @@ -33,7 +33,7 @@