Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for IPv6 static #209

Merged
merged 1 commit into from
Mar 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/sunstone/public/app/opennebula/vm.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ define(function(require) {

var NIC_IP_ATTRS = [
"IP",
"IP6",
"IP6_GLOBAL",
"IP6_ULA",
"VROUTER_IP",
Expand Down
6 changes: 6 additions & 0 deletions src/sunstone/public/app/tabs/vnets-tab/panels/ar.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ define(function(require) {
var last_mac = ar.MAC_END;
var first_ip = ar.IP;
var last_ip = ar.IP_END;
var first_ip6_static= ar.IP6;
var last_ip6_static = ar.IP6_END;
var first_ip6_global= ar.IP6_GLOBAL;
var last_ip6_global = ar.IP6_GLOBAL_END;
var first_ip6_ula = ar.IP6_ULA;
Expand All @@ -317,6 +319,8 @@ define(function(require) {
delete ar["IP_END"];
delete ar["IP6_ULA"];
delete ar["IP6_ULA_END"];
delete ar["IP6"];
delete ar["IP6_END"];
delete ar["IP6_GLOBAL"];
delete ar["IP6_GLOBAL_END"];
delete ar["AR_ID"];
Expand Down Expand Up @@ -364,6 +368,8 @@ define(function(require) {
'last_mac': last_mac,
'first_ip': first_ip,
'last_ip': last_ip,
'first_ip6_static': first_ip6_static,
'last_ip6_static': last_ip6_static,
'first_ip6_global': first_ip6_global,
'last_ip6_global': last_ip6_global,
'first_ip6_ula': first_ip6_ula,
Expand Down
7 changes: 7 additions & 0 deletions src/sunstone/public/app/tabs/vnets-tab/panels/ar/arInfo.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@
<td class="value_td">{{last_ip6_global}}</td>
</tr>
{{/if}}
{{#if first_ip6_static}}
<tr>
<td class="key_td">{{tr "IP6"}}</td>
<td class="value_td">{{first_ip6_static}}</td>
<td class="value_td">{{last_ip6_static}}</td>
</tr>
{{/if}}
{{#if first_ip6_ula}}
<tr>
<td class="key_td">{{tr "IP6_ULA"}}</td>
Expand Down
1 change: 1 addition & 0 deletions src/sunstone/public/app/tabs/vnets-tab/panels/leases.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ define(function(require) {
"col0HTML" : col0HTML,
"col1HTML" : col1HTML,
"IP" : lease.IP,
"IP6" : lease.IP6,
"MAC" : lease.MAC,
"IP6_LINK" : lease.IP6_LINK,
"IP6_ULA" : lease.IP6_ULA,
Expand Down
2 changes: 2 additions & 0 deletions src/sunstone/public/app/tabs/vnets-tab/panels/leases/html.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<th></th>
<th></th>
<th>{{tr "IP"}}</th>
<th>{{tr "IPv6"}}</th>
<th>{{tr "MAC"}}</th>
<th>{{tr "IPv6 Link"}}</th>
<th>{{tr "IPv6 ULA"}}</th>
Expand All @@ -48,6 +49,7 @@
<td class="key_td">{{{col0HTML}}}</td>
<td>{{{col1HTML}}}</td>
<td style="white-space: nowrap" class="value_td">{{valOrDefault IP "--"}}</td>
<td style="white-space: nowrap" class="value_td">{{valOrDefault IP6 "--"}}</td>
<td style="white-space: nowrap" class="value_td">{{valOrDefault MAC "--"}}</td>
<td style="white-space: nowrap" class="value_td">{{valOrDefault IP6_LINK "--"}}</td>
<td style="white-space: nowrap" class="value_td">{{valOrDefault IP6_ULA "--"}}</td>
Expand Down
20 changes: 20 additions & 0 deletions src/sunstone/public/app/tabs/vnets-tab/utils/ar-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,20 @@ define(function(require) {
}
});

$('input.slaac',ar_section).prop('checked',true);
$('.slaac_false', ar_section).hide();

$('input.slaac',ar_section).on('change', function(){
var slaac = $(this).prop('checked');
if(slaac){
$('.slaac_true', ar_section).show();
$('.slaac_false', ar_section).hide();
}else{
$('.slaac_true', ar_section).hide();
$('.slaac_false', ar_section).show();
}
});

$('input#'+str_ar_tab_id+'_ar_type_ip4',ar_section).prop('checked', true);
$('input#'+str_ar_tab_id+'_ar_type_ip4',ar_section).change();

Expand Down Expand Up @@ -111,9 +125,15 @@ define(function(require) {
break;
case "IP4_6":
fields = $('div.type_ip4_6', this.ar_section).children("input");
if(!$('input.slaac',this.ar_section).prop('checked')){
ar_type += "_STATIC";
}
break;
case "IP6":
fields = $('div.type_ip6', this.ar_section).children("input");
if(!$('input.slaac',this.ar_section).prop('checked')){
ar_type += "_STATIC";
}
break;
case "ETHER":
fields = $('div.type_ether', this.ar_section).children("input");
Expand Down
35 changes: 27 additions & 8 deletions src/sunstone/public/app/tabs/vnets-tab/utils/ar-tab/html.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div class="row">
<div class="medium-6 columns">
<div class="row collapse ar_input type_ip4 type_ip4_6">
<label for="{{str_ar_tab_id}}_ip_start">{{tr "First IP address"}}
<label for="{{str_ar_tab_id}}_ip_start">{{tr "First IPv4 address"}}
</label>
<input wizard_field="IP" type="text" name="IP" id="{{str_ar_tab_id}}_ip_start"/>
</div>
Expand All @@ -35,22 +35,41 @@
<input wizard_field="MAC" type="text" name="MAC" id="{{str_ar_tab_id}}_mac_start" />
</div>
</div>
<div class="medium-6 columns ar_input type_ip4 type_ip4_6 type_ip6 type_ether">
<label for="{{str_ar_tab_id}}_size">{{tr "Size"}}
</label>
<input wizard_field="SIZE" required type="number" min="0" name="SIZE" id="{{str_ar_tab_id}}_size" />
<div class="medium-6 columns">
<div class="row collapse ar_input type_ip4 type_ip4_6 type_ip6 type_ether">
<label for="{{str_ar_tab_id}}_size">{{tr "Size"}}
</label>
<input wizard_field="SIZE" required type="number" min="0" name="SIZE" id="{{str_ar_tab_id}}_size" />
</div>
<div class="row collapse ar_input type_ip4_6 type_ip6 switch left">
<label for="{{str_ar_tab_id}}_">{{tr "SLAAC"}}
</label>
<input class="switch-input slaac" wizard_field="SLAAC" name="SLAAC" id="{{str_ar_tab_id}}_slaac" type="checkbox">
<label class="switch-paddle" for="{{str_ar_tab_id}}_slaac">
</label>
</div>
</div>
</div>
<div class="row">
<div class="row slaac_true">
<div class="medium-6 columns ar_input type_ip4_6 type_ip6">
<label for="{{str_ar_tab_id}}_global_prefix">{{tr "Global prefix"}}</label>
<label for="{{str_ar_tab_id}}_global_prefix">{{tr "IPv6 Global prefix"}}</label>
<input wizard_field="GLOBAL_PREFIX" type="text" name="GLOBAL_PREFIX" id="{{str_ar_tab_id}}_global_prefix"/>
</div>
<div class="medium-6 columns ar_input type_ip4_6 type_ip6">
<label for="{{str_ar_tab_id}}_ula_prefix">{{tr "ULA prefix"}}</label>
<label for="{{str_ar_tab_id}}_ula_prefix">{{tr "IPv6 ULA prefix"}}</label>
<input wizard_field="ULA_PREFIX" type="text" name="ULA_PREFIX" id="{{str_ar_tab_id}}_ula_prefix"/>
</div>
</div>
<div class="row slaac_false">
<div class="medium-6 columns ar_input type_ip4_6 type_ip6">
<label for="{{str_ar_tab_id}}_ipv6">{{tr "IPv6"}}</label>
<input wizard_field="IP6" type="text" name="IP6" id="{{str_ar_tab_id}}_ipv6"/>
</div>
<div class="medium-6 columns ar_input type_ip4_6 type_ip6">
<label for="{{str_ar_tab_id}}_prefix_lenght">{{tr "Prefix lenght"}}</label>
<input wizard_field="PREFIX_LENGHT" type="text" name="PREFIX_LENGHT" id="{{str_ar_tab_id}}_prefix_lenght"/>
</div>
</div>
<div class="row">
<div class="medium-12 columns">
{{#advancedSection (tr "Advanced Options") }}
Expand Down