Compare commits
5 Commits
d207efd6dc
...
bc83e37cdd
Author | SHA1 | Date | |
---|---|---|---|
|
bc83e37cdd | ||
|
934854f39f | ||
|
ab125d3f47 | ||
|
434e2d9a1b | ||
|
f6be728c19 |
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -1,3 +1,7 @@
|
||||
[submodule "demo"]
|
||||
path = demo
|
||||
url = https://github.com/GrapesJS/grapesjs
|
||||
branch = gh-pages
|
||||
[submodule "grapesjs"]
|
||||
path = grapesjs
|
||||
url = https://github.com/GrapesJS/grapesjs
|
||||
|
@ -1,18 +1,16 @@
|
||||
FROM node:20-alpine
|
||||
|
||||
# Workdir
|
||||
RUN mkdir /usr/local/app
|
||||
RUN chown 33:33 /usr/local/app
|
||||
WORKDIR /usr/local/app
|
||||
|
||||
ADD entrypoint.sh /usr/local/bin
|
||||
RUN mkdir /usr/lib/json-server
|
||||
#RUN chown 33:33 /usr/lib/json-server
|
||||
WORKDIR /usr/lib/json-server
|
||||
|
||||
# Install modules
|
||||
RUN npm install -g json-server
|
||||
|
||||
USER 33
|
||||
ADD entrypoint.sh /usr/local/bin
|
||||
|
||||
#USER 33
|
||||
|
||||
# Cant kill with ctrl+c
|
||||
#ENTRYPOINT ["/usr/local/bin/json-server", "db.json"]
|
||||
ENTRYPOINT ["entrypoint.sh"]
|
||||
CMD ["json-server", "-H", "0.0.0.0", "db.json"]
|
||||
CMD ["json-server", "-H", "0.0.0.0", "/usr/lib/json-server/db.json"]
|
||||
|
@ -1,3 +1,9 @@
|
||||
#!/bin/sh
|
||||
if [ ! -f db.json ] ; then
|
||||
touch db.json
|
||||
fi
|
||||
if [ ! -s db.json ] ; then
|
||||
echo '{"projects": [ {"id": 1, "data": {"assets": [], "styles": [], "pages": []} } ]}' > db.json
|
||||
fi
|
||||
|
||||
"$@"
|
||||
|
@ -1,3 +0,0 @@
|
||||
.red {
|
||||
color: #f24b4b;
|
||||
}
|
1
demo
Submodule
1
demo
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit cb3f311e10fe182301048ffc28ccd9b20b0435ab
|
2
grapesjs
2
grapesjs
@ -1 +1 @@
|
||||
Subproject commit f8b66a1d7e28b6c156cb7d6c61d2951872e9675f
|
||||
Subproject commit 8893dbe2e79972e5c34806e71075d2e94a4a9e3e
|
1451
index.html
1451
index.html
File diff suppressed because it is too large
Load Diff
33
js/main.js
33
js/main.js
@ -1,33 +0,0 @@
|
||||
import fr from "../grapesjs/src/i18n/locale/fr.js";
|
||||
//const projectID = window.location.hash.substr(1);
|
||||
const projectID = 1;
|
||||
|
||||
if (projectID == '' || isNaN(projectID)) {
|
||||
alert("L’ID de projet est invalide. Cette application ne va pas fonctionner.");
|
||||
} else {
|
||||
const projectEndpoint = `/projects/${projectID}`;
|
||||
var editor = grapesjs.init({
|
||||
container : '#gjs',
|
||||
components: '<div class="red">Le chargement du projet est en cours. Si ce message ne disparait pas, le chargement a sans doutes échoué…</div>',
|
||||
i18n: {
|
||||
locale: 'fr', // default locale
|
||||
detectLocale: false, // by default, the editor will detect the language
|
||||
//localeFallback: 'en', // default fallback
|
||||
messages: {fr},
|
||||
},
|
||||
storageManager: {
|
||||
type: 'remote',
|
||||
stepsBeforeSave: 1,
|
||||
autosave: true,
|
||||
options: {
|
||||
remote: {
|
||||
urlLoad: projectEndpoint,
|
||||
urlStore: projectEndpoint,
|
||||
fetchOptions: opts => (opts.method === 'POST' ? { method: 'PATCH' } : {}),
|
||||
onStore: data => ({ id: projectID, data }),
|
||||
onLoad: result => result.data,
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue
Block a user