🎨新增客户端离线通知选项

This commit is contained in:
coward 2024-06-13 14:28:56 +08:00
parent 0ef9dfab57
commit e51d4445cf
2 changed files with 21 additions and 8 deletions

View File

@ -177,7 +177,8 @@ const openAddClientDialog = () => {
publicKey: "",
presharedKey: ""
},
enabled: 1
enabled: 1,
offlineMonitoring: 0
}
},
beforeSure: (done, { options }) => {
@ -216,7 +217,8 @@ const openEditClientDialog = (client?: any) => {
useServerDNS: client.useServerDNS,
enableAfterCreation: client.enableAfterCreation,
keys: client.keys,
enabled: Number(client.enabled)
enabled: Number(client.enabled),
offlineMonitoring: client.offlineMonitoring
}
},
beforeSure: (done, { options }) => {

View File

@ -4,7 +4,7 @@ import { FormInstance } from "element-plus";
import { storageLocal } from "@pureadmin/utils";
import { userKey } from "@/utils/auth";
import { clientFormRules } from "@/views/server/component/rules";
import {generateClientKeys} from "@/api/clients";
import { generateClientKeys } from "@/api/clients";
// props
export interface DetailFormProps {
@ -26,6 +26,7 @@ export interface DetailFormProps {
presharedKey: string;
};
enabled: number;
offlineMonitoring: number;
};
}
@ -49,7 +50,8 @@ const props = withDefaults(defineProps<DetailFormProps>(), {
publicKey: "",
presharedKey: ""
},
enabled: 1
enabled: 1,
offlineMonitoring: 0
})
});
@ -88,7 +90,10 @@ defineExpose({ getDetailFormRef });
<el-input v-model="detailForm.name" />
</el-form-item>
<el-form-item prop="email" label="邮箱">
<el-input v-model="detailForm.email" />
<el-input
v-model="detailForm.email"
placeholder="可用于离线监听通知或接收客户端配置文件"
/>
</el-form-item>
<el-form-item prop="subnetRange" label="子网范围">
<el-input v-model="detailForm.subnetRange" />
@ -146,27 +151,33 @@ defineExpose({ getDetailFormRef });
v-if="detailForm.id === ''"
v-model="detailForm.keys.privateKey"
/>
<el-input v-else disabled v-model="detailForm.keys.privateKey" />
<el-input v-else v-model="detailForm.keys.privateKey" disabled />
</el-form-item>
<el-form-item prop="publicKey" label="公钥">
<el-input
v-if="detailForm.id === ''"
v-model="detailForm.keys.publicKey"
/>
<el-input v-else disabled v-model="detailForm.keys.publicKey" />
<el-input v-else v-model="detailForm.keys.publicKey" disabled />
</el-form-item>
<el-form-item prop="presharedKey" label="共享密钥">
<el-input
v-if="detailForm.id === ''"
v-model="detailForm.keys.presharedKey"
/>
<el-input v-else disabled v-model="detailForm.keys.presharedKey" />
<el-input v-else v-model="detailForm.keys.presharedKey" disabled />
</el-form-item>
<el-form-item v-if="detailForm.id === ''">
<el-button type="primary" size="small" @click="generateClientKeysApi()"
>生成密钥对</el-button
>
</el-form-item>
<el-form-item prop="OfflineMonitoring" label="是否启用离线监听">
<el-radio-group v-model="detailForm.offlineMonitoring">
<el-radio :value="1"></el-radio>
<el-radio :value="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="useServerDNS" label="是否使用服务端DNS">
<el-radio-group v-model="detailForm.useServerDNS">
<el-radio :value="1"></el-radio>