|
|
@ -27,18 +27,18 @@ export type TableTimeSeries = { |
|
|
|
export enum HasticDatasourceStatus { |
|
|
|
export enum HasticDatasourceStatus { |
|
|
|
AVAILABLE = 'success', |
|
|
|
AVAILABLE = 'success', |
|
|
|
NOT_AVAILABLE = 'error', |
|
|
|
NOT_AVAILABLE = 'error', |
|
|
|
TESTING = 'info' |
|
|
|
CONNECTING = 'info' |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export type HasticDatasourceTestingStatus = { |
|
|
|
export type HasticDatasourceConnectingStatus = { |
|
|
|
status: HasticDatasourceStatus, |
|
|
|
status: HasticDatasourceStatus, |
|
|
|
message: string |
|
|
|
message: string |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export class AnalyticService { |
|
|
|
export class AnalyticService { |
|
|
|
public testingStatus: HasticDatasourceTestingStatus = { |
|
|
|
public connectingStatus: HasticDatasourceConnectingStatus = { |
|
|
|
status: HasticDatasourceStatus.TESTING, |
|
|
|
status: HasticDatasourceStatus.CONNECTING, |
|
|
|
message: 'Testing...' |
|
|
|
message: 'Connecting...' |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
private _isUp: boolean = false; |
|
|
|
private _isUp: boolean = false; |
|
|
@ -273,8 +273,8 @@ export class AnalyticService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async checkDatasourceAvailability(): Promise<boolean> { |
|
|
|
async checkDatasourceAvailability(): Promise<boolean> { |
|
|
|
this.testingStatus.status = HasticDatasourceStatus.TESTING; |
|
|
|
this.connectingStatus.status = HasticDatasourceStatus.CONNECTING; |
|
|
|
this.testingStatus.message = 'Testing...'; |
|
|
|
this.connectingStatus.message = 'Connecting...'; |
|
|
|
|
|
|
|
|
|
|
|
this._isUp = await this._isDatasourceAvailable(); |
|
|
|
this._isUp = await this._isDatasourceAvailable(); |
|
|
|
return this._isUp; |
|
|
|
return this._isUp; |
|
|
@ -398,8 +398,8 @@ export class AnalyticService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private _displayConnectionAlert(status: HasticDatasourceStatus, message: string[]): void { |
|
|
|
private _displayConnectionAlert(status: HasticDatasourceStatus, message: string[]): void { |
|
|
|
this.testingStatus.status = status; |
|
|
|
this.connectingStatus.status = status; |
|
|
|
this.testingStatus.message = message.join('<br /> '); |
|
|
|
this.connectingStatus.message = message.join('<br /> '); |
|
|
|
|
|
|
|
|
|
|
|
const statusChanged = this._updateHasticUrlStatus(status); |
|
|
|
const statusChanged = this._updateHasticUrlStatus(status); |
|
|
|
|
|
|
|
|
|
|
|