Files
azuredatastudio/src/sql/parts/jobManagement/agent/agentView.component.ts
Aditya Bist 8ec5451e64 Feature/agent2 adbist (#1113)
* added caching for jobs view and history page

* added build fix

* removed agent from cache service name

* put cache in job mgmt service and fixed view destroy error

* jobs view cache and refresh implemented

* refresh and cache complete

* added refresh to job history page

* fixed steps style

* explicitly tell user when no steps are available

* show message when no prev runs available

* code review refactor

* cleaned code

* added code that got left out
2018-04-12 10:36:34 -07:00

96 lines
3.0 KiB
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!../common/media/jobs';
import * as nls from 'vs/nls';
import { Component, Inject, forwardRef, ElementRef, ChangeDetectorRef, ViewChild, Injectable} from '@angular/core';
import * as Utils from 'sql/parts/connection/common/utils';
import { RefreshWidgetAction, EditDashboardAction } from 'sql/parts/dashboard/common/actions';
import { IColorTheme } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { IDisposable } from 'vs/base/common/lifecycle';
import * as themeColors from 'vs/workbench/common/theme';
import { DashboardPage } from 'sql/parts/dashboard/common/dashboardPage.component';
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import { IBootstrapService, BOOTSTRAP_SERVICE_ID } from 'sql/services/bootstrap/bootstrapService';
import { DashboardServiceInterface } from 'sql/parts/dashboard/services/dashboardServiceInterface.service';
import { AgentJobInfo, AgentJobHistoryInfo } from 'sqlops';
import { PanelComponent, IPanelOptions, NavigationBarLayout } from 'sql/base/browser/ui/panel/panel.component';
export const DASHBOARD_SELECTOR: string = 'agentview-component';
@Component({
selector: DASHBOARD_SELECTOR,
templateUrl: decodeURI(require.toUrl('./agentView.component.html'))
})
@Injectable()
export class AgentViewComponent {
@ViewChild(PanelComponent) private _panel: PanelComponent;
// tslint:disable:no-unused-variable
private readonly jobsComponentTitle: string = nls.localize('jobview.Jobs', "Jobs");
private _showHistory: boolean = false;
private _jobId: string = null;
private _agentJobInfo: AgentJobInfo = null;
private _refresh: boolean = undefined;
public jobsIconClass: string = 'jobsview-icon';
// tslint:disable-next-line:no-unused-variable
private readonly panelOpt: IPanelOptions = {
showTabsWhenOne: true,
layout: NavigationBarLayout.vertical,
showIcon: true
};
constructor(
@Inject(forwardRef(() => ChangeDetectorRef)) private _cd: ChangeDetectorRef){
}
/**
* Public Getters
*/
public get jobId(): string {
return this._jobId;
}
public get showHistory(): boolean {
return this._showHistory;
}
public get agentJobInfo(): AgentJobInfo {
return this._agentJobInfo;
}
public get refresh(): boolean {
return this._refresh;
}
/**
* Public Setters
*/
public set jobId(value: string) {
this._jobId = value;
this._cd.detectChanges();
}
public set showHistory(value: boolean) {
this._showHistory = value;
this._cd.detectChanges();
}
public set agentJobInfo(value: AgentJobInfo) {
this._agentJobInfo = value;
this._cd.detectChanges();
}
public set refresh(value: boolean) {
this._refresh = value;
this._cd.detectChanges();
}
}