Move Tasks Panel (#5162)

* moving tasks panel

* fix css styling

* clean up code

* do a bunch of renaming
This commit is contained in:
Anthony Dresser
2019-04-24 13:54:58 -07:00
committed by GitHub
parent 51145903aa
commit 9e804089e0
22 changed files with 204 additions and 256 deletions

View File

@@ -19,8 +19,8 @@ import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
import { ProviderConnectionInfo } from 'sql/platform/connection/common/providerConnectionInfo';
import * as Utils from 'sql/platform/connection/common/utils';
import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/common/objectExplorerService';
import { ITaskService } from 'sql/platform/taskHistory/common/taskService';
import { TaskStatus, TaskNode } from 'sql/workbench/parts/taskHistory/common/taskNode';
import { ITaskService } from 'sql/platform/tasks/common/tasksService';
import { TaskStatus, TaskNode } from 'sql/platform/tasks/common/tasksNode';
import * as TelemetryKeys from 'sql/platform/telemetry/telemetryKeys';
import * as TelemetryUtils from 'sql/platform/telemetry/telemetryUtilities';
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';

View File

@@ -0,0 +1,115 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { StopWatch } from 'vs/base/common/stopwatch';
import { generateUuid } from 'vs/base/common/uuid';
export enum TaskStatus {
NotStarted = 0,
InProgress = 1,
Succeeded = 2,
SucceededWithWarning = 3,
Failed = 4,
Canceled = 5,
Canceling = 6
}
export enum TaskExecutionMode {
execute = 0,
script = 1,
executeAndScript = 2,
}
export class TaskNode {
/**
* id for TaskNode
*/
public id: string;
/**
* string defining the type of the task - for example Backup, Restore
*/
public taskName: string;
/**
* sever name
*/
public serverName: string;
/**
* Database Name
*/
public databaseName: string;
/**
* Provider Name
*/
public providerName: string;
/**
* The start time of the task
*/
public startTime: string;
/**
* The end time of the task
*/
public endTime: string;
/**
* The timer for the task
*/
public timer: StopWatch;
/**
* Does this node have children
*/
public hasChildren: boolean;
/**
* Children of this node
*/
public children: TaskNode[];
/**
* Task's message
*/
public message: string;
/**
* Status of the task
*/
public status: TaskStatus;
/**
* Execution mode of task
*/
public taskExecutionMode: TaskExecutionMode;
/**
* Indicates if the task can be canceled
*/
public isCancelable: boolean;
/**
* Script of task operation
*/
public script: string;
constructor(taskName: string, serverName: string, databaseName: string, taskId: string = undefined, taskExecutionMode: TaskExecutionMode = TaskExecutionMode.execute, isCancelable: boolean = true) {
this.id = taskId || generateUuid();
this.taskName = taskName;
this.serverName = serverName;
this.databaseName = databaseName;
this.timer = StopWatch.create();
this.startTime = new Date().toLocaleTimeString();
this.status = TaskStatus.InProgress;
this.hasChildren = false;
this.taskExecutionMode = taskExecutionMode;
this.isCancelable = isCancelable;
}
}

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import * as azdata from 'azdata';
import { TaskNode, TaskStatus, TaskExecutionMode } from 'sql/workbench/parts/taskHistory/common/taskNode';
import { TaskNode, TaskStatus, TaskExecutionMode } from 'sql/platform/tasks/common/tasksNode';
import { IQueryEditorService } from 'sql/workbench/services/queryEditor/common/queryEditorService';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { Event, Emitter } from 'vs/base/common/event';