small fixes
This commit is contained in:
@@ -27,7 +27,7 @@ func (o *Outbound) UnmarshalJSON(data []byte) error {
|
|||||||
delete(raw, "tag")
|
delete(raw, "tag")
|
||||||
|
|
||||||
// Remaining fields
|
// Remaining fields
|
||||||
o.Options, err = json.Marshal(raw)
|
o.Options, err = json.MarshalIndent(raw, "", " ")
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ func (s *ServerService) GenKeypair(keyType string, options string) []string {
|
|||||||
case "reality":
|
case "reality":
|
||||||
return s.generateRealityKeyPair()
|
return s.generateRealityKeyPair()
|
||||||
case "wireguard":
|
case "wireguard":
|
||||||
return generateWireGuardKey(options)
|
return s.generateWireGuardKey(options)
|
||||||
}
|
}
|
||||||
|
|
||||||
return []string{"Failed to generate keypair"}
|
return []string{"Failed to generate keypair"}
|
||||||
@@ -195,7 +195,7 @@ func (s *ServerService) generateRealityKeyPair() []string {
|
|||||||
return []string{"PrivateKey: " + base64.RawURLEncoding.EncodeToString(privateKey[:]), "PublicKey: " + base64.RawURLEncoding.EncodeToString(publicKey[:])}
|
return []string{"PrivateKey: " + base64.RawURLEncoding.EncodeToString(privateKey[:]), "PublicKey: " + base64.RawURLEncoding.EncodeToString(publicKey[:])}
|
||||||
}
|
}
|
||||||
|
|
||||||
func generateWireGuardKey(pk string) []string {
|
func (s *ServerService) generateWireGuardKey(pk string) []string {
|
||||||
if len(pk) > 0 {
|
if len(pk) > 0 {
|
||||||
key, _ := wgtypes.ParseKey(pk)
|
key, _ := wgtypes.ParseKey(pk)
|
||||||
return []string{key.PublicKey().String()}
|
return []string{key.PublicKey().String()}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<v-card subtitle="Warp">
|
<v-card subtitle="Warp">
|
||||||
<template v-if="data.id>0">
|
<template v-if="data.id>0">
|
||||||
<table dir="ltr" width="100%">
|
<table dir="ltr" width="100%">
|
||||||
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Device ID</td>
|
<td>Device ID</td>
|
||||||
<td>{{ data.ext.device_id }}</td>
|
<td>{{ data.ext.device_id }}</td>
|
||||||
@@ -27,9 +28,11 @@
|
|||||||
</v-text-field>
|
</v-text-field>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<v-card :subtitle="$t('types.wg.peer')">
|
<v-card :subtitle="$t('types.wg.peer')">
|
||||||
<table dir="ltr" width="100%">
|
<table dir="ltr" width="100%">
|
||||||
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ $t('out.addr') }}</td>
|
<td>{{ $t('out.addr') }}</td>
|
||||||
<td>{{ data.peers[0].address + ":" + data.peers[0].port }}</td>
|
<td>{{ data.peers[0].address + ":" + data.peers[0].port }}</td>
|
||||||
@@ -46,6 +49,7 @@
|
|||||||
<td>Reserved</td>
|
<td>Reserved</td>
|
||||||
<td>[{{ data.peers[0].reserved.join(',') }}]</td>
|
<td>[{{ data.peers[0].reserved.join(',') }}]</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</v-card>
|
</v-card>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<v-col cols="12" sm="8">
|
<v-col cols="12" sm="8">
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="options.public_key"
|
v-model="options.public_key"
|
||||||
disabled
|
readonly
|
||||||
:label="$t('tls.pubKey')"
|
:label="$t('tls.pubKey')"
|
||||||
append-icon="mdi-refresh"
|
append-icon="mdi-refresh"
|
||||||
@click:append="getWgPubKey()"
|
@click:append="getWgPubKey()"
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ import { defineStore } from 'pinia'
|
|||||||
import { push } from 'notivue'
|
import { push } from 'notivue'
|
||||||
import { i18n } from '@/locales'
|
import { i18n } from '@/locales'
|
||||||
import { Inbound } from '@/types/inbounds'
|
import { Inbound } from '@/types/inbounds'
|
||||||
import { Outbound } from '@/types/outbounds'
|
|
||||||
import { Endpoint } from '@/types/endpoints'
|
|
||||||
import { Client } from '@/types/clients'
|
import { Client } from '@/types/clients'
|
||||||
|
|
||||||
const Data = defineStore('Data', {
|
const Data = defineStore('Data', {
|
||||||
@@ -15,8 +13,8 @@ const Data = defineStore('Data', {
|
|||||||
onlines: {inbound: <string[]>[], outbound: <string[]>[], user: <string[]>[]},
|
onlines: {inbound: <string[]>[], outbound: <string[]>[], user: <string[]>[]},
|
||||||
config: <any>{},
|
config: <any>{},
|
||||||
inbounds: <any[]>[],
|
inbounds: <any[]>[],
|
||||||
outbounds: <Outbound[]>[],
|
outbounds: <any[]>[],
|
||||||
endpoints: <Endpoint[]>[],
|
endpoints: <any[]>[],
|
||||||
clients: <any>[],
|
clients: <any>[],
|
||||||
tlsConfigs: <any[]>[],
|
tlsConfigs: <any[]>[],
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user