🔄 Rebased from master
This commit is contained in:
@@ -7,6 +7,8 @@ import {
|
||||
theme as defaultTheme,
|
||||
language as defaultLanguage,
|
||||
} from '@/utils/defaults';
|
||||
import ErrorHandler from '@/utils/ErrorHandler';
|
||||
import ConfigSchema from '@/utils/ConfigSchema.json';
|
||||
|
||||
/**
|
||||
* Initiates the Accumulator class and generates a complete config object
|
||||
@@ -97,3 +99,17 @@ export const getUsersLanguage = () => {
|
||||
const langObj = languages.find(lang => lang.code === langCode);
|
||||
return langObj;
|
||||
};
|
||||
|
||||
/**
|
||||
* validator for item target attribute
|
||||
* Uses enum values from config schema, and shows warning if invalid
|
||||
* @param {String} target
|
||||
* @returns {Boolean} isValid
|
||||
*/
|
||||
export const targetValidator = (target) => {
|
||||
const acceptedTargets = ConfigSchema.properties.sections.items
|
||||
.properties.items.items.properties.target.enum;
|
||||
const isTargetValid = acceptedTargets.indexOf(target) !== -1;
|
||||
if (!isTargetValid) ErrorHandler(`Unknown target value: ${target}`);
|
||||
return isTargetValid;
|
||||
};
|
||||
|
||||
@@ -75,6 +75,20 @@
|
||||
"default": "default",
|
||||
"description": "Which page to load by default, and on the base page or domain root. You can still switch to different views from within the UI"
|
||||
},
|
||||
"defaultOpeningMethod": {
|
||||
"title": "Default Opening Method",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"newtab",
|
||||
"sametab",
|
||||
"parent",
|
||||
"top",
|
||||
"modal",
|
||||
"workspace"
|
||||
],
|
||||
"default": "newtab",
|
||||
"description": "The default opening method for items. Only used if no item.target is specified"
|
||||
},
|
||||
"statusCheck": {
|
||||
"title": "Enable Status Checks",
|
||||
"type": "boolean",
|
||||
@@ -616,6 +630,8 @@
|
||||
"enum": [
|
||||
"newtab",
|
||||
"sametab",
|
||||
"parent",
|
||||
"top",
|
||||
"modal",
|
||||
"workspace"
|
||||
],
|
||||
|
||||
@@ -142,6 +142,8 @@ module.exports = {
|
||||
metaTagData: [
|
||||
{ name: 'description', content: 'A simple static homepage for you\'re server' },
|
||||
],
|
||||
/* If no 'target' specified, this is the default opening method */
|
||||
openingMethod: 'newtab',
|
||||
/* Default option for Toast messages */
|
||||
toastedOptions: {
|
||||
position: 'bottom-center',
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import en from '@/assets/locales/en.json';
|
||||
import de from '@/assets/locales/de.json';
|
||||
import nl from '@/assets/locales/nl.json';
|
||||
import pl from '@/assets/locales/pl.json';
|
||||
import fr from '@/assets/locales/fr.json';
|
||||
import sl from '@/assets/locales/sl.json';
|
||||
import es from '@/assets/locales/es.json';
|
||||
@@ -12,6 +13,7 @@ import hi from '@/assets/locales/hi.json';
|
||||
import ja from '@/assets/locales/ja.json';
|
||||
import pt from '@/assets/locales/pt.json';
|
||||
import ru from '@/assets/locales/ru.json';
|
||||
import nb from '@/assets/locales/nb.json';
|
||||
import pirate from '@/assets/locales/zz-pirate.json';
|
||||
|
||||
// Language data - Next register your language by adding it to this list
|
||||
@@ -34,6 +36,12 @@ export const languages = [
|
||||
locale: nl,
|
||||
flag: '🇳🇱',
|
||||
},
|
||||
{
|
||||
name: 'polski',
|
||||
code: 'pl',
|
||||
locale: pl,
|
||||
flag: '🇵🇱',
|
||||
},
|
||||
{
|
||||
name: 'Français',
|
||||
code: 'fr',
|
||||
@@ -94,6 +102,12 @@ export const languages = [
|
||||
locale: ru,
|
||||
flag: '🇷🇺',
|
||||
},
|
||||
{ // Norwegian
|
||||
name: 'Norsk',
|
||||
code: 'nb',
|
||||
locale: nb,
|
||||
flag: '🇳🇴',
|
||||
},
|
||||
{ // Joke Language - Pirate
|
||||
name: 'Pirate',
|
||||
code: 'pirate',
|
||||
|
||||
Reference in New Issue
Block a user