Skip to content

Commit

Permalink
yarn prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
skippermeister committed Sep 28, 2024
1 parent 66edd70 commit b4cf2ba
Show file tree
Hide file tree
Showing 83 changed files with 4,530 additions and 2,569 deletions.
4 changes: 2 additions & 2 deletions webapp/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

<script lang="ts">
import { defineComponent } from 'vue';
import NavBar from "./components/NavBar.vue";
import NavBar from './components/NavBar.vue';
export default defineComponent({
name: "App",
name: 'App',
components: {
NavBar,
},
Expand Down
22 changes: 15 additions & 7 deletions webapp/src/components/BasePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,24 @@
<div class="col-sm-11">
<h1>
{{ title }}
<span v-if="showWebSocket" :class="{
'onlineMarker': isWebsocketConnected,
'offlineMarker': !isWebsocketConnected,
}">
<span
v-if="showWebSocket"
:class="{
onlineMarker: isWebsocketConnected,
offlineMarker: !isWebsocketConnected,
}"
>
</span>
</h1>
</div>
<div class="col-sm-1" v-if="showReload">
<button type="button" class="float-end btn btn-outline-primary" @click="$emit('reload')" v-tooltip
:title="$t('base.Reload')">
<button
type="button"
class="float-end btn btn-outline-primary"
@click="$emit('reload')"
v-tooltip
:title="$t('base.Reload')"
>
<BIconArrowClockwise />
</button>
</div>
Expand Down Expand Up @@ -59,7 +67,7 @@ export default defineComponent({
instructionsRefreshing: this.$t('base.Refreshing'),
onRefresh: () => {
this.$emit('reload');
}
},
});
},
unmounted() {
Expand Down
858 changes: 526 additions & 332 deletions webapp/src/components/BatteryView.vue

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions webapp/src/components/BootstrapAlert.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
<template>
<div v-if="isAlertVisible" ref="element" class="alert" role="alert" :class="classes">
<slot />
<button v-if="dismissible" type="button" class="btn-close" data-bs-dismiss="alert" :aria-label="dismissLabel"
@click="dismissClicked" />
<button
v-if="dismissible"
type="button"
class="btn-close"
data-bs-dismiss="alert"
:aria-label="dismissLabel"
@click="dismissClicked"
/>
</div>
</template>

Expand All @@ -24,7 +30,7 @@ export default defineComponent({
show: { type: Boolean, default: false },
variant: { type: String, default: 'info' },
},
emits: ["dismissed", "dismiss-count-down", 'update:modelValue'],
emits: ['dismissed', 'dismiss-count-down', 'update:modelValue'],
setup(props, { emit }) {
const element = ref<HTMLElement>();
const instance = ref<Alert>();
Expand Down
12 changes: 5 additions & 7 deletions webapp/src/components/DevInfo.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<template>
<BootstrapAlert :show="!devInfoList.valid_data">
<h4 class="alert-heading">
<BIconInfoSquare class="fs-2" />&nbsp;{{ $t('devinfo.NoInfo') }}
</h4>
<h4 class="alert-heading"><BIconInfoSquare class="fs-2" />&nbsp;{{ $t('devinfo.NoInfo') }}</h4>
{{ $t('devinfo.NoInfoLong') }}
</BootstrapAlert>
<table v-if="devInfoList.valid_data" class="table table-hover">
Expand Down Expand Up @@ -78,13 +76,13 @@ export default defineComponent({
productionYear() {
return () => {
return ((parseInt(this.devInfoList.serial, 16) >> (7 * 4)) & 0xf) + 2014;
}
};
},
productionWeek() {
return () => {
return ((parseInt(this.devInfoList.serial, 16) >> (5 * 4)) & 0xff).toString(16);
}
}
}
};
},
},
});
</script>
37 changes: 27 additions & 10 deletions webapp/src/components/FirmwareInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
<tr>
<th>{{ $t('firmwareinfo.FirmwareVersion') }}</th>
<td>
<a :href="versionInfoUrl" target="_blank" v-tooltip
:title="$t('firmwareinfo.FirmwareVersionHint')">
<a
:href="versionInfoUrl"
target="_blank"
v-tooltip
:title="$t('firmwareinfo.FirmwareVersionHint')"
>
{{ systemStatus.git_hash }}
</a>
</td>
Expand All @@ -36,18 +40,31 @@
<th>{{ $t('firmwareinfo.FirmwareUpdate') }}</th>
<td>
<div class="form-check form-check-inline form-switch">
<input v-model="modelAllowVersionInfo" class="form-check-input" type="checkbox"
role="switch" v-tooltip :title="$t('firmwareinfo.FrmwareUpdateAllow')" />
<input
v-model="modelAllowVersionInfo"
class="form-check-input"
type="checkbox"
role="switch"
v-tooltip
:title="$t('firmwareinfo.FrmwareUpdateAllow')"
/>
<label class="form-check-label">
<a v-if="modelAllowVersionInfo && systemStatus.update_url !== undefined"
:href="systemStatus.update_url" target="_blank" v-tooltip
:title="$t('firmwareinfo.FirmwareUpdateHint')">
<a
v-if="modelAllowVersionInfo && systemStatus.update_url !== undefined"
:href="systemStatus.update_url"
target="_blank"
v-tooltip
:title="$t('firmwareinfo.FirmwareUpdateHint')"
>
<span class="badge" :class="systemStatus.update_status">
{{ systemStatus.update_text }}
</span>
</a>
<span v-else-if="modelAllowVersionInfo" class="badge"
:class="systemStatus.update_status">
<span
v-else-if="modelAllowVersionInfo"
class="badge"
:class="systemStatus.update_status"
>
{{ systemStatus.update_text }}
</span>
</label>
Expand Down Expand Up @@ -112,7 +129,7 @@ export default defineComponent({
return 'https://github.com/skippermeister/OpenDTU-OnBattery/commits/' + this.systemStatus.git_hash;
}
return 'https://github.com/skippermeister/OpenDTU-OnBattery/releases/tag/' + this.systemStatus.git_hash;
}
},
},
});
</script>
2 changes: 1 addition & 1 deletion webapp/src/components/FormFooter.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<hr class="border border-3 opacity-75">
<hr class="border border-3 opacity-75" />
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<button type="button" class="btn btn-secondary" @click="$emit('reload')">
{{ $t('base.Cancel') }}
Expand Down
10 changes: 8 additions & 2 deletions webapp/src/components/FsInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
<th>{{ name }}</th>
<td>
<div class="progress">
<div class="progress-bar" role="progressbar" :style="{ width: getPercent() + '%' }"
v-bind:aria-valuenow="getPercent()" aria-valuemin="0" aria-valuemax="100">
<div
class="progress-bar"
role="progressbar"
:style="{ width: getPercent() + '%' }"
v-bind:aria-valuenow="getPercent()"
aria-valuemin="0"
aria-valuemax="100"
>
{{ $n(getPercent() / 100, 'percent') }}
</div>
</div>
Expand Down
33 changes: 23 additions & 10 deletions webapp/src/components/GridProfile.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<template>
<BootstrapAlert :show="!hasValidData">
<h4 class="alert-heading">
<BIconInfoSquare class="fs-2" />&nbsp;{{ $t('gridprofile.NoInfo') }}
</h4>
<h4 class="alert-heading"><BIconInfoSquare class="fs-2" />&nbsp;{{ $t('gridprofile.NoInfo') }}</h4>
{{ $t('gridprofile.NoInfoLong') }}
</BootstrapAlert>

Expand All @@ -23,8 +21,14 @@
<div class="accordion" id="accordionProfile">
<div class="accordion-item" v-for="(section, index) in gridProfileList.sections" :key="index">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
:data-bs-target="`#collapse${index}`" aria-expanded="true" :aria-controls="`collapse${index}`">
<button
class="accordion-button collapsed"
type="button"
data-bs-toggle="collapse"
:data-bs-target="`#collapse${index}`"
aria-expanded="true"
:aria-controls="`collapse${index}`"
>
{{ section.name }}
</button>
</h2>
Expand All @@ -39,8 +43,11 @@
{{ $n(value.v, 'decimal') }} {{ value.u }}
</template>
<template v-else>
<StatusBadge :status="value.v == 1" true_text="gridprofile.Enabled"
false_text="gridprofile.Disabled" />
<StatusBadge
:status="value.v == 1"
true_text="gridprofile.Enabled"
false_text="gridprofile.Disabled"
/>
</template>
</td>
</tr>
Expand All @@ -56,8 +63,14 @@
<div class="accordion" id="accordionDev">
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
data-bs-target="#collapseDev" aria-expanded="true" aria-controls="collapseDev">
<button
class="accordion-button collapsed"
type="button"
data-bs-toggle="collapse"
data-bs-target="#collapseDev"
aria-expanded="true"
aria-controls="collapseDev"
>
{{ $t('gridprofile.GridprofileSupport') }}
</button>
</h2>
Expand Down Expand Up @@ -104,7 +117,7 @@ export default defineComponent({
.map(function (x) {
let y = x.toString(16); // to hex
y = ('00' + y).substr(-2); // zero-pad to 2-digits
return y
return y;
})
.join(' ');
};
Expand Down
3 changes: 2 additions & 1 deletion webapp/src/components/HeapDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
<th>{{ $t('heapdetails.MaxUsage') }}</th>
<td>
{{ $n(Math.round(getMaxUsageAbs() / 1024), 'kilobyte') }} ({{
$n(getMaxUsageRel(), 'percent') }})
$n(getMaxUsageRel(), 'percent')
}})
</td>
</tr>
</tbody>
Expand Down
Loading

0 comments on commit b4cf2ba

Please sign in to comment.