part of job queues tab done

This commit is contained in:
Henry Jameson 2025-12-03 23:05:46 +02:00
commit cdbf3f42b8
11 changed files with 232 additions and 9 deletions

View file

@ -0,0 +1,34 @@
import BooleanSetting from '../helpers/boolean_setting.vue'
import ChoiceSetting from '../helpers/choice_setting.vue'
import IntegerSetting from '../helpers/integer_setting.vue'
import StringSetting from '../helpers/string_setting.vue'
import TupleSetting from '../helpers/tuple_setting.vue'
import GroupSetting from '../helpers/group_setting.vue'
import AttachmentSetting from '../helpers/attachment_setting.vue'
import ListSetting from '../helpers/list_setting.vue'
import SharedComputedObject from '../helpers/shared_computed_object.js'
const JobQueuesTab = {
provide () {
return {
defaultDraftMode: true,
defaultSource: 'admin'
}
},
components: {
BooleanSetting,
ChoiceSetting,
IntegerSetting,
StringSetting,
TupleSetting,
AttachmentSetting,
GroupSetting,
ListSetting
},
computed: {
...SharedComputedObject()
}
}
export default JobQueuesTab

View file

@ -0,0 +1,78 @@
<template>
<div :label="$t('admin_dash.tabs.job_queues')">
<div class="setting-item">
<h3>{{ $t('admin_dash.job_queues.Oban') }}</h3>
<ul class="setting-list">
<li>
<ChoiceSetting path=":pleroma.Oban.:log" />
<h4>{{ $t('admin_dash.job_queues.queues') }}</h4>
<ul class="setting-list">
<li>
<IntegerSetting
suggestions="50"
path=":pleroma.Oban.:queues.:federator_incoming"
/>
</li>
<li>
<IntegerSetting
suggestions="50"
path=":pleroma.Oban.:queues.:federator_outgoing"
/>
</li>
<li>
<IntegerSetting
suggestions="5"
path=":pleroma.Oban.:queues.:attachments_cleanup"
/>
</li>
<li>
<IntegerSetting
suggestions="10"
path=":pleroma.Oban.:queues.:mailer"
/>
</li>
<li>
<IntegerSetting
suggestions="10"
path=":pleroma.Oban.:queues.:activity_expiration"
/>
</li>
<li>
<IntegerSetting
suggestions="10"
path=":pleroma.Oban.:queues.:scheduled_activities"
/>
</li>
<li>
<IntegerSetting
suggestions="20"
path=":pleroma.Oban.:queues.:transmogrifier"
/>
</li>
<li>
<IntegerSetting
suggestions="50"
path=":pleroma.Oban.:queues.:web_push"
/>
</li>
<!-- CONFIRM what is this queue -->
<li>
<IntegerSetting
path=":pleroma.Oban.:queues.:slow"
/>
</li>
<!-- CONFIRM what is this queue -->
<li>
<IntegerSetting
path=":pleroma.Oban.:queues.:background"
/>
</li>
</ul>
<GroupSetting path=":pleroma.Oban.queues" />
</li>
</ul>
</div>
</div>
</template>
<script src="./job_queues_tab.js"></script>

View file

@ -74,7 +74,7 @@
/> />
</li> </li>
</ul> </ul>
<!-- TODO confirm with backend on how filters work --> <!-- CONFIRM how filters work -->
<h3>{{ $t('admin_dash.uploads.filenames') }}</h3> <h3>{{ $t('admin_dash.uploads.filenames') }}</h3>
<ul class="setting-list"> <ul class="setting-list">
<li> <li>

View file

@ -44,7 +44,7 @@ export default {
extraEntries () { extraEntries () {
if (this.ignoreSuggestions) return [...this.valueSet.values()] if (this.ignoreSuggestions) return [...this.valueSet.values()]
return [...this.valueSet.values()].filter((x) => { return [...this.valueSet.values()].filter((x) => {
return !this.suggestions.has(x) return !this.suggestions?.has(x)
}) })
}, },
builtinEntries () { builtinEntries () {

View file

@ -24,6 +24,7 @@
type="number" type="number"
:step="step || 1" :step="step || 1"
:disabled="shouldBeDisabled" :disabled="shouldBeDisabled"
:placeholder="backendDescriptionSuggestions"
:min="min || 0" :min="min || 0"
:value="realDraftMode ? draft :state" :value="realDraftMode ? draft :state"
@change="update" @change="update"

View file

@ -18,6 +18,10 @@ export default {
type: [String, Array], type: [String, Array],
required: false required: false
}, },
suggestions: {
type: [String, Array],
required: false
},
subgroup: { subgroup: {
type: String, type: String,
required: false required: false
@ -53,6 +57,9 @@ export default {
swapDescriptionAndLabel: { swapDescriptionAndLabel: {
type: Boolean type: Boolean
}, },
backendDescriptionPath: {
type: [String, Array]
},
overrideBackendDescription: { overrideBackendDescription: {
type: Boolean type: Boolean
}, },
@ -158,7 +165,7 @@ export default {
} }
}, },
backendDescriptionSuggestions () { backendDescriptionSuggestions () {
return this.backendDescription?.suggestions return this.backendDescription?.suggestions || this.suggestions
}, },
shouldBeDisabled () { shouldBeDisabled () {
if (this.path == null) { if (this.path == null) {
@ -228,6 +235,7 @@ export default {
}, },
descriptionPath () { descriptionPath () {
if (this.path == null) return null if (this.path == null) return null
if (this.backendDescriptionPath) return this.backendDescriptionPath
const path = Array.isArray(this.path) ? this.path : this.path.split('.') const path = Array.isArray(this.path) ? this.path : this.path.split('.')
if (this.subgroup) { if (this.subgroup) {
return [ return [

View 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]
}
}
}
}

View 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>

View file

@ -10,6 +10,7 @@ import UploadsTab from './admin_tabs/uploads_tab.vue'
import MailerTab from './admin_tabs/mailer_tab.vue' import MailerTab from './admin_tabs/mailer_tab.vue'
import MonitoringTab from './admin_tabs/monitoring_tab.vue' import MonitoringTab from './admin_tabs/monitoring_tab.vue'
import RegistrationsTab from './admin_tabs/registrations_tab.vue' import RegistrationsTab from './admin_tabs/registrations_tab.vue'
import JobQueuesTab from './admin_tabs/job_queues_tab.vue'
import { useInterfaceStore } from 'src/stores/interface' import { useInterfaceStore } from 'src/stores/interface'
import { library } from '@fortawesome/fontawesome-svg-core' import { library } from '@fortawesome/fontawesome-svg-core'
@ -22,6 +23,7 @@ import {
faEnvelope, faEnvelope,
faChartLine, faChartLine,
faDoorOpen, faDoorOpen,
faGears,
faUpload faUpload
} from '@fortawesome/free-solid-svg-icons' } from '@fortawesome/free-solid-svg-icons'
@ -34,6 +36,7 @@ library.add(
faEnvelope, faEnvelope,
faChartLine, faChartLine,
faDoorOpen, faDoorOpen,
faGears,
faUpload faUpload
) )
@ -42,15 +45,16 @@ const SettingsModalAdminContent = {
VerticalTabSwitcher, VerticalTabSwitcher,
InstanceTab, InstanceTab,
LimitsTab, RegistrationsTab,
FrontendsTab,
MediaProxyTab,
MailerTab,
EmojiTab, EmojiTab,
FrontendsTab,
LimitsTab,
MailerTab,
UploadsTab, UploadsTab,
MediaProxyTab,
LinksTab, LinksTab,
JobQueuesTab,
MonitoringTab, MonitoringTab,
RegistrationsTab
}, },
computed: { computed: {
user () { user () {

View file

@ -114,6 +114,14 @@
<LinksTab /> <LinksTab />
</div> </div>
<div
:label="$t('admin_dash.tabs.job_queues')"
icon="gears"
data-tab-name="job_queues"
>
<JobQueuesTab />
</div>
<div <div
:label="$t('admin_dash.tabs.monitoring')" :label="$t('admin_dash.tabs.monitoring')"
icon="chart-line" icon="chart-line"

View file

@ -1158,7 +1158,12 @@
"uploads": "Uploads", "uploads": "Uploads",
"monitoring": "Monitoring", "monitoring": "Monitoring",
"registrations": "Registrations", "registrations": "Registrations",
"links": "Links" "links": "Links",
"job_queues": "Job Queues"
},
"job_queues": {
"Oban": "Oban queues",
"queues": "Queues"
}, },
"nodb": { "nodb": {
"heading": "Database config is disabled", "heading": "Database config is disabled",
@ -1305,6 +1310,18 @@
}, },
"temp_overrides": { "temp_overrides": {
":pleroma": { ":pleroma": {
"Oban": {
":queues": {
":scheduled_activites": {
"label": "Scheduled activities",
"description": "Scheduled activites queue"
},
":slow": {
"label": "Slow",
"description": "idk"
}
}
},
"Pleroma_DOT_Formatter": { "Pleroma_DOT_Formatter": {
":attribute_toggle": { ":attribute_toggle": {
"label": "Set {attr} attribute" "label": "Set {attr} attribute"