auto update time in ui
This commit is contained in:
@@ -55,22 +55,6 @@ module.exports = {
|
|||||||
this.autoCheckUpgrade = this.config.admin["auto-check-upgrade"];
|
this.autoCheckUpgrade = this.config.admin["auto-check-upgrade"];
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
|
||||||
get_current_time: async function () {
|
|
||||||
try {
|
|
||||||
const response = await api.get("time");
|
|
||||||
if (response.timeinfo) {
|
|
||||||
const { timeinfo } = response;
|
|
||||||
return timeinfo.split(": ")[1].split(" U")[0];
|
|
||||||
} else {
|
|
||||||
return " ";
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
fetch_current_time: async function () {
|
fetch_current_time: async function () {
|
||||||
try {
|
try {
|
||||||
@@ -208,6 +192,7 @@ module.exports = {
|
|||||||
|
|
||||||
if (response == "ok") {
|
if (response == "ok") {
|
||||||
alert("Date/Time updated successfully.");
|
alert("Date/Time updated successfully.");
|
||||||
|
this.fetch_current_time();
|
||||||
} else {
|
} else {
|
||||||
throw response;
|
throw response;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user