From a0eb57c21a4566043838dc35d9f200e2c0125048 Mon Sep 17 00:00:00 2001 From: Germey Date: Sat, 19 Jul 2025 19:19:29 +0800 Subject: [PATCH] Refine video ui (#229) Co-authored-by: AceDataCloud --- ...-ac420385-68e7-48c2-a2ed-e5f8f5b07be7.json | 7 + src/assets/scss/_common.scss | 4 + src/components/common/Navigator.vue | 4 +- src/components/common/NoTasks.vue | 19 ++ .../{kling => common}/VideoPlayer.vue | 19 +- src/components/flux/RecentPanel.vue | 34 +-- src/components/flux/task/Preview.vue | 21 +- src/components/hailuo/ConfigPanel.vue | 2 +- src/components/hailuo/DetailPanel.vue | 23 -- src/components/hailuo/OperationPanel.vue | 77 ------ src/components/hailuo/VideoPlayer.vue | 40 ---- .../hailuo/config/StartImageUrlInput.vue | 1 - src/components/hailuo/task/Preview.vue | 204 +++------------- src/components/kling/DetailPanel.vue | 23 -- src/components/kling/OperationPanel.vue | 77 ------ src/components/kling/RecentPanel.vue | 116 +-------- src/components/kling/config/EndImage.vue | 1 + src/components/kling/config/RatioSelector.vue | 3 +- src/components/kling/config/StartImage.vue | 1 + src/components/kling/task/Preview.vue | 80 ++----- src/components/midjourney/tasks/TaskList.vue | 7 +- ... 12bbf7ffa7fa83f53df0601dd849b5ec10dac0d5} | 0 ... 1cac01f1bb5cb4542847ae6ce6cd8bdb0da934e3} | 0 ... 1cf23631896388a6f5fc18c78057b4cb3e3edd71} | 0 ... 2407905331f9af94dfccc2f8e3385ed468109196} | 0 ... 240d8e6b418a5241a727a756a9d5b1ea6f5827a0} | 0 ... 33b1bf27c3b696a73fdb7114ad66fa9341e896b4} | 0 ... 35ab59b749c97a36fa42f3708c900dff3f5b68a9} | 0 ... 3dba68a1b0191771f3d2e4ae9cf2181dbc1c42b0} | 0 ... 3fb00a39a57a6f0c1afff55915facc3b95e73d2f} | 0 ... 4563aa859b50c18a6dc4c7a62aef15988ebf9412} | 0 ... 523d1c9e5687ec8611cd44b8983d877f0f56d57a} | 0 ... 539895854abc303a38ed1d172c668e1def53e533} | 0 ... 60054856763ea5f03350988f70e0f3c11ff45d52} | 0 ... 6594b1f34e368e36f7a4a0a564aa195b85c5845c} | 0 ... 67f4f677eb7339845ff51ab31b52064b9db2debc} | 0 ... 7ea466f4f74fcaf31c169c4774af383557f48600} | 0 ... 8d7c65f0aad9646079056a42d5454b7d8efb6de3} | 0 ... 91895d812358325a9162158b84708641de1cdec3} | 0 ... 92350994e1ef47bd0e83f7da135ad78e4ab2662f} | 0 ... 958ebf0bccd46c8dfd874265fa71d213d130e433} | 0 ... 98ec5fb115f5043ed9ab320e65192d6920d7d5cf} | 0 ... 9b2720742677507b1fa5fb9c52f9249a4fd964c9} | 0 ... a4cb1c8922bcccd5be34352ac5f672f6f0dd0835} | 0 ... abf6be6c247b605af0433d30d269783b344aad9b} | 0 .../ae67ec879cc75c1975d867d826c758f10f937576 | 0 .../b2b3ce795530ab866482ec804f108dd71d0310bf | 0 .../b98db8f6de44e67a60b590a46e699ce6ce6f0e24 | 0 .../ba26ba472a0e0c9f90016aabaab7e8ca5b2daae3 | 0 ... ba9a4ce94c47d016b5bbafdaa541cad72a98aa4e} | 0 .../ba9aab87c2cd2da3e5bf66d0232d7f22f2e76c33 | 0 ... be90802cb33f91c4f4b774b80f80a4ca8136099b} | 0 ... c2a6c2156974e2951bfeb57cbf53f10a449fb5f7} | 0 ... cceb3b563e20bb0cf39519882169e337de03bd52} | 0 ... ce0d5cc13c984022d7736f705674677c863a9ee2} | 0 ... d37ef8cbc56c40432bcd35821a7dd8127ab01b39} | 0 .../d463b73cba1b6c6d8f7d89831e95896a12d68336 | 0 .../d637bab92336f197c97d84add193ed97175dfb5a | 0 ... da0130505c649e4591c396f3cf98ff136941c46d} | 0 .../daf955bc7cc5133ede010e869518aef529284ccc | 0 .../deb27991c3066662a0805a4782be1c3201c53c0f | 0 .../e5a5872154bf439bc03d8d1253297b314f5dea8b | 0 .../ea2df235927ddb5401660b0c404948495b9e3799 | 0 .../f1a91b94cd8308b4e3c5bfabc932d36f83cdb0ff | 0 .../f1c7edd539488af928068922e5379011bc34b08e | 0 .../f6f5542db9a54103b795f81a4890c2d1dd63abad | 0 ... f72742ce237c029ddcec262fb938169da0d8e8db} | 0 .../fa2df4f8ea528fb9ec239bfc070dff9db175ba2d | 0 .../fbc1be1016bbce95978c548e10055e50ed400136 | 0 ... fcbdec861138fdba8131d6901f99b33eeb8464ac} | 0 .../fd7428405e4ae02d95fc37cba47935b938de2cff | 0 .../fd954bcc0fcd01b9d286a0eb4adc995872d914fa | 0 src/i18n/ar/common.json | 38 ++- src/i18n/ar/hailuo.json | 96 ++++---- src/i18n/de/common.json | 62 +++-- src/i18n/de/hailuo.json | 154 ++++++------ src/i18n/el/hailuo.json | 150 ++++++------ src/i18n/en/common.json | 70 +++--- src/i18n/en/hailuo.json | 50 ++-- src/i18n/es/common.json | 194 ++++++++------- src/i18n/es/hailuo.json | 66 +++--- src/i18n/fi/common.json | 148 ++++++------ src/i18n/fi/hailuo.json | 126 +++++----- src/i18n/fr/common.json | 50 ++-- src/i18n/fr/hailuo.json | 168 ++----------- src/i18n/it/common.json | 60 +++-- src/i18n/it/hailuo.json | 102 ++++---- src/i18n/ja/common.json | 138 ++++++----- src/i18n/ja/hailuo.json | 130 +++++------ src/i18n/ko/common.json | 34 ++- src/i18n/ko/hailuo.json | 70 +++--- src/i18n/pl/common.json | 62 +++-- src/i18n/pl/hailuo.json | 120 +++++----- src/i18n/pt/common.json | 74 +++--- src/i18n/pt/hailuo.json | 84 +++---- src/i18n/ru/common.json | 112 +++++---- src/i18n/ru/hailuo.json | 104 ++++----- src/i18n/sr/common.json | 162 +++++++------ src/i18n/sr/hailuo.json | 122 +++++----- src/i18n/sv/common.json | 68 +++--- src/i18n/sv/hailuo.json | 102 ++++---- src/i18n/uk/common.json | 100 ++++---- src/i18n/uk/hailuo.json | 98 ++++---- src/i18n/zh-CN/hailuo.json | 2 +- src/i18n/zh-TW/common.json | 4 - src/i18n/zh-TW/hailuo.json | 220 +++++++++--------- src/layouts/Main.vue | 24 +- src/pages/flux/Index.vue | 16 -- src/pages/hailuo/Index.vue | 66 +----- src/pages/kling/Index.vue | 67 +----- src/pages/midjourney/Index.vue | 16 -- src/store/hailuo/persist.ts | 2 +- src/store/kling/persist.ts | 2 +- 113 files changed, 1740 insertions(+), 2556 deletions(-) create mode 100644 change/@acedatacloud-nexior-ac420385-68e7-48c2-a2ed-e5f8f5b07be7.json create mode 100644 src/components/common/NoTasks.vue rename src/components/{kling => common}/VideoPlayer.vue (70%) delete mode 100644 src/components/hailuo/DetailPanel.vue delete mode 100644 src/components/hailuo/OperationPanel.vue delete mode 100644 src/components/hailuo/VideoPlayer.vue delete mode 100644 src/components/kling/DetailPanel.vue delete mode 100644 src/components/kling/OperationPanel.vue rename src/i18n/.cache/{0242b2e4db24de9200b4453bbe7c3973e5174895 => 12bbf7ffa7fa83f53df0601dd849b5ec10dac0d5} (100%) rename src/i18n/.cache/{047cb4c6d73572504bc045b21589576d864cfacd => 1cac01f1bb5cb4542847ae6ce6cd8bdb0da934e3} (100%) rename src/i18n/.cache/{0a35cc2fae6da6cd5be7775176a7df8f541da900 => 1cf23631896388a6f5fc18c78057b4cb3e3edd71} (100%) rename src/i18n/.cache/{10ab8b7cbf76dfc2ea0152d02c9436cb88f17b98 => 2407905331f9af94dfccc2f8e3385ed468109196} (100%) rename src/i18n/.cache/{12e394f2e14d3f3b0cc47ba5fcac77ec10f7dd4d => 240d8e6b418a5241a727a756a9d5b1ea6f5827a0} (100%) rename src/i18n/.cache/{1d2d47f95cd728ccf621a01f0ee06af09125764a => 33b1bf27c3b696a73fdb7114ad66fa9341e896b4} (100%) rename src/i18n/.cache/{20051c0c12a48f640ef571eb60bd3b9c3d3b2ef3 => 35ab59b749c97a36fa42f3708c900dff3f5b68a9} (100%) rename src/i18n/.cache/{31f28ce1d3e7fb5135e35d64a8f38a8f2912a04d => 3dba68a1b0191771f3d2e4ae9cf2181dbc1c42b0} (100%) rename src/i18n/.cache/{322250b237d5e0e9f28977dce7b2fb144fad5cdf => 3fb00a39a57a6f0c1afff55915facc3b95e73d2f} (100%) rename src/i18n/.cache/{33485984031bc11fd88f0534409721c751a2cf05 => 4563aa859b50c18a6dc4c7a62aef15988ebf9412} (100%) rename src/i18n/.cache/{3df0b14b41314a855f511992f6fb18e310fe921e => 523d1c9e5687ec8611cd44b8983d877f0f56d57a} (100%) rename src/i18n/.cache/{3e9f1e48a73a7044bdd3f0650f17f245a7bacfa2 => 539895854abc303a38ed1d172c668e1def53e533} (100%) rename src/i18n/.cache/{3f8a38f25f6866336eed3e6f382fb582619c2528 => 60054856763ea5f03350988f70e0f3c11ff45d52} (100%) rename src/i18n/.cache/{46f6d53d90a5f15a9edca513289831d4b7e87c46 => 6594b1f34e368e36f7a4a0a564aa195b85c5845c} (100%) rename src/i18n/.cache/{4894721e70be1bd06b16137ee2aa54becf38b377 => 67f4f677eb7339845ff51ab31b52064b9db2debc} (100%) rename src/i18n/.cache/{4a03e0245034e18f73129b6201ed5d5e22610749 => 7ea466f4f74fcaf31c169c4774af383557f48600} (100%) rename src/i18n/.cache/{5177a2310a79ad0d654c2525b0c04c7d5c7c0c32 => 8d7c65f0aad9646079056a42d5454b7d8efb6de3} (100%) rename src/i18n/.cache/{52b331c7bf70c872eb0fabb1d0ddca1436b627cf => 91895d812358325a9162158b84708641de1cdec3} (100%) rename src/i18n/.cache/{5a8a6effab2e994af09af0647a915128eb6c8330 => 92350994e1ef47bd0e83f7da135ad78e4ab2662f} (100%) rename src/i18n/.cache/{5adef8418e3a026422052dad2f9941b31aa83273 => 958ebf0bccd46c8dfd874265fa71d213d130e433} (100%) rename src/i18n/.cache/{5ba94789194bc740dadb5a38f188c0f66cde6609 => 98ec5fb115f5043ed9ab320e65192d6920d7d5cf} (100%) rename src/i18n/.cache/{600517774ecbe6c6db3a4f6086ad8e1618060e9b => 9b2720742677507b1fa5fb9c52f9249a4fd964c9} (100%) rename src/i18n/.cache/{625a0b832bd30c5b0938b986cd42818e65ed66c6 => a4cb1c8922bcccd5be34352ac5f672f6f0dd0835} (100%) rename src/i18n/.cache/{6882228e1494a99a867eb79793b7b8b4e91d33f3 => abf6be6c247b605af0433d30d269783b344aad9b} (100%) delete mode 100644 src/i18n/.cache/ae67ec879cc75c1975d867d826c758f10f937576 delete mode 100644 src/i18n/.cache/b2b3ce795530ab866482ec804f108dd71d0310bf delete mode 100644 src/i18n/.cache/b98db8f6de44e67a60b590a46e699ce6ce6f0e24 delete mode 100644 src/i18n/.cache/ba26ba472a0e0c9f90016aabaab7e8ca5b2daae3 rename src/i18n/.cache/{6990071af41451d4148fc1af9af4e404d023b43f => ba9a4ce94c47d016b5bbafdaa541cad72a98aa4e} (100%) delete mode 100644 src/i18n/.cache/ba9aab87c2cd2da3e5bf66d0232d7f22f2e76c33 rename src/i18n/.cache/{69e2241019fc8d5a21fbd8c96514f0c04d824b74 => be90802cb33f91c4f4b774b80f80a4ca8136099b} (100%) rename src/i18n/.cache/{74df94740f3dd48426e0bf296241a328179d4f41 => c2a6c2156974e2951bfeb57cbf53f10a449fb5f7} (100%) rename src/i18n/.cache/{8a41db19e1c7f129dd1bd966e83e43cd07ee8659 => cceb3b563e20bb0cf39519882169e337de03bd52} (100%) rename src/i18n/.cache/{8e0500175b52fe62b44ea6e8f3c20812cd44c3f4 => ce0d5cc13c984022d7736f705674677c863a9ee2} (100%) rename src/i18n/.cache/{94b3dcee49896baead24e16589d4ffb32a276f36 => d37ef8cbc56c40432bcd35821a7dd8127ab01b39} (100%) delete mode 100644 src/i18n/.cache/d463b73cba1b6c6d8f7d89831e95896a12d68336 delete mode 100644 src/i18n/.cache/d637bab92336f197c97d84add193ed97175dfb5a rename src/i18n/.cache/{9592f02344446c017c804bb16a733fbe06abf287 => da0130505c649e4591c396f3cf98ff136941c46d} (100%) delete mode 100644 src/i18n/.cache/daf955bc7cc5133ede010e869518aef529284ccc delete mode 100644 src/i18n/.cache/deb27991c3066662a0805a4782be1c3201c53c0f delete mode 100644 src/i18n/.cache/e5a5872154bf439bc03d8d1253297b314f5dea8b delete mode 100644 src/i18n/.cache/ea2df235927ddb5401660b0c404948495b9e3799 delete mode 100644 src/i18n/.cache/f1a91b94cd8308b4e3c5bfabc932d36f83cdb0ff delete mode 100644 src/i18n/.cache/f1c7edd539488af928068922e5379011bc34b08e delete mode 100644 src/i18n/.cache/f6f5542db9a54103b795f81a4890c2d1dd63abad rename src/i18n/.cache/{ab51b2c6ca9ddf6476d838545d6aeb2e60ad6919 => f72742ce237c029ddcec262fb938169da0d8e8db} (100%) delete mode 100644 src/i18n/.cache/fa2df4f8ea528fb9ec239bfc070dff9db175ba2d delete mode 100644 src/i18n/.cache/fbc1be1016bbce95978c548e10055e50ed400136 rename src/i18n/.cache/{ae28cfc567316213b193dc0a1807d5b8118d9180 => fcbdec861138fdba8131d6901f99b33eeb8464ac} (100%) delete mode 100644 src/i18n/.cache/fd7428405e4ae02d95fc37cba47935b938de2cff delete mode 100644 src/i18n/.cache/fd954bcc0fcd01b9d286a0eb4adc995872d914fa diff --git a/change/@acedatacloud-nexior-ac420385-68e7-48c2-a2ed-e5f8f5b07be7.json b/change/@acedatacloud-nexior-ac420385-68e7-48c2-a2ed-e5f8f5b07be7.json new file mode 100644 index 00000000..c3871fed --- /dev/null +++ b/change/@acedatacloud-nexior-ac420385-68e7-48c2-a2ed-e5f8f5b07be7.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "refine video ui", + "packageName": "@acedatacloud/nexior", + "email": "office@acedata.cloud", + "dependentChangeType": "patch" +} diff --git a/src/assets/scss/_common.scss b/src/assets/scss/_common.scss index 19908a72..754b7ab0 100644 --- a/src/assets/scss/_common.scss +++ b/src/assets/scss/_common.scss @@ -43,6 +43,10 @@ html.dark, color: var(--el-text-color-primary); } +.el-upload { + display: block; +} + .el-upload-list { margin: 0; padding: 0; diff --git a/src/components/common/Navigator.vue b/src/components/common/Navigator.vue index fdb87af1..7689639f 100644 --- a/src/components/common/Navigator.vue +++ b/src/components/common/Navigator.vue @@ -239,7 +239,7 @@ export default defineComponent({ &[direction='row'] { flex-direction: row; padding-top: 10px; - border-top: 1px solid var(--el-border-color-lighter); + border-top: 1px solid var(--el-border-color); .chevron, .logo { display: none; @@ -321,7 +321,7 @@ export default defineComponent({ height: 35px; border-radius: 50%; cursor: pointer; - border: 1px solid var(--el-border-color); + border: 1px solid var(--el-border-color-lighter); } } } diff --git a/src/components/common/NoTasks.vue b/src/components/common/NoTasks.vue new file mode 100644 index 00000000..8a09eae6 --- /dev/null +++ b/src/components/common/NoTasks.vue @@ -0,0 +1,19 @@ + + + + + diff --git a/src/components/kling/VideoPlayer.vue b/src/components/common/VideoPlayer.vue similarity index 70% rename from src/components/kling/VideoPlayer.vue rename to src/components/common/VideoPlayer.vue index 45b2fa73..6780dadc 100644 --- a/src/components/kling/VideoPlayer.vue +++ b/src/components/common/VideoPlayer.vue @@ -1,7 +1,7 @@ - - diff --git a/src/components/hailuo/OperationPanel.vue b/src/components/hailuo/OperationPanel.vue deleted file mode 100644 index 17976db3..00000000 --- a/src/components/hailuo/OperationPanel.vue +++ /dev/null @@ -1,77 +0,0 @@ - - - - - diff --git a/src/components/hailuo/VideoPlayer.vue b/src/components/hailuo/VideoPlayer.vue deleted file mode 100644 index 416f9a53..00000000 --- a/src/components/hailuo/VideoPlayer.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - - - diff --git a/src/components/hailuo/config/StartImageUrlInput.vue b/src/components/hailuo/config/StartImageUrlInput.vue index 87ff9e38..80a64c4e 100644 --- a/src/components/hailuo/config/StartImageUrlInput.vue +++ b/src/components/hailuo/config/StartImageUrlInput.vue @@ -10,7 +10,6 @@ v-model:file-list="fileList" accept=".png,.jpg,.jpeg,.gif,.bmp,.webp" name="file" - class="upload-wrapper" :show-file-list="true" :limit="1" :multiple="false" diff --git a/src/components/hailuo/task/Preview.vue b/src/components/hailuo/task/Preview.vue index a10df2a1..faf5a0a6 100644 --- a/src/components/hailuo/task/Preview.vue +++ b/src/components/hailuo/task/Preview.vue @@ -1,5 +1,5 @@ -

+

{{ $t('hailuo.name.taskId') }}: {{ modelValue?.id }} - +

-

+

{{ $t('hailuo.name.failureReason') }}: {{ modelValue?.response?.error?.message }} - +

-

+

{{ $t('hailuo.name.traceId') }}: {{ modelValue?.response?.trace_id }} - +

-
+
-

+

{{ $t('hailuo.name.taskId') }}: {{ modelValue?.id }} - +

@@ -102,10 +106,11 @@ diff --git a/src/components/kling/OperationPanel.vue b/src/components/kling/OperationPanel.vue deleted file mode 100644 index 47d7a73c..00000000 --- a/src/components/kling/OperationPanel.vue +++ /dev/null @@ -1,77 +0,0 @@ - - - - - diff --git a/src/components/kling/RecentPanel.vue b/src/components/kling/RecentPanel.vue index 006511f7..7898b503 100644 --- a/src/components/kling/RecentPanel.vue +++ b/src/components/kling/RecentPanel.vue @@ -1,46 +1,27 @@ - - diff --git a/src/components/kling/config/EndImage.vue b/src/components/kling/config/EndImage.vue index e6a5b03b..0f892938 100644 --- a/src/components/kling/config/EndImage.vue +++ b/src/components/kling/config/EndImage.vue @@ -9,6 +9,7 @@ {{ $t('kling.name.klingBot') }} - {{ $dayjs.format('' + new Date(parseFloat(modelValue?.created_at || '') * 1000)) }} + {{ $dayjs.format('' + new Date(parseFloat((modelValue?.created_at || '').toString()) * 1000)) }}
@@ -28,12 +28,13 @@
-
- +
+
-

+

+ + {{ $t('kling.name.model') }}: + {{ modelValue?.request?.model }} +

+

{{ $t('kling.name.taskId') }}: {{ modelValue?.id }} - +

@@ -59,51 +65,44 @@ {{ $t('kling.name.failure') }} -

+

{{ $t('kling.name.taskId') }}: {{ modelValue?.id }} - +

-

+

{{ $t('kling.name.failureReason') }}: {{ modelValue?.response?.error?.message }} - +

-

+

{{ $t('kling.name.traceId') }}: {{ modelValue?.response?.trace_id }} - +

-
+
-

+

{{ $t('kling.name.taskId') }}: {{ modelValue?.id }} - +

-

+

{{ $t('kling.name.traceId') }}: {{ modelValue?.response?.trace_id }} - +

@@ -117,7 +116,8 @@ import { ElImage, ElAlert, ElButton, ElTooltip } from 'element-plus'; import { IKlingTask } from '@/models'; import CopyToClipboard from '@/components/common/CopyToClipboard.vue'; import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; -import VideoPlayer from '../VideoPlayer.vue'; +import VideoPlayer from '@/components/common/VideoPlayer.vue'; + export default defineComponent({ name: 'TaskPreview', components: { @@ -147,44 +147,12 @@ export default defineComponent({ } }, methods: { - // onExtend(event: MouseEvent, response: IKlingGenerateResponse) { - // event.stopPropagation(); - // // extend url here - // console.debug('set config', response); - // this.$store.commit('kling/setConfig', { - // ...this.$store.state.kling?.config, - // video_id: response.video_id, - // prompt: response.prompt, - // action: 'extend', - // thumbnail_url: response.thumbnail_url, - // video_url: response.video_url - // }); - // }, onDownload(event: MouseEvent, video_url: string) { event.stopPropagation(); console.log('on download'); // download url here window.open(video_url, '_blank'); }, - onReload(event: Event) { - const target = event.target as HTMLImageElement; - // append a random url query to existing url query, to force reload the image - // extract exiting url query - const url = new URL(target.src); - // extract `retry` query - const retry = url.searchParams.get('retry'); - if (!retry) { - // if no retry query, set it as random string - url.searchParams.set('retry', '1'); - } else if (parseInt(retry) < 2) { - // if retry < 3, increase it by 1 - url.searchParams.set('retry', (parseInt(retry) + 1).toString()); - } else { - return; - } - // set the new url - target.src = url.toString(); - }, onOpenVideo(url: string) { window.open(url, '_blank'); } diff --git a/src/components/midjourney/tasks/TaskList.vue b/src/components/midjourney/tasks/TaskList.vue index 3e0dbe3b..b6979005 100644 --- a/src/components/midjourney/tasks/TaskList.vue +++ b/src/components/midjourney/tasks/TaskList.vue @@ -3,7 +3,7 @@
-

{{ $t('midjourney.message.noTasks') }}

+
@@ -15,14 +15,15 @@ diff --git a/src/pages/flux/Index.vue b/src/pages/flux/Index.vue index 5d0f5206..fb9287cd 100644 --- a/src/pages/flux/Index.vue +++ b/src/pages/flux/Index.vue @@ -105,22 +105,6 @@ export default defineComponent({ console.debug('end onGetApplication'); await this.onGetTasks(); }, - onApply() { - applicationOperator - .create({ - // @ts-ignore - application: this.application - }) - .then(({ data: data }: { data: IApplicationDetailResponse }) => { - this.application = data; - ElMessage.success(this.$t('application.message.applySuccessfully')); - }) - .catch((error) => { - if (error?.response?.data?.code === ERROR_CODE_DUPLICATION) { - ElMessage.error(this.$t('application.message.alreadyApplied')); - } - }); - }, async onScrollDown() { setTimeout(() => { // scroll to bottom for `.tasks` diff --git a/src/pages/hailuo/Index.vue b/src/pages/hailuo/Index.vue index 5b5b7b57..b5fa90dc 100644 --- a/src/pages/hailuo/Index.vue +++ b/src/pages/hailuo/Index.vue @@ -4,7 +4,7 @@ @@ -13,10 +13,10 @@ import { defineComponent } from 'vue'; import Layout from '@/layouts/Hailuo.vue'; import ConfigPanel from '@/components/hailuo/ConfigPanel.vue'; -import { applicationOperator, hailuoOperator } from '@/operators'; -import { IApplicationDetailResponse, IHailuoGenerateRequest, Status } from '@/models'; +import { hailuoOperator } from '@/operators'; +import { IHailuoGenerateRequest, Status } from '@/models'; import { ElMessage } from 'element-plus'; -import { ERROR_CODE_DUPLICATION, ERROR_CODE_USED_UP } from '@/constants'; +import { ERROR_CODE_USED_UP } from '@/constants'; import RecentPanel from '@/components/hailuo/RecentPanel.vue'; import { IHailuoTask } from '@/models'; @@ -47,27 +47,15 @@ export default defineComponent({ loading() { return this.$store.state.hailuo?.status?.getApplications === Status.Request; }, - service() { - return this.$store.state.hailuo.service; - }, credential() { return this.$store.state.hailuo.credential; }, config() { return this.$store.state.hailuo.config; }, - initializing() { - return this.$store.state.hailuo.status.getApplications === Status.Request; - }, - needApply() { - return this.$store.state.hailuo.status.getApplications === Status.Success && !this.application; - }, application() { return this.$store.state.hailuo.application; }, - applications() { - return this.$store.state.hailuo.applications; - }, tasks() { return this.$store.state.hailuo.tasks; } @@ -117,26 +105,9 @@ export default defineComponent({ console.debug('end onGetApplication'); await this.onGetTasks(); }, - onApply() { - applicationOperator - .create({ - // @ts-ignore - application: this.application - }) - .then(({ data: data }: { data: IApplicationDetailResponse }) => { - this.application = data; - ElMessage.success(this.$t('application.message.applySuccessfully')); - }) - .catch((error) => { - if (error?.response?.data?.code === ERROR_CODE_DUPLICATION) { - ElMessage.error(this.$t('application.message.alreadyApplied')); - } - }); - }, async onScrollDown() { setTimeout(() => { - // scroll to bottom for `.recent` - const el = document.querySelector('.recent'); + const el = document.querySelector('.tasks'); if (el) { el.scrollTop = el.scrollHeight; } @@ -173,9 +144,6 @@ export default defineComponent({ }) .then(() => { ElMessage.success(this.$t('hailuo.message.startTaskSuccess')); - this.$store.commit('hailuo/setConfig', { - config: undefined - }); }) .catch((error) => { const response = error?.response?.data; @@ -195,27 +163,3 @@ export default defineComponent({ } }); - - diff --git a/src/pages/kling/Index.vue b/src/pages/kling/Index.vue index 6c5f29f1..1fdbc5a0 100644 --- a/src/pages/kling/Index.vue +++ b/src/pages/kling/Index.vue @@ -4,7 +4,7 @@ @@ -13,8 +13,8 @@ import { defineComponent } from 'vue'; import Layout from '@/layouts/Kling.vue'; import ConfigPanel from '@/components/kling/ConfigPanel.vue'; -import { applicationOperator, klingOperator } from '@/operators'; -import { IApplicationDetailResponse, IKlingGenerateRequest, Status } from '@/models'; +import { klingOperator } from '@/operators'; +import { IKlingGenerateRequest, Status } from '@/models'; import { ElMessage } from 'element-plus'; import { ERROR_CODE_DUPLICATION, ERROR_CODE_USED_UP } from '@/constants'; import RecentPanel from '@/components/kling/RecentPanel.vue'; @@ -47,27 +47,12 @@ export default defineComponent({ loading() { return this.$store.state.kling?.status?.getApplications === Status.Request; }, - service() { - return this.$store.state.kling.service; - }, credential() { return this.$store.state.kling.credential; }, config() { return this.$store.state.kling.config; }, - initializing() { - return this.$store.state.kling.status.getApplications === Status.Request; - }, - needApply() { - return this.$store.state.kling.status.getApplications === Status.Success && !this.application; - }, - application() { - return this.$store.state.kling.application; - }, - applications() { - return this.$store.state.kling.applications; - }, tasks() { return this.$store.state.kling.tasks; } @@ -117,26 +102,9 @@ export default defineComponent({ console.debug('end onGetApplication'); await this.onGetTasks(); }, - onApply() { - applicationOperator - .create({ - // @ts-ignore - application: this.application - }) - .then(({ data: data }: { data: IApplicationDetailResponse }) => { - this.application = data; - ElMessage.success(this.$t('application.message.applySuccessfully')); - }) - .catch((error) => { - if (error?.response?.data?.code === ERROR_CODE_DUPLICATION) { - ElMessage.error(this.$t('application.message.alreadyApplied')); - } - }); - }, async onScrollDown() { setTimeout(() => { - // scroll to bottom for `.recent` - const el = document.querySelector('.recent'); + const el = document.querySelector('.tasks'); if (el) { el.scrollTop = el.scrollHeight; } @@ -173,9 +141,6 @@ export default defineComponent({ }) .then(() => { ElMessage.success(this.$t('kling.message.startTaskSuccess')); - this.$store.commit('kling/setConfig', { - config: undefined - }); }) .catch((error) => { const response = error?.response?.data; @@ -195,27 +160,3 @@ export default defineComponent({ } }); - - diff --git a/src/pages/midjourney/Index.vue b/src/pages/midjourney/Index.vue index 6cbd6baa..828bfb9d 100644 --- a/src/pages/midjourney/Index.vue +++ b/src/pages/midjourney/Index.vue @@ -197,22 +197,6 @@ export default defineComponent({ console.debug('end onGetApplications'); await this.onGetTasks(); }, - onApply() { - applicationOperator - .create({ - // @ts-ignore - application: this.application - }) - .then(({ data: data }: { data: IApplicationDetailResponse }) => { - this.application = data; - ElMessage.success(this.$t('application.message.applySuccessfully')); - }) - .catch((error) => { - if (error?.response?.data?.code === ERROR_CODE_DUPLICATION) { - ElMessage.error(this.$t('application.message.alreadyApplied')); - } - }); - }, async onStartTask(request: IMidjourneyImagineRequest) { const token = this.credential?.token; if (!token) { diff --git a/src/store/hailuo/persist.ts b/src/store/hailuo/persist.ts index e7bd0441..9ad2658e 100644 --- a/src/store/hailuo/persist.ts +++ b/src/store/hailuo/persist.ts @@ -1 +1 @@ -export default ['hailuo.credential', 'hailuo.application', 'hailuo.applications']; +export default ['hailuo.config', 'hailuo.credential', 'hailuo.application', 'hailuo.applications']; diff --git a/src/store/kling/persist.ts b/src/store/kling/persist.ts index 8d4e5ace..6c8b1d65 100644 --- a/src/store/kling/persist.ts +++ b/src/store/kling/persist.ts @@ -1 +1 @@ -export default ['kling.credential', 'kling.application', 'kling.applications']; +export default ['kling.config', 'kling.credential', 'kling.application', 'kling.applications'];