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

F #5202 Added dropdown to OpenNebula host field

This commit is contained in:
juanmont 2017-06-26 11:24:29 +02:00 committed by Tino Vázquez
parent 0ae56398b7
commit 7081fd6fb3
2 changed files with 24 additions and 2 deletions

View File

@ -26,6 +26,7 @@ define(function(require) {
var WizardFields = require('utils/wizard-fields');
var UniqueId = require('utils/unique-id');
var CustomTagsTable = require('utils/custom-tags-table');
var OpenNebula = require('opennebula');
/*
TEMPLATES
@ -103,6 +104,21 @@ define(function(require) {
});
$("#tf_btn_hybrid", context).trigger("click");
this.hosts_ec2 = [];
var that = this;
OpenNebula.Host.list({
timeout: true,
success: function(request, results){
$.each(results, function(key, value){
if(value.HOST.TEMPLATE.HYPERVISOR == "ec2"){
that.hosts_ec2.push({"ID":value.HOST.ID, "NAME": value.HOST.NAME});
}
});
return true;
}
});
}
function _retrieve(context) {
@ -156,7 +172,7 @@ define(function(require) {
function _addProviderTab(provider_id, context) {
var htmlId = 'provider' + provider_id + UniqueId.id();
var that = this;
var oneInput = "";
if (this.oneEnabled){
@ -216,6 +232,10 @@ define(function(require) {
if (this.value == "ec2"){
$(".hybrid_inputs", providerSection).append(EC2HTML());
$.each(that.hosts_ec2, function(key, value){
$("#HOST", providerSection).append("<option value="+value.ID+">"+value.NAME+"</option>");
});
$("#HOST", providerSection)
} else if (this.value == "AZURE"){
$(".hybrid_inputs", providerSection).append(AzureHTML());
} else if (this.value == "opennebula"){

View File

@ -66,7 +66,9 @@
<label>
{{tr "OpenNebula Host"}}
{{{tip (tr "Defines which OpenNebula host will use this template")}}}
<input wizard_field="HOST" type="text">
<select wizard_field="HOST" id="HOST" name="HOST">
<option value=""></option>
</select>
</label>
</div>
<div class="medium-6 columns">