diff --git a/src/store/modules/normalizers.js b/src/store/modules/normalizers.js
index 43a56a06..9a097ffd 100644
--- a/src/store/modules/normalizers.js
+++ b/src/store/modules/normalizers.js
@@ -18,6 +18,12 @@ export const parseTuples = (tuples, key) => {
accum[item.tuple[0]] = item.tuple[1].reduce((acc, group) => {
return [...acc, { [group.tuple[0]]: { value: group.tuple[1], id: `f${(~~(Math.random() * 1e8)).toString(16)}` }}]
}, [])
+ } else if (item.tuple[0] === ':icons') {
+ accum[item.tuple[0]] = item.tuple[1].map(icon => {
+ return Object.keys(icon).map(name => {
+ return { key: name, value: icon[name], id: `f${(~~(Math.random() * 1e8)).toString(16)}` }
+ })
+ }, [])
} else if ((item.tuple[0] === ':sslopts' && item.tuple[1].length === 0) || // should be removed
(item.tuple[0] === ':tlsopts' && item.tuple[1].length === 0)) {
accum[item.tuple[0]] = {}
diff --git a/src/views/settings/components/Inputs.vue b/src/views/settings/components/Inputs.vue
index 3afdf51d..91686720 100644
--- a/src/views/settings/components/Inputs.vue
+++ b/src/views/settings/components/Inputs.vue
@@ -116,24 +116,8 @@
{{ setting.description }}
@@ -142,7 +126,7 @@ import AceEditor from 'vue2-ace-editor' import 'brace/mode/elixir' import 'default-passive-events' -import { AutoLinkerInput, EditableKeywordInput, MascotsInput } from './inputComponents' +import { AutoLinkerInput, EditableKeywordInput, IconsInput, MascotsInput } from './inputComponents' export default { name: 'Inputs', @@ -150,6 +134,7 @@ export default { editor: AceEditor, AutoLinkerInput, EditableKeywordInput, + IconsInput, MascotsInput }, props: { @@ -201,17 +186,13 @@ export default { this.processNestedData([value], this.settingGroup.group, this.settingGroup.key, this.settingParent.key, this.settingParent.type, this.setting.key, this.setting.type) } }, - iconsValue() { - return this.data[':icons'] - ? this.data[':icons'].map(icon => Object.keys(icon).map(key => [key, icon[key]])) - : null - }, inputValue() { if ([':esshd', ':cors_plug', ':quack', ':http_signatures'].includes(this.settingGroup.group) && this.data[this.setting.key]) { return this.data[this.setting.key].value } else if ((this.settingGroup.group === ':logger' && this.setting.key === ':backends') || - this.setting.key === 'Pleroma.Web.Auth.Authenticator') { + this.setting.key === 'Pleroma.Web.Auth.Authenticator' || + this.setting.key === ':admin_token') { return this.data.value } else if (this.setting.type === 'atom') { return this.data[this.setting.key] && this.data[this.setting.key][0] === ':' ? this.data[this.setting.key].substr(1) : this.data[this.setting.key] @@ -263,16 +244,12 @@ export default { } }, methods: { - addIconToIcons() {}, - addValueToIcons() {}, - deleteIcondRow(index) {}, editableKeyword(key, type) { return key === ':replace' || (Array.isArray(type) && type.includes('keyword') && type.includes('integer')) || type === 'map' || (Array.isArray(type) && type.includes('keyword') && type.findIndex(el => el.includes('list') && el.includes('string')) !== -1) }, - parseIcons(value, inputType, index) {}, parseRateLimiter(value, input, typeOfInput, typeOfLimit, currentValue) { if (typeOfLimit === 'oneLimit') { const valueToSend = typeOfInput === 'scale' ? { 'tuple': [value, currentValue[1]] } : { 'tuple': [currentValue[0], value] } @@ -309,8 +286,6 @@ export default { this.setting.key === ':args' ) }, - toggleAtomTuple(value, tab, input) { - }, toggleLimits(value, input) { this.updateSetting(value, this.settingGroup.group, 'rate_limit', input) }, diff --git a/src/views/settings/components/inputComponents/IconsInput.vue b/src/views/settings/components/inputComponents/IconsInput.vue new file mode 100644 index 00000000..6f520425 --- /dev/null +++ b/src/views/settings/components/inputComponents/IconsInput.vue @@ -0,0 +1,106 @@ + +