mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 07:19:41 +02:00
feat(service): rebase and recommit (#6245)
This commit is contained in:
parent
33a29159d2
commit
c30292cedd
2 changed files with 40 additions and 8 deletions
|
@ -4,6 +4,7 @@
|
||||||
<div class="toolBar">
|
<div class="toolBar">
|
||||||
<div class="toolBarTitle"> <i class="fa" ng-class="$ctrl.titleIcon" aria-hidden="true" style="margin-right: 2px;"></i> {{ $ctrl.titleText }} </div>
|
<div class="toolBarTitle"> <i class="fa" ng-class="$ctrl.titleIcon" aria-hidden="true" style="margin-right: 2px;"></i> {{ $ctrl.titleText }} </div>
|
||||||
<div class="settings">
|
<div class="settings">
|
||||||
|
<datatable-columns-visibility columns="$ctrl.columnVisibility.columns" on-change="($ctrl.onColumnVisibilityChange)"></datatable-columns-visibility>
|
||||||
<span class="setting" ng-class="{ 'setting-active': $ctrl.settings.open }" uib-dropdown dropdown-append-to-body auto-close="disabled" is-open="$ctrl.settings.open">
|
<span class="setting" ng-class="{ 'setting-active': $ctrl.settings.open }" uib-dropdown dropdown-append-to-body auto-close="disabled" is-open="$ctrl.settings.open">
|
||||||
<span uib-dropdown-toggle><i class="fa fa-cog" aria-hidden="true"></i> Settings</span>
|
<span uib-dropdown-toggle><i class="fa fa-cog" aria-hidden="true"></i> Settings</span>
|
||||||
<div class="dropdown-menu dropdown-menu-right" uib-dropdown-menu>
|
<div class="dropdown-menu dropdown-menu-right" uib-dropdown-menu>
|
||||||
|
@ -88,7 +89,7 @@
|
||||||
<i class="fa fa-sort-alpha-up" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'StackName' && $ctrl.state.reverseOrder"></i>
|
<i class="fa fa-sort-alpha-up" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'StackName' && $ctrl.state.reverseOrder"></i>
|
||||||
</a>
|
</a>
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th ng-show="$ctrl.columnVisibility.columns.image.display">
|
||||||
<a ng-click="$ctrl.changeOrderBy('Image')">
|
<a ng-click="$ctrl.changeOrderBy('Image')">
|
||||||
Image
|
Image
|
||||||
<i class="fa fa-sort-alpha-down" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'Image' && !$ctrl.state.reverseOrder"></i>
|
<i class="fa fa-sort-alpha-down" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'Image' && !$ctrl.state.reverseOrder"></i>
|
||||||
|
@ -102,21 +103,21 @@
|
||||||
<i class="fa fa-sort-alpha-up" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'Mode' && $ctrl.state.reverseOrder"></i>
|
<i class="fa fa-sort-alpha-up" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'Mode' && $ctrl.state.reverseOrder"></i>
|
||||||
</a>
|
</a>
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th ng-show="$ctrl.columnVisibility.columns.ports.display">
|
||||||
<a ng-click="$ctrl.changeOrderBy('Ports')">
|
<a ng-click="$ctrl.changeOrderBy('Ports')">
|
||||||
Published Ports
|
Published Ports
|
||||||
<i class="fa fa-sort-alpha-down" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'Ports' && !$ctrl.state.reverseOrder"></i>
|
<i class="fa fa-sort-alpha-down" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'Ports' && !$ctrl.state.reverseOrder"></i>
|
||||||
<i class="fa fa-sort-alpha-up" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'Ports' && $ctrl.state.reverseOrder"></i>
|
<i class="fa fa-sort-alpha-up" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'Ports' && $ctrl.state.reverseOrder"></i>
|
||||||
</a>
|
</a>
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th ng-show="$ctrl.columnVisibility.columns.updated.display">
|
||||||
<a ng-click="$ctrl.changeOrderBy('UpdatedAt')">
|
<a ng-click="$ctrl.changeOrderBy('UpdatedAt')">
|
||||||
Last Update
|
Last Update
|
||||||
<i class="fa fa-sort-alpha-down" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'UpdatedAt' && !$ctrl.state.reverseOrder"></i>
|
<i class="fa fa-sort-alpha-down" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'UpdatedAt' && !$ctrl.state.reverseOrder"></i>
|
||||||
<i class="fa fa-sort-alpha-up" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'UpdatedAt' && $ctrl.state.reverseOrder"></i>
|
<i class="fa fa-sort-alpha-up" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'UpdatedAt' && $ctrl.state.reverseOrder"></i>
|
||||||
</a>
|
</a>
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th ng-show="$ctrl.columnVisibility.columns.ownership.display">
|
||||||
<a ng-click="$ctrl.changeOrderBy('ResourceControl.Ownership')">
|
<a ng-click="$ctrl.changeOrderBy('ResourceControl.Ownership')">
|
||||||
Ownership
|
Ownership
|
||||||
<i class="fa fa-sort-alpha-down" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'ResourceControl.Ownership' && !$ctrl.state.reverseOrder"></i>
|
<i class="fa fa-sort-alpha-down" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'ResourceControl.Ownership' && !$ctrl.state.reverseOrder"></i>
|
||||||
|
@ -143,7 +144,7 @@
|
||||||
<a ui-sref="docker.services.service({id: item.Id})" ng-click="$event.stopPropagation()">{{ item.Name }}</a>
|
<a ui-sref="docker.services.service({id: item.Id})" ng-click="$event.stopPropagation()">{{ item.Name }}</a>
|
||||||
</td>
|
</td>
|
||||||
<td ng-if="$ctrl.showStackColumn">{{ item.StackName ? item.StackName : '-' }}</td>
|
<td ng-if="$ctrl.showStackColumn">{{ item.StackName ? item.StackName : '-' }}</td>
|
||||||
<td>{{ item.Image | hideshasum }}</td>
|
<td ng-show="$ctrl.columnVisibility.columns.image.display">{{ item.Image | hideshasum }}</td>
|
||||||
<td ng-controller="ServicesDatatableActionsController as actionCtrl">
|
<td ng-controller="ServicesDatatableActionsController as actionCtrl">
|
||||||
{{ item.Mode }}
|
{{ item.Mode }}
|
||||||
<code>{{ item.Tasks | runningtaskscount }}</code> / <code>{{ item.Mode === 'replicated' ? item.Replicas : ($ctrl.nodes | availablenodecount: item) }}</code>
|
<code>{{ item.Tasks | runningtaskscount }}</code> / <code>{{ item.Mode === 'replicated' ? item.Replicas : ($ctrl.nodes | availablenodecount: item) }}</code>
|
||||||
|
@ -167,7 +168,7 @@
|
||||||
<a class="interactive" ng-click="actionCtrl.scaleAction(item); $event.stopPropagation();"><i class="fa fa-check-square"></i></a>
|
<a class="interactive" ng-click="actionCtrl.scaleAction(item); $event.stopPropagation();"><i class="fa fa-check-square"></i></a>
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td ng-show="$ctrl.columnVisibility.columns.ports.display">
|
||||||
<a
|
<a
|
||||||
ng-if="item.Ports && item.Ports.length > 0 && p.PublishedPort"
|
ng-if="item.Ports && item.Ports.length > 0 && p.PublishedPort"
|
||||||
ng-repeat="p in item.Ports"
|
ng-repeat="p in item.Ports"
|
||||||
|
@ -180,8 +181,8 @@
|
||||||
</a>
|
</a>
|
||||||
<span ng-if="!item.Ports || item.Ports.length === 0">-</span>
|
<span ng-if="!item.Ports || item.Ports.length === 0">-</span>
|
||||||
</td>
|
</td>
|
||||||
<td>{{ item.UpdatedAt | getisodate }}</td>
|
<td ng-show="$ctrl.columnVisibility.columns.updated.display">{{ item.UpdatedAt | getisodate }}</td>
|
||||||
<td>
|
<td ng-show="$ctrl.columnVisibility.columns.ownership.display">
|
||||||
<span>
|
<span>
|
||||||
<i ng-class="item.ResourceControl.Ownership | ownershipicon" aria-hidden="true"></i>
|
<i ng-class="item.ResourceControl.Ownership | ownershipicon" aria-hidden="true"></i>
|
||||||
{{ item.ResourceControl.Ownership ? item.ResourceControl.Ownership : item.ResourceControl.Ownership = $ctrl.RCO.ADMINISTRATORS }}
|
{{ item.ResourceControl.Ownership ? item.ResourceControl.Ownership : item.ResourceControl.Ownership = $ctrl.RCO.ADMINISTRATORS }}
|
||||||
|
|
|
@ -14,6 +14,33 @@ angular.module('portainer.docker').controller('ServicesDatatableController', [
|
||||||
expandedItems: [],
|
expandedItems: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.columnVisibility = {
|
||||||
|
columns: {
|
||||||
|
image: {
|
||||||
|
label: 'Image',
|
||||||
|
display: true,
|
||||||
|
},
|
||||||
|
ownership: {
|
||||||
|
label: 'OwnerShip',
|
||||||
|
display: true,
|
||||||
|
},
|
||||||
|
ports: {
|
||||||
|
label: 'Published Ports',
|
||||||
|
display: true,
|
||||||
|
},
|
||||||
|
updated: {
|
||||||
|
label: 'Last Update',
|
||||||
|
display: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
this.onColumnVisibilityChange = onColumnVisibilityChange.bind(this);
|
||||||
|
function onColumnVisibilityChange(columns) {
|
||||||
|
this.columnVisibility.columns = columns;
|
||||||
|
DatatableService.setColumnVisibilitySettings(this.tableKey, this.columnVisibility);
|
||||||
|
}
|
||||||
|
|
||||||
this.expandAll = function () {
|
this.expandAll = function () {
|
||||||
this.state.expandAll = !this.state.expandAll;
|
this.state.expandAll = !this.state.expandAll;
|
||||||
for (var i = 0; i < this.state.filteredDataSet.length; i++) {
|
for (var i = 0; i < this.state.filteredDataSet.length; i++) {
|
||||||
|
@ -107,6 +134,10 @@ angular.module('portainer.docker').controller('ServicesDatatableController', [
|
||||||
this.settings.open = false;
|
this.settings.open = false;
|
||||||
}
|
}
|
||||||
this.onSettingsRepeaterChange();
|
this.onSettingsRepeaterChange();
|
||||||
|
var storedColumnVisibility = DatatableService.getColumnVisibilitySettings(this.tableKey);
|
||||||
|
if (storedColumnVisibility !== null) {
|
||||||
|
this.columnVisibility = storedColumnVisibility;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue