mirror of https://github.com/rancher/ui.git
commit
2b7f156324
|
|
@ -548,10 +548,8 @@ export default InputTextFile.extend(ManageLabels, ClusterDriver, {
|
|||
return remapped;
|
||||
}),
|
||||
|
||||
canSave: computed('allErrors.[]', function() {
|
||||
let { clusterOptErrors, } = this;
|
||||
|
||||
return (clusterOptErrors || []).length > 0;
|
||||
canEditForm: computed('clusterOptErrors.[]', function() {
|
||||
return (this.clusterOptErrors || []).length === 0;
|
||||
}),
|
||||
|
||||
kubeApiPodSecurityPolicy: computed('config.services.kubeApi.podSecurityPolicy', {
|
||||
|
|
@ -826,11 +824,9 @@ export default InputTextFile.extend(ManageLabels, ClusterDriver, {
|
|||
},
|
||||
|
||||
set(key, value) {
|
||||
if (this.clusterOptErrors && this.clusterOptErrors.length > 0) {
|
||||
next(() => {
|
||||
set(this, 'clusterOptErrors', this.checkYamlForRkeConfig(value));
|
||||
});
|
||||
}
|
||||
next(() => {
|
||||
set(this, 'clusterOptErrors', this.checkYamlForRkeConfig(value));
|
||||
});
|
||||
|
||||
return value;
|
||||
}
|
||||
|
|
@ -881,7 +877,7 @@ export default InputTextFile.extend(ManageLabels, ClusterDriver, {
|
|||
let decamledYaml = this.parseOptsFromYaml(yamlValue);
|
||||
|
||||
if (decamledYaml && isEmpty(decamledYaml.rancherKubernetesEngineConfig)) {
|
||||
set(this, 'clusterOptErrors', [`Cluster Options Parse Error: Missing Rancher Kubernetes Engine Config`]);
|
||||
set(this, 'clusterOptErrors', [`Cluster Options Parse Error: Missing rancher_kubernetes_engine_config key`]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
@ -931,10 +927,6 @@ export default InputTextFile.extend(ManageLabels, ClusterDriver, {
|
|||
if (this.updateFromYaml) {
|
||||
this.updateFromYaml(newOpts);
|
||||
}
|
||||
} else {
|
||||
ok = false;
|
||||
|
||||
return ok;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1035,11 +1027,9 @@ export default InputTextFile.extend(ManageLabels, ClusterDriver, {
|
|||
errors = this.validateAuthorizedClusterEndpoint(errors);
|
||||
}
|
||||
|
||||
const clusterOptErrors = get(this, 'clusterOptErrors') || [];
|
||||
|
||||
set(this, 'errors', errors);
|
||||
|
||||
return errors.length === 0 && clusterOptErrors.length === 0;
|
||||
return errors.length === 0;
|
||||
},
|
||||
|
||||
validateAuthorizedClusterEndpoint(errors) {
|
||||
|
|
|
|||
|
|
@ -16,23 +16,13 @@
|
|||
<div class="right-buttons">
|
||||
{{#if (or (not applyClusterTemplate) (and (eq step 1) (not applyClusterTemplate)))}}
|
||||
{{#if pasteOrUpload}}
|
||||
{{#if clusterOptErrors.length}}
|
||||
<button class="btn btn-sm bg-primary" disabled>
|
||||
{{#if notView}}
|
||||
{{t "clusterNew.advanced.cancel"}}
|
||||
{{else}}
|
||||
{{t "clusterNew.advanced.viewCancel"}}
|
||||
{{/if}}
|
||||
</button>
|
||||
{{else}}
|
||||
<button class="btn btn-sm bg-primary" {{action "cancel"}}>
|
||||
{{#if notView}}
|
||||
{{t "clusterNew.advanced.cancel"}}
|
||||
{{else}}
|
||||
{{t "clusterNew.advanced.viewCancel"}}
|
||||
{{/if}}
|
||||
</button>
|
||||
{{/if}}
|
||||
<button {{action "cancel"}} type="button" class="btn btn-sm bg-primary" disabled={{not canEditForm}}>
|
||||
{{#if notView}}
|
||||
{{t "clusterNew.advanced.cancel"}}
|
||||
{{else}}
|
||||
{{t "clusterNew.advanced.viewCancel"}}
|
||||
{{/if}}
|
||||
</button>
|
||||
{{else}}
|
||||
<button class="btn btn-sm bg-primary" {{action "showPaste"}}>
|
||||
{{#if notView}}
|
||||
|
|
@ -123,23 +113,17 @@
|
|||
</div>
|
||||
<div class="accordion-content">
|
||||
{{top-errors errors=clusterOptErrors}}
|
||||
<div class="mt-25">
|
||||
{{input-yaml
|
||||
showDownload=false
|
||||
canChangeName=false
|
||||
autoResize=true
|
||||
value=yamlValue
|
||||
fileChosen=(action "fileUploaded")
|
||||
readOnly=(eq mode "view")
|
||||
showUpload=(not-eq mode "view")
|
||||
valueUpdated=(action "yamlValUpdated")
|
||||
}}
|
||||
</div>
|
||||
{{copy-to-clipboard
|
||||
tooltipText=""
|
||||
buttonText="copyToClipboard.tooltip"
|
||||
clipboardText=yamlValue
|
||||
class="with-clip"
|
||||
|
||||
{{input-yaml
|
||||
showCopy=true
|
||||
showDownload=false
|
||||
canChangeName=false
|
||||
autoResize=true
|
||||
value=yamlValue
|
||||
fileChosen=(action "fileUploaded")
|
||||
readOnly=(eq mode "view")
|
||||
showUpload=(not-eq mode "view")
|
||||
valueUpdated=(action "yamlValUpdated")
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1266,9 +1250,7 @@
|
|||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#unless (and pasteOrUpload clusterOptErrors)}}
|
||||
{{top-errors errors=allErrors}}
|
||||
{{/unless}}
|
||||
{{top-errors errors=allErrors}}
|
||||
|
||||
{{#if (or (and notView (eq step 1)) (and isEdit (eq step 2)))}}
|
||||
{{save-cancel
|
||||
|
|
@ -1276,7 +1258,6 @@
|
|||
editing=isEdit
|
||||
save=(action "driverSave")
|
||||
cancel=(action "close")
|
||||
saveDisabled=canSave
|
||||
}}
|
||||
{{else}}
|
||||
<div class="footer-actions">
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ export default Component.extend(ThrottledResize, {
|
|||
tagName: ['div'],
|
||||
showUpload: true,
|
||||
showDownload: true,
|
||||
showCopy: false,
|
||||
|
||||
shouldChangeName: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,14 @@
|
|||
{{#if title}}
|
||||
<section class="header clearfix">
|
||||
<div class="right-buttons">
|
||||
{{#if showCopy}}
|
||||
{{copy-to-clipboard
|
||||
tooltipText=""
|
||||
buttonText="copyToClipboard.tooltip"
|
||||
clipboardText=value
|
||||
class="with-clip"
|
||||
}}
|
||||
{{/if}}
|
||||
{{#if showUpload}}
|
||||
<button class="btn bg-link icon-btn" {{action "click"}}>
|
||||
<span class="darken"><i class="icon icon-upload text-small"/></span>
|
||||
|
|
@ -18,6 +26,14 @@
|
|||
</section>
|
||||
{{else}}
|
||||
<div class="text-right mb-20">
|
||||
{{#if showCopy}}
|
||||
{{copy-to-clipboard
|
||||
tooltipText=""
|
||||
buttonText="copyToClipboard.tooltip"
|
||||
clipboardText=value
|
||||
class="with-clip"
|
||||
}}
|
||||
{{/if}}
|
||||
{{#if showUpload}}
|
||||
<button class="btn bg-link icon-btn" {{action "click"}}>
|
||||
<span class="darken"><i class="icon icon-upload text-small"/></span>
|
||||
|
|
|
|||
Loading…
Reference in New Issue