Fix retrieve tasks (#109)
Co-authored-by: AceDataCloud <office@acedata.cloud>
This commit is contained in:
1 parent
0831e3e181
commit
acc99514ca
12 files changed
+45
-15
No files matched your search
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"type": "patch",
|
||||||
|
"comment": "fix retrieve task issue",
|
||||||
|
"packageName": "@acedatacloud/nexior",
|
||||||
|
"email": "office@acedata.cloud",
|
||||||
|
"dependentChangeType": "patch"
|
||||||
|
}
|
||||||
@@ -89,7 +89,7 @@ import MarkdownRenderer from '@/components/common/MarkdownRenderer.vue';
|
|||||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||||
import { IApplication, IChatMessage, IChatMessageState } from '@/models';
|
import { IApplication, IChatMessage, IChatMessageState } from '@/models';
|
||||||
import CopyToClipboard from '@/components/common/CopyToClipboard.vue';
|
import CopyToClipboard from '@/components/common/CopyToClipboard.vue';
|
||||||
import RestartToGenerate from '@/components/common/RestartToGenerate.vue';
|
import RestartToGenerate from './RestartToGenerate.vue';
|
||||||
import {
|
import {
|
||||||
ERROR_CODE_API_ERROR,
|
ERROR_CODE_API_ERROR,
|
||||||
ERROR_CODE_BAD_REQUEST,
|
ERROR_CODE_BAD_REQUEST,
|
||||||
|
|||||||
+1
-2
@@ -37,8 +37,7 @@ export default defineComponent({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.icon-check,
|
.icon-sync {
|
||||||
.icon-copy {
|
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
@@ -34,7 +34,9 @@
|
|||||||
<p class="style">{{ audio?.style }}</p>
|
<p class="style">{{ audio?.style }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<el-button size="small" round @click="onExtend($event, audio)">{{ $t('suno.button.extend') }}</el-button>
|
<el-button v-if="audio?.audio_url && audio?.video_url" size="small" round @click="onExtend($event, audio)">{{
|
||||||
|
$t('suno.button.extend')
|
||||||
|
}}</el-button>
|
||||||
<el-tooltip effect="dark" :content="$t('suno.button.download')" placement="top">
|
<el-tooltip effect="dark" :content="$t('suno.button.download')" placement="top">
|
||||||
<font-awesome-icon
|
<font-awesome-icon
|
||||||
v-if="audio?.audio_url"
|
v-if="audio?.audio_url"
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ class ChatOperator {
|
|||||||
filter: {
|
filter: {
|
||||||
ids?: string[];
|
ids?: string[];
|
||||||
applicationId?: string;
|
applicationId?: string;
|
||||||
|
userId?: string;
|
||||||
},
|
},
|
||||||
options: IChatConversationOptions
|
options: IChatConversationOptions
|
||||||
): Promise<AxiosResponse<IChatConversationsResponse>> {
|
): Promise<AxiosResponse<IChatConversationsResponse>> {
|
||||||
@@ -81,6 +82,11 @@ class ChatOperator {
|
|||||||
? {
|
? {
|
||||||
application_id: filter.applicationId
|
application_id: filter.applicationId
|
||||||
}
|
}
|
||||||
|
: {}),
|
||||||
|
...(filter.userId
|
||||||
|
? {
|
||||||
|
user_id: filter.userId
|
||||||
|
}
|
||||||
: {})
|
: {})
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class MidjourneyOperator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async tasks(
|
async tasks(
|
||||||
filter: { ids?: string[]; applicationId?: string; limit?: number; offset?: number },
|
filter: { ids?: string[]; applicationId?: string; userId?: string; limit?: number; offset?: number },
|
||||||
options: { token: string }
|
options: { token: string }
|
||||||
): Promise<AxiosResponse<IMidjourneyTasksResponse>> {
|
): Promise<AxiosResponse<IMidjourneyTasksResponse>> {
|
||||||
return await axios.post(
|
return await axios.post(
|
||||||
@@ -45,6 +45,11 @@ class MidjourneyOperator {
|
|||||||
application_id: filter.applicationId
|
application_id: filter.applicationId
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
|
...(filter.userId
|
||||||
|
? {
|
||||||
|
user_id: filter.userId
|
||||||
|
}
|
||||||
|
: {}),
|
||||||
...(filter.limit !== undefined
|
...(filter.limit !== undefined
|
||||||
? {
|
? {
|
||||||
limit: filter.limit
|
limit: filter.limit
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class QrartOperator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async tasks(
|
async tasks(
|
||||||
filter: { ids?: string[]; applicationId?: string; limit?: number; offset?: number },
|
filter: { ids?: string[]; applicationId?: string; userId?: string; limit?: number; offset?: number },
|
||||||
options: { token: string }
|
options: { token: string }
|
||||||
): Promise<AxiosResponse<IQrartTasksResponse>> {
|
): Promise<AxiosResponse<IQrartTasksResponse>> {
|
||||||
return await axios.post(
|
return await axios.post(
|
||||||
@@ -40,6 +40,11 @@ class QrartOperator {
|
|||||||
application_id: filter.applicationId
|
application_id: filter.applicationId
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
|
...(filter.userId
|
||||||
|
? {
|
||||||
|
user_id: filter.userId
|
||||||
|
}
|
||||||
|
: {}),
|
||||||
...(filter.limit !== undefined
|
...(filter.limit !== undefined
|
||||||
? {
|
? {
|
||||||
limit: filter.limit
|
limit: filter.limit
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class SunoOperator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async tasks(
|
async tasks(
|
||||||
filter: { ids?: string[]; applicationId?: string; limit?: number; offset?: number },
|
filter: { ids?: string[]; applicationId?: string; userId?: string; limit?: number; offset?: number },
|
||||||
options: { token: string }
|
options: { token: string }
|
||||||
): Promise<AxiosResponse<ISunoTasksResponse>> {
|
): Promise<AxiosResponse<ISunoTasksResponse>> {
|
||||||
return await axios.post(
|
return await axios.post(
|
||||||
@@ -42,6 +42,11 @@ class SunoOperator {
|
|||||||
ids: filter.ids
|
ids: filter.ids
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
|
...(filter.userId
|
||||||
|
? {
|
||||||
|
user_id: filter.userId
|
||||||
|
}
|
||||||
|
: {}),
|
||||||
...(filter.applicationId
|
...(filter.applicationId
|
||||||
? {
|
? {
|
||||||
application_id: filter.applicationId
|
application_id: filter.applicationId
|
||||||
|
|||||||
@@ -103,7 +103,8 @@ export const getApplications = async ({
|
|||||||
|
|
||||||
export const getConversations = async ({
|
export const getConversations = async ({
|
||||||
commit,
|
commit,
|
||||||
state
|
state,
|
||||||
|
rootState
|
||||||
}: ActionContext<IChatState, IRootState>): Promise<IChatConversation[]> => {
|
}: ActionContext<IChatState, IRootState>): Promise<IChatConversation[]> => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
state.status.getConversations = Status.Request;
|
state.status.getConversations = Status.Request;
|
||||||
@@ -117,7 +118,7 @@ export const getConversations = async ({
|
|||||||
chatOperator
|
chatOperator
|
||||||
.getConversations(
|
.getConversations(
|
||||||
{
|
{
|
||||||
applicationId: state.application?.id
|
userId: rootState.user?.id
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
token
|
token
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ export const getService = async ({ commit, state }: ActionContext<IMidjourneySta
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getTasks = async (
|
export const getTasks = async (
|
||||||
{ commit, state }: ActionContext<IMidjourneyState, IRootState>,
|
{ commit, state, rootState }: ActionContext<IMidjourneyState, IRootState>,
|
||||||
{ offset, limit }: { offset?: number; limit?: number }
|
{ offset, limit }: { offset?: number; limit?: number }
|
||||||
): Promise<IMidjourneyTasksResponse> => {
|
): Promise<IMidjourneyTasksResponse> => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
@@ -113,7 +113,7 @@ export const getTasks = async (
|
|||||||
midjourneyOperator
|
midjourneyOperator
|
||||||
.tasks(
|
.tasks(
|
||||||
{
|
{
|
||||||
applicationId: state.application?.id,
|
userId: rootState?.user?.id,
|
||||||
offset,
|
offset,
|
||||||
limit
|
limit
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ export const getService = async ({ commit, state }: ActionContext<IQrartState, I
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getTasks = async (
|
export const getTasks = async (
|
||||||
{ commit, state }: ActionContext<IQrartState, IRootState>,
|
{ commit, state, rootState }: ActionContext<IQrartState, IRootState>,
|
||||||
{ offset, limit }: { offset?: number; limit?: number }
|
{ offset, limit }: { offset?: number; limit?: number }
|
||||||
): Promise<IQrartTask[]> => {
|
): Promise<IQrartTask[]> => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
@@ -114,7 +114,7 @@ export const getTasks = async (
|
|||||||
qrartOperator
|
qrartOperator
|
||||||
.tasks(
|
.tasks(
|
||||||
{
|
{
|
||||||
applicationId: state.application?.id
|
userId: rootState?.user?.id
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
token
|
token
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ export const getService = async ({ commit, state }: ActionContext<ISunoState, IR
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getTasks = async (
|
export const getTasks = async (
|
||||||
{ commit, state }: ActionContext<ISunoState, IRootState>,
|
{ commit, state, rootState }: ActionContext<ISunoState, IRootState>,
|
||||||
{ offset, limit }: { offset?: number; limit?: number }
|
{ offset, limit }: { offset?: number; limit?: number }
|
||||||
): Promise<ISunoTask[]> => {
|
): Promise<ISunoTask[]> => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
@@ -116,7 +116,7 @@ export const getTasks = async (
|
|||||||
sunoOperator
|
sunoOperator
|
||||||
.tasks(
|
.tasks(
|
||||||
{
|
{
|
||||||
applicationId: state.application?.id
|
userId: rootState?.user?.id
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
token
|
token
|
||||||
|
|||||||
Reference in new issue
Block a user