Add "After latest" button in the build actions form

This commit is contained in:
Martchus 2024-03-13 23:56:49 +01:00
parent c7f2310250
commit 85ccd68f07
2 changed files with 13 additions and 0 deletions

View File

@ -244,6 +244,8 @@
onchange="this.form['start-after-id'].disabled = !this.checked" />
<label for="build-action-start-after">After</label>
<input type="text" name="start-after-id" value="" placeholder="build action ID" disabled="disabled" />
<input type="button" name="start-after-latest" value="After latest"
title="Start after the first action displayed on the current page of the build actions table" />
</fieldset>
</div>
</div>

View File

@ -34,6 +34,17 @@ export function initBuildActionsForm()
handleBuildActionPresetChange();
};
// allow selecting to start after the latest build action
const buildActionsFormElements = buildActionsForm.elements;
buildActionsFormElements['start-after-latest'].onclick = function() {
const condElement = buildActionsFormElements['start-condition'];
const idElement = buildActionsFormElements['start-after-id'];
const id = document.getElementById('build-actions-list')?.getElementsByTagName('table')[0]?.tBodies[0]?.getElementsByTagName('tr')[0]?.dataset.id;
condElement.value = 'after';
idElement.disabled = false;
idElement.value = id || '';
};
queryBuildActions();
handleBuildActionTypeChange();
buildActionsForm.dataset.initialized = true;