eaed7d0ba4
## ✅ Checklist - [X] I have followed every step in the [contributing guide](https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md) - [X] The PR title follows the convention. - [X] I ran and tested the code works --- ## Testing Manually tested each implementation. --- ## Changelog * Updated Logs Page with the new implementation in time filter component * In TRQL editor users can now click on empty/blank spaces in the editor and the cursor will appear * Added CMD + / for line commenting in TRQL * Activated proper undo/redo functionality in CodeMirror (TRQL editor) * Added a check for new logs button, previously once the user got to the end of the logs he could not check for newer logs * Added showing MS in logs page Dates * Removed LOG_INFO internal logs, they are available with Admin Debug flag * Added support for correct timezone render on server side. * Increased CLICKHOUSE_LOGS_LIST_MAX_MEMORY_USAGE to 1GB * Changed Previous run/ Next run to J/K, consistent with previous/next page in Runs list
61 lines
1.5 KiB
TypeScript
61 lines
1.5 KiB
TypeScript
import { closeBrackets } from "@codemirror/autocomplete";
|
|
import { indentWithTab, history, historyKeymap, undo, redo } from "@codemirror/commands";
|
|
import { bracketMatching } from "@codemirror/language";
|
|
import { lintKeymap } from "@codemirror/lint";
|
|
import { highlightSelectionMatches } from "@codemirror/search";
|
|
import { Prec, type Extension } from "@codemirror/state";
|
|
import {
|
|
drawSelection,
|
|
dropCursor,
|
|
highlightActiveLine,
|
|
highlightActiveLineGutter,
|
|
highlightSpecialChars,
|
|
keymap,
|
|
lineNumbers,
|
|
} from "@codemirror/view";
|
|
|
|
export function getEditorSetup(showLineNumbers = true, showHighlights = true): Array<Extension> {
|
|
const options = [
|
|
drawSelection(),
|
|
dropCursor(),
|
|
history(),
|
|
bracketMatching(),
|
|
closeBrackets(),
|
|
Prec.highest(
|
|
keymap.of([
|
|
{
|
|
key: "Mod-Enter",
|
|
run: () => {
|
|
return true;
|
|
},
|
|
preventDefault: false,
|
|
},
|
|
])
|
|
),
|
|
// Explicit undo/redo keybindings with high precedence
|
|
Prec.high(
|
|
keymap.of([
|
|
{ key: "Mod-z", run: undo },
|
|
{ key: "Mod-Shift-z", run: redo },
|
|
{ key: "Mod-y", run: redo },
|
|
])
|
|
),
|
|
keymap.of([indentWithTab, ...historyKeymap, ...lintKeymap]),
|
|
];
|
|
|
|
if (showLineNumbers) {
|
|
options.push(lineNumbers());
|
|
}
|
|
|
|
if (showHighlights) {
|
|
options.push([
|
|
highlightActiveLineGutter(),
|
|
highlightSpecialChars(),
|
|
highlightActiveLine(),
|
|
highlightSelectionMatches(),
|
|
]);
|
|
}
|
|
|
|
return options;
|
|
}
|