mirror of https://github.com/Lissy93/dashy.git
🥚 Console banner
This commit is contained in:
parent
3434bfacba
commit
122627f6ce
|
@ -13,6 +13,7 @@ import Footer from '@/components/PageStrcture/Footer.vue';
|
||||||
import LoadingScreen from '@/components/PageStrcture/LoadingScreen.vue';
|
import LoadingScreen from '@/components/PageStrcture/LoadingScreen.vue';
|
||||||
import { componentVisibility } from '@/utils/ConfigHelpers';
|
import { componentVisibility } from '@/utils/ConfigHelpers';
|
||||||
import ConfigAccumulator from '@/utils/ConfigAccumalator';
|
import ConfigAccumulator from '@/utils/ConfigAccumalator';
|
||||||
|
import { welcomeMsg } from '@/utils/CoolConsole';
|
||||||
import {
|
import {
|
||||||
localStorageKeys,
|
localStorageKeys,
|
||||||
splashScreenTime,
|
splashScreenTime,
|
||||||
|
@ -103,6 +104,7 @@ export default {
|
||||||
const cleanedCss = this.appConfig.customCss.replace(/<\/?[^>]+(>|$)/g, '');
|
const cleanedCss = this.appConfig.customCss.replace(/<\/?[^>]+(>|$)/g, '');
|
||||||
this.injectCustomStyles(cleanedCss);
|
this.injectCustomStyles(cleanedCss);
|
||||||
}
|
}
|
||||||
|
welcomeMsg();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -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;");
|
||||||
|
};
|
|
@ -1,11 +1,15 @@
|
||||||
/* eslint no-console: ["error", { allow: ["warn", "error"] }] */
|
/* eslint no-console: ["error", { allow: ["warn", "error"] }] */
|
||||||
|
|
||||||
|
import { warningMsg, raiseBug } from '@/utils/CoolConsole';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function called when an error happens
|
* Function called when an error happens
|
||||||
* If you wish to use an error logging service, put code for it here
|
* If you wish to use an error logging service, put code for it here
|
||||||
*/
|
*/
|
||||||
const ErrorHandler = function handler(msg) {
|
const ErrorHandler = function handler(msg) {
|
||||||
|
warningMsg();
|
||||||
console.warn(msg);
|
console.warn(msg);
|
||||||
|
raiseBug();
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ErrorHandler;
|
export default ErrorHandler;
|
||||||
|
|
Loading…
Reference in New Issue