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'];