VM wizard: Show message if no affinity groups are available.

This commit is contained in:
Brian Federle 2013-04-30 13:14:31 -07:00
parent c7143be7c9
commit 1a4a319d32
4 changed files with 30 additions and 11 deletions

View File

@ -14,6 +14,8 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
message.select.affinity.groups=Please select any affinity groups you want this VM to belong to:
message.no.affinity.groups=You do not have any affinity groups. Please continue to the next step.
label.action.delete.nic=Remove NIC
message.action.delete.nic=Please confirm that want to remove this NIC, which will also remove the associated network from the VM.
changed.item.properties=Changed item properties

View File

@ -5716,6 +5716,12 @@ label.error {
margin: 10px 10px 0px;
}
.multi-wizard .select-container p {
padding: 11px;
color: #424242;
background: #DFDFDF;
}
.multi-wizard .select-container .select {
font-size: 13px;
margin: -1px 0 0;

View File

@ -25,6 +25,8 @@ under the License.
<% long now = System.currentTimeMillis(); %>
<script language="javascript">
dictionary = {
'message.select.affinity.groups': '<fmt:message key="message.select.affinity.groups" />',
'message.no.affinity.groups': '<fmt:message key="message.no.affinity.groups" />',
'label.action.delete.nic': '<fmt:message key="label.action.delete.nic" />',
'message.action.delete.nic': '<fmt:message key="message.action.delete.nic" />',
'changed.item.properties': '<fmt:message key="changed.item.properties" />',

View File

@ -485,17 +485,26 @@
'affinity': function($step, formData) {
return {
response: {
success: function(args) {
$step.find('.select-container').append(
makeSelects('affinity-groups', args.data.affinityGroups, {
name: 'name',
desc: 'description',
id: 'id'
}, {
type: 'checkbox',
'wizard-field': 'affinity-groups'
})
);
success: function(args) {
if (args.data.affinityGroups && args.data.affinityGroups.length) {
$step.prepend(
$('<div>').addClass('main-desc').append(
$('<p>').html(_l('message.select.affinity.groups'))
)
);
$step.find('.select-container').append(
makeSelects('affinity-groups', args.data.affinityGroups, {
name: 'name',
desc: 'description',
id: 'id'
}, {
type: 'checkbox',
'wizard-field': 'affinity-groups'
})
);
} else {
$step.find('.select-container').append($('<p>').html(_l('message.no.affinity.groups')));
}
}
}
};