Skip to content

Commit

Permalink
issue #60 - get integration status from json returned by rest call -a…
Browse files Browse the repository at this point in the history
…ddressing some review feedback (#61)

Signed-off-by: Brian Fitzpatrick <bfitzpat@redhat.com>
  • Loading branch information
bfitzpat committed Aug 6, 2019
1 parent 1c776c4 commit 6d51d0d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/CamelKNodeProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,13 @@ export class CamelKNodeProvider implements vscode.TreeDataProvider<TreeNode> {
// process the JSON we get back from the kube rest API
processIntegrationListFromJSON(json : Object) {
if (json) {
let temp = JSON.stringify(json);
let o = JSON.parse(temp);
for (var i=0; i<o.items.length;i++) {
var integrationName = o.items[i].metadata.name;
let newNode = new TreeNode("string", integrationName, 'Running', vscode.TreeItemCollapsibleState.None);
let jsonStringify = JSON.stringify(json);
let jsonObject = JSON.parse(jsonStringify);
for (var i=0; i<jsonObject.items.length;i++) {
var integration = jsonObject.items[i];
var integrationName = integration.metadata.name;
var integrationPhase = integration.status.phase;
let newNode = new TreeNode("string", integrationName, integrationPhase, vscode.TreeItemCollapsibleState.None);
if (this.doesNodeExist(this.treeNodes, newNode) === false) {
this.addChild(this.treeNodes, newNode, true);
}
Expand Down

0 comments on commit 6d51d0d

Please sign in to comment.