mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-31 01:25:38 -05:00
control the auto refresh state (#6577)
* control the auto refresh state * visual indicator when autorefresh is off
This commit is contained in:
@@ -25,6 +25,7 @@ export interface IInsightsConfig {
|
||||
queryFile?: string;
|
||||
details?: IInsightsConfigDetails;
|
||||
autoRefreshInterval?: number;
|
||||
id?: string;
|
||||
}
|
||||
|
||||
export interface IInsightsLabel {
|
||||
@@ -124,3 +125,14 @@ platform.Registry.add(Extensions.InsightContribution, insightRegistry);
|
||||
export function registerInsight(id: string, description: string, schema: IJSONSchema, ctor: Type<IInsightsView>): InsightIdentifier {
|
||||
return insightRegistry.registerInsight(id, description, schema, ctor);
|
||||
}
|
||||
|
||||
const WidgetAutoRefreshState: { [key: string]: boolean } = {};
|
||||
|
||||
export function getWidgetAutoRefreshState(widgetId: string, connectionId: string): boolean {
|
||||
const key = widgetId + connectionId;
|
||||
return Object.keys(WidgetAutoRefreshState).indexOf(key) === -1 || WidgetAutoRefreshState[key];
|
||||
}
|
||||
|
||||
export function setWidgetAutoRefreshState(widgetId: string, connectionId: string, state: boolean): void {
|
||||
WidgetAutoRefreshState[widgetId + connectionId] = state;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user