diff --git a/webapp/src/components/NetworkInfoView.vue b/webapp/src/components/NetworkInfoView.vue
index d87c43b..eb53ae7 100644
--- a/webapp/src/components/NetworkInfoView.vue
+++ b/webapp/src/components/NetworkInfoView.vue
@@ -3,13 +3,13 @@
-
+
-
+
-
+
-
+
@@ -28,5 +28,39 @@ export default defineComponent({
InterfaceStationInfo,
InterfaceApInfo,
},
+ data() {
+ return {
+ networkDataList: {
+ // WifiStationInfo
+ sta_status: false,
+ sta_ssid: "",
+ sta_rssi: 0,
+ // WifiApInfo
+ ap_status: false,
+ ap_ssid: "",
+ ap_stationnum: 0,
+ // InterfaceStationInfo
+ sta_ip: "",
+ sta_netmask: "",
+ sta_gateway: "",
+ sta_dns1: "",
+ sta_dns2: "",
+ sta_mac: "",
+ // InterfaceApInfo
+ ap_ip: "",
+ ap_mac: "",
+ }
+ }
+ },
+ created() {
+ this.getNetworkInfo();
+ },
+ methods: {
+ getNetworkInfo() {
+ fetch("/api/network/status")
+ .then((response) => response.json())
+ .then((data) => (this.networkDataList = data));
+ },
+ },
});
\ No newline at end of file
diff --git a/webapp/src/components/SystemInfoView.vue b/webapp/src/components/SystemInfoView.vue
index a60173f..3385e9e 100644
--- a/webapp/src/components/SystemInfoView.vue
+++ b/webapp/src/components/SystemInfoView.vue
@@ -3,11 +3,11 @@
-
+
-
+
-
+
@@ -24,5 +24,42 @@ export default defineComponent({
FirmwareInfo,
MemoryInfo,
},
+ data() {
+ return {
+ systemDataList: {
+ // HardwareInfo
+ chipmodel: "",
+ chiprevision: "",
+ chipcores: "",
+ cpufreq: "",
+ // FirmwareInfo
+ hostname: "",
+ sdkversion: "",
+ firmware_version: "",
+ git_hash: "",
+ resetreason_0: "",
+ resetreason_1: "",
+ cfgsavecount: 0,
+ uptime: 0,
+ // MemoryInfo
+ heap_total: 0,
+ heap_used: 0,
+ littlefs_total: 0,
+ littlefs_used: 0,
+ sketch_total: 0,
+ sketch_used: 0
+ }
+ }
+ },
+ created() {
+ this.getSystemInfo();
+ },
+ methods: {
+ getSystemInfo() {
+ fetch("/api/system/status")
+ .then((response) => response.json())
+ .then((data) => (this.systemDataList = data));
+ },
+ },
});
diff --git a/webapp/src/components/partials/FirmwareInfo.vue b/webapp/src/components/partials/FirmwareInfo.vue
index c95d65e..fdcbb8c 100644
--- a/webapp/src/components/partials/FirmwareInfo.vue
+++ b/webapp/src/components/partials/FirmwareInfo.vue
@@ -9,35 +9,35 @@
| Hostname |
- {{ systemDataList.hostname }} |
+ {{ hostname }} |
| SDK Version |
- {{ systemDataList.sdkversion }} |
+ {{ sdkversion }} |
| Firmware Version |
- {{ systemDataList.firmware_version }} |
+ {{ firmware_version }} |
| Git Hash |
- {{ systemDataList.git_hash }} |
+ {{ git_hash }} |
| Reset Reason CPU 0 |
- {{ systemDataList.resetreason_0 }} |
+ {{ resetreason_0 }} |
| Reset Reason CPU 1 |
- {{ systemDataList.resetreason_1 }} |
+ {{ resetreason_1 }} |
| Config save count |
- {{ systemDataList.cfgsavecount }} |
+ {{ cfgsavecount }} |
| Uptime |
- {{ timeInHours(systemDataList.uptime) }} |
+ {{ timeInHours(uptime) }} |
@@ -50,22 +50,15 @@
import { defineComponent } from 'vue';
export default defineComponent({
- data() {
- return {
- systemDataList: {
- hostname: "",
- sdkversion: "",
- firmware_version: "",
- git_hash: "",
- resetreason_0: "",
- resetreason_1: "",
- cfgsavecount: 0,
- uptime: 0
- },
- };
- },
- created() {
- this.getSystemInfo();
+ props: {
+ hostname: String,
+ sdkversion: String,
+ firmware_version: String,
+ git_hash: String,
+ resetreason_0: String,
+ resetreason_1: String,
+ cfgsavecount: { type: Number, required: true },
+ uptime: { type: Number, required: true },
},
computed: {
timeInHours() {
@@ -83,12 +76,5 @@ export default defineComponent({
};
},
},
- methods: {
- getSystemInfo() {
- fetch("/api/system/status")
- .then((response) => response.json())
- .then((data) => (this.systemDataList = data));
- },
- },
});
diff --git a/webapp/src/components/partials/FsInfo.vue b/webapp/src/components/partials/FsInfo.vue
index 9d433c9..4fa3e4a 100644
--- a/webapp/src/components/partials/FsInfo.vue
+++ b/webapp/src/components/partials/FsInfo.vue
@@ -29,7 +29,7 @@ export default defineComponent({
},
methods: {
getPercent() {
- return Math.round((this.used / this.total) * 100);
+ return this.total === 0 ? 0 : Math.round((this.used / this.total) * 100);
},
},
});
diff --git a/webapp/src/components/partials/HardwareInfo.vue b/webapp/src/components/partials/HardwareInfo.vue
index 6ff920c..1b9fcce 100644
--- a/webapp/src/components/partials/HardwareInfo.vue
+++ b/webapp/src/components/partials/HardwareInfo.vue
@@ -9,19 +9,19 @@
| Chip Model |
- {{ systemDataList.chipmodel }} |
+ {{ chipmodel }} |
| Chip Revision |
- {{ systemDataList.chiprevision }} |
+ {{ chiprevision }} |
| Chip Cores |
- {{ systemDataList.chipcores }} |
+ {{ chipcores }} |
| CPU Frequency |
- {{ systemDataList.cpufreq }} MHz |
+ {{ cpufreq }} MHz |
@@ -34,25 +34,11 @@
import { defineComponent } from 'vue';
export default defineComponent({
- data() {
- return {
- systemDataList: {
- chipmodel: "",
- chiprevision: "",
- chipcores: "",
- cpufreq: ""
- },
- };
- },
- created() {
- this.getSystemInfo();
- },
- methods: {
- getSystemInfo() {
- fetch("/api/system/status")
- .then((response) => response.json())
- .then((data) => (this.systemDataList = data));
- },
+ props: {
+ chipmodel: String,
+ chiprevision: String,
+ chipcores: String,
+ cpufreq: String,
},
});
diff --git a/webapp/src/components/partials/InterfaceApInfo.vue b/webapp/src/components/partials/InterfaceApInfo.vue
index 91e1335..21c1324 100644
--- a/webapp/src/components/partials/InterfaceApInfo.vue
+++ b/webapp/src/components/partials/InterfaceApInfo.vue
@@ -9,11 +9,11 @@
| IP Address |
- {{ networkDataList.ap_ip }} |
+ {{ ap_ip }} |
| MAC Address |
- {{ networkDataList.ap_mac }} |
+ {{ ap_mac }} |
@@ -26,23 +26,9 @@
import { defineComponent } from 'vue';
export default defineComponent({
- data() {
- return {
- networkDataList: {
- ap_ip: "",
- ap_mac: ""
- },
- };
- },
- created() {
- this.getNetworkInfo();
- },
- methods: {
- getNetworkInfo() {
- fetch("/api/network/status")
- .then((response) => response.json())
- .then((data) => (this.networkDataList = data));
- },
+ props: {
+ ap_ip: String,
+ ap_mac: String,
},
});
diff --git a/webapp/src/components/partials/InterfaceStationInfo.vue b/webapp/src/components/partials/InterfaceStationInfo.vue
index 87e3ac3..c70389e 100644
--- a/webapp/src/components/partials/InterfaceStationInfo.vue
+++ b/webapp/src/components/partials/InterfaceStationInfo.vue
@@ -9,27 +9,27 @@
| IP Address |
- {{ networkDataList.sta_ip }} |
+ {{ sta_ip }} |
| Netmask |
- {{ networkDataList.sta_netmask }} |
+ {{ sta_netmask }} |
| Default Gateway |
- {{ networkDataList.sta_gateway }} |
+ {{ sta_gateway }} |
| DNS 1 |
- {{ networkDataList.sta_dns1 }} |
+ {{ sta_dns1 }} |
| DNS 2 |
- {{ networkDataList.sta_dns2 }} |
+ {{ sta_dns2 }} |
| MAC Address |
- {{ networkDataList.sta_mac }} |
+ {{ sta_mac }} |
@@ -42,27 +42,13 @@
import { defineComponent } from 'vue';
export default defineComponent({
- data() {
- return {
- networkDataList: {
- sta_ip: "",
- sta_netmask: "",
- sta_gateway: "",
- sta_dns1: "",
- sta_dns2: "",
- sta_mac: ""
- },
- };
- },
- created() {
- this.getNetworkInfo();
- },
- methods: {
- getNetworkInfo() {
- fetch("/api/network/status")
- .then((response) => response.json())
- .then((data) => (this.networkDataList = data));
- },
+ props: {
+ sta_ip: String,
+ sta_netmask: String,
+ sta_gateway: String,
+ sta_dns1: String,
+ sta_dns2: String,
+ sta_mac: String,
},
});
diff --git a/webapp/src/components/partials/MemoryInfo.vue b/webapp/src/components/partials/MemoryInfo.vue
index 3700e16..402bc5b 100644
--- a/webapp/src/components/partials/MemoryInfo.vue
+++ b/webapp/src/components/partials/MemoryInfo.vue
@@ -14,10 +14,10 @@
-
-
-
+
+
+
@@ -33,27 +33,13 @@ export default defineComponent({
components: {
FsInfo,
},
- data() {
- return {
- systemDataList: {
- heap_total: 0,
- heap_used: 0,
- littlefs_total: 0,
- littlefs_used: 0,
- sketch_total: 0,
- sketch_used: 0
- },
- };
- },
- created() {
- this.getSystemInfo();
- },
- methods: {
- getSystemInfo() {
- fetch("/api/system/status")
- .then((response) => response.json())
- .then((data) => (this.systemDataList = data));
- },
+ props: {
+ heap_total: { type: Number, required: true },
+ heap_used: { type: Number, required: true },
+ littlefs_total: { type: Number, required: true },
+ littlefs_used: { type: Number, required: true },
+ sketch_total: { type: Number, required: true },
+ sketch_used: { type: Number, required: true },
},
});
diff --git a/webapp/src/components/partials/WifiApInfo.vue b/webapp/src/components/partials/WifiApInfo.vue
index f8bc109..bdf1eb9 100644
--- a/webapp/src/components/partials/WifiApInfo.vue
+++ b/webapp/src/components/partials/WifiApInfo.vue
@@ -10,20 +10,20 @@
| Status |
- enabled
+ enabled
disabled
|
| SSID |
- {{ networkDataList.ap_ssid }} |
+ {{ ap_ssid }} |
| # Stations |
- {{ networkDataList.ap_stationnum }} |
+ {{ ap_stationnum }} |
@@ -36,24 +36,10 @@
import { defineComponent } from 'vue';
export default defineComponent({
- data() {
- return {
- networkDataList: {
- ap_status: false,
- ap_ssid: "",
- ap_stationnum: 0
- },
- };
- },
- created() {
- this.getNetworkInfo();
- },
- methods: {
- getNetworkInfo() {
- fetch("/api/network/status")
- .then((response) => response.json())
- .then((data) => (this.networkDataList = data));
- },
+ props: {
+ ap_status: { type: Boolean, required: true },
+ ap_ssid: String,
+ ap_stationnum: { type: Number, required: true },
},
});
diff --git a/webapp/src/components/partials/WifiStationInfo.vue b/webapp/src/components/partials/WifiStationInfo.vue
index 47d703c..a3e3e04 100644
--- a/webapp/src/components/partials/WifiStationInfo.vue
+++ b/webapp/src/components/partials/WifiStationInfo.vue
@@ -10,24 +10,24 @@
| Status |
- enabled
+ enabled
disabled
|
| SSID |
- {{ networkDataList.sta_ssid }} |
+ {{ sta_ssid }} |
| Quality |
- {{ getRSSIasQuality(networkDataList.sta_rssi) }} % |
+ {{ getRSSIasQuality(sta_rssi) }} % |
| RSSI |
- {{ networkDataList.sta_rssi }} |
+ {{ sta_rssi }} |
@@ -40,24 +40,12 @@
import { defineComponent } from 'vue';
export default defineComponent({
- data() {
- return {
- networkDataList: {
- sta_status: false,
- sta_ssid: "",
- sta_rssi: 0
- },
- };
- },
- created() {
- this.getNetworkInfo();
+ props: {
+ sta_status: { type: Boolean, required: true },
+ sta_ssid: String,
+ sta_rssi: { type: Number, required: true },
},
methods: {
- getNetworkInfo() {
- fetch("/api/network/status")
- .then((response) => response.json())
- .then((data) => (this.networkDataList = data));
- },
getRSSIasQuality(rssi: number) {
let quality = 0;