-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* F#2921 Fix DISKIO info. Accumulate values and ignore negative values for vCenter * F#4823 Add option to specify vCenter VM folder
- Loading branch information
Showing
15 changed files
with
198 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* -------------------------------------------------------------------------- */ | ||
/* Copyright 2002-2016, OpenNebula Project, OpenNebula Systems */ | ||
/* */ | ||
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */ | ||
/* not use this file except in compliance with the License. You may obtain */ | ||
/* a copy of the License at */ | ||
/* */ | ||
/* http://www.apache.org/licenses/LICENSE-2.0 */ | ||
/* */ | ||
/* Unless required by applicable law or agreed to in writing, software */ | ||
/* distributed under the License is distributed on an "AS IS" BASIS, */ | ||
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ | ||
/* See the License for the specific language governing permissions and */ | ||
/* limitations under the License. */ | ||
/* -------------------------------------------------------------------------- */ | ||
|
||
define(function(require){ | ||
var Locale = require('utils/locale'); | ||
var Config = require('sunstone-config'); | ||
var OpenNebula = require('opennebula'); | ||
var OpenNebulaImage = require('opennebula/image'); | ||
var UserInputs = require('utils/user-inputs'); | ||
var WizardFields = require('utils/wizard-fields'); | ||
var DeployFolderTemplate = require('hbs!./deploy-folder/html'); | ||
|
||
return { | ||
'setup': _setup, | ||
'fill': _fill, | ||
'retrieveChanges': _retrieveChanges | ||
}; | ||
|
||
function _setup(context) { | ||
if (!Config.isFeatureEnabled("vcenter_deploy_folder")){ | ||
$(context).remove(); | ||
} | ||
} | ||
|
||
function _fill(context, element) { | ||
|
||
if (Config.isFeatureEnabled("vcenter_deploy_folder")){ | ||
var deployFolderContext = context; | ||
var template_public_cloud_type = element.TEMPLATE.PUBLIC_CLOUD.TYPE | ||
|
||
if ($.isEmptyObject(template_public_cloud_type)) { | ||
deployFolderContext.html(""); | ||
} else { | ||
if (template_public_cloud_type === 'vcenter') { | ||
var deploy_folder = element.TEMPLATE.DEPLOY_FOLDER | ||
deployFolderContext.html(DeployFolderTemplate()); | ||
$("#deploy_folder_input", deployFolderContext).val(deploy_folder); | ||
$("#deploy_folder_input", deployFolderContext).data("original_value",deploy_folder); | ||
} else { | ||
deployFolderContext.html(""); | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
function _retrieveChanges(context) { | ||
|
||
var templateJSON = WizardFields.retrieve(context); | ||
var fields = $('[wizard_field]', context); | ||
|
||
fields.each(function() { | ||
var field_name = $(this).attr('wizard_field'); | ||
if (templateJSON[field_name] == $(this).data("original_value")){ | ||
delete templateJSON[field_name]; | ||
} | ||
}); | ||
|
||
return templateJSON; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{{! -------------------------------------------------------------------------- }} | ||
{{! Copyright 2002-2016, OpenNebula Project, OpenNebula Systems }} | ||
{{! }} | ||
{{! Licensed under the Apache License, Version 2.0 (the "License"); you may }} | ||
{{! not use this file except in compliance with the License. You may obtain }} | ||
{{! a copy of the License at }} | ||
{{! }} | ||
{{! http://www.apache.org/licenses/LICENSE-2.0 }} | ||
{{! }} | ||
{{! Unless required by applicable law or agreed to in writing, software }} | ||
{{! distributed under the License is distributed on an "AS IS" BASIS, }} | ||
{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }} | ||
{{! See the License for the specific language governing permissions and }} | ||
{{! limitations under the License. }} | ||
{{! -------------------------------------------------------------------------- }} | ||
|
||
<fieldset> | ||
<legend> | ||
<i class="fa fa-folder"></i> {{tr "vCenter Deployment"}} | ||
</legend> | ||
<div class="deployContainer"> | ||
<label for="deploy_folder_input"> | ||
{{tr "Deployment Folder"}} | ||
{{{tip (tr "If specified, the VMs and Template folder path where the VM will be created inside the data center. The path is delimited by slashes e.g /Management/VMs. If no path is set the VM will be deployed in the same folder where the template exists.")}}} | ||
</label> | ||
<input type="text" name="deploy_folder_input" id="deploy_folder_input" wizard_field="DEPLOY_FOLDER"/> | ||
</div> | ||
</fieldset> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters