Edit yaml for !rke2 cluster should show mgmt cluster

This commit is contained in:
Vincent Fiduccia 2021-08-12 17:38:44 -07:00
parent c740629f9b
commit 3ad95772db
No known key found for this signature in database
GPG Key ID: 2B29AD6BB2BB2582
2 changed files with 25 additions and 1 deletions

View File

@ -1,5 +1,5 @@
import { AGE, NAME as NAME_COL, STATE } from '@/config/table-headers';
import { CAPI, NORMAN } from '@/config/types';
import { CAPI, MANAGEMENT, NORMAN } from '@/config/types';
import { MULTI_CLUSTER } from '@/store/features';
import { DSL } from '@/store/type-map';
@ -100,6 +100,7 @@ export function init(store) {
weightType(CAPI.MACHINE, 1, true);
basicType([
MANAGEMENT.CLUSTER,
CAPI.MACHINE_DEPLOYMENT,
CAPI.MACHINE_SET,
CAPI.MACHINE,

View File

@ -5,6 +5,7 @@ import { set } from '@/utils/object';
import { sortBy } from '@/utils/sort';
import { ucFirst } from '@/utils/string';
import { compare } from '@/utils/version';
import { AS, MODE, _EDIT, _YAML } from '~/config/query-params';
export const DEFAULT_WORKSPACE = 'fleet-default';
@ -100,6 +101,28 @@ export default {
return out;
},
goToEditYaml() {
return () => {
let location;
if ( !this.isRke2 ) {
location = this.mgmt?.detailLocation;
}
if ( !location ) {
location = this.detailLocation;
}
location.query = {
...location.query,
[MODE]: _EDIT,
[AS]: _YAML
};
this.currentRouter().push(location);
};
},
isImported() {
return this.provisioner === 'imported';
},