mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-20 09:35:38 -05:00
Add support for target location in tasks (#10179)
* Add support for target location in tasks * bump sqltoolsservice to get addition of targetLocation to TaskNode
This commit is contained in:
@@ -103,11 +103,18 @@ export class TaskHistoryRenderer implements IRenderer {
|
||||
templateData.label.textContent = element.taskName + ' ' + taskStatus;
|
||||
templateData.label.title = templateData.label.textContent;
|
||||
|
||||
let description: string;
|
||||
// Determine the target name and set hover text equal to that
|
||||
let description = element.serverName;
|
||||
if (element.databaseName) {
|
||||
description += ' | ' + element.databaseName;
|
||||
// show target location if there is one, otherwise show server and database name
|
||||
if (element.targetLocation) {
|
||||
description = element.targetLocation;
|
||||
} else {
|
||||
description = element.serverName;
|
||||
if (element.databaseName) {
|
||||
description += ' | ' + element.databaseName;
|
||||
}
|
||||
}
|
||||
|
||||
templateData.description.textContent = description;
|
||||
templateData.description.title = templateData.description.textContent;
|
||||
|
||||
|
||||
@@ -43,6 +43,11 @@ export class TaskNode {
|
||||
*/
|
||||
public databaseName?: string;
|
||||
|
||||
/**
|
||||
* Target Location
|
||||
*/
|
||||
public targetLocation?: string;
|
||||
|
||||
/**
|
||||
* Provider Name
|
||||
*/
|
||||
@@ -99,7 +104,7 @@ export class TaskNode {
|
||||
*/
|
||||
public script?: string;
|
||||
|
||||
constructor(taskName: string, serverName?: string, databaseName?: string, taskId: string | undefined = undefined, taskExecutionMode: TaskExecutionMode = TaskExecutionMode.execute, isCancelable: boolean = true) {
|
||||
constructor(taskName: string, serverName?: string, databaseName?: string, taskId: string | undefined = undefined, taskExecutionMode: TaskExecutionMode = TaskExecutionMode.execute, isCancelable: boolean = true, targetLocation?: string) {
|
||||
this.id = taskId || generateUuid();
|
||||
|
||||
this.taskName = taskName;
|
||||
@@ -111,5 +116,6 @@ export class TaskNode {
|
||||
this.hasChildren = false;
|
||||
this.taskExecutionMode = taskExecutionMode;
|
||||
this.isCancelable = isCancelable;
|
||||
this.targetLocation = targetLocation;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ export class TaskService implements ITaskService {
|
||||
serverName = connectionProfile.serverName;
|
||||
}
|
||||
}
|
||||
let node: TaskNode = new TaskNode(taskInfo.name, serverName, databaseName, taskInfo.taskId, taskInfo.taskExecutionMode, taskInfo.isCancelable);
|
||||
let node: TaskNode = new TaskNode(taskInfo.name, serverName, databaseName, taskInfo.taskId, taskInfo.taskExecutionMode, taskInfo.isCancelable, taskInfo.targetLocation);
|
||||
node.providerName = taskInfo.providerName;
|
||||
this.handleNewTask(node);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user