Skip to content

Commit

Permalink
#167 wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Göran Sander committed Nov 12, 2023
1 parent ac8f8b9 commit 986beff
Show file tree
Hide file tree
Showing 5 changed files with 262 additions and 138 deletions.
144 changes: 73 additions & 71 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,44 +58,44 @@
// ------------------------------------
// Import tasks from Excel file
// ------------------------------------
"args": [
"task-import",
"--auth-type",
"cert",
"--host",
"192.168.100.109",
"--auth-cert-file",
"./cert/client.pem",
"--auth-cert-key-file",
"./cert/client_key.pem",
"--auth-user-dir",
"LAB",
"--auth-user-id",
"goran",
// "args": [
// "task-import",
// "--auth-type",
// "cert",
// "--host",
// "192.168.100.109",
// "--auth-cert-file",
// "./cert/client.pem",
// "--auth-cert-key-file",
// "./cert/client_key.pem",
// "--auth-user-dir",
// "LAB",
// "--auth-user-id",
// "goran",

"--file-type",
"excel",
// "--file-type",
// "excel",

"--file-name",
"testdata/tasks.xlsx",
"--sheet-name",
"5"
// "--file-name",
// "testdata/tasks.xlsx",
// "--sheet-name",
// "7"

// "--import-app",
// "--import-app-sheet-name",
// "App import",
// // "--import-app",
// // "--import-app-sheet-name",
// // "App import",

// "--qvf-overwrite",
// "no",
// // "--qvf-overwrite",
// // "no",

// "--limit-import-count",
// "2",
// // "--limit-import-count",
// // "2",

// "--sleep-app-upload",
// "500",
// // "--sleep-app-upload",
// // "500",

// "--dry-run"
]
// // "--dry-run"
// ]

// ------------------------------------
// Import tasks from CSV file
Expand All @@ -121,7 +121,8 @@
// "--file-name",
// // "tasks2source.csv",
// // "task-chain.csv",
// "testdata/reload-tasks.csv",
// // "testdata/reload-tasks.csv",
// "./tasks5.csv",

// // "--qvf-overwrite",
// // "no",
Expand Down Expand Up @@ -318,45 +319,46 @@
// "comprule"
// ]

// ------------------------------------
// Get reload tasks as CSV/Excel/JSON file
// ------------------------------------
// "args": [
// "task-get",
// "--auth-type",
// "cert",
// "--host",
// "192.168.100.109",
// // "--auth-cert-file",
// // "./cert/client.pem",
// // "--auth-cert-key-file",
// // "./cert/client_key.pem",
// "--auth-user-dir",
// "LAB",
// "--auth-user-id",
// "goran",
// // "--task-id",
// // "82bc3e66-c899-4e44-b52f-552145da5ee0",
// // "82bc3e66-c899-4e44-b52f-552145da5ee1",
// // "5748afa9-3abe-43ab-bb1f-127c48ced075",
// // "5520e710-91ad-41d2-aeb6-434cafbf366b",
// // "--task-tag",
// // "Ctrl-Q demo",
// // "Butler 5.0 demo",

// "--output-format",
// "table",
// "--output-dest",
// "file",
// "--output-file-name",
// // "tasks.xlsx",
// "tasks.csv",
// // "tasks2.json",
// // "tasks2.xlsx",
// "--output-file-format",
// // "excel",
// // "json",
// "csv",
------------------------------------
Get reload tasks as CSV/Excel/JSON file
------------------------------------
"args": [
"task-get",
"--auth-type",
"cert",
"--host",
"192.168.100.109",
// "--auth-cert-file",
// "./cert/client.pem",
// "--auth-cert-key-file",
// "./cert/client_key.pem",
"--auth-user-dir",
"LAB",
"--auth-user-id",
"goran",
// "--task-id",
// "82bc3e66-c899-4e44-b52f-552145da5ee0",
// "82bc3e66-c899-4e44-b52f-552145da5ee1",
// "5748afa9-3abe-43ab-bb1f-127c48ced075",
// "5520e710-91ad-41d2-aeb6-434cafbf366b",
// "--task-tag",
// "Ctrl-Q demo",
// "Butler 5.0 demo",

"--output-format",
"table",
"--output-dest",
"file",
"--output-file-name",
// "tasks.xlsx",
// "tasks.csv",
"tasks_all.csv",
// "tasks2.json",
// "tasks2.xlsx",
"--output-file-format",
// "excel",
// "json",
"csv",

// "--output-file-name",
// // "reload-tasks.xlsx",
Expand Down
25 changes: 20 additions & 5 deletions src/lib/cmd/gettask.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,25 @@ const getTask = async (options) => {
taskTable = taskTable.concat([row]);

// Find all triggers for this task
const schemaEventsForThisTask = schemaEventList.filter((item) => item.schemaEvent?.reloadTask?.id === task.taskId);
const compositeEventsForThisTask = compositeEventList.filter(
(item) => item.compositeEvent?.reloadTask?.id === task.taskId
);
const schemaEventsForThisTask = schemaEventList.filter((item) => {
if (item.schemaEvent?.reloadTask?.id === task.taskId) {
return true;
}
if (item.schemaEvent?.externalProgramTask?.id === task.taskId) {
return true;
}
return false;
});

const compositeEventsForThisTask = compositeEventList.filter((item) => {
if (item.compositeEvent?.reloadTask?.id === task.taskId) {
return true;
}
if (item.compositeEvent?.externalProgramTask?.id === task.taskId) {
return true;
}
return false;
});

// Write schema events to table
if (columnBlockShow.schematrigger) {
Expand Down Expand Up @@ -690,7 +705,7 @@ const getTask = async (options) => {
}

if (columnBlockShow.extprogram) {
headerRow = headerRow.concat(['Path', 'Parameters']);
headerRow = headerRow.concat(['Ext program path', 'Ext program parameters']);
}

if (columnBlockShow.lastexecution) {
Expand Down
Loading

0 comments on commit 986beff

Please sign in to comment.