1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-19 06:50:07 +03:00

Feature #4446: Add IPAM to Sunstone

Signed-off-by: Carlos Martín <cmartin@opennebula.org>
This commit is contained in:
Guillaume Oberlé 2016-08-29 12:06:23 +02:00 committed by Carlos Martín
parent fa4e30a9a5
commit 496dba9d23
4 changed files with 31 additions and 2 deletions

View File

@ -81,8 +81,12 @@ define(function(require) {
var ar = arList[i];
var id = ar.AR_ID;
var ipam_mad = (ar.IPAM_MAD ? ar.IPAM_MAD : "internal");
var type = (ar.TYPE ? ar.TYPE : "--");
var ip4_subnet = (ar.IP4_SUBNET ? ar.IP4_SUBNET : "--");
var start = "";
if(ar.TYPE == "IP4" || ar.TYPE == "IP4_6"){
@ -107,7 +111,9 @@ define(function(require) {
processedARList.push({
"id" : id,
"ipam_mad" : ipam_mad,
"type" : type,
"ip4_subnet": ip4_subnet,
"start" : start,
"prefixHTML" : prefix,
"leasesHTML" : leases
@ -302,9 +308,11 @@ define(function(require) {
var last_ip6_ula = ar.IP6_ULA_END;
var arKnownAttr = [
{key: Locale.tr("IPAM Driver"), value: ar.IPAM_MAD},
{key: Locale.tr("Type"), value: ar.TYPE},
{key: Locale.tr("MAC Start"), value: ar.MAC},
{key: Locale.tr("IP Start"), value: ar.IP},
{key: Locale.tr("IPv4 Subnet"), value: ar.IP4_SUBNET},
{key: Locale.tr("IPv4 Start"), value: ar.IP},
{key: Locale.tr("Global prefix"),value: ar.GLOBAL_PREFIX},
{key: Locale.tr("ULA prefix"), value: ar.ULA_PREFIX},
{key: Locale.tr("Size"), value: ar.SIZE},
@ -319,8 +327,10 @@ define(function(require) {
delete ar["IP6_GLOBAL"];
delete ar["IP6_GLOBAL_END"];
delete ar["AR_ID"];
delete ar["IPAM_MAD"];
delete ar["TYPE"];
delete ar["MAC"];
delete ar["IP4_SUBNET"];
delete ar["IP"];
delete ar["GLOBAL_PREFIX"];
delete ar["ULA_PREFIX"];

View File

@ -42,7 +42,9 @@
<thead>
<tr>
<th>{{tr "Address Range"}}</th>
<th>{{tr "IPAM"}}</th>
<th>{{tr "Type"}}</th>
<th>{{tr "IPv4 Subnet"}}</th>
<th>{{tr "Start"}}</th>
<th>{{tr "IPv6 Prefix"}}</th>
<th>{{tr "Leases"}}</th>
@ -52,7 +54,9 @@
{{#each arList}}
<tr ar="{{id}}">
<td style="white-space: nowrap" class="value_td">{{id}}</td>
<td style="white-space: nowrap" class="value_td">{{ipam_mad}}</td>
<td style="white-space: nowrap" class="value_td">{{type}}</td>
<td style="white-space: nowrap" class="value_td">{{ip4_subnet}}</td>
<td style="white-space: nowrap" class="value_td">{{start}}</td>
<td style="white-space: nowrap" class="value_td">{{{prefixHTML}}}</td>
<td style="white-space: nowrap" class="value_td">{{{leasesHTML}}}</td>

View File

@ -181,6 +181,8 @@ define(function(require) {
CustomTagsTable.fill(this.ar_section, ar_json);
$('input[name$="ar_type"]',this.ar_section).prop("disabled", true);
$('input[wizard_field="IPAM_MAD"]',this.ar_section).prop("disabled", true);
$('input[wizard_field="IP4_SUBNET"]',this.ar_section).prop("disabled", true);
$('input[wizard_field="IP"]',this.ar_section).prop("disabled", true);
$('input[wizard_field="MAC"]',this.ar_section).prop("disabled", true);
}

View File

@ -22,10 +22,23 @@
<input wizard_field="TYPE" type="radio" name="{{str_ar_tab_id}}_ar_type" id="{{str_ar_tab_id}}_ar_type_ether" value="ETHER"/><label for="{{str_ar_tab_id}}_ar_type_ether">{{tr "Ethernet"}}</label>
</div>
</div>
<div class="row">
<div class="medium-6 columns ar_input type_ip4 type_ip4_6 type_ip6">
<label for="{{str_ar_tab_id}}_ipam_mad">{{tr "IPAM Driver"}}</label>
<input wizard_field="IPAM_MAD" type="text" name="IPAM_MAD" id="{{str_ar_tab_id}}_ipam_mad"/>
</div>
</div>
<div class="row">
<div class="medium-6 columns ar_input type_ip4 type_ip4_6">
<label for="{{str_ar_tab_id}}_ip4_subnet">{{tr "IPv4 Subnet"}}
</label>
<input wizard_field="IP4_SUBNET" type="text" name="IP4_SUBNET" id="{{str_ar_tab_id}}_ip4_subnet"/>
</div>
</div>
<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>