Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add headshots api #146

Merged
merged 4 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "add headshots api",
"packageName": "@acedatacloud/nexior",
"email": "[email protected]",
"dependentChangeType": "patch"
}
2 changes: 1 addition & 1 deletion src/components/headshots/ImageGallery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="image-gallery">
<div v-for="(image, index) in images" :key="index" class="image-container">
<img :src="image.image_url" alt="Image" />
<button class="view-button" @click="viewImage(image.image_url)">View Image</button>
<button class="view-button" @click="viewImage(image.image_url)">{{ $t('headshots.button.viewImage') }}</button>
</div>
</div>
</template>
Expand Down
5 changes: 4 additions & 1 deletion src/components/headshots/config/ImageUrlsInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ export default defineComponent({
},
urls(): string[] {
// @ts-ignore
return this.fileList.map((file: UploadFile) => file?.response?.file_url);
return this.fileList.map((file: UploadFile) => {
const url = file?.response?.file_url;
return url.replace('https://cdn.acedata.cloud', 'https://acedata-cdn.zhishuyun.com');
});
},
value: {
get() {
Expand Down
5 changes: 4 additions & 1 deletion src/i18n/zh-CN/headshots.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@
"message": "生成",
"description": "生成Headshots证件照 的按钮文本"
},

"button.viewImage": {
"message": "查看原图",
"description": "生成Headshots证件照 的按钮文本"
},
"button.download": {
"message": "下载视频",
"description": "下载视频按钮文本"
Expand Down
8 changes: 8 additions & 0 deletions src/i18n/zh-CN/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
"message": "Luma",
"description": "展示在编辑框的标题"
},
"field.featuresHeadshots": {
"message": "AI证件照",
"description": "展示在编辑框的标题"
},
"field.featuresSuno": {
"message": "Suno",
"description": "展示在编辑框的标题"
Expand Down Expand Up @@ -259,6 +263,10 @@
"message": "打开或关闭 Luma 功能模块。",
"description": "Luma 功能的描述"
},
"message.featuresHeadshots": {
"message": "打开或关闭 AI证件照 功能模块。",
"description": "AI证件照 功能的描述"
},
"message.featuresSupport": {
"message": "打开或关闭客服支持",
"description": "Support 功能的描述"
Expand Down
6 changes: 3 additions & 3 deletions src/operators/headshots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { BASE_URL_API } from '@/constants';
class HeadshotsOperator {
async task(id: string, options: { token: string }): Promise<AxiosResponse<IHeadshotsTaskResponse>> {
return await axios.post(
`/luma/tasks`,
`/headshots/tasks`,
{
action: 'retrieve',
id: id
Expand All @@ -32,7 +32,7 @@ class HeadshotsOperator {
options: { token: string }
): Promise<AxiosResponse<IHeadshotsTasksResponse>> {
return await axios.post(
`/luma/tasks`,
`/headshots/tasks`,
{
action: 'retrieve_batch',
...(filter.ids
Expand Down Expand Up @@ -79,7 +79,7 @@ class HeadshotsOperator {
token: string;
}
): Promise<AxiosResponse<IHeadshotsGenerateResponse>> {
return await axios.post('/luma/videos', data, {
return await axios.post('/headshots/generate', data, {
headers: {
authorization: `Bearer ${options.token}`,
'content-type': 'application/json',
Expand Down
Loading