mirror of https://github.com/portainer/portainer
Merge branch 'develop' into feat2240-host-view
commit
fabaae66c2
|
@ -72,6 +72,7 @@ function ($state, ContainerService, ModalService, Notifications, HttpRequestHelp
|
||||||
Notifications.success(successMessage, container.Names[0]);
|
Notifications.success(successMessage, container.Names[0]);
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.catch(function error(err) {
|
||||||
|
errorMessage = errorMessage + ':' + container.Names[0];
|
||||||
Notifications.error('Failure', err, errorMessage);
|
Notifications.error('Failure', err, errorMessage);
|
||||||
})
|
})
|
||||||
.finally(function final() {
|
.finally(function final() {
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
angular.module('portainer.app').controller('EndpointItemController', [
|
||||||
|
function EndpointItemController() {
|
||||||
|
var ctrl = this;
|
||||||
|
|
||||||
|
ctrl.editEndpoint = editEndpoint;
|
||||||
|
|
||||||
|
function editEndpoint(event) {
|
||||||
|
event.stopPropagation();
|
||||||
|
ctrl.onEdit(ctrl.model.Id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]);
|
|
@ -21,8 +21,16 @@
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span class="small">
|
<span>
|
||||||
Group: {{ $ctrl.model.GroupName }}
|
|
||||||
|
<span class="small">
|
||||||
|
Group: {{ $ctrl.model.GroupName }}
|
||||||
|
</span>
|
||||||
|
<button
|
||||||
|
ng-if="$ctrl.isAdmin"
|
||||||
|
class="btn btn-link btn-xs"
|
||||||
|
ng-click="$ctrl.editEndpoint($event)"><i class="fa fa-pencil-alt"></i>
|
||||||
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,9 @@ angular.module('portainer.app').component('endpointItem', {
|
||||||
templateUrl: 'app/portainer/components/endpoint-list/endpoint-item/endpointItem.html',
|
templateUrl: 'app/portainer/components/endpoint-list/endpoint-item/endpointItem.html',
|
||||||
bindings: {
|
bindings: {
|
||||||
model: '<',
|
model: '<',
|
||||||
onSelect: '<'
|
onSelect: '<',
|
||||||
}
|
onEdit: '<',
|
||||||
|
isAdmin:'<'
|
||||||
|
},
|
||||||
|
controller: 'EndpointItemController'
|
||||||
});
|
});
|
||||||
|
|
|
@ -11,6 +11,8 @@ angular.module('portainer.app').component('endpointList', {
|
||||||
endpoints: '<',
|
endpoints: '<',
|
||||||
dashboardAction: '<',
|
dashboardAction: '<',
|
||||||
snapshotAction: '<',
|
snapshotAction: '<',
|
||||||
showSnapshotAction: '<'
|
showSnapshotAction: '<',
|
||||||
|
editAction: '<',
|
||||||
|
isAdmin:'<'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
ng-repeat="endpoint in $ctrl.endpoints | filter:$ctrl.state.textFilter"
|
ng-repeat="endpoint in $ctrl.endpoints | filter:$ctrl.state.textFilter"
|
||||||
model="endpoint"
|
model="endpoint"
|
||||||
on-select="$ctrl.dashboardAction"
|
on-select="$ctrl.dashboardAction"
|
||||||
|
on-edit="$ctrl.editAction"
|
||||||
|
is-admin="$ctrl.isAdmin"
|
||||||
></endpoint-item>
|
></endpoint-item>
|
||||||
<div ng-if="!$ctrl.endpoints" class="text-center text-muted">
|
<div ng-if="!$ctrl.endpoints" class="text-center text-muted">
|
||||||
Loading...
|
Loading...
|
||||||
|
|
|
@ -25,7 +25,7 @@ function TemplateCreateRequest(model) {
|
||||||
this.Image = model.Image;
|
this.Image = model.Image;
|
||||||
this.Registry = model.Registry.URL;
|
this.Registry = model.Registry.URL;
|
||||||
this.Command = model.Command;
|
this.Command = model.Command;
|
||||||
this.Network = model.Network;
|
this.Network = model.Network && model.Network.Name;
|
||||||
this.Privileged = model.Privileged;
|
this.Privileged = model.Privileged;
|
||||||
this.Interactive = model.Interactive;
|
this.Interactive = model.Interactive;
|
||||||
this.RestartPolicy = model.RestartPolicy;
|
this.RestartPolicy = model.RestartPolicy;
|
||||||
|
|
|
@ -44,6 +44,8 @@
|
||||||
dashboard-action="goToDashboard"
|
dashboard-action="goToDashboard"
|
||||||
show-snapshot-action="!applicationState.application.authentication || isAdmin"
|
show-snapshot-action="!applicationState.application.authentication || isAdmin"
|
||||||
snapshot-action="triggerSnapshot"
|
snapshot-action="triggerSnapshot"
|
||||||
|
edit-action="goToEdit"
|
||||||
|
is-admin="isAdmin"
|
||||||
></endpoint-list>
|
></endpoint-list>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -62,6 +62,12 @@ function ($q, $scope, $state, Authentication, EndpointService, EndpointHelper, G
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$scope.goToEdit = goToEdit;
|
||||||
|
|
||||||
|
function goToEdit(id) {
|
||||||
|
$state.go('portainer.endpoints.endpoint', { id: id });
|
||||||
|
}
|
||||||
|
|
||||||
function initView() {
|
function initView() {
|
||||||
$scope.isAdmin = Authentication.getUserDetails().role === 1;
|
$scope.isAdmin = Authentication.getUserDetails().role === 1;
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,12 @@ function ($q, $scope, $state, $transition$, TemplateService, TemplateHelper, Net
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.then(function success(data) {
|
.then(function success(data) {
|
||||||
|
var template = data.template;
|
||||||
|
if (template.Network) {
|
||||||
|
template.Network = _.find(data.networks, function(o) { return o.Name === template.Network; });
|
||||||
|
} else {
|
||||||
|
template.Network = _.find(data.networks, function(o) { return o.Name === 'bridge'; });
|
||||||
|
}
|
||||||
$scope.categories = TemplateHelper.getUniqueCategories(data.templates);
|
$scope.categories = TemplateHelper.getUniqueCategories(data.templates);
|
||||||
$scope.template = data.template;
|
$scope.template = data.template;
|
||||||
$scope.networks = data.networks;
|
$scope.networks = data.networks;
|
||||||
|
|
Loading…
Reference in New Issue