Skip to content

Commit 236e57e

Browse files
committed
This closes apache#168
2 parents 990010d + ed8584c commit 236e57e

File tree

7 files changed

+38
-34
lines changed

7 files changed

+38
-34
lines changed

usage/jsgui/src/main/webapp/assets/css/base.css

+3-1
Original file line numberDiff line numberDiff line change
@@ -1185,8 +1185,10 @@ tr.app-add-wizard-config-entry {
11851185
height: 8em;
11861186
margin-right: 4px;
11871187
font-family: Consolas, Lucida Console, Monaco, monospace;
1188+
font-size: 8.5pt;
1189+
line-height: 11pt;
11881190
white-space: pre;
1189-
word-wrap: normal;
1191+
word-wrap: normal;
11901192
overflow-x: scroll;
11911193
overflow-y: scroll;
11921194
}

usage/jsgui/src/main/webapp/assets/js/view/add-child-invoke.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
* Render as a modal
2121
*/
2222
define([
23-
"underscore", "jquery", "backbone",
23+
"underscore", "jquery", "backbone", "brooklyn", "brooklyn-utils", "view/viewutils", "formatJson",
2424
"text!tpl/apps/add-child-modal.html"
25-
], function(_, $, Backbone, AddChildModalHtml) {
25+
], function(_, $, Backbone, Brooklyn, Util, ViewUtils, FormatJSON,
26+
AddChildModalHtml) {
2627
return Backbone.View.extend({
2728
template: _.template(AddChildModalHtml),
2829
initialize: function() {

usage/jsgui/src/main/webapp/assets/js/view/entity-advanced.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
* @type {*}
2323
*/
2424
define(["underscore", "jquery", "backbone", "brooklyn", "brooklyn-utils", "view/viewutils",
25-
"text!tpl/apps/advanced.html", "view/entity-config", "view/change-name-invoke", "view/add-child-invoke", "view/policy-new"
25+
"text!tpl/apps/advanced.html", "view/change-name-invoke", "view/add-child-invoke", "view/policy-new"
2626
], function(_, $, Backbone, Brooklyn, Util, ViewUtils,
27-
AdvancedHtml, EntityConfigView, ChangeNameInvokeView, AddChildInvokeView, NewPolicyView) {
27+
AdvancedHtml, ChangeNameInvokeView, AddChildInvokeView, NewPolicyView) {
2828
var EntityAdvancedView = Backbone.View.extend({
2929
events: {
3030
"click button#change-name": "showChangeNameModal",
@@ -40,12 +40,6 @@ define(["underscore", "jquery", "backbone", "brooklyn", "brooklyn-utils", "view/
4040
_.bindAll(this);
4141
this.$el.html(this.template());
4242

43-
this.options.tabView.configView = new EntityConfigView({
44-
model:this.options.model,
45-
tabView:this.options.tabView,
46-
});
47-
this.$("div#advanced-config").html(this.options.tabView.configView.render().el);
48-
4943
this.model.on('change', this.modelChange, this);
5044
this.modelChange();
5145

usage/jsgui/src/main/webapp/assets/js/view/entity-summary.js

+17-9
Original file line numberDiff line numberDiff line change
@@ -21,36 +21,44 @@
2121
* @type {*}
2222
*/
2323
define([
24-
"underscore", "jquery", "backbone", "view/viewutils",
25-
"text!tpl/apps/summary.html"
26-
], function (_, $, Backbone, ViewUtils, SummaryHtml) {
24+
"underscore", "jquery", "backbone", "brooklyn", "brooklyn-utils", "view/viewutils",
25+
"text!tpl/apps/summary.html", "view/entity-config",
26+
], function (_, $, Backbone, Brooklyn, Util, ViewUtils,
27+
SummaryHtml, EntityConfigView) {
2728

2829
var EntitySummaryView = Backbone.View.extend({
2930
events:{
3031
'click a.open-tab':'tabSelected'
3132
},
3233
template:_.template(SummaryHtml),
3334
initialize: function() {
34-
_.bindAll(this)
35-
var that = this
35+
_.bindAll(this);
36+
var that = this;
3637
this.$el.html(this.template({
3738
entity:this.model,
3839
application:this.options.application,
39-
}))
40-
ViewUtils.attachToggler(this.$el)
40+
}));
41+
42+
this.options.tabView.configView = new EntityConfigView({
43+
model:this.options.model,
44+
tabView:this.options.tabView,
45+
});
46+
this.$("div#advanced-config").html(this.options.tabView.configView.render().el);
47+
48+
ViewUtils.attachToggler(this.$el);
4149

4250
// TODO we should have a backbone object exported from the sensors view which we can listen to here
4351
// (currently we just take the URL from that view) - and do the same for active tasks;
4452
ViewUtils.getRepeatedlyWithDelay(this, this.model.getSensorUpdateUrl(),
45-
function(data) { that.updateWithData(data) });
53+
function(data) { that.updateWithData(data); });
4654
// however if we only use external objects we must either subscribe to their errors also
4755
// or do our own polling against the server, so we know when to disable ourselves
4856
// ViewUtils.fetchRepeatedlyWithDelay(this, this.model, { period: 10*1000 })
4957

5058
this.loadSpec();
5159
},
5260
render:function () {
53-
return this
61+
return this;
5462
},
5563
revealIfHasValue: function(sensor, $div, renderer, values) {
5664
var that = this;

usage/jsgui/src/main/webapp/assets/tpl/apps/add-child-modal.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ <h4 style="margin-bottom: 9px;">YAML Specification</h4>
2424
<p>Add a child or children to this entity by providing a YAML blueprint</p>
2525

2626
<div class="for-textarea">
27-
<textarea id="child-spec" style="width: 100%; height: 120px;"/>
27+
<textarea id="child-spec" class="code-textarea" style="height: 120px;"/>
2828
</div>
2929

3030
<label><input type="checkbox" id="child-autostart" checked="checked"/> Auto-start </label>

usage/jsgui/src/main/webapp/assets/tpl/apps/advanced.html

+2-11
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,6 @@ <h3><span id="entity-name">Entity</span></h3>
4343
<div id="advanced-tab-error-message"></div>
4444
</div>
4545

46-
<div class="toggler-region region-config" style="margin-top: 18px;">
47-
<div class="toggler-header user-hidden">
48-
<div class="toggler-icon icon-chevron-left"></div>
49-
<div><b>Config</b></div>
50-
</div>
51-
<div id="advanced-config" class="hide"/>
52-
</div>
53-
5446
<div class="toggler-region region-config" style="margin-top: 18px;">
5547
<div class="toggler-header user-hidden">
5648
<div class="toggler-icon icon-chevron-left"></div>
@@ -60,15 +52,14 @@ <h3><span id="entity-name">Entity</span></h3>
6052
</div>
6153

6254
<!-- TODO persistence -->
63-
<!-- TODO entity tags -->
6455

6556
<div class="toggler-region region-config" style="margin-top: 18px;">
6657
<div class="toggler-header user-hidden">
6758
<div class="toggler-icon icon-chevron-left"></div>
6859
<div><b>Entity Resource JSON</b></div>
6960
</div>
7061
<div id="advanced-entity-json" class="for-textarea hide">
71-
<textarea readonly="readonly" style="width: 100%;"/>
62+
<textarea readonly="readonly" class="code-textarea"/>
7263
</div>
7364
</div>
7465

@@ -79,6 +70,6 @@ <h3><span id="entity-name">Entity</span></h3>
7970
</div>
8071
<div id="advanced-locations" class="for-textarea hide">
8172
<!-- TODO a nicer view than just the JSON -->
82-
<textarea readonly="readonly" style="width: 100%;"/>
73+
<textarea readonly="readonly" class="code-textarea"/>
8374
</div>
8475
</div>

usage/jsgui/src/main/webapp/assets/tpl/apps/summary.html

+10-2
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,18 @@ <h2><%= entity.get('name') %></h2>
8282
<div><b>Blueprint</b></div>
8383
</div>
8484
<div id="entity-spec-yaml" class="for-textarea hide">
85-
<textarea readonly="readonly" style="width: 100%;"/>
85+
<textarea readonly="readonly" class="code-textarea"/>
8686
</div>
8787
</div>
88-
88+
89+
<div class="toggler-region region-config" style="margin-top: 18px;">
90+
<div class="toggler-header user-hidden">
91+
<div class="toggler-icon icon-chevron-left"></div>
92+
<div><b>Config</b></div>
93+
</div>
94+
<div id="advanced-config" class="hide"/>
95+
</div>
96+
8997
<!-- TODO would like to show more info here, nicely; e.g.
9098
children, members (above? new section here ?)
9199
active tasks (new section here)

0 commit comments

Comments
 (0)