-
- {{ $t('luma.button.uploadVideoUrl') }}
-
+
+
+
+ {{ $t('luma.name.videoUrl') }}
+
+
-
+
+
+
+
+
+
+ {{ $t('luma.button.uploadVideoUrl') }}
+
+
@@ -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"