Skip to content

Commit

Permalink
Merge pull request #951 from bareos/dev/fbergkemper/master/s4967
Browse files Browse the repository at this point in the history
webui: introduce confirmation dialog on rerun and cancel job actions
  • Loading branch information
pstorz committed Oct 21, 2021
2 parents c86ebd6 + 3ffa44e commit 0a7e896
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -121,6 +121,7 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:
- Disable autotosectionlabel plugin in documentation and add required labels [PR #942]
- webui: improve log message keyword highlighting [PR #937]
- webui: change retention/expiration column to only show retention on volume tables [PR #943]
- webui: introduce confirmation dialog on rerun and cancel job actions [PR #951]

### Deprecated

Expand Down Expand Up @@ -270,4 +271,5 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:
[PR #942]: https://github.com/bareos/bareos/pull/942
[PR #943]: https://github.com/bareos/bareos/pull/943
[PR #944]: https://github.com/bareos/bareos/pull/944
[PR #951]: https://github.com/bareos/bareos/pull/951
[unreleased]: https://github.com/bareos/bareos/tree/master
2 changes: 2 additions & 0 deletions webui/module/Job/src/Job/Controller/JobController.php
Expand Up @@ -128,6 +128,8 @@ public function indexAction()
);
} else {
$result = $this->getJobModel()->rerunJob($this->bsock, $jobid);
$jobid = rtrim( substr( $result, strrpos($result, "=") + 1 ) );
return $this->redirect()->toRoute('job', array('action' => 'details', 'id' => $jobid));
}
}
catch(Exception $e) {
Expand Down
4 changes: 2 additions & 2 deletions webui/public/js/bootstrap-table-formatter.js
Expand Up @@ -533,9 +533,9 @@ function scheduleActionButtonsFormatter(value, row, index, basePath) {

function jobActionButtonsFormatter(value, row, index, basePath) {
let jobDetailsButton = '<a class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="top" href="' + basePath + '/job/details/' + row.jobid + '" title="' + iJS._("View Job Details") + '" id="btn-0"><span class="glyphicon glyphicon-search"></span></a>';
let jobRerunButton = '<a class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="top" href="' + basePath + '/job/index?action=rerun&jobid=' + row.jobid + '" title="' + iJS._('Rerun') + '" id="btn-1"><span class="glyphicon glyphicon-repeat"></span></a>';
let jobRerunButton = '<a class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="top" href="' + basePath + '/job/index?action=rerun&jobid=' + row.jobid + '" title="' + iJS._('Rerun') + '" id="btn-1" onclick="return confirm(\'Rerun Job ID ' + row.jobid + '?\')"><span class="glyphicon glyphicon-repeat"></span></a>';
let jobRestoreButton = '<a class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="top" href="' + basePath + '/restore/?mergefilesets=1&mergejobs=1&client=' + row.client + '&jobid=' + row.jobid + '" title="' + iJS._("Restore") + '" id="btn-1"><span class="glyphicon glyphicon-import"></span></a>';
let jobCancelButton = '<a class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="top" href="' + basePath + '/job/cancel/' + row.jobid + '" title="' + iJS._("Cancel") + '" id="btn-1"><span class="glyphicon glyphicon-trash"></span></a>';
let jobCancelButton = '<a class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="top" href="' + basePath + '/job/cancel/' + row.jobid + '" title="' + iJS._("Cancel") + '" id="btn-1" onclick="return confirm(\'Cancel Job ID ' + row.jobid + '?\')"><span class="glyphicon glyphicon-remove"></span></a>';

switch(row.jobstatus) {
case 'T':
Expand Down
4 changes: 3 additions & 1 deletion webui/tests/selenium/webui-selenium-test.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# BAREOS - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2018-2020 Bareos GmbH & Co. KG
# Copyright (C) 2018-2021 Bareos GmbH & Co. KG
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -403,6 +403,8 @@ def test_rerun_job(self):
self.wait_and_click(By.XPATH, '//tr[@data-index="0"]/td[1]/a')
# Press on rerun button
self.wait_and_click(By.CSS_SELECTOR, "span.glyphicon.glyphicon-repeat")
# Accept confirmation dialog
self.driver.switch_to.alert.accept()
if self.profile == "readonly":
self.wait_and_click(By.LINK_TEXT, "Back")
else:
Expand Down

0 comments on commit 0a7e896

Please sign in to comment.