mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Automatically fix up arc controller URL (#11177)
This commit is contained in:
@@ -31,7 +31,7 @@ export class PostgresOverviewPage extends DashboardPage {
|
|||||||
this.disposables.push(
|
this.disposables.push(
|
||||||
this._controllerModel.onEndpointsUpdated(() => this.eventuallyRunOnInitialized(() => this.handleEndpointsUpdated())),
|
this._controllerModel.onEndpointsUpdated(() => this.eventuallyRunOnInitialized(() => this.handleEndpointsUpdated())),
|
||||||
this._controllerModel.onRegistrationsUpdated(() => this.eventuallyRunOnInitialized(() => this.handleRegistrationsUpdated())),
|
this._controllerModel.onRegistrationsUpdated(() => this.eventuallyRunOnInitialized(() => this.handleRegistrationsUpdated())),
|
||||||
this._postgresModel.onServiceUpdated(() => this.eventuallyRunOnInitialized(() => this.hadleServiceUpdated())),
|
this._postgresModel.onServiceUpdated(() => this.eventuallyRunOnInitialized(() => this.handleServiceUpdated())),
|
||||||
this._postgresModel.onPodsUpdated(() => this.eventuallyRunOnInitialized(() => this.handlePodsUpdated())));
|
this._postgresModel.onPodsUpdated(() => this.eventuallyRunOnInitialized(() => this.handlePodsUpdated())));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,7 +353,7 @@ export class PostgresOverviewPage extends DashboardPage {
|
|||||||
this.propertiesLoading!.loading = false;
|
this.propertiesLoading!.loading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private hadleServiceUpdated() {
|
private handleServiceUpdated() {
|
||||||
this.properties!.propertyItems = this.getProperties();
|
this.properties!.propertyItems = this.getProperties();
|
||||||
this.propertiesLoading!.loading = false;
|
this.propertiesLoading!.loading = false;
|
||||||
|
|
||||||
|
|||||||
@@ -88,8 +88,21 @@ export class ConnectToControllerDialog {
|
|||||||
if (!this.urlInputBox.value || !this.usernameInputBox.value || !this.passwordInputBox.value) {
|
if (!this.urlInputBox.value || !this.usernameInputBox.value || !this.passwordInputBox.value) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
let url = this.urlInputBox.value;
|
||||||
|
// Only support https connections
|
||||||
|
if (url.toLowerCase().startsWith('http://')) {
|
||||||
|
url = url.replace('http', 'https');
|
||||||
|
}
|
||||||
|
// Append https if they didn't type it in
|
||||||
|
if (!url.toLowerCase().startsWith('https://')) {
|
||||||
|
url = `https://${url}`;
|
||||||
|
}
|
||||||
|
// Append default port if one wasn't specified
|
||||||
|
if (!/.*:\d*$/.test(url)) {
|
||||||
|
url = `${url}:30080`;
|
||||||
|
}
|
||||||
const controllerInfo: ControllerInfo = {
|
const controllerInfo: ControllerInfo = {
|
||||||
url: this.urlInputBox.value,
|
url: url,
|
||||||
username: this.usernameInputBox.value,
|
username: this.usernameInputBox.value,
|
||||||
rememberPassword: this.rememberPwCheckBox.checked ?? false,
|
rememberPassword: this.rememberPwCheckBox.checked ?? false,
|
||||||
resources: []
|
resources: []
|
||||||
|
|||||||
Reference in New Issue
Block a user