From 465159c7e5f355281e743576fc14ad4b7670dfd5 Mon Sep 17 00:00:00 2001 From: Germey Date: Sat, 19 Jul 2025 23:02:19 +0800 Subject: [PATCH] Update luma experience (#230) --- ...-9ea209d2-6e30-4fa7-83a7-7dc114e77547.json | 7 + package.json | 1 - src/components/common/VideoPlayer.vue | 7 +- src/components/flux/RecentPanel.vue | 2 +- src/components/flux/task/Preview.vue | 2 +- src/components/hailuo/RecentPanel.vue | 114 ++------------ src/components/hailuo/task/Preview.vue | 4 +- src/components/kling/task/Preview.vue | 4 +- src/components/luma/ConfigPanel.vue | 13 +- src/components/luma/OperationPanel.vue | 77 --------- src/components/luma/RecentPanel.vue | 114 ++------------ src/components/luma/VideoPlayer.vue | 40 ----- src/components/luma/config/CustomSelector.vue | 33 ++-- src/components/luma/config/EndImageInput.vue | 122 +++++++++++++++ .../luma/config/EndImageUrlInput.vue | 123 --------------- .../luma/config/EnhancementSelector.vue | 32 ++-- .../luma/config/ExtendFromInput.vue | 42 +---- src/components/luma/config/LoopSelector.vue | 33 ++-- .../luma/config/StartImageInput.vue | 122 +++++++++++++++ .../luma/config/StartImageUrlInput.vue | 127 --------------- src/components/luma/config/UploadVideo.vue | 91 ++++++----- src/components/luma/task/Preview.vue | 146 ++---------------- src/i18n/zh-CN/luma.json | 2 +- src/pages/kling/Index.vue | 2 +- src/pages/luma/Index.vue | 66 +------- src/pages/midjourney/Index.vue | 17 +- yarn.lock | 5 - 27 files changed, 404 insertions(+), 944 deletions(-) create mode 100644 change/@acedatacloud-nexior-9ea209d2-6e30-4fa7-83a7-7dc114e77547.json delete mode 100644 src/components/luma/OperationPanel.vue delete mode 100644 src/components/luma/VideoPlayer.vue create mode 100644 src/components/luma/config/EndImageInput.vue delete mode 100644 src/components/luma/config/EndImageUrlInput.vue create mode 100644 src/components/luma/config/StartImageInput.vue delete mode 100644 src/components/luma/config/StartImageUrlInput.vue diff --git a/change/@acedatacloud-nexior-9ea209d2-6e30-4fa7-83a7-7dc114e77547.json b/change/@acedatacloud-nexior-9ea209d2-6e30-4fa7-83a7-7dc114e77547.json new file mode 100644 index 00000000..e07328e4 --- /dev/null +++ b/change/@acedatacloud-nexior-9ea209d2-6e30-4fa7-83a7-7dc114e77547.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "fix luma style", + "packageName": "@acedatacloud/nexior", + "email": "cqc@cuiqingcai.com", + "dependentChangeType": "patch" +} diff --git a/package.json b/package.json index 762aa71e..52f1c8d6 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,6 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-promise": "^5.0.0", - "eslint-plugin-unused-imports": "^4.1.4", "eslint-plugin-vue": "^8.5.0", "husky": "^7.0.2", "postcss": "^8.4.32", diff --git a/src/components/common/VideoPlayer.vue b/src/components/common/VideoPlayer.vue index 6780dadc..55d1a155 100644 --- a/src/components/common/VideoPlayer.vue +++ b/src/components/common/VideoPlayer.vue @@ -2,7 +2,7 @@
@@ -13,15 +13,14 @@ import { defineComponent } from 'vue'; // @ts-ignore import VuePlyr from '@skjnldsv/vue-plyr'; // @ts-ignore -import { IKlingVideo } from '@/models'; import '@skjnldsv/vue-plyr/dist/vue-plyr.css'; export default defineComponent({ name: 'VideoPlayer', components: { VuePlyr }, props: { - modelValue: { - type: Object as () => IKlingVideo | undefined, + src: { + type: String, required: true } }, diff --git a/src/components/flux/RecentPanel.vue b/src/components/flux/RecentPanel.vue index 7fcec186..081099cc 100644 --- a/src/components/flux/RecentPanel.vue +++ b/src/components/flux/RecentPanel.vue @@ -2,7 +2,7 @@
-
+
diff --git a/src/components/flux/task/Preview.vue b/src/components/flux/task/Preview.vue index c3065b0a..a172d980 100644 --- a/src/components/flux/task/Preview.vue +++ b/src/components/flux/task/Preview.vue @@ -18,7 +18,7 @@
-
+
-
-
-
-
- - - -
-
- - - -
-
-
-
- -
-

- {{ $t('hailuo.message.noTasks') }} -

+
+ +
+
+ +
+
+
- - diff --git a/src/components/hailuo/task/Preview.vue b/src/components/hailuo/task/Preview.vue index faf5a0a6..135dc31e 100644 --- a/src/components/hailuo/task/Preview.vue +++ b/src/components/hailuo/task/Preview.vue @@ -21,8 +21,8 @@
-
- +
+
-
- +
+
diff --git a/src/components/luma/ConfigPanel.vue b/src/components/luma/ConfigPanel.vue index ed70c179..44996322 100644 --- a/src/components/luma/ConfigPanel.vue +++ b/src/components/luma/ConfigPanel.vue @@ -5,8 +5,8 @@ - - + +
@@ -36,18 +36,19 @@ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; import EnhancementSelector from './config/EnhancementSelector.vue'; import CustomSelector from './config/CustomSelector.vue'; import LoopSelector from './config/LoopSelector.vue'; -import EndImageUrlInput from './config/EndImageUrlInput.vue'; -import StartImageUrlInput from './config/StartImageUrlInput.vue'; +import EndImageInput from './config/EndImageInput.vue'; +import StartImageInput from './config/StartImageInput.vue'; // @ts-ignore import UploadVideo from './config/UploadVideo.vue'; import PromptInput from './config/PromptInput.vue'; import ExtendFromInput from './config/ExtendFromInput.vue'; + export default defineComponent({ name: 'PresetPanel', components: { LoopSelector, - StartImageUrlInput, - EndImageUrlInput, + StartImageInput, + EndImageInput, EnhancementSelector, ElButton, FontAwesomeIcon, diff --git a/src/components/luma/OperationPanel.vue b/src/components/luma/OperationPanel.vue deleted file mode 100644 index 66b8633a..00000000 --- a/src/components/luma/OperationPanel.vue +++ /dev/null @@ -1,77 +0,0 @@ - - - - - diff --git a/src/components/luma/RecentPanel.vue b/src/components/luma/RecentPanel.vue index b0a1ee1e..7b770b5d 100644 --- a/src/components/luma/RecentPanel.vue +++ b/src/components/luma/RecentPanel.vue @@ -1,44 +1,27 @@ - - diff --git a/src/components/luma/VideoPlayer.vue b/src/components/luma/VideoPlayer.vue deleted file mode 100644 index bad7c29c..00000000 --- a/src/components/luma/VideoPlayer.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - - - diff --git a/src/components/luma/config/CustomSelector.vue b/src/components/luma/config/CustomSelector.vue index f36dd427..53d2baaa 100644 --- a/src/components/luma/config/CustomSelector.vue +++ b/src/components/luma/config/CustomSelector.vue @@ -1,8 +1,14 @@ @@ -11,6 +17,7 @@ import { defineComponent } from 'vue'; import { ElSwitch } from 'element-plus'; import { LUMA_DEFAULT_CUSTOM } from '@/constants'; import InfoIcon from '@/components/common/InfoIcon.vue'; + export default defineComponent({ name: 'CustomSelector', components: { @@ -38,21 +45,3 @@ export default defineComponent({ } }); - - diff --git a/src/components/luma/config/EndImageInput.vue b/src/components/luma/config/EndImageInput.vue new file mode 100644 index 00000000..e4a89487 --- /dev/null +++ b/src/components/luma/config/EndImageInput.vue @@ -0,0 +1,122 @@ + + + + + diff --git a/src/components/luma/config/EndImageUrlInput.vue b/src/components/luma/config/EndImageUrlInput.vue deleted file mode 100644 index 5406849d..00000000 --- a/src/components/luma/config/EndImageUrlInput.vue +++ /dev/null @@ -1,123 +0,0 @@ - - - - - diff --git a/src/components/luma/config/EnhancementSelector.vue b/src/components/luma/config/EnhancementSelector.vue index 04463d03..9424f133 100644 --- a/src/components/luma/config/EnhancementSelector.vue +++ b/src/components/luma/config/EnhancementSelector.vue @@ -1,8 +1,14 @@ @@ -38,21 +44,3 @@ export default defineComponent({ } }); - - diff --git a/src/components/luma/config/ExtendFromInput.vue b/src/components/luma/config/ExtendFromInput.vue index efd23b7e..f9f5998e 100644 --- a/src/components/luma/config/ExtendFromInput.vue +++ b/src/components/luma/config/ExtendFromInput.vue @@ -1,16 +1,10 @@ @@ -18,14 +12,12 @@ - - diff --git a/src/components/luma/config/LoopSelector.vue b/src/components/luma/config/LoopSelector.vue index bb6a01ac..4c03348f 100644 --- a/src/components/luma/config/LoopSelector.vue +++ b/src/components/luma/config/LoopSelector.vue @@ -1,8 +1,14 @@ @@ -11,6 +17,7 @@ import { defineComponent } from 'vue'; import { ElSwitch } from 'element-plus'; import { LUMA_DEFAULT_LOOP } from '@/constants'; import InfoIcon from '@/components/common/InfoIcon.vue'; + export default defineComponent({ name: 'LoopSelector', components: { @@ -38,21 +45,3 @@ export default defineComponent({ } }); - - diff --git a/src/components/luma/config/StartImageInput.vue b/src/components/luma/config/StartImageInput.vue new file mode 100644 index 00000000..575ad963 --- /dev/null +++ b/src/components/luma/config/StartImageInput.vue @@ -0,0 +1,122 @@ + + + + + diff --git a/src/components/luma/config/StartImageUrlInput.vue b/src/components/luma/config/StartImageUrlInput.vue deleted file mode 100644 index c76f9256..00000000 --- a/src/components/luma/config/StartImageUrlInput.vue +++ /dev/null @@ -1,127 +0,0 @@ - - - - - diff --git a/src/components/luma/config/UploadVideo.vue b/src/components/luma/config/UploadVideo.vue index a3130e98..d4832ad6 100644 --- a/src/components/luma/config/UploadVideo.vue +++ b/src/components/luma/config/UploadVideo.vue @@ -1,26 +1,39 @@ @@ -29,6 +42,9 @@ import { defineComponent } from 'vue'; import { ElButton, ElUpload, ElMessage, UploadFiles } from 'element-plus'; import { getBaseUrlPlatform } from '@/utils'; import InfoIcon from '@/components/common/InfoIcon.vue'; +import FilePreview from '@/components/common/FilePreview.vue'; +import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; + export const DEFAULT_CONTENT = ''; interface IData { @@ -41,7 +57,9 @@ export default defineComponent({ components: { ElUpload, ElButton, - InfoIcon + InfoIcon, + FilePreview, + FontAwesomeIcon }, data(): IData { return { @@ -115,25 +133,14 @@ export default defineComponent({ diff --git a/src/components/luma/task/Preview.vue b/src/components/luma/task/Preview.vue index b6892e69..95081039 100644 --- a/src/components/luma/task/Preview.vue +++ b/src/components/luma/task/Preview.vue @@ -7,7 +7,7 @@
{{ $t('luma.name.lumaBot') }} - {{ $dayjs.format('' + new Date(parseFloat(modelValue?.created_at || '') * 1000)) }} + {{ $dayjs.format('' + new Date(parseFloat((modelValue?.created_at || '').toString()) * 1000)) }}
@@ -21,12 +21,12 @@
-
- +
+
-
+
- + {{ $t('luma.button.extend') }} @@ -35,18 +35,18 @@ type="info" size="small" class="btn-action" - @click="onDownload($event, modelValue?.response?.video_url)" + @click.stop="onDownload($event, modelValue?.response?.video_url)" > {{ $t('luma.button.download') }}
-

+

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

@@ -60,23 +60,23 @@ {{ $t('luma.name.failure') }} -

+

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

-

+

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

-

+

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

@@ -98,7 +98,7 @@ {{ $t('luma.name.taskId') }}: {{ modelValue?.id }} - +

@@ -112,7 +112,8 @@ import { ElImage, ElAlert, ElButton, ElTooltip } from 'element-plus'; import { ILumaTask, ILumaGenerateResponse } 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: { @@ -143,7 +144,6 @@ export default defineComponent({ }, methods: { onExtend(event: MouseEvent, response: ILumaGenerateResponse) { - event.stopPropagation(); // extend url here console.debug('set config', response); this.$store.commit('luma/setConfig', { @@ -156,32 +156,8 @@ export default defineComponent({ }); }, 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'); } } }); @@ -251,94 +227,6 @@ $left-width: 70px; } } } - - .image-wrapper { - position: relative; - width: fit-content; - min-height: 50px; - min-width: 100px; - .image { - max-height: 400px; - max-width: 500px; - display: block; - width: fit-content; - } - .btn-raw { - position: absolute; - left: 50%; - top: 50%; - transform: translate(-50%, -50%); - z-index: 1000; - display: none; - } - .play-icon { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - font-size: 48px; - color: white; - z-index: 500; - pointer-events: none; /* Ensure the icon doesn't interfere with hover */ - } - &:hover { - .image { - filter: brightness(0.6); - } - .btn-raw { - display: block; - } - - .play-icon { - display: none; - } - } - } - .operations { - display: flex; - justify-content: left; - flex-direction: row; - width: 100%; - align-items: baseline; - flex-wrap: wrap; - overflow: hidden; - text-align: center; - color: var(--el-text-color-regular); - font-size: 14px; - overflow-y: scroll; - - &.full { - height: 70px; - } - - .btn-action { - margin-bottom: 10px; - } - } - } -} - - - diff --git a/src/i18n/zh-CN/luma.json b/src/i18n/zh-CN/luma.json index ffe1b163..0f9515c9 100644 --- a/src/i18n/zh-CN/luma.json +++ b/src/i18n/zh-CN/luma.json @@ -80,7 +80,7 @@ "description": "要生成的 QR 码的高级设置" }, "name.custom": { - "message": "自定义视频扩展", + "message": "上传视频扩展", "description": "自定义扩展视频" }, "name.extend": { diff --git a/src/pages/kling/Index.vue b/src/pages/kling/Index.vue index 1fdbc5a0..15e8f6d0 100644 --- a/src/pages/kling/Index.vue +++ b/src/pages/kling/Index.vue @@ -16,7 +16,7 @@ import ConfigPanel from '@/components/kling/ConfigPanel.vue'; 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 { ERROR_CODE_USED_UP } from '@/constants'; import RecentPanel from '@/components/kling/RecentPanel.vue'; import { IKlingTask } from '@/models'; diff --git a/src/pages/luma/Index.vue b/src/pages/luma/Index.vue index fc6470fd..6b12333a 100644 --- a/src/pages/luma/Index.vue +++ b/src/pages/luma/Index.vue @@ -4,7 +4,7 @@ @@ -13,10 +13,10 @@ import { defineComponent } from 'vue'; import Layout from '@/layouts/Luma.vue'; import ConfigPanel from '@/components/luma/ConfigPanel.vue'; -import { applicationOperator, lumaOperator } from '@/operators'; -import { IApplicationDetailResponse, ILumaGenerateRequest, Status } from '@/models'; +import { lumaOperator } from '@/operators'; +import { ILumaGenerateRequest, 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/luma/RecentPanel.vue'; import { ILumaTask } from '@/models'; @@ -47,27 +47,15 @@ export default defineComponent({ loading() { return this.$store.state.luma?.status?.getApplications === Status.Request; }, - service() { - return this.$store.state.luma.service; - }, credential() { return this.$store.state.luma.credential; }, config() { return this.$store.state.luma.config; }, - initializing() { - return this.$store.state.luma.status.getApplications === Status.Request; - }, - needApply() { - return this.$store.state.luma.status.getApplications === Status.Success && !this.application; - }, application() { return this.$store.state.luma.application; }, - applications() { - return this.$store.state.luma.applications; - }, tasks() { return this.$store.state.luma.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('luma.message.startTaskSuccess')); - this.$store.commit('luma/setConfig', { - config: undefined - }); }) .catch((error) => { const response = error?.response?.data; @@ -195,27 +163,3 @@ export default defineComponent({ } }); - - diff --git a/src/pages/midjourney/Index.vue b/src/pages/midjourney/Index.vue index 828bfb9d..999ec096 100644 --- a/src/pages/midjourney/Index.vue +++ b/src/pages/midjourney/Index.vue @@ -55,9 +55,6 @@ export default defineComponent({ tasks() { return this.$store.state.midjourney.tasks; }, - service() { - return this.$store.state.midjourney.service; - }, credential() { return this.$store.state.midjourney.credential; }, @@ -67,18 +64,9 @@ export default defineComponent({ loading() { return this.$store.state.midjourney.status.getApplications === Status.Request; }, - initializing() { - return this.$store.state.midjourney.status.getApplications === Status.Request; - }, - needApply() { - return this.$store.state.midjourney.status.getApplications === Status.Success && !this.application; - }, application() { return this.$store.state.midjourney.application; }, - applications() { - return this.$store.state.midjourney.applications; - }, finalPrompt(): string { let content = ''; if (this.config.references && this.config.references?.length > 0) { @@ -181,7 +169,6 @@ export default defineComponent({ }, methods: { async onReachTop() { - console.debug('ddasdasdreached top'); await this.onGetTasks({ createdAtMax: this.tasks?.items?.[0]?.created_at }); @@ -248,11 +235,9 @@ export default defineComponent({ await this.onStartTask(request); }, async onScrollDown() { - await this.$nextTick(); // 确保 DOM 更新完成后再执行滚动操作 + await this.$nextTick(); setTimeout(() => { - // scroll to bottom for `.tasks` const el = document.querySelector('.tasks'); - if (el) { el.scrollTop = el.scrollHeight; } diff --git a/yarn.lock b/yarn.lock index bd5e6a99..c4f78997 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2578,11 +2578,6 @@ eslint-plugin-promise@^5.0.0: resolved "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-5.2.0.tgz" integrity sha512-SftLb1pUG01QYq2A/hGAWfDRXqYD82zE7j7TopDOyNdU+7SvvoXREls/+PRTY17vUXzXnZA/zfnyKgRH6x4JJw== -eslint-plugin-unused-imports@^4.1.4: - version "4.1.4" - resolved "https://registry.yarnpkg.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.1.4.tgz#62ddc7446ccbf9aa7b6f1f0b00a980423cda2738" - integrity sha512-YptD6IzQjDardkl0POxnnRBhU1OEePMV0nd6siHaRBbd+lyh6NAhFEobiznKU7kTsSsDeSD62Pe7kAM1b7dAZQ== - eslint-plugin-vue@^8.5.0: version "8.5.0" resolved "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-8.5.0.tgz"