Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
f38294d3
Commit
f38294d3
authored
Oct 10, 2014
by
Brendan Burns
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1721 from sjcarriere/master
Add a simple hierarchical treatment for box/list view.
parents
707ff3c0
7dbf705a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
box.ng
www/box.ng
+7
-8
podcontroller.js
www/podcontroller.js
+4
-0
No files found.
www/box.ng
View file @
f38294d3
...
@@ -18,7 +18,7 @@ limitations under the License.
...
@@ -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.
...
@@ -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.
...
@@ -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>
\ No newline at end of file
www/podcontroller.js
View file @
f38294d3
...
@@ -46,6 +46,10 @@ k8sApp.controller('PodCtrl', function ($scope, $http, $routeParams) {
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment