From fd8eb9ffcdbacb67e9fad7494a0d934c9b1983e2 Mon Sep 17 00:00:00 2001 From: HCode <71808213+hyf-github-user@users.noreply.github.com> Date: Sat, 17 Aug 2024 21:16:38 +0800 Subject: [PATCH] add luma upload (#116) --- ...-59c75e48-34b6-4d51-99fe-dabc1f30bfa6.json | 7 ++ .../luma/config/EndImageUrlInput.vue | 86 +++++++++++++++--- src/components/luma/config/PromptInput.vue | 6 +- .../luma/config/StartImageUrlInput.vue | 88 ++++++++++++++++--- src/components/luma/task/Preview.vue | 6 +- src/i18n/zh-CN/luma.json | 28 +++++- src/store/luma/actions.ts | 2 +- 7 files changed, 192 insertions(+), 31 deletions(-) create mode 100644 change/@acedatacloud-nexior-59c75e48-34b6-4d51-99fe-dabc1f30bfa6.json diff --git a/change/@acedatacloud-nexior-59c75e48-34b6-4d51-99fe-dabc1f30bfa6.json b/change/@acedatacloud-nexior-59c75e48-34b6-4d51-99fe-dabc1f30bfa6.json new file mode 100644 index 00000000..279a5853 --- /dev/null +++ b/change/@acedatacloud-nexior-59c75e48-34b6-4d51-99fe-dabc1f30bfa6.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "add luma upload", + "packageName": "@acedatacloud/nexior", + "email": "1348977728@qq.com", + "dependentChangeType": "patch" +} diff --git a/src/components/luma/config/EndImageUrlInput.vue b/src/components/luma/config/EndImageUrlInput.vue index 0ca1df3c..878e0e80 100644 --- a/src/components/luma/config/EndImageUrlInput.vue +++ b/src/components/luma/config/EndImageUrlInput.vue @@ -1,34 +1,72 @@ - @@ -46,7 +103,7 @@ export default defineComponent({ display: flex; flex-direction: row; align-items: center; - + justify-content: space-between; // Distribute space evenly .title { font-size: 14px; margin: 0; @@ -54,6 +111,13 @@ export default defineComponent({ } .value { flex: 1; + margin-left: 60px; // Adjust this value as needed + } + .upload-wrapper { + transform: translate(-26px, 5px); // Move left and down + } + .info { + margin-left: auto; // Pushes the info icon to the right } } diff --git a/src/components/luma/config/PromptInput.vue b/src/components/luma/config/PromptInput.vue index 8c45a4e2..fbeb36b7 100644 --- a/src/components/luma/config/PromptInput.vue +++ b/src/components/luma/config/PromptInput.vue @@ -35,12 +35,12 @@ export default defineComponent({ computed: { prompt: { get() { - return this.$store.state.suno?.config?.prompt; + return this.$store.state.luma?.config?.prompt; }, set(val) { console.debug('set prompt', val); - this.$store.commit('suno/setConfig', { - ...this.$store.state.suno?.config, + this.$store.commit('luma/setConfig', { + ...this.$store.state.luma?.config, prompt: val }); } diff --git a/src/components/luma/config/StartImageUrlInput.vue b/src/components/luma/config/StartImageUrlInput.vue index 3683e8ee..f9db2aa8 100644 --- a/src/components/luma/config/StartImageUrlInput.vue +++ b/src/components/luma/config/StartImageUrlInput.vue @@ -1,34 +1,73 @@ - @@ -46,7 +107,7 @@ export default defineComponent({ display: flex; flex-direction: row; align-items: center; - + justify-content: space-between; // Distribute space evenly .title { font-size: 14px; margin: 0; @@ -54,6 +115,13 @@ export default defineComponent({ } .value { flex: 1; + margin-left: 60px; // Adjust this value as needed + } + .upload-wrapper { + transform: translate(-26px, 5px); // Move left and down + } + .info { + margin-left: auto; // Pushes the info icon to the right } } diff --git a/src/components/luma/task/Preview.vue b/src/components/luma/task/Preview.vue index aaa673f7..964d46df 100644 --- a/src/components/luma/task/Preview.vue +++ b/src/components/luma/task/Preview.vue @@ -7,15 +7,13 @@
{{ $t('luma.name.lumaBot') }} - + {{ $dayjs.format('' + new Date(parseFloat(modelValue?.created_at || '') * 1000)) }}

{{ modelValue?.request?.prompt }} - - - ({{ $t('luma.status.pending') }}) - + - ({{ $t('luma.status.pending') }})

diff --git a/src/i18n/zh-CN/luma.json b/src/i18n/zh-CN/luma.json index 78311c6d..d9ebda3e 100644 --- a/src/i18n/zh-CN/luma.json +++ b/src/i18n/zh-CN/luma.json @@ -199,8 +199,12 @@ "message": "继续生成", "description": "继续生成按钮文本" }, - "button.uploadQr": { - "message": "上传二维码", + "button.uploadStartImageUrl": { + "message": "上传图片", + "description": "上传二维码的按钮文本" + }, + "button.uploadEndImageUrl": { + "message": "上传图片", "description": "上传二维码的按钮文本" }, "preset.sunset": { @@ -343,6 +347,26 @@ "message": "生成图像失败", "description": "图像生成失败时的消息" }, + "message.uploadStartImageExceed": { + "message": "上传首帧图片数量超过限制", + "description": "上传首帧图片数量超过限制时的错误信息" + }, + "message.uploadEndImageExceed": { + "message": "上传尾帧图片数量超过限制", + "description": "上传首帧图片数量超过限制时的错误信息" + }, + "message.uploadStartImageError": { + "message": "上传首帧图片失败", + "description": "上传首帧图片失败时的错误信息" + }, + "message.uploadEndImageError": { + "message": "上传尾帧图片失败", + "description": "上传尾帧图片失败时的错误信息" + }, + "message.uploadDocumentsError": { + "message": "上传文档失败", + "description": "上传文档失败时的错误信息" + }, "message.noOperations": { "message": "没有可用操作", "description": "没有可用操作时的消息" diff --git a/src/store/luma/actions.ts b/src/store/luma/actions.ts index ec9bcee6..e1f5b1e2 100644 --- a/src/store/luma/actions.ts +++ b/src/store/luma/actions.ts @@ -44,7 +44,7 @@ export const getApplications = async ({ .then((response) => { console.debug('get applications success', response?.data); state.status.getApplications = Status.Success; - commit('setApplications', response.data.items); + commit('setApplication', response.data.items); // check if there is any application with 'Period' type const application = response.data.items?.find((application) => application?.type === IApplicationType.PERIOD); const application2 = response.data.items?.find((application) => application?.type === IApplicationType.USAGE);