Skip to content

Commit

Permalink
feat: add support for klipper runtime warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <[email protected]>
  • Loading branch information
meteyou committed Mar 6, 2024
1 parent 5c6556c commit aa6a39f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"DeprecatedOptionHeadline": "Deprecated Klipper Option",
"DeprecatedValue": "Value '{value}' in option '{option}' in section '{section}' is deprecated and will be removed in a future release.",
"DeprecatedValueHeadline": "Deprecated Klipper Value",
"KlipperRuntimeWarning": "Klipper runtime warning",
"KlipperWarning": "Klipper warning"
},
"MoonrakerWarnings": {
Expand Down
4 changes: 4 additions & 0 deletions src/store/gui/notifications/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ export const getters: GetterTree<GuiNotificationState, any> = {
if (warnings.length) {
const date = rootState.server.system_boot_at ?? new Date()

window.console.log(warnings)

// get all dismissed klipper warnings and convert it to a string[]
const warningsDismisses = rootGetters['gui/notifications/getDismissByCategory']('klipperWarning').map(
(dismiss: GuiNotificationStateDismissEntry) => {
Expand All @@ -293,6 +295,8 @@ export const getters: GetterTree<GuiNotificationState, any> = {
} else if (warning.type === 'deprecated_option') {
title = i18n.t('App.Notifications.KlipperWarnings.DeprecatedOptionHeadline').toString()
description = i18n.t('App.Notifications.KlipperWarnings.DeprecatedOption', warning).toString()
} else if (warning.type === 'runtime_warning') {
title = i18n.t('App.Notifications.KlipperWarnings.KlipperRuntimeWarning').toString()
}

// generate url to mainsail docs to fix this warning
Expand Down

0 comments on commit aa6a39f

Please sign in to comment.