This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
deleteClient,
|
||||
downloadClient,
|
||||
downloadClient, generateClientIP,
|
||||
getClients,
|
||||
saveClient
|
||||
} from "@/api/clients";
|
||||
@@ -139,6 +139,17 @@ const openQrCodeDialog = (clientName: string, id: string) => {
|
||||
|
||||
// 打开新增客户端弹窗
|
||||
const openAddClientDialog = () => {
|
||||
let clientIP = ref([]);
|
||||
let serverIP = ref([]);
|
||||
// 先 生成客户端IP
|
||||
generateClientIP({
|
||||
rule: "AUTO"
|
||||
}).then(res => {
|
||||
if (res.code === 200) {
|
||||
clientIP.value = res.data.clientIP;
|
||||
serverIP.value = res.data.serverIP;
|
||||
}
|
||||
});
|
||||
const serverInfo = storageLocal().getItem("server-info");
|
||||
addDialog({
|
||||
width: "40%",
|
||||
@@ -151,13 +162,17 @@ const openAddClientDialog = () => {
|
||||
name: "",
|
||||
email: "",
|
||||
subnetRange: "",
|
||||
ipAllocation: "",
|
||||
allowedIPS: "",
|
||||
ipAllocation: clientIP,
|
||||
allowedIPS: serverIP,
|
||||
extraAllowedIPS: "",
|
||||
endpoint: "",
|
||||
useServerDNS: 0,
|
||||
enableAfterCreation: 0,
|
||||
keys: null,
|
||||
keys: {
|
||||
privateKey: "",
|
||||
publicKey: "",
|
||||
presharedKey: ""
|
||||
},
|
||||
enabled: 1
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user