mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-11 02:48:21 +00:00
Add Addresses, Services Pages
This commit is contained in:
parent
de5efa2592
commit
ab1e23e10d
3 changed files with 72 additions and 1 deletions
|
@ -12,7 +12,8 @@ let navState = $ref(NavState.Open);
|
|||
const navRoutes = {
|
||||
"/": { icon: IDashboard, caption: "Dashboard" },
|
||||
"/firewall/rules": { icon: IRule, caption: "Rules" },
|
||||
"/addresses": { icon: IAddress, caption: "Addresses" },
|
||||
"/object/addresses": { icon: IAddress, caption: "Addresses" },
|
||||
"/object/services": { icon: IAddress, caption: "Services" },
|
||||
};
|
||||
|
||||
enum AuthState { Unauthenticated, MfaRequired, Authenticated };
|
||||
|
|
35
client/src/pages/object/Addresses.vue
Normal file
35
client/src/pages/object/Addresses.vue
Normal file
|
@ -0,0 +1,35 @@
|
|||
<script setup lang="ts">
|
||||
import { apiCall } from "../../api";
|
||||
|
||||
let addresses = $ref([]);
|
||||
const columns = [
|
||||
{heading: 'Name', path: 'name'},
|
||||
{heading: 'Type', path: 'type'},
|
||||
{heading: 'Value', path: 'value'},
|
||||
{heading: 'Comment', path: 'comment'},
|
||||
];
|
||||
|
||||
async function load(){
|
||||
let res = await apiCall("Object.GetAddresses", {});
|
||||
if (res.Error === null) {
|
||||
addresses = res.Data.Addresses;
|
||||
console.debug("addresses", addresses);
|
||||
} else {
|
||||
console.debug("error", res);
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async() => {
|
||||
load();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Addresses">
|
||||
<button @click="load">Load Addresses</button>
|
||||
</PageHeader>
|
||||
<NiceTable :columns="columns" v-model:data="addresses"/>
|
||||
</div>
|
||||
</template>
|
35
client/src/pages/object/Services.vue
Normal file
35
client/src/pages/object/Services.vue
Normal file
|
@ -0,0 +1,35 @@
|
|||
<script setup lang="ts">
|
||||
import { apiCall } from "../../api";
|
||||
|
||||
let services = $ref([]);
|
||||
const columns = [
|
||||
{heading: 'Name', path: 'name'},
|
||||
{heading: 'Type', path: 'type'},
|
||||
{heading: 'Value', path: 'value'},
|
||||
{heading: 'Comment', path: 'comment'},
|
||||
];
|
||||
|
||||
async function load(){
|
||||
let res = await apiCall("Object.GetServices", {});
|
||||
if (res.Error === null) {
|
||||
services = res.Data.Services;
|
||||
console.debug("services", services);
|
||||
} else {
|
||||
console.debug("error", res);
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async() => {
|
||||
load();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="services">
|
||||
<button @click="load">Load Services</button>
|
||||
</PageHeader>
|
||||
<NiceTable :columns="columns" v-model:data="services"/>
|
||||
</div>
|
||||
</template>
|
Loading…
Add table
Reference in a new issue