Added QoS, Added file RouterConfig.vue, optimized stuff

This commit is contained in:
Patrick Hatsune 2024-10-02 00:30:03 -07:00
parent c115dbc865
commit 64be911517
Signed by: keyemail
GPG key ID: A03C1F76E54247A0
12 changed files with 102 additions and 74 deletions

View file

@ -32,7 +32,10 @@
<p>MAC Address</p>
</div>
<div class="seperator"></div>
<form v-if="section.devices" v-for="device in section.devices">
<form
v-if="section.devices"
v-for="device in section.devices"
>
<div id="device">
<p>{{ device.name }}</p>
<p>{{ device.ip }}</p>

View file

@ -15,6 +15,7 @@
option: string,
label?: string,
dropdown?: string[],
buttons?: string[],
subOptions?: {
name?: string,
class: string,
@ -48,12 +49,15 @@
:key="form.name"
>
<template v-else/>
<select
v-if="form.dropdown"
>
<select v-if="form.dropdown">
<option v-for="option in form.dropdown">{{ option }}</option>
</select>
<template v-else/>
<button
v-if="form.buttons"
v-for="button in form.buttons"
>{{ button }}</button>
<template v-else/>
<label
:class="subform.class"
v-if="form.subOptions"

25
src/data/QoS.ts Normal file
View file

@ -0,0 +1,25 @@
const qos = [{
id: "qosGeneral",
forms: [
{
name: "qosEnable",
class: "selectOption",
option: "checkbox",
label: "Enable QoS",
},
{
name: "optimizeDatabase",
class: "selectOption",
option: "checkbox",
label: "Automically update performance optizimiation database"
},
{
name: "optimizeDatabase",
class: "buttonOption",
option: "hidden",
buttons: ["Update Now"]
}
]
}]
export default qos;

View file

@ -14,7 +14,8 @@
{ name: "Device List", link: "/basic/devices" },
{ name: "QoS", link: "/basic/qos" },
{ name: "File Sharing", link: "/basic/fileshare" },
{ name: "Guest Network", link: "/basic/guestnetwork" }
{ name: "Guest Network", link: "/basic/guestnetwork" },
{ name: "Router Configuration", link: "/basic/routerconfig" },
];
</script>

View file

@ -5,18 +5,7 @@
const pageTitle="Device List"
const pageID="deviceList"
interface Sections {
title: string,
id: string,
devices?: {
connection: string,
name?: string,
ip: string,
mac: string,
}[]
}
const sections = shallowRef<Sections[]>([]);
const sections = shallowRef([] as typeof deviceListData);
sections.value = deviceListData;
</script>

View file

@ -5,26 +5,7 @@
const pageTitle="Internet Setup"
const pageID="internetSetupComponent"
interface Sections {
title?: string,
id: string,
selectedRadio?: number,
forms?: {
name?: string,
class: string,
option: string,
label?: string,
dropdown?: string[],
subOptions?: {
name?: string,
class: string,
option: string,
label?: string,
}[]
}[]
}
const sections = shallowRef<Sections[]>([]);
const sections = shallowRef([] as typeof internetSetup);
sections.value = internetSetup;
</script>

View file

@ -35,7 +35,7 @@
const fetchOverviewItems = async () => {
try {
const response = await axios.get('http://localhost:8080/overviewItems');
const response = await axios.get('http://192.168.122.1:8080/overviewItems');
overviewItems.value = [
{

View file

@ -1,7 +1,17 @@
<script lang="ts" setup>
import { shallowRef } from 'vue'
import BasicDashboard from '@/components/dashboard/Template.vue';
import qos from '@/data/QoS.ts';
const pageTitle="QoS Settings"
const pageID="qosComponent"
const sections = shallowRef([] as typeof qos);
sections.value = qos;
</script>
<template>
<div>
<h2 class="title">QoS</h2>
</div>
<BasicDashboard :pageTitle="pageTitle" :pageID="pageID" :sections="sections"/>
</template>
<style src="@/styles/basicDashboard.css" scoped></style>

View file

@ -0,0 +1,7 @@
<template>
<div>
<h2 class="title">Router Configuration</h2>
</div>
</template>
<style src="@/styles/basicDashboard.css" scoped></style>

View file

@ -5,26 +5,8 @@
const pageTitle="Wireless Settings"
const pageID="wirelessSettingsComponent"
interface Sections {
title?: string,
id: string,
selectedRadio?: number,
forms?: {
name?: string,
class: string,
option: string,
label?: string,
dropdown?: string[],
subOptions?: {
name?: string,
class: string,
option: string,
label?: string,
}[]
}[]
}
const sections = shallowRef([] as typeof wirelessSettings);
const sections = shallowRef<Sections[]>([]);
sections.value = wirelessSettings;
</script>

View file

@ -1,16 +1,17 @@
import { createRouter, createWebHistory } from "vue-router";
import AdvanceDashboard from '../pages/AdvancedDashboard.vue';
import BasicDashboard from "../pages/BasicDashboard.vue";
import LoginPage from "../pages/LoginPage.vue";
import RegisterPage from "../pages/RegisterPage.vue";
import AdvanceDashboard from '@/pages/AdvancedDashboard.vue';
import BasicDashboard from "@/pages/BasicDashboard.vue";
import LoginPage from "@/pages/LoginPage.vue";
import RegisterPage from "@/pages/RegisterPage.vue";
import BasicOverview from "../pages/basicDashboard/Overview.vue"
import BasicInternetSetup from "../pages/basicDashboard/InternetSetup.vue"
import BasicWireless from "../pages/basicDashboard/Wireless.vue"
import BasicDevicesList from "../pages/basicDashboard/DeviceList.vue"
import BasicQoS from "../pages/basicDashboard/QoS.vue"
import BasicFileShare from "../pages/basicDashboard/FileShare.vue"
import BasicGuestNetwork from "../pages/basicDashboard/GuestNetwork.vue"
import BasicOverview from "@/pages/basicDashboard/Overview.vue"
import BasicInternetSetup from "@/pages/basicDashboard/InternetSetup.vue"
import BasicWireless from "@/pages/basicDashboard/Wireless.vue"
import BasicDevicesList from "@/pages/basicDashboard/DeviceList.vue"
import BasicQoS from "@/pages/basicDashboard/QoS.vue"
import BasicFileShare from "@/pages/basicDashboard/FileShare.vue"
import BasicGuestNetwork from "@/pages/basicDashboard/GuestNetwork.vue"
import RouterConfig from "@/pages/basicDashboard/RouterConfig.vue";
const routes = [
{
@ -48,10 +49,15 @@ const routes = [
{
path: 'fileshare',
component: BasicFileShare,
}, {
},
{
path: 'guestnetwork',
component: BasicGuestNetwork,
}
},
{
path: 'routerconfig',
component: RouterConfig,
},
]
},
{

View file

@ -109,7 +109,7 @@
}
}
#internetSetupComponent, #wirelessSettingsComponent {
#internetSetupComponent, #wirelessSettingsComponent, #qosComponent {
display: flex;
flex-direction: column;
gap: 20px;
@ -129,6 +129,23 @@
flex-direction: column;
gap: 10px;
}
label {
background-color: transparent;
}
button {
color: inherit;
background-color: var(--dark-bg-alt-2-color);
border: none;
height: 50px;
min-width: 110px;
border-radius: 5px;
transition: 0.3s background-color;
cursor: pointer;
font-size: 1rem;
}
button:hover {
background-color: var(--dark-highlight-color);
}
.seperator {
margin-top: 20px;
@ -179,6 +196,9 @@
color: #fff;
}
}
.buttonOption {
width: fit-content
}
.subSelect {
display: flex;
flex-direction: column-reverse;