Skip to content

Commit 70dd528

Browse files
authored
Merge pull request #90 from fccview/develop
2.2.0
2 parents 6a127fc + 1d845b5 commit 70dd528

File tree

4 files changed

+142
-128
lines changed

4 files changed

+142
-128
lines changed

app/_utils/line-manipulation-utils.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,19 @@ export const parseJobsFromLines = (
316316
const nextLine = lines[i + 1].trim();
317317
if (nextLine.startsWith("# ")) {
318318
const commentedCron = nextLine.substring(2);
319-
const parts = commentedCron.split(/\s+/);
320-
if (parts.length >= 6) {
321-
const schedule = parts.slice(0, 5).join(" ");
322-
const command = parts.slice(5).join(" ");
319+
const parts = commentedCron.split(/(?:\s|\t)+/);
320+
let schedule: string | undefined;
321+
let command: string | undefined;
322+
323+
if (parts[0].startsWith("@") && parts.length >= 2) {
324+
schedule = parts[0];
325+
command = commentedCron.slice(commentedCron.indexOf(parts[1]));
326+
} else if (parts.length >= 6) {
327+
schedule = parts.slice(0, 5).join(" ");
328+
command = commentedCron.slice(commentedCron.indexOf(parts[5]));
329+
}
323330

331+
if (schedule && command) {
324332
const jobId =
325333
uuid || generateStableJobId(schedule, command, user, comment, i);
326334

package.json

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cronjob-manager",
3-
"version": "2.1.0",
3+
"version": "2.2.0",
44
"private": true,
55
"scripts": {
66
"dev": "next dev",
@@ -36,8 +36,8 @@
3636
"cronstrue": "^3.2.0",
3737
"fflate": "^0.8.2",
3838
"jose": "^6.1.1",
39-
"minimatch": "^10.0.3",
40-
"next": "16.1.6",
39+
"minimatch": "^10.2.3",
40+
"next": "16.2.1",
4141
"next-intl": "^4.4.0",
4242
"next-themes": "^0.2.1",
4343
"postcss": "^8",
@@ -46,7 +46,7 @@
4646
"react-dom": "19.2.4",
4747
"react-syntax-highlighter": "^15.6.1",
4848
"serwist": "^9.5.5",
49-
"systeminformation": "^5.27.14",
49+
"systeminformation": "^5.31.0",
5050
"tailwind-merge": "^2.0.0",
5151
"tailwindcss": "^3.3.0",
5252
"typescript": "^5"
@@ -56,15 +56,22 @@
5656
"@types/bcryptjs": "^2.4.6",
5757
"@types/minimatch": "^6.0.0",
5858
"eslint": "^9",
59-
"eslint-config-next": "16.1.6",
59+
"eslint-config-next": "16.2.1",
6060
"postcss-import": "^16.1.1"
6161
},
6262
"resolutions": {
6363
"@isaacs/brace-expansion": "^5.0.1",
64+
"eslint/minimatch": "^3.1.3",
65+
"@eslint/config-array/minimatch": "^3.1.3",
66+
"@eslint/eslintrc/minimatch": "^3.1.3",
67+
"eslint-plugin-import/minimatch": "^3.1.3",
68+
"eslint-plugin-jsx-a11y/minimatch": "^3.1.3",
6469
"@types/react": "19.2.14",
6570
"@types/react-dom": "19.2.3",
6671
"lodash": "^4.17.23",
6772
"prismjs": "^1.30.0",
68-
"systeminformation": "^5.27.14"
73+
"systeminformation": "^5.31.0",
74+
"ajv": "^6.14.0",
75+
"flatted": "^3.4.2"
6976
}
7077
}

proxy.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ export const proxy = async (request: NextRequest) => {
9999
}
100100
} catch (error) {
101101
console.error("Session check error:", error);
102+
return NextResponse.redirect(loginUrl);
102103
}
103104

104105
const response = NextResponse.next();

0 commit comments

Comments
 (0)