Skip to content

Commit

Permalink
Merge pull request #365 from KxSystems/KXI-47762
Browse files Browse the repository at this point in the history
add logs for populate scratchpad
  • Loading branch information
Philip-Carneiro-KX authored Jun 25, 2024
2 parents 812935e + 04574ab commit 8e2437b
Showing 1 changed file with 26 additions and 20 deletions.
46 changes: 26 additions & 20 deletions src/classes/insightsConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,23 +143,24 @@ export class InsightsConnection {
public defineEndpoints() {
if (this.insightsVersion) {
switch (this.insightsVersion) {
case "1.11":
this.connEndpoints = {
scratchpad: {
scratchpad: "scratchpad-manager/api/v1/execute/display",
import: "scratchpad-manager/api/v1/execute/import/data",
importSql: "scratchpad-manager/api/v1/execute/import/sql",
importQsql: "scratchpad-manager/api/v1/execute/import/qsql",
reset: "scratchpad-manager/api/v1/execute/reset",
},
serviceGateway: {
meta: "servicegateway/meta",
data: "servicegateway/data",
sql: "servicegateway/qe/sql",
qsql: "servicegateway/qe/qsql",
},
};
break;
// uncomment it when SCRATCHPAD merge to Insights
// case "1.11":
// this.connEndpoints = {
// scratchpad: {
// scratchpad: "scratchpad-manager/api/v1/execute/display",
// import: "scratchpad-manager/api/v1/execute/import/data",
// importSql: "scratchpad-manager/api/v1/execute/import/sql",
// importQsql: "scratchpad-manager/api/v1/execute/import/qsql",
// reset: "scratchpad-manager/api/v1/execute/reset",
// },
// serviceGateway: {
// meta: "servicegateway/meta",
// data: "servicegateway/data",
// sql: "servicegateway/qe/sql",
// qsql: "servicegateway/qe/qsql",
// },
// };
// break;
default:
this.connEndpoints = {
scratchpad: {
Expand Down Expand Up @@ -358,9 +359,14 @@ export class InsightsConnection {
`Executed successfully, stored in ${variableName}.`,
"INFO",
);

kdbOutputLog("[SCRATCHPAD] Data:", "INFO");
kdbOutputLog(JSON.stringify(scratchpadResponse.data), "INFO");
kdbOutputLog(
`[SCRATCHPAD] Status: ${scratchpadResponse.status}`,
"INFO",
);
kdbOutputLog(
`[SCRATCHPAD] Populated scratchpad with the following params: ${JSON.stringify(body.params)}`,
"INFO",
);
window.showInformationMessage(
`Executed successfully, stored in ${variableName}.`,
);
Expand Down

0 comments on commit 8e2437b

Please sign in to comment.