feat: 新增交通银行数据导出插件及测试通道机制
This commit is contained in:
@@ -71,6 +71,7 @@ export class AdminOpsController extends BaseController {
|
||||
pluginOut.push({
|
||||
id: p.id, name: p.name, description: p.description || '', category: p.category || '',
|
||||
icon: p.icon || '', status: p.status, latest_version: p.latestVersion,
|
||||
test_version: p.testVersion || '',
|
||||
force_min_version: p.forceMinVersion, force_deadline: p.forceDeadline,
|
||||
manifest: m, capabilities: m.capabilities || [], permissions: m.permissions || {},
|
||||
field_count: Object.keys((m.fields || {}).properties || {}).length,
|
||||
@@ -99,6 +100,7 @@ export class AdminOpsController extends BaseController {
|
||||
const plugins: any = (await m.query(
|
||||
`SELECT (SELECT COUNT(*) FROM plugins) AS total,
|
||||
(SELECT COUNT(*) FROM plugins WHERE status='published') AS published,
|
||||
(SELECT COUNT(*) FROM plugins WHERE status='testing') AS testing,
|
||||
(SELECT COUNT(*) FROM plugins WHERE status='disabled') AS disabled,
|
||||
(SELECT COUNT(*) FROM plugins WHERE status='revoked') AS revoked`))[0];
|
||||
const runs: any = (await m.query(
|
||||
@@ -140,7 +142,7 @@ export class AdminOpsController extends BaseController {
|
||||
for (const a of await this.accountRepo.find()) nick[a.account] = a.nickname || '';
|
||||
return {
|
||||
users: { total: Number(users.total || 0), admins: Number(users.admins || 0), authorized: Number(users.authorized || 0) },
|
||||
plugins: { total: Number(plugins.total || 0), published: Number(plugins.published || 0), disabled: Number(plugins.disabled || 0), revoked: Number(plugins.revoked || 0) },
|
||||
plugins: { total: Number(plugins.total || 0), published: Number(plugins.published || 0), testing: Number(plugins.testing || 0), disabled: Number(plugins.disabled || 0), revoked: Number(plugins.revoked || 0) },
|
||||
runs: { total: Number(runs.started || 0), success: Number(runs.success || 0), failed: Number(runs.failed || 0), durationSec: Number(runs.duration_sec || 0), activeUsers: Number(runs.active_users || 0), activePlugins: Number(runs.active_plugins || 0) },
|
||||
trend,
|
||||
topPlugins: topPlugins.map((tp: any) => ({ ...tp, name: pnames[tp.pluginId] || tp.pluginId, runs: Number(tp.triggered || 0) })),
|
||||
|
||||
Reference in New Issue
Block a user