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.
|
||||
$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.
|
||||
$this('admin')->addMenuItem('modules', [
|
||||
'label' => 'Drone Deploys',
|
||||
|
@ -26,8 +26,8 @@ if (COCKPIT_ADMIN && !COCKPIT_API_REQUEST) {
|
||||
|
||||
$headers = [
|
||||
'Content-Type: application/json',
|
||||
'Accept: application/json',
|
||||
'Authorization: Bearer ' . $settings['token']
|
||||
'Accept: application/json',
|
||||
'Authorization: Bearer ' . $settings['token']
|
||||
];
|
||||
|
||||
$ch = curl_init($url);
|
||||
@ -57,8 +57,8 @@ if (COCKPIT_ADMIN && !COCKPIT_API_REQUEST) {
|
||||
$limit--;
|
||||
if ($limit>0) {
|
||||
$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]->updated_at = date('Y-m-d H:i', $deploy->updated);
|
||||
if ($deploy->finished) {
|
||||
$deploys[$idx]->deploy_time = $deploy->finished - $deploy->started;
|
||||
}
|
||||
if ($deploy->finished) {
|
||||
$deploys[$idx]->deploy_time = $deploy->finished - $deploy->started;
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'deploys' => $deploys,
|
||||
'building' => $building,
|
||||
'build' => $build
|
||||
'build' => $build
|
||||
];
|
||||
},
|
||||
|
||||
@ -102,8 +102,8 @@ if (COCKPIT_ADMIN && !COCKPIT_API_REQUEST) {
|
||||
|
||||
$headers = [
|
||||
'Content-Type: application/json',
|
||||
'Accept: application/json',
|
||||
'Authorization: Bearer ' . $settings['token']
|
||||
'Accept: application/json',
|
||||
'Authorization: Bearer ' . $settings['token']
|
||||
];
|
||||
|
||||
$ch = curl_init($url);
|
||||
|
@ -130,14 +130,14 @@
|
||||
} else {
|
||||
App.ui.notify("unknown error", "danger");
|
||||
}
|
||||
if (data) {
|
||||
if (data) {
|
||||
$this.modal.show();
|
||||
editor = $this.refs.codemirror.editor;
|
||||
editor.setValue(JSON.stringify(data, null, 2), true);
|
||||
editor.setOption("readOnly", true);
|
||||
editor.setSize($this.modal.dialog[0].clientWidth - 50, $this.modal.dialog[0].clientHeight - 70);
|
||||
editor.refresh();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
App.ui.notify(App.i18n.get("A new deploy was requested."), "success");
|
||||
|
Loading…
Reference in New Issue
Block a user