webapp: Only include required icons to reduce file size

This commit is contained in:
Thomas Basler 2022-10-15 01:22:53 +02:00
parent d37543fd95
commit 024e16ee85
7 changed files with 78 additions and 8 deletions

View File

@ -99,3 +99,23 @@
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import {
BIconInfoCircle,
BIconActivity,
BIconBug,
BIconChat
} from 'bootstrap-icons-vue';
export default defineComponent({
components: {
BIconInfoCircle,
BIconActivity,
BIconBug,
BIconChat,
},
});
</script>

View File

@ -116,11 +116,19 @@
<script lang="ts">
import { defineComponent } from 'vue';
import {
BIconExclamationCircleFill,
BIconArrowLeft,
BIconCheckCircle
} from 'bootstrap-icons-vue';
import * as bootstrap from 'bootstrap';
import BootstrapAlert from "@/components/partials/BootstrapAlert.vue";
export default defineComponent({
components: {
BIconExclamationCircleFill,
BIconArrowLeft,
BIconCheckCircle,
BootstrapAlert,
},
data() {

View File

@ -74,8 +74,20 @@
<script lang="ts">
import { defineComponent } from 'vue';
import SparkMD5 from "spark-md5";
import {
BIconExclamationCircleFill,
BIconArrowLeft,
BIconArrowRepeat,
BIconCheckCircle
} from 'bootstrap-icons-vue';
export default defineComponent({
components: {
BIconExclamationCircleFill,
BIconArrowLeft,
BIconArrowRepeat,
BIconCheckCircle,
},
data() {
return {
loading: true,
@ -122,7 +134,7 @@ export default defineComponent({
this.uploading = true;
const formData = new FormData();
if (event !== null) {
const target= event.target as HTMLInputElement;
const target = event.target as HTMLInputElement;
if (target.files !== null) {
this.file = target.files[0];
}

View File

@ -314,11 +314,23 @@
<script lang="ts">
import { defineComponent } from 'vue';
import InverterChannelInfo from "@/components/partials/InverterChannelInfo.vue";
import * as bootstrap from 'bootstrap';
import {
BIconXCircleFill,
BIconExclamationCircleFill,
BIconCheckCircleFill,
BIconSpeedometer,
BIconPower,
BIconCpu,
BIconJournalText,
BIconToggleOn,
BIconToggleOff,
BIconArrowCounterclockwise
} from 'bootstrap-icons-vue';
import EventLog from '@/components/partials/EventLog.vue';
import DevInfo from '@/components/partials/DevInfo.vue';
import BootstrapAlert from '@/components/partials/BootstrapAlert.vue';
import InverterChannelInfo from "@/components/partials/InverterChannelInfo.vue";
declare interface Inverter {
serial: number,
@ -337,6 +349,16 @@ export default defineComponent({
EventLog,
DevInfo,
BootstrapAlert,
BIconXCircleFill,
BIconExclamationCircleFill,
BIconCheckCircleFill,
BIconSpeedometer,
BIconPower,
BIconCpu,
BIconJournalText,
BIconToggleOn,
BIconToggleOff,
BIconArrowCounterclockwise,
},
data() {
return {

View File

@ -146,6 +146,10 @@
<script lang="ts">
import { defineComponent } from 'vue';
import {
BIconTrash,
BIconPencil
} from 'bootstrap-icons-vue';
import * as bootstrap from 'bootstrap';
import BootstrapAlert from "@/components/partials/BootstrapAlert.vue";
@ -160,6 +164,8 @@ declare interface Inverter {
export default defineComponent({
components: {
BootstrapAlert,
BIconTrash,
BIconPencil,
},
data() {
return {
@ -184,7 +190,7 @@ export default defineComponent({
this.getInverters();
},
computed: {
sortedInverters() {
sortedInverters(): Inverter[] {
return this.inverters.slice().sort((a, b) => {
return a.serial - b.serial;
});

View File

@ -10,7 +10,8 @@
<td>Model</td>
<td v-if="devInfoList.hw_model_name != ''">{{ devInfoList.hw_model_name }}</td>
<td v-else>Unknown model! Please report the "Hardware Part Number" and model (e.g. HM-350) as an issue
<a href="https://github.com/tbnobody/OpenDTU/issues" target="_blank">here</a>.</td>
<a href="https://github.com/tbnobody/OpenDTU/issues" target="_blank">here</a>.
</td>
</tr>
<tr>
<td>Bootloader Version</td>
@ -38,6 +39,7 @@
<script lang="ts">
import { defineComponent } from 'vue';
import { BIconInfoSquare } from 'bootstrap-icons-vue';
import BootstrapAlert from '@/components/partials/BootstrapAlert.vue';
declare interface DevInfoData {
@ -52,6 +54,7 @@ declare interface DevInfoData {
export default defineComponent({
components: {
BIconInfoSquare,
BootstrapAlert,
},
props: {

View File

@ -1,9 +1,8 @@
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { BootstrapIconsPlugin } from 'bootstrap-icons-vue';
import "bootstrap/dist/css/bootstrap.min.css"
import "bootstrap"
createApp(App).use(router).use(BootstrapIconsPlugin).mount('#app')
createApp(App).use(router).mount('#app')