clocktopus 1.6.12 → 1.6.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,6 +9,15 @@ const SCRIPT_PATH = path.resolve(__dirname, '../../index.js');
|
|
|
9
9
|
const isDev = SCRIPT_PATH.includes('/Projects/') || SCRIPT_PATH.includes('/src/');
|
|
10
10
|
const PM2_NAME = isDev ? 'clocktopus-monitor-dev' : 'clocktopus-monitor';
|
|
11
11
|
const pm2Bin = path.join(path.dirname(createRequire(import.meta.url).resolve('pm2')), 'bin', 'pm2');
|
|
12
|
+
const bunBin = (() => {
|
|
13
|
+
try {
|
|
14
|
+
return execSync('which bun', { encoding: 'utf-8' }).trim();
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return 'bun';
|
|
18
|
+
}
|
|
19
|
+
})();
|
|
20
|
+
const pm2Cmd = `${bunBin} ${pm2Bin}`;
|
|
12
21
|
const monitorRoutes = new Hono();
|
|
13
22
|
function pm2Exec(command) {
|
|
14
23
|
try {
|
|
@@ -22,7 +31,7 @@ function pm2Exec(command) {
|
|
|
22
31
|
}
|
|
23
32
|
monitorRoutes.get('/monitor/status', (c) => {
|
|
24
33
|
try {
|
|
25
|
-
const output = execSync(`${
|
|
34
|
+
const output = execSync(`${pm2Cmd} jlist`, { encoding: 'utf-8', timeout: 10000 });
|
|
26
35
|
const processes = JSON.parse(output);
|
|
27
36
|
const proc = processes.find((p) => p.name === PM2_NAME);
|
|
28
37
|
if (!proc) {
|
|
@@ -43,18 +52,18 @@ monitorRoutes.post('/monitor/start', (c) => {
|
|
|
43
52
|
const bunPath = execSync('which bun', { encoding: 'utf-8' }).trim();
|
|
44
53
|
// Delete any existing process to avoid duplicates
|
|
45
54
|
try {
|
|
46
|
-
execSync(`${
|
|
55
|
+
execSync(`${pm2Cmd} delete ${PM2_NAME}`, { stdio: 'ignore' });
|
|
47
56
|
}
|
|
48
57
|
catch { }
|
|
49
|
-
const result = pm2Exec(`${
|
|
58
|
+
const result = pm2Exec(`${pm2Cmd} start ${SCRIPT_PATH} --name ${PM2_NAME} --interpreter ${bunPath} -- monitor:run`);
|
|
50
59
|
return c.json(result);
|
|
51
60
|
});
|
|
52
61
|
monitorRoutes.post('/monitor/stop', (c) => {
|
|
53
|
-
const result = pm2Exec(`${
|
|
62
|
+
const result = pm2Exec(`${pm2Cmd} stop ${PM2_NAME}`);
|
|
54
63
|
return c.json(result);
|
|
55
64
|
});
|
|
56
65
|
monitorRoutes.post('/monitor/restart', (c) => {
|
|
57
|
-
const result = pm2Exec(`${
|
|
66
|
+
const result = pm2Exec(`${pm2Cmd} restart ${PM2_NAME}`);
|
|
58
67
|
return c.json(result);
|
|
59
68
|
});
|
|
60
69
|
export default monitorRoutes;
|
package/dist/dashboard/views.js
CHANGED
|
@@ -883,13 +883,8 @@ export function indexPage() {
|
|
|
883
883
|
duration = '<span class="in-progress">In progress</span>';
|
|
884
884
|
}
|
|
885
885
|
const jira = s.jiraTicket || '-';
|
|
886
|
-
const canDelete = !!s.completedAt && !(s.jiraTicket && !s.jiraWorklogId);
|
|
887
|
-
const disabledAttr = canDelete ? '' : ' disabled';
|
|
888
|
-
const btnTitle = canDelete
|
|
889
|
-
? 'Delete entry'
|
|
890
|
-
: 'Cannot delete: Jira worklog id not tracked for this entry';
|
|
891
886
|
const deleteBtn = s.completedAt
|
|
892
|
-
? '<button class="delete-btn" title="
|
|
887
|
+
? '<button class="delete-btn" title="Delete entry" data-delete-id="' + escapeHtml(s.id) + '">×</button>'
|
|
893
888
|
: '';
|
|
894
889
|
return '<tr>' +
|
|
895
890
|
'<td>' + escapeHtml(s.description) + '</td>' +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clocktopus",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.14",
|
|
4
4
|
"description": "Time-tracking automation for Clockify with idle monitoring, Jira integration, Google Calendar sync, CLI, web dashboard, and desktop app.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|