mirror of
https://github.com/portainer/portainer.git
synced 2025-07-25 08:19:40 +02:00
feat(agent): add agent support (#1828)
This commit is contained in:
parent
77a85bd385
commit
2327d696e0
116 changed files with 1900 additions and 689 deletions
7
app/agent/components/node-selector/node-selector.js
Normal file
7
app/agent/components/node-selector/node-selector.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
angular.module('portainer.agent').component('nodeSelector', {
|
||||
templateUrl: 'app/agent/components/node-selector/nodeSelector.html',
|
||||
controller: 'NodeSelectorController',
|
||||
bindings: {
|
||||
model: '='
|
||||
}
|
||||
});
|
8
app/agent/components/node-selector/nodeSelector.html
Normal file
8
app/agent/components/node-selector/nodeSelector.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
<div class="form-group">
|
||||
<label for="target_node" class="col-sm-1 control-label text-left">Node</label>
|
||||
<div class="col-sm-11">
|
||||
<select class="form-control"
|
||||
ng-model="$ctrl.model" ng-options="agent.NodeName as agent.NodeName for agent in $ctrl.agents"
|
||||
></select>
|
||||
</div>
|
||||
</div>
|
18
app/agent/components/node-selector/nodeSelectorController.js
Normal file
18
app/agent/components/node-selector/nodeSelectorController.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
angular.module('portainer.agent')
|
||||
.controller('NodeSelectorController', ['AgentService', 'Notifications', function (AgentService, Notifications) {
|
||||
var ctrl = this;
|
||||
|
||||
this.$onInit = function() {
|
||||
AgentService.agents()
|
||||
.then(function success(data) {
|
||||
ctrl.agents = data;
|
||||
if (!ctrl.model) {
|
||||
ctrl.model = data[0].NodeName;
|
||||
}
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to load agents');
|
||||
});
|
||||
};
|
||||
|
||||
}]);
|
Loading…
Add table
Add a link
Reference in a new issue