webapp: Fix eslint issues
This commit is contained in:
parent
4cd5d79c73
commit
d3d96b51ce
@ -1,22 +1,12 @@
|
||||
/* eslint-env node */
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
import { FlatCompat } from "@eslint/eslintrc";
|
||||
import js from "@eslint/js";
|
||||
import pluginVue from 'eslint-plugin-vue'
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
recommendedConfig: js.configs.recommended,
|
||||
});
|
||||
import vueTsEslintConfig from '@vue/eslint-config-typescript'
|
||||
|
||||
export default [
|
||||
js.configs.recommended,
|
||||
...pluginVue.configs['flat/essential'],
|
||||
...compat.extends("@vue/eslint-config-typescript/recommended"),
|
||||
...vueTsEslintConfig(),
|
||||
{
|
||||
files: [
|
||||
"**/*.vue",
|
||||
|
||||
@ -216,7 +216,9 @@ export default defineComponent({
|
||||
this.$router.push('/');
|
||||
},
|
||||
onClick() {
|
||||
this.$refs.navbarCollapse && (this.$refs.navbarCollapse as HTMLElement).classList.remove('show');
|
||||
if (this.$refs.navbarCollapse) {
|
||||
(this.$refs.navbarCollapse as HTMLElement).classList.remove('show');
|
||||
}
|
||||
},
|
||||
getEasterSunday(year: number): Date {
|
||||
const f = Math.floor;
|
||||
|
||||
@ -48,4 +48,4 @@ export interface Device {
|
||||
display: Display;
|
||||
}
|
||||
|
||||
export interface PinMapping extends Array<Device> {}
|
||||
export type PinMapping = Array<Device>;
|
||||
|
||||
@ -84,7 +84,7 @@ export default defineComponent({
|
||||
this.socket.onmessage = (event) => {
|
||||
console.log(event);
|
||||
|
||||
let outstr = new String(event.data);
|
||||
let outstr = String(event.data);
|
||||
let removedNewline = false;
|
||||
if (outstr.endsWith('\n')) {
|
||||
outstr = outstr.substring(0, outstr.length - 1);
|
||||
@ -108,7 +108,9 @@ export default defineComponent({
|
||||
},
|
||||
// Send heartbeat packets regularly * 59s Send a heartbeat
|
||||
heartCheck() {
|
||||
this.heartInterval && clearTimeout(this.heartInterval);
|
||||
if (this.heartInterval) {
|
||||
clearTimeout(this.heartInterval);
|
||||
}
|
||||
this.heartInterval = setInterval(() => {
|
||||
if (this.socket.readyState === 1) {
|
||||
// Connection status
|
||||
@ -126,7 +128,9 @@ export default defineComponent({
|
||||
// continue regardless of error
|
||||
}
|
||||
|
||||
this.heartInterval && clearTimeout(this.heartInterval);
|
||||
if (this.heartInterval) {
|
||||
clearTimeout(this.heartInterval);
|
||||
}
|
||||
},
|
||||
getOutDate(): string {
|
||||
const u = new Date();
|
||||
|
||||
@ -734,7 +734,9 @@ export default defineComponent({
|
||||
},
|
||||
// Send heartbeat packets regularly * 59s Send a heartbeat
|
||||
heartCheck(duration: number = 59) {
|
||||
this.heartInterval && clearTimeout(this.heartInterval);
|
||||
if (this.heartInterval) {
|
||||
clearTimeout(this.heartInterval);
|
||||
}
|
||||
this.heartInterval = setInterval(() => {
|
||||
if (this.socket.readyState === 1) {
|
||||
// Connection status
|
||||
@ -747,7 +749,9 @@ export default defineComponent({
|
||||
/** To break off websocket Connect */
|
||||
closeSocket() {
|
||||
this.socket.close();
|
||||
this.heartInterval && clearTimeout(this.heartInterval);
|
||||
if (this.heartInterval) {
|
||||
clearTimeout(this.heartInterval);
|
||||
}
|
||||
this.isFirstFetchAfterConnect = true;
|
||||
},
|
||||
onShowEventlog(serial: string) {
|
||||
|
||||
@ -14,7 +14,7 @@ let proxy_target;
|
||||
try {
|
||||
// eslint-disable-next-line
|
||||
proxy_target = require('./vite.user.ts').proxy_target;
|
||||
} catch (error) {
|
||||
} catch {
|
||||
proxy_target = '192.168.20.110';
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user