Skip to content

Commit

Permalink
update excalidraw
Browse files Browse the repository at this point in the history
  • Loading branch information
springhack committed Jan 9, 2025
1 parent 1c7c3e1 commit 2bf18a8
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 24 deletions.
14 changes: 9 additions & 5 deletions excalidraw/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
FROM germanorizzo/ws4sqlite
ADD . /excalidraw
WORKDIR /excalidraw
ENTRYPOINT ["/ws4sqlite"]
CMD ["-db", "/excalidraw/storage.db", "-serve-dir", "/excalidraw/www"]
FROM germanorizzo/ws4sqlite AS ws4sqlite

FROM alpine
ADD init /init
ADD www /excalidraw/www
ADD storage.yaml /excalidraw/storage/storage.yaml
COPY --from=ws4sqlite /ws4sqlite /ws4sqlite
ENTRYPOINT ["/bin/sh", "/init"]
CMD ["-db", "/excalidraw/storage/storage.db", "-serve-dir", "/excalidraw/www"]
12 changes: 12 additions & 0 deletions excalidraw/init
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

if [ ! -e /excalidraw/storage/storage.yaml ];
then
cat > /excalidraw/storage/storage.yaml <<EOF
initStatements:
- CREATE TABLE storage (id TEXT PRIMARY KEY, time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, name TEXT, data TEXT)
- CREATE INDEX idx_time ON storage(time);
EOF
fi

exec /ws4sqlite $@
6 changes: 0 additions & 6 deletions excalidraw/www/bootstrap.min.css

This file was deleted.

File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions excalidraw/www/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
<script src="vendor/react.production.min.js"></script>
<script src="vendor/react-dom.production.min.js"></script>
<script src="vendor/excalidraw.production.min.js"></script>
<link rel="stylesheet" href="editor.css" />
<link rel="stylesheet" href="css/editor.css" />
</head>
<body>
<div id="app"></div>
</body>
<script src="common.js"></script>
<script src="editor.js"></script>
<script src="js/common.js"></script>
<script src="js/editor.js"></script>
</html>
File renamed without changes
File renamed without changes
File renamed without changes
6 changes: 3 additions & 3 deletions excalidraw/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
<script src="vendor/react-dom.production.min.js"></script>
<script src="vendor/react-bootstrap.min.js"></script>
<link rel="stylesheet" href="vendor/bootstrap.min.css" />
<link rel="stylesheet" href="index.css" />
<link rel="stylesheet" href="css/index.css" />
</head>
<body>
<div id="app"></div>
</body>
<script src="common.js"></script>
<script src="index.js"></script>
<script src="js/common.js"></script>
<script src="js/index.js"></script>
</html>
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions excalidraw/www/index.js → excalidraw/www/js/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Author: SpringHack - springhack@live.cn
* Last modified: 2025-01-08 17:04:00
* Filename: index.js
* Last modified: 2025-01-09 10:33:01
* Filename: js/index.js
* Description: Created by SpringHack using vim automatically.
*/
const { createRoot } = ReactDOM;
Expand Down Expand Up @@ -66,9 +66,9 @@ const Nav = () => {
createElement('div', { className: 'l-group' }, [
...list.map((item) => {
return createElement('div', { className: 'l-group-item', onClick: openEditor.bind(null, item.id) }, [
createElement('img', { src: 'doc.svg' }),
createElement('img', { src: 'img/doc.svg' }),
createElement('div', { className: 'list-title' }, item.name),
createElement('img', { className: 'list-remove', src: 'del.svg', onClick: removeDocument.bind(null, item.id) })
createElement('img', { className: 'list-remove', src: 'img/del.svg', onClick: removeDocument.bind(null, item.id) })
])
})
]),
Expand Down Expand Up @@ -97,7 +97,7 @@ const Search = () => {
});
}, [keyword]);
return createElement('div', { className: 'search-box', onClick: () => setOpen(true) }, [
createElement('img', { src: 'search.svg', className: 'search-title' }),
createElement('img', { src: 'img/search.svg', className: 'search-title' }),
createElement(Modal, { show: open, onHide: () => setOpen(false) }, [
createElement(Modal.Header, {}, [
createElement(Form.Control, { id: 'search-input', type: 'text', muted: true, onChange })
Expand Down
2 changes: 0 additions & 2 deletions excalidraw/www/react-bootstrap.min.js

This file was deleted.

0 comments on commit 2bf18a8

Please sign in to comment.