Skip to content

Commit e35bec5

Browse files
committed
CLOUDSTACK-6342: UI changes for secondary IP on LB rules
This is front-end only; API call changes still need to be done.
1 parent 6d18654 commit e35bec5

5 files changed

Lines changed: 50 additions & 12 deletions

File tree

client/WEB-INF/classes/resources/messages.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17+
message.listView.subselect.multi=(Ctrl/Cmd-click)
18+
label.use.vm.ips=Use VM IPs
1719
label.reinstall.vm=Reinstall VM
1820
message.reinstall.vm=NOTE: Proceed with caution. This will cause the VM to be reinstalled from the template; data on the root disk will be lost. Extra data volumes, if any, will not be touched.
1921
label.recover.vm=Recover VM

ui/css/cloudstack3.css

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,7 @@ div.list-view td.first {
13331333
cursor: pointer;
13341334
}
13351335

1336-
div.list-view td.first:hover {
1336+
div.list-view tr:not(.multi-edit-selected) td.first:hover {
13371337
color: #3A82CD;
13381338
}
13391339

@@ -1978,6 +1978,11 @@ div.copypasteicon:hover {
19781978
margin: 4px 0 0 12px;
19791979
}
19801980

1981+
.list-view .subselect span.info {
1982+
font-size: 10px;
1983+
white-space: nowrap;
1984+
}
1985+
19811986
.list-view .subselect select {
19821987
width: 85%;
19831988
margin: 5px 0 4px;
@@ -7939,23 +7944,37 @@ div.panel.ui-dialog div.list-view div.fixed-header {
79397944

79407945
/*List-view: subselect dropdown*/
79417946
.list-view .subselect {
7942-
width: 116px;
7947+
width: 102px;
7948+
cursor: default;
79437949
display: block;
79447950
float: left;
7945-
background: url(../images/bg-gradients.png) 0px -42px;
7951+
background: #EFEFEF;
79467952
padding: 0;
79477953
margin: 8px 0 1px 7px;
79487954
clear: both;
79497955
border: 1px solid #A8A7A7;
7950-
/*+border-radius:4px;*/
7951-
-moz-border-radius: 4px;
7952-
-webkit-border-radius: 4px;
7953-
-khtml-border-radius: 4px;
7954-
border-radius: 4px;
7956+
/*+border-radius:2px;*/
7957+
-moz-border-radius: 2px;
7958+
-webkit-border-radius: 2px;
7959+
-khtml-border-radius: 2px;
7960+
border-radius: 2px;
7961+
}
7962+
7963+
.list-view .subselect:hover span {
7964+
color: initial;
79557965
}
79567966

79577967
.list-view .subselect span {
79587968
margin: 4px 0 0 12px;
7969+
cursor: default;
7970+
}
7971+
7972+
.list-view .subselect span.info {
7973+
background: none;
7974+
}
7975+
7976+
.list-view .subselect span:hover {
7977+
color: initial;
79597978
}
79607979

79617980
.list-view .subselect select {

ui/dictionary.jsp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ under the License.
2525
<% long now = System.currentTimeMillis(); %>
2626
<script type="text/javascript">
2727
dictionary = {
28+
'message.listView.subselect.multi': '<fmt:message key="message.listView.subselect.multi" />',
29+
'label.use.vm.ips': '<fmt:message key="label.use.vm.ips" />',
2830
'label.recover.vm': '<fmt:message key="label.recover.vm" />',
2931
'message.recover.vm': '<fmt:message key="message.recover.vm" />',
3032
'label.reinstall.vm': '<fmt:message key="label.reinstall.vm" />',

ui/scripts/network.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3324,7 +3324,8 @@
33243324

33253325
//when server-side change of adding new parameter "vmidipmap" to assignToLoadBalancerRule API is in, uncomment the following commented 4 lines.
33263326
subselect: {
3327-
label: 'label.use.vm.ip',
3327+
isMultiple: true,
3328+
label: 'label.use.vm.ips',
33283329
dataProvider: multipleVmSecondaryIPSubselect
33293330
},
33303331

@@ -3617,7 +3618,12 @@
36173618
if (args.itemData != null) {
36183619
for (var k = 0; k < args.itemData.length; k++) {
36193620
inputData['vmidipmap[' + k + '].vmid'] = args.itemData[k].id;
3620-
inputData['vmidipmap[' + k + '].vmip'] = args.itemData[k]._subselect;
3621+
3622+
// NOTE - multiple IP support not ready for API integration yet
3623+
// for now, just use the first selected IP
3624+
//
3625+
// Please change this to pass multiple IPs
3626+
inputData['vmidipmap[' + k + '].vmip'] = args.itemData[k]._subselect[0];
36213627
}
36223628
}
36233629
}

ui/scripts/ui/widgets/listView.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,11 +1285,19 @@
12851285
if (subselect) {
12861286
var $td = $tr.find('td.first');
12871287
var $select = $('<div></div>').addClass('subselect').append(
1288-
$('<span>').html(_l(subselect.label)),
1289-
$('<select>')
1288+
$('<span>').html(_l(subselect.label))
12901289
).hide();
12911290
var $selectionArea = $tr.find('td:last').find('input');
12921291

1292+
if (subselect.isMultiple) {
1293+
$select.append(
1294+
$('<select multiple>'),
1295+
$('<span>').addClass('info').html(_l('message.listView.subselect.multi'))
1296+
);
1297+
} else {
1298+
$select.append($('<select>'));
1299+
}
1300+
12931301
$td.append($select);
12941302

12951303
// Show and populate selection
@@ -1317,6 +1325,7 @@
13171325
$select.hide();
13181326
}
13191327

1328+
$select.find('option:first').attr('selected', 'selected');
13201329
$listView.find('.data-table').dataTable('refresh');
13211330
}
13221331
}

0 commit comments

Comments
 (0)