From bef948521867966486f29c615e041b2a3e3edf00 Mon Sep 17 00:00:00 2001 From: Matt Wisniewski Date: Wed, 24 Nov 2021 20:06:20 -0500 Subject: [PATCH] Debug info (#313) * fix(Archived Messages): FIxes badge used for archived messages * feat(Console): Debug info & warning --- pages/auth/unlock/index.vue | 55 +++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/pages/auth/unlock/index.vue b/pages/auth/unlock/index.vue index ada33c435b..38c133b4cc 100644 --- a/pages/auth/unlock/index.vue +++ b/pages/auth/unlock/index.vue @@ -41,6 +41,61 @@ export default Vue.extend({ }, }, mounted() { + // This information can be useful for users to help us find and report bugs. + console.clear() + console.log( + '%c⚠️ Do not share anything from console with others. Do not run commands sent by others online.', + 'font-family: Space Mono; color:white; background: #e67e22; border-radius: 2px; padding: 0.5rem;border-right: none;', + ) + console.log( + '%c🪲 The following info however can be useful for bug reporting. Click the tag below to show more details.', + 'font-family: Space Mono; color:white; background: #2c3e50; border-radius: 2px; padding: 0.5rem;border-right: none;', + ) + console.groupCollapsed('%c🛰 Satellite.im%cℹ', + 'font-family: Space Mono; color:white; background: #34495e; border-radius: 2px 0 0 2px; padding: 0.1rem 0.5rem;border-right: none;', + 'color:white; background: #3498db;border-radius: 0 2px 2px 0; padding: 0.1rem 0.5rem; border-left: none;',) + + console.log( + `%c${this.$config.clientVersion} %cPre-Alpha`, + 'font-family: Space Mono; color:white; background: #34495e; border-radius: 2px 0 0 2px; padding: 0.1rem 0.5rem;border-right: none;', + 'color:white; background: #9b59b6;border-radius: 0 2px 2px 0; padding: 0.1rem 0.5rem; border-left: none;', + ) + console.log( + `%cBrowser %c${navigator.vendor}, ${navigator.product}`, + 'font-family: Space Mono; color:white; background: #34495e; border-radius: 2px 0 0 2px; padding: 0.1rem 0.5rem;border-right: none;', + 'color:white; background: #9b59b6;border-radius: 0 2px 2px 0; padding: 0.1rem 0.5rem; border-left: none;', + ) + console.log( + `%cLanguage%c${navigator.language}`, + 'font-family: Space Mono; color:white; background: #34495e; border-radius: 2px 0 0 2px; padding: 0.1rem 0.5rem;border-right: none;', + 'color:white; background: #9b59b6;border-radius: 0 2px 2px 0; padding: 0.1rem 0.5rem; border-left: none;', + ) + console.log( + `%cPlatform%c${navigator.platform}`, + 'font-family: Space Mono; color:white; background: #34495e; border-radius: 2px 0 0 2px; padding: 0.1rem 0.5rem;border-right: none;', + 'color:white; background: #9b59b6;border-radius: 0 2px 2px 0; padding: 0.1rem 0.5rem; border-left: none;', + ) + if (navigator.onLine) { + console.log( + `%cNetwork %cConnected`, + 'font-family: Space Mono; color:white; background: #34495e; border-radius: 2px 0 0 2px; padding: 0.1rem 0.5rem;border-right: none;', + 'color:white; background: #2ecc71; border-radius: 0 2px 2px 0; padding: 0.1rem 0.5rem; border-left: none;', + ) + } else { + console.log( + `%cNetwork %cOffline`, + 'font-family: Space Mono; color:white; background: #34495e; border-radius: 2px 0 0 2px; padding: 0.1rem 0.5rem;border-right: none;', + 'color:white; background: #e74c3c; border-radius: 0 2px 2px 0; padding: 0.1rem 0.5rem; border-left: none;', + ) + } + + console.groupCollapsed( + `%c📦 Open State`, + 'font-family: Space Mono; color: #222; background: #f1c40f; border-radius: 2px; padding: 0.1rem 0.5rem;border-right: none;', + ) + console.log(this.$store.state) + console.groupEnd() + console.groupEnd() this.$store.commit('accounts/lock') this.$store.commit('prerequisites/resetState') },