feat(center): 授权矩阵总览支持分类分组、列筛选与列分页
- 插件数量增长(现 25,后续更多)后纯横向铺列不可用,改为三层收敛:分类 Tab 降维、插件列分页(默认每页 15 列,账号列固定)、插件列多选/搜索/仅已授权筛选(选择记 localStorage) - 表头两级 sticky(分类分组行 + 插件行),悬停高亮整列,点击列头只看该插件,紧凑模式压窄列宽 - grants/matrix 接口补 category 字段供前端分组
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* 授权矩阵总览(GitHub / 阿里云 RAM 授权总览式)
|
||||
* 行=账号(搜索/部门/仅看已授权),列=插件;单元格 [⬇下载][▶运行] 可点击徽标,
|
||||
* 点击即切换该权限;下载+运行都关掉时自动整行撤销。首列与列头冻结,状态底色三档。
|
||||
* 授权矩阵总览(账号 × 插件)—— 面向插件持续膨胀(25 → 50 → 100+)
|
||||
*
|
||||
* 纯横向铺列在几十个插件时就没法用了,所以按「降维」思路收敛:
|
||||
* 1) 分类 Tab:一次只看一个分类(财务 / 人事 / 其他…),列数天然有界;
|
||||
* 2) 列分页:单分类也很长时按每页 N 列翻页(默认 15),账号列与行始终不变、只翻插件列;
|
||||
* 3) 列筛选:插件多选(空=全部)/ 搜索 / 仅看已授权插件,选择记 localStorage;
|
||||
* 4) 两行 sticky 表头(分类分组 + 插件)+ 悬停列高亮 + 点击列头只看该插件,长表也能横向跟踪。
|
||||
* 单元格仍是 [⬇下载][▶运行] 徽标,点一下切一位,两位都关掉自动整行撤销。
|
||||
*/
|
||||
import { computed, ref } from 'vue'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { grantPlugin } from '@/api/business'
|
||||
|
||||
@@ -14,20 +19,66 @@ interface Props {
|
||||
const props = defineProps<Props>()
|
||||
const emit = defineEmits<{ (e: 'changed'): void }>()
|
||||
|
||||
const LS_COLS = 'xq.grants.matrix.cols'
|
||||
const LS_COMPACT = 'xq.grants.matrix.compact'
|
||||
const LS_PAGE_SIZE = 'xq.grants.matrix.pageSize'
|
||||
const PAGE_SIZES = [10, 15, 20, 30, 50]
|
||||
|
||||
function readCols(): string[] {
|
||||
try {
|
||||
const raw = localStorage.getItem(LS_COLS)
|
||||
const arr = raw ? JSON.parse(raw) : []
|
||||
return Array.isArray(arr) ? arr.map(String) : []
|
||||
} catch {
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
function readPageSize(): number {
|
||||
const n = Number(localStorage.getItem(LS_PAGE_SIZE))
|
||||
return PAGE_SIZES.includes(n) ? n : 15
|
||||
}
|
||||
|
||||
// 账号侧
|
||||
const kw = ref('')
|
||||
const deptFilter = ref<string | null>(null)
|
||||
const onlyGranted = ref(false)
|
||||
|
||||
// 插件侧
|
||||
const picked = ref<string[]>(readCols())
|
||||
const pluginKw = ref('')
|
||||
const onlyGrantedPlugins = ref(false)
|
||||
const catFilter = ref('')
|
||||
const compact = ref(localStorage.getItem(LS_COMPACT) === '1')
|
||||
const pageSize = ref(readPageSize())
|
||||
const page = ref(1)
|
||||
|
||||
const plugins = computed<any[]>(() => props.matrix.plugins || [])
|
||||
const grants = computed<any[]>(() => props.matrix.grants || [])
|
||||
|
||||
watch(picked, v => localStorage.setItem(LS_COLS, JSON.stringify(v)), { deep: true })
|
||||
watch(compact, v => localStorage.setItem(LS_COMPACT, v ? '1' : '0'))
|
||||
watch(pageSize, v => localStorage.setItem(LS_PAGE_SIZE, String(v)))
|
||||
|
||||
const deptOptions = computed(() => {
|
||||
const set = new Set<string>()
|
||||
for (const a of props.matrix.accounts || []) if (a.dept) set.add(a.dept)
|
||||
return [...set]
|
||||
})
|
||||
|
||||
const catOf = (p: any) => String(p.category || '未分类')
|
||||
|
||||
/** 分类清单(带插件数),只有一个分类时不显示 Tab */
|
||||
const categories = computed(() => {
|
||||
const map = new Map<string, number>()
|
||||
for (const p of plugins.value) map.set(catOf(p), (map.get(catOf(p)) || 0) + 1)
|
||||
return [...map.entries()].map(([label, count]) => ({ label, count }))
|
||||
})
|
||||
|
||||
/** grants 快速索引:(account, pluginId) -> {can_download, can_run} */
|
||||
const grantIndex = computed(() => {
|
||||
const idx = new Map<string, any>()
|
||||
for (const g of props.matrix.grants || []) idx.set(`${g.account}|${g.plugin_id}`, g)
|
||||
for (const g of grants.value) idx.set(`${g.account}|${g.plugin_id}`, g)
|
||||
return idx
|
||||
})
|
||||
|
||||
@@ -41,6 +92,67 @@ function cellState(account: string, pluginId: string): 'full' | 'partial' | 'non
|
||||
return c.can_download && c.can_run ? 'full' : 'partial'
|
||||
}
|
||||
|
||||
const grantedPluginIds = computed(() => new Set(grants.value.map((g: any) => String(g.plugin_id))))
|
||||
|
||||
/** 插件列过滤(分类 Tab + 多选 + 搜索 + 仅已授权) */
|
||||
const visiblePlugins = computed<any[]>(() => {
|
||||
const kwv = pluginKw.value.trim().toLowerCase()
|
||||
return plugins.value.filter((p: any) => {
|
||||
if (catFilter.value && catOf(p) !== catFilter.value) return false
|
||||
if (picked.value.length && !picked.value.includes(p.id)) return false
|
||||
if (onlyGrantedPlugins.value && !grantedPluginIds.value.has(p.id)) return false
|
||||
if (kwv) {
|
||||
const hay = `${p.name || ''} ${p.id} ${catOf(p)}`.toLowerCase()
|
||||
if (!hay.includes(kwv)) return false
|
||||
}
|
||||
return true
|
||||
})
|
||||
})
|
||||
|
||||
/** 同分类连续排列,两级表头才能成段 */
|
||||
const columns = computed<any[]>(() => {
|
||||
const list = [...visiblePlugins.value]
|
||||
const order: string[] = []
|
||||
for (const p of list) {
|
||||
const c = catOf(p)
|
||||
if (!order.includes(c)) order.push(c)
|
||||
}
|
||||
return list.sort((a, b) => order.indexOf(catOf(a)) - order.indexOf(catOf(b)))
|
||||
})
|
||||
|
||||
const totalPages = computed(() => Math.max(1, Math.ceil(columns.value.length / pageSize.value)))
|
||||
|
||||
/** 当前页要渲染的插件列(账号行不参与分页) */
|
||||
const pagedColumns = computed(() =>
|
||||
columns.value.slice((page.value - 1) * pageSize.value, page.value * pageSize.value)
|
||||
)
|
||||
|
||||
const rangeText = computed(() => {
|
||||
const total = columns.value.length
|
||||
if (!total) return '0 / 0 列'
|
||||
const from = (page.value - 1) * pageSize.value + 1
|
||||
const to = Math.min(total, page.value * pageSize.value)
|
||||
return `${from}-${to} / 共 ${total} 列`
|
||||
})
|
||||
|
||||
const pluginGroups = computed(() => {
|
||||
const out: { label: string; span: number }[] = []
|
||||
for (const p of pagedColumns.value) {
|
||||
const label = catOf(p)
|
||||
const last = out[out.length - 1]
|
||||
if (last && last.label === label) last.span += 1
|
||||
else out.push({ label, span: 1 })
|
||||
}
|
||||
return out
|
||||
})
|
||||
|
||||
watch([picked, pluginKw, onlyGrantedPlugins, catFilter, pageSize], () => {
|
||||
page.value = 1
|
||||
})
|
||||
watch(totalPages, tp => {
|
||||
if (page.value > tp) page.value = tp
|
||||
})
|
||||
|
||||
const rows = computed(() => {
|
||||
const kwv = kw.value.trim().toLowerCase()
|
||||
return (props.matrix.accounts || []).filter((a: any) => {
|
||||
@@ -49,12 +161,18 @@ const rows = computed(() => {
|
||||
String(a.account).toLowerCase().includes(kwv) ||
|
||||
String(a.nickname || '').toLowerCase().includes(kwv)
|
||||
const deptOk = !deptFilter.value || a.dept === deptFilter.value
|
||||
const grantedOk =
|
||||
!onlyGranted.value || (props.matrix.grants || []).some((g: any) => g.account === a.account)
|
||||
const grantedOk = !onlyGranted.value || grants.value.some((g: any) => g.account === a.account)
|
||||
return kwOk && deptOk && grantedOk
|
||||
})
|
||||
})
|
||||
|
||||
/** 悬停列高亮,缓解长表横向串行 */
|
||||
const hoverCol = ref('')
|
||||
|
||||
function focusPlugin(id: string) {
|
||||
picked.value = picked.value.length === 1 && picked.value[0] === id ? [] : [id]
|
||||
}
|
||||
|
||||
const toggling = ref(false)
|
||||
|
||||
async function toggle(account: string, pluginId: string, field: 'can_download' | 'can_run') {
|
||||
@@ -76,8 +194,8 @@ async function toggle(account: string, pluginId: string, field: 'can_download' |
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<!-- 工具条 -->
|
||||
<div class="flex items-center gap-3 mb-3 flex-wrap">
|
||||
<!-- 工具条 1:账号维度 -->
|
||||
<div class="flex items-center gap-3 mb-2 flex-wrap">
|
||||
<el-input v-model="kw" placeholder="搜索账号 / 昵称" clearable style="width: 200px" />
|
||||
<el-select v-model="deptFilter" placeholder="全部部门" clearable style="width: 130px">
|
||||
<el-option v-for="d in deptOptions" :key="d" :label="d" :value="d" />
|
||||
@@ -91,26 +209,108 @@ async function toggle(account: string, pluginId: string, field: 'can_download' |
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 工具条 2:分类 Tab(插件按业务分类降维) -->
|
||||
<div v-if="categories.length > 1" class="flex items-center gap-2 mb-2 flex-wrap">
|
||||
<span class="text-xs text-gray-400">插件分类</span>
|
||||
<el-radio-group v-model="catFilter" size="small">
|
||||
<el-radio-button value="">全部 ({{ plugins.length }})</el-radio-button>
|
||||
<el-radio-button v-for="c in categories" :key="c.label" :value="c.label">
|
||||
{{ c.label }} ({{ c.count }})
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
|
||||
<!-- 工具条 3:插件列筛选 + 分页 -->
|
||||
<div class="flex items-center gap-3 mb-3 flex-wrap">
|
||||
<el-select
|
||||
v-model="picked"
|
||||
multiple
|
||||
filterable
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
placeholder="全部插件列"
|
||||
style="width: 220px"
|
||||
>
|
||||
<el-option
|
||||
v-for="p in plugins"
|
||||
:key="p.id"
|
||||
:label="`${p.category ? p.category + ' · ' : ''}${p.name}`"
|
||||
:value="p.id"
|
||||
/>
|
||||
</el-select>
|
||||
<el-input v-model="pluginKw" placeholder="搜索插件名 / ID / 分类" clearable style="width: 190px" />
|
||||
<el-switch v-model="onlyGrantedPlugins" size="small" active-text="仅看已授权插件" />
|
||||
<el-switch v-model="compact" size="small" active-text="紧凑模式" />
|
||||
<el-button v-if="picked.length" size="small" text bg @click="picked = []">
|
||||
显示全部插件列
|
||||
</el-button>
|
||||
|
||||
<div class="ml-auto flex items-center gap-2">
|
||||
<span class="text-xs text-gray-400">
|
||||
账号 {{ rows.length }} / {{ (matrix.accounts || []).length }}
|
||||
</span>
|
||||
<span class="text-xs text-gray-400">·</span>
|
||||
<span class="text-xs text-gray-400">{{ rangeText }}</span>
|
||||
<template v-if="totalPages > 1">
|
||||
<el-button size="small" :disabled="page <= 1" @click="page--">上一页</el-button>
|
||||
<span class="text-xs text-gray-500">{{ page }} / {{ totalPages }}</span>
|
||||
<el-button size="small" :disabled="page >= totalPages" @click="page++">下一页</el-button>
|
||||
</template>
|
||||
<el-select v-model="pageSize" size="small" style="width: 104px">
|
||||
<el-option v-for="n in PAGE_SIZES" :key="n" :label="`每页 ${n} 列`" :value="n" />
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 矩阵 -->
|
||||
<el-scrollbar max-height="520" class="border border-g-300/50 rounded-lg">
|
||||
<table class="matrix-table">
|
||||
<el-scrollbar :max-height="compact ? 560 : 520" class="border border-g-300/50 rounded-lg">
|
||||
<table class="matrix-table" :class="{ 'is-compact': compact }">
|
||||
<thead>
|
||||
<tr class="group-row">
|
||||
<th class="sticky-col">
|
||||
<div class="text-xs text-gray-400 font-normal">账号 / 插件</div>
|
||||
</th>
|
||||
<th
|
||||
v-for="(g, gi) in pluginGroups"
|
||||
:key="`g-${gi}-${g.label}`"
|
||||
:colspan="g.span"
|
||||
class="group-th"
|
||||
>
|
||||
{{ g.label }}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="sticky-col">
|
||||
<div class="text-xs text-gray-400 font-normal">账号 / 插件</div>
|
||||
</th>
|
||||
<th v-for="p in matrix.plugins" :key="p.id" class="plugin-col">
|
||||
<div class="font-medium text-[13px]">{{ p.name }}</div>
|
||||
<div class="text-[11px] text-gray-400 font-normal">v{{ p.latest_version }}</div>
|
||||
<th
|
||||
v-for="p in pagedColumns"
|
||||
:key="p.id"
|
||||
class="plugin-col"
|
||||
:class="{ 'col-active': hoverCol === p.id }"
|
||||
:title="`${p.name}(${p.id})· 点击只看此插件`"
|
||||
@click="focusPlugin(p.id)"
|
||||
@mouseenter="hoverCol = p.id"
|
||||
@mouseleave="hoverCol = ''"
|
||||
>
|
||||
<div class="font-medium text-[13px] name">{{ p.name }}</div>
|
||||
<div v-if="!compact" class="text-[11px] text-gray-400 font-normal">
|
||||
v{{ p.latest_version }}
|
||||
<span v-if="p.status && p.status !== 'published'" class="text-gray-400">
|
||||
· {{ p.status }}
|
||||
</span>
|
||||
</div>
|
||||
</th>
|
||||
<th v-if="!matrix.plugins?.length">暂无插件</th>
|
||||
<th v-if="!pagedColumns.length">无匹配插件列</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="a in rows" :key="a.account">
|
||||
<td class="sticky-col">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="size-7 rounded-lg grid place-items-center bg-[var(--el-color-primary-light-9)] text-[var(--el-color-primary)] text-xs font-bold shrink-0">
|
||||
<div
|
||||
class="size-7 rounded-lg grid place-items-center bg-[var(--el-color-primary-light-9)] text-[var(--el-color-primary)] text-xs font-bold shrink-0"
|
||||
>
|
||||
{{ (a.nickname || a.account || '?').slice(0, 1).toUpperCase() }}
|
||||
</div>
|
||||
<div class="min-w-0">
|
||||
@@ -119,38 +319,50 @@ async function toggle(account: string, pluginId: string, field: 'can_download' |
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td v-for="p in matrix.plugins" :key="p.id" align="center" :class="`state-${cellState(a.account, p.id)}`">
|
||||
<td
|
||||
v-for="p in pagedColumns"
|
||||
:key="p.id"
|
||||
align="center"
|
||||
:class="[`state-${cellState(a.account, p.id)}`, { 'col-active': hoverCol === p.id }]"
|
||||
@mouseenter="hoverCol = p.id"
|
||||
@mouseleave="hoverCol = ''"
|
||||
>
|
||||
<div class="flex items-center justify-center gap-1.5">
|
||||
<el-tooltip :content="cellOf(a.account, p.id)?.can_download ? '允许下载(点击撤销)' : '禁止下载(点击放行)'" placement="top" :show-after="300">
|
||||
<el-tag
|
||||
size="small"
|
||||
:type="cellOf(a.account, p.id)?.can_download ? 'success' : 'info'"
|
||||
:effect="cellOf(a.account, p.id)?.can_download ? 'light' : 'plain'"
|
||||
class="cursor-pointer select-none cell-tag"
|
||||
@click="toggle(a.account, p.id, 'can_download')"
|
||||
>⬇</el-tag>
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="cellOf(a.account, p.id)?.can_run ? '允许运行(点击撤销)' : '禁止运行(点击放行)'" placement="top" :show-after="300">
|
||||
<el-tag
|
||||
size="small"
|
||||
:type="cellOf(a.account, p.id)?.can_run ? 'success' : 'info'"
|
||||
:effect="cellOf(a.account, p.id)?.can_run ? 'light' : 'plain'"
|
||||
class="cursor-pointer select-none cell-tag"
|
||||
@click="toggle(a.account, p.id, 'can_run')"
|
||||
>▶</el-tag>
|
||||
</el-tooltip>
|
||||
<el-tag
|
||||
size="small"
|
||||
:type="cellOf(a.account, p.id)?.can_download ? 'success' : 'info'"
|
||||
:effect="cellOf(a.account, p.id)?.can_download ? 'light' : 'plain'"
|
||||
class="cursor-pointer select-none cell-tag"
|
||||
:title="cellOf(a.account, p.id)?.can_download ? '允许下载(点击撤销)' : '禁止下载(点击放行)'"
|
||||
@click="toggle(a.account, p.id, 'can_download')"
|
||||
>
|
||||
⬇
|
||||
</el-tag>
|
||||
<el-tag
|
||||
size="small"
|
||||
:type="cellOf(a.account, p.id)?.can_run ? 'success' : 'info'"
|
||||
:effect="cellOf(a.account, p.id)?.can_run ? 'light' : 'plain'"
|
||||
class="cursor-pointer select-none cell-tag"
|
||||
:title="cellOf(a.account, p.id)?.can_run ? '允许运行(点击撤销)' : '禁止运行(点击放行)'"
|
||||
@click="toggle(a.account, p.id, 'can_run')"
|
||||
>
|
||||
▶
|
||||
</el-tag>
|
||||
</div>
|
||||
</td>
|
||||
<td v-if="!matrix.plugins?.length" align="center">—</td>
|
||||
<td v-if="!pagedColumns.length" align="center">—</td>
|
||||
</tr>
|
||||
<tr v-if="!rows.length">
|
||||
<td :colspan="(matrix.plugins?.length || 0) + 1" align="center" class="py-8 text-gray-400 text-sm">无匹配账号</td>
|
||||
<td :colspan="pagedColumns.length + 1" align="center" class="py-8 text-gray-400 text-sm">
|
||||
无匹配账号
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</el-scrollbar>
|
||||
<div class="mt-2 text-xs text-gray-400">
|
||||
点击单元格内的 ⬇ / ▶ 徽标切换对应权限;下载与运行都关闭时自动撤销整条授权。
|
||||
点击单元格内的 ⬇ / ▶ 徽标切换对应权限;下载与运行都关闭时自动撤销整条授权。点击插件列头可只看该插件;
|
||||
插件多时先用「插件分类」Tab 收窄,再按需翻页。
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -178,6 +390,30 @@ async function toggle(account: string, pluginId: string, field: 'can_download' |
|
||||
z-index: 2;
|
||||
text-align: center;
|
||||
}
|
||||
/* 分组行固定在更上层,插件行紧随其后 */
|
||||
.matrix-table thead .group-row th {
|
||||
top: 0;
|
||||
height: 26px;
|
||||
padding: 3px 10px;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
color: var(--el-text-color-secondary);
|
||||
letter-spacing: 0.3px;
|
||||
}
|
||||
.matrix-table thead tr:not(.group-row) th {
|
||||
top: 32px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.matrix-table .plugin-col {
|
||||
max-width: 132px;
|
||||
min-width: 96px;
|
||||
}
|
||||
.matrix-table .plugin-col .name {
|
||||
max-width: 116px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.matrix-table .sticky-col {
|
||||
position: sticky;
|
||||
left: 0;
|
||||
@@ -189,12 +425,20 @@ async function toggle(account: string, pluginId: string, field: 'can_download' |
|
||||
.matrix-table thead .sticky-col {
|
||||
z-index: 3;
|
||||
}
|
||||
.matrix-table thead .group-row .sticky-col {
|
||||
z-index: 4;
|
||||
}
|
||||
.matrix-table td.state-full {
|
||||
background: var(--el-color-success-light-9);
|
||||
}
|
||||
.matrix-table td.state-partial {
|
||||
background: var(--el-color-warning-light-9);
|
||||
}
|
||||
/* 当前悬停列:描边高亮,长表横向跟踪用 */
|
||||
.matrix-table th.col-active,
|
||||
.matrix-table td.col-active {
|
||||
box-shadow: inset 0 0 0 2px var(--el-color-primary-light-5);
|
||||
}
|
||||
.matrix-table tbody tr:hover td {
|
||||
background-color: var(--el-fill-color-light);
|
||||
}
|
||||
@@ -208,4 +452,21 @@ async function toggle(account: string, pluginId: string, field: 'can_download' |
|
||||
font-size: 12px;
|
||||
padding: 0 7px;
|
||||
}
|
||||
/* 紧凑模式:压窄列宽,塞下更多插件列 */
|
||||
.matrix-table.is-compact th,
|
||||
.matrix-table.is-compact td {
|
||||
padding: 4px 6px;
|
||||
}
|
||||
.matrix-table.is-compact .plugin-col {
|
||||
max-width: 78px;
|
||||
min-width: 64px;
|
||||
}
|
||||
.matrix-table.is-compact .plugin-col .name {
|
||||
max-width: 66px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.matrix-table.is-compact .cell-tag {
|
||||
padding: 0 4px;
|
||||
font-size: 11px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -468,7 +468,8 @@ export class AdminPluginController extends BaseController {
|
||||
await this.centerAuthService.requirePerms(
|
||||
['center:grant:list', 'center:plugin:list'], xAdminToken, xApiToken);
|
||||
const m = this.accountPluginRepo.manager;
|
||||
const plugins: any[] = await m.query(`SELECT id, name, status, latest_version FROM plugins ORDER BY id`);
|
||||
const plugins: any[] = await m.query(
|
||||
`SELECT id, name, status, latest_version, category FROM plugins ORDER BY id`);
|
||||
const accounts: any[] = await m.query(
|
||||
`SELECT account, nickname, dept, status, is_admin FROM accounts ORDER BY account`
|
||||
);
|
||||
@@ -477,7 +478,10 @@ export class AdminPluginController extends BaseController {
|
||||
);
|
||||
const platforms: any[] = await m.query(`SELECT account, platform_id FROM account_platforms`);
|
||||
return {
|
||||
plugins: plugins.map(p => ({ id: p.id, name: p.name, status: p.status, latest_version: p.latest_version })),
|
||||
plugins: plugins.map(p => ({
|
||||
id: p.id, name: p.name, status: p.status,
|
||||
latest_version: p.latest_version, category: p.category || '',
|
||||
})),
|
||||
accounts: accounts.map(a => ({
|
||||
account: a.account, nickname: a.nickname || '', dept: a.dept || '',
|
||||
status: Number(a.status), is_admin: !!Number(a.is_admin),
|
||||
|
||||
Reference in New Issue
Block a user