mirror of
https://github.com/donaldzou/WGDashboard
synced 2025-02-26 05:58:47 +00:00
Fixed hardcoded issue
This commit is contained in:
parent
5cd99f2edc
commit
ac77c3a390
@ -31,6 +31,7 @@ Chart.register(
|
||||
import LocaleText from "@/components/text/localeText.vue";
|
||||
import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js";
|
||||
import dayjs from "dayjs";
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
const props = defineProps({
|
||||
configurationPeers: Array,
|
||||
configurationInfo: Object
|
||||
@ -45,12 +46,12 @@ const historyReceivedData = ref({
|
||||
timestamp: [],
|
||||
data: []
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
const dashboardStore = DashboardConfigurationStore()
|
||||
const fetchRealtimeTrafficInterval = ref(undefined)
|
||||
const fetchRealtimeTraffic = async () => {
|
||||
await fetchGet("/api/getWireguardConfigurationRealtimeTraffic", {
|
||||
configurationName: "wg1"
|
||||
configurationName: route.params.id
|
||||
}, (res) => {
|
||||
let timestamp = dayjs().format("hh:mm:ss A")
|
||||
|
||||
|
@ -19,9 +19,6 @@ const getUrl = (url) => {
|
||||
if (apiKey){
|
||||
return `${apiKey.host}${url}`
|
||||
}
|
||||
|
||||
// console.log("URL fetching: ", import.meta.env.MODE === 'development' ? url
|
||||
// : `${window.location.protocol}//${(window.location.host + window.location.pathname + url).replace(/\/\//g, '/')}`)
|
||||
return import.meta.env.MODE === 'development' ? url
|
||||
: `${window.location.protocol}//${(window.location.host + window.location.pathname + url).replace(/\/\//g, '/')}`
|
||||
}
|
||||
@ -36,7 +33,6 @@ export const fetchGet = async (url, params=undefined, callback=undefined) => {
|
||||
if (!x.ok){
|
||||
if (x.status !== 200){
|
||||
if (x.status === 401){
|
||||
|
||||
store.newMessage("WGDashboard", "Sign in session ended, please sign in again", "warning")
|
||||
}
|
||||
throw new Error(x.statusText)
|
||||
|
Loading…
Reference in New Issue
Block a user