Refresh agent dashboard panel after create\update\delete operations (#1861)

* Edit alert WIP

* A couple alert edit bugs

* Hook up dashboard refresh notification

* Hook onchange event to other agent service calls

* Switch update handler to scalar value

* Add null check on handler callback
This commit is contained in:
Karl Burtram
2018-07-06 08:57:30 -07:00
committed by GitHub
parent 6f9a27ecc7
commit 21bad7a01f
25 changed files with 280 additions and 103 deletions

View File

@@ -603,4 +603,11 @@ export class ExtHostDataProtocol extends ExtHostDataProtocolShape {
$deleteProxy(handle: number, ownerUri: string, proxy: sqlops.AgentProxyInfo): Thenable<sqlops.ResultStatus> {
return this._resolveProvider<sqlops.AgentServicesProvider>(handle).deleteProxy(ownerUri, proxy);
}
/**
* SQL Agent job data update notification
*/
public $onJobDataUpdated(handle: Number): void {
this._proxy.$onJobDataUpdated(handle);
}
}

View File

@@ -460,6 +460,11 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
this._profilerService.onSessionStopped(response);
}
// SQL Server Agent handlers
public $onJobDataUpdated(handle: Number): void {
this._jobManagementService.fireOnDidChange();
}
public $unregisterProvider(handle: number): TPromise<any> {
let capabilitiesRegistration = this._capabilitiesRegistrations[handle];
if (capabilitiesRegistration) {

View File

@@ -265,6 +265,10 @@ export function createApiFactory(
};
let registerAgentServicesProvider = (provider: sqlops.AgentServicesProvider): vscode.Disposable => {
provider.registerOnUpdated(() => {
extHostDataProvider.$onJobDataUpdated(provider.handle);
});
return extHostDataProvider.$registerAgentServiceProvider(provider);
};

View File

@@ -456,6 +456,7 @@ export interface MainThreadDataProtocolShape extends IDisposable {
$onScriptingComplete(handle: number, message: sqlops.ScriptingCompleteResult): void;
$onSessionEventsAvailable(handle: number, response: sqlops.ProfilerSessionEvents): void;
$onSessionStopped(handle: number, response: sqlops.ProfilerSessionStoppedParams): void;
$onJobDataUpdated(handle: Number): void;
/**
* Callback when a session has completed initialization