From ec2f5623562c59302c888190230d4abc11bfd28b Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Sun, 22 Dec 2019 00:52:42 +0300 Subject: [PATCH] Add JobQueue tab, process Prune setting --- src/store/modules/normalizers.js | 2 + src/views/settings/components/Inputs.vue | 34 +------- .../inputComponents/AutoLinkerInput.vue | 2 +- .../inputComponents/BackendsLoggerInput.vue | 2 +- .../inputComponents/ProxyUrlInput.vue | 2 +- .../components/inputComponents/PruneInput.vue | 82 +++++++++++++++++++ .../inputComponents/SslOptionsInput.vue | 5 -- .../components/inputComponents/index.js | 1 + src/views/settings/index.vue | 11 ++- 9 files changed, 96 insertions(+), 45 deletions(-) create mode 100644 src/views/settings/components/inputComponents/PruneInput.vue diff --git a/src/store/modules/normalizers.js b/src/store/modules/normalizers.js index 059d03a3..81b61df7 100644 --- a/src/store/modules/normalizers.js +++ b/src/store/modules/normalizers.js @@ -26,6 +26,8 @@ export const parseTuples = (tuples, key) => { return { key: name, value: icon[name], id: `f${(~~(Math.random() * 1e8)).toString(16)}` } }) }, []) + } else if (item.tuple[0] === ':prune') { + accum[item.tuple[0]] = item.tuple[1] === ':disabled' ? [item.tuple[1]] : item.tuple[1].tuple } else if (item.tuple[0] === ':proxy_url') { accum[item.tuple[0]] = parseProxyUrl(item.tuple[1]) } else if ((item.tuple[0] === ':sslopts' && item.tuple[1].length === 0) || // should be removed diff --git a/src/views/settings/components/Inputs.vue b/src/views/settings/components/Inputs.vue index 60f98a0f..7db9537d 100644 --- a/src/views/settings/components/Inputs.vue +++ b/src/views/settings/components/Inputs.vue @@ -55,31 +55,6 @@ @input="update($event, settingGroup.group, settingGroup.key, settingParent, setting.key, setting.type, nested)"> -
- - Disabled - Limit-based - Time-based - - - - - - - -
: @@ -112,6 +87,7 @@ +

{{ setting.description }}

@@ -121,7 +97,7 @@ import AceEditor from 'vue2-ace-editor' import 'brace/mode/elixir' import 'default-passive-events' -import { AutoLinkerInput, BackendsLoggerInput, EditableKeywordInput, IconsInput, MascotsInput, ProxyUrlInput, SslOptionsInput } from './inputComponents' +import { AutoLinkerInput, BackendsLoggerInput, EditableKeywordInput, IconsInput, MascotsInput, ProxyUrlInput, PruneInput, SslOptionsInput } from './inputComponents' export default { name: 'Inputs', @@ -133,6 +109,7 @@ export default { IconsInput, MascotsInput, ProxyUrlInput, + PruneInput, SslOptionsInput }, props: { @@ -203,11 +180,6 @@ export default { labelWidth() { return this.isMobile ? '100px' : '240px' }, - prune() { - return this.data[this.setting.key] === ':disabled' - ? ':disabled' - : Object.keys(this.data[this.setting.key])[0] - }, rateLimitAllUsers() { return this.data[this.setting.key] ? Object.entries(this.data[this.setting.key])[0] : [null, null] }, diff --git a/src/views/settings/components/inputComponents/AutoLinkerInput.vue b/src/views/settings/components/inputComponents/AutoLinkerInput.vue index 97f7adf8..756eeb1c 100644 --- a/src/views/settings/components/inputComponents/AutoLinkerInput.vue +++ b/src/views/settings/components/inputComponents/AutoLinkerInput.vue @@ -16,7 +16,7 @@ export default { name: 'AutoLinkerInput', props: { data: { - type: Object || Array, + type: [Object, Array], default: function() { return {} } diff --git a/src/views/settings/components/inputComponents/BackendsLoggerInput.vue b/src/views/settings/components/inputComponents/BackendsLoggerInput.vue index 8508a7cc..da6af188 100644 --- a/src/views/settings/components/inputComponents/BackendsLoggerInput.vue +++ b/src/views/settings/components/inputComponents/BackendsLoggerInput.vue @@ -16,7 +16,7 @@ export default { name: 'BackendsLoggerInput', props: { data: { - type: Object || Array, + type: [Object, Array], default: function() { return {} } diff --git a/src/views/settings/components/inputComponents/ProxyUrlInput.vue b/src/views/settings/components/inputComponents/ProxyUrlInput.vue index e188c45d..7848fe15 100644 --- a/src/views/settings/components/inputComponents/ProxyUrlInput.vue +++ b/src/views/settings/components/inputComponents/ProxyUrlInput.vue @@ -19,7 +19,7 @@ export default { name: 'ProxyUrlInput', props: { data: { - type: Object || Array, + type: [Object, Array], default: function() { return {} } diff --git a/src/views/settings/components/inputComponents/PruneInput.vue b/src/views/settings/components/inputComponents/PruneInput.vue new file mode 100644 index 00000000..f24176bb --- /dev/null +++ b/src/views/settings/components/inputComponents/PruneInput.vue @@ -0,0 +1,82 @@ + + + + + diff --git a/src/views/settings/components/inputComponents/SslOptionsInput.vue b/src/views/settings/components/inputComponents/SslOptionsInput.vue index a613ee9e..b2df2ec7 100644 --- a/src/views/settings/components/inputComponents/SslOptionsInput.vue +++ b/src/views/settings/components/inputComponents/SslOptionsInput.vue @@ -15,13 +15,8 @@