webapp: Fix lint errors
This commit is contained in:
parent
b58d08683e
commit
de156ef10a
@ -48,15 +48,14 @@ export default defineComponent({
|
|||||||
showReload: { type: Boolean, required: false, default: false },
|
showReload: { type: Boolean, required: false, default: false },
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
var self = this;
|
|
||||||
console.log("init");
|
console.log("init");
|
||||||
PullToRefresh.init({
|
PullToRefresh.init({
|
||||||
mainElement: 'body', // above which element?
|
mainElement: 'body', // above which element?
|
||||||
instructionsPullToRefresh: this.$t('base.Pull'),
|
instructionsPullToRefresh: this.$t('base.Pull'),
|
||||||
instructionsReleaseToRefresh: this.$t('base.Release'),
|
instructionsReleaseToRefresh: this.$t('base.Release'),
|
||||||
instructionsRefreshing: this.$t('base.Refreshing'),
|
instructionsRefreshing: this.$t('base.Refreshing'),
|
||||||
onRefresh: function() {
|
onRefresh: () => {
|
||||||
self.$emit('reload');
|
this.$emit('reload');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@ -52,7 +52,7 @@ export default defineComponent({
|
|||||||
_countDownTimeout = undefined;
|
_countDownTimeout = undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
var countDown = ref();
|
const countDown = ref();
|
||||||
watch(() => props.modelValue, () => {
|
watch(() => props.modelValue, () => {
|
||||||
countDown.value = parseCountDown(props.modelValue);
|
countDown.value = parseCountDown(props.modelValue);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -83,10 +83,10 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
modelAllowVersionInfo: {
|
modelAllowVersionInfo: {
|
||||||
get(): any {
|
get(): boolean {
|
||||||
return !!this.allowVersionInfo;
|
return !!this.allowVersionInfo;
|
||||||
},
|
},
|
||||||
set(value: any) {
|
set(value: boolean) {
|
||||||
this.$emit('update:allowVersionInfo', value);
|
this.$emit('update:allowVersionInfo', value);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -83,10 +83,12 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
model: {
|
model: {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
get(): any {
|
get(): any {
|
||||||
if (this.type === 'checkbox') return !!this.modelValue;
|
if (this.type === 'checkbox') return !!this.modelValue;
|
||||||
return this.modelValue;
|
return this.modelValue;
|
||||||
},
|
},
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
set(value: any) {
|
set(value: any) {
|
||||||
this.$emit('update:modelValue', value);
|
this.$emit('update:modelValue', value);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -28,9 +28,11 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
model: {
|
model: {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
get(): any {
|
get(): any {
|
||||||
return this.modelValue;
|
return this.modelValue;
|
||||||
},
|
},
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
set(value: any) {
|
set(value: any) {
|
||||||
this.$emit('update:modelValue', value);
|
this.$emit('update:modelValue', value);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -146,8 +146,8 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
isEaster() {
|
isEaster() {
|
||||||
const easter = this.getEasterSunday(this.now.getFullYear());
|
const easter = this.getEasterSunday(this.now.getFullYear());
|
||||||
var easterStart = new Date(easter);
|
const easterStart = new Date(easter);
|
||||||
var easterEnd = new Date(easter);
|
const easterEnd = new Date(easter);
|
||||||
easterStart.setDate(easterStart.getDate() - 2);
|
easterStart.setDate(easterStart.getDate() - 2);
|
||||||
easterEnd.setDate(easterEnd.getDate() + 1);
|
easterEnd.setDate(easterEnd.getDate() + 1);
|
||||||
return this.now >= easterStart && this.now < easterEnd;
|
return this.now >= easterStart && this.now < easterEnd;
|
||||||
@ -170,15 +170,15 @@ export default defineComponent({
|
|||||||
this.$refs.navbarCollapse && (this.$refs.navbarCollapse as HTMLElement).classList.remove("show");
|
this.$refs.navbarCollapse && (this.$refs.navbarCollapse as HTMLElement).classList.remove("show");
|
||||||
},
|
},
|
||||||
getEasterSunday(year: number): Date {
|
getEasterSunday(year: number): Date {
|
||||||
var f = Math.floor;
|
const f = Math.floor;
|
||||||
var G = year % 19;
|
const G = year % 19;
|
||||||
var C = f(year / 100);
|
const C = f(year / 100);
|
||||||
var H = (C - f(C / 4) - f((8 * C + 13) / 25) + 19 * G + 15) % 30;
|
const H = (C - f(C / 4) - f((8 * C + 13) / 25) + 19 * G + 15) % 30;
|
||||||
var I = H - f(H / 28) * (1 - f(29 / (H + 1)) * f((21 - G) / 11));
|
const I = H - f(H / 28) * (1 - f(29 / (H + 1)) * f((21 - G) / 11));
|
||||||
var J = (year + f(year / 4) + I + 2 - C + f(C / 4)) % 7;
|
const J = (year + f(year / 4) + I + 2 - C + f(C / 4)) % 7;
|
||||||
var L = I - J;
|
const L = I - J;
|
||||||
var month = 3 + f((L + 40) / 44);
|
const month = 3 + f((L + 40) / 44);
|
||||||
var day = L + 28 - 31 * f(month / 4);
|
const day = L + 28 - 31 * f(month / 4);
|
||||||
|
|
||||||
return new Date(year, month - 1, day);
|
return new Date(year, month - 1, day);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -84,9 +84,11 @@ export default defineComponent({
|
|||||||
let comCur = 999999;
|
let comCur = 999999;
|
||||||
|
|
||||||
if (this.selectedPinAssignment && category in this.selectedPinAssignment) {
|
if (this.selectedPinAssignment && category in this.selectedPinAssignment) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
comSel = (this.selectedPinAssignment as any)[category][prop];
|
comSel = (this.selectedPinAssignment as any)[category][prop];
|
||||||
}
|
}
|
||||||
if (this.currentPinAssignment && category in this.currentPinAssignment) {
|
if (this.currentPinAssignment && category in this.currentPinAssignment) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
comCur = (this.currentPinAssignment as any)[category][prop];
|
comCur = (this.currentPinAssignment as any)[category][prop];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,7 @@ export function isLoggedIn(): boolean {
|
|||||||
return (localStorage.getItem('user') != null);
|
return (localStorage.getItem('user') != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function login(username: String, password: String) {
|
export function login(username: string, password: string) {
|
||||||
const requestOptions = {
|
const requestOptions = {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@ -188,8 +188,8 @@ export default defineComponent({
|
|||||||
fetch("/api/config/get?file=" + this.backupFileSelect, { headers: authHeader() })
|
fetch("/api/config/get?file=" + this.backupFileSelect, { headers: authHeader() })
|
||||||
.then(res => res.blob())
|
.then(res => res.blob())
|
||||||
.then(blob => {
|
.then(blob => {
|
||||||
var file = window.URL.createObjectURL(blob);
|
const file = window.URL.createObjectURL(blob);
|
||||||
var a = document.createElement('a');
|
const a = document.createElement('a');
|
||||||
a.href = file;
|
a.href = file;
|
||||||
a.download = this.backupFileSelect;
|
a.download = this.backupFileSelect;
|
||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
|
|||||||
@ -56,7 +56,7 @@ export default defineComponent({
|
|||||||
watch: {
|
watch: {
|
||||||
consoleBuffer() {
|
consoleBuffer() {
|
||||||
if (this.isAutoScroll) {
|
if (this.isAutoScroll) {
|
||||||
let textarea = this.$el.querySelector("#console");
|
const textarea = this.$el.querySelector("#console");
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
textarea.scrollTop = textarea.scrollHeight;
|
textarea.scrollTop = textarea.scrollHeight;
|
||||||
}, 0);
|
}, 0);
|
||||||
@ -121,7 +121,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
this.heartInterval && clearTimeout(this.heartInterval);
|
this.heartInterval && clearTimeout(this.heartInterval);
|
||||||
},
|
},
|
||||||
getOutDate(): String {
|
getOutDate(): string {
|
||||||
const u = new Date();
|
const u = new Date();
|
||||||
return ('0' + u.getHours()).slice(-2) + ':' +
|
return ('0' + u.getHours()).slice(-2) + ':' +
|
||||||
('0' + u.getMinutes()).slice(-2) + ':' +
|
('0' + u.getMinutes()).slice(-2) + ':' +
|
||||||
@ -132,7 +132,7 @@ export default defineComponent({
|
|||||||
this.consoleBuffer = "";
|
this.consoleBuffer = "";
|
||||||
},
|
},
|
||||||
copyConsole() {
|
copyConsole() {
|
||||||
var input = document.createElement('textarea');
|
const input = document.createElement('textarea');
|
||||||
input.innerHTML = this.consoleBuffer;
|
input.innerHTML = this.consoleBuffer;
|
||||||
document.body.appendChild(input);
|
document.body.appendChild(input);
|
||||||
input.select();
|
input.select();
|
||||||
|
|||||||
@ -476,17 +476,15 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var self = this;
|
this.socket.onopen = (event) => {
|
||||||
|
|
||||||
this.socket.onopen = function (event) {
|
|
||||||
console.log(event);
|
console.log(event);
|
||||||
console.log("Successfully connected to the echo websocket server...");
|
console.log("Successfully connected to the echo websocket server...");
|
||||||
self.isWebsocketConnected = true;
|
this.isWebsocketConnected = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.socket.onclose = function () {
|
this.socket.onclose = () => {
|
||||||
console.log("Connection to websocket closed...")
|
console.log("Connection to websocket closed...")
|
||||||
self.isWebsocketConnected = false;
|
this.isWebsocketConnected = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Listen to window events , When the window closes , Take the initiative to disconnect websocket Connect
|
// Listen to window events , When the window closes , Take the initiative to disconnect websocket Connect
|
||||||
|
|||||||
@ -99,7 +99,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
allowVersionInfo(allow: Boolean) {
|
allowVersionInfo(allow: boolean) {
|
||||||
localStorage.setItem("allowVersionInfo", allow ? "1" : "0");
|
localStorage.setItem("allowVersionInfo", allow ? "1" : "0");
|
||||||
if (allow) {
|
if (allow) {
|
||||||
this.getUpdateInfo();
|
this.getUpdateInfo();
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import path from 'path'
|
|||||||
// example 'vite.user.ts': export const proxy_target = '192.168.16.107'
|
// example 'vite.user.ts': export const proxy_target = '192.168.16.107'
|
||||||
let proxy_target;
|
let proxy_target;
|
||||||
try {
|
try {
|
||||||
|
// eslint-disable-next-line
|
||||||
proxy_target = require('./vite.user.ts').proxy_target;
|
proxy_target = require('./vite.user.ts').proxy_target;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
proxy_target = '192.168.20.110';
|
proxy_target = '192.168.20.110';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user