From c9aa59643fbe8d522dcc611bfecdd6aa962da0ec Mon Sep 17 00:00:00 2001 From: mikeTWC1984 Date: Wed, 6 Mar 2024 00:00:13 -0500 Subject: [PATCH] small fixes --- bin/sshx-plugin.js | 9 +++++++-- htdocs/js/pages/JobDetails.class.js | 2 +- htdocs/js/pages/Schedule.class.js | 2 +- lib/api/event.js | 2 +- package-lock.json | 4 ++-- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/bin/sshx-plugin.js b/bin/sshx-plugin.js index 2b6c235..d991f0d 100644 --- a/bin/sshx-plugin.js +++ b/bin/sshx-plugin.js @@ -108,9 +108,14 @@ if(uri.password) conf.password = decodeURIComponent(uri.password) if (uri.searchParams.get('privateKey')) conf.privateKey = readFileSync(String(uri.searchParams.get('privateKey'))) if (uri.searchParams.get('passphrase')) conf.passphrase = uri.searchParams.get('passphrase') +if (!conf.password && !conf.privateKey ) { + printComplete(1, 1, "No password or key specified. Use SSH_PASSWORD/SSH_KEY env vars, or set via URI (ssh://user:[pass]@host?privateKey=/path/to/key") + process.exit(1) +} + try { conn.on('error', (err) => { // handle configuration errors - stream.write({ + printJson({ complete: 1, code: 1, description: err.message @@ -177,7 +182,7 @@ try { }).connect(conf) } catch (err) { - stream.write({ + printJson({ complete: 1, code: 1, description: err.message diff --git a/htdocs/js/pages/JobDetails.class.js b/htdocs/js/pages/JobDetails.class.js index 13fe9f6..0774810 100644 --- a/htdocs/js/pages/JobDetails.class.js +++ b/htdocs/js/pages/JobDetails.class.js @@ -208,8 +208,8 @@ Class.subclass(Page.Base, "Page.JobDetails", { html += '
'; html += 'Completed Job'; - if(event.id) html += `` if (event.id && !event.multiplex) html += '
 Run Again
'; + if (event.id) html += ``; //adding edit button on job detail page if (event.id) html += ''; if (app.isAdmin()) html += '
 Delete Job
'; diff --git a/htdocs/js/pages/Schedule.class.js b/htdocs/js/pages/Schedule.class.js index 8747acd..68a8166 100644 --- a/htdocs/js/pages/Schedule.class.js +++ b/htdocs/js/pages/Schedule.class.js @@ -1752,7 +1752,7 @@ Class.subclass(Page.Base, "Page.Schedule", { // Secret let sph = event.secret_preview ? '[' + event.secret_preview + ']' : ''; - html += get_form_table_row('Secret', ``); + html += get_form_table_row('Secret', ``); html += get_form_table_caption("Specify KEY=VALUE pairs to be mounted as env variables (to this job process)"); html += get_form_table_spacer(); diff --git a/lib/api/event.js b/lib/api/event.js index 98feea1..e4660ac 100644 --- a/lib/api/event.js +++ b/lib/api/event.js @@ -657,7 +657,7 @@ module.exports = Class.create({ let total = 0 let max = params.max || 0 let jobs = [] - let filter = { has_error: false } + let filter = { } if(params.id) filter.event = params.id if(params.arg) filter.arg = params.arg if(params.error) filter.has_error = true // delete filter.has_error diff --git a/package-lock.json b/package-lock.json index 3c12a1f..9924abc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cronicle-edge", - "version": "1.7.7", + "version": "1.8.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cronicle-edge", - "version": "1.7.7", + "version": "1.8.0", "license": "MIT", "dependencies": { "@iarna/toml": "^2.2.5",