feat: 新增通知推送功能及离线登录,优化重连逻辑
- 新增通知推送模块:支持 WebSocket 实时推送与轮询兜底,新增通知管理界面 - 新增离线登录功能:断网时凭本地 7 天授权票据自动登录或手动登录 - 优化 Electron 客户端 WebSocket 重连逻辑,避免死循环 - 调整工作流脚本,拆分重构合同相关分支逻辑 - 新增设备上报客户端版本字段,用于升级追踪与关旧依据
This commit is contained in:
Binary file not shown.
@@ -49,7 +49,7 @@
|
||||
|
||||
<script setup>
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { ArrowDown, Lock, SwitchButton, Odometer, TrendCharts, Box, User, Key, Document, Files } from '@element-plus/icons-vue'
|
||||
import { ArrowDown, Lock, SwitchButton, Odometer, TrendCharts, Box, User, Key, Document, Files, Monitor, Bell } from '@element-plus/icons-vue'
|
||||
import { ElMessage as message } from 'element-plus'
|
||||
import LoginPage from './components/LoginPage.vue'
|
||||
import PasswordDialog from './components/PasswordDialog.vue'
|
||||
@@ -61,12 +61,16 @@ import StatsView from './views/StatsView.vue'
|
||||
import AuditView from './views/AuditView.vue'
|
||||
import CredsManageView from './views/CredsManageView.vue'
|
||||
import FileSourceManageView from './views/FileSourceManageView.vue'
|
||||
import UpgradeView from './views/UpgradeView.vue'
|
||||
import NotifyManageView from './views/NotifyManageView.vue'
|
||||
import { store, clearSession } from './store'
|
||||
import { adminMe } from './api'
|
||||
|
||||
const menuOptions = [
|
||||
{ label: '概览', key: 'overview', icon: Odometer },
|
||||
{ label: '数据看板', key: 'stats', icon: TrendCharts },
|
||||
{ label: '升级进度', key: 'upgrade', icon: Monitor, admin: true },
|
||||
{ label: '通知推送', key: 'notify', icon: Bell, admin: true },
|
||||
{ label: '插件管理', key: 'plugins', icon: Box },
|
||||
{ label: '账号管理', key: 'accounts', icon: User },
|
||||
{ label: '权限授权', key: 'grants', icon: Key },
|
||||
@@ -80,6 +84,8 @@ const menu = computed(() => menuOptions.filter(m => !m.admin || store.isAdmin))
|
||||
const KEY = {
|
||||
'#/overview': 'overview',
|
||||
'#/stats': 'stats',
|
||||
'#/upgrade': 'upgrade',
|
||||
'#/notify': 'notify',
|
||||
'#/plugins': 'plugins',
|
||||
'#/accounts': 'accounts',
|
||||
'#/grants': 'grants',
|
||||
@@ -90,6 +96,8 @@ const KEY = {
|
||||
const VIEWS = {
|
||||
'#/overview': OverviewView,
|
||||
'#/stats': StatsView,
|
||||
'#/upgrade': UpgradeView,
|
||||
'#/notify': NotifyManageView,
|
||||
'#/plugins': PluginManageView,
|
||||
'#/accounts': AccountManageView,
|
||||
'#/grants': GrantManageView,
|
||||
|
||||
@@ -155,6 +155,13 @@ export async function adminReports(page = 1, pageSize = 20, filters = {}) {
|
||||
export async function adminStats() {
|
||||
return req('/api/admin/stats', { headers: adminHeaders() })
|
||||
}
|
||||
// 客户端升级追踪:按版本统计 + 按账号分组(关旧控制面依据)
|
||||
export async function adminDevicesSummary() {
|
||||
return req('/api/admin/devices/summary', { headers: adminHeaders() })
|
||||
}
|
||||
export async function adminDevices(page = 1, pageSize = 20) {
|
||||
return req('/api/admin/devices?' + pagedQuery({ page, page_size: pageSize }), { headers: adminHeaders() })
|
||||
}
|
||||
export async function adminCredsList(page = 1, pageSize = 20) {
|
||||
return req('/api/admin/creds/manage?' + pagedQuery({ page, page_size: pageSize }), { headers: adminHeaders() })
|
||||
}
|
||||
@@ -198,4 +205,23 @@ export async function adminUpload(pluginId, name, version, file) {
|
||||
fd.append('upload', file)
|
||||
const qs = new URLSearchParams({ plugin_id: pluginId, name, version })
|
||||
return req('/api/admin/pkg?' + qs.toString(), { method: 'POST', headers: adminHeaders(), body: fd })
|
||||
}
|
||||
// ===== 通知推送 =====
|
||||
export async function adminNotifications(page = 1, pageSize = 20, q = '') {
|
||||
const qs = pagedQuery({ page, page_size: pageSize })
|
||||
const url = '/api/admin/notifications?' + qs + (q ? '&q=' + encodeURIComponent(q) : '')
|
||||
return req(url, { headers: adminHeaders() })
|
||||
}
|
||||
export async function adminNotificationCreate(body) {
|
||||
return req('/api/admin/notifications', {
|
||||
method: 'POST',
|
||||
headers: adminHeaders({ 'Content-Type': 'application/json' }),
|
||||
body: JSON.stringify(body)
|
||||
})
|
||||
}
|
||||
export async function adminNotificationToggle(id, active) {
|
||||
return req(`/api/admin/notifications/${id}?active=${active}`, { method: 'PATCH', headers: adminHeaders() })
|
||||
}
|
||||
export async function adminNotificationDelete(id) {
|
||||
return req(`/api/admin/notifications/${id}`, { method: 'DELETE', headers: adminHeaders() })
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="page-head cp-rise">
|
||||
<div>
|
||||
<h3>通知推送 <span class="badge">Notify</span></h3>
|
||||
<p>向客户端推送通知(全部账号或指定账号)· 客户端定时拉取并弹系统通知</p>
|
||||
</div>
|
||||
<div style="display:flex;gap:10px">
|
||||
<el-button type="primary" :icon="Plus" @click="openCreate">新建通知</el-button>
|
||||
<el-button :loading="busy" :icon="Refresh" @click="reload">刷新</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cp-card cp-rise" style="padding: 12px 16px">
|
||||
<el-table :data="items" size="small" v-loading="busy" :row-key="r => r.id">
|
||||
<el-table-column label="ID" width="60">
|
||||
<template #default="{ row }"><span class="mono">{{ row.id }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="级别" width="90">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="levelType(row.level)" size="small" effect="light">{{ levelLabel(row.level) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="标题" width="180" show-overflow-tooltip>
|
||||
<template #default="{ row }"><b>{{ row.title }}</b></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="内容" min-width="240" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.content || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="范围" width="170">
|
||||
<template #default="{ row }">
|
||||
<template v-if="row.target === 'all'">全部账号</template>
|
||||
<template v-else>账号 {{ row.account }}{{ acctName(row.account) ? '(' + acctName(row.account) + ')' : '' }}</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" width="150">
|
||||
<template #default="{ row }"><span class="mono dim-sm">{{ fmtTime(row.created_at) }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="80">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.active ? 'success' : 'info'" size="small">{{ row.active ? '启用' : '停用' }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" size="small" @click="toggle(row)">{{ row.active ? '停用' : '启用' }}</el-button>
|
||||
<el-button link type="danger" size="small" @click="del(row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<PagerBar :total="total" :page="page" :page-size="pageSize" @change="onPageChange" />
|
||||
</div>
|
||||
|
||||
<!-- 新建通知 -->
|
||||
<el-dialog v-model="dlgOpen" title="新建通知" width="520px" destroy-on-close>
|
||||
<el-form label-width="70px">
|
||||
<el-form-item label="标题" required>
|
||||
<el-input v-model="form.title" placeholder="如:插件更新提醒" maxlength="200" />
|
||||
</el-form-item>
|
||||
<el-form-item label="内容">
|
||||
<el-input v-model="form.content" type="textarea" :rows="3" placeholder="通知正文(可选)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="级别">
|
||||
<el-radio-group v-model="form.level">
|
||||
<el-radio-button value="info">一般</el-radio-button>
|
||||
<el-radio-button value="warning">提醒</el-radio-button>
|
||||
<el-radio-button value="important">重要</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="范围">
|
||||
<el-radio-group v-model="form.target">
|
||||
<el-radio-button value="all">全部账号</el-radio-button>
|
||||
<el-radio-button value="account">指定账号</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.target === 'account'" label="账号" required>
|
||||
<el-select
|
||||
v-model="form.account"
|
||||
filterable
|
||||
placeholder="搜索选择账号(昵称 / 工号)"
|
||||
style="width:100%"
|
||||
:loading="acctLoading"
|
||||
>
|
||||
<el-option v-for="a in accounts" :key="a.account" :label="acctLabel(a)" :value="a.account" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="有效期">
|
||||
<el-date-picker
|
||||
v-model="form.expires_at"
|
||||
type="datetime"
|
||||
placeholder="空 = 长期有效"
|
||||
value-format="YYYY-MM-DDTHH:mm:ss"
|
||||
style="width:100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="dlgOpen = false">取消</el-button>
|
||||
<el-button type="primary" :loading="saving" @click="create">发送</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, reactive, ref } from 'vue'
|
||||
import { Plus, Refresh } from '@element-plus/icons-vue'
|
||||
import { ElMessage as message, ElMessageBox } from 'element-plus'
|
||||
import { adminNotifications, adminNotificationCreate, adminNotificationToggle, adminNotificationDelete, adminAccounts } from '../api'
|
||||
import { fmtTime } from '../format'
|
||||
import PagerBar from '../components/PagerBar.vue'
|
||||
import { usePagedList } from '../composables/usePagedList'
|
||||
|
||||
const list = usePagedList((p, s, q) => adminNotifications(p, s, q || ''), { onError: e => message.error('读取失败:' + (e.message || e)) })
|
||||
const { items, total, page, size: pageSize, busy, load: reload, onPageChange } = list
|
||||
|
||||
function levelType(l) {
|
||||
return { info: 'info', warning: 'warning', important: 'danger' }[l] || 'info'
|
||||
}
|
||||
function levelLabel(l) {
|
||||
return { info: '一般', warning: '提醒', important: '重要' }[l] || l
|
||||
}
|
||||
|
||||
// 账号下拉(昵称 + 工号)
|
||||
const accounts = ref([])
|
||||
const acctLoading = ref(false)
|
||||
const acctMap = computed(() => {
|
||||
const m = {}
|
||||
for (const a of accounts.value) m[a.account] = a.nickname || ''
|
||||
return m
|
||||
})
|
||||
function acctLabel(a) {
|
||||
return a.nickname ? `${a.nickname}(${a.account})` : a.account
|
||||
}
|
||||
function acctName(account) {
|
||||
return acctMap.value[account] || ''
|
||||
}
|
||||
async function loadAccounts() {
|
||||
acctLoading.value = true
|
||||
try {
|
||||
const r = await adminAccounts(1, 200)
|
||||
accounts.value = r.items || []
|
||||
} catch (e) {
|
||||
message.warning('账号列表加载失败:' + (e.message || e))
|
||||
} finally {
|
||||
acctLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 新建
|
||||
const dlgOpen = ref(false)
|
||||
const saving = ref(false)
|
||||
const form = reactive({ title: '', content: '', level: 'info', target: 'all', account: '', expires_at: '' })
|
||||
|
||||
function openCreate() {
|
||||
form.title = ''; form.content = ''; form.level = 'info'; form.target = 'all'; form.account = ''; form.expires_at = ''
|
||||
dlgOpen.value = true
|
||||
void loadAccounts()
|
||||
}
|
||||
|
||||
async function create() {
|
||||
if (!form.title.trim()) { message.warning('请填写标题'); return }
|
||||
if (form.target === 'account' && !form.account.trim()) { message.warning('指定账号时请填写目标账号'); return }
|
||||
saving.value = true
|
||||
try {
|
||||
await adminNotificationCreate({
|
||||
title: form.title.trim(), content: form.content, level: form.level,
|
||||
target: form.target, account: form.account.trim(), expires_at: form.expires_at || '',
|
||||
})
|
||||
message.success('通知已发送')
|
||||
dlgOpen.value = false
|
||||
await reload()
|
||||
} catch (e) { message.error('发送失败:' + (e.message || e)) }
|
||||
finally { saving.value = false }
|
||||
}
|
||||
|
||||
async function toggle(row) {
|
||||
try {
|
||||
await adminNotificationToggle(row.id, !row.active)
|
||||
message.success(row.active ? '已停用' : '已启用')
|
||||
await reload()
|
||||
} catch (e) { message.error('操作失败:' + (e.message || e)) }
|
||||
}
|
||||
|
||||
async function del(row) {
|
||||
try {
|
||||
await ElMessageBox.confirm(`确定删除通知「${row.title}」?`, '删除确认', { type: 'warning' })
|
||||
await adminNotificationDelete(row.id)
|
||||
message.success('已删除')
|
||||
await reload()
|
||||
} catch (e) {
|
||||
if (e !== 'cancel' && e !== 'close') message.error('删除失败:' + (e.message || e))
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,198 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="page-head cp-rise">
|
||||
<div>
|
||||
<h3>升级进度 <span class="badge">Upgrade</span></h3>
|
||||
<p>客户端版本追踪 · 按版本/账号查看升级情况(决定何时关闭旧控制面的依据)</p>
|
||||
</div>
|
||||
<el-button :loading="busy" :icon="Refresh" @click="refresh">刷新</el-button>
|
||||
</div>
|
||||
|
||||
<template v-if="s">
|
||||
<!-- KPI -->
|
||||
<div class="kpis cp-rise">
|
||||
<div class="kpi cp-card" v-for="(k, i) in kpis" :key="k.label" :style="{ animationDelay: i * 50 + 'ms' }">
|
||||
<div class="kpi-ic" :style="{ background: k.bg, color: k.color }"><el-icon :size="17"><component :is="k.icon" /></el-icon></div>
|
||||
<div class="kpi-meta">
|
||||
<div class="kpi-num mono" :style="{ color: k.color }">{{ k.value }}</div>
|
||||
<div class="kpi-lab">{{ k.label }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 版本分布 -->
|
||||
<div class="cp-card cp-rise ver-card">
|
||||
<div class="card-title">客户端版本分布 <span class="sub">按设备数 · 最新版高亮</span></div>
|
||||
<div class="ver" v-for="v in versions" :key="v.client_version || '(empty)'">
|
||||
<div class="vhead">
|
||||
<span class="vtag mono" :class="{ latest: v.latest }">{{ v.client_version || '未上报' }}</span>
|
||||
<em>{{ v.count }} 台 · {{ pct(v.count) }}%</em>
|
||||
</div>
|
||||
<div class="vbar"><i :class="{ latest: v.latest }" :style="{ width: pct(v.count) + '%' }"></i></div>
|
||||
</div>
|
||||
<div v-if="!(s.by_version || []).length" class="empty">暂无设备上报</div>
|
||||
</div>
|
||||
|
||||
<!-- 按账号 -->
|
||||
<div class="cp-card cp-rise acct-card">
|
||||
<div class="card-title">按账号查看 <span class="sub">账号 × 客户端版本 × 设备数</span></div>
|
||||
<el-table :data="s.by_account || []" size="small">
|
||||
<el-table-column label="姓名 / 账号" min-width="220">
|
||||
<template #default="{ row }">
|
||||
<div class="who">
|
||||
<span class="wname">{{ row.nickname || '(未命名)' }}</span>
|
||||
<span class="mono wacct">{{ row.account || '—' }}</span>
|
||||
<el-tag v-if="row.dept" size="small" effect="plain" type="info">{{ row.dept }}</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客户端版本" width="180">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="versionType(row.client_version)" size="small" effect="light">{{ row.client_version || '未上报' }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备数" width="110">
|
||||
<template #default="{ row }"><span class="mono">{{ row.device_count }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最后在线" min-width="150">
|
||||
<template #default="{ row }"><span class="mono dim-sm">{{ fmtTime(row.last_seen) }}</span></template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<!-- 设备明细 -->
|
||||
<div class="cp-card cp-rise dev-card">
|
||||
<div class="card-title">设备明细 <span class="sub">最近心跳倒序 · 上报后自动更新版本</span></div>
|
||||
<el-table :data="devices" size="small" v-loading="devBusy" :row-key="r => r.device_id">
|
||||
<el-table-column label="设备ID" min-width="150">
|
||||
<template #default="{ row }"><span class="mono">{{ row.device_id }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="账号" width="140">
|
||||
<template #default="{ row }"><span class="mono">{{ row.account || '—' }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="主机名" min-width="140" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.hostname || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="版本" width="130">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="versionType(row.client_version)" size="small" effect="light">{{ row.client_version || '未上报' }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="Chrome" width="90">
|
||||
<template #default="{ row }"><span :style="{ color: row.chrome_ok ? '#1d9d5c' : '#d6453d' }">{{ row.chrome_ok ? '✔ 就绪' : '✘ 异常' }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最后在线" width="150">
|
||||
<template #default="{ row }"><span class="mono dim-sm">{{ fmtTime(row.last_seen) }}</span></template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<PagerBar :total="devTotal" :page="page" :page-size="pageSize" @change="onPageChange" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-skeleton v-else-if="busy" animated :rows="5" style="margin-top: 20px" />
|
||||
<div v-else class="empty-tip cp-card cp-rise">加载失败或暂无数据</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { Refresh, Monitor, SuccessFilled, WarningFilled, QuestionFilled } from '@element-plus/icons-vue'
|
||||
import { ElMessage as message } from 'element-plus'
|
||||
import { adminDevicesSummary, adminDevices } from '../api'
|
||||
import { fmtTime } from '../format'
|
||||
import PagerBar from '../components/PagerBar.vue'
|
||||
import { usePagedList } from '../composables/usePagedList'
|
||||
|
||||
const busy = ref(false)
|
||||
const s = ref(null)
|
||||
|
||||
const deviceList = usePagedList((p, s) => adminDevices(p, s), { onError: e => message.error('读取失败:' + (e.message || e)) })
|
||||
const { items: devices, total: devTotal, page, size: pageSize, busy: devBusy, load: loadDevices, onPageChange } = deviceList
|
||||
|
||||
// 版本号比较:按 . 分段数值比较
|
||||
function cmpVersion(a, b) {
|
||||
const pa = (a || '').split('.').map(x => parseInt(x, 10) || 0)
|
||||
const pb = (b || '').split('.').map(x => parseInt(x, 10) || 0)
|
||||
for (let i = 0; i < Math.max(pa.length, pb.length); i++) {
|
||||
const d = (pa[i] || 0) - (pb[i] || 0)
|
||||
if (d) return d
|
||||
}
|
||||
return 0
|
||||
}
|
||||
const latestVersion = computed(() => {
|
||||
const vs = (s.value?.by_version || []).map(v => v.client_version || '').filter(Boolean)
|
||||
if (!vs.length) return ''
|
||||
return vs.reduce((a, b) => (cmpVersion(a, b) >= 0 ? a : b))
|
||||
})
|
||||
const versions = computed(() =>
|
||||
(s.value?.by_version || []).map(v => ({
|
||||
...v,
|
||||
latest: !!v.client_version && cmpVersion(v.client_version, latestVersion.value) === 0,
|
||||
})))
|
||||
|
||||
const kpis = computed(() => {
|
||||
const total = s.value?.total || 0
|
||||
const vs = versions.value
|
||||
const latest = vs.filter(v => v.latest).reduce((n, v) => n + v.count, 0)
|
||||
const empty = vs.filter(v => !v.client_version).reduce((n, v) => n + v.count, 0)
|
||||
const old = Math.max(0, total - latest - empty)
|
||||
return [
|
||||
{ label: '总设备数', value: total, icon: Monitor, color: '#2f5cf0', bg: 'linear-gradient(135deg,#e8edfe,#d7e1fd)' },
|
||||
{ label: `已升级 ${latestVersion.value || ''}`.trim(), value: latest, icon: SuccessFilled, color: '#1d9d5c', bg: 'linear-gradient(135deg,#e5f6ed,#d2efe0)' },
|
||||
{ label: '旧版本', value: old, icon: WarningFilled, color: '#d97706', bg: 'linear-gradient(135deg,#fbf0df,#f6e4c8)' },
|
||||
{ label: '未上报版本', value: empty, icon: QuestionFilled, color: '#7a8398', bg: 'linear-gradient(135deg,#eef0f4,#e3e6ec)' },
|
||||
]
|
||||
})
|
||||
|
||||
function pct(n) {
|
||||
const total = s.value?.total || 0
|
||||
return total ? Math.round((n / total) * 100) : 0
|
||||
}
|
||||
function versionType(v) {
|
||||
if (!v) return 'info'
|
||||
return cmpVersion(v, latestVersion.value) === 0 ? 'success' : 'warning'
|
||||
}
|
||||
|
||||
async function refresh() {
|
||||
busy.value = true
|
||||
try {
|
||||
s.value = await adminDevicesSummary()
|
||||
await loadDevices()
|
||||
} catch (e) { message.error('读取失败:' + (e.message || e)) }
|
||||
finally { busy.value = false }
|
||||
}
|
||||
|
||||
onMounted(refresh)
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
|
||||
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
|
||||
.kpi { display: flex; align-items: center; gap: 14px; padding: 18px; }
|
||||
.kpi-ic { width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0; display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7); }
|
||||
.kpi-num { font-size: 24px; font-weight: 800; line-height: 1.1; }
|
||||
.kpi-lab { font-size: 12px; color: var(--cp-ink-3); margin-top: 4px; letter-spacing: .3px; }
|
||||
|
||||
.ver-card, .acct-card, .dev-card { padding: 20px; margin-bottom: 18px; }
|
||||
.card-title { margin-bottom: 14px; }
|
||||
.card-title .sub { font-size: 11px; font-weight: 500; color: var(--cp-ink-3); margin-left: 4px; }
|
||||
|
||||
.ver { margin-bottom: 12px; }
|
||||
.ver:last-child { margin-bottom: 0; }
|
||||
.vhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
|
||||
.vtag {
|
||||
display: inline-block; padding: 2px 10px; border-radius: 6px;
|
||||
background: var(--cp-panel-2); color: var(--cp-ink-2); font-size: 12px; font-weight: 700;
|
||||
}
|
||||
.vtag.latest { background: linear-gradient(135deg, var(--cp-blue), var(--cp-teal)); color: #fff; }
|
||||
.vhead em { font-style: normal; font-size: 11.5px; color: var(--cp-ink-3); }
|
||||
.vbar { height: 7px; border-radius: 4px; background: var(--cp-panel-2); overflow: hidden; }
|
||||
.vbar i { display: block; height: 100%; background: var(--cp-panel); border-radius: 4px; transition: width .6s cubic-bezier(.22, .61, .36, 1); }
|
||||
.vbar i.latest { background: linear-gradient(90deg, var(--cp-blue), var(--cp-teal)); }
|
||||
.empty { color: var(--cp-ink-3); font-size: 12px; text-align: center; padding: 18px 0; }
|
||||
.empty-tip { padding: 40px; text-align: center; color: var(--cp-ink-3); }
|
||||
.dim-sm { color: var(--cp-ink-2); font-size: 12px; }
|
||||
.who { display: flex; align-items: center; gap: 8px; }
|
||||
.wname { font-weight: 700; color: var(--cp-ink-1); }
|
||||
.wacct { font-size: 12px; color: var(--cp-ink-3); }
|
||||
</style>
|
||||
Reference in New Issue
Block a user