Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
f43b545b
"...git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "c9c82173068d628b0569ccb6d656adfa37a389e8"
Commit
f43b545b
authored
Jun 10, 2024
by
Timothy J. Baek
Browse files
refac
parent
12a04b11
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
src/lib/components/common/CodeEditor.svelte
src/lib/components/common/CodeEditor.svelte
+5
-1
src/lib/components/workspace/Tools/CodeEditor.svelte
src/lib/components/workspace/Tools/CodeEditor.svelte
+2
-0
No files found.
src/lib/components/common/CodeEditor.svelte
View file @
f43b545b
...
@@ -37,6 +37,8 @@
...
@@ -37,6 +37,8 @@
codeEditor.dispatch({
codeEditor.dispatch({
changes: [{ from: 0, to: codeEditor.state.doc.length, insert: formattedCode }]
changes: [{ from: 0, to: codeEditor.state.doc.length, insert: formattedCode }]
});
});
toast.success('Code formatted successfully');
return true;
return true;
}
}
...
@@ -59,13 +61,15 @@
...
@@ -59,13 +61,15 @@
];
];
onMount(() => {
onMount(() => {
value = boilerplate;
// Check if html class has dark mode
// Check if html class has dark mode
isDarkMode = document.documentElement.classList.contains('dark');
isDarkMode = document.documentElement.classList.contains('dark');
// python code editor, highlight python code
// python code editor, highlight python code
codeEditor = new EditorView({
codeEditor = new EditorView({
state: EditorState.create({
state: EditorState.create({
doc:
boilerplat
e,
doc:
valu
e,
extensions: extensions
extensions: extensions
}),
}),
parent: document.getElementById('code-textarea')
parent: document.getElementById('code-textarea')
...
...
src/lib/components/workspace/Tools/CodeEditor.svelte
View file @
f43b545b
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
from datetime import datetime
from datetime import datetime
import requests
import requests
class Tools:
class Tools:
def __init__(self):
def __init__(self):
pass
pass
...
@@ -40,6 +41,7 @@ class Tools:
...
@@ -40,6 +41,7 @@ class Tools:
except Exception as e:
except Exception as e:
print(e)
print(e)
return "Invalid equation"
return "Invalid equation"
`;
`;
</script>
</script>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment