Skip to content

armgit / dashy

Public Imported from GitHub
0

๐Ÿš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

:egg: Console banner

Alicia Sykes122627f6ce9a
diff --git a/src/App.vue b/src/App.vue
index 7d7faee4..80135d8f 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -13,6 +13,7 @@ import Footer from '@/components/PageStrcture/Footer.vue';
import LoadingScreen from '@/components/PageStrcture/LoadingScreen.vue';
import { componentVisibility } from '@/utils/ConfigHelpers';
import ConfigAccumulator from '@/utils/ConfigAccumalator';
+import { welcomeMsg } from '@/utils/CoolConsole';
import {
localStorageKeys,
splashScreenTime,
@@ -103,6 +104,7 @@ export default {
const cleanedCss = this.appConfig.customCss.replace(/<\/?[^>]+(>|$)/g, '');
this.injectCustomStyles(cleanedCss);
}
+ welcomeMsg();
},
};
</script>
diff --git a/src/utils/CoolConsole.js b/src/utils/CoolConsole.js
new file mode 100644
index 00000000..4bd32bd6
--- /dev/null
+++ b/src/utils/CoolConsole.js
@@ -0,0 +1,14 @@
+/* eslint no-console: ["error", { allow: ["log"] }] */
+
+export const welcomeMsg = () => {
+ const v = process.env.VUE_APP_VERSION ? `V${process.env.VUE_APP_VERSION}` : '';
+ console.log(`%cDashy ${v} ๐Ÿš€`, 'color:#00af87; background:#0b1021; font-size:36px; padding: 0.5rem 0.5rem 0; margin: 1rem auto; font-family: Rockwell; border: 2px solid #00af87; border-radius: 4px;font-weight: bold; text-shadow: 1px 1px 1px #00af87bf;');
+};
+
+export const warningMsg = () => {
+ console.log('%cโš ๏ธ Error โš ๏ธ', "background:#21bbca; color:#0b1021; font-size:20px; padding:0.25rem 0.5rem; margin: 1rem auto 0.25rem; font-family: 'Trebuchet MS', Helvetica; border: 2px solid yellow; border-radius: 4px; font-weight: bold;");
+};
+
+export const raiseBug = () => {
+ console.log('%c๐Ÿ›If you have found a bug, raise an issue on GitHub, at:\nhttps://git.io/JnqPR', "color:#dddd10; font-size: 14px; font-family: 'Trebuchet MS', Helvetica;");
+};
diff --git a/src/utils/ErrorHandler.js b/src/utils/ErrorHandler.js
index 15e27769..eb37160b 100644
--- a/src/utils/ErrorHandler.js
+++ b/src/utils/ErrorHandler.js
@@ -1,11 +1,15 @@
/* eslint no-console: ["error", { allow: ["warn", "error"] }] */
+import { warningMsg, raiseBug } from '@/utils/CoolConsole';
+
/**
* Function called when an error happens
* If you wish to use an error logging service, put code for it here
*/
const ErrorHandler = function handler(msg) {
+ warningMsg();
console.warn(msg);
+ raiseBug();
};
export default ErrorHandler;