mirror of https://github.com/rancher/ui.git
edit cluster launched with cluster template
This commit is contained in:
parent
7ee41a0cc3
commit
4e9b36ae45
|
|
@ -28,8 +28,8 @@ export default Route.extend({
|
|||
|
||||
if (!isEmpty(cluster.clusterTemplateRevisionId)) {
|
||||
setProperties(modelOut, {
|
||||
clusterTemplateRevision: globalStore.find('clustertemplaterevision', cluster.clusterTemplateRevisionId),
|
||||
clusterTemplate: globalStore.find('clustertemplate', cluster.clusterTemplateId),
|
||||
clusterTemplateRevisions: globalStore.findAll('clustertemplaterevision'),
|
||||
clusterTemplates: globalStore.findAll('clustertemplate'),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -37,6 +37,28 @@ export default Route.extend({
|
|||
},
|
||||
|
||||
afterModel(model) {
|
||||
let {
|
||||
clusterTemplateRevisions = null,
|
||||
clusterTemplates = null,
|
||||
cluster
|
||||
} = model;
|
||||
|
||||
if (clusterTemplateRevisions) {
|
||||
let ctr = null;
|
||||
let ct = null;
|
||||
let ctId = null;
|
||||
|
||||
ctr = clusterTemplateRevisions.findBy('id', cluster.clusterTemplateRevisionId);
|
||||
ctId = get(ctr, 'clusterTemplateId');
|
||||
ct = clusterTemplates.findBy('id', ctId);
|
||||
|
||||
setProperties(model, {
|
||||
clusterTemplateRevisionId: get(ctr, 'id'),
|
||||
clusterTemplateId: get(ct, 'id'),
|
||||
clusterTemplateRevision: ctr
|
||||
});
|
||||
}
|
||||
|
||||
// load the css/js url here, if the url loads fail we should error the driver out
|
||||
// show the driver in the ui, greyed out, and possibly add error text "can not load comonent from url [put url here]"
|
||||
let { kontainerDrivers } = model;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
</section>
|
||||
|
||||
<CruCluster
|
||||
@applyClusterTemplate={{not (is-empty model.clusterTemplateRevision)}}
|
||||
@applyClusterTemplate={{not (is-empty model.clusterTemplateRevisionId)}}
|
||||
@clusterTemplateRevisionId={{model.clusterTemplateRevisionId}}
|
||||
@model={{model}}
|
||||
@initialProvider={{cluster.provider}}
|
||||
@provider={{provider}}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
</section>
|
||||
|
||||
{{#unless clusterTemplateCreate}}
|
||||
{{#if model.clusterTemplateRevisions}}
|
||||
{{#if (or model.clusterTemplateRevisions model.clusterTemplateRevision)}}
|
||||
<section class="cluster-template-select mb-20">
|
||||
<div class="row">
|
||||
<div class="col span-6">
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
{{#if (eq step 1)}}
|
||||
<form onsubmit={{action "clickNext"}}>
|
||||
<div class="row">
|
||||
|
|
|
|||
Loading…
Reference in New Issue