part of job queues tab done
This commit is contained in:
parent
0a9a3648d6
commit
cdbf3f42b8
11 changed files with 232 additions and 9 deletions
|
|
@ -44,7 +44,7 @@ export default {
|
|||
extraEntries () {
|
||||
if (this.ignoreSuggestions) return [...this.valueSet.values()]
|
||||
return [...this.valueSet.values()].filter((x) => {
|
||||
return !this.suggestions.has(x)
|
||||
return !this.suggestions?.has(x)
|
||||
})
|
||||
},
|
||||
builtinEntries () {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
type="number"
|
||||
:step="step || 1"
|
||||
:disabled="shouldBeDisabled"
|
||||
:placeholder="backendDescriptionSuggestions"
|
||||
:min="min || 0"
|
||||
:value="realDraftMode ? draft :state"
|
||||
@change="update"
|
||||
|
|
|
|||
|
|
@ -18,6 +18,10 @@ export default {
|
|||
type: [String, Array],
|
||||
required: false
|
||||
},
|
||||
suggestions: {
|
||||
type: [String, Array],
|
||||
required: false
|
||||
},
|
||||
subgroup: {
|
||||
type: String,
|
||||
required: false
|
||||
|
|
@ -53,6 +57,9 @@ export default {
|
|||
swapDescriptionAndLabel: {
|
||||
type: Boolean
|
||||
},
|
||||
backendDescriptionPath: {
|
||||
type: [String, Array]
|
||||
},
|
||||
overrideBackendDescription: {
|
||||
type: Boolean
|
||||
},
|
||||
|
|
@ -158,7 +165,7 @@ export default {
|
|||
}
|
||||
},
|
||||
backendDescriptionSuggestions () {
|
||||
return this.backendDescription?.suggestions
|
||||
return this.backendDescription?.suggestions || this.suggestions
|
||||
},
|
||||
shouldBeDisabled () {
|
||||
if (this.path == null) {
|
||||
|
|
@ -228,6 +235,7 @@ export default {
|
|||
},
|
||||
descriptionPath () {
|
||||
if (this.path == null) return null
|
||||
if (this.backendDescriptionPath) return this.backendDescriptionPath
|
||||
const path = Array.isArray(this.path) ? this.path : this.path.split('.')
|
||||
if (this.subgroup) {
|
||||
return [
|
||||
|
|
|
|||
16
src/components/settings_modal/helpers/tuple_setting.js
Normal file
16
src/components/settings_modal/helpers/tuple_setting.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import Setting from './setting.js'
|
||||
|
||||
export default {
|
||||
...Setting,
|
||||
methods: {
|
||||
...Setting.methods,
|
||||
getValue ({ e, side }) {
|
||||
const [a, b] = this.visibleState || []
|
||||
if (side === 0) {
|
||||
return [e.target.value, b]
|
||||
} else {
|
||||
return [a, e.target.value]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
57
src/components/settings_modal/helpers/tuple_setting.vue
Normal file
57
src/components/settings_modal/helpers/tuple_setting.vue
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<template>
|
||||
<label
|
||||
v-if="matchesExpertLevel"
|
||||
class="TupleSetting"
|
||||
>
|
||||
<label
|
||||
v-if="!hideLabel"
|
||||
:for="path"
|
||||
class="setting-label"
|
||||
:class="{ 'faint': shouldBeDisabled }"
|
||||
>
|
||||
<template v-if="backendDescriptionLabel">
|
||||
{{ backendDescriptionLabel + ' ' }}
|
||||
</template>
|
||||
<template v-else-if="source === 'admin'">
|
||||
MISSING LABEL FOR {{ path }}
|
||||
</template>
|
||||
<slot v-else />
|
||||
</label>
|
||||
{{ ' ' }}
|
||||
<input
|
||||
:id="path"
|
||||
class="input string-input"
|
||||
:class="{ disabled: shouldBeDisabled }"
|
||||
:disabled="shouldBeDisabled"
|
||||
:placeholder="backendDescriptionSuggestions?.[0]?.[0]"
|
||||
:value="visibleState?.[0]"
|
||||
@change="e => update({ e, side: 0 })"
|
||||
>
|
||||
{{ ' ' }}
|
||||
<input
|
||||
:id="path"
|
||||
class="input string-input"
|
||||
:class="{ disabled: shouldBeDisabled }"
|
||||
:disabled="shouldBeDisabled"
|
||||
:placeholder="backendDescriptionSuggestions?.[0]?.[1]"
|
||||
:value="visibleState?.[1]"
|
||||
@change="e => update({ e, side: 1 })"
|
||||
>
|
||||
{{ ' ' }}
|
||||
<ModifiedIndicator
|
||||
:changed="isChanged"
|
||||
:onclick="reset"
|
||||
/>
|
||||
<ProfileSettingIndicator :is-profile="isProfileSetting" />
|
||||
<DraftButtons v-if="!hideDraftButtons" />
|
||||
<p
|
||||
v-if="backendDescriptionDescription"
|
||||
class="setting-description"
|
||||
:class="{ 'faint': shouldBeDisabled }"
|
||||
>
|
||||
{{ backendDescriptionDescription + ' ' }}
|
||||
</p>
|
||||
</label>
|
||||
</template>
|
||||
|
||||
<script src="./tuple_setting.js"></script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue