diff --git a/src/components/settings/UserSession.vue b/src/components/settings/UserSession.vue index 1bbf603..d27903a 100644 --- a/src/components/settings/UserSession.vue +++ b/src/components/settings/UserSession.vue @@ -15,7 +15,11 @@
Plattform:
- +
@@ -78,38 +82,46 @@ export default defineComponent({ const options = ref(['Minuten', 'Stunden', 'Tage']); const option = ref(options.value[0]); const lifetime = ref(0); - function getBrowserIcon(browser: string) { - console.log('browser', browser); - return browser == 'firefox' + function getBrowserIcon(br: string) { + const browser = br.toLowerCase(); + return browser.includes('firefox') ? 'mdi-firefox' - : browser == 'chrome' + : browser.includes('chrome') ? 'mdi-google-chrome' - : browser == 'safari' + : browser.includes('safari') ? 'mdi-apple-safari' + : browser.includes('edge') + ? 'mdi-microsoft-edge' + : browser.includes('opera') + ? 'mdi-opera' + : browser.includes('ie') + ? 'mdi-internet-explorer' : 'mdi-help'; } - function getPlatformIcon(platform: string) { + function getPlatformIcon(pl: string) { + const platform = pl.toLowerCase(); console.log('platform', platform); - return platform == 'linux' + return platform.includes('linux') ? 'mdi-linux' - : platform == 'windows' + : platform.includes('windows') ? 'mdi-microsoft-windows' - : platform == 'macos' + : platform.includes('mac') ? 'mdi-apple' - : platform == 'iphone' + : platform.includes('ios') ? 'mdi-cellphone' - : platform == 'android' + : platform.includes('android') ? 'mdi-cellphone' : 'mdi-help'; } - function getOS(platform: string) { - return platform == 'iphone' + function getOS(pl: string) { + const platform = pl.toLowerCase(); + return platform.includes('ios') ? 'mdi-apple' - : platform == 'android' + : platform.includes('android') ? 'mdi-android' - : 'mdi-help'; + : false; } async function deleteSession(token: string) {