-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! fixup! Rework dashboard to work through JSON RPC protocol
- Loading branch information
1 parent
b06b037
commit fa772d2
Showing
13 changed files
with
115 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
dashboard/src/components/api/json-rpc/che-json-rpc-api-service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
dashboard/src/components/api/json-rpc/che-json-rpc-api.factory.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (c) 2015-2017 Red Hat, Inc. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
*/ | ||
'use strict'; | ||
|
||
import {CheJsonRpcMasterApi} from './che-json-rpc-master-api'; | ||
import {WebsocketClient} from './websocket-client'; | ||
|
||
/** | ||
* This class manages the api connection through JSON RPC. | ||
* | ||
* @author Ann Shumilova | ||
*/ | ||
export class CheJsonRpcApi { | ||
private $q: ng.IQService; | ||
private $websocket: ng.websocket.IWebSocketProvider; | ||
private $log: ng.ILogService; | ||
private jsonRpcApiConnection: Map<string, CheJsonRpcMasterApi>; | ||
|
||
/** | ||
* Default constructor that is using resource | ||
* @ngInject for Dependency injection | ||
*/ | ||
constructor($q: ng.IQService, $websocket: ng.websocket.IWebSocketProvider, $log: ng.ILogService) { | ||
this.$q = $q; | ||
this.$websocket = $websocket; | ||
this.$log = $log; | ||
this.jsonRpcApiConnection = new Map<string, CheJsonRpcMasterApi>(); | ||
} | ||
|
||
getJsonRpcMasterApi(entrypoint: string): CheJsonRpcMasterApi { | ||
if (this.jsonRpcApiConnection.has(entrypoint)) { | ||
return this.jsonRpcApiConnection.get(entrypoint); | ||
} else { | ||
let websocketClient = new WebsocketClient(this.$websocket, this.$q); | ||
let cheJsonRpcMasterApi: CheJsonRpcMasterApi = new CheJsonRpcMasterApi(websocketClient, entrypoint); | ||
this.jsonRpcApiConnection.set(entrypoint, cheJsonRpcMasterApi); | ||
return cheJsonRpcMasterApi; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
...n-rpc/che-json-rpc-wsagent-api.factory.ts → .../api/json-rpc/che-json-rpc-wsagent-api.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.