parent
362eabab8d
commit
4571a9b8c1
@ -0,0 +1,44 @@
|
|||||||
|
const { setSetting } = require("./util-server");
|
||||||
|
const axios = require("axios");
|
||||||
|
const { isDev } = require("../src/util");
|
||||||
|
|
||||||
|
exports.version = require("../package.json").version;
|
||||||
|
exports.latestVersion = null;
|
||||||
|
|
||||||
|
let interval;
|
||||||
|
|
||||||
|
exports.startInterval = () => {
|
||||||
|
let check = async () => {
|
||||||
|
try {
|
||||||
|
const res = await axios.get("https://raw.githubusercontent.com/louislam/uptime-kuma/master/package.json");
|
||||||
|
|
||||||
|
if (typeof res.data === "string") {
|
||||||
|
res.data = JSON.parse(res.data);
|
||||||
|
}
|
||||||
|
|
||||||
|
// For debug
|
||||||
|
if (process.env.TEST_CHECK_VERSION === "1") {
|
||||||
|
res.data.version = "1000.0.0"
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.latestVersion = res.data.version;
|
||||||
|
console.log("Latest Version: " + exports.latestVersion);
|
||||||
|
} catch (_) { }
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
check();
|
||||||
|
interval = setTimeout(check, 3600 * 48);
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.enableCheckUpdate = async (value) => {
|
||||||
|
await setSetting("checkUpdate", value);
|
||||||
|
|
||||||
|
clearInterval(interval);
|
||||||
|
|
||||||
|
if (value) {
|
||||||
|
exports.startInterval();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.socket = null;
|
@ -1,10 +1,10 @@
|
|||||||
import { library } from "@fortawesome/fontawesome-svg-core"
|
import { library } from "@fortawesome/fontawesome-svg-core"
|
||||||
import { faCog, faEdit, faList, faPause, faPlay, faPlus, faTachometerAlt, faTrash } from "@fortawesome/free-solid-svg-icons"
|
import { faCog, faEdit, faPlus, faPause, faPlay, faTachometerAlt, faTrash, faList, faArrowAltCircleUp } from "@fortawesome/free-solid-svg-icons"
|
||||||
//import { fa } from '@fortawesome/free-regular-svg-icons'
|
//import { fa } from '@fortawesome/free-regular-svg-icons'
|
||||||
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"
|
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"
|
||||||
|
|
||||||
// Add Free Font Awesome Icons here
|
// Add Free Font Awesome Icons here
|
||||||
// https://fontawesome.com/v5.15/icons?d=gallery&p=2&s=solid&m=free
|
// https://fontawesome.com/v5.15/icons?d=gallery&p=2&s=solid&m=free
|
||||||
library.add(faCog, faTachometerAlt, faEdit, faPlus, faPause, faPlay, faTrash, faList)
|
library.add(faCog, faEdit, faPlus, faPause, faPlay, faTachometerAlt, faTrash, faList, faArrowAltCircleUp);
|
||||||
|
|
||||||
export { FontAwesomeIcon }
|
export { FontAwesomeIcon }
|
||||||
|
Loading…
Reference in new issue