Skip to content

Commit

Permalink
webapp: Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tbnobody committed Apr 12, 2024
1 parent b58d086 commit de156ef
Show file tree
Hide file tree
Showing 13 changed files with 189 additions and 185 deletions.
5 changes: 2 additions & 3 deletions webapp/src/components/BasePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
});
},
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/components/BootstrapAlert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default defineComponent({
_countDownTimeout = undefined;
};
var countDown = ref();
const countDown = ref();
watch(() => props.modelValue, () => {
countDown.value = parseCountDown(props.modelValue);
});
Expand Down Expand Up @@ -116,4 +116,4 @@ export default defineComponent({
};
},
});
</script>
</script>
4 changes: 2 additions & 2 deletions webapp/src/components/FirmwareInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
},
Expand Down
4 changes: 3 additions & 1 deletion webapp/src/components/InputElement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
Expand All @@ -112,4 +114,4 @@ export default defineComponent({
}
},
});
</script>
</script>
2 changes: 2 additions & 0 deletions webapp/src/components/InputSerial.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
Expand Down
24 changes: 12 additions & 12 deletions webapp/src/components/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -170,18 +170,18 @@ 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);
}
},
});
</script>
</script>
2 changes: 2 additions & 0 deletions webapp/src/components/PinInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/utils/authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/views/ConfigAdminView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading

0 comments on commit de156ef

Please sign in to comment.