Files
OpenDTU/webapp/src/components/NetworkInfoView.vue

66 lines
1.9 KiB
Vue
Raw Normal View History

2022-04-13 22:43:26 +02:00
<template>
2022-06-21 20:32:43 +02:00
<div class="container" role="main">
<div class="page-header">
<h1>Network Info</h1>
</div>
<WifiStationInfo v-bind="networkDataList"/>
2022-06-21 20:32:43 +02:00
<div class="mt-5"></div>
<WifiApInfo v-bind="networkDataList"/>
2022-06-21 20:32:43 +02:00
<div class="mt-5"></div>
<InterfaceStationInfo v-bind="networkDataList"/>
2022-06-21 20:32:43 +02:00
<div class="mt-5"></div>
<InterfaceApInfo v-bind="networkDataList"/>
2022-06-21 20:32:43 +02:00
<div class="mt-5"></div>
2022-04-13 22:43:26 +02:00
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
2022-04-13 22:43:26 +02:00
import WifiStationInfo from "./partials/WifiStationInfo.vue";
2022-04-13 22:59:24 +02:00
import WifiApInfo from "./partials/WifiApInfo.vue";
import InterfaceStationInfo from "./partials/InterfaceStationInfo.vue";
import InterfaceApInfo from "./partials/InterfaceApInfo.vue";
2022-04-13 22:43:26 +02:00
export default defineComponent({
2022-06-21 20:32:43 +02:00
components: {
WifiStationInfo,
WifiApInfo,
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));
},
},
});
2022-04-13 22:43:26 +02:00
</script>