mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 05:45:22 +02:00
feat(host): replace engine view with host view (#2255)
* feat(engine-details): remove old panels * feat(engine-details): add basic engine-details-panel component * feat(engine-details): pass details to the different components * feat(engine-details): replace host-view with host-overview * feat(engine-details): add commaseperated filter * feat(engine-details): add host-view container component * feat(engine-details): add host-details component * feat(engine-details): build host details object * feat(engine-details): format engine version * feat(engine-details): get details for one node * feat(engine-details): pass is-agent from view * feat(engine-details): replace old node view with a new component * feat(engine-details): add swarm-node-details component * feat(engine-details): remove isSwarm binding * feat(engine-details): remove node-details and include in parent * feat(engine-details): add labels-table component * feat(engine-details): add update node service * feat(engine-details): add update label functionality * style(engine-details): remove whitespaces * feat(engine-details): remove old node page * feat(engine-details): pass is agent to host details * feat(host-details): hide missing info * feat(host-details): update node availability * style(host-details): remove obsolete event object * feat(host-details): fix labels not sending * feat(host-details): remove flags for hiding data * feat(host-details): create mock call to server for agent host info * style(host-details): fix spelling mistake in filter's name * feat(host-details): get info from agent * feat(host-details): hide engine labels when empty * feat(node-details): move labels table and save button * feat(host-info): add different urls for refresh * feat(host-details): show disk/devices info for agent * feat(host-view): add loading indicator to devices-panel * feat(host-details): add loading indicator to disks panel * feat(host-details): show devices/disks on standalone agent * refactor(host-details): remove default value * refactor(host-details): remove redundant commaSeperated filter * refactor(host-details): remove unused functions * style(host-details): remove whitespace
This commit is contained in:
parent
275fcf5587
commit
ca08b2fa2a
34 changed files with 737 additions and 528 deletions
|
@ -0,0 +1,23 @@
|
|||
angular.module('portainer.docker').controller('NodeLabelsTableController', [
|
||||
function NodeLabelsTableController() {
|
||||
var ctrl = this;
|
||||
ctrl.removeLabel = removeLabel;
|
||||
ctrl.updateLabel = updateLabel;
|
||||
|
||||
function removeLabel(index) {
|
||||
var label = ctrl.labels.splice(index, 1);
|
||||
if (label !== null) {
|
||||
ctrl.onChangedLabels({ labels: ctrl.labels });
|
||||
}
|
||||
}
|
||||
|
||||
function updateLabel(label) {
|
||||
if (
|
||||
label.value !== label.originalValue ||
|
||||
label.key !== label.originalKey
|
||||
) {
|
||||
ctrl.onChangedLabels({ labels: ctrl.labels });
|
||||
}
|
||||
}
|
||||
}
|
||||
]);
|
|
@ -0,0 +1,35 @@
|
|||
<div ng-if="!$ctrl.labels.length">
|
||||
There are no labels for this node.
|
||||
</div>
|
||||
|
||||
<table class="table" ng-if="$ctrl.labels.length">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Label</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="label in $ctrl.labels">
|
||||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon fit-text-size">Name</span>
|
||||
<input type="text" class="form-control" ng-model="label.key" placeholder="e.g. com.example.foo"
|
||||
ng-change="$ctrl.updateLabel(label)">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon fit-text-size">Value</span>
|
||||
<input type="text" class="form-control" ng-model="label.value" placeholder="e.g. bar"
|
||||
ng-change="$ctrl.updateLabel(label)">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-sm btn-danger" type="button" ng-click="$ctrl.removeLabel($index)">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
|
@ -0,0 +1,9 @@
|
|||
angular.module('portainer.docker').component('nodeLabelsTable', {
|
||||
templateUrl:
|
||||
'app/docker/components/host-view-panels/node-labels-table/node-labels-table.html',
|
||||
controller: 'NodeLabelsTableController',
|
||||
bindings: {
|
||||
labels: '<',
|
||||
onChangedLabels: '&'
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue