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