mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-26 01:25:38 -05:00
More layering and compile strictness (#8973)
* add more folders to strictire compile, add more strict compile options * update ci * wip * add more layering and fix issues * add more strictness * remove unnecessary assertion * add missing checks * fix indentation * remove jsdoc
This commit is contained in:
115
src/sql/workbench/services/tasks/common/tasksNode.ts
Normal file
115
src/sql/workbench/services/tasks/common/tasksNode.ts
Normal 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 = 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user