mirror of https://github.com/rancher/ui.git
commit
000dfc47ef
|
|
@ -1,14 +1,25 @@
|
|||
import Controller from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { get } from '@ember/object';
|
||||
import { get, computed } from '@ember/object';
|
||||
import C from 'ui/utils/constants';
|
||||
|
||||
export default Controller.extend({
|
||||
router: service(),
|
||||
access: service(),
|
||||
showCurrent: computed('access.userCode.password', function() {
|
||||
if (get(this, 'access.userCode.password')) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}),
|
||||
currentPassword: computed('', function() {
|
||||
return get(this, 'access.userCode.password') || null;
|
||||
}),
|
||||
complete(success) {
|
||||
let backTo = get(this, 'session').get(C.SESSION.BACK_TO)
|
||||
let router = get(this, 'router');
|
||||
if (success) {
|
||||
get(this, 'access').set('userCode', null);
|
||||
if ( backTo ) {
|
||||
// console.log('Going back to', backTo);
|
||||
window.location.href = backTo;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@ export default Route.extend({
|
|||
|
||||
model: function() {
|
||||
return {
|
||||
user: get(this, 'access.me')
|
||||
user: get(this, 'access.me'),
|
||||
code: get(this, 'access.userCode')||'',
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@
|
|||
{{input-edit-password
|
||||
complete=(action (action complete))
|
||||
user=model.user
|
||||
showCurrent=true
|
||||
showCurrent=showCurrent
|
||||
currentPassword=currentPassword
|
||||
cancelDisabled=true
|
||||
}}
|
||||
</div>
|
||||
|
|
@ -108,12 +108,14 @@ export default Controller.extend({
|
|||
get(this, 'access').login(provider, code).then((user) => {
|
||||
if ( get(user, 'mustChangePassword') && provider === 'local' ) {
|
||||
get(this,'session').set(C.SESSION.BACK_TO, window.location.origin);
|
||||
get(this, 'access').set('userCode', code);
|
||||
get(this, 'router').transitionTo('update-password');
|
||||
} else {
|
||||
setProperties(this, {
|
||||
user: null,
|
||||
code: null,
|
||||
});
|
||||
get(this, 'access').set('userCode', null);
|
||||
this.send('complete', true);
|
||||
}
|
||||
}).catch((err) => {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ export default Service.extend({
|
|||
app: service(),
|
||||
|
||||
me: null,
|
||||
userCode: null,
|
||||
|
||||
// These are set by authenticated/route
|
||||
// Is access control enabled
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{{#if showHeader}}
|
||||
<div class="header">
|
||||
<h1>{{t 'serverUrl.header.label'}}</h1>
|
||||
<p class="help-text">{{t 'serverUrl.header.detail'}}</p>
|
||||
<p class="help-text">{{t 'serverUrl.header.detail' appName=settings.appName}}</p>
|
||||
</div>
|
||||
{{/if}}
|
||||
<form class="horizontal-form container-fluid text-left" {{action 'saveServerUrl' on="submit"}}>
|
||||
|
|
|
|||
|
|
@ -5029,7 +5029,7 @@ serviceLog:
|
|||
serverUrl:
|
||||
header:
|
||||
label: Rancher Server URL
|
||||
detail: TBD
|
||||
detail: "What URL should be used for this {appName} installation? All the nodes in your clusters will need to be able to reach this."
|
||||
button:
|
||||
save: Save URL
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue