Skip to content

Commit

Permalink
1.9.x minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeTWC1984 committed May 7, 2024
1 parent bf24b19 commit 506a543
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 32 deletions.
3 changes: 2 additions & 1 deletion bin/manager.bat
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ if /I "%1"=="--port" (
echo Usage: .\manager [--port port] [ --storage /path/to/storage.json]
echo [ --reset ] # make current host the manager
echo [ --cluster "server1,server2"] # add extra workers on setup
shift
shift
exit
) else (exit)

goto parseArgs
Expand Down
19 changes: 16 additions & 3 deletions bin/storage-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ var storage = new StandaloneStorage(config.Storage, function (err) {
// setup new manager server
var setup = require('../conf/setup.json');

let minimal = (process.env['CRONICLE_setup'] === 'minimal')

// make sure this is only run once
// changing exit code to 0, so it won't break docker entry point
storage.get('global/users', async function (err) {
Expand All @@ -230,18 +232,29 @@ var storage = new StandaloneStorage(config.Storage, function (err) {
var func = params.shift();
params.push(callback);

let obj = {}

// massage a few params
if (typeof (params[1]) == 'object') {
var obj = params[1];
obj = params[1];
if (obj.created) obj.created = Tools.timeNow(true);
if (obj.modified) obj.modified = Tools.timeNow(true);
if (obj.regexp && (obj.regexp == '_HOSTNAME_')) obj.regexp = '^(' + Tools.escapeRegExp(hostname) + ')$';
if (obj.hostname && (obj.hostname == '_HOSTNAME_')) obj.hostname = hostname;
if (obj.ip && (obj.ip == '_IP_')) obj.ip = ip;
//if (obj.optional) { verbose("skipping " + params[0]); return callback(); }
}


if(minimal && obj.optional) {
// skip optional objects
callback()
}
else {
// call storage directly
storage[func].apply(storage, params);
}

// call storage directly
storage[func].apply(storage, params);
},
function (err) {
if (err) throw err;
Expand Down
2 changes: 1 addition & 1 deletion bundle
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ else
fi

if [ "$oracle" = 1 ]; then
sqlDrivers+=("oracledb")
sqlDrivers+=("oracledb@6.5.0")
else
sqlArgs+=("--external:oracledb")
fi
Expand Down
2 changes: 1 addition & 1 deletion bundle.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ if($SQL) { $Oracle = $MSSQL = $Mysql = $Pgsql = $true }

$Mysql ? $sqlDrivers.Add("mysql2"): $sqlArgs.Add("--external:mysql2") | Out-Null
$Pgsql ? $sqlDrivers.AddRange(@("pg", "pg-query-stream")) : $sqlArgs.AddRange(@("--external:pg", "--external:pg-query-stream")) | Out-Null
$Oracle ? $sqlDrivers.Add("oracledb") : $sqlArgs.Add("--external:oracledb") | Out-Null
$Oracle ? $sqlDrivers.Add("oracledb@6.5.0") : $sqlArgs.Add("--external:oracledb") | Out-Null
$MSSQL ? $sqlDrivers.Add("tedious") : $sqlArgs.Add("--external:tedious") | Out-Null
$Sqlite ? $sqlDrivers.Add("sqlite3") : $sqlArgs.Add("--external:sqlite3") | Out-Null

Expand Down
2 changes: 1 addition & 1 deletion engines/SQLExamples/DDL.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CREATE TABLE cronicle (
)

------- oracle
CREATE TABLE cronicle5 (
CREATE TABLE cronicle (
K varchar(256) PRIMARY KEY,
V blob,
created timestamp DEFAULT CURRENT_TIMESTAMP,
Expand Down
27 changes: 16 additions & 11 deletions htdocs/js/pages/Schedule.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -908,9 +908,16 @@ Class.subclass(Page.Base, "Page.Schedule", {

let niceTiming = summarize_event_timing(item.timing, item.timezone, (inactiveTitle || isGrid) ? null : item.ticks)

let gridTiming = niceTiming.length > 20 ? summarize_event_timing_short(item.timing) : niceTiming
let gridTimingTitle = niceTiming;

if (inactiveTitle) {
gridTiming = `<s>${gridTiming}</s>`
gridTimingTitle = `${inactiveTitle}<br><s>${niceTiming}</s>`
niceTiming = `<span title="${inactiveTitle}"><s>${niceTiming}</s>`
if (item.ticks) niceTiming += `<span title="Extra Ticks: ${item.ticks}"> <b>+</b> </>`
if (item.ticks) niceTiming += `<span title="Extra Ticks: ${item.ticks}"> <b>+</b> </>`


}

let now = Date.now() / 1000
Expand All @@ -921,7 +928,7 @@ Class.subclass(Page.Base, "Page.Schedule", {
self.getNiceCategory(cat, col_width),
self.getNicePlugin(plugin, col_width),
self.getNiceGroup(group, item.target, col_width),
niceTiming + (isGrid ? '' : chainInfo),
niceTiming + chainInfo,
'<span id="ss_' + item.id + '" onMouseUp="$P().jump_to_last_job(' + idx + ')">' + status_html + '</span>',
get_text_from_seconds(now - item.modified, true, true), //modified
actions.join('&nbsp;|&nbsp;')
Expand Down Expand Up @@ -978,18 +985,16 @@ Class.subclass(Page.Base, "Page.Schedule", {
} // group_by


let timingTitle = niceTiming;
let timing = niceTiming.length > 20 ? summarize_event_timing_short(item.timing) : tds[5]


// timing title in grid view

if(item.ticks) {
timingTitle += `<br><br>Extra ticks: ${item.ticks}`
timing += "+"
gridTimingTitle += `<br><br>Extra ticks: ${item.ticks}`
gridTiming += "+"
}

if(app.chained_jobs[item.id]) {
timingTitle += ('<br><br>' + app.chained_jobs[item.id])
timing += "<";
gridTimingTitle += ('<br><br>' + app.chained_jobs[item.id])
gridTiming += "<";
}

let lastStatus = 'event-none'
Expand All @@ -1016,7 +1021,7 @@ Class.subclass(Page.Base, "Page.Schedule", {
<div class="flex-container">
<div style="padding-left:5px">${actions.join(' | ')}</div>
<div style="text-overflow:ellipsis;overflow:hidden;white-space: nowrap;">
<span title="${timingTitle}" style="overflow:hidden;text-overflow: ellipsis;white-space:nowrap">${timing}</span>
<span title="${gridTimingTitle}" style="overflow:hidden;text-overflow: ellipsis;white-space:nowrap">${gridTiming}</span>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cronicle-edge",
"version": "1.9.2",
"version": "1.9.3",
"description": "A simple, distributed task scheduler and runner with a web based UI.",
"author": "Joseph Huckaby <[email protected]>",
"homepage": "https://github.com/jhuckaby/Cronicle",
Expand Down
33 changes: 22 additions & 11 deletions sample_conf/setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@
"created": 1434125333,
"params": [
{ "id":"prefix", "type":"text", "size":20, "title":"Env Prefix", "value": "JOB_" }
]
],
"optional": true
} ],

[ "listPush", "global/plugins", {
Expand Down Expand Up @@ -280,37 +281,43 @@
"id": "base_app_url",
"title": "base_app_url",
"key": "http://localhost:3012",
"description": "overrides app url displayed in notifications"
"description": "overrides app url displayed in notifications",
"optional": true
}],
[ "listPush", "global/conf_keys", {
"id": "ad_domain",
"title": "ad_domain",
"key": "corp.cronicle.com",
"description": "default AD domain for external auth. You can also prepend domain to the username (e.g. [email protected])"
"description": "default AD domain for external auth. You can also prepend domain to the username (e.g. [email protected])",
"optional": true
}],
[ "listPush", "global/conf_keys", {
"id": "smtp_hostname",
"title": "smtp_hostname",
"key": "mailrelay.cronicle.com",
"description": "SMTP server (port 25 is used default)"
"description": "SMTP server (port 25 is used default)",
"optional": true
}],
[ "listPush", "global/conf_keys", {
"id": "email_from",
"title": "email_from",
"key": "[email protected]",
"description": "Notification sender"
"description": "Notification sender",
"optional": true
}],
[ "listPush", "global/conf_keys", {
"id": "admin_web_hook",
"title": "admin_web_hook",
"key": "",
"description": "Webhook for activity log notifications. Uses slack markdown.\nTip: use cronicle run api to handle notification with custom event"
"description": "Webhook for activity log notifications. Uses slack markdown.\nTip: use cronicle run api to handle notification with custom event",
"optional": true
}],
[ "listPush", "global/conf_keys", {
"id": "custom_live_log_socket_url",
"title": "custom_live_log_socket_url",
"key": "http://localhost:3012",
"description": "!this requires browser page refresh\noverrides the host for live log connection. On multinode cluster this can be assigned to each node, e.g. \ncustom_live_log_socket_url.manager\ncustom_live_log_socket_url.worker1\nCan specify custom port too. This is useful if using reverse proxy or docker/swarm"
"description": "!this requires browser page refresh\noverrides the host for live log connection. On multinode cluster this can be assigned to each node, e.g. \ncustom_live_log_socket_url.manager\ncustom_live_log_socket_url.worker1\nCan specify custom port too. This is useful if using reverse proxy or docker/swarm",
"optional": true
}]

,[ "listPush", "global/conf_keys", {
Expand Down Expand Up @@ -388,29 +395,33 @@
"id": "oninfo_web_hook",
"title": "oninfo_web_hook",
"key": "",
"description": "Special webhook - will fire on info message, e.g. server startup/restart/error. Those messages appear on activity log"
"description": "Special webhook - will fire on info message, e.g. server startup/restart/error. Those messages appear on activity log",
"optional": true
}]

,[ "listPush", "global/conf_keys", {
"id": "universal_web_hook",
"title": "universal_web_hook",
"key": "",
"description": "Special webhook - will fire on each job start/completion"
"description": "Special webhook - will fire on each job start/completion",
"optional": true
}]

,[ "listPush", "global/conf_keys", {
"id": "onupdate_web_hook",
"title": "onupdate_web_hook",
"key": "",
"description": "Special webhook - will fire on metadata update (e.g. on event update)"
"description": "Special webhook - will fire on metadata update (e.g. on event update)",
"optional": true
}]

,[ "listPush", "global/conf_keys", {
"id": "ui_live_log_ws",
"title": "ui.live_log_ws",
"type": "bool",
"key": false,
"description": "Turns on classic websocket api for live log"
"description": "Turns on classic websocket api for live log",
"optional": true
}]

,[ "listPush", "global/conf_keys", {
Expand Down

0 comments on commit 506a543

Please sign in to comment.