mirror of https://github.com/rancher/ui.git
Fix rollback issue
https://github.com/rancher/rancher/issues/13819 https://github.com/rancher/rancher/issues/13820
This commit is contained in:
parent
67ad60550a
commit
9ca256956d
|
|
@ -38,9 +38,9 @@ export default Component.extend(ModalBase, {
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
save(cb) {
|
save(cb) {
|
||||||
const revision = get(this, 'choices').findIndex(r => r.value === get(this, 'revisionId')) + 1;
|
const id = get(this, 'selected.id');
|
||||||
get(this, 'model').doAction('rollback', {
|
get(this, 'model').doAction('rollback', {
|
||||||
revision,
|
replicaSetId: id,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.send('cancel');
|
this.send('cancel');
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
|
|
@ -74,7 +74,6 @@ export default Component.extend(ModalBase, {
|
||||||
},
|
},
|
||||||
|
|
||||||
choices: computed('revisions.[]', function () {
|
choices: computed('revisions.[]', function () {
|
||||||
const currentId = get(this, 'current.id');
|
|
||||||
|
|
||||||
return (get(this, 'revisions') || [])
|
return (get(this, 'revisions') || [])
|
||||||
.sortBy('createdTS')
|
.sortBy('createdTS')
|
||||||
|
|
@ -87,14 +86,14 @@ export default Component.extend(ModalBase, {
|
||||||
value: id,
|
value: id,
|
||||||
ts: get(r, 'createdTS'),
|
ts: get(r, 'createdTS'),
|
||||||
data: r,
|
data: r,
|
||||||
disabled: id === currentId
|
disabled: r.workloadAnnotations[C.LABEL.DEPLOYMENT_REVISION] === get(this, 'model.workloadAnnotations')[C.LABEL.DEPLOYMENT_REVISION]
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
|
|
||||||
current: computed('revisions.@each.workloadAnnotations', function () {
|
current: computed('revisions.@each.workloadAnnotations', function () {
|
||||||
const currentRevision = get(this,`model.workloadAnnotations.${C.LABEL.DEPLOYMENT_REVISION}`);
|
const currentRevision = get(this, 'model.workloadAnnotations')[C.LABEL.DEPLOYMENT_REVISION];
|
||||||
return (get(this,'revisions')||[]).findBy(`workloadAnnotations.${C.LABEL.DEPLOYMENT_REVISION}`, currentRevision);
|
return (get(this,'revisions')||[]).find((r) => get(r, 'workloadAnnotations')[C.LABEL.DEPLOYMENT_REVISION] === currentRevision);
|
||||||
}),
|
}),
|
||||||
|
|
||||||
selected: computed('revisionId', 'revisions.[]', function () {
|
selected: computed('revisionId', 'revisions.[]', function () {
|
||||||
|
|
|
||||||
|
|
@ -86,8 +86,8 @@ module.exports = function(defaults) {
|
||||||
app.import('node_modules/identicon.js/identicon.js');
|
app.import('node_modules/identicon.js/identicon.js');
|
||||||
app.import('node_modules/jgrowl/jquery.jgrowl.css');
|
app.import('node_modules/jgrowl/jquery.jgrowl.css');
|
||||||
app.import('node_modules/jgrowl/jquery.jgrowl.js');
|
app.import('node_modules/jgrowl/jquery.jgrowl.js');
|
||||||
app.import('node_modules/jsondiffpatch/public/build/jsondiffpatch-formatters.js');
|
|
||||||
app.import('node_modules/jsondiffpatch/public/build/jsondiffpatch.js');
|
app.import('node_modules/jsondiffpatch/public/build/jsondiffpatch.js');
|
||||||
|
app.import('node_modules/jsondiffpatch/public/build/jsondiffpatch-formatters.js');
|
||||||
app.import('node_modules/jszip/dist/jszip.js')
|
app.import('node_modules/jszip/dist/jszip.js')
|
||||||
app.import('node_modules/moment/moment.js');
|
app.import('node_modules/moment/moment.js');
|
||||||
app.import('node_modules/prismjs/prism.js');
|
app.import('node_modules/prismjs/prism.js');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue