ui: add session behavior and ttl to UI

fixes #649
pull/696/head
Jack Pearkes 10 years ago
parent 2f541b5ef7
commit a82bbb6561

@ -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}}

@ -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) {

@ -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;

Loading…
Cancel
Save