Merge pull request #1721 from sjcarriere/master
Add a simple hierarchical treatment for box/list view.
This commit is contained in:
commit
f38294d391
14
www/box.ng
14
www/box.ng
@ -18,7 +18,7 @@ limitations under the License.
|
|||||||
{{ groupName }}
|
{{ groupName }}
|
||||||
|
|
||||||
<div ng-if="group.kind != 'grouping'">
|
<div ng-if="group.kind != 'grouping'">
|
||||||
<div ng-if="!display || display=='box'">
|
<div ng-if="!settings.display || settings.display=='box'">
|
||||||
<div class="content k8s-item k8s-inline" ng-repeat="item in group">
|
<div class="content k8s-item k8s-inline" ng-repeat="item in group">
|
||||||
<div class="k8s-title-font k8s-font-regular">
|
<div class="k8s-title-font k8s-font-regular">
|
||||||
<div ng-switch on='item.labels["type"]'>
|
<div ng-switch on='item.labels["type"]'>
|
||||||
@ -30,7 +30,7 @@ limitations under the License.
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div ng-if="display=='list'">
|
<div ng-if="settings.display=='list'">
|
||||||
<table style="width: 90%; padding: 10px">
|
<table style="width: 90%; padding: 10px">
|
||||||
<tr ng-repeat="item in group" ng-class-odd="'k8s-odd'" ng-class-even="'k8s-even'" valign="top">
|
<tr ng-repeat="item in group" ng-class-odd="'k8s-odd'" ng-class-even="'k8s-even'" valign="top">
|
||||||
<td class="k8s-cell">
|
<td class="k8s-cell">
|
||||||
@ -49,14 +49,14 @@ limitations under the License.
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<a ng-click="display='box'">box</a>
|
|
||||||
<a ng-click="display='list'">list</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div ng-if="group.kind == 'grouping'">
|
<div ng-if="group.kind == 'grouping'">
|
||||||
<div ng-repeat="(groupName,group) in group.items" ng-include="'box.ng'">
|
<div ng-repeat="(groupName,group) in group.items" ng-include="'box.ng'">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<a ng-click="settings={display:'box'}">box</a>
|
||||||
|
<a ng-click="settings={display:'list'}">list</a>
|
||||||
|
<a ng-click="controller.resetGroupLayout(this);">reset</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
@ -46,6 +46,10 @@ k8sApp.controller('PodCtrl', function ($scope, $http, $routeParams) {
|
|||||||
|
|
||||||
function GroupController() {}
|
function GroupController() {}
|
||||||
|
|
||||||
|
GroupController.prototype.resetGroupLayout = function(group) {
|
||||||
|
delete group.settings;
|
||||||
|
};
|
||||||
|
|
||||||
GroupController.prototype.handlePath = function(path) {
|
GroupController.prototype.handlePath = function(path) {
|
||||||
var parts = path.split("/")
|
var parts = path.split("/")
|
||||||
// split leaves an empty string at the beginning.
|
// split leaves an empty string at the beginning.
|
||||||
|
Loading…
Reference in New Issue
Block a user