Skip to content

Commit 206f307

Browse files
committed
fix: playbook- & inventory-browse select-by-click (#78)
1 parent dacfec5 commit 206f307

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

frontend/src/base/home/Repositories.svelte

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,13 @@
225225
<div>
226226
<b>{t('common.status')}:</b>
227227
<span class={item.status_name == 'Failed' ? 'text-red-600' : 'text-green-600'}>
228-
{item.status_name}
228+
{#if item.status_name == 'Failed'}
229+
{t('jobs.info.failed')}
230+
{:else if item.status_name == 'Finished'}
231+
{t('jobs.info.succeeded')}
232+
{:else}
233+
{t('jobs.info.running')}
234+
{/if}
229235
</span>
230236
</div>
231237
{#if item.log_stdout_url || item.log_stderr_url}

frontend/src/base/home/forms/Job.svelte

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@
156156
})
157157
158158
// autocomplete via api filesystem-browsing (playbook/inventory)
159+
// todo: inventory_file multi-input
159160
interface browseResponse {
160161
dirs: string[],
161162
files: string[],
@@ -340,16 +341,22 @@
340341
}
341342
342343
function fsBrowseSelect(f: 'playbook_file'|'inventory_file', c: string) {
343-
let p = rsplit(form[f].value, '/');
344-
let path = p[0];
345-
let current = p[1];
344+
if (fsBrowseChoices.dirs.includes(c) && !c.endsWith('/')) {
345+
c += '/';
346+
}
347+
348+
if (form[f].value && form[f].value.endsWith('/')) {
349+
form[f].value += c;
350+
fsBrowse(f);
351+
return;
352+
}
346353
347-
if ((!path) || (!current && !fsBrowseChoices.dirs.includes(path))) {
354+
let [path, _] = fsBrowseGetPathCurrent(f);
355+
if (!path) {
348356
form[f].value = c;
349357
} else {
350358
form[f].value = `${path}/${c}`;
351359
}
352-
353360
fsBrowse(f);
354361
}
355362
@@ -958,6 +965,7 @@
958965
<Input id="job_args" bind:value={form.cmd_args.value} bind:color={form.cmd_args.color} />
959966
<Helper class={classModalHelp}>{t('jobs.form.help.cmd_args')}</Helper>
960967
</div>
968+
<!-- todo: allow user to de-select hostkey-file -->
961969
<div class={classModalInput}>
962970
<Label for="job_ssh_hostkey_file" class={classModalLabel}>{t('system.ssh_hostkey')}</Label>
963971
<Select id="job_ssh_hostkey_file" items={formInfos.choices.ssh_hostkey_file}

src/oxl_ansible_webui/aw/config/languages/de.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
'common.success': 'Aktion erfolgreich',
4242
'common.actions': 'Aktionen',
4343
'common.search': 'Suche',
44-
'common.updated_at': 'Geändert um',
44+
'common.updated_at': 'Aktualisiert um',
4545
'common.created_at': 'Erstellt um',
4646
'common.click_to_copy': 'zum Kopieren klicken',
4747
'common.comment': 'Kommentar',

0 commit comments

Comments
 (0)