Merge branch 'master' of github.com:Lissy93/dashy into FEATURE/minimal-view
This commit is contained in:
@@ -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>
|
||||
|
||||
142
src/assets/locales/de.json
Normal file
142
src/assets/locales/de.json
Normal file
@@ -0,0 +1,142 @@
|
||||
{
|
||||
"home": {
|
||||
"no-results": "keine Suchresultate",
|
||||
"no-data": "keine Daten Konfiguriert"
|
||||
},
|
||||
"search": {
|
||||
"search-label": "Suche",
|
||||
"search-placeholder": "Starte tippen um zu filtern",
|
||||
"clear-search-tooltip": "Leere die Suche"
|
||||
},
|
||||
"login": {
|
||||
"title": "Dashy",
|
||||
"username-label": "Username",
|
||||
"password-label": "Passwort",
|
||||
"login-button": "Login",
|
||||
"remember-me-label": "Angemeldet bleiben für",
|
||||
"remember-me-never": "Niemals",
|
||||
"remember-me-hour": "4 Stunden",
|
||||
"remember-me-day": "1 Tag",
|
||||
"remember-me-week": "1 Woche"
|
||||
},
|
||||
"config": {
|
||||
"main-tab": "Config",
|
||||
"view-config-tab": "zeige Config",
|
||||
"edit-config-tab": "bearbeite Config",
|
||||
"custom-css-tab": "eigene Styles",
|
||||
"heading": "Konfiguration optionen",
|
||||
"download-config-button": "Download Config",
|
||||
"edit-config-button": "bearbeite Config",
|
||||
"edit-css-button": "bearbeite Custom CSS",
|
||||
"cloud-sync-button": "aktiviere Cloud Sync",
|
||||
"edit-cloud-sync-button": "bearbeite Cloud Sync",
|
||||
"rebuild-app-button": "Anwendung neu erstellen",
|
||||
"change-language-button": "ändere App Sprache",
|
||||
"reset-settings-button": "Lokale Einstellungen zurücksetzten",
|
||||
"app-info-button": "App Info",
|
||||
"backup-note": "Es wird empfohlen ein Backup der Konfiguration zu erstellen, bevor Änderungen durchgeführt werden.",
|
||||
"reset-config-msg-l1": "Dadurch werden alle Benutzereinstellungen aus dem lokalen Speicher entfernt, hat jedoch keine Auswirkungen auf Ihre Datei 'conf.yml'.",
|
||||
"reset-config-msg-l2": "Sie sollten zuerst alle Änderungen, die Sie lokal vorgenommen haben, sichern, wenn Sie sie in Zukunft verwenden möchten.",
|
||||
"reset-config-msg-l3": "Sind Sie sicher, dass Sie fortfahren möchten?",
|
||||
"data-cleared-msg": "Daten erfolgreich gelöscht",
|
||||
"actions-label": "Aktionen",
|
||||
"copy-config-label": "Config kopieren",
|
||||
"data-copied-msg": "Config wurde in die Zwischenablage kopiert",
|
||||
"reset-config-label": "Config zurücksetzten",
|
||||
"css-save-btn": "Änderungen speichern",
|
||||
"css-note-label": "Bemerkung",
|
||||
"css-note-l1": "Sie müssen die Seite aktualisieren, damit Ihre Änderungen wirksam werden.",
|
||||
"css-note-l2": "Stilüberschreibungen werden nur lokal gespeichert, daher wird empfohlen, eine Kopie Ihres CSS zu erstellen.",
|
||||
"css-note-l3": "Um alle benutzerdefinierten Stile zu entfernen, löschen Sie den Inhalt und klicken Sie auf Änderungen speichern."
|
||||
},
|
||||
"settings": {
|
||||
"theme-label": "Theme",
|
||||
"layout-label": "Layout",
|
||||
"layout-auto": "Auto",
|
||||
"layout-horizontal": "Horizontal",
|
||||
"layout-vertical": "Vertikal",
|
||||
"item-size-label": "Item größe",
|
||||
"item-size-small": "klein",
|
||||
"item-size-medium": "mittel",
|
||||
"item-size-large": "groß",
|
||||
"config-launcher-label": "Config"
|
||||
},
|
||||
"updates": {
|
||||
"app-version-note": "Dashy version",
|
||||
"up-to-date": "Up-to-Date",
|
||||
"out-of-date": "Update Verfügbar",
|
||||
"unsupported-version-l1": "Sie verwenden eine nicht unterstützte Version von Dashy",
|
||||
"unsupported-version-l2": "Für die beste Erfahrung und aktuelle Sicherheitspatches aktualisieren Sie bitte auf"
|
||||
},
|
||||
"language-switcher": {
|
||||
"title": "Ändere die Applikationssprache",
|
||||
"dropdown-label": "Sprache Auswählen",
|
||||
"save-button": "Speichern",
|
||||
"success-msg": "Sprache geändert zu"
|
||||
},
|
||||
"theme-maker": {
|
||||
"title": "Theme Konfigurator",
|
||||
"export-button": "Benutzerdefinierte Variablen exportieren",
|
||||
"reset-button": "Styles zurücksetzen für",
|
||||
"show-all-button": "Alle Variablen anzeigen",
|
||||
"save-button": "Speichern",
|
||||
"cancel-button": "Abbrechen",
|
||||
"saved-toast": "{theme} wurde Erfolgreich geupdated",
|
||||
"copied-toast": "Theme Daten für {theme} in Zwischenablage kopiert.",
|
||||
"reset-toast": "Benutzerdefinierte Farben für {theme} entfernt"
|
||||
},
|
||||
"config-editor": {
|
||||
"save-location-label": "Speicherort",
|
||||
"location-local-label": "Lokal",
|
||||
"location-disk-label": "Änderungen in die Konfigurationsdatei schreiben",
|
||||
"save-button": "speichere Änderungen",
|
||||
"valid-label": "Config ist gültig",
|
||||
"status-success-msg": "Aufgabe abgeschlossen",
|
||||
"status-fail-msg": "Aufgabe fehlgeschlagen",
|
||||
"success-msg-disk": "Konfigurationsdatei erfolgreich auf die Festplatte geschrieben",
|
||||
"success-msg-local": "Lokale Änderungen erfolgreich gespeichert",
|
||||
"success-note-l1": "Die App sollte automatisch rebuild werden.",
|
||||
"success-note-l2": "Dies kann bis zu einer Minute dauern.",
|
||||
"success-note-l3": "Sie müssen die Seite aktualisieren, damit die Änderungen wirksam werden.",
|
||||
"error-msg-save-mode": "Bitte wählen Sie einen Speichermodus: Lokal oder Datei",
|
||||
"error-msg-cannot-save": "Beim Speichern der Konfiguration ist ein Fehler aufgetreten",
|
||||
"error-msg-bad-json": "Fehler in JSON, möglicherweise fehlerhaft",
|
||||
"warning-msg-validation": "Validierungswarnung"
|
||||
},
|
||||
"app-rebuild": {
|
||||
"title": "Rebuild Application",
|
||||
"rebuild-note-l1": "Damit die in die Datei conf.yml geschriebenen Änderungen wirksam werden, ist ein rebuild erforderlich.",
|
||||
"rebuild-note-l2": "Dies sollte automatisch passieren, aber wenn nicht, können Sie es hier manuell auslösen.",
|
||||
"rebuild-note-l3": "Dies ist bei lokal gespeicherten Änderungen nicht erforderlich.",
|
||||
"rebuild-button": "Start Build",
|
||||
"rebuilding-status-1": "Building...",
|
||||
"rebuilding-status-2": "Das kann ein paar minuten dauern",
|
||||
"error-permission": "Sie sind nicht berechtigt, diese Aktion auszulösen",
|
||||
"success-msg": "Build erfolgreich abgeschlossen",
|
||||
"fail-msg": "Build-Vorgang fehlgeschlagen",
|
||||
"reload-note": "Ein Neuladen der Seite ist jetzt erforderlich, damit die Änderungen wirksam werden.",
|
||||
"reload-button": "Seite neuladen"
|
||||
},
|
||||
"cloud-sync": {
|
||||
"title": "Cloud Backup & Wiederherstellung",
|
||||
"intro-l1": "Cloud-Backup und Wiederherstellung ist eine optionale Funktion, mit der Sie Ihre Config in das Internet hochladen und dann auf einem anderen Gerät oder einer anderen Dashy-Instanz wiederherstellen können.",
|
||||
"intro-l2": "Alle Daten sind vollständig Ende-zu-Ende mit AES verschlüsselt. Ihr Passwort wird als Schlüssel verwendet wird.",
|
||||
"intro-l3": "Weitere Informationen finden Sie im",
|
||||
"backup-title-setup": "Backup erstellen",
|
||||
"backup-title-update": "Backup aktualisieren",
|
||||
"password-label-setup": "Passwort auswählen",
|
||||
"password-label-update": "Passwort eigeben",
|
||||
"backup-button-setup": "Backup",
|
||||
"backup-button-update": "Backup aktualisieren",
|
||||
"backup-id-label": "Your Backup ID",
|
||||
"backup-id-note": "Dies wird verwendet, um später aus Backups wiederherzustellen. Bewahren Sie es zusammen mit Ihrem Passwort an einem sicheren Ort auf.",
|
||||
"restore-title": "Backup wiederherstellen",
|
||||
"restore-id-label": "Restore ID",
|
||||
"restore-password-label": "Passwort",
|
||||
"restore-button": "wiederherstellen",
|
||||
"backup-error-unknown": "Anfrage kann nicht verarbeitet werden",
|
||||
"backup-error-password": "Falsches Passwort. Bitte geben Sie Ihr aktuelles Passwort ein.",
|
||||
"backup-success-msg": "Erfolgreich beendet",
|
||||
"restore-success-msg": "Config erfolgreich wiederhergestellt"
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,6 @@
|
||||
"change-language-button": "Change App Language",
|
||||
"reset-settings-button": "Reset Local Settings",
|
||||
"app-info-button": "App Info",
|
||||
"app-version-note": "Dashy version",
|
||||
"backup-note": "It is recommend to make a backup of your configuration before making changes.",
|
||||
"reset-config-msg-l1": "This will remove all user settings from local storage, but won't effect your 'conf.yml' file.",
|
||||
"reset-config-msg-l2": "You should first backup any changes you've made locally, if you want to use them in the future.",
|
||||
@@ -62,6 +61,13 @@
|
||||
"item-size-large": "Large",
|
||||
"config-launcher-label": "Config"
|
||||
},
|
||||
"updates": {
|
||||
"app-version-note": "Dashy version",
|
||||
"up-to-date": "Up-to-Date",
|
||||
"out-of-date": "Update Available",
|
||||
"unsupported-version-l1": "You are using an unsupported version of Dashy",
|
||||
"unsupported-version-l2": "For the best experience, and recent security patches, please update to"
|
||||
},
|
||||
"language-switcher": {
|
||||
"title": "Change Application Language",
|
||||
"dropdown-label": "Select a Language",
|
||||
@@ -105,8 +111,8 @@
|
||||
"rebuild-button": "Start Build",
|
||||
"rebuilding-status-1": "Building...",
|
||||
"rebuilding-status-2": "This may take a few minutes",
|
||||
"error-permission": "You do no have permission to trigger this action",
|
||||
"success-msg": "Build completed succesfully",
|
||||
"error-permission": "You don't have permission to trigger this action",
|
||||
"success-msg": "Build completed successfully",
|
||||
"fail-msg": "Build operation failed",
|
||||
"reload-note": "A page reload is now required for changes to take effect",
|
||||
"reload-button": "Reload Page"
|
||||
|
||||
142
src/assets/locales/nl.json
Normal file
142
src/assets/locales/nl.json
Normal file
@@ -0,0 +1,142 @@
|
||||
{
|
||||
"home": {
|
||||
"no-results": "Geen Zoekresultaten",
|
||||
"no-data": "Geen Data Geconfigureerd"
|
||||
},
|
||||
"search": {
|
||||
"search-label": "Zoek",
|
||||
"search-placeholder": "Begin met typen om te filteren",
|
||||
"clear-search-tooltip": "Wis Zoekopdracht"
|
||||
},
|
||||
"login": {
|
||||
"title": "Dashy",
|
||||
"username-label": "Gebruikersnaam",
|
||||
"password-label": "Wachtwoord",
|
||||
"login-button": "Aanmelden",
|
||||
"remember-me-label": "Onthoud mij voor",
|
||||
"remember-me-never": "Nooit",
|
||||
"remember-me-hour": "4 Uur",
|
||||
"remember-me-day": "1 Dag",
|
||||
"remember-me-week": "1 Week"
|
||||
},
|
||||
"config": {
|
||||
"main-tab": "Config",
|
||||
"view-config-tab": "Bekijk Config",
|
||||
"edit-config-tab": "Wijzig Config",
|
||||
"custom-css-tab": "Aangepaste Stijlen",
|
||||
"heading": "Configuratie Opties",
|
||||
"download-config-button": "Download Config",
|
||||
"edit-config-button": "Wijzig Config",
|
||||
"edit-css-button": "Wijzig Aangepaste CSS",
|
||||
"cloud-sync-button": "Schakel Cloud Synchronisatie In",
|
||||
"edit-cloud-sync-button": "Wijzig Cloud Synchronisatie",
|
||||
"rebuild-app-button": "Herbouw Applicatie",
|
||||
"change-language-button": "Verander App Taal",
|
||||
"reset-settings-button": "Reset Lokale Instellingen",
|
||||
"app-info-button": "App Info",
|
||||
"backup-note": "Het is aan te raden een backup van de configuratie te maken voordat de instellingen worden aangepast.",
|
||||
"reset-config-msg-l1": "Dit zal alle gebruikersinstellingen verwijderen van local storage, maar past het 'conf.yml' bestand niet aan.",
|
||||
"reset-config-msg-l2": "Maak eerst een backup van de lokale veranderingen, om ze later nog te kunnen gebruiken.",
|
||||
"reset-config-msg-l3": "Weet je het zeker?",
|
||||
"data-cleared-msg": "Data succesvol verwijderd",
|
||||
"actions-label": "Acties",
|
||||
"copy-config-label": "Kopieer Config",
|
||||
"data-copied-msg": "Config is gekopieerd naar het klembord",
|
||||
"reset-config-label": "Reset Config",
|
||||
"css-save-btn": "Sla Wijzigingen Op",
|
||||
"css-note-label": "Let op",
|
||||
"css-note-l1": "Herlaad de pagina om de veranderingen toe te passen.",
|
||||
"css-note-l2": "Stijl overrides worden alleen lokaal opgeslagen, het is verstandig om een kopie van de CSS te maken.",
|
||||
"css-note-l3": "Om alle aangepaste stijlen te verwijderen, verwijder de inhoud en druk op Sla Wijzigingen Op"
|
||||
},
|
||||
"settings": {
|
||||
"theme-label": "Thema",
|
||||
"layout-label": "Layout",
|
||||
"layout-auto": "Auto",
|
||||
"layout-horizontal": "Horizontaal",
|
||||
"layout-vertical": "Verticaal",
|
||||
"item-size-label": "Itemgrootte",
|
||||
"item-size-small": "Klein",
|
||||
"item-size-medium": "Gemiddeld",
|
||||
"item-size-large": "Groot",
|
||||
"config-launcher-label": "Config"
|
||||
},
|
||||
"updates": {
|
||||
"app-version-note": "Dashy versie",
|
||||
"up-to-date": "Bijgewerkt",
|
||||
"out-of-date": "Update Beschikbaar",
|
||||
"unsupported-version-l1": "Je gebruikt een niet-ondersteunde versie van Dashy",
|
||||
"unsupported-version-l2": "Voor de beste ervaring en betere beveiliging, update naar"
|
||||
},
|
||||
"language-switcher": {
|
||||
"title": "Verander Applicatie Taal",
|
||||
"dropdown-label": "Selecteer een Taal",
|
||||
"save-button": "Opslaan",
|
||||
"success-msg": "Taal Veranderd naar"
|
||||
},
|
||||
"theme-maker": {
|
||||
"title": "Thema Configurator",
|
||||
"export-button": "Exporteer Aangepaste Variabelen",
|
||||
"reset-button": "Reset Stijlen voor",
|
||||
"show-all-button": "Toon Alle Variabelen",
|
||||
"save-button": "Opslaan",
|
||||
"cancel-button": "Annuleren",
|
||||
"saved-toast": "{theme} Succesvol Bijgewerkt",
|
||||
"copied-toast": "Thema data voor {theme} naar klembord gekopieerd",
|
||||
"reset-toast": "Aangepaste Kleuren voor {theme} Verwijderd"
|
||||
},
|
||||
"config-editor": {
|
||||
"save-location-label": "Sla Locatie Op",
|
||||
"location-local-label": "Pas Lokaal Toe",
|
||||
"location-disk-label": "Sla Veranderingen Op in Config Bestand",
|
||||
"save-button": "Opslaan",
|
||||
"valid-label": "Config is Geldig",
|
||||
"status-success-msg": "Taak Voltooid",
|
||||
"status-fail-msg": "Taak Gefaald",
|
||||
"success-msg-disk": "Config bestand succesvol opgeslagen",
|
||||
"success-msg-local": "Lokale aanpassingen succesvol opgeslagen",
|
||||
"success-note-l1": "De applicatie zou automatisch moeten herbouwen.",
|
||||
"success-note-l2": "Dit duurt maximaal een minuut.",
|
||||
"success-note-l3": "Herlaad de pagina om de veranderingen toe te passen.",
|
||||
"error-msg-save-mode": "Selecteer een Save Mode: Lokaal of Bestand",
|
||||
"error-msg-cannot-save": "Een fout trad op tijdens het opslaan van de config",
|
||||
"error-msg-bad-json": "Fout in JSON, mogelijk ongeldige structuur",
|
||||
"warning-msg-validation": "Validatie Waarschuwing"
|
||||
},
|
||||
"app-rebuild": {
|
||||
"title": "Herbouw Applicatie",
|
||||
"rebuild-note-l1": "Het is nodig de applicatie te herbouwen om de veranderingen in conf.yml toe te passen.",
|
||||
"rebuild-note-l2": "Dit zou automatisch moeten gebeuren, mocht dit niet het geval zijn, kun je het hier handmatig starten.",
|
||||
"rebuild-note-l3": "Dit is niet nodig voor lokaal opgeslagen aanpassingen.",
|
||||
"rebuild-button": "Start Build",
|
||||
"rebuilding-status-1": "Building...",
|
||||
"rebuilding-status-2": "Dit kan een paar minuten duren",
|
||||
"error-permission": "Je bent niet bevoegd deze actie uit te voeren",
|
||||
"success-msg": "Build succesvol uitgevoerd",
|
||||
"fail-msg": "Build proces gefaald",
|
||||
"reload-note": "Herlaad de pagina om de veranderingen toe te passen",
|
||||
"reload-button": "Herlaad Pagina"
|
||||
},
|
||||
"cloud-sync": {
|
||||
"title": "Cloud Backup & Herstel",
|
||||
"intro-l1": "Cloud Backup & Herstel is een optionele functie, die het mogelijk maakt om het config bestand naar het internet te uploaden en het te herstellen op een ander apparaat of instantie van Dashy.",
|
||||
"intro-l2": "Alle data is volledig end-to-end versleuteld met AES, met je wachtwoord als de sleutel.",
|
||||
"intro-l3": "Voor meer informatie, zie",
|
||||
"backup-title-setup": "Maak een Backup",
|
||||
"backup-title-update": "Update Backup",
|
||||
"password-label-setup": "Kies een Wachtwoord",
|
||||
"password-label-update": "Voer Wachtwoord in",
|
||||
"backup-button-setup": "Backup",
|
||||
"backup-button-update": "Update Backup",
|
||||
"backup-id-label": "Je Backup ID",
|
||||
"backup-id-note": "Dit wordt gebruikt om later backups te herstellen. Dus sla het ergens veilig op, samen met je wachtwoord.",
|
||||
"restore-title": "Herstel een Backup",
|
||||
"restore-id-label": "Herstel ID",
|
||||
"restore-password-label": "Wachtwoord",
|
||||
"restore-button": "Herstel",
|
||||
"backup-error-unknown": "Kon verzoek niet uitvoeren",
|
||||
"backup-error-password": "Incorrect wachtwoord. Voer alsjeblieft je huidige wachtwoord in.",
|
||||
"backup-success-msg": "Succesvol Uitgevoerd",
|
||||
"restore-success-msg": "Config Succesvol Hersteld"
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,9 @@
|
||||
<modal :name="modalName" :resizable="true" width="40%" height="60%" classes="dashy-modal">
|
||||
<div class="about-modal">
|
||||
<router-link to="/about">
|
||||
<h2>Dashy V{{ appVersion }}</h2>
|
||||
<h2>Dashy</h2>
|
||||
</router-link>
|
||||
<AppVersion />
|
||||
<h3>Service Worker Status</h3>
|
||||
<code v-html="serviceWorkerInfo">{{ serviceWorkerInfo }}</code>
|
||||
<br>
|
||||
@@ -39,10 +40,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AppVersion from '@/components/Configuration/AppVersion';
|
||||
import { modalNames, sessionStorageKeys } from '@/utils/defaults';
|
||||
|
||||
export default {
|
||||
name: 'AppInfoModal',
|
||||
components: {
|
||||
AppVersion,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
modalName: modalNames.ABOUT_APP,
|
||||
|
||||
112
src/components/Configuration/AppVersion.vue
Normal file
112
src/components/Configuration/AppVersion.vue
Normal file
@@ -0,0 +1,112 @@
|
||||
<template>
|
||||
<div class="app-version">
|
||||
<!-- Current Version -->
|
||||
<p>
|
||||
{{ $t('updates.app-version-note') }} {{ appVersion }}
|
||||
</p>
|
||||
<div v-if="checksEnabled">
|
||||
<!-- Results haven't come in yet, either still checking, or error -->
|
||||
<p v-if="!finished">
|
||||
{{ error ? 'Error checking for updates.' : 'Chcekcing for Updates...' }}
|
||||
</p>
|
||||
<!-- App is up-to-date -->
|
||||
<p v-if="finished && isUpToDate" class="up-to-date">
|
||||
✅ {{ $t('updates.up-to-date') }}
|
||||
</p>
|
||||
<!-- An update is available, but not too out-of-date -->
|
||||
<p v-else-if="finished && !veryOutOfDate" class="update-availible">
|
||||
⚠️{{ $t('updates.out-of-date') }}: <b>{{ latestVersion }}</b>
|
||||
</p>
|
||||
<!-- Update available, app is VERY out of date, show some additional info -->
|
||||
<p v-else-if="finished && veryOutOfDate" class="big-update-availible">
|
||||
❗ {{ $t('updates.out-of-date') }}: <b>{{ latestVersion }}</b>
|
||||
<span class="please-update">
|
||||
{{ $t('updates.unsupported-version-l1') }}.<br>
|
||||
{{ $t('updates.unsupported-version-2') }} {{ latestVersion }}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
|
||||
export default {
|
||||
name: 'AppInfoModal',
|
||||
inject: ['config'],
|
||||
data() {
|
||||
return {
|
||||
appVersion: process.env.VUE_APP_VERSION, // Current version, from package.json
|
||||
latestVersion: '', // Will store latest version, when request returns
|
||||
checksEnabled: true, // Should we check for updates
|
||||
isUpToDate: true, // Is current version === latest version
|
||||
veryOutOfDate: false, // If the app is more than 5 versions out of date
|
||||
finished: false, // Set to true when request is done
|
||||
error: false, // Set to true if checkig fails
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
const appConfig = this.config.appConfig || {};
|
||||
if (!this.appVersion || (appConfig && appConfig.disableUpdateChecks)) {
|
||||
// Either current version isn't found, or user disabled checks
|
||||
this.checksEnabled = false;
|
||||
} else {
|
||||
this.checkVersion(); // Trigger the check
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/* Gets the apps latest version from Dashy's git repo */
|
||||
checkVersion() {
|
||||
const packageUrl = 'https://raw.githubusercontent.com/Lissy93/dashy/master/package.json';
|
||||
axios.get(packageUrl).then((response) => {
|
||||
if (response && response.data && response.data.version) {
|
||||
this.latestVersion = response.data.version;
|
||||
this.isUpToDate = this.checkIfUpToDate(this.appVersion, this.latestVersion);
|
||||
this.finished = true;
|
||||
}
|
||||
}).catch(() => {
|
||||
this.error = true;
|
||||
});
|
||||
},
|
||||
/* Compares the current version, with the package.json version */
|
||||
checkIfUpToDate(currentVersion, latestVersion) {
|
||||
const parse = (version) => parseInt(version.replaceAll('.', ''), 10);
|
||||
const difference = parse(latestVersion) - parse(currentVersion);
|
||||
if (difference > 5) this.veryOutOfDate = true;
|
||||
return difference <= 0;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
div.app-version {
|
||||
color: var(--settings-text-color);
|
||||
text-align: center;
|
||||
p {
|
||||
margin: 0.5rem auto;
|
||||
color: var(--transparent-white-50);
|
||||
cursor: default;
|
||||
&.up-to-date {
|
||||
color: var(--success);
|
||||
font-weight: bold;
|
||||
opacity: 0.8;
|
||||
}
|
||||
&.update-availible {
|
||||
color: var(--warning);
|
||||
opacity: 0.8;
|
||||
}
|
||||
&.big-update-availible {
|
||||
color: var(--danger);
|
||||
.please-update {
|
||||
font-size: 0.8rem;
|
||||
color: var(--danger);
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -2,46 +2,48 @@
|
||||
<Tabs :navAuto="true" name="Add Item" ref="tabView">
|
||||
<TabItem :name="$t('config.main-tab')" class="main-tab">
|
||||
<div class="main-options-container">
|
||||
<h2>Configuration Options</h2>
|
||||
<a class="hyperlink-wrapper" @click="downloadConfigFile('conf.yml', yaml)">
|
||||
<button class="config-button center">
|
||||
<DownloadIcon class="button-icon"/>
|
||||
{{ $t('config.download-config-button') }}
|
||||
<div class="config-buttons">
|
||||
<h2>Configuration Options</h2>
|
||||
<a class="hyperlink-wrapper" @click="downloadConfigFile('conf.yml', yaml)">
|
||||
<button class="config-button center">
|
||||
<DownloadIcon class="button-icon"/>
|
||||
{{ $t('config.download-config-button') }}
|
||||
</button>
|
||||
</a>
|
||||
<button class="config-button center" @click="() => navigateToTab(2)">
|
||||
<EditIcon class="button-icon"/>
|
||||
{{ $t('config.edit-config-button') }}
|
||||
</button>
|
||||
</a>
|
||||
<button class="config-button center" @click="() => navigateToTab(2)">
|
||||
<EditIcon class="button-icon"/>
|
||||
{{ $t('config.edit-config-button') }}
|
||||
</button>
|
||||
<button class="config-button center" @click="() => navigateToTab(3)">
|
||||
<CustomCssIcon class="button-icon"/>
|
||||
{{ $t('config.edit-css-button') }}
|
||||
</button>
|
||||
<button class="config-button center" @click="openCloudSync()">
|
||||
<CloudIcon class="button-icon"/>
|
||||
{{backupId ? $t('config.edit-cloud-sync-button') : $t('config.cloud-sync-button') }}
|
||||
</button>
|
||||
<button class="config-button center" @click="openLanguageSwitchModal()">
|
||||
<LanguageIcon class="button-icon"/>
|
||||
{{ $t('config.change-language-button') }}
|
||||
</button>
|
||||
<button class="config-button center" @click="openRebuildAppModal()">
|
||||
<RebuildIcon class="button-icon"/>
|
||||
{{ $t('config.rebuild-app-button') }}
|
||||
</button>
|
||||
<button class="config-button center" @click="resetLocalSettings()">
|
||||
<DeleteIcon class="button-icon"/>
|
||||
{{ $t('config.reset-settings-button') }}
|
||||
</button>
|
||||
<button class="config-button center" @click="openAboutModal()">
|
||||
<IconAbout class="button-icon" />
|
||||
{{ $t('config.app-info-button') }}
|
||||
</button>
|
||||
<p class="small-screen-note" style="display: none;">
|
||||
You are using a very small screen, and some screens in this menu may not be optimal
|
||||
</p>
|
||||
<p class="app-version">{{ $t('config.app-version-note') }} {{ appVersion }}</p>
|
||||
<p class="language">{{ getLanguage() }}</p>
|
||||
<button class="config-button center" @click="() => navigateToTab(4)">
|
||||
<CustomCssIcon class="button-icon"/>
|
||||
{{ $t('config.edit-css-button') }}
|
||||
</button>
|
||||
<button class="config-button center" @click="() => navigateToTab(3)">
|
||||
<CloudIcon class="button-icon"/>
|
||||
{{backupId ? $t('config.edit-cloud-sync-button') : $t('config.cloud-sync-button') }}
|
||||
</button>
|
||||
<button class="config-button center" @click="openLanguageSwitchModal()">
|
||||
<LanguageIcon class="button-icon"/>
|
||||
{{ $t('config.change-language-button') }}
|
||||
</button>
|
||||
<button class="config-button center" @click="openRebuildAppModal()">
|
||||
<RebuildIcon class="button-icon"/>
|
||||
{{ $t('config.rebuild-app-button') }}
|
||||
</button>
|
||||
<button class="config-button center" @click="resetLocalSettings()">
|
||||
<DeleteIcon class="button-icon"/>
|
||||
{{ $t('config.reset-settings-button') }}
|
||||
</button>
|
||||
<button class="config-button center" @click="openAboutModal()">
|
||||
<IconAbout class="button-icon" />
|
||||
{{ $t('config.app-info-button') }}
|
||||
</button>
|
||||
<p class="small-screen-note" style="display: none;">
|
||||
You are using a very small screen, and some screens in this menu may not be optimal
|
||||
</p>
|
||||
<p class="language">{{ getLanguage() }}</p>
|
||||
<AppVersion />
|
||||
</div>
|
||||
<div class="config-note">
|
||||
<span>{{ $t('config.backup-note') }}</span>
|
||||
</div>
|
||||
@@ -67,6 +69,9 @@
|
||||
<TabItem :name="$t('config.edit-config-tab')">
|
||||
<JsonEditor :config="config" />
|
||||
</TabItem>
|
||||
<TabItem :name="$t('cloud-sync.title')">
|
||||
<CloudBackupRestore :config="config" />
|
||||
</TabItem>
|
||||
<TabItem :name="$t('config.custom-css-tab')">
|
||||
<CustomCssEditor :config="config" />
|
||||
</TabItem>
|
||||
@@ -74,7 +79,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import hljs from 'highlight.js/lib/core';
|
||||
import yaml from 'highlight.js/lib/languages/yaml';
|
||||
import 'highlight.js/styles/mono-blue.css';
|
||||
@@ -84,7 +88,9 @@ import { localStorageKeys, modalNames } from '@/utils/defaults';
|
||||
import { getUsersLanguage } from '@/utils/ConfigHelpers';
|
||||
import JsonEditor from '@/components/Configuration/JsonEditor';
|
||||
import CustomCssEditor from '@/components/Configuration/CustomCss';
|
||||
import CloudBackupRestore from '@/components/Configuration/CloudBackupRestore';
|
||||
import RebuildApp from '@/components/Configuration/RebuildApp';
|
||||
import AppVersion from '@/components/Configuration/AppVersion';
|
||||
|
||||
import DownloadIcon from '@/assets/interface-icons/config-download-file.svg';
|
||||
import DeleteIcon from '@/assets/interface-icons/config-delete-local.svg';
|
||||
@@ -102,6 +108,7 @@ export default {
|
||||
jsonParser: JsonToYaml,
|
||||
backupId: localStorage[localStorageKeys.BACKUP_ID] || '',
|
||||
appVersion: process.env.VUE_APP_VERSION,
|
||||
latestVersion: '',
|
||||
};
|
||||
},
|
||||
props: {
|
||||
@@ -118,7 +125,9 @@ export default {
|
||||
components: {
|
||||
JsonEditor,
|
||||
CustomCssEditor,
|
||||
CloudBackupRestore,
|
||||
RebuildApp,
|
||||
AppVersion,
|
||||
DownloadIcon,
|
||||
DeleteIcon,
|
||||
EditIcon,
|
||||
@@ -140,9 +149,6 @@ export default {
|
||||
openAboutModal() {
|
||||
this.$modal.show(modalNames.ABOUT_APP);
|
||||
},
|
||||
openCloudSync() {
|
||||
this.$modal.show(modalNames.CLOUD_BACKUP);
|
||||
},
|
||||
openLanguageSwitchModal() {
|
||||
this.$modal.show(modalNames.LANG_SWITCHER);
|
||||
},
|
||||
@@ -213,7 +219,8 @@ a.config-button, button.config-button {
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
margin: 0.5rem auto;
|
||||
width: 18rem;
|
||||
min-width: 18rem;
|
||||
width: 100%;
|
||||
svg.button-icon {
|
||||
path {
|
||||
fill: var(--config-settings-color);
|
||||
@@ -232,6 +239,13 @@ a.config-button, button.config-button {
|
||||
}
|
||||
}
|
||||
|
||||
a.hyperlink-wrapper {
|
||||
margin: 0 auto;
|
||||
text-decoration: none;
|
||||
min-width: 18rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
p.app-version, p.language {
|
||||
margin: 0.5rem auto;
|
||||
font-size: 1rem;
|
||||
@@ -292,17 +306,21 @@ div.code-container {
|
||||
}
|
||||
}
|
||||
|
||||
a.hyperlink-wrapper {
|
||||
margin: 0 auto;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.main-options-container {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.config-buttons {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-top: 2rem;
|
||||
background: var(--config-settings-background);
|
||||
height: calc(100% - 2rem);
|
||||
height: calc(100% - 4rem);
|
||||
width: fit-content;
|
||||
margin: 0 auto;
|
||||
padding: 2rem 1rem;
|
||||
h2 {
|
||||
margin: 0 auto 1rem auto;
|
||||
color: var(--config-settings-color);
|
||||
@@ -311,7 +329,6 @@ a.hyperlink-wrapper {
|
||||
|
||||
.config-note {
|
||||
width: 80%;
|
||||
position: absolute;
|
||||
bottom: 1rem;
|
||||
left: 10%;
|
||||
margin: 0.5rem auto;
|
||||
|
||||
@@ -146,6 +146,7 @@ export default {
|
||||
localStorage.setItem(localStorageKeys.PAGE_INFO, JSON.stringify(data.pageInfo));
|
||||
}
|
||||
if (data.appConfig) {
|
||||
data.appConfig.auth = this.config.appConfig.auth || [];
|
||||
localStorage.setItem(localStorageKeys.APP_CONFIG, JSON.stringify(data.appConfig));
|
||||
}
|
||||
if (data.appConfig.theme) {
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
<template>
|
||||
<header>
|
||||
<PageTitle v-if="titleVisible" :title="pageInfo.title" :description="pageInfo.description" />
|
||||
<PageTitle
|
||||
v-if="titleVisible"
|
||||
:title="pageInfo.title"
|
||||
:description="pageInfo.description"
|
||||
:logo="pageInfo.logo"
|
||||
/>
|
||||
<Nav v-if="navVisible" :links="pageInfo.navLinks" class="nav" />
|
||||
</header>
|
||||
</template>
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
<template>
|
||||
<router-link to="/" class="page-titles">
|
||||
<img v-if="logo" :src="logo" class="site-logo" />
|
||||
<div class="text">
|
||||
<h1>{{ title }}</h1>
|
||||
<span class="subtitle">{{ description }}</span>
|
||||
</div>
|
||||
</router-link>
|
||||
</template>
|
||||
|
||||
@@ -11,6 +14,7 @@ export default {
|
||||
props: {
|
||||
title: String,
|
||||
description: String,
|
||||
logo: String,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -20,7 +24,9 @@ export default {
|
||||
|
||||
.page-titles {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: wrap;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
text-decoration: none;
|
||||
h1 {
|
||||
color: var(--heading-text-color);
|
||||
@@ -33,7 +39,13 @@ export default {
|
||||
text-shadow: 1px 1px 2px #130f23;
|
||||
opacity: var(--dimming-factor);
|
||||
}
|
||||
img.site-logo {
|
||||
margin: 0.2rem 0.5rem 0.2rem 0;
|
||||
max-width: 3.5rem;
|
||||
height: fit-content;
|
||||
}
|
||||
@include phone {
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
padding: 0.25rem 0;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
<div class="config-buttons">
|
||||
<IconSpanner @click="showEditor()" tabindex="-2"
|
||||
v-tooltip="tooltip('Update configuration')" />
|
||||
<IconCloud @click="showCloudModal()" tabindex="-2"
|
||||
v-tooltip="tooltip('Backup / restore cloud config')" />
|
||||
</div>
|
||||
|
||||
<!-- Modal containing all the configuration options -->
|
||||
@@ -15,12 +13,6 @@
|
||||
<ConfigContainer :config="combineConfig()" />
|
||||
</modal>
|
||||
|
||||
<!-- Modal for cloud backup and restore options -->
|
||||
<modal :name="modalNames.CLOUD_BACKUP" :resizable="true" width="65%" height="60%"
|
||||
@closed="$emit('modalChanged', false)" classes="dashy-modal">
|
||||
<CloudBackupRestore :config="combineConfig()" />
|
||||
</modal>
|
||||
|
||||
<!-- Modal for manually changing locale -->
|
||||
<modal :name="modalNames.LANG_SWITCHER" classes="dashy-modal"
|
||||
:resizable="true" width="30%" height="25%">
|
||||
@@ -33,9 +25,7 @@
|
||||
<script>
|
||||
|
||||
import IconSpanner from '@/assets/interface-icons/config-editor.svg';
|
||||
import IconCloud from '@/assets/interface-icons/cloud-backup-restore.svg';
|
||||
import ConfigContainer from '@/components/Configuration/ConfigContainer';
|
||||
import CloudBackupRestore from '@/components/Configuration/CloudBackupRestore';
|
||||
import LanguageSwitcher from '@/components/Settings/LanguageSwitcher';
|
||||
import { topLevelConfKeys, localStorageKeys, modalNames } from '@/utils/defaults';
|
||||
|
||||
@@ -48,9 +38,7 @@ export default {
|
||||
},
|
||||
components: {
|
||||
IconSpanner,
|
||||
IconCloud,
|
||||
ConfigContainer,
|
||||
CloudBackupRestore,
|
||||
LanguageSwitcher,
|
||||
},
|
||||
props: {
|
||||
@@ -64,10 +52,6 @@ export default {
|
||||
this.$modal.show(modalNames.CONF_EDITOR);
|
||||
this.$emit('modalChanged', true);
|
||||
},
|
||||
showCloudModal: function show() {
|
||||
this.$modal.show(modalNames.CLOUD_BACKUP);
|
||||
this.$emit('modalChanged', true);
|
||||
},
|
||||
combineConfig() {
|
||||
const conf = {};
|
||||
conf[topLevelConfKeys.APP_CONFIG] = this.appConfig;
|
||||
|
||||
@@ -104,9 +104,9 @@ export default {
|
||||
/* Updates theme. Checks if the new theme is local or external,
|
||||
and calls appropirate updating function. Updates local storage */
|
||||
updateTheme(newTheme) {
|
||||
if (newTheme === 'Deafault') {
|
||||
if (newTheme === 'Default') {
|
||||
this.resetToDefault();
|
||||
this.themeHelper.theme = 'Deafault';
|
||||
this.themeHelper.theme = 'Default';
|
||||
} else if (this.isThemeLocal(newTheme)) {
|
||||
this.ApplyLocalTheme(newTheme);
|
||||
} else {
|
||||
@@ -131,7 +131,8 @@ export default {
|
||||
div.vs__dropdown-toggle {
|
||||
border-color: var(--settings-text-color);
|
||||
border-radius: var(--curve-factor);
|
||||
width: 8rem;
|
||||
min-width: 8rem;
|
||||
max-width: 16rem;
|
||||
height: 1.8rem;
|
||||
font-size: 0.85rem;
|
||||
cursor: pointer;
|
||||
|
||||
34
src/main.js
34
src/main.js
@@ -1,22 +1,25 @@
|
||||
/* eslint-disable no-multi-spaces */
|
||||
// Import core framework and essential utils
|
||||
import Vue from 'vue';
|
||||
import VueI18n from 'vue-i18n'; // i18n for localization
|
||||
|
||||
// Import component Vue plugins, used throughout the app
|
||||
import VTooltip from 'v-tooltip'; // A Vue directive for Popper.js, tooltip component
|
||||
import VModal from 'vue-js-modal'; // Modal component
|
||||
import VSelect from 'vue-select'; // Select dropdown component
|
||||
import VTabs from 'vue-material-tabs'; // Tab view component, used on the config page
|
||||
import Toasted from 'vue-toasted'; // Toast component, used to show confirmation notifications
|
||||
import VTooltip from 'v-tooltip'; // A Vue directive for Popper.js, tooltip component
|
||||
import VModal from 'vue-js-modal'; // Modal component
|
||||
import VSelect from 'vue-select'; // Select dropdown component
|
||||
import VTabs from 'vue-material-tabs'; // Tab view component, used on the config page
|
||||
import Toasted from 'vue-toasted'; // Toast component, used to show confirmation notifications
|
||||
|
||||
// Import base Dashy components and utils
|
||||
import Dashy from '@/App.vue';
|
||||
import router from '@/router';
|
||||
import registerServiceWorker from '@/registerServiceWorker';
|
||||
import clickOutside from '@/utils/ClickOutside';
|
||||
import { toastedOptions, language as defaultLanguage } from '@/utils/defaults';
|
||||
import { messages } from '@/utils/languages';
|
||||
import Dashy from '@/App.vue'; // Main Dashy Vue app
|
||||
import router from '@/router'; // Router, for navigation
|
||||
import serviceWorker from '@/utils/InitServiceWorker'; // Service worker initialization
|
||||
import clickOutside from '@/utils/ClickOutside'; // Directive for closing popups, modals, etc
|
||||
import { messages } from '@/utils/languages'; // Language texts
|
||||
import ErrorReporting from '@/utils/ErrorReporting'; // Error reporting initializer (off)
|
||||
import { toastedOptions, language as defaultLanguage } from '@/utils/defaults'; // Defaults
|
||||
|
||||
// Initialize global Vue components
|
||||
Vue.use(VueI18n);
|
||||
Vue.use(VTooltip);
|
||||
Vue.use(VModal);
|
||||
@@ -25,7 +28,7 @@ Vue.use(Toasted, toastedOptions);
|
||||
Vue.component('v-select', VSelect);
|
||||
Vue.directive('clickOutside', clickOutside);
|
||||
|
||||
Vue.config.productionTip = false;
|
||||
Vue.config.productionTip = false; // Disable annoying console message
|
||||
|
||||
// Setup i18n translations
|
||||
const i18n = new VueI18n({
|
||||
@@ -34,8 +37,11 @@ const i18n = new VueI18n({
|
||||
messages,
|
||||
});
|
||||
|
||||
// Register Service Worker
|
||||
registerServiceWorker();
|
||||
// Checks if service worker not disable, and if so will registers it
|
||||
serviceWorker();
|
||||
|
||||
// Checks if user enabled error reporting, and if so will initialize it
|
||||
ErrorReporting(Vue, router);
|
||||
|
||||
// Render function
|
||||
const render = (awesome) => awesome(Dashy);
|
||||
|
||||
@@ -12,9 +12,14 @@ import { metaTagData } from '@/utils/defaults';
|
||||
|
||||
Vue.use(Router);
|
||||
|
||||
/**
|
||||
* Checks if the current user is either authenticated,
|
||||
* or if authentication is not enabled
|
||||
* @returns true if user logged in, or user management not enabled
|
||||
*/
|
||||
const isAuthenticated = () => {
|
||||
const users = config.appConfig.auth;
|
||||
return (!users || isLoggedIn(users));
|
||||
return (!users || users.length === 0 || isLoggedIn(users));
|
||||
};
|
||||
|
||||
const router = new Router({
|
||||
|
||||
@@ -6,7 +6,11 @@ import { cookieKeys, localStorageKeys } from './defaults';
|
||||
* @param {String} user The username of user
|
||||
* @returns {String} The hashed token
|
||||
*/
|
||||
const generateUserToken = (user) => sha256(user.toString()).toString().toLowerCase();
|
||||
const generateUserToken = (user) => {
|
||||
const strAndUpper = (input) => input.toString().toUpperCase();
|
||||
const sha = sha256(strAndUpper(user.user) + strAndUpper(user.hash));
|
||||
return strAndUpper(sha);
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks if the user is currently authenticated
|
||||
@@ -47,7 +51,7 @@ export const checkCredentials = (username, pass, users) => {
|
||||
response = { correct: false, msg: 'Missing Password' };
|
||||
} else {
|
||||
users.forEach((user) => {
|
||||
if (user.user === username) {
|
||||
if (user.user.toLowerCase() === username.toLowerCase()) {
|
||||
if (user.hash.toLowerCase() === sha256(pass).toString().toLowerCase()) {
|
||||
response = { correct: true, msg: 'Logging in...' };
|
||||
} else {
|
||||
|
||||
@@ -23,7 +23,10 @@ export default class ConfigAccumulator {
|
||||
|
||||
/* App Config */
|
||||
appConfig() {
|
||||
const appConfigFile = this.conf.appConfig || {};
|
||||
let appConfigFile = {};
|
||||
if (this.conf) {
|
||||
appConfigFile = this.conf.appConfig || {};
|
||||
}
|
||||
let usersAppConfig = defaultAppConfig;
|
||||
if (localStorage[localStorageKeys.APP_CONFIG]) {
|
||||
usersAppConfig = JSON.parse(localStorage[localStorageKeys.APP_CONFIG]);
|
||||
@@ -48,11 +51,16 @@ export default class ConfigAccumulator {
|
||||
} catch (e) {
|
||||
localPageInfo = {};
|
||||
}
|
||||
const pi = this.conf.pageInfo || defaults; // The page info object to return
|
||||
pi.title = localPageInfo.title || conf.pageInfo.title || defaults.title;
|
||||
pi.description = localPageInfo.description || conf.pageInfo.description || defaults.description;
|
||||
pi.navLinks = localPageInfo.navLinks || conf.pageInfo.navLinks || defaults.navLinks;
|
||||
pi.footerText = localPageInfo.footerText || conf.pageInfo.footerText || defaults.footerText;
|
||||
let filePageInfo = {};
|
||||
if (this.conf) {
|
||||
filePageInfo = this.conf.pageInfo || {};
|
||||
}
|
||||
const pi = filePageInfo || defaults; // The page info object to return
|
||||
pi.title = localPageInfo.title || filePageInfo.title || defaults.title;
|
||||
pi.logo = localPageInfo.logo || filePageInfo.logo || defaults.logo;
|
||||
pi.description = localPageInfo.description || filePageInfo.description || defaults.description;
|
||||
pi.navLinks = localPageInfo.navLinks || filePageInfo.navLinks || defaults.navLinks;
|
||||
pi.footerText = localPageInfo.footerText || filePageInfo.footerText || defaults.footerText;
|
||||
return pi;
|
||||
}
|
||||
|
||||
@@ -69,7 +77,9 @@ export default class ConfigAccumulator {
|
||||
}
|
||||
}
|
||||
// If the function hasn't yet returned, then return the config file sections
|
||||
return this.conf.sections;
|
||||
let sectionsFile = [];
|
||||
if (this.conf) sectionsFile = this.conf.sections || [];
|
||||
return sectionsFile;
|
||||
}
|
||||
|
||||
/* Complete config */
|
||||
|
||||
@@ -39,6 +39,15 @@
|
||||
},
|
||||
"footerText": {
|
||||
"type": "string"
|
||||
},
|
||||
"logo": {
|
||||
"type": "string",
|
||||
"description": "Path to an optional image asset, to be displayed in the header",
|
||||
"pattern": "^(http|\/)",
|
||||
"examples": [
|
||||
"/web-icons/dashy-logo.png",
|
||||
"https://i.ibb.co/yhbt6CY/dashy.png"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -244,6 +253,16 @@
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "If set to true, custom right-click context menu will be disabled"
|
||||
},
|
||||
"disableUpdateChecks": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Prevents Dashy from checking for updates"
|
||||
},
|
||||
"enableErrorReporting": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Enable anonymous crash reports. This helps bugs be found and fixed, in order to make Dashy more stable. Reporting is off by default, and no data will EVER be collected without your explicit and active concent."
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
/* eslint-disable no-console */
|
||||
/* Script that validates the conf.yml file against Dashy's schema, and outputs any issues */
|
||||
const Ajv = require('ajv');
|
||||
const yaml = require('js-yaml');
|
||||
const fs = require('fs');
|
||||
|
||||
const schema = require('./ConfigSchema.json');
|
||||
|
||||
const validatorOptions = {
|
||||
strict: true,
|
||||
allowUnionTypes: true,
|
||||
allErrors: true,
|
||||
};
|
||||
|
||||
const ajv = new Ajv(validatorOptions);
|
||||
|
||||
/* Message printed when validation was successful */
|
||||
const successMsg = () => '\x1b[1m\x1b[32mNo issues found, your configuration is valid :)\x1b[0m\n';
|
||||
|
||||
/* Formats error message. ready for printing to the console */
|
||||
const errorMsg = (output) => {
|
||||
const warningFont = '\x1b[103m\x1b[34m';
|
||||
const line = `${warningFont}${new Array(42).fill('━').join('')}\x1b[0m`;
|
||||
let msg = `\n${line}\n${warningFont} Warning: ${output.length} `
|
||||
+ `issue${output.length > 1 ? 's' : ''} found in config file \x1b[0m\n${line}\n`;
|
||||
output.forEach((details, index) => {
|
||||
msg += `${'\x1b[36m'}${index + 1}. ${details.keyword} ${details.message} `
|
||||
+ `in ${details.instancePath}\x1b[0m\n`;
|
||||
});
|
||||
return msg;
|
||||
};
|
||||
|
||||
/* Error message printed when the file could not be opened */
|
||||
const bigError = () => {
|
||||
const formatting = '\x1b[30m\x1b[43m';
|
||||
const line = `${formatting}${new Array(38).fill('━').join('')}\x1b[0m\n`;
|
||||
const msg = `${formatting} Error, unable to validate 'conf.yml' \x1b[0m\n`;
|
||||
return `\n${line}${msg}${line}\n`;
|
||||
};
|
||||
|
||||
const setIsValidVariable = (isValid) => {
|
||||
process.env.VUE_APP_CONFIG_VALID = isValid;
|
||||
};
|
||||
|
||||
/* Start the validation */
|
||||
const validate = (config) => {
|
||||
console.log('\nChecking config file against schema...');
|
||||
const valid = ajv.validate(schema, config);
|
||||
if (valid) {
|
||||
setIsValidVariable(true);
|
||||
console.log(successMsg());
|
||||
} else {
|
||||
setIsValidVariable(false);
|
||||
console.log(errorMsg(ajv.errors));
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
const config = yaml.load(fs.readFileSync('./public/conf.yml', 'utf8'));
|
||||
validate(config);
|
||||
} catch (e) {
|
||||
setIsValidVariable(false);
|
||||
console.log(bigError());
|
||||
console.log('Please ensure that your config file is present, '
|
||||
+ 'has the correct access rights and is parsable. '
|
||||
+ 'If this warning persists, it may be an issue with the '
|
||||
+ 'validator function. Please raise an issue, and include the following stack trace:\n');
|
||||
console.warn('\x1b[33mStack Trace for ConfigValidators.js:\x1b[0m\n', e);
|
||||
console.log('\n\n');
|
||||
}
|
||||
14
src/utils/CoolConsole.js
Normal file
14
src/utils/CoolConsole.js
Normal file
@@ -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"] }] */
|
||||
|
||||
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;
|
||||
|
||||
39
src/utils/ErrorReporting.js
Normal file
39
src/utils/ErrorReporting.js
Normal file
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* NOTE: No data is EVER sent to any external service without your explicit consent.
|
||||
* In the case of error reporting, Sentry will not even be initialized unless
|
||||
* you have purposely set appConfig.enableErrorReporting: true.
|
||||
* It is false by default.
|
||||
* You may want to enable error reporting if you have encountered a bug,
|
||||
* as access to the console errors enable it to be triaged an fixed effectively
|
||||
*/
|
||||
|
||||
/* eslint-disable global-require */
|
||||
|
||||
import ConfigAccumulator from '@/utils/ConfigAccumalator';
|
||||
|
||||
const ErrorTracking = (Vue, router) => {
|
||||
// Fetch users config
|
||||
const appConfig = new ConfigAccumulator().appConfig() || {};
|
||||
// Check if error reporting is enabled. Only proceed if user has turned it on.
|
||||
if (appConfig.enableErrorReporting) {
|
||||
// Import Sentry
|
||||
const Sentry = require('@sentry/vue');
|
||||
const { Integrations } = require('@sentry/tracing');
|
||||
const dsn = 'https://3138ea85f15a4fa883a5b27a4dc8ee28@o937511.ingest.sentry.io/5887934';
|
||||
// Initialize Sentry
|
||||
Sentry.init({
|
||||
Vue,
|
||||
dsn,
|
||||
integrations: [
|
||||
new Integrations.BrowserTracing({
|
||||
routingInstrumentation: Sentry.vueRouterInstrumentation(router),
|
||||
}),
|
||||
],
|
||||
tracesSampleRate: 1.0,
|
||||
});
|
||||
} else {
|
||||
// Error reporting not enabled. Do Nothing.
|
||||
}
|
||||
};
|
||||
|
||||
export default ErrorTracking;
|
||||
@@ -1,8 +1,8 @@
|
||||
/* eslint-disable no-console */
|
||||
|
||||
import { register } from 'register-service-worker';
|
||||
import { sessionStorageKeys } from './utils/defaults';
|
||||
import conf from '../public/conf.yml';
|
||||
import { sessionStorageKeys } from '@/utils/defaults';
|
||||
import conf from '../../public/conf.yml';
|
||||
|
||||
/* Sets a local storage item with the state from the SW lifecycle */
|
||||
const setSwStatus = (swStateToSet) => {
|
||||
@@ -1,5 +1,7 @@
|
||||
// Locales - Import translation files here!
|
||||
import en from '@/assets/locales/en.json';
|
||||
import de from '@/assets/locales/de.json';
|
||||
import nl from '@/assets/locales/nl.json';
|
||||
|
||||
// Language data - Add your country name, locale code and imported file here
|
||||
export const languages = [
|
||||
@@ -9,6 +11,18 @@ export const languages = [
|
||||
locale: en,
|
||||
flag: '🇬🇧',
|
||||
},
|
||||
{
|
||||
name: 'German',
|
||||
code: 'de',
|
||||
locale: de,
|
||||
flag: '🇩🇪',
|
||||
},
|
||||
{
|
||||
name: 'Dutch',
|
||||
code: 'nl',
|
||||
locale: nl,
|
||||
flag: '🇳🇱',
|
||||
},
|
||||
// Including:
|
||||
// name - Human readable name for your language (e.g German)
|
||||
// code - ISO language code (e.g. de)
|
||||
|
||||
@@ -157,7 +157,7 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
availibleThemes.Deafault = '#';
|
||||
availibleThemes.Default = '#';
|
||||
return availibleThemes;
|
||||
},
|
||||
/* Checks if any of the icons are Font Awesome glyphs */
|
||||
|
||||
Reference in New Issue
Block a user