mirror of https://github.com/rancher/dashboard.git
Redeploy action on workloads
This commit is contained in:
parent
3f17434bc0
commit
42235589f3
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { insertAt } from '@/utils/array';
|
||||||
|
import { TIMESTAMP } from '@/config/labels-annotations';
|
||||||
import { WORKLOAD_TYPES } from '@/config/types';
|
import { WORKLOAD_TYPES } from '@/config/types';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -5,18 +7,19 @@ export default {
|
||||||
_availableActions() {
|
_availableActions() {
|
||||||
let out = this._standardActions;
|
let out = this._standardActions;
|
||||||
|
|
||||||
|
insertAt(out, 0, {
|
||||||
|
action: 'redeploy',
|
||||||
|
label: 'Redeploy',
|
||||||
|
icon: 'icon icon-spinner',
|
||||||
|
enabled: !!this.links.update,
|
||||||
|
});
|
||||||
|
|
||||||
const toFilter = ['cloneYaml'];
|
const toFilter = ['cloneYaml'];
|
||||||
|
|
||||||
out = out.filter((action) => {
|
out = out.filter((action) => {
|
||||||
if (!toFilter.includes(action.action)) {
|
if (!toFilter.includes(action.action)) {
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
}).map((action) => {
|
|
||||||
if (action.action === 'viewEditYaml') {
|
|
||||||
action.label = 'View as YAML';
|
|
||||||
}
|
|
||||||
|
|
||||||
return action;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
|
|
@ -63,4 +66,11 @@ export default {
|
||||||
*/
|
*/
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
redeploy() {
|
||||||
|
const now = (new Date()).toISOString().replace(/\.\d+Z$/, 'Z');
|
||||||
|
|
||||||
|
this.setAnnotation(TIMESTAMP, now);
|
||||||
|
this.save();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue