run eslint --fix

This commit is contained in:
Samuel Lorch 2024-07-30 12:00:40 +02:00
parent abb9f24e58
commit e9b6963b4a
21 changed files with 253 additions and 251 deletions

View file

@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { apiCall } from "../../api"; import { apiCall } from '../../api';
import getPlugins from "../../plugins"; import getPlugins from '../../plugins';
const p = getPlugins(); const p = getPlugins();
let peers = $ref({}); let peers = $ref({});
@ -8,11 +8,11 @@ let loading = $ref(false);
let selection = $ref([] as number[]); let selection = $ref([] as number[]);
const columns = [ const columns = [
{ heading: "Name", path: "name" }, { heading: 'Name', path: 'name' },
{ heading: "Allowed IPs", path: "allowed_ips" }, { heading: 'Allowed IPs', path: 'allowed_ips' },
{ heading: "Endpoint", path: "endpoint" }, { heading: 'Endpoint', path: 'endpoint' },
{ heading: "Persistent Keepalive", path: "persistent_keepalive" }, { heading: 'Persistent Keepalive', path: 'persistent_keepalive' },
{ heading: "Comment", path: "comment" }, { heading: 'Comment', path: 'comment' },
]; ];
const displayData = $computed(() => { const displayData = $computed(() => {
@ -32,24 +32,24 @@ const displayData = $computed(() => {
async function load() { async function load() {
loading = true; loading = true;
let res = await apiCall("vpn.wireguard.peers.list", {}); let res = await apiCall('vpn.wireguard.peers.list', {});
if (res.Error === null) { if (res.Error === null) {
console.debug("peers", res.Data); console.debug('peers', res.Data);
peers = res.Data; peers = res.Data;
} else { } else {
console.debug("error", res); console.debug('error', res);
} }
loading = false; loading = false;
} }
async function deletePeer() { async function deletePeer() {
let res = await apiCall("vpn.wireguard.peers.delete", { let res = await apiCall('vpn.wireguard.peers.delete', {
name: displayData[selection[0]].name, name: displayData[selection[0]].name,
}); });
if (res.Error === null) { if (res.Error === null) {
console.debug("deleted peer"); console.debug('deleted peer');
} else { } else {
console.debug("error", res); console.debug('error', res);
} }
load(); load();
} }
@ -76,7 +76,9 @@ onMounted(async () => {
> >
<button @click="load">Refresh</button> <button @click="load">Refresh</button>
<router-link class="button" to="/vpn/wireguard.peers/edit" <router-link class="button" to="/vpn/wireguard.peers/edit"
>Create</router-link >
Create
</router-link
> >
<button :disabled="selection.length != 1" @click="editPeer"> <button :disabled="selection.length != 1" @click="editPeer">
Edit Edit