webapp: create interface for DevInfoStatus
This commit is contained in:
parent
2682ca8dec
commit
4775f34f5b
@ -38,19 +38,10 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { defineComponent, type PropType } from 'vue';
|
||||
import { BIconInfoSquare } from 'bootstrap-icons-vue';
|
||||
import BootstrapAlert from '@/components/BootstrapAlert.vue';
|
||||
|
||||
declare interface DevInfoData {
|
||||
valid_data: boolean,
|
||||
fw_bootloader_version: number,
|
||||
fw_build_version: number,
|
||||
fw_build_datetime: Date,
|
||||
hw_part_number: number,
|
||||
hw_version: number,
|
||||
hw_model_name: string,
|
||||
}
|
||||
import type { DevInfoStatus } from "@/types/DevInfoStatus";
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
@ -58,7 +49,7 @@ export default defineComponent({
|
||||
BootstrapAlert,
|
||||
},
|
||||
props: {
|
||||
devInfoList: { type: Object as () => DevInfoData, required: true },
|
||||
devInfoList: { type: Object as PropType<DevInfoStatus>, required: true },
|
||||
},
|
||||
computed: {
|
||||
formatVersion() {
|
||||
|
||||
9
webapp/src/types/DevInfoStatus.ts
Normal file
9
webapp/src/types/DevInfoStatus.ts
Normal file
@ -0,0 +1,9 @@
|
||||
export interface DevInfoStatus {
|
||||
valid_data: boolean,
|
||||
fw_bootloader_version: number,
|
||||
fw_build_version: number,
|
||||
fw_build_datetime: Date,
|
||||
hw_part_number: number,
|
||||
hw_version: number,
|
||||
hw_model_name: string
|
||||
}
|
||||
@ -154,7 +154,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<DevInfo v-if="!devInfoLoading" :devInfoList="(devInfoList as any)" />
|
||||
<DevInfo v-if="!devInfoLoading" :devInfoList="devInfoList" />
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
@ -341,6 +341,7 @@ import EventLog from '@/components/EventLog.vue';
|
||||
import DevInfo from '@/components/DevInfo.vue';
|
||||
import BootstrapAlert from '@/components/BootstrapAlert.vue';
|
||||
import InverterChannelInfo from "@/components/InverterChannelInfo.vue";
|
||||
import type { DevInfoStatus } from '@/types/DevInfoStatus';
|
||||
|
||||
declare interface Inverter {
|
||||
serial: number,
|
||||
@ -383,7 +384,7 @@ export default defineComponent({
|
||||
eventLogList: {},
|
||||
eventLogLoading: true,
|
||||
devInfoView: {} as bootstrap.Modal,
|
||||
devInfoList: {},
|
||||
devInfoList: {} as DevInfoStatus,
|
||||
devInfoLoading: true,
|
||||
|
||||
limitSettingView: {} as bootstrap.Modal,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user