mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-11 02:48:21 +00:00
run eslint --fix
This commit is contained in:
parent
abb9f24e58
commit
e9b6963b4a
21 changed files with 253 additions and 251 deletions
|
@ -1,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { apiCall } from "../../api";
|
||||
import getPlugins from "../../plugins";
|
||||
import { apiCall } from '../../api';
|
||||
import getPlugins from '../../plugins';
|
||||
const p = getPlugins();
|
||||
|
||||
let peers = $ref({});
|
||||
|
@ -8,11 +8,11 @@ let loading = $ref(false);
|
|||
let selection = $ref([] as number[]);
|
||||
|
||||
const columns = [
|
||||
{ heading: "Name", path: "name" },
|
||||
{ heading: "Allowed IPs", path: "allowed_ips" },
|
||||
{ heading: "Endpoint", path: "endpoint" },
|
||||
{ heading: "Persistent Keepalive", path: "persistent_keepalive" },
|
||||
{ heading: "Comment", path: "comment" },
|
||||
{ heading: 'Name', path: 'name' },
|
||||
{ heading: 'Allowed IPs', path: 'allowed_ips' },
|
||||
{ heading: 'Endpoint', path: 'endpoint' },
|
||||
{ heading: 'Persistent Keepalive', path: 'persistent_keepalive' },
|
||||
{ heading: 'Comment', path: 'comment' },
|
||||
];
|
||||
|
||||
const displayData = $computed(() => {
|
||||
|
@ -32,24 +32,24 @@ const displayData = $computed(() => {
|
|||
|
||||
async function load() {
|
||||
loading = true;
|
||||
let res = await apiCall("vpn.wireguard.peers.list", {});
|
||||
let res = await apiCall('vpn.wireguard.peers.list', {});
|
||||
if (res.Error === null) {
|
||||
console.debug("peers", res.Data);
|
||||
console.debug('peers', res.Data);
|
||||
peers = res.Data;
|
||||
} else {
|
||||
console.debug("error", res);
|
||||
console.debug('error', res);
|
||||
}
|
||||
loading = false;
|
||||
}
|
||||
|
||||
async function deletePeer() {
|
||||
let res = await apiCall("vpn.wireguard.peers.delete", {
|
||||
let res = await apiCall('vpn.wireguard.peers.delete', {
|
||||
name: displayData[selection[0]].name,
|
||||
});
|
||||
if (res.Error === null) {
|
||||
console.debug("deleted peer");
|
||||
console.debug('deleted peer');
|
||||
} else {
|
||||
console.debug("error", res);
|
||||
console.debug('error', res);
|
||||
}
|
||||
load();
|
||||
}
|
||||
|
@ -76,7 +76,9 @@ onMounted(async () => {
|
|||
>
|
||||
<button @click="load">Refresh</button>
|
||||
<router-link class="button" to="/vpn/wireguard.peers/edit"
|
||||
>Create</router-link
|
||||
>
|
||||
Create
|
||||
</router-link
|
||||
>
|
||||
<button :disabled="selection.length != 1" @click="editPeer">
|
||||
Edit
|
||||
|
|
Loading…
Add table
Reference in a new issue