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

F #5411: Add DockerRegistry marketplace option (#1284)

(cherry picked from commit c4c3a3ff5d252d377b8d7dd57eeddfbd7c56178d)
This commit is contained in:
Frederick Borges 2021-06-08 17:23:54 +02:00 committed by Tino Vazquez
parent b3f76341a6
commit 96b0925567
2 changed files with 43 additions and 9 deletions

View File

@ -139,6 +139,19 @@ define(function(require) {
name: 'SKIP_UNTESTED',
label: Locale.tr("Show only auto-contextualized apps"),
driver: 'linuxcontainers'
},
{
name: 'BASE_URL',
id: 'DOCKER_REGISTRY_BASE_URL',
label: Locale.tr("DockerHub marketplace url"),
driver: 'docker_registry'
},
{
name: 'SSL',
label: Locale.tr("SSL"),
driver: 'docker_registry',
checkbox: true,
checkboxLabel: Locale.tr("SSL connection")
}
]
/*
@ -248,7 +261,18 @@ define(function(require) {
var marketObj = {};
$.extend(marketObj, WizardFields.retrieve(dialog));
var checkboxAttr = MARKET_MAD_ATTRS.filter(function(e) {
return e.checkbox;
}).map(function(e){
return e.name;
});
$.each(marketObj, function(key, value){
if (checkboxAttr.includes(key)) marketObj[key] = (value === "on") ? "true" : "false";
});
if (this.action == "create") {
marketObj = {
"marketplace" : marketObj
@ -292,7 +316,16 @@ define(function(require) {
if (e["NAME"] == marketMADName) {
if (!$.isEmptyObject(e["REQUIRED_ATTRS"])) {
$.each(e["REQUIRED_ATTRS"].split(","), function(i, attrName){
$('#' + attrName, dialog).attr('required', true);
$.each(MARKET_MAD_ATTRS, function(i, mktAttr){
if (mktAttr.name == attrName && mktAttr.driver == marketMADName){
if (mktAttr.id){
$('#' + mktAttr.id, dialog).attr('required', true);
}
else{
$('#' + attrName, dialog).attr('required', true);
}
}
});
});
}
return false;

View File

@ -46,18 +46,19 @@
<div class="row">
{{#each marketMadAttrs}}
<div class="medium-6 columns market-mad-attr-container {{this.driver}}">
<label for="{{this.name}}">
<label for="{{#if this.id }}{{this.id}}{{else}}{{this.name}}{{/if}}">
{{this.label}}
{{#if this.tooltip}}
<span class="tip">{{this.tooltip}}</span>
<span class="tip">{{this.tooltip}}</span>
{{/if}}
</label>
{{#if this.id }}
<input id="{{this.id}}" type="text" wizard_field="{{this.name}}"/>
{{else}}
<input id="{{this.name}}" type="text" wizard_field="{{this.name}}"/>
{{/if}}
<input id="{{#if this.id }}{{this.id}}{{else}}{{this.name}}{{/if}}" type="{{#if this.checkbox}}checkbox{{else}}text{{/if}}" wizard_field="{{this.name}}"/>
{{#if checkboxLabel}}
<label for="{{#if this.id }}{{this.id}}{{else}}{{this.name}}{{/if}}">
{{this.checkboxLabel}}
</label>
{{/if}}
</div>
{{/each}}
</div>