mirror of https://github.com/rancher/ui.git
fixes
This commit is contained in:
parent
31a0bd2095
commit
b107439c12
|
|
@ -128,13 +128,7 @@ export default Ember.Controller.extend({
|
|||
this.send('authenticationSucceeded', res.body);
|
||||
}).catch(res => {
|
||||
// Github auth succeeded but didn't get back a token
|
||||
let err;
|
||||
try {
|
||||
err = JSON.parse(res.xhr.responseText);
|
||||
} catch(e) {
|
||||
err = {type: 'error', message: 'Error authenticating, check Client ID and Secret'};
|
||||
}
|
||||
this.send('gotError', err);
|
||||
this.send('gotError', res.body);
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -1,50 +0,0 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
model: null,
|
||||
|
||||
didReceiveAttrs() {
|
||||
let orig = this.get('originalModel');
|
||||
let tpl = orig.get('tpl');
|
||||
let links = tpl.get('versionLinks');
|
||||
var verArr = Object.keys(links).filter((key) => {
|
||||
// Filter out empty values for rancher/rancher#5494
|
||||
return !!links[key];
|
||||
}).map((key) => {
|
||||
return {version: key, link: links[key]};
|
||||
});
|
||||
|
||||
let out = {
|
||||
stack: orig.get('stack').clone(),
|
||||
serviceChoices: orig.get('serviceChoices'),
|
||||
tpl: tpl,
|
||||
currentUrl: orig.get('tplVersion.links.self'),
|
||||
versionLinks: links,
|
||||
versionsArray: verArr,
|
||||
};
|
||||
|
||||
this.set('model', out);
|
||||
},
|
||||
|
||||
actions: {
|
||||
doSave(templateId, newStack, tpl) {
|
||||
let orig = this.get('originalModel');
|
||||
let stack = orig.get('stack');
|
||||
stack.merge(newStack);
|
||||
|
||||
orig.setProperties({
|
||||
changed: true,
|
||||
enabled: true,
|
||||
stack: stack,
|
||||
tplVersion: tpl,
|
||||
});
|
||||
this.sendAction('dismiss');
|
||||
},
|
||||
|
||||
outsideClick() {},
|
||||
|
||||
cancel() {
|
||||
this.sendAction('dismiss');
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
{{new-catalog
|
||||
serviceChoices=serviceChoices
|
||||
stackResource=model.stack
|
||||
templateResource=model.tpl
|
||||
selectedTemplateUrl=currentUrl
|
||||
versionLinks=model.versionLinks
|
||||
versionsArray=model.versionsArray
|
||||
cancel=(action "cancel")
|
||||
actuallySave=false
|
||||
editing=true
|
||||
showHeader=false
|
||||
showPreview=false
|
||||
showName=false
|
||||
titleUpgrade='newCatalog.titleConfigure'
|
||||
selectVersionUpgrade='newCatalog.selectVersionConfigure'
|
||||
saveUpgrade='newCatalog.saveConfigure'
|
||||
sectionClass=""
|
||||
doSave=(action 'doSave')
|
||||
}}
|
||||
|
|
@ -36,7 +36,9 @@ export default ModalBase.extend({
|
|||
|
||||
didRender: function() {
|
||||
setTimeout(() => {
|
||||
this.$('BUTTON')[0].focus();
|
||||
try {
|
||||
this.$('BUTTON')[0].focus();
|
||||
} catch (e) {}
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,7 +3,26 @@ import Ember from 'ember';
|
|||
export default Ember.Component.extend({
|
||||
settings: Ember.inject.service(),
|
||||
|
||||
catalog: null,
|
||||
|
||||
stackId: null,
|
||||
hasKubernetes: null,
|
||||
hasMesos: null,
|
||||
hasSwarm: null,
|
||||
hasInfra: null,
|
||||
|
||||
didReceiveAttrs() {
|
||||
let k8s = this.get('catalog.catalog').findBy('id','infra:infra*k8s');
|
||||
let mesos = this.get('catalog.catalog').findBy('id','infra:infra*k8s');
|
||||
let swarm = this.get('catalog.catalog').findBy('id','infra:infra*k8s');
|
||||
let infra = this.get('catalog.catalog').findBy('templateBase','infra');
|
||||
this.setProperties({
|
||||
hasKubernetes: !!k8s,
|
||||
hasMesos: !!mesos,
|
||||
hasSwarm: !!swarm,
|
||||
hasInfra: !!infra,
|
||||
});
|
||||
},
|
||||
|
||||
actions: {
|
||||
newService() {
|
||||
|
|
|
|||
|
|
@ -11,29 +11,37 @@
|
|||
{{#link-to "catalog-tab" class="btn btn-primary"}}{{t 'heroAddService.linkToCatalog'}}{{/link-to}}
|
||||
</section>
|
||||
|
||||
<section class="well welcome">
|
||||
<h2>{{t 'heroAddService.infra.header'}}</h2>
|
||||
<p>
|
||||
{{t 'heroAddService.infra.paragraph' appName=settings.appName}}
|
||||
</p>
|
||||
{{#if hasInfra}}
|
||||
<section class="well welcome">
|
||||
<h2>{{t 'heroAddService.infra.header'}}</h2>
|
||||
<p>
|
||||
{{t 'heroAddService.infra.paragraph' appName=settings.appName}}
|
||||
</p>
|
||||
|
||||
<div class="infra-container">
|
||||
<div class="infra-box">
|
||||
<img class="backhill" height="100" src="{{app.baseAssets}}assets/images/providers/kubernetes.svg" />
|
||||
{{#link-to "catalog-tab.launch" "infra:infra*k8s" class="btn btn-primary"}}{{t 'heroAddService.addCatalog'}}{{/link-to}}
|
||||
</div>
|
||||
<div class="infra-box">
|
||||
<img class="backhill" height="100" src="{{app.baseAssets}}assets/images/providers/mesos.svg" />
|
||||
{{#link-to "catalog-tab.launch" "infra:infra*mesos" class="btn btn-primary"}}{{t 'heroAddService.addCatalog'}}{{/link-to}}
|
||||
</div>
|
||||
<div class="infra-box">
|
||||
<img class="backhill" height="100" src="{{app.baseAssets}}assets/images/providers/swarm.svg" />
|
||||
{{#link-to "catalog-tab.launch" "infra:infra*swarm" class="btn btn-primary"}}{{t 'heroAddService.addCatalog'}}{{/link-to}}
|
||||
</div>
|
||||
<div class="infra-box">
|
||||
<i class="icon icon-gear" style="font-size: 80px; margin: 10px 0 20px 0;"></i>
|
||||
{{#link-to "catalog-tab" (query-params catalogId="infra") class="btn btn-primary"}}{{t 'heroAddService.linkToCatalog'}}{{/link-to}}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="infra-container">
|
||||
{{#if hasKubernetes}}
|
||||
<div class="infra-box">
|
||||
<img class="backhill" height="100" src="{{app.baseAssets}}assets/images/providers/kubernetes.svg" />
|
||||
{{#link-to "catalog-tab.launch" "infra:infra*k8s" class="btn btn-primary"}}{{t 'heroAddService.addCatalog'}}{{/link-to}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if hasMesos}}
|
||||
<div class="infra-box">
|
||||
<img class="backhill" height="100" src="{{app.baseAssets}}assets/images/providers/mesos.svg" />
|
||||
{{#link-to "catalog-tab.launch" "infra:infra*mesos" class="btn btn-primary"}}{{t 'heroAddService.addCatalog'}}{{/link-to}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if hasSwarm}}
|
||||
<div class="infra-box">
|
||||
<img class="backhill" height="100" src="{{app.baseAssets}}assets/images/providers/swarm.svg" />
|
||||
{{#link-to "catalog-tab.launch" "infra:infra*swarm" class="btn btn-primary"}}{{t 'heroAddService.addCatalog'}}{{/link-to}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div class="infra-box">
|
||||
<i class="icon icon-gear" style="font-size: 80px; margin: 10px 0 20px 0;"></i>
|
||||
{{#link-to "catalog-tab" (query-params catalogId="infra") class="btn btn-primary"}}{{t 'heroAddService.linkToCatalog'}}{{/link-to}}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{/if}}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { parseCatalogSetting } from 'ui/utils/parse-catalog-setting';
|
|||
|
||||
export default Ember.Component.extend({
|
||||
settings: Ember.inject.service(),
|
||||
catalog: Ember.inject.service(),
|
||||
|
||||
initialValue: null,
|
||||
|
||||
|
|
@ -63,6 +64,7 @@ export default Ember.Component.extend({
|
|||
this.get('settings').one('settingsPromisesResolved', () => {
|
||||
btnCb(true);
|
||||
this.sendAction('saved');
|
||||
this.get('catalog').clearCache();
|
||||
});
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -117,6 +117,10 @@ export default Ember.Service.extend({
|
|||
});
|
||||
},
|
||||
|
||||
clearCache() {
|
||||
this.set('cache', null);
|
||||
},
|
||||
|
||||
_addLimits(url, qp) {
|
||||
let version = this.get('settings.rancherVersion');
|
||||
qp = qp || {};
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
{{else}}
|
||||
{{#link-to "stacks.new" classNames="btn btn-sm btn-primary"}}{{t 'stacksPage.actionButton'}}{{/link-to}}
|
||||
{{#if arranged.length}}
|
||||
{{#link-to "catalog-tab" projects.current.id (query-params catalogId=null) classNames="btn btn-sm btn-primary"}}{{t 'stacksPage.catalogButton'}}{{/link-to}}
|
||||
{{#link-to "catalog-tab" projects.current.id (query-params catalogId="all") classNames="btn btn-sm btn-primary"}}{{t 'stacksPage.catalogButton'}}{{/link-to}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
|
|
@ -41,7 +41,7 @@
|
|||
{{else if (and model.length tagArray.length)}}
|
||||
<div class="r-m20 text-center text-muted">{{t 'stacksPage.noMatch'}}</div>
|
||||
{{else}}
|
||||
{{hero-add-service}}
|
||||
{{hero-add-service catalog=model.catalog}}
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ export default Ember.Route.extend({
|
|||
model: function() {
|
||||
return Ember.RSVP.hash({
|
||||
stacks: this.get('store').findAll('stack'),
|
||||
infraTemplates: this.get('catalog').fetchTemplates({plusInfra: true, allowFailure: true}),
|
||||
catalog: this.get('catalog').fetchTemplates({plusInfra: true, allowFailure: true}),
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue