fixed permission
This commit is contained in:
parent
c8467208ac
commit
9d1b2eaaf7
@ -16,7 +16,7 @@ $app->on('admin.init', function () use ($app) {
|
|||||||
// Bind admin routes.
|
// Bind admin routes.
|
||||||
$this->bindClass('Drone\\Controller\\Admin', 'drone/deploys');
|
$this->bindClass('Drone\\Controller\\Admin', 'drone/deploys');
|
||||||
|
|
||||||
if ($app->module('cockpit')->hasaccess('drone', 'deploys.view')) {
|
if ($app->module('cockpit')->hasaccess('drone', 'manage.view')) {
|
||||||
// Add to modules menu.
|
// Add to modules menu.
|
||||||
$this('admin')->addMenuItem('modules', [
|
$this('admin')->addMenuItem('modules', [
|
||||||
'label' => 'Drone Deploys',
|
'label' => 'Drone Deploys',
|
||||||
|
@ -26,8 +26,8 @@ if (COCKPIT_ADMIN && !COCKPIT_API_REQUEST) {
|
|||||||
|
|
||||||
$headers = [
|
$headers = [
|
||||||
'Content-Type: application/json',
|
'Content-Type: application/json',
|
||||||
'Accept: application/json',
|
'Accept: application/json',
|
||||||
'Authorization: Bearer ' . $settings['token']
|
'Authorization: Bearer ' . $settings['token']
|
||||||
];
|
];
|
||||||
|
|
||||||
$ch = curl_init($url);
|
$ch = curl_init($url);
|
||||||
@ -57,8 +57,8 @@ if (COCKPIT_ADMIN && !COCKPIT_API_REQUEST) {
|
|||||||
$limit--;
|
$limit--;
|
||||||
if ($limit>0) {
|
if ($limit>0) {
|
||||||
$deploys[] = $deploy;
|
$deploys[] = $deploy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,15 +72,15 @@ if (COCKPIT_ADMIN && !COCKPIT_API_REQUEST) {
|
|||||||
}
|
}
|
||||||
$deploys[$idx]->created_at = date('Y-m-d H:i', $deploy->created);
|
$deploys[$idx]->created_at = date('Y-m-d H:i', $deploy->created);
|
||||||
$deploys[$idx]->updated_at = date('Y-m-d H:i', $deploy->updated);
|
$deploys[$idx]->updated_at = date('Y-m-d H:i', $deploy->updated);
|
||||||
if ($deploy->finished) {
|
if ($deploy->finished) {
|
||||||
$deploys[$idx]->deploy_time = $deploy->finished - $deploy->started;
|
$deploys[$idx]->deploy_time = $deploy->finished - $deploy->started;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'deploys' => $deploys,
|
'deploys' => $deploys,
|
||||||
'building' => $building,
|
'building' => $building,
|
||||||
'build' => $build
|
'build' => $build
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -102,8 +102,8 @@ if (COCKPIT_ADMIN && !COCKPIT_API_REQUEST) {
|
|||||||
|
|
||||||
$headers = [
|
$headers = [
|
||||||
'Content-Type: application/json',
|
'Content-Type: application/json',
|
||||||
'Accept: application/json',
|
'Accept: application/json',
|
||||||
'Authorization: Bearer ' . $settings['token']
|
'Authorization: Bearer ' . $settings['token']
|
||||||
];
|
];
|
||||||
|
|
||||||
$ch = curl_init($url);
|
$ch = curl_init($url);
|
||||||
|
@ -130,14 +130,14 @@
|
|||||||
} else {
|
} else {
|
||||||
App.ui.notify("unknown error", "danger");
|
App.ui.notify("unknown error", "danger");
|
||||||
}
|
}
|
||||||
if (data) {
|
if (data) {
|
||||||
$this.modal.show();
|
$this.modal.show();
|
||||||
editor = $this.refs.codemirror.editor;
|
editor = $this.refs.codemirror.editor;
|
||||||
editor.setValue(JSON.stringify(data, null, 2), true);
|
editor.setValue(JSON.stringify(data, null, 2), true);
|
||||||
editor.setOption("readOnly", true);
|
editor.setOption("readOnly", true);
|
||||||
editor.setSize($this.modal.dialog[0].clientWidth - 50, $this.modal.dialog[0].clientHeight - 70);
|
editor.setSize($this.modal.dialog[0].clientWidth - 50, $this.modal.dialog[0].clientHeight - 70);
|
||||||
editor.refresh();
|
editor.refresh();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
App.ui.notify(App.i18n.get("A new deploy was requested."), "success");
|
App.ui.notify(App.i18n.get("A new deploy was requested."), "success");
|
||||||
|
Loading…
Reference in New Issue
Block a user