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

79 lines
2.3 KiB
Vue
Raw Normal View History

2022-04-13 22:43:26 +02:00
<template>
2022-07-05 00:38:50 +02:00
<div class="container-xxl" role="main">
2022-06-21 20:32:43 +02:00
<div class="page-header">
<h1>Network Info</h1>
</div>
<div class="text-center" v-if="dataLoading">
<div class="spinner-border" role="status">
<span class="visually-hidden">Loading...</span>
</div>
</div>
<template v-if="!dataLoading">
<WifiStationInfo v-bind="networkDataList" />
<div class="mt-5"></div>
<WifiApInfo v-bind="networkDataList" />
<div class="mt-5"></div>
<InterfaceStationInfo v-bind="networkDataList" />
<div class="mt-5"></div>
<InterfaceApInfo v-bind="networkDataList" />
<div class="mt-5"></div>
</template>
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 {
dataLoading: true,
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() {
this.dataLoading = true;
fetch("/api/network/status")
.then((response) => response.json())
.then((data) => {
this.networkDataList = data;
this.dataLoading = false;
});
},
},
});
2022-04-13 22:43:26 +02:00
</script>