Support reset default storage class

https://github.com/rancher/rancher/issues/12966
This commit is contained in:
loganhz 2018-04-23 17:18:21 +08:00
parent 361bbcb266
commit aba5c5c765
2 changed files with 8 additions and 2 deletions

View File

@ -62,6 +62,10 @@ export default Resource.extend({
});
},
resetDefault() {
this.setDefault(false)
},
edit() {
get(this, 'router').transitionTo('authenticated.cluster.storage.classes.detail.edit', get(this, 'id'));
},
@ -80,8 +84,8 @@ export default Resource.extend({
annotations[DEFAULT_ANNOTATION] = 'true';
annotations[BETA_ANNOTATION] = 'true';
} else {
delete annotations[DEFAULT_ANNOTATION];
delete annotations[BETA_ANNOTATION];
annotations[DEFAULT_ANNOTATION] = 'false';
annotations[BETA_ANNOTATION] = 'false';
}
this.save();
@ -92,6 +96,7 @@ export default Resource.extend({
let out = [
{ label: 'action.makeDefault', icon: 'icon icon-star-fill', action: 'makeDefault', enabled: !isDefault },
{ label: 'action.resetDefault', icon: 'icon icon-star-line', action: 'resetDefault', enabled: isDefault },
];
return out;

View File

@ -5343,6 +5343,7 @@ action:
garbageCollect: Cleanup
logs: View Logs
makeDefault: Set as default
resetDefault: Reset default
nodeConfig: Download Keys
move: Move
pause: Pause Orchestration