ui: add session behavior and ttl to UI

fixes #649
This commit is contained in:
Jack Pearkes 2015-02-11 18:51:30 -08:00
parent fd84191754
commit df11bff8bb
3 changed files with 26 additions and 3 deletions

View File

@ -569,11 +569,13 @@
{{ sessionName session }} {{ sessionName session }}
<button {{ action "invalidateSession" session.ID }} {{ bind-attr class=":btn :btn-danger :pull-right :btn-list isLoading:btn-warning" }}>Invalidate</button> <button {{ action "invalidateSession" session.ID }} {{ bind-attr class=":btn :btn-danger :pull-right :btn-list isLoading:btn-warning" }}>Invalidate</button>
</div> </div>
<ul class="list-inline sub"> <ul class="list-inline sub">
{{#each check in session.Checks}} {{#each check in session.Checks}}
<li class="bold">{{check}}</li> <li class="bold">{{check}}</li>
{{/each}} {{/each}}
</ul> </ul>
{{ sessionMeta session }}
</div> </div>
{{/each}} {{/each}}

View File

@ -21,11 +21,25 @@ Ember.Handlebars.helper('listBar', function(status) {
}); });
Ember.Handlebars.helper('sessionName', function(session) { Ember.Handlebars.helper('sessionName', function(session) {
var name;
if (session.Name === "") { if (session.Name === "") {
return session.ID; name = '<span>' + session.ID + '</span>';
} else { } else {
return new Handlebars.SafeString('<span>' + session.Name + '</span>' + ' <small>' + session.ID + '</small>'); name = '<span>' + session.Name + '</span>' + ' <small>' + session.ID + '</small>';
} }
return new Handlebars.SafeString(name);
});
Ember.Handlebars.helper('sessionMeta', function(session) {
var meta = '<div class="metadata">' + session.Behavior + ' behavior</div>';
if (session.TTL !== "") {
meta = meta + '<div class="metadata">, ' + session.TTL + ' TTL</div>';
}
return new Handlebars.SafeString(meta);
}); });
Ember.Handlebars.helper('aclName', function(name, id) { Ember.Handlebars.helper('aclName', function(name, id) {

View File

@ -74,7 +74,7 @@
} }
small { small {
display:inline-block; display: inline-block;
padding-right: 8px; padding-right: 8px;
padding-top: 2px; padding-top: 2px;
font-size: 12px; font-size: 12px;
@ -82,6 +82,13 @@
} }
} }
.metadata {
display: block;
font-size: 12px;
float: left;
color: $gray-light;
}
ul.sub { ul.sub {
li { li {
padding: 0; padding: 0;