Skip to content

Commit cfbf6a5

Browse files
committed
Add firewall state page
1 parent fbb6014 commit cfbf6a5

File tree

3 files changed

+43
-3
lines changed

3 files changed

+43
-3
lines changed

adminui2/src/layouts/default.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const adminPageLinks = [
4242
4343
const debugPageLinks = [
4444
{ name: 'Wireguard Peers', icon: Icons.Peers, to: '/diagnostics/wg' },
45-
{ name: 'Firewall State', icon: Icons.FirewallState, to: '/settings/management_users' },
45+
{ name: 'Firewall State', icon: Icons.FirewallState, to: '/diagnostics/firewall' },
4646
{ name: 'Test Rule', icon: Icons.Test, to: '/settings/management_users' },
4747
{ name: 'User ACLs', icon: Icons.List, to: '/settings/management_users' }
4848
]
@@ -140,7 +140,7 @@ async function logout() {
140140
<span>Advanced</span>
141141
</label>
142142

143-
<ul tabindex="0" class="menu dropdown-content rounded-box w-52 bg-base-100 p-2 pb-4 text-black shadow">
143+
<ul tabindex="0" class="menu-dropup dropdown-content rounded-box w-52 bg-base-100 p-2 pb-4 text-black shadow">
144144
<li v-for="link in debugPageLinks" :key="link.name" :class="route.path == link.to ? 'bordered' : 'hover-bordered'">
145145
<RouterLink :to="link.to" :class="route.path == link.to ? 'active' : ''">
146146
<span class="w-6 text-center"><font-awesome-icon :icon="link.icon" /></span>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<script setup lang="ts">
2+
import { computed, ref } from 'vue'
3+
import { useApi } from '@/composables/useApi'
4+
import { getFirewallState } from '@/api'
5+
6+
const { data: fwState, isLoading: isLoadingState } = useApi(() => getFirewallState())
7+
8+
const isLoading = computed(() => {
9+
return isLoadingState.value
10+
})
11+
12+
13+
const state = computed(() => fwState.value ?? {})
14+
</script>
15+
16+
<template>
17+
<main class="w-full p-4">
18+
<PageLoading v-if="isLoading" />
19+
<div v-else>
20+
<h1 class="text-4xl font-bold mb-4">Wireguard peers</h1>
21+
<p>
22+
Firewall State, all rules and devices directly deserialised.
23+
</p>
24+
<div class="mt-6 flex flex-wrap w-full">
25+
<div class="card w-full bg-base-100 shadow-xl min-w-[800px]">
26+
<div class="card-body">
27+
<pre>{{ state }}</pre>
28+
</div>
29+
</div>
30+
</div>
31+
</div>
32+
</main>
33+
</template>
34+
35+
<style scoped>
36+
.hashlist-table.table-sm :where(th, td) {
37+
padding-top: 0.4rem;
38+
padding-bottom: 0.4rem;
39+
}
40+
</style>

adminui2/src/router/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const router = createRouter({
4545
route('/policy/groups', 'Groups', () => import('@/pages/Groups.vue')),
4646

4747
route('/diagnostics/wg', 'Wireguard Diagnostics', () => import('@/pages/Diagnostics/WireguardPeers.vue')),
48-
// route('/diagnostics/firewall', 'Firewall Diagnostics', () => import('@/pages/projects/project.vue')),
48+
route('/diagnostics/firewall', 'Firewall Diagnostics', () => import('@/pages/Diagnostics/FirewallState.vue')),
4949
// route('/diagnostics/check', 'Check Firewall', () => import('@/pages/projects/project.vue')),
5050
// route('/diagnostics/acls', 'ACLs', () => import('@/pages/projects/project.vue')),
5151

0 commit comments

Comments
 (0)