mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-25 17:23:10 -05:00
* Fix #6477 controller login + fix dashboard layout - Service endpoints shoudl be on own column, cut off smaller screen - Controller login not working due to 404 error This is due to a breaking API change We have requested fixes to help mitigate need for cluster name, but for now have a default value for this Finally, modified code so it's easier to update swagger API and also added instructions on how to update in future
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -3,10 +3,37 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { EndpointRouterApi } from './apiGenerated';
|
||||
import * as request from 'request';
|
||||
import { ClusterRouterApi, Authentication } from './apiGenerated';
|
||||
|
||||
|
||||
class AuthConfiguration implements Authentication {
|
||||
public username: string = '';
|
||||
public password: string = '';
|
||||
|
||||
constructor(private _ignoreSslVerification: boolean) {
|
||||
}
|
||||
|
||||
applyToRequest(requestOptions: request.Options): void {
|
||||
requestOptions['agentOptions'] = {
|
||||
rejectUnauthorized: !this._ignoreSslVerification
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class ClusterApiWrapper extends ClusterRouterApi {
|
||||
constructor(basePathOrUsername: string, password?: string, basePath?: string, ignoreSslVerification?: boolean) {
|
||||
super(basePathOrUsername, password, basePath);
|
||||
this.authentications.default = new AuthConfiguration(!!ignoreSslVerification);
|
||||
}
|
||||
}
|
||||
|
||||
export async function getEndPoints(
|
||||
url: string, username: string, password: string, ignoreSslVerification?: boolean
|
||||
clusterName: string,
|
||||
url: string,
|
||||
username: string,
|
||||
password: string,
|
||||
ignoreSslVerification?: boolean
|
||||
): Promise<IEndPointsResponse> {
|
||||
|
||||
if (!url || !username || !password) {
|
||||
@@ -14,8 +41,7 @@ export async function getEndPoints(
|
||||
}
|
||||
|
||||
url = adjustUrl(url);
|
||||
let endPointApi = new EndpointRouterApi(username, password, url);
|
||||
endPointApi.ignoreSslVerification = !!ignoreSslVerification;
|
||||
let endPointApi = new ClusterApiWrapper(username, password, url, !!ignoreSslVerification);
|
||||
|
||||
let controllerResponse: IEndPointsResponse = undefined;
|
||||
let controllerError: IControllerError = undefined;
|
||||
@@ -27,7 +53,7 @@ export async function getEndPoints(
|
||||
};
|
||||
|
||||
try {
|
||||
let result = await endPointApi.endpointsGet();
|
||||
let result = await endPointApi.endpointsGet(clusterName);
|
||||
controllerResponse = <IEndPointsResponse>{
|
||||
response: result.response as IHttpResponse,
|
||||
endPoints: result.body as IEndPoint[],
|
||||
|
||||
Reference in New Issue
Block a user