@@ -49,6 +28,7 @@ const ProvidersView = {
📎 关联 {{ countOf(p) }} 个资产
+
已配置 API
未配置 API
{{ p.enabled ? '启用' : '停用' }}
@@ -83,14 +63,13 @@ const ProvidersView = {
function countOf(p) {
return (assetCounts.value['id:' + p.id] || 0) + (assetCounts.value['p:' + p.slug] || 0) + (assetCounts.value['p:' + p.name] || 0);
}
+ // 平台名下账号数(账号按 platform slug 归属平台)
+ function accountsCountOf(p) {
+ return store.accounts.filter(a => a.platform === p.slug).length;
+ }
function serviceList(p) {
return (p.services || '').split(',').map(s => s.trim()).filter(Boolean);
}
- // 账号所属平台显示名:platform 存的是 slug,回退显示原值
- function platformName(slug) {
- const p = store.providers.find(x => x.slug === slug);
- return p ? p.name : slug;
- }
Vue.onMounted(async () => {
try { const r = await Api.get('/providers/adapters'); supported.value = r.supported_types || []; capabilities.value = r.capabilities || {}; } catch (e) { /* ignore */ }
});
@@ -123,6 +102,6 @@ const ProvidersView = {
} catch (e) { results[p.id] = { ok: false, text: '✗ ' + e.message }; }
finally { syncing[p.id] = false; }
}
- return { store, Fmt, testing, syncing, results, countOf, serviceList, platformName, isSupported, canSync, fmtTime, test, sync, seed: seedProviders, create: openProviderCreate, edit: openProviderEdit, del: deleteProvider, addAccount: () => openAccountCreate(''), editAccount: openAccountEdit, delAccount: deleteAccount };
+ return { store, Fmt, testing, syncing, results, countOf, accountsCountOf, serviceList, isSupported, canSync, fmtTime, test, sync, seed: seedProviders, create: openProviderCreate, edit: openProviderEdit, del: deleteProvider, openAccounts: (p) => openAccountsView(p.slug), manageAccounts: () => openAccountsView(null) };
},
};