:art:完成基本构想的全部
All checks were successful
continuous-integration/drone/tag Build is passing

This commit is contained in:
coward
2024-06-06 17:02:45 +08:00
parent 1bc4e7869a
commit b02ce4b0ba
24 changed files with 432 additions and 40 deletions

View File

@@ -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
}
},