|
Lines 34-39
define([
Link Here
|
| 34 |
"dojo/_base/array", |
34 |
"dojo/_base/array", |
| 35 |
"dojo/string", |
35 |
"dojo/string", |
| 36 |
"dojo/Deferred", |
36 |
"dojo/Deferred", |
|
|
37 |
"dojo/topic", |
| 38 |
"dojo/on", |
| 37 |
"dojox/html/entities", |
39 |
"dojox/html/entities", |
| 38 |
"dojox/string/sprintf", |
40 |
"dojox/string/sprintf", |
| 39 |
"dijit/Menu", |
41 |
"dijit/Menu", |
|
Lines 62-68
define([
Link Here
|
| 62 |
"umc/modules/uvmm/DomainWizard", |
64 |
"umc/modules/uvmm/DomainWizard", |
| 63 |
"umc/modules/uvmm/types", |
65 |
"umc/modules/uvmm/types", |
| 64 |
"umc/i18n!umc/modules/uvmm" |
66 |
"umc/i18n!umc/modules/uvmm" |
| 65 |
], function(declare, lang, array, string, Deferred, entities, sprintf, Menu, MenuItem, ContentPane, ProgressBar, Dialog, _TextBoxMixin, |
67 |
], function(declare, lang, array, string, Deferred, topic, on, entities, sprintf, Menu, MenuItem, ContentPane, ProgressBar, Dialog, _TextBoxMixin, |
| 66 |
tools, dialog, Module, Page, Form, ExpandingTitlePane, Grid, SearchForm, Tree, Tooltip, Text, ContainerWidget, |
68 |
tools, dialog, Module, Page, Form, ExpandingTitlePane, Grid, SearchForm, Tree, Tooltip, Text, ContainerWidget, |
| 67 |
CheckBox, ComboBox, TextBox, TreeModel, DomainPage, DomainWizard, types, _) { |
69 |
CheckBox, ComboBox, TextBox, TreeModel, DomainPage, DomainWizard, types, _) { |
| 68 |
|
70 |
|
|
Lines 90-98
define([
Link Here
|
| 90 |
_progressBar: null, |
92 |
_progressBar: null, |
| 91 |
_progressContainer: null, |
93 |
_progressContainer: null, |
| 92 |
|
94 |
|
|
|
95 |
// open this domain by default |
| 96 |
openDomain: null, |
| 97 |
|
| 93 |
uninitialize: function() { |
98 |
uninitialize: function() { |
| 94 |
this.inherited(arguments); |
99 |
this.inherited(arguments); |
| 95 |
|
100 |
|
|
|
101 |
if (this._progressContainer) |
| 96 |
this._progressContainer.destroyRecursive(); |
102 |
this._progressContainer.destroyRecursive(); |
| 97 |
}, |
103 |
}, |
| 98 |
|
104 |
|
|
Lines 111-116
define([
Link Here
|
| 111 |
this._finishedDeferred.resolve(this._ucr); |
117 |
this._finishedDeferred.resolve(this._ucr); |
| 112 |
})); |
118 |
})); |
| 113 |
|
119 |
|
|
|
120 |
// directly open domain |
| 121 |
if (this.openDomain) { |
| 122 |
this._domainPage = new DomainPage({ |
| 123 |
isClosable: true, |
| 124 |
moduleWidget: this |
| 125 |
}); |
| 126 |
this._domainPage.on('closeTab', lang.hitch(this, 'closeDomainPage')); |
| 127 |
this.addChild(this._domainPage); |
| 128 |
this.selectChild(this._domainPage); |
| 129 |
this.openDomainPage(this.openDomain); |
| 130 |
return; // do not rendet the overview page |
| 131 |
} |
| 132 |
|
| 114 |
// setup search page |
133 |
// setup search page |
| 115 |
this._searchPage = new Page({ |
134 |
this._searchPage = new Page({ |
| 116 |
headerText: 'UCS Virtual Machine Manager' |
135 |
headerText: 'UCS Virtual Machine Manager' |
|
Lines 256-262
define([
Link Here
|
| 256 |
|
275 |
|
| 257 |
// setup the detail page |
276 |
// setup the detail page |
| 258 |
this._domainPage = new DomainPage({ |
277 |
this._domainPage = new DomainPage({ |
| 259 |
onClose: lang.hitch(this, function() { |
278 |
onCloseTab: lang.hitch(this, function() { |
| 260 |
this.selectChild(this._searchPage); |
279 |
this.selectChild(this._searchPage); |
| 261 |
this.set( 'title', this.defaultTitle ); |
280 |
this.set( 'title', this.defaultTitle ); |
| 262 |
}), |
281 |
}), |
|
Lines 272-277
define([
Link Here
|
| 272 |
postCreate: function() { |
291 |
postCreate: function() { |
| 273 |
this.inherited(arguments); |
292 |
this.inherited(arguments); |
| 274 |
|
293 |
|
|
|
294 |
if (this._tree) |
| 275 |
this.own(this._tree.watch('path', lang.hitch(this, function() { |
295 |
this.own(this._tree.watch('path', lang.hitch(this, function() { |
| 276 |
var searchType = this._searchForm.getWidget('type').get('value'); |
296 |
var searchType = this._searchForm.getWidget('type').get('value'); |
| 277 |
if (searchType == 'domain') { |
297 |
if (searchType == 'domain') { |
|
Lines 282-287
define([
Link Here
|
| 282 |
})); |
302 |
})); |
| 283 |
} |
303 |
} |
| 284 |
}))); |
304 |
}))); |
|
|
305 |
|
| 306 |
this.on('close', lang.hitch(this, 'onCloseTab')); |
| 285 |
}, |
307 |
}, |
| 286 |
|
308 |
|
| 287 |
_selectInputText: function() { |
309 |
_selectInputText: function() { |
|
Lines 785-790
define([
Link Here
|
| 785 |
description: _( 'Edit the configuration of the virtual machine' ), |
807 |
description: _( 'Edit the configuration of the virtual machine' ), |
| 786 |
callback: lang.hitch(this, 'openDomainPage') |
808 |
callback: lang.hitch(this, 'openDomainPage') |
| 787 |
}, { |
809 |
}, { |
|
|
810 |
name: 'editNewTab', |
| 811 |
label: _( 'Edit in new tab' ), |
| 812 |
isStandardAction: false, |
| 813 |
isMultiAction: false, |
| 814 |
iconClass: 'umcIconEdit', |
| 815 |
description: _('Open a new tab to edit the configuration of the virtual machine'), |
| 816 |
callback: lang.hitch(this, function(ids, items) { |
| 817 |
var props = { |
| 818 |
onCloseTab: lang.hitch(this, function() { |
| 819 |
topic.publish('/umc/tabs/focus', this); |
| 820 |
}), |
| 821 |
openDomain: ids |
| 822 |
}; |
| 823 |
topic.publish('/umc/modules/open', 'uvmm', '', props); |
| 824 |
}) |
| 825 |
}, { |
| 788 |
name: 'start', |
826 |
name: 'start', |
| 789 |
label: _( 'Start' ), |
827 |
label: _( 'Start' ), |
| 790 |
iconClass: 'umcIconPlay', |
828 |
iconClass: 'umcIconPlay', |
|
Lines 1069-1074
define([
Link Here
|
| 1069 |
else { |
1107 |
else { |
| 1070 |
progress.set('value', i); |
1108 |
progress.set('value', i); |
| 1071 |
} |
1109 |
} |
|
|
1110 |
}, |
| 1111 |
|
| 1112 |
closeDomainPage: function() { |
| 1113 |
// close the UVMM module |
| 1114 |
if (this._domainPage && this._domainPage.isClosable) { |
| 1115 |
topic.publish('/umc/tabs/close', this); |
| 1116 |
return; |
| 1117 |
} |
| 1118 |
}, |
| 1119 |
|
| 1120 |
onCloseTab: function() { |
| 1121 |
// event stub |
| 1072 |
} |
1122 |
} |
| 1073 |
}); |
1123 |
}); |
| 1074 |
}); |
1124 |
}); |