1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

Feature #1109: Add SelfService support in ozones

Add self service end point when creating a zone.

Show self service public link when showing VDC information.
(cherry picked from commit f44bb4940efaaa10486afe79c89935068b28a545)
This commit is contained in:
Hector Sanjuan 2012-03-02 13:37:02 +01:00 committed by Ruben S. Montero
parent ecb7120d2b
commit d367efc7db
2 changed files with 32 additions and 7 deletions

View File

@ -282,12 +282,14 @@ function updateVDCInfo(req,vdc_json){
var zone_host = "";
var zone_port = "";
var sun_link = "";
var self_link = "";
var zone_match = zone_endpoint.match(/^https?:\/\/([\w.-]+):(\d+)\/([\W\w]+)$/);
if (zone_match){
zone_host = zone_match[1];
zone_port = zone_match[2];
sun_link = "http://" + zone_host +"/sunstone_"+ vdc.NAME+"/";
self_link = "http://" + zone_host +"/self_"+ vdc.NAME+"/";
};
var info_tab = {
@ -330,6 +332,10 @@ function updateVDCInfo(req,vdc_json){
<td class="key_td">Sunstone public link</td>\
<td class="value_td">'+(sun_link.length? '<a href="'+sun_link+'" target="_blank">'+sun_link+'<span class="ui-icon ui-icon-extlink" style="display:inline-block;" /></a>' : "")+'</td>\
</tr>\
<tr>\
<td class="key_td">SelfService public link</td>\
<td class="value_td">'+(self_link.length? '<a href="'+self_link+'" target="_blank">'+self_link+'<span class="ui-icon ui-icon-extlink" style="display:inline-block;" /></a>' : "")+'</td>\
</tr>\
<tr>\
<td class="key_td">ONE_XMLPRC (to export for CLI access)</td>\
<td class="value_td"><input type="text" id="one_xmlrpc" value="'+(zone_host.length? "http://" + zone_host +"/"+ vdc.NAME: "--")+'" style="width:100%;"/></td>\
@ -501,12 +507,10 @@ function setupCreateVDCDialog(){
"ZONEID" : zoneid,
"VDCADMINNAME" : vdcadminname,
"VDCADMINPASS" : vdcadminpass,
"FORCE" : force
"FORCE" : force,
"HOSTS" : hosts
}
};
if (hosts.length){
vdc_json["VDC"]["HOSTS"]=hosts;
};
Sunstone.runAction("VDC.create",vdc_json);
dialog.dialog('close');

View File

@ -53,6 +53,12 @@ var create_zone_tmpl =
<input type="text" name="sunsendpoint_port" id="sunsendpoint_port" value="9869" style="width:3em;"/> /\
<input type="text" name="sunsendpoint_path" id="sunsendpoint_path" value="" style="width:4em;"/>\
<br />\
<label for="selfsendpoint">SelfService end point:</label>\
<input type="text" name="selfsendpoint_ptc" id="selfsendpoint_ptc" value="http" style="width:2em;"/> ://\
<input type="text" name="selfsendpoint" id="selfsendpoint" style="width:7em;" value="localhost"/> :\
<input type="text" name="selfsendpoint_port" id="selfsendpoint_port" value="4567" style="width:3em;"/> /\
<input type="text" name="selfsendpoint_path" id="selfsendpoint_path" value="ui" style="width:4em;"/>\
<br />\
</div>\
</fieldset>\
<fieldset>\
@ -310,8 +316,12 @@ function updateZoneInfo(req,zone_json){
<td class="value_td">'+zone.ENDPOINT+'</td>\
</tr>\
<tr>\
<td class="key_td">Sunstone endpoint</td>\
<td class="value_td">'+ (zone.SUNSENDPOINT.length? '<a href="'+zone.SUNSENDPOINT+'" target="_blank">'+zone.SUNSENDPOINT+'<span class="ui-icon ui-icon-extlink" style="display:inline-block;" /></a>' : "") +'</td>\
<td class="key_td">Sunstone endpoint</td>\
<td class="value_td">'+ (zone.SUNSENDPOINT.length? '<a href="'+zone.SUNSENDPOINT+'" target="_blank">'+zone.SUNSENDPOINT+'<span class="ui-icon ui-icon-extlink" style="display:inline-block;" /></a>' : "") +'</td>\
</tr>\
<tr>\
<td class="key_td">SelfService endpoint</td>\
<td class="value_td">'+ (zone.SELFENDPOINT.length? '<a href="'+zone.SELFENDPOINT+'" target="_blank">'+zone.SELFENDPOINT+'<span class="ui-icon ui-icon-extlink" style="display:inline-block;" /></a>' : "") +'</td>\
</tr>\
<tr>\
<td class="key_td">#VDCs</td>\
@ -557,11 +567,17 @@ function setupCreateZoneDialog(){
var endpoint_port = $('#endpoint_port',this).val();
var onename = $('#onename',this).val();
var onepass = $('#onepass',this).val();
var se = $('#sunsendpoint',this).val();
var se_ptc = $('#sunsendpoint_ptc',this).val();
var se_port = $('#sunsendpoint_port',this).val();
var se_path = $('#sunsendpoint_path',this).val();
var ss = $('#selfsendpoint',this).val();
var ss_ptc = $('#selfsendpoint_ptc',this).val();
var ss_port = $('#selfsendpoint_port',this).val();
var ss_path = $('#selfsendpoint_path',this).val();
if (!name.length || !endpoint.length ||
!onename.length || !onepass.length){
notifyError("Please fill in all fields");
@ -575,13 +591,18 @@ function setupCreateZoneDialog(){
se = se_ptc + "://" + se + ":" + se_port +
"/" + se_path;
if (ss.length)
ss = ss_ptc + "://" + ss + ":" + ss_port +
"/" + ss_path;
var zone_json = {
"ZONE": {
"NAME": name,
"ENDPOINT": endpoint,
"ONENAME": onename,
"ONEPASS": onepass,
"SUNSENDPOINT" : se
"SUNSENDPOINT" : se,
"SELFENDPOINT" : ss,
}
};