fix listsetting & http ssl options

This commit is contained in:
Henry Jameson 2025-12-08 13:50:08 +02:00
commit 5aed9a20b8
4 changed files with 30 additions and 14 deletions

View file

@ -57,7 +57,6 @@ export default {
},
suggestionsSet () {
const suggestions = this.backendDescriptionSuggestions
console.log(suggestions)
if (suggestions) {
return new Set(suggestions)
} else {
@ -68,7 +67,7 @@ export default {
if (this.ignoreSuggestions) return [...this.valueSet.values()]
if (!this.suggestionsSet) return []
return [...this.valueSet.values()].filter((x) => {
return !this.suggestionsSet?.has(x)
return !this.builtinEntriesValueSet.has(x)
})
},
builtinEntries () {
@ -81,8 +80,11 @@ export default {
const builtins = [...this.suggestionsSet.values()]
return builtins.map((option) => ({
label: option,
value: this.valueSet.has(option)
value: option
}))
},
builtinEntriesValueSet () {
return new Set(this.builtinEntries.map(x => x.value))
}
},
methods: {
@ -90,32 +92,38 @@ export default {
optionPresent (option) {
return this.valueSet.has(option)
},
getValue ({ event, index, eventType }) {
getValue ({ event, value, index, eventType }) {
switch (eventType) {
case 'toggle': {
this.newValue = ''
return [...this.visibleState, event]
const newSet = new Set(this.valueSet.values())
if (event) {
newSet.add(value)
} else {
newSet.delete(value)
}
return [...newSet.values()]
}
case 'add': {
if (!this.newValue) return this.visibleState
const res = [...this.visibleState, this.newValue]
if (!this.newValue) return this.valueSet.values()
const res = [...this.valueSet.values(), this.newValue]
this.newValue = ''
return res
}
case 'remove': {
const pre = this.visibleState.slice(0, index)
const post = this.visibleState.slice(index + 1)
const pre = [...this.valueSet.values()].slice(0, index)
const post = [...this.valueSet.values()].slice(index + 1)
return [...pre, ...post]
}
case 'edit': {
const pre = this.visibleState.slice(0, index)
const post = this.visibleState.slice(index + 1)
const pre = [...this.valueSet.values()].slice(0, index)
const post = [...this.valueSet.values()].slice(index + 1)
const string = event.target.value
if (!string) return this.visibleState
if (!string) return [...this.valueSet.values()]
return [...pre, string, ...post]
}

View file

@ -27,7 +27,7 @@
<Checkbox
:disabled="shouldBeDisabled"
:model-value="optionPresent(item.value)"
@update:model-value="e => update({ event, eventType: 'toggle' })"
@update:model-value="event => update({ event, value: item.value, eventType: 'toggle' })"
>
{{ item.label }}
</Checkbox>

View file

@ -255,7 +255,6 @@ export default {
}
},
canHardReset () {
console.log('MP', this.$store.state.adminSettings.modifiedPaths.has)
return this.realSource === 'admin' && this.$store.state.adminSettings.modifiedPaths?.has(this.canonPath.join(' -> '))
},
matchesExpertLevel () {

View file

@ -106,6 +106,15 @@ const adminSettingsStorage = {
set(config, path, convert(c.value))
})
console.log('CONFIG', JSON.parse(JSON.stringify(config)))
// patching http adapter config to be easier to handle
const adapter = config[':pleroma'][':http'][':adapter']
if (Array.isArray(adapter)) {
config[':pleroma'][':http'][':adapter'] = {
[':ssl_options']: {
[':versions']: []
}
}
}
commit('updateAdminSettings', { config, modifiedPaths })
commit('resetAdminDraft')
},