diff --git a/src/store/modules/normalizers.js b/src/store/modules/normalizers.js index 81c57c89..a41c4ff5 100644 --- a/src/store/modules/normalizers.js +++ b/src/store/modules/normalizers.js @@ -27,9 +27,7 @@ export const parseTuples = (tuples, key) => { ? accum[item.tuple[0]] = parseNonAtomObject(item.tuple[1]) : accum[item.tuple[0]] = parseObject(item.tuple[1]) } else { - key === 'mrf_user_allowlist' - ? accum[item.tuple[0]] = item.tuple[1] - : accum[item.tuple[0]] = item.tuple[1] + accum[item.tuple[0]] = item.tuple[1] } return accum }, {}) @@ -79,10 +77,13 @@ export const wrapUpdatedSettings = (group, settings) => { const wrapValues = settings => { return Object.keys(settings).map(setting => { const [type, value] = settings[setting] - if (type === 'keyword') { + if (type === 'keyword' || type.includes('keyword')) { return { 'tuple': [setting, wrapValues(value)] } } else if (type === 'atom') { return { 'tuple': [setting, `:${value}`] } + } else if (setting === ':ip') { + const ip = value.split('.').map(s => parseInt(s, 10)) + return { 'tuple': [setting, { 'tuple': ip }] } } else { return { 'tuple': [setting, value] } } diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index 0c42d807..6c372aed 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -24,6 +24,9 @@ const settings = { loading: true }, mutations: { + CLEAR_UPDATED_SETTINGS: (state) => { + state.updatedSettings = {} + }, REWRITE_CONFIG: (state, { tab, data }) => { state.settings[tab] = data }, @@ -77,6 +80,7 @@ const settings = { }, []) const response = await updateSettings(configs, getters.authHost, getters.token) commit('SET_SETTINGS', response.data.configs) + commit('CLEAR_UPDATED_SETTINGS') }, UpdateSettings({ commit }, { group, key, input, value, type }) { key diff --git a/src/views/settings/components/Inputs.vue b/src/views/settings/components/Inputs.vue index 83ca7345..8ec62cab 100644 --- a/src/views/settings/components/Inputs.vue +++ b/src/views/settings/components/Inputs.vue @@ -56,10 +56,10 @@ lang="elixir" theme="chrome"/> + v-if="setting.key === ':ip'" + :value="inputValue" + placeholder="xxx.xxx.xxx.xx" + @input="update($event, settingGroup.group, settingGroup.key, settingParent, setting.key, setting.type, nested)"/>