|
113 | 113 | persistent-hint :readonly="!inEdit" />
|
114 | 114 | <v-text-field v-model="selected.device.id" label="Device ID" readonly />
|
115 | 115 | <v-text-field v-model="selected.device.server" label="Server" :readonly="!inEdit" />
|
116 |
| - <v-text-field v-model="selected.device.apiKey" label="API Key" readonly |
117 |
| - :append-icon="showApiKey ? 'mdi-eye' : 'mdi-eye-off'" |
118 |
| - :type="showApiKey ? 'text' : 'password'" |
119 |
| - @click:append="showApiKey = !showApiKey" /> |
| 116 | + |
| 117 | + <v-text-field v-if="!inEdit" label="API Key" readonly |
| 118 | + append-icon="mdi-content-copy" @click:append="copy(selected.device.apiKey)">* * * *</v-text-field> |
| 119 | + <v-text-field v-if="inEdit" v-model="selected.device.apiKey" label="API Key" /> |
| 120 | + |
120 | 121 | <v-text-field v-model="selected.device.instanceid" label="AWS or Azure Instance ID" :readonly="!inEdit" />
|
121 | 122 | <div :hidden="!inEdit">
|
122 | 123 | <v-text-field v-model="selected.device.name" label="Device friendly name"
|
|
240 | 241 | label="Role" single dark />
|
241 | 242 | <v-text-field v-model="selected.vpn.current.table" label="Table" />
|
242 | 243 | <v-text-field v-model="selected.vpn.current.publicKey" label="Public key" />
|
243 |
| - <v-text-field v-model="selected.vpn.current.privateKey" label="Private key" |
244 |
| - autocomplete="off" |
245 |
| - :append-icon="showPrivate ? 'mdi-eye' : 'mdi-eye-off'" |
246 |
| - :type="showPrivate ? 'text' : 'password'" |
247 |
| - hint="Clear this field to have the client manage its private key" |
248 |
| - @click:append="showPrivate = !showPrivate" /> |
249 |
| - <v-text-field v-model="selected.vpn.current.presharedKey" |
250 |
| - label="Preshared Key" autocomplete="off" |
251 |
| - :append-icon="showPreshared ? 'mdi-eye' : 'mdi-eye-off'" |
252 |
| - :type="showPreshared ? 'text' : 'password'" |
253 |
| - @click:append="showPreshared = !showPreshared" /> |
| 244 | + <v-text-field v-if="!editPrivate" label="Private key" readonly append-icon="mdi-square-edit-outline" @click:append="editPrivate = true" /> |
| 245 | + <v-text-field v-if="editPrivate" v-model="selected.vpn.current.privateKey" label="Private key" |
| 246 | + hint="Clear this field to have the client manage its private key" /> |
| 247 | + <v-text-field label="Preshared Key" readonly |
| 248 | + append-icon="mdi-content-copy" @click:append="copy(selected.vpn.current.presharedKey)" /> |
254 | 249 | <v-text-field type="number"
|
255 | 250 | v-model="selected.vpn.current.persistentKeepalive"
|
256 | 251 | label="Persistent keepalive"
|
@@ -551,6 +546,7 @@ export default {
|
551 | 546 | showApiKey: false,
|
552 | 547 | showTree: false,
|
553 | 548 | friendly: false,
|
| 549 | + editPrivate: false, |
554 | 550 | use_ezcode: true,
|
555 | 551 | footerProps: { 'items-per-page-options': [25, 50, 100, -1] },
|
556 | 552 | dialogCreate: false,
|
@@ -1049,6 +1045,7 @@ export default {
|
1049 | 1045 | //}
|
1050 | 1046 | vpn = this.vpn
|
1051 | 1047 | this.inEdit = false;
|
| 1048 | + this.editPrivate = false; |
1052 | 1049 | this.updatevpn(this.vpn)
|
1053 | 1050 | // this.updatedevice_vpn(this.vpn)
|
1054 | 1051 | // this.Refreshing()
|
@@ -1128,7 +1125,7 @@ export default {
|
1128 | 1125 | this.addNet.items[i+1] = { "text": this.nets[i].netName, "value": this.nets[i] }
|
1129 | 1126 | }
|
1130 | 1127 | },
|
1131 |
| - |
| 1128 | +
|
1132 | 1129 | copyDeviceConfig(device) {
|
1133 | 1130 | var url = "curl \"http://localhost:53280/config/?id=" + device.id + "&apiKey=" + device.apiKey + "&server=" + device.server + "\""
|
1134 | 1131 |
|
@@ -1166,6 +1163,15 @@ export default {
|
1166 | 1163 | this.Refreshing()
|
1167 | 1164 | },
|
1168 | 1165 |
|
| 1166 | + copy(text) { |
| 1167 | + navigator.clipboard |
| 1168 | + .writeText(text) |
| 1169 | + .then(() => { |
| 1170 | + this.errorDevice("Copied to clipboard") |
| 1171 | + }) |
| 1172 | + }, |
| 1173 | +
|
| 1174 | +
|
1169 | 1175 | async forceFileDownload(vpn) {
|
1170 | 1176 | console.log(vpn)
|
1171 | 1177 | await this.readvpnconfig(vpn)
|
|
0 commit comments