From 3104cf605deaed96677e08a587eb9a1df81366b5 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Fri, 24 Sep 2021 00:13:55 +0100 Subject: [PATCH] :fire: Removes non-essential code from AppInfo modal --- src/components/Configuration/AppInfoModal.vue | 133 +++--------------- 1 file changed, 19 insertions(+), 114 deletions(-) diff --git a/src/components/Configuration/AppInfoModal.vue b/src/components/Configuration/AppInfoModal.vue index 8ba9dbc6..d8c4c98f 100644 --- a/src/components/Configuration/AppInfoModal.vue +++ b/src/components/Configuration/AppInfoModal.vue @@ -1,46 +1,32 @@ @@ -58,71 +44,13 @@ export default { return { modalName: modalNames.ABOUT_APP, appVersion: process.env.VUE_APP_VERSION, - systemInfo: this.getSystemInfo(), errorLog: this.getErrorLog(), - serviceWorkerInfo: 'Checking...', - showInfo: false, }; }, - mounted() { - setTimeout(() => { - this.serviceWorkerInfo = this.getSwStatus(); - }, 100); - }, methods: { getErrorLog() { return sessionStorage.getItem(sessionStorageKeys.ERROR_LOG) || ''; }, - getIsConfigValidStatus() { - const isValidVar = process.env.VUE_APP_CONFIG_VALID; - if (isValidVar === undefined) return 'Config validation status is missing'; - return `Config is ${isValidVar ? 'Valid' : 'Invalid'}`; - }, - getSwStatus() { - const sessionData = sessionStorage[sessionStorageKeys.SW_STATUS]; - const swInfo = sessionData ? JSON.parse(sessionData) : {}; - let swStatus = ''; - if (swInfo.registered) swStatus += 'Service worker registered\n'; - if (swInfo.ready) swStatus += 'Dashy is being served from service worker\n'; - if (swInfo.cached) swStatus += 'Content has been cached for offline use\n'; - if (swInfo.updateFound) swStatus += 'New content is downloading\n'; - if (swInfo.updated) swStatus += 'New content is available; please refresh\n'; - if (swInfo.offline) swStatus += 'No internet connection found. App is running in offline mode\n'; - if (swInfo.error) swStatus += 'Error during service worker registration\n'; - if (swInfo.devMode) swStatus += 'App running in dev mode, no need for service worker\n'; - if (swStatus.length === 0) swStatus += 'No service worker info available'; - return swStatus; - }, - getSystemInfo() { - const { userAgent } = navigator; - - // Find Operating System - let os = 'Unknown'; - if (userAgent.indexOf('Win') !== -1) os = 'Windows'; - else if (userAgent.indexOf('Mac') !== -1) os = 'MacOS'; - else if (userAgent.indexOf('Android') !== -1) os = 'Android'; - else if (userAgent.indexOf('iPhone') !== -1) os = 'iOS'; - else if (userAgent.indexOf('Linux') !== -1) os = 'Linux'; - else if (userAgent.indexOf('X11') !== -1) os = 'UNIX'; - - // Find Browser - let browser = 'Unknown'; - if (userAgent.indexOf('Opera') !== -1) browser = 'Opera'; - else if (userAgent.indexOf('Chrome') !== -1) browser = 'Chrome'; - else if (userAgent.indexOf('Safari') !== -1) browser = 'Safari'; - else if (userAgent.indexOf('Firefox') !== -1) browser = 'Firefox'; - else if (userAgent.indexOf('MSIE') !== -1) browser = 'IE'; - else browser = 'Unknown'; - - const isMobile = !!navigator.userAgent.match(/iphone|android|blackberry/ig) || false; - - return { - os, - browser, - userAgent, - isMobile, - }; - }, }, }; @@ -152,40 +80,17 @@ div.about-modal { } } h3 { - font-size: 1.3rem; - margin: 1rem 0 0.2rem 0; + font-size: 1rem; + margin: 0.5rem 0 0.2rem 0; color: var(--about-page-accent); } - p.small-note { - margin: 0.2rem 0; - } - p.about-text { - margin: 0.2rem 0; - } a { color: var(--about-page-accent); } - ul { - margin-top: 0.2rem; - } a.info { text-decoration: underline; margin-left: 0.2rem; } - .system-info { - font-size: 0.8rem; - background: var(--black); - color: var(--white); - border-radius: var(--curve-factor-small); - padding: 0.5rem; - border: 1px solid var(--white); - width: fit-content; - h4 { - font-size: 0.8rem; - margin: 0 0 0.2rem 0; - text-decoration: underline; - } - } .app-version { text-align: left; }