feat: DBGPTS uninstall arguments change

This commit is contained in:
lhwan
2024-08-26 14:45:03 +08:00
parent ed6037f398
commit 2119b7f8ce
5 changed files with 12 additions and 7 deletions

View File

@@ -362,9 +362,9 @@ export const postAgentUninstall = (pluginName: string, user?: string) => {
timeout: 60000,
});
};
export const postDbgptsUninstall = (pluginName: string, user?: string) => {
export const postDbgptsUninstall = (data: { name: string, type: string }, user?: string) => {
return POST("/api/v1/serve/dbgpts/my/uninstall", undefined, {
params: { name: pluginName, user },
params: { ...data, user },
timeout: 60000,
});
};

View File

@@ -325,6 +325,7 @@ export const CommonEn = {
Copy_Btn: 'Copy',
Delete_Btn: 'Delete',
dbgpts_community: 'DBGPTS Community',
community_dbgpts: 'Community DBGPTS',
my_dbgpts: 'My DBGPTS',
Refresh_dbgpts: 'Refresh from the community Git repository',
workflow: 'Workflow',

View File

@@ -327,6 +327,7 @@ export const CommonZh: Resources["translation"] = {
Copy_Btn: '复制',
Delete_Btn: '删除',
dbgpts_community: 'DBGPTS社区',
community_dbgpts: '社区DBGPTS',
my_dbgpts: '我的DBGPTS',
Refresh_dbgpts: '从社区Git仓库刷新',
workflow: '工作流',

View File

@@ -52,7 +52,7 @@ const BlurredCard: React.FC<{
<span
className="line-clamp-1 text-ellipsis font-semibold text-base"
style={{
// maxWidth: '60%',
maxWidth: '60%',
}}
>
{name}
@@ -62,7 +62,7 @@ const BlurredCard: React.FC<{
<span
className="line-clamp-1 text-ellipsis font-semibold text-base"
style={{
// maxWidth: '60%',
maxWidth: '60%',
}}
>
{name}

View File

@@ -81,7 +81,7 @@ function Agent() {
}, [activeKey, typeStr]);
const pluginAction = useCallback(
async (agent: { name: string }, index: number, isInstall: boolean) => {
async (agent: { name: string, type: string }, index: number, isInstall: boolean) => {
if (actionIndex) return;
setActionIndex(index);
setLoading(true);
@@ -90,7 +90,10 @@ function Agent() {
const [err] = await apiInterceptors(postDbgptsInstall(agent));
errs = err;
} else {
const [err] = await apiInterceptors(postDbgptsUninstall(agent.name));
const [err] = await apiInterceptors(postDbgptsUninstall({
name: agent.name,
type: agent.type
}));
errs = err;
}
setLoading(false);
@@ -105,7 +108,7 @@ function Agent() {
const items: SegmentedProps['options'] = [
{
value: 'market',
label: 'DBGPTS',
label: t('community_dbgpts'),
},
{
value: 'my',