Skip to content

Commit

Permalink
Feat: add the application graph page (#520)
Browse files Browse the repository at this point in the history
* Feat: add the application graph page

Signed-off-by: barnettZQG <[email protected]>

* Fix: some style error

Signed-off-by: barnettZQG <[email protected]>
  • Loading branch information
barnettZQG authored May 26, 2022
1 parent 1b49c1a commit 45a1f09
Show file tree
Hide file tree
Showing 74 changed files with 15,448 additions and 11,880 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@
},
"dependencies": {
"@alifd/meet-react": "^2.0.0",
"@antv/g6": "4.3.11",
"@b-design/ui": "^1.0.63",
"ansi-to-react": "^6.1.6",
"axios": "0.24.0",
"classnames": "^2.3.1",
"dagre": "^0.8.5",
"diagram-maker": "^1.3.0",
"dva": "2.4.1",
"dva-core": "2.0.4",
"dva-loading": "3.0.22",
"echarts": "^5.2.2",
"i18next": "^19.8.2",
"js-yaml": "^4.1.0",
"lodash": "4.17.21",
Expand Down Expand Up @@ -86,6 +86,7 @@
"@pmmmwh/react-refresh-webpack-plugin": "0.5.1",
"@testing-library/react": "^12.1.2",
"@types/chai": "^4.2.11",
"dagre-compound": "0.0.11",
"@types/js-yaml": "^4.0.1",
"@types/lodash": "^4.14.176",
"@types/mocha": "^8.2.1",
Expand Down Expand Up @@ -122,7 +123,6 @@
"less": "3.9.0",
"less-loader": "4.1.0",
"mini-css-extract-plugin": "0.11.3",
"ts-mocha": "^9.0.2",
"optimize-css-assets-webpack-plugin": "6.0.1",
"pnp-webpack-plugin": "1.6.4",
"postcss": "^8.3.3",
Expand All @@ -136,6 +136,7 @@
"sass-loader": "^10.0.5",
"style-loader": "1.3.0",
"ts-loader": "8.1.0",
"ts-mocha": "^9.0.2",
"typescript": "4.4.4",
"url-loader": "4.1.1",
"webpack": "4.44.2",
Expand Down
41 changes: 41 additions & 0 deletions src/api/observation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,44 @@ export function listApplicationServiceAppliedResources(params: {
},
});
}

export function listApplicationResourceTree(params: {
appNs: string;
appName: string;
componentName?: string;
cluster?: string;
clusterNs?: string;
}) {
let velaQLParams = `appNs=${params.appNs}, appName=${params.appName}`;
if (params.cluster) {
velaQLParams = `cluster=${params.cluster}, clusterNs=${params.clusterNs}, ` + velaQLParams;
}
if (params.componentName) {
velaQLParams = `name=${params.componentName}, ` + velaQLParams;
}
const urlParams = `application-resource-tree-view{${velaQLParams}}.status`;
return get('/api/v1/query', {
params: {
velaql: urlParams,
},
});
}

export function detailResource(params: {
name: string;
namespace: string;
kind: string;
apiVersion: string;
cluster?: string;
}) {
let velaQLParams = `name=${params.name}, namespace=${params.namespace}, kind=${params.kind}, apiVersion=${params.apiVersion}`;
if (params.cluster) {
velaQLParams = `cluster=${params.cluster}, ` + velaQLParams;
}
const urlParams = `application-resource-detail-view{${velaQLParams}}.status`;
return get('/api/v1/query', {
params: {
velaql: urlParams,
},
});
}
1 change: 1 addition & 0 deletions src/assets/KubeVela-01.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
112 changes: 112 additions & 0 deletions src/assets/resources/c-role.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
152 changes: 152 additions & 0 deletions src/assets/resources/cm.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 45a1f09

Please sign in to comment.