diff --git a/src/store/modules/normalizers.js b/src/store/modules/normalizers.js
index 123847aa..8be6220d 100644
--- a/src/store/modules/normalizers.js
+++ b/src/store/modules/normalizers.js
@@ -80,7 +80,12 @@ export const parseTuples = (tuples, key) => {
accum[item.tuple[0]] = item.tuple[1].reduce((acc, mascot) => {
return [...acc, { [mascot.tuple[0]]: { ...mascot.tuple[1], id: `f${(~~(Math.random() * 1e8)).toString(16)}` }}]
}, [])
- } else if (item.tuple[0] === ':groups' || item.tuple[0] === ':replace' || item.tuple[0] === ':retries') {
+ } else if (
+ item.tuple[0] === ':groups' ||
+ item.tuple[0] === ':replace' ||
+ item.tuple[0] === ':retries' ||
+ item.tuple[0] === ':crontab'
+ ) {
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)}` }}]
}, [])
@@ -218,7 +223,12 @@ export const wrapUpdatedSettings = (group, settings, currentState) => {
const wrapValues = (settings, currentState) => {
return Object.keys(settings).map(setting => {
const [type, value] = settings[setting]
- if (type === 'keyword' || type.includes('keyword') || setting === ':replace') {
+ if (
+ type === 'keyword' ||
+ type.includes('keyword') ||
+ type.includes('tuple') && type.includes('list') ||
+ setting === ':replace'
+ ) {
return { 'tuple': [setting, wrapValues(value, currentState)] }
} else if (type === 'atom' && value.length > 0) {
return { 'tuple': [setting, `:${value}`] }
@@ -226,8 +236,8 @@ const wrapValues = (settings, currentState) => {
return typeof value === 'string'
? { 'tuple': [setting, value] }
: { 'tuple': [setting, { 'tuple': value }] }
- } else if (type.includes('tuple') && type.includes('list')) {
- return { 'tuple': [setting, value] }
+ } else if (type === 'reversed_tuple') {
+ return { 'tuple': [value, setting] }
} else if (type === 'map') {
const mapValue = Object.keys(value).reduce((acc, key) => {
acc[key] = setting === ':match_actor' ? value[key] : value[key][1]
diff --git a/src/views/settings/components/Inputs.vue b/src/views/settings/components/Inputs.vue
index 581324d9..d99871b2 100644
--- a/src/views/settings/components/Inputs.vue
+++ b/src/views/settings/components/Inputs.vue
@@ -223,7 +223,11 @@ export default {
}
},
keywordData() {
- return Array.isArray(this.data) ? this.data : []
+ if (this.setting.key === ':crontab') {
+ return this.data[this.setting.key] || []
+ } else {
+ return Array.isArray(this.data) ? this.data : []
+ }
},
rewritePolicyValue() {
return typeof this.data[this.setting.key] === 'string' ? [this.data[this.setting.key]] : this.data[this.setting.key]
@@ -238,9 +242,10 @@ export default {
methods: {
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)
+ (Array.isArray(type) && type.includes('keyword') && type.includes('integer')) ||
+ (Array.isArray(type) && type.includes('keyword') && type.findIndex(el => el.includes('list') && el.includes('string')) !== -1) ||
+ (Array.isArray(type) && type.includes('list') && type.includes('tuple'))
},
getFormattedDescription(desc) {
return marked(desc)
diff --git a/src/views/settings/components/inputComponents/EditableKeywordInput.vue b/src/views/settings/components/inputComponents/EditableKeywordInput.vue
index bc2bb65c..f86f600d 100644
--- a/src/views/settings/components/inputComponents/EditableKeywordInput.vue
+++ b/src/views/settings/components/inputComponents/EditableKeywordInput.vue
@@ -8,6 +8,14 @@