diff --git a/ui/index.html b/ui/index.html index 050b2ceb4..e79033553 100644 --- a/ui/index.html +++ b/ui/index.html @@ -145,7 +145,7 @@
-

+

Create Key

@@ -213,10 +213,15 @@
-
+
-

+

{{model.Key}} + {{#if model.isLocked}} + + KEY LOCKED + + {{/if}}

@@ -226,11 +231,11 @@
- {{ textarea value=model.valueDecoded class="form-control"}} + {{ textarea value=model.valueDecoded class="form-control" disabled=model.isLocked}}
- - - + + +
diff --git a/ui/javascripts/app/models.js b/ui/javascripts/app/models.js index 4ecf38bbf..84c1f8851 100644 --- a/ui/javascripts/app/models.js +++ b/ui/javascripts/app/models.js @@ -176,6 +176,15 @@ App.Key = Ember.Object.extend(Ember.Validations.Mixin, { return (this.get('Key').slice(-1) === '/') }.property('Key'), + // Boolean if the key is locked or now + isLocked: function() { + if (!this.get('Session')) { + return false; + } else { + return true; + } + }.property('Session'), + // Determines what route to link to. If it's a folder, // it will link to kv.show. Otherwise, kv.edit linkToRoute: function() { diff --git a/ui/javascripts/app/routes.js b/ui/javascripts/app/routes.js index 220f8c99d..37f14f006 100644 --- a/ui/javascripts/app/routes.js +++ b/ui/javascripts/app/routes.js @@ -172,6 +172,12 @@ App.KvEditRoute = App.BaseRoute.extend({ }); return objs; }), + }).then(function(models) { + // If the key is locked, add the session + if (models.key.get('isLocked') == true) { + models.session = Ember.$.getJSON('/v1/session/info/' + key.Session + '/&dc=' + dc) + } + return models }); }, diff --git a/ui/styles/_panels.scss b/ui/styles/_panels.scss index ead5b3749..3d7f5acd1 100644 --- a/ui/styles/_panels.scss +++ b/ui/styles/_panels.scss @@ -10,6 +10,32 @@ border-color: $gray-background; } + h4.panel-title { + padding: 4px 10px 4px 10px; + font-size: 20px; + color: $gray-light; + color: $gray-darker; + border-radius: 3px; + opacity: 0.8; + + small { + font-size: 14px; + text-transform: uppercase; + font-weight: 700; + margin-left: 5px; + padding-top: 2px; + } + + .panel-note { + margin-top: 5px; + float: right; + font-weight: 600; + color: $gray-light; + font-size: 14px; + } + } + + h3.panel-title { padding: 4px 0px 4px 0px; font-size: 20px;