feature: display moonraker warnings on the dashboard

Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
Stefan Dej committed 2021-05-31 00:15:14 +02:00
1 parent 1529261f6a
commit 037db5f14a
5 files changed
+45

No files matched your search

@@ -0,0 +1,36 @@
<template>
<v-card class="mb-6">
<v-toolbar flat dense color="orange darken-2">
<v-toolbar-title>
<span class="subheading">
<v-icon class="mdi mdi-alert-circle" left></v-icon>{{ $t("Panels.MoonrakerWarningsPanel.MoonrakerWarnings") }}
</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text :class="index > 0 ? 'py-0' : 'pt-3 pb-0'" v-for="(warning, index) in warnings" v-bind:key="warning">
<v-divider class="my-2" v-if="index"></v-divider>
<p class="orange--text mb-0">{{ warning }}</p>
</v-card-text>
<v-divider class="mb-2 mt-3"></v-divider>
<v-card-actions class="px-4 pt-2 pb-4 text-center text-lg-left">
<v-btn small :href="'//'+hostname+':'+port+'/server/files/moonraker.log'" color="primary" class=""><v-icon class="mr-2">mdi-download</v-icon>{{ $t("Panels.MoonrakerWarningsPanel.DownloadLog") }}</v-btn>
</v-card-actions>
</v-card>
</template>
<script>
import { mapState } from 'vuex';
export default {
data: () => ({
}),
computed: {
...mapState({
warnings: state => state.server.warnings,
hostname: state => state.socket.hostname,
port: state => state.socket.port,
}),
},
}
</script>
+2
View File
@@ -4,6 +4,7 @@ import StatusPanel from './StatusPanel.vue'
import KlippyStatePanel from './KlippyStatePanel.vue'
import MinSettingsPanel from './MinSettingsPanel.vue'
import MoonrakerFailedComponentsPanel from './MoonrakerFailedComponentsPanel.vue'
import MoonrakerWarningsPanel from './MoonrakerWarningsPanel.vue'
import ToolsPanel from './ToolsPanel.vue'
import ControlPanel from "./ControlPanel";
import ZOffsetPanel from "./ZOffsetPanel";
@@ -18,6 +19,7 @@ Vue.component('status-panel', StatusPanel);
Vue.component('klippy-state-panel', KlippyStatePanel);
Vue.component('min-settings-panel', MinSettingsPanel);
Vue.component('moonraker-failed-components-panel', MoonrakerFailedComponentsPanel);
Vue.component('moonraker-warnings-panel', MoonrakerWarningsPanel);
Vue.component('tools-panel', ToolsPanel);
Vue.component('control-panel', ControlPanel);
Vue.component('zoffset-panel', ZOffsetPanel);
+4
View File
@@ -247,6 +247,10 @@
"FollowingPluginHasAnError": "Following plugin has an error:",
"DownloadLog": "Download Log"
},
"MoonrakerWarningsPanel": {
"MoonrakerWarnings": "Moonraker Warnings",
"DownloadLog": "Download Log"
},
"PowerControlPanel": {
"PowerControl": "Power Control",
"Error": "Error",
+2
View File
@@ -3,6 +3,7 @@
<v-col class="col-sm-12 col-md-5">
<min-settings-panel v-if="klippy_state === 'ready' && existsPrinterConfig"></min-settings-panel>
<moonraker-failed-components-panel v-if="moonrakerFailedComponents.length"></moonraker-failed-components-panel>
<moonraker-warnings-panel v-if="moonrakerWarnings.length"></moonraker-warnings-panel>
<klippy-state-panel v-if="socket_connected && klippy_state !== 'ready'"></klippy-state-panel>
<status-panel v-if="klippy_state === 'ready'"></status-panel>
<webcam-panel class="mt-6" v-if="showDashboardWebcam"></webcam-panel>
@@ -33,6 +34,7 @@
klippy_connected: state => state.server.klippy_connected,
klippy_state: state => state.server.klippy_state,
moonrakerFailedComponents: state => state.server.failed_components,
moonrakerWarnings: state => state.server.warnings,
showDashboardWebcam: state => state.gui.dashboard.boolWebcam,
showDashboardConsole: state => state.gui.dashboard.boolConsole,
+1
View File
@@ -15,6 +15,7 @@ export function getDefaultState() {
klippy_message: "",
components: [],
failed_components: [],
warnings: [],
registered_directories: [],
events: [],
config: {},