diff --git a/web/components.d.ts b/web/components.d.ts index db43598..390f06c 100644 --- a/web/components.d.ts +++ b/web/components.d.ts @@ -39,6 +39,8 @@ declare module 'vue' { NPagination: typeof import('naive-ui')['NPagination'] NProgress: typeof import('naive-ui')['NProgress'] NQrCode: typeof import('naive-ui')['NQrCode'] + NRadio: typeof import('naive-ui')['NRadio'] + NRadioGroup: typeof import('naive-ui')['NRadioGroup'] NSelect: typeof import('naive-ui')['NSelect'] NSpace: typeof import('naive-ui')['NSpace'] NSpin: typeof import('naive-ui')['NSpin'] diff --git a/web/pages/admin/accounts-expansion.vue b/web/pages/admin/accounts-expansion.vue index f96364d..cdaa137 100644 --- a/web/pages/admin/accounts-expansion.vue +++ b/web/pages/admin/accounts-expansion.vue @@ -14,7 +14,7 @@ 20T扩容说明:建议 蜂小推 quark 账号扩容。【什么推荐蜂小推】 1. 20T扩容 只支持新号,等到蜂小推首次 6T 奖励 到账后进行扩容 2. 账号需要处于关闭状态, 开启状态可能会被用于,自动转存等任务,存咋影响 - 3. 扩容完成后,并不直接获得容量,账号将存储大量热门资源,需要手动推广 + 3. 扩容完成后,并不直接获得容量,账号将存储大量热门资源,需要手动推广 4. 注意 推广获得20T容量,删除所有资源, 热门资源比较敏感,不建议,长期推广,仅用于扩容 @@ -80,6 +80,42 @@ + + + + + + 确定要对账号 "{{ pendingAccount?.name }}" 进行扩容操作吗? + + + + + + 系统内部数据源 + 使用系统内置的数据源进行扩容 + + + 第三方接口 + 使用第三方API获取数据源 + + + + + + + + 取消 + 确定扩容 + + + + + @@ -203,6 +239,10 @@ const expandingAccountId = ref(null) const drawActive = ref(false) // 侧边栏激活 const qrCode = ref("https://app.fengtuiwl.com/#/pages/login/reg?p=22112503") const showImageModal = ref(false) // 图片模态框 +const showDataSourceDialog = ref(false) // 数据源选择弹窗 +const selectedDataSource = ref('internal') // internal or third-party +const thirdPartyUrl = ref('https://so.252035.xyz/') +const pendingAccount = ref(null) // 待处理的账号 // API实例 const taskApi = useTaskApi() @@ -295,48 +335,53 @@ const fetchExpansionTasks = async () => { // 处理扩容操作 const handleExpansion = async (account) => { - const dialog = useDialog() + pendingAccount.value = account + showDataSourceDialog.value = true +} - dialog.warning({ - title: '确认扩容', - content: `确定要对账号 "${account.name}" 进行扩容操作吗?`, - positiveText: '确定', - negativeText: '取消', - draggable: true, - onPositiveClick: async () => { - expandingAccountId.value = account.id - try { - const response = await taskApi.createExpansionTask({ - pan_account_id: account.id, - description: `对 ${account.name} 账号进行扩容操作` - }) +// 确认数据源选择 +const confirmDataSourceSelection = async () => { + if (!pendingAccount.value) return - // 启动任务 - await taskApi.startTask(response.task_id) + showDataSourceDialog.value = false + expandingAccountId.value = pendingAccount.value.id - notification.success({ - title: '成功', - content: '扩容任务已创建并启动', - duration: 3000 - }) + try { + const dataSource = selectedDataSource.value === 'internal' + ? { type: 'internal' } + : { type: 'third-party', url: thirdPartyUrl.value } - // 刷新数据 - await Promise.all([ - fetchExpansionAccounts(), - fetchExpansionTasks() - ]) - } catch (error) { - console.error('创建扩容任务失败:', error) - notification.error({ - title: '失败', - content: '创建扩容任务失败: ' + (error.message || '未知错误'), - duration: 3000 - }) - } finally { - expandingAccountId.value = null - } - } - }) + const response = await taskApi.createExpansionTask({ + pan_account_id: pendingAccount.value.id, + description: `对 ${pendingAccount.value.name} 账号进行扩容操作`, + dataSource + }) + + // 启动任务 + await taskApi.startTask(response.task_id) + + notification.success({ + title: '成功', + content: '扩容任务已创建并启动', + duration: 3000 + }) + + // 刷新数据 + await Promise.all([ + fetchExpansionAccounts(), + fetchExpansionTasks() + ]) + } catch (error) { + console.error('创建扩容任务失败:', error) + notification.error({ + title: '失败', + content: '创建扩容任务失败: ' + (error.message || '未知错误'), + duration: 3000 + }) + } finally { + expandingAccountId.value = null + pendingAccount.value = null + } } // 查看任务详情
+ 确定要对账号 "{{ pendingAccount?.name }}" 进行扩容操作吗? +