Skip to content

Commit

Permalink
fixup! Rework dashboard to work through JSON RPC protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
ashumilova committed Aug 16, 2017
1 parent 906f101 commit b06b037
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export class ExportWorkspaceDialogController {
*
* @param remoteWorkspace the remote exported workspace
*/
finishWorkspaceExporting(remoteWorkspace: any) {
finishWorkspaceExporting(remoteWorkspace: che.IWorkspace) {
this.exportInCloudSteps += 'Export of workspace ' + remoteWorkspace.config.name + 'finished <br>';
this.cheNotification.showInfo('Successfully exported the workspace to ' + remoteWorkspace.config.name + ' on ' + this.privateCloudUrl);
this.hide();
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/components/api/json-rpc/json-rpc-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class JsonRpcClient {
*/
request(method: string, params?: any): ng.IPromise<any> {
let deferred = this.client.getDeferred();
let id: string = this.counter++ + '';
let id: string = (this.counter++).toString();
this.pendingRequests.set(id, deferred);

let request: IRequest = {
Expand Down
4 changes: 3 additions & 1 deletion dashboard/src/components/api/json-rpc/websocket-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export class WebsocketClient implements ICommunicationClient {

/**
* Performs connection to the pointed entrypoint.
*
* @param entrypoint the entrypoint to connect to
*/
connect(entrypoint: string): ng.IPromise<any> {
let deferred = this.$q.defer();
Expand Down Expand Up @@ -60,7 +62,7 @@ export class WebsocketClient implements ICommunicationClient {
/**
* Sends pointed data.
*
* @param data
* @param data to be sent
*/
send(data: any): void {
this.websocketStream.send(data);
Expand Down
6 changes: 3 additions & 3 deletions dashboard/src/components/api/remote/che-remote-workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class CheRemoteWorkspace {
);
}

createWorkspaceFromConfig(workspaceConfig: any) {
createWorkspaceFromConfig(workspaceConfig: any): ng.IPromise<any> {
return this.remoteWorkspaceAPI.create(workspaceConfig).$promise;
}

Expand All @@ -60,7 +60,7 @@ export class CheRemoteWorkspace {
* @param workspaceId the ID of the workspace
* @returns {*}
*/
getMachineToken(workspaceId: string) {
getMachineToken(workspaceId: string): ng.IPromise<any> {
let deferred = this.$q.defer();
let deferredPromise = deferred.promise;

Expand All @@ -80,7 +80,7 @@ export class CheRemoteWorkspace {
* @param envName the name of the environment
* @returns {*} promise
*/
startWorkspace(remoteWsURL: string, workspaceId: string, envName: string) {
startWorkspace(remoteWsURL: string, workspaceId: string, envName: string): ng.IPromise<any> {
let deferred = this.$q.defer();
let deferredPromise = deferred.promise;
this.cheJsonRpcMasterApi.connect(remoteWsURL).then(() => {
Expand Down
8 changes: 4 additions & 4 deletions dashboard/src/components/api/remote/che-remote.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class CheRemote {
* @param password the password on the remote server
* @returns {*|promise|N|n}
*/
newAuth(url: string, login: string, password: string) {
newAuth(url: string, login: string, password: string): ng.IPromise<any> {
let remoteLogin = new CheRemoteLogin(this.$resource, url);
return remoteLogin.authenticate(login, password);
}
Expand All @@ -52,7 +52,7 @@ export class CheRemote {
* @param token
* @returns {*}
*/
newWorkspace(remoteConfig: any) {
newWorkspace(remoteConfig: any): CheRemoteWorkspace {
return new CheRemoteWorkspace(this.$resource, this.$q, this.$websocket, remoteConfig);
}

Expand All @@ -62,7 +62,7 @@ export class CheRemote {
* @param token
* @returns {*}
*/
newProject(remoteConfig: any) {
newProject(remoteConfig: any): CheRemoteProject {
return new CheRemoteProject(this.$resource, remoteConfig);
}

Expand All @@ -72,7 +72,7 @@ export class CheRemote {
* @param token
* @returns {*}
*/
newRecipe(remoteConfig): any {
newRecipe(remoteConfig: any): CheRemoteRecipe {
return new CheRemoteRecipe(this.$resource, remoteConfig);
}
}

0 comments on commit b06b037

Please sign in to comment.