|
|
@ -26,20 +26,19 @@ export type TableTimeSeries = { |
|
|
|
|
|
|
|
|
|
|
|
export enum HasticDatasourceStatus { |
|
|
|
export enum HasticDatasourceStatus { |
|
|
|
AVAILABLE = 'success', |
|
|
|
AVAILABLE = 'success', |
|
|
|
NOT_AVAILABLE = 'error' |
|
|
|
NOT_AVAILABLE = 'error', |
|
|
|
|
|
|
|
TESTING = 'info' |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export type HasticDatasourceTestingStatus = { |
|
|
|
export type HasticDatasourceTestingStatus = { |
|
|
|
testing: boolean, |
|
|
|
|
|
|
|
status: HasticDatasourceStatus, |
|
|
|
status: HasticDatasourceStatus, |
|
|
|
message: string |
|
|
|
message: string |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export class AnalyticService { |
|
|
|
export class AnalyticService { |
|
|
|
public testingStatus: HasticDatasourceTestingStatus = { |
|
|
|
public testingStatus: HasticDatasourceTestingStatus = { |
|
|
|
testing: false, |
|
|
|
status: HasticDatasourceStatus.TESTING, |
|
|
|
status: HasticDatasourceStatus.NOT_AVAILABLE, |
|
|
|
message: 'Testing...' |
|
|
|
message: '' |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
private _isUp: boolean = false; |
|
|
|
private _isUp: boolean = false; |
|
|
@ -274,11 +273,11 @@ export class AnalyticService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async checkDatasourceAvailability(): Promise<boolean> { |
|
|
|
async checkDatasourceAvailability(): Promise<boolean> { |
|
|
|
this.testingStatus.testing = true; |
|
|
|
this.testingStatus.status = HasticDatasourceStatus.TESTING; |
|
|
|
|
|
|
|
this.testingStatus.message = 'Testing...'; |
|
|
|
|
|
|
|
|
|
|
|
this._isUp = await this._isDatasourceAvailable(); |
|
|
|
this._isUp = await this._isDatasourceAvailable(); |
|
|
|
|
|
|
|
|
|
|
|
this.testingStatus.testing = false; |
|
|
|
|
|
|
|
return this._isUp; |
|
|
|
return this._isUp; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|