diff --git a/webapp/src/components/HomeView.vue b/webapp/src/components/HomeView.vue
index 938a8e8..a8ad859 100644
--- a/webapp/src/components/HomeView.vue
+++ b/webapp/src/components/HomeView.vue
@@ -23,13 +23,26 @@
:id="'v-pills-' + inverter.serial" role="tabpanel"
:aria-labelledby="'v-pills-' + inverter.serial + '-tab'" tabindex="0">
-
@@ -54,17 +94,20 @@
import { defineComponent } from 'vue';
import InverterChannelInfo from "@/components/partials/InverterChannelInfo.vue";
import * as bootstrap from 'bootstrap';
+import EventLog from '@/components/partials/EventLog.vue';
declare interface Inverter {
serial: number,
name: string,
age_critical: boolean,
- data_age: 0
+ data_age: 0,
+ events: 0
}
export default defineComponent({
components: {
InverterChannelInfo,
+ EventLog
},
data() {
return {
@@ -73,11 +116,17 @@ export default defineComponent({
waitForData: true,
inverterData: [] as Inverter[],
isFirstFetchAfterConnect: true,
+ eventLogView: {} as bootstrap.Modal,
+ eventLogList: {},
+ eventLogLoading: true
};
},
created() {
this.initSocket();
},
+ mounted() {
+ this.eventLogView = new bootstrap.Modal('#eventView');
+ },
unmounted() {
this.closeSocket();
},
@@ -140,6 +189,20 @@ export default defineComponent({
this.heartInterval && clearTimeout(this.heartInterval);
this.isFirstFetchAfterConnect = true;
},
+ onHideEventlog() {
+ this.eventLogView.hide();
+ },
+ onShowEventlog(serial: number) {
+ this.eventLogLoading = true;
+ fetch("/api/eventlog/status")
+ .then((response) => response.json())
+ .then((data) => {
+ this.eventLogList = data[serial];
+ this.eventLogLoading = false;
+ });
+
+ this.eventLogView.show();
+ },
},
});
\ No newline at end of file
diff --git a/webapp/src/components/partials/EventLog.vue b/webapp/src/components/partials/EventLog.vue
new file mode 100644
index 0000000..f8ebe32
--- /dev/null
+++ b/webapp/src/components/partials/EventLog.vue
@@ -0,0 +1,57 @@
+
+
+
+ | Start |
+ Stop |
+ ID |
+ Message |
+
+
+
+
+ | {{ timeInHours(eventLogList.events[event - 1].start_time) }} |
+ {{ timeInHours(eventLogList.events[event - 1].end_time) }} |
+ {{ eventLogList.events[event - 1].message_id }} |
+ {{ eventLogList.events[event - 1].message }} |
+
+
+
+
+
+
+
\ No newline at end of file