Skip to content

Commit

Permalink
webui: adjust http requests in job module views
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergkemper committed Apr 17, 2023
1 parent 3f362f4 commit c779a09
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion webui/module/Job/view/job/job/actions.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ $this->headTitle($title);
locale: '<?php echo str_replace('_','-', $_SESSION['bareos']['locale']); ?>',
cookie: <?php echo $_SESSION['bareos']['dt_statesave']; ?>,
cookieIdTable: 'job_jobactions',
url: '<?php echo $this->url('job', array('action' => 'getData'), null) . '?data=runjobs'; ?>',
url: '<?php echo $this->url('api/dotjob', array(), array()) . '?type=executable'; ?>',
method: 'get',
dataType: 'json',
pagination : true,
Expand Down
6 changes: 3 additions & 3 deletions webui/module/Job/view/job/job/details.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ $this->headTitle($title);
function attachJobDetailsTable() {
$('#jobdetails').bootstrapTable({
locale: '<?php echo str_replace('_','-', $_SESSION['bareos']['locale']); ?>',
url: '<?php echo $this->url('job', array('action' => 'getData'), null) . '?data=details&jobid='.$this->jobid; ?>',
url: '<?php echo $this->url("api/job", array("id" => $this->jobid), array()); ?>',
method: 'get',
dataType: 'json',
detailView: true,
Expand Down Expand Up @@ -247,7 +247,7 @@ $this->headTitle($title);
locale: '<?php echo str_replace('_','-', $_SESSION['bareos']['locale']); ?>',
cookie: <?php echo $_SESSION['bareos']['dt_statesave']; ?>,
cookieIdTable: 'job_table_job_log',
url: '<?php echo $this->url('job', array('action' => 'getData'), null) . '?data=logs&jobid='.$this->jobid; ?>',
url: '<?php echo $this->url("api/joblog", array("id" => $this->jobid), array()); ?>',
method: 'get',
dataType: 'json',
pagination : true,
Expand Down Expand Up @@ -280,7 +280,7 @@ $this->headTitle($title);
locale: '<?php echo str_replace('_','-', $_SESSION['bareos']['locale']); ?>',
cookie: <?php echo $_SESSION['bareos']['dt_statesave']; ?>,
cookieIdTable: 'job_table_job_media',
url: '<?php echo $this->url('job', array('action' => 'getData'), null) . '?data=jobmedia&jobid='.$this->jobid; ?>',
url: '<?php echo $this->url('api/media', array(), array("query" => array("filter" => "jobid", "jobid" => $this->jobid))); ?>',
method: 'get',
dataType: 'json',
pagination : true,
Expand Down
4 changes: 2 additions & 2 deletions webui/module/Job/view/job/job/index.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ $this->headTitle($title);
function refreshTableData() {
$('#spinner').fadeIn('slow');
$('#jobtable').bootstrapTable('refreshOptions', {
url: '<?php echo $this->url('job', array('action' => 'getData'), null) . '?data=jobs&period='; ?>' + displayRange,
url: '<?php echo $this->url('api/job', array(), array()) . '?period='; ?>' + displayRange,
});
$('.bootstrap-table-filter-control-jobid').val(jobid);
$('.bootstrap-table-filter-control-name').val(jobname);
Expand Down Expand Up @@ -326,7 +326,7 @@ $this->headTitle($title);
locale: '<?php echo str_replace('_','-', $_SESSION['bareos']['locale']); ?>',
cookie: <?php echo $_SESSION['bareos']['dt_statesave']; ?>,
cookieIdTable: 'dashboard_table_jobs_last_status',
url: '<?php echo $this->url('job', array('action' => 'getData'), null) . '?data=jobs&period='; ?>' + displayRange,
url: '<?php echo $this->url("api/job", array(), array()) . "?period="; ?>' + displayRange,
method: 'get',
dataType: 'json',
pagination : true,
Expand Down
7 changes: 4 additions & 3 deletions webui/module/Job/view/job/job/rerun.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ $this->headTitle($title);
function refreshTableData() {
$('#spinner').fadeIn('slow');
$('#jobtable').bootstrapTable('refreshOptions', {
url: '<?php echo $this->url('job', array('action' => 'getData'), null) . '?data=jobs-to-rerun&period='; ?>' + displayRange,
url: '<?php echo $this->url('api/job', array(), array()) . '?filter=rerun&period='; ?>' + displayRange,
});
$('#spinner').fadeOut('slow');
}
Expand All @@ -236,12 +236,13 @@ $this->headTitle($title);
if (s.length === 0) {
$("#modal-004").modal();
} else {
let url = "<?php echo $this->url('job', array('action' => 'getData'), null) . '?data=job-rerun&jobs=" + s + "'; ?>";
let url = "<?php echo $this->url('api/execute', array(), array()) . '?command=rerun&jobs=" + s + "'; ?>";

$('#dir-messages').empty()

$.ajax({
url: url,
type: 'POST',
dataType: 'json',
timeout: 10000,
success: function(data) {
Expand All @@ -267,7 +268,7 @@ $this->headTitle($title);
locale: '<?php echo str_replace('_','-', $_SESSION['bareos']['locale']); ?>',
cookie: <?php echo $_SESSION['bareos']['dt_statesave']; ?>,
cookieIdTable: 'jobs_rerun',
url: '<?php echo $this->url('job', array('action' => 'getData'), null) . '?data=jobs-to-rerun&period='; ?>' + displayRange,
url: '<?php echo $this->url('api/job', array(), array()) . '?filter=rerun&period='; ?>' + displayRange,
method: 'get',
dataType: 'json',
pagination : false,
Expand Down
4 changes: 2 additions & 2 deletions webui/module/Job/view/job/job/timeline.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ elseif (!$this->acl_alert) : ?>
data: []
}]);

let url = "<?php echo $this->url('job', array('action' => 'getData'), null) . '?data=job-timeline&jobs=" + s + "&period='; ?>" + p;
let url = "<?php echo $this->url('api/timeline', array(), array()) . '?module=job&jobs=" + s + "&period='; ?>" + p;

$.getJSON(url, function(response) {
if (response.length === 0) {
Expand Down Expand Up @@ -284,7 +284,7 @@ elseif (!$this->acl_alert) : ?>
locale: '<?php echo str_replace('_', '-', $_SESSION['bareos']['locale']); ?>',
cookie: <?php echo $_SESSION['bareos']['dt_statesave']; ?>,
cookieIdTable: 'timeline_jobs',
url: '<?php echo $this->url('job', array('action' => 'getData'), null) . '?data=all-job-resources'; ?>',
url: '<?php echo $this->url('api/dotjob', array(), array()); ?>',
method: 'get',
dataType: 'json',
pagination: false,
Expand Down

0 comments on commit c779a09

Please sign in to comment.