Skip to content

Commit

Permalink
WebUI: agent edit/detail view: change the **HELP** url based on the b… (
Browse files Browse the repository at this point in the history
  • Loading branch information
tori-27 authored Oct 11, 2024
1 parent 03e9546 commit ac4136f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions web/src/components/agent/AgentForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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 });
}
Expand Down

0 comments on commit ac4136f

Please sign in to comment.