mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-25 11:21:02 +00:00
WebUI: agent edit/detail view: change the **HELP** url based on the b… (#4219)
This commit is contained in:
parent
03e9546ac7
commit
ac4136f9c6
1 changed files with 11 additions and 5 deletions
|
@ -21,11 +21,7 @@
|
|||
<TextField :id="id" :model-value="agent.id?.toString()" disabled />
|
||||
</InputField>
|
||||
|
||||
<InputField
|
||||
v-slot="{ id }"
|
||||
:label="$t('admin.settings.agents.backend.backend')"
|
||||
docs-url="docs/next/administration/backends/docker"
|
||||
>
|
||||
<InputField v-slot="{ id }" :label="$t('admin.settings.agents.backend.backend')" :docs-url="backendDocsUrl">
|
||||
<TextField :id="id" v-model="agent.backend" disabled />
|
||||
</InputField>
|
||||
|
||||
|
@ -107,6 +103,16 @@ const agent = computed({
|
|||
set: (value) => emit('update:modelValue', value),
|
||||
});
|
||||
|
||||
const baseDocsUrl = 'https://woodpecker-ci.org/docs/next/administration/backends/';
|
||||
|
||||
const backendDocsUrl = computed(() => {
|
||||
let backendUrlSuffix = agent.value.backend?.toLowerCase();
|
||||
if (backendUrlSuffix === 'custom') {
|
||||
backendUrlSuffix = 'custom-backends';
|
||||
}
|
||||
return `${baseDocsUrl}${backendUrlSuffix === '' ? 'docker' : backendUrlSuffix}`;
|
||||
});
|
||||
|
||||
function updateAgent(newValues: Partial<Agent>) {
|
||||
emit('update:modelValue', { ...agent.value, ...newValues });
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue