feat(admin): 会话管理新增并发计数范围配置

SessionManagement页面与i18n新增concurrentScope(GLOBAL/PER_DEVICE)radio及概览标签
This commit is contained in:
DaxPay Dev
2026-07-12 12:32:16 +08:00
parent d073c6036c
commit b3dd7b963c
4 changed files with 54 additions and 0 deletions

View File

@@ -125,6 +125,8 @@ export interface SessionManagementConfig {
maxConcurrentSessions?: number;
/** 并发策略 */
concurrentStrategy?: string;
/** 并发计数范围 GLOBAL=全局共享 / PER_DEVICE=按终端独立 */
concurrentScope?: string;
}
/**

View File

@@ -7,6 +7,7 @@
"online": "Online {hours} hours",
"active": "Active {hours} hours",
"concurrent": "Concurrent {count} sessions",
"scope": "Scope {name}",
"strategy": "Strategy {name}"
},
"section": {
@@ -39,5 +40,11 @@
"newSession": "Allow New Session",
"kickOldest": "Kick Oldest Session",
"denyNew": "Deny New Session"
},
"concurrentScope": {
"label": "Concurrent Counting Scope",
"desc": "Global: all terminals share one quota pool; Per Device: each terminal type counts independently.",
"global": "Global",
"perDevice": "Per Device"
}
}

View File

@@ -7,6 +7,7 @@
"online": "在线 {hours} 小时",
"active": "活跃 {hours} 小时",
"concurrent": "并发 {count} 个",
"scope": "范围 {name}",
"strategy": "策略 {name}"
},
"section": {
@@ -39,5 +40,11 @@
"newSession": "允许新会话",
"kickOldest": "踢出最早会话",
"denyNew": "拒绝新会话"
},
"concurrentScope": {
"label": "并发计数范围",
"desc": "全局共享:所有终端共用一个配额池;按终端独立:每类终端各自计数互不影响。",
"global": "全局共享",
"perDevice": "按终端独立"
}
}

View File

@@ -28,10 +28,22 @@
{ label: $t('system.security.session-management.concurrentStrategy.denyNew'), value: 'DENY_NEW' },
];
// 并发计数范围选项
const concurrentScopeOptions = [
// 全局共享
{ label: $t('system.security.session-management.concurrentScope.global'), value: 'GLOBAL' },
// 按终端独立
{ label: $t('system.security.session-management.concurrentScope.perDevice'), value: 'PER_DEVICE' },
];
const currentStrategyLabel = computed(() => {
return concurrentStrategyOptions.find((item) => item.value === formState.value.concurrentStrategy)?.label || '-';
});
const currentScopeLabel = computed(() => {
return concurrentScopeOptions.find((item) => item.value === formState.value.concurrentScope)?.label || '-';
});
const summaryItems = computed(() => {
return [
// 控制启用状态
@@ -46,6 +58,8 @@
$t('system.security.session-management.summary.concurrent', {
count: formState.value.maxConcurrentSessions ?? 0,
}),
// 计数范围
$t('system.security.session-management.summary.scope', { name: currentScopeLabel.value }),
// 策略名称
$t('system.security.session-management.summary.strategy', { name: currentStrategyLabel.value }),
];
@@ -249,6 +263,30 @@
<!-- 超限策略与清理 -->
<div class="config-section__title">{{ $t('system.security.session-management.section.policy') }}</div>
<div class="config-item config-item--block">
<div class="config-item__main">
<!-- 并发计数范围标签 -->
<div class="config-item__label">{{
$t('system.security.session-management.concurrentScope.label')
}}</div>
<!-- 并发计数范围描述 -->
<div class="config-item__desc">{{
$t('system.security.session-management.concurrentScope.desc')
}}</div>
</div>
<a-radio-group
v-model:value="formState.concurrentScope"
button-style="solid"
:disabled="!isEditing"
>
<a-radio-button
v-for="item in concurrentScopeOptions"
:key="item.value"
:value="item.value"
>{{ item.label }}</a-radio-button>
</a-radio-group>
</div>
<div class="config-item config-item--block">
<div class="config-item__main">
<!-- 并发超限处理策略标签 -->