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 }}
<button {{ action "invalidateSession" session.ID }} {{ bind-attr class=":btn :btn-danger :pull-right :btn-list isLoading:btn-warning" }}>Invalidate</button>
</div>
<ul class="list-inline sub">
{{#each check in session.Checks}}
<li class="bold">{{check}}</li>
{{/each}}
</ul>
{{ sessionMeta session }}
</div>
{{/each}}

View File

@ -21,11 +21,25 @@ Ember.Handlebars.helper('listBar', function(status) {
});
Ember.Handlebars.helper('sessionName', function(session) {
var name;
if (session.Name === "") {
return session.ID;
name = '<span>' + session.ID + '</span>';
} 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) {

View File

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