修改VPN页面
This commit is contained in:
parent
91d6e0f3d1
commit
b51f41d9ff
|
|
@ -239,7 +239,9 @@
|
||||||
class="router-item"
|
class="router-item"
|
||||||
>
|
>
|
||||||
<el-input v-model="router.ip" placeholder="IP地址 (如: 192.168.1.1)" style="flex: 1;" />
|
<el-input v-model="router.ip" placeholder="IP地址 (如: 192.168.1.1)" style="flex: 1;" />
|
||||||
<el-input-number v-model="router.prefix" :min="1" :max="32" placeholder="前缀长度" style="flex: 1; margin-left: 10px;" />
|
<el-input-number v-model="router.prefix" :min="0" :max="32" placeholder="前缀长度" style="flex: 1; margin-left: 10px;" />
|
||||||
|
<!-- metric -->
|
||||||
|
<el-input-number v-model="router.metric" :min="0" :max="1000000" placeholder="metric" style="flex: 1; margin-left: 10px;" />
|
||||||
<el-button type="danger" size="small" text @click="removeRouter('ipv4', index)" style="margin-left: 10px;">
|
<el-button type="danger" size="small" text @click="removeRouter('ipv4', index)" style="margin-left: 10px;">
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
@ -260,7 +262,9 @@
|
||||||
class="router-item"
|
class="router-item"
|
||||||
>
|
>
|
||||||
<el-input v-model="router.ip" placeholder="IP地址 (如: 2001:db8::1)" style="flex: 1;" />
|
<el-input v-model="router.ip" placeholder="IP地址 (如: 2001:db8::1)" style="flex: 1;" />
|
||||||
<el-input-number v-model="router.prefix" :min="1" :max="128" placeholder="前缀长度" style="flex: 1; margin-left: 10px;" />
|
<el-input-number v-model="router.prefix" :min="0" :max="128" placeholder="前缀长度" style="flex: 1; margin-left: 10px;" />
|
||||||
|
<!-- metric -->
|
||||||
|
<el-input-number v-model="router.metric" :min="0" :max="1000000" placeholder="metric" style="flex: 1; margin-left: 10px;" />
|
||||||
<el-button type="danger" size="small" text @click="removeRouter('ipv6', index)" style="margin-left: 10px;">
|
<el-button type="danger" size="small" text @click="removeRouter('ipv6', index)" style="margin-left: 10px;">
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
@ -339,6 +343,7 @@ interface VPNRouter {
|
||||||
type: number;
|
type: number;
|
||||||
ip: string;
|
ip: string;
|
||||||
prefix: number;
|
prefix: number;
|
||||||
|
metric: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const serverList = ref<ServerConfig[]>([]);
|
const serverList = ref<ServerConfig[]>([]);
|
||||||
|
|
@ -542,7 +547,8 @@ const addRouter = (type: 'ipv4' | 'ipv6') => {
|
||||||
const router: VPNRouter = {
|
const router: VPNRouter = {
|
||||||
type: type === 'ipv4' ? 4 : 6,
|
type: type === 'ipv4' ? 4 : 6,
|
||||||
ip: '',
|
ip: '',
|
||||||
prefix: type === 'ipv4' ? 24 : 64
|
prefix: type === 'ipv4' ? 24 : 64,
|
||||||
|
metric: 35
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!selectedServer.value.ipv4_router) {
|
if (!selectedServer.value.ipv4_router) {
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
<el-table-column prop="private_ipv4" label="内网IPv4" width="140" />
|
<el-table-column prop="private_ipv4" label="内网IPv4" width="140" />
|
||||||
<el-table-column prop="uuid" label="会话ID" min-width="200" show-overflow-tooltip />
|
<el-table-column prop="uuid" label="会话ID" min-width="200" show-overflow-tooltip />
|
||||||
<el-table-column prop="host_info.hostname" label="主机名" min-width="200" show-overflow-tooltip />
|
<el-table-column prop="host_info.hostname" label="主机名" min-width="200" show-overflow-tooltip />
|
||||||
<el-table-column prop="host_info.os" label="操作系统" min-width="200" show-overflow-tooltip>
|
<el-table-column prop="host_info.os" label="操作系统" min-width="120" show-overflow-tooltip>
|
||||||
<!-- tags 操作系统, windows 蓝色; linux 绿色;macos 黄色; android 红色; ios 紫色; 其他 橙色 -->
|
<!-- tags 操作系统, windows 蓝色; linux 绿色;macos 黄色; android 红色; ios 紫色; 其他 橙色 -->
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tag v-if="scope.row.host_info.os === 'windows'" type="primary" size="small">Windows</el-tag>
|
<el-tag v-if="scope.row.host_info.os === 'windows'" type="primary" size="small">Windows</el-tag>
|
||||||
|
|
@ -386,6 +386,9 @@ const getOnlineUsers = async (serverId: string) => {
|
||||||
if (response["code"] === 0) {
|
if (response["code"] === 0) {
|
||||||
if(response.data){
|
if(response.data){
|
||||||
// 处理每个用户对象,确保 host_info 字段有有效的值
|
// 处理每个用户对象,确保 host_info 字段有有效的值
|
||||||
|
|
||||||
|
//根据key id排序
|
||||||
|
response.data.sort((a, b) => a.id - b.id);
|
||||||
onlineUsers.value = response.data.map((user: any) => ({
|
onlineUsers.value = response.data.map((user: any) => ({
|
||||||
...user,
|
...user,
|
||||||
host_info: user.host_info || createEmptyHostInfo()
|
host_info: user.host_info || createEmptyHostInfo()
|
||||||
|
|
@ -414,6 +417,8 @@ const getOnlineUsers2 = async (serverId: string) => {
|
||||||
if (response["code"] === 0) {
|
if (response["code"] === 0) {
|
||||||
if(response.data){
|
if(response.data){
|
||||||
// 处理每个用户对象,确保 host_info 字段有有效的值
|
// 处理每个用户对象,确保 host_info 字段有有效的值
|
||||||
|
//根据key id排序
|
||||||
|
response.data.sort((a, b) => a.id - b.id);
|
||||||
onlineUsers.value = response.data.map((user: any) => ({
|
onlineUsers.value = response.data.map((user: any) => ({
|
||||||
...user,
|
...user,
|
||||||
host_info: user.host_info || createEmptyHostInfo()
|
host_info: user.host_info || createEmptyHostInfo()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue