@silexlabs/silex-dashboard 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eleventy.js +11 -0
- package/.github/workflows/npm-publish.yml +20 -0
- package/.silex/default/.silex.data.json +1 -0
- package/.silex/default/assets/alex-small.jpg +0 -0
- package/.silex/default/assets/silex-icon-2018@200px.png +0 -0
- package/README.md +23 -0
- package/_data/api-translations.json +22 -0
- package/_data/languages.json +7 -0
- package/_data/site.js +3 -0
- package/_includes/alternate.liquid +9 -0
- package/_includes/main.html +1 -0
- package/_includes/website-list.js.html +172 -0
- package/_site/README/index.html +12 -0
- package/_site/assets/alex-small.jpg +0 -0
- package/_site/assets/silex-dashboard.png +0 -0
- package/_site/assets/silex-icon-2018@200px.png +0 -0
- package/_site/css/main.css +1 -0
- package/_site/en/index.html +176 -0
- package/_site/fr/index.html +177 -0
- package/assets/alex-small.jpg +0 -0
- package/assets/silex-dashboard.png +0 -0
- package/assets/silex-icon-2018@200px.png +0 -0
- package/css/main.css.liquid +4 -0
- package/package.json +29 -0
- package/pages/en/index.md +32 -0
- package/pages/fr/index.md +32 -0
- package/pages/main.css.liquid +4 -0
- package/pages/pages.11tydata.js +5 -0
package/.eleventy.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: Publish on npm
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
tags:
|
|
5
|
+
- '*'
|
|
6
|
+
jobs:
|
|
7
|
+
build:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
steps:
|
|
10
|
+
- uses: actions/checkout@v2
|
|
11
|
+
# Setup .npmrc file to publish to npm
|
|
12
|
+
- uses: actions/setup-node@v1
|
|
13
|
+
with:
|
|
14
|
+
node-version: '18.x'
|
|
15
|
+
registry-url: 'https://registry.npmjs.org'
|
|
16
|
+
- run: npm install
|
|
17
|
+
- run: npm run build
|
|
18
|
+
- run: npm publish --access public
|
|
19
|
+
env:
|
|
20
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"assets":[{"type":"image","src":"assets/alex-small.jpg","unitDim":"px","height":0,"width":0},{"type":"image","src":"assets/silex-icon-2018@200px.png","unitDim":"px","height":0,"width":0}],"pages":[{"frames":[{"component":{"type":"wrapper","classes":["body","loading"],"attributes":{"id":"ik0i"},"components":[{"tagName":"HEADER","type":"container","classes":[{"name":"header","active":false},{"name":"padding-normal","active":false}],"attributes":{"id":"igrg"},"components":[{"type":"image","attributes":{"id":"ir7s","src":"assets/silex-icon-2018@200px.png"},"custom-name":"logo"},{"tagName":"NAV","type":"container","classes":["nav"],"attributes":{"id":"i9jq"},"components":[{"tagName":"A","type":"text","classes":[{"name":"nav__item","active":false}],"attributes":{"id":"iels","href":"{{ item.url }}"},"components":[{"type":"textnode","content":"Sites"}],"template":{"before":"{% for item in nav %}","replace":"{{ item.label }}","after":"{% endfor %}","attributes":"target=\"{{ item.target }}\"","classname":"{% if forloop.index == 1 %}active{% endif %}","style":""},"originalTagName":"div"}],"custom-name":"Nav"},{"type":"container","classes":["lang",{"name":"h-space","active":false}],"attributes":{"id":"i2red7"},"components":[{"tagName":"A","type":"text","classes":["lang__item",{"name":"nav__item","active":false}],"attributes":{"href":"/{{ link.code }}","id":"iciz"},"components":[{"type":"textnode","content":"en"}],"template":{"before":"{% assign links = languages %}\n{%- for link in links %}","replace":"{{ link.code }}","after":"{% endfor %}","attributes":"hreflang=\"{{link.code}}\"","classname":"{% if link.code == lang %}active{% endif %}","style":""},"originalTagName":"div"}],"custom-name":"Lang"},{"type":"container","attributes":{"id":"i24ew"},"custom-name":"User","components":[{"type":"image","attributes":{"id":"idkdk","src":"assets/alex-small.jpg"},"template":{"before":"","replace":"","after":"","attributes":"src=\"${json.avatar.url}\"","classname":"","style":""}}]}],"custom-name":"Header"},{"tagName":"MAIN","type":"container","classes":[{"name":"padding-normal","active":false},"section"],"attributes":{"id":"iz63r"},"components":[{"tagName":"H1","type":"text","attributes":{"id":"itp1f"},"components":[{"type":"textnode","content":"Welcome back!"},{"tagName":"br","void":true}],"template":{"before":"","replace":"{{ title2 }}","after":"","attributes":"","classname":"","style":""}},{"type":"text","classes":["subtitle",{"name":"color--light","active":false}],"attributes":{"id":"iyex8"},"components":[{"type":"textnode","content":"Dive into your projects or kickstart a new one"}],"template":{"before":"","replace":"{{ subtitle }}","after":"","attributes":"","classname":"","style":""}},{"type":"container","classes":[{"name":"button-bar","active":false},"margin-20"],"attributes":{"id":"ickx4"},"components":[{"type":"text","classes":[{"name":"button","active":false},{"name":"button--primary","active":false},{"name":"rounded","active":false},"top-space-40"],"attributes":{"id":"i2x0l"},"components":[{"tagName":"span","type":"text","classes":["icon-font"],"attributes":{"id":"ibsgw"},"components":[{"type":"textnode","content":"+"}]},{"type":"textnode","content":" "},{"tagName":"span","type":"text","attributes":{"id":"itl2n8"},"components":[{"type":"textnode","content":"Create website"}],"template":{"before":"","replace":"{{ add-button }}","after":"","attributes":"","classname":"","style":""}}],"template":{"before":"","replace":"","after":"","attributes":"@click=\"showCreationForm = !showCreationForm\" v-if=\"!showCreationForm\"","classname":"","style":""}},{"type":"text","classes":[{"name":"button","active":false},"button--secondary",{"name":"rounded","active":false}],"attributes":{"id":"i0ro3"},"components":[{"type":"textnode","content":"Import"}]}]},{"type":"container","classes":[{"name":"box","active":false},"top-space-40"],"attributes":{"id":"ihwwxz"},"components":[{"tagName":"H3","type":"text","classes":["box__header"],"attributes":{"id":"i3gd1b"},"components":[{"type":"textnode","content":"Create a new website"}],"template":{"before":"","replace":"{{ add-title }}","after":"","attributes":"","classname":"","style":""}},{"type":"form","classes":["form"],"attributes":{"method":"get","id":"i50acf"},"components":[{"classes":[{"name":"v-space","active":false}],"attributes":{"id":"igtg1t"},"components":[{"type":"label","classes":[{"name":"v-space","active":false}],"attributes":{"id":"i1nmbc"},"components":[{"type":"textnode","content":"Website name"}],"template":{"before":"","replace":"{{ add-name-label }}","after":"","attributes":"","classname":"","style":""}},{"type":"input","void":true,"classes":["input",{"name":"full-width","active":false}],"attributes":{"type":"text","id":"ij5iwh","placeholder":"{{ add-name-placeholder }}"},"template":{"before":"","replace":"","after":"","attributes":"v-model=\"newWebsiteName\"","classname":"","style":""}}]},{"attributes":{"id":"ie0xes"},"components":[{"type":"button","classes":[{"name":"button","active":false},{"name":"rounded","active":false},{"name":"button--primary","active":false},"right-space"],"attributes":{"type":"submit","id":"i021na"},"text":"Create","components":[{"type":"textnode","content":"Create"}],"template":{"before":"","replace":"{{ add-ok }}","after":"","attributes":"","classname":"","style":""}},{"type":"button","classes":[{"name":"button","active":false},{"name":"rounded","active":false},"button--secondary"],"attributes":{"type":"reset"},"text":"Cancel","components":[{"type":"textnode","content":"Cancel"}],"template":{"before":"","replace":"{{ add-cancel }}","after":"","attributes":"@click=\"showCreationForm = !showCreationForm\"","classname":"","style":""}}]}],"template":{"before":"","replace":"","after":"","attributes":"@submit.prevent=\"createWebsite\"","classname":"","style":""}}],"template":{"before":"","replace":"","after":"","attributes":"v-if=\"showCreationForm\"","classname":"","style":""}},{"type":"container","attributes":{"id":"if80m"},"components":[{"tagName":"SECTION","type":"container","classes":[{"name":"button-bar","active":false},{"name":"button-bar--full-width","active":false},{"name":"bg-white","active":false},{"name":"rounded","active":false},"loaded__item"],"attributes":{"id":"idgvg"},"components":[{"tagName":"H3","type":"text","classes":[{"name":"button-bar_item","active":false},{"name":"button-bar__item--main","active":false}],"attributes":{"id":"i69a7"},"components":[{"type":"textnode","content":"My first website"}],"template":{"before":"","replace":"","after":"","attributes":"v-text=\"website.name || website.id\"","classname":"","style":""}},{"tagName":"P","type":"text","classes":[{"name":"button-bar_item","active":false},{"name":"button-bar__item--secondary","active":false},"flex-no-shrink"],"attributes":{"id":"i65hn"},"components":[{"type":"textnode","content":"Updated 1h ago by lexoyo"}],"template":{"before":"","replace":"","after":"","attributes":"v-text=\"'{{ list-item-updated }} ' + new Date(website.stats.mtime).toLocaleDateString(undefined, { day: 'numeric', month: 'long', year: 'numeric' })\"","classname":"","style":""}},{"tagName":"P","type":"text","classes":[{"name":"button-bar_item","active":false},{"name":"button-bar__item--secondary","active":false},"flex-no-shrink"],"attributes":{"id":"i64qa"},"components":[{"type":"textnode","content":"Created 2023-02-16 by lexoyo"}],"template":{"before":"","replace":"","after":"","attributes":"v-text=\"'{{ list-item-created }} ' + new Date(website.stats.birthtime).toLocaleDateString(undefined, { day: 'numeric', month: 'long', year: 'numeric' })\"","classname":"","style":""}},{"type":"container","classes":[{"name":"button-bar_item","active":false},"flex-no-shrink"],"attributes":{"id":"i3b4tr"},"components":[{"type":"text","classes":[{"name":"button","active":false},{"name":"rounded","active":false},{"name":"button--primary","active":false},{"name":"button--small","active":false},"right-space"],"attributes":{"id":"ifyf6p","href":""},"components":[{"type":"textnode","content":"Edit"}],"originalTagName":"div","template":{"before":"","replace":"{{ list-edit }}","after":"","attributes":"@click=\"openEditor(website.id)\"","classname":"","style":""}},{"type":"text","classes":[{"name":"button","active":false},{"name":"rounded","active":false},"button--secondary",{"name":"button--small","active":false}],"attributes":{"id":"iol4h"},"components":[{"type":"textnode","content":"X"}],"template":{"before":"","replace":"","after":"","attributes":"@click=\"deleteWebsite(website.id)\" title=\"{{ list-delete }}\"","classname":"","style":""}}]}],"template":{"before":"","replace":"","after":"","attributes":"v-if=\"!loading\" v-for=\"(website, index) in websites\" :key=\"index\"","classname":"","style":""}},{"tagName":"SECTION","type":"container","classes":[{"name":"button-bar","active":false},{"name":"button-bar--full-width","active":false},{"name":"bg-white","active":false},{"name":"rounded","active":false},{"name":"loading__item","active":false},{"name":"skeleton-anim","active":false},{"name":"skeleton-wrapper","active":false}],"attributes":{"id":"i1fjn"},"components":[{"tagName":"H3","type":"text","classes":[{"name":"button-bar_item","active":false},{"name":"button-bar__item--main","active":false},"skeleton-text",{"name":"skeleton","active":false}],"components":[{"type":"textnode","content":"My first websiteMy first websiteMy first websiteMy first"}]},{"tagName":"P","type":"text","classes":[{"name":"button-bar_item","active":false},{"name":"button-bar__item--secondary","active":false},"skeleton-text",{"name":"skeleton","active":false}],"components":[{"type":"textnode","content":"Updated 1h ago by lexoyo"}]},{"tagName":"P","type":"text","classes":[{"name":"button-bar_item","active":false},{"name":"button-bar__item--secondary","active":false},"skeleton-text",{"name":"skeleton","active":false}],"components":[{"type":"textnode","content":"Created 2023-02-16 by lexoyo"}]},{"type":"text","classes":[{"name":"button-bar_item","active":false},{"name":"skeleton","active":false},{"name":"skeleton-button","active":false}],"attributes":{"id":"ixz6c"},"components":[{"type":"textnode","content":"Edit"}]}],"template":{"before":"","replace":"","after":"","attributes":"v-if=\"loading\"","classname":"","style":""}},{"tagName":"SECTION","type":"container","classes":[{"name":"button-bar","active":false},{"name":"button-bar--full-width","active":false},{"name":"bg-white","active":false},{"name":"rounded","active":false},{"name":"loading__item","active":false},{"name":"skeleton-anim","active":false},{"name":"skeleton-wrapper","active":false}],"attributes":{"id":"iwxxo5"},"components":[{"tagName":"H3","type":"text","classes":[{"name":"button-bar_item","active":false},{"name":"button-bar__item--main","active":false},"skeleton-text",{"name":"skeleton","active":false}],"components":[{"type":"textnode","content":"My first websiteMy first websiteMy first websiteMy first"}]},{"tagName":"P","type":"text","classes":[{"name":"button-bar_item","active":false},{"name":"button-bar__item--secondary","active":false},"skeleton-text",{"name":"skeleton","active":false}],"components":[{"type":"textnode","content":"Updated 1h ago by lexoyo"}]},{"tagName":"P","type":"text","classes":[{"name":"button-bar_item","active":false},{"name":"button-bar__item--secondary","active":false},"skeleton-text",{"name":"skeleton","active":false}],"components":[{"type":"textnode","content":"Created 2023-02-16 by lexoyo"}]},{"type":"text","classes":[{"name":"button-bar_item","active":false},{"name":"skeleton","active":false},{"name":"skeleton-button","active":false}],"attributes":{"id":"i9fx3l"},"components":[{"type":"textnode","content":"Edit"}]}],"template":{"before":"","replace":"","after":"","attributes":"v-if=\"loading\"","classname":"","style":""}},{"tagName":"SECTION","type":"container","classes":[{"name":"button-bar","active":false},{"name":"button-bar--full-width","active":false},{"name":"bg-white","active":false},{"name":"rounded","active":false},{"name":"loading__item","active":false},{"name":"skeleton-anim","active":false},{"name":"skeleton-wrapper","active":false}],"attributes":{"id":"isld3r"},"components":[{"tagName":"H3","type":"text","classes":[{"name":"button-bar_item","active":false},{"name":"button-bar__item--main","active":false},"skeleton-text",{"name":"skeleton","active":false}],"components":[{"type":"textnode","content":"My first websiteMy first websiteMy first websiteMy first"}]},{"tagName":"P","type":"text","classes":[{"name":"button-bar_item","active":false},{"name":"button-bar__item--secondary","active":false},"skeleton-text",{"name":"skeleton","active":false}],"components":[{"type":"textnode","content":"Updated 1h ago by lexoyo"}]},{"tagName":"P","type":"text","classes":[{"name":"button-bar_item","active":false},{"name":"button-bar__item--secondary","active":false},"skeleton-text",{"name":"skeleton","active":false}],"components":[{"type":"textnode","content":"Created 2023-02-16 by lexoyo"}]},{"type":"text","classes":[{"name":"button-bar_item","active":false},{"name":"skeleton","active":false},{"name":"skeleton-button","active":false}],"attributes":{"id":"i8oes3"},"components":[{"type":"textnode","content":"Edit"}]}],"template":{"before":"","replace":"","after":"","attributes":"v-if=\"loading\"","classname":"","style":""}},{"tagName":"SECTION","type":"container","classes":[{"name":"button-bar","active":false},{"name":"button-bar--full-width","active":false},{"name":"bg-white","active":false},{"name":"rounded","active":false},{"name":"loading__item","active":false},{"name":"skeleton-anim","active":false},{"name":"skeleton-wrapper","active":false}],"attributes":{"id":"iqmx38"},"components":[{"tagName":"H3","type":"text","classes":[{"name":"button-bar_item","active":false},{"name":"button-bar__item--main","active":false},"skeleton-text",{"name":"skeleton","active":false}],"components":[{"type":"textnode","content":"My first websiteMy first websiteMy first websiteMy first"}]},{"tagName":"P","type":"text","classes":[{"name":"button-bar_item","active":false},{"name":"button-bar__item--secondary","active":false},"skeleton-text",{"name":"skeleton","active":false}],"components":[{"type":"textnode","content":"Updated 1h ago by lexoyo"}]},{"tagName":"P","type":"text","classes":[{"name":"button-bar_item","active":false},{"name":"button-bar__item--secondary","active":false},"skeleton-text",{"name":"skeleton","active":false}],"components":[{"type":"textnode","content":"Created 2023-02-16 by lexoyo"}]},{"type":"text","classes":[{"name":"button-bar_item","active":false},{"name":"skeleton","active":false},{"name":"skeleton-button","active":false}],"attributes":{"id":"ie83jl"},"components":[{"type":"textnode","content":"Edit"}]}],"template":{"before":"","replace":"","after":"","attributes":"v-if=\"loading\"","classname":"","style":""}}]},{"type":"container","classes":[{"name":"box","active":false},"horizontal"],"attributes":{"id":"i7ej6j"},"components":[{"type":"text","classes":[{"name":"full-width","active":false},{"name":"v-space","active":false},{"name":"h-space","active":false}],"attributes":{"id":"iv0eyi"},"components":[{"type":"textnode","content":"Insert your text here"}],"template":{"before":"","replace":"","after":"","attributes":"v-text=\"error\"","classname":"","style":""}},{"type":"text","classes":[{"name":"button","active":false},{"name":"rounded","active":false},{"name":"button--small","active":false},"button--tertiary"],"attributes":{"id":"i4656n"},"components":[{"type":"textnode","content":"Dismiss"}],"template":{"before":"","replace":"{{ message-dismiss }}","after":"","attributes":"@click=\"error = null\"","classname":"","style":""}}],"template":{"before":"","replace":"","after":"","attributes":"v-if=\"error\"","classname":"","style":""}},{"type":"container","classes":[{"name":"box","active":false},"horizontal"],"attributes":{"id":"ilteie"},"components":[{"type":"text","classes":[{"name":"full-width","active":false},{"name":"v-space","active":false},{"name":"h-space","active":false}],"attributes":{"id":"i2d31v"},"components":[{"type":"textnode","content":"Insert your text here"}],"template":{"before":"","replace":"","after":"","attributes":"v-text=\"message\"","classname":"","style":""}},{"type":"text","classes":[{"name":"button","active":false},{"name":"rounded","active":false},{"name":"button--small","active":false},"button--tertiary"],"attributes":{"id":"i2urco"},"components":[{"type":"textnode","content":"Dismiss"}],"template":{"before":"","replace":"{{ message-dismiss }}","after":"","attributes":"@click=\"message = null\"","classname":"","style":""}}],"template":{"before":"","replace":"","after":"","attributes":"v-if=\"message\"","classname":"","style":""}}],"custom-name":"Main","template":{"before":"","replace":"","after":"","attributes":"","classname":"app","style":""}},{"tagName":"FOOTER","type":"container","classes":[{"name":"header","active":false},"footer"],"attributes":{"id":"ilzpl"},"components":[{"type":"text","classes":["section"],"attributes":{"id":"i238z"},"components":[{"type":"textnode","content":"Links"},{"tagName":"br","void":true},{"tagName":"ul","attributes":{"id":"ibmxx"},"components":[{"tagName":"li","type":"text","attributes":{"id":"iktkw"},"components":[{"type":"textnode","content":"Docs"}]},{"tagName":"li","type":"text","attributes":{"id":"ipexhl"},"components":[{"type":"textnode","content":"Support"}]},{"tagName":"li","type":"text","classes":["gjs-hovered"],"attributes":{"id":"ihfzt","draggable":"true"},"components":[{"type":"textnode","content":"Bug report"}]},{"tagName":"li","type":"text","attributes":{"id":"i4qli"},"components":[{"type":"textnode","content":"Source code"},{"tagName":"br","void":true}]}]}],"template":{"before":"","replace":"{{ content }}","after":"","attributes":"","classname":"","style":""}}],"custom-name":"Footer"}]}}],"type":"main","id":"mk3OKgfr4A9V7Dww","settings":{"lang":"","title":"","description":"","favicon":"","og:title":"","og:description":"","og:image":"","head":""},"name":"Main"}],"styles":[{"selectors":[{"name":"nav__item","active":false}],"style":{"margin":"0px 10px 0px 10px","font-size":"0.8rem","padding":"24px 0px 24px 0px","color":"grey","font-weight":"700"}},{"selectors":["body"],"style":{"font-family":"\"Roboto\", sans-serif","background-color":"#f0f0f0"}},{"selectors":[{"name":"header","active":false}],"style":{"display":"flex","align-items":"center","justify-content":"space-between","background-color":"#ffffff"}},{"selectors":["#ir7s"],"style":{"color":"black","width":"32px","height":"32px"}},{"selectors":[{"name":"padding-normal","active":false}],"style":{"padding":"0px 24px 0px 24px"}},{"selectors":["#i9jq"],"style":{"display":"flex"}},{"selectors":["nav"],"style":{"width":"100%","margin":"0px 20px 0px 20px"}},{"selectors":["#iz63r"],"style":{"min-height":"90vh"}},{"selectors":["#itp1f"],"style":{"font-size":"2rem","margin":"0px 0px 10px 0px"}},{"selectors":["subtitle"],"style":{"font-size":"1rem","margin":"0px 0px 20px 0px"}},{"selectors":["section"],"style":{"max-width":"1200px","margin":"80px auto 80px auto"}},{"selectors":["subtitle",{"name":"color--light","active":false}],"style":{"color":"#636363","font-weight":"700"}},{"selectors":["#idkdk"],"style":{"color":"black","border-radius":"100% 100% 100% 100%"}},{"selectors":[{"name":"button","active":false}],"style":{"font-weight":"700","background-color":"#dddddd","font-size":"0.8rem","padding":"12px 12px 12px 12px","display":"inline-block","border":"0 none black"}},{"selectors":[{"name":"button","active":false},{"name":"button--primary","active":false}],"style":{"background-color":"#5e85a8","color":"white"}},{"selectors":[{"name":"button-bar","active":false}],"style":{"margin":"10px 0px 10px 0px","display":"flex"}},{"selectors":["#ibsgw"],"style":{"position":"relative","top":"3px"}},{"selectors":[{"name":"button-bar","active":false},{"name":"button-bar--full-width","active":false}],"style":{"justify-content":"space-between","align-items":"center"}},{"selectors":[{"name":"button-bar_item","active":false}],"style":{"margin":"20px 20px 20px 20px"}},{"selectors":[{"name":"button-bar_item","active":false},{"name":"button-bar__item--secondary","active":false}],"style":{"font-size":"0.8rem","color":"#444444"}},{"selectors":[{"name":"button","active":false},"button--secondary"],"style":{"font-weight":"400"}},{"selectors":[{"name":"bg-white","active":false}],"style":{"background-color":"#ffffff"}},{"selectors":[{"name":"rounded","active":false}],"style":{"border-radius":"5px 5px 5px 5px"}},{"selectors":["#ilzpl"],"style":{"min-height":"100px"}},{"selectors":["#i238z"],"style":{"padding":"10px"}},{"selectors":["footer"],"style":{"display":"block","margin":"20px 0px 0 0px","padding":"1px 0px 1px 0px"}},{"selectors":["skeleton-text",{"name":"skeleton","active":false}],"style":{"background-color":"#dddddd","color":"transparent","opacity":"0.31","border-radius":"5px 5px 5px 5px"}},{"selectors":[{"name":"skeleton","active":false},{"name":"skeleton-button","active":false}],"style":{"color":"transparent","opacity":"0.16"}},{"selectors":[{"name":"skeleton-anim","active":false}],"style":{"position":"relative"}},{"selectors":[{"name":"nav__item","active":false},"active"],"style":{"color":"black"}},{"selectors":["margin-20"],"style":{"margin":"20px 0px 20px 0px"}},{"selectors":["#i0ro3"],"style":{"display":"none"}},{"selectors":[{"name":"loading__item","active":false},"loaded-true"],"style":{"display":"none"}},{"selectors":["#i69a7"],"style":{"width":"100%"}},{"selectors":["flex-no-shrink"],"style":{"flex-shrink":"0"}},{"selectors":[{"name":"button--small","active":false}],"style":{"padding":"5px 10px 5px 10px"}},{"selectors":["form"],"style":{"padding":"10px 10px 10px 10px","border-radius":"5px 5px 5px 5px"}},{"selectors":["#i1nmbc"],"style":{"flex-shrink":"0"}},{"selectors":["input"],"style":{"padding":"10px 10px 10px 10px","background-color":"transparent","border":"1px solid #5e85a8"}},{"selectors":[{"name":"full-width","active":false}],"style":{"width":"100%"}},{"selectors":[{"name":"v-space","active":false}],"style":{"margin":"10px 0px 10px 0px"}},{"selectors":["#ihwwxz"],"style":{"min-height":"100px"}},{"selectors":[{"name":"box","active":false}],"style":{"border":"2px solid #5e85a8"}},{"selectors":["box__header"],"style":{"margin":"0px 0px 0px 0px","padding":"10px 0px 10px 10px"}},{"selectors":[{"name":"box","active":false},"horizontal"],"style":{"align-items":"center"}},{"selectors":["horizontal"],"style":{"display":"flex","align-items":"center"}},{"selectors":[{"name":"h-space","active":false}],"style":{"margin":"0px 10px 0px 10px"}},{"selectors":[{"name":"button","active":false},"button--tertiary"],"style":{"border":"0px none black"}},{"selectors":["button--tertiary"],"style":{"background-color":"transparent","font-weight":"400"}},{"selectors":["icon-font"],"style":{"font-size":"1.5rem","line-height":"1px","margin":"0px 2px 0px 2px"}},{"selectors":["lang__item"],"style":{"margin":"0px 5px 0px 5px"}},{"selectors":[{"name":"button--primary","active":false},"right-space"],"style":{"margin":"0 10px 0 0"}},{"selectors":["top-space-40"],"style":{"margin":"40px 0 0 0"}}],"settings":{"lang":"","title":"{{ title }}","description":"","favicon":"","og:title":"","og:description":"","og:image":"","head":"{% render \"alternate.liquid\" languages: languages lang: lang page: page %}\n{% render \"website-list.js.html\" frontmatter: frontmatter page: page site: site api-translations: api-translations lang: lang %}\n\n<style>\n.button { cursor: pointer; }\n.skeleton-anim:after {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n content: \"\";\n background: \n linear-gradient(0.25turn, transparent, rgba(255,255,255,.75), transparent),\n linear-gradient(transparent, transparent),\n radial-gradient(38px circle at 19px 19px, transparent 50%, transparent 51%),\n linear-gradient(transparent, transparent); \n background-repeat: no-repeat;\n background-size: 315px 250px, 315px 180px, 100px 100px, 225px 30px; \n background-position: -315px 0, 0 0, 0px 190px, 50px 195px; \n animation: loading 1.5s infinite;\n}\n\n@keyframes loading { \n to {\n background-position: 200% 0, 0 0, 0 190px, 50px 195px;\n }\n}\n\n</style>"},"publication":{"css":{"url":"/css","path":"pages"},"html":{"path":"_includes"},"assets":{"url":"/assets/"},"url":"/","path":"../../","autoHomePage":false},"name":"Dashboard","fonts":[{"name":"Roboto","value":"\"Roboto\", sans-serif","variants":[]}],"symbols":[]}
|
|
Binary file
|
|
Binary file
|
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Silex Dashboard
|
|
2
|
+
|
|
3
|
+
Here is the source code of Silex dashboard. It is a [Silex](https://www.silex.me) plugin which can be installed to manage websites you will then edit in Silex.
|
|
4
|
+
|
|
5
|
+
Technically, the dashboard is an [11ty](https://11ty.dev) website with a design made in Silex + [a vue.js app](https://vuejs.org/) which interacts with Silex API
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
For discussions and bug report please go to [Silex main project](https://github.com/silexlabs/Silex)
|
|
10
|
+
|
|
11
|
+
## Contribute
|
|
12
|
+
|
|
13
|
+
Start 11ty on localhost:8080
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
$ npm run serve
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Start Silex on localhost:6805
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
$ npm start
|
|
23
|
+
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"en": {
|
|
3
|
+
"Failed to fetch websites": "Failed to fetch websites",
|
|
4
|
+
"HTTP error! status: ${response.status}": "HTTP error! status: ${response.status}",
|
|
5
|
+
"You need to provide a website name": "You need to provide a website name",
|
|
6
|
+
"Website created successfully": "Website created successfully",
|
|
7
|
+
"Failed to create website": "Failed to create website",
|
|
8
|
+
"Deleting a website? Are your sure? Really?": "Deleting a website? Are your sure? Really?",
|
|
9
|
+
"Website deleted successfully": "Website deleted successfully",
|
|
10
|
+
"Failed to delete website": "Failed to delete website"
|
|
11
|
+
},
|
|
12
|
+
"fr": {
|
|
13
|
+
"Failed to fetch websites": "Erreur, impossible de récupérer la liste des sites",
|
|
14
|
+
"HTTP error! status: ${response.status}": "Erreur HTTP ! status: ${response.status}",
|
|
15
|
+
"You need to provide a website name": "Vous n\\'avez pas donné de nom à votre site",
|
|
16
|
+
"Website created successfully": "Le site a bien été créé",
|
|
17
|
+
"Failed to create website": "Erreur, le site n\\'a pas été créé",
|
|
18
|
+
"Deleting a website? Are your sure? Really?": "Etes vous sûr.e de vouloir supprimer définitivement ce site ?",
|
|
19
|
+
"Website deleted successfully": "Le site a bien été effacé",
|
|
20
|
+
"Failed to delete website": "Erreur, le site n\\'a pas été effacé"
|
|
21
|
+
}
|
|
22
|
+
}
|
package/_data/site.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{%- assign permalinkWithoutLang = page.url | split: "/" | slice: 2 | join: "/" %}
|
|
2
|
+
{%- for alt in languages %}
|
|
3
|
+
{%- if alt.code != lang %}
|
|
4
|
+
<link
|
|
5
|
+
rel="alternate"
|
|
6
|
+
hreflang="{{alt.code}}"
|
|
7
|
+
href="/{{alt.code}}/{{permalinkWithoutLang}}" />
|
|
8
|
+
{%- endif %}
|
|
9
|
+
{%- endfor %}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!DOCTYPE html><html lang=""><head><link rel="stylesheet" href="/css/main.css">{% render "alternate.liquid" languages: languages lang: lang page: page %} {% render "website-list.js.html" frontmatter: frontmatter page: page site: site api-translations: api-translations lang: lang %}<style>.button{cursor:pointer}.skeleton-anim:after{width:100%;height:100%;position:absolute;top:0;left:0;content:"";background:linear-gradient(.25turn,transparent,rgba(255,255,255,.75),transparent),linear-gradient(transparent,transparent),radial-gradient(38px circle at 19px 19px,transparent 50%,transparent 51%),linear-gradient(transparent,transparent);background-repeat:no-repeat;background-size:315px 250px,315px 180px,100px 100px,225px 30px;background-position:-315px 0,0 0,0 190px,50px 195px;animation:loading 1.5s infinite}@keyframes loading{to{background-position:200% 0,0 0,0 190px,50px 195px}}</style><title>{{ title }}</title><link rel="icon" href=""><meta property="description" content=""><meta property="og:title" content=""><meta property="og:description" content=""><meta property="og:image" content=""></head><body id="ik0i" class="body loading"><header id="igrg" class="header padding-normal"><img id="ir7s" src="/assets//silex-icon-2018@200px.png"><nav id="i9jq" class="nav">{% for item in nav %}<a id="iels" href="{{ item.url }}" class="nav__item {% if forloop.index == 1 %}active{% endif %}" target="{{ item.target }}">{{ item.label }}</a>{% endfor %}</nav><div id="i2red7" class="lang h-space">{% assign links = languages %} {%- for link in links %}<a href="/{{ link.code }}" id="iciz" class="lang__item nav__item {% if link.code == lang %}active{% endif %}" hreflang="{{link.code}}">{{ link.code }}</a>{% endfor %}</div><div id="i24ew"><img id="idkdk" src="/assets//alex-small.jpg" src="${json.avatar.url}"></div></header><main id="iz63r" class="padding-normal section app"><h1 id="itp1f">{{ title2 }}</h1><div id="iyex8" class="subtitle color--light">{{ subtitle }}</div><div id="ickx4" class="button-bar margin-20"><div id="i2x0l" class="button button--primary rounded top-space-40" @click="showCreationForm = !showCreationForm" v-if="!showCreationForm"><span id="ibsgw" class="icon-font">+</span><span id="itl2n8">{{ add-button }}</span></div><div id="i0ro3" class="button button--secondary rounded">Import</div></div><div id="ihwwxz" class="box top-space-40" v-if="showCreationForm"><h3 id="i3gd1b" class="box__header">{{ add-title }}</h3><form method="get" id="i50acf" class="form" @submit.prevent="createWebsite"><div id="igtg1t" class="v-space"><label id="i1nmbc" class="v-space">{{ add-name-label }}</label><input type="text" id="ij5iwh" placeholder="{{ add-name-placeholder }}" class="input full-width" v-model="newWebsiteName"></div><div id="ie0xes"><button type="submit" id="i021na" class="button rounded button--primary right-space">{{ add-ok }}</button><button type="reset" class="button rounded button--secondary" @click="showCreationForm = !showCreationForm">{{ add-cancel }}</button></div></form></div><div id="if80m"><section id="idgvg" class="button-bar button-bar--full-width bg-white rounded loaded__item" v-if="!loading" v-for="(website, index) in websites" :key="index"><h3 id="i69a7" class="button-bar_item button-bar__item--main" v-text="website.name || website.id">My first website</h3><p id="i65hn" class="button-bar_item button-bar__item--secondary flex-no-shrink" v-text="'{{ list-item-updated }} ' + new Date(website.stats.mtime).toLocaleDateString(undefined, { day: 'numeric', month: 'long', year: 'numeric' })">Updated 1h ago by lexoyo</p><p id="i64qa" class="button-bar_item button-bar__item--secondary flex-no-shrink" v-text="'{{ list-item-created }} ' + new Date(website.stats.birthtime).toLocaleDateString(undefined, { day: 'numeric', month: 'long', year: 'numeric' })">Created 2023-02-16 by lexoyo</p><div id="i3b4tr" class="button-bar_item flex-no-shrink"><div id="ifyf6p" href="" class="button rounded button--primary button--small right-space" @click="openEditor(website.id)">{{ list-edit }}</div><div id="iol4h" class="button rounded button--secondary button--small" @click="deleteWebsite(website.id)" title="{{ list-delete }}">X</div></div></section><section id="i1fjn" class="button-bar button-bar--full-width bg-white rounded loading__item skeleton-anim skeleton-wrapper" v-if="loading"><h3 class="button-bar_item button-bar__item--main skeleton-text skeleton">My first websiteMy first websiteMy first websiteMy first</h3><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Updated 1h ago by lexoyo</p><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Created 2023-02-16 by lexoyo</p><div id="ixz6c" class="button-bar_item skeleton skeleton-button">Edit</div></section><section class="button-bar button-bar--full-width bg-white rounded loading__item skeleton-anim skeleton-wrapper" v-if="loading"><h3 class="button-bar_item button-bar__item--main skeleton-text skeleton">My first websiteMy first websiteMy first websiteMy first</h3><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Updated 1h ago by lexoyo</p><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Created 2023-02-16 by lexoyo</p><div class="button-bar_item skeleton skeleton-button">Edit</div></section><section class="button-bar button-bar--full-width bg-white rounded loading__item skeleton-anim skeleton-wrapper" v-if="loading"><h3 class="button-bar_item button-bar__item--main skeleton-text skeleton">My first websiteMy first websiteMy first websiteMy first</h3><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Updated 1h ago by lexoyo</p><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Created 2023-02-16 by lexoyo</p><div class="button-bar_item skeleton skeleton-button">Edit</div></section><section class="button-bar button-bar--full-width bg-white rounded loading__item skeleton-anim skeleton-wrapper" v-if="loading"><h3 class="button-bar_item button-bar__item--main skeleton-text skeleton">My first websiteMy first websiteMy first websiteMy first</h3><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Updated 1h ago by lexoyo</p><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Created 2023-02-16 by lexoyo</p><div class="button-bar_item skeleton skeleton-button">Edit</div></section><section class="button-bar button-bar--full-width bg-white rounded loading__item skeleton-anim skeleton-wrapper" v-if="loading"><h3 class="button-bar_item button-bar__item--main skeleton-text skeleton">My first websiteMy first websiteMy first websiteMy first</h3><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Updated 1h ago by lexoyo</p><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Created 2023-02-16 by lexoyo</p><div class="button-bar_item skeleton skeleton-button">Edit</div></section><section class="button-bar button-bar--full-width bg-white rounded loading__item skeleton-anim skeleton-wrapper" v-if="loading"><h3 class="button-bar_item button-bar__item--main skeleton-text skeleton">My first websiteMy first websiteMy first websiteMy first</h3><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Updated 1h ago by lexoyo</p><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Created 2023-02-16 by lexoyo</p><div class="button-bar_item skeleton skeleton-button">Edit</div></section></div><div id="i7ej6j" class="box horizontal" v-if="error"><div id="iv0eyi" class="full-width v-space h-space" v-text="error">Insert your text here</div><div id="i4656n" class="button rounded button--small button--tertiary" @click="error = null">{{ message-dismiss }}</div></div><div id="ilteie" class="box horizontal" v-if="message"><div id="i2d31v" class="full-width v-space h-space" v-text="message">Insert your text here</div><div id="i2urco" class="button rounded button--small button--tertiary" @click="message = null">{{ message-dismiss }}</div></div></main><footer id="ilzpl" class="header footer"><div id="i238z" class="section">{{ content }}</div></footer></body></html>
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
<div class="app">
|
|
3
|
+
<div v-if="showLoginForm">
|
|
4
|
+
<h2>Login</h2>
|
|
5
|
+
<form @submit.prevent="login">
|
|
6
|
+
<label>
|
|
7
|
+
Username:
|
|
8
|
+
<input type="text" v-model="username" required />
|
|
9
|
+
</label>
|
|
10
|
+
<label>
|
|
11
|
+
Password:
|
|
12
|
+
<input type="password" v-model="password" required />
|
|
13
|
+
</label>
|
|
14
|
+
<button type="submit">Login</button>
|
|
15
|
+
</form>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<div v-if="loggedIn">
|
|
19
|
+
<button @click="showLoginForm = true; loggedIn = false; websites = []">Logout</button>
|
|
20
|
+
<h2>Websites</h2>
|
|
21
|
+
<ul>
|
|
22
|
+
<li v-for="(website, index) in websites" :key="index">
|
|
23
|
+
<div v-text="website.name || website.id"></div>
|
|
24
|
+
<button @click="deleteWebsite(website.id)">Delete</button>
|
|
25
|
+
</li>
|
|
26
|
+
</ul>
|
|
27
|
+
|
|
28
|
+
<button @click="showCreationForm = true">Create Website</button>
|
|
29
|
+
|
|
30
|
+
<div v-if="showCreationForm">
|
|
31
|
+
<h2>Create Website</h2>
|
|
32
|
+
<form @submit.prevent="createWebsite">
|
|
33
|
+
<label>
|
|
34
|
+
Website Name:
|
|
35
|
+
<input type="text" v-model="newWebsiteName" required />
|
|
36
|
+
</label>
|
|
37
|
+
<button type="submit">Create</button>
|
|
38
|
+
</form>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div v-if="error">
|
|
43
|
+
<p>Error: {{ error }}</p>
|
|
44
|
+
<button @click="error = null">Dismiss</button>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div v-if="message">
|
|
48
|
+
<p>{{ message }}</p>
|
|
49
|
+
<button @click="message = null">Dismiss</button>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
-->
|
|
53
|
+
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
|
|
54
|
+
<script>
|
|
55
|
+
const { createApp, ref, onMounted, reactive } = Vue;
|
|
56
|
+
const apiUrl = '{{ site.silexUrl }}';
|
|
57
|
+
|
|
58
|
+
const App = {
|
|
59
|
+
data() {
|
|
60
|
+
return {
|
|
61
|
+
websites: [],
|
|
62
|
+
newWebsiteName: '',
|
|
63
|
+
showCreationForm: false,
|
|
64
|
+
error: null,
|
|
65
|
+
message: null,
|
|
66
|
+
showLoginForm: false,
|
|
67
|
+
username: '',
|
|
68
|
+
password: '',
|
|
69
|
+
loggedIn: true,
|
|
70
|
+
loading: true,
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
mounted() {
|
|
74
|
+
if (this.loggedIn) this.fetchWebsites()
|
|
75
|
+
else this.showLoginForm = true
|
|
76
|
+
},
|
|
77
|
+
methods: {
|
|
78
|
+
openEditor(id) {
|
|
79
|
+
window.open(`${apiUrl}/?id=${id}`)
|
|
80
|
+
},
|
|
81
|
+
async fetchWebsites() {
|
|
82
|
+
this.loading = true
|
|
83
|
+
try {
|
|
84
|
+
const response = await fetch(`${apiUrl}/website/`)
|
|
85
|
+
if (!response.ok) {
|
|
86
|
+
throw new Error(`HTTP error! status: ${response.status}`)
|
|
87
|
+
}
|
|
88
|
+
this.websites = await response.json();
|
|
89
|
+
} catch (error) {
|
|
90
|
+
this.error = '{{ api-translations[lang]["Failed to fetch websites"] }}'
|
|
91
|
+
}
|
|
92
|
+
this.loading = false
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
async login() {
|
|
96
|
+
this.loading = true
|
|
97
|
+
try {
|
|
98
|
+
const response = await fetch(`${apiUrl}/me/`, {
|
|
99
|
+
method: 'POST',
|
|
100
|
+
headers: {
|
|
101
|
+
'Content-Type': 'application/json',
|
|
102
|
+
},
|
|
103
|
+
body: JSON.stringify({
|
|
104
|
+
username: this.username,
|
|
105
|
+
password: this.password,
|
|
106
|
+
}),
|
|
107
|
+
})
|
|
108
|
+
if (!response.ok) {
|
|
109
|
+
throw new Error(`{{ api-translations[lang]["HTTP error! status: ${response.status}"] }}`)
|
|
110
|
+
}
|
|
111
|
+
this.loggedIn = true;
|
|
112
|
+
this.showLoginForm = false;
|
|
113
|
+
await this.fetchWebsites()
|
|
114
|
+
} catch (error) {
|
|
115
|
+
this.error = 'Failed to log in'
|
|
116
|
+
}
|
|
117
|
+
this.loading = false
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
async createWebsite() {
|
|
121
|
+
if(!this.newWebsiteName) throw new Error('{{ api-translations[lang]["You need to provide a website name"] }}')
|
|
122
|
+
this.loading = true
|
|
123
|
+
try {
|
|
124
|
+
const id = this.newWebsiteName.replace(/[/\\?%*:|"<>]/g, '_')
|
|
125
|
+
const response = await fetch(`${apiUrl}/website/?id=${id}`, {
|
|
126
|
+
method: 'POST',
|
|
127
|
+
headers: {
|
|
128
|
+
'Content-Type': 'application/json',
|
|
129
|
+
},
|
|
130
|
+
body: JSON.stringify({
|
|
131
|
+
name: this.newWebsiteName,
|
|
132
|
+
}),
|
|
133
|
+
})
|
|
134
|
+
if (!response.ok) {
|
|
135
|
+
throw new Error(`{{ api-translations[lang]["HTTP error! status: ${response.status}"] }}`)
|
|
136
|
+
}
|
|
137
|
+
this.message = '{{ api-translations[lang]["Website created successfully"] }}'
|
|
138
|
+
this.newWebsiteName = ''
|
|
139
|
+
this.showCreationForm = false;
|
|
140
|
+
await this.fetchWebsites()
|
|
141
|
+
} catch (error) {
|
|
142
|
+
this.error = '{{ api-translations[lang]["Failed to create website"] }}'
|
|
143
|
+
}
|
|
144
|
+
this.loading = false
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
async deleteWebsite(id) {
|
|
148
|
+
const ok = confirm('{{ api-translations[lang]["Deleting a website? Are your sure? Really?"] }}')
|
|
149
|
+
if(!ok) return
|
|
150
|
+
this.loading = true
|
|
151
|
+
try {
|
|
152
|
+
const response = await fetch(`${apiUrl}/website/?id=${id}`, {
|
|
153
|
+
method: 'DELETE',
|
|
154
|
+
})
|
|
155
|
+
if (!response.ok) {
|
|
156
|
+
throw new Error(`{{ api-translations[lang][""] }}HTTP error! status: ${response.status}`)
|
|
157
|
+
}
|
|
158
|
+
this.message = '{{ api-translations[lang]["Website deleted successfully"] }}'
|
|
159
|
+
await this.fetchWebsites()
|
|
160
|
+
} catch (error) {
|
|
161
|
+
this.error = '{{ api-translations[lang]["Failed to delete website"] }}'
|
|
162
|
+
}
|
|
163
|
+
this.loading = false
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
window.addEventListener('load', () => {
|
|
169
|
+
createApp(App).mount('.app');
|
|
170
|
+
})
|
|
171
|
+
</script>
|
|
172
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<h1>Silex Dashboard</h1>
|
|
2
|
+
<p>Here is the source code of Silex dashboard. It is a <a href="https://www.silex.me">Silex</a> plugin which can be installed to manage websites you will then edit in Silex.</p>
|
|
3
|
+
<p>Technically, the dashboard is an <a href="https://11ty.dev">11ty</a> website with a design made in Silex + <a href="https://vuejs.org/">a vue.js app</a> which interacts with Silex API</p>
|
|
4
|
+
<p><img src="./assets/silex-dashboard.png" alt="Silex dashboard screenshot"></p>
|
|
5
|
+
<p>For discussions and bug report please go to <a href="https://github.com/silexlabs/Silex">Silex main project</a></p>
|
|
6
|
+
<h2>Contribute</h2>
|
|
7
|
+
<p>Start 11ty on localhost:8080</p>
|
|
8
|
+
<pre><code class="language-sh">$ npm run serve
|
|
9
|
+
</code></pre>
|
|
10
|
+
<p>Start Silex on localhost:6805</p>
|
|
11
|
+
<pre><code class="language-sh">$ npm start
|
|
12
|
+
</code></pre>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* { box-sizing: border-box; } body {margin: 0;}.nav__item{margin:0px 10px 0px 10px;font-size:0.8rem;padding:24px 0px 24px 0px;color:grey;font-weight:700;}.body{font-family:"Roboto", sans-serif;background-color:#f0f0f0;}.header{display:flex;align-items:center;justify-content:space-between;background-color:#ffffff;}#ir7s{color:black;width:32px;height:32px;}.padding-normal{padding:0px 24px 0px 24px;}#i9jq{display:flex;}.nav{width:100%;margin:0px 20px 0px 20px;}#iz63r{min-height:90vh;}#itp1f{font-size:2rem;margin:0px 0px 10px 0px;}.subtitle{font-size:1rem;margin:0px 0px 20px 0px;}.section{max-width:1200px;margin:80px auto 80px auto;}.subtitle.color--light{color:#636363;font-weight:700;}#idkdk{color:black;border-radius:100% 100% 100% 100%;}.button{font-weight:700;background-color:#dddddd;font-size:0.8rem;padding:12px 12px 12px 12px;display:inline-block;border:0 none black;}.button.button--primary{background-color:#5e85a8;color:white;}.button-bar{margin:10px 0px 10px 0px;display:flex;}#ibsgw{position:relative;top:3px;}.button-bar.button-bar--full-width{justify-content:space-between;align-items:center;}.button-bar_item{margin:20px 20px 20px 20px;}.button-bar_item.button-bar__item--secondary{font-size:0.8rem;color:#444444;}.button.button--secondary{font-weight:400;}.bg-white{background-color:#ffffff;}.rounded{border-radius:5px 5px 5px 5px;}#ilzpl{min-height:100px;}#i238z{padding:10px;}.footer{display:block;margin:20px 0px 0 0px;padding:1px 0px 1px 0px;}.skeleton-text.skeleton{background-color:#dddddd;color:transparent;opacity:0.31;border-radius:5px 5px 5px 5px;}.skeleton.skeleton-button{color:transparent;opacity:0.16;}.skeleton-anim{position:relative;}.nav__item.active{color:black;}.margin-20{margin:20px 0px 20px 0px;}#i0ro3{display:none;}.loading__item.loaded-true{display:none;}#i69a7{width:100%;}.flex-no-shrink{flex-shrink:0;}.button--small{padding:5px 10px 5px 10px;}.form{padding:10px 10px 10px 10px;border-radius:5px 5px 5px 5px;}#i1nmbc{flex-shrink:0;}.input{padding:10px 10px 10px 10px;background-color:transparent;border:1px solid #5e85a8;}.full-width{width:100%;}.v-space{margin:10px 0px 10px 0px;}#ihwwxz{min-height:100px;}.box{border:2px solid #5e85a8;}.box__header{margin:0px 0px 0px 0px;padding:10px 0px 10px 10px;}.box.horizontal{align-items:center;}.horizontal{display:flex;align-items:center;}.h-space{margin:0px 10px 0px 10px;}.button.button--tertiary{border:0px none black;}.button--tertiary{background-color:transparent;font-weight:400;}.icon-font{font-size:1.5rem;line-height:1px;margin:0px 2px 0px 2px;}.lang__item{margin:0px 5px 0px 5px;}.button--primary.right-space{margin:0 10px 0 0;}.top-space-40{margin:40px 0 0 0;}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
<!DOCTYPE html><html lang=""><head><link rel="stylesheet" href="/css/main.css">
|
|
2
|
+
<link
|
|
3
|
+
rel="alternate"
|
|
4
|
+
hreflang="fr"
|
|
5
|
+
href="/fr/" /> <!--
|
|
6
|
+
<div class="app">
|
|
7
|
+
<div v-if="showLoginForm">
|
|
8
|
+
<h2>Login</h2>
|
|
9
|
+
<form @submit.prevent="login">
|
|
10
|
+
<label>
|
|
11
|
+
Username:
|
|
12
|
+
<input type="text" v-model="username" required />
|
|
13
|
+
</label>
|
|
14
|
+
<label>
|
|
15
|
+
Password:
|
|
16
|
+
<input type="password" v-model="password" required />
|
|
17
|
+
</label>
|
|
18
|
+
<button type="submit">Login</button>
|
|
19
|
+
</form>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div v-if="loggedIn">
|
|
23
|
+
<button @click="showLoginForm = true; loggedIn = false; websites = []">Logout</button>
|
|
24
|
+
<h2>Websites</h2>
|
|
25
|
+
<ul>
|
|
26
|
+
<li v-for="(website, index) in websites" :key="index">
|
|
27
|
+
<div v-text="website.name || website.id"></div>
|
|
28
|
+
<button @click="deleteWebsite(website.id)">Delete</button>
|
|
29
|
+
</li>
|
|
30
|
+
</ul>
|
|
31
|
+
|
|
32
|
+
<button @click="showCreationForm = true">Create Website</button>
|
|
33
|
+
|
|
34
|
+
<div v-if="showCreationForm">
|
|
35
|
+
<h2>Create Website</h2>
|
|
36
|
+
<form @submit.prevent="createWebsite">
|
|
37
|
+
<label>
|
|
38
|
+
Website Name:
|
|
39
|
+
<input type="text" v-model="newWebsiteName" required />
|
|
40
|
+
</label>
|
|
41
|
+
<button type="submit">Create</button>
|
|
42
|
+
</form>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div v-if="error">
|
|
47
|
+
<p>Error: </p>
|
|
48
|
+
<button @click="error = null">Dismiss</button>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<div v-if="message">
|
|
52
|
+
<p></p>
|
|
53
|
+
<button @click="message = null">Dismiss</button>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
-->
|
|
57
|
+
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
|
|
58
|
+
<script>
|
|
59
|
+
const { createApp, ref, onMounted, reactive } = Vue;
|
|
60
|
+
const apiUrl = 'http://localhost:6805';
|
|
61
|
+
|
|
62
|
+
const App = {
|
|
63
|
+
data() {
|
|
64
|
+
return {
|
|
65
|
+
websites: [],
|
|
66
|
+
newWebsiteName: '',
|
|
67
|
+
showCreationForm: false,
|
|
68
|
+
error: null,
|
|
69
|
+
message: null,
|
|
70
|
+
showLoginForm: false,
|
|
71
|
+
username: '',
|
|
72
|
+
password: '',
|
|
73
|
+
loggedIn: true,
|
|
74
|
+
loading: true,
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
mounted() {
|
|
78
|
+
if (this.loggedIn) this.fetchWebsites()
|
|
79
|
+
else this.showLoginForm = true
|
|
80
|
+
},
|
|
81
|
+
methods: {
|
|
82
|
+
openEditor(id) {
|
|
83
|
+
window.open(`${apiUrl}/?id=${id}`)
|
|
84
|
+
},
|
|
85
|
+
async fetchWebsites() {
|
|
86
|
+
this.loading = true
|
|
87
|
+
try {
|
|
88
|
+
const response = await fetch(`${apiUrl}/website/`)
|
|
89
|
+
if (!response.ok) {
|
|
90
|
+
throw new Error(`HTTP error! status: ${response.status}`)
|
|
91
|
+
}
|
|
92
|
+
this.websites = await response.json();
|
|
93
|
+
} catch (error) {
|
|
94
|
+
this.error = 'Failed to fetch websites'
|
|
95
|
+
}
|
|
96
|
+
this.loading = false
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
async login() {
|
|
100
|
+
this.loading = true
|
|
101
|
+
try {
|
|
102
|
+
const response = await fetch(`${apiUrl}/me/`, {
|
|
103
|
+
method: 'POST',
|
|
104
|
+
headers: {
|
|
105
|
+
'Content-Type': 'application/json',
|
|
106
|
+
},
|
|
107
|
+
body: JSON.stringify({
|
|
108
|
+
username: this.username,
|
|
109
|
+
password: this.password,
|
|
110
|
+
}),
|
|
111
|
+
})
|
|
112
|
+
if (!response.ok) {
|
|
113
|
+
throw new Error(`HTTP error! status: ${response.status}`)
|
|
114
|
+
}
|
|
115
|
+
this.loggedIn = true;
|
|
116
|
+
this.showLoginForm = false;
|
|
117
|
+
await this.fetchWebsites()
|
|
118
|
+
} catch (error) {
|
|
119
|
+
this.error = 'Failed to log in'
|
|
120
|
+
}
|
|
121
|
+
this.loading = false
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
async createWebsite() {
|
|
125
|
+
if(!this.newWebsiteName) throw new Error('You need to provide a website name')
|
|
126
|
+
this.loading = true
|
|
127
|
+
try {
|
|
128
|
+
const id = this.newWebsiteName.replace(/[/\\?%*:|"<>]/g, '_')
|
|
129
|
+
const response = await fetch(`${apiUrl}/website/?id=${id}`, {
|
|
130
|
+
method: 'POST',
|
|
131
|
+
headers: {
|
|
132
|
+
'Content-Type': 'application/json',
|
|
133
|
+
},
|
|
134
|
+
body: JSON.stringify({
|
|
135
|
+
name: this.newWebsiteName,
|
|
136
|
+
}),
|
|
137
|
+
})
|
|
138
|
+
if (!response.ok) {
|
|
139
|
+
throw new Error(`HTTP error! status: ${response.status}`)
|
|
140
|
+
}
|
|
141
|
+
this.message = 'Website created successfully'
|
|
142
|
+
this.newWebsiteName = ''
|
|
143
|
+
this.showCreationForm = false;
|
|
144
|
+
await this.fetchWebsites()
|
|
145
|
+
} catch (error) {
|
|
146
|
+
this.error = 'Failed to create website'
|
|
147
|
+
}
|
|
148
|
+
this.loading = false
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
async deleteWebsite(id) {
|
|
152
|
+
const ok = confirm('Deleting a website? Are your sure? Really?')
|
|
153
|
+
if(!ok) return
|
|
154
|
+
this.loading = true
|
|
155
|
+
try {
|
|
156
|
+
const response = await fetch(`${apiUrl}/website/?id=${id}`, {
|
|
157
|
+
method: 'DELETE',
|
|
158
|
+
})
|
|
159
|
+
if (!response.ok) {
|
|
160
|
+
throw new Error(`HTTP error! status: ${response.status}`)
|
|
161
|
+
}
|
|
162
|
+
this.message = 'Website deleted successfully'
|
|
163
|
+
await this.fetchWebsites()
|
|
164
|
+
} catch (error) {
|
|
165
|
+
this.error = 'Failed to delete website'
|
|
166
|
+
}
|
|
167
|
+
this.loading = false
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
window.addEventListener('load', () => {
|
|
173
|
+
createApp(App).mount('.app');
|
|
174
|
+
})
|
|
175
|
+
</script>
|
|
176
|
+
<style>.button{cursor:pointer}.skeleton-anim:after{width:100%;height:100%;position:absolute;top:0;left:0;content:"";background:linear-gradient(.25turn,transparent,rgba(255,255,255,.75),transparent),linear-gradient(transparent,transparent),radial-gradient(38px circle at 19px 19px,transparent 50%,transparent 51%),linear-gradient(transparent,transparent);background-repeat:no-repeat;background-size:315px 250px,315px 180px,100px 100px,225px 30px;background-position:-315px 0,0 0,0 190px,50px 195px;animation:loading 1.5s infinite}@keyframes loading{to{background-position:200% 0,0 0,0 190px,50px 195px}}</style><title>Silex Dashboard</title><link rel="icon" href=""><meta property="description" content=""><meta property="og:title" content=""><meta property="og:description" content=""><meta property="og:image" content=""></head><body id="ik0i" class="body loading"><header id="igrg" class="header padding-normal"><img id="ir7s" src="/assets//silex-icon-2018@200px.png"><nav id="i9jq" class="nav"><a id="iels" href="/" class="nav__item active" target="">Sites</a><a id="iels" href="http://docs.silex.me/" class="nav__item " target="_blank">Docs</a><a id="iels" href="https://www.silex.me/" class="nav__item " target="_blank">About</a><a id="iels" href="https://mail-list.silexlabs.org/subscription/cemnfkaVrK?locale=en-US&source=silex-dashboard" class="nav__item " target="_blank">News</a></nav><div id="i2red7" class="lang h-space"><a href="/en" id="iciz" class="lang__item nav__item active" hreflang="en">en</a><a href="/fr" id="iciz" class="lang__item nav__item " hreflang="fr">fr</a></div><div id="i24ew"><img id="idkdk" src="/assets//alex-small.jpg" src="${json.avatar.url}"></div></header><main id="iz63r" class="padding-normal section app"><h1 id="itp1f">Welcome back!</h1><div id="iyex8" class="subtitle color--light">Dive into your projects or kickstart a new one</div><div id="ickx4" class="button-bar margin-20"><div id="i2x0l" class="button button--primary rounded top-space-40" @click="showCreationForm = !showCreationForm" v-if="!showCreationForm"><span id="ibsgw" class="icon-font">+</span><span id="itl2n8">Create website</span></div><div id="i0ro3" class="button button--secondary rounded">Import</div></div><div id="ihwwxz" class="box top-space-40" v-if="showCreationForm"><h3 id="i3gd1b" class="box__header">Create a new website</h3><form method="get" id="i50acf" class="form" @submit.prevent="createWebsite"><div id="igtg1t" class="v-space"><label id="i1nmbc" class="v-space">Website name</label><input type="text" id="ij5iwh" placeholder="My project website" class="input full-width" v-model="newWebsiteName"></div><div id="ie0xes"><button type="submit" id="i021na" class="button rounded button--primary right-space">Create</button><button type="reset" class="button rounded button--secondary" @click="showCreationForm = !showCreationForm">Cancel</button></div></form></div><div id="if80m"><section id="idgvg" class="button-bar button-bar--full-width bg-white rounded loaded__item" v-if="!loading" v-for="(website, index) in websites" :key="index"><h3 id="i69a7" class="button-bar_item button-bar__item--main" v-text="website.name || website.id">My first website</h3><p id="i65hn" class="button-bar_item button-bar__item--secondary flex-no-shrink" v-text="'Updated ' + new Date(website.stats.mtime).toLocaleDateString(undefined, { day: 'numeric', month: 'long', year: 'numeric' })">Updated 1h ago by lexoyo</p><p id="i64qa" class="button-bar_item button-bar__item--secondary flex-no-shrink" v-text="'Created ' + new Date(website.stats.birthtime).toLocaleDateString(undefined, { day: 'numeric', month: 'long', year: 'numeric' })">Created 2023-02-16 by lexoyo</p><div id="i3b4tr" class="button-bar_item flex-no-shrink"><div id="ifyf6p" href="" class="button rounded button--primary button--small right-space" @click="openEditor(website.id)">Edit</div><div id="iol4h" class="button rounded button--secondary button--small" @click="deleteWebsite(website.id)" title="Delete">X</div></div></section><section id="i1fjn" class="button-bar button-bar--full-width bg-white rounded loading__item skeleton-anim skeleton-wrapper" v-if="loading"><h3 class="button-bar_item button-bar__item--main skeleton-text skeleton">My first websiteMy first websiteMy first websiteMy first</h3><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Updated 1h ago by lexoyo</p><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Created 2023-02-16 by lexoyo</p><div id="ixz6c" class="button-bar_item skeleton skeleton-button">Edit</div></section><section class="button-bar button-bar--full-width bg-white rounded loading__item skeleton-anim skeleton-wrapper" v-if="loading"><h3 class="button-bar_item button-bar__item--main skeleton-text skeleton">My first websiteMy first websiteMy first websiteMy first</h3><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Updated 1h ago by lexoyo</p><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Created 2023-02-16 by lexoyo</p><div class="button-bar_item skeleton skeleton-button">Edit</div></section><section class="button-bar button-bar--full-width bg-white rounded loading__item skeleton-anim skeleton-wrapper" v-if="loading"><h3 class="button-bar_item button-bar__item--main skeleton-text skeleton">My first websiteMy first websiteMy first websiteMy first</h3><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Updated 1h ago by lexoyo</p><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Created 2023-02-16 by lexoyo</p><div class="button-bar_item skeleton skeleton-button">Edit</div></section><section class="button-bar button-bar--full-width bg-white rounded loading__item skeleton-anim skeleton-wrapper" v-if="loading"><h3 class="button-bar_item button-bar__item--main skeleton-text skeleton">My first websiteMy first websiteMy first websiteMy first</h3><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Updated 1h ago by lexoyo</p><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Created 2023-02-16 by lexoyo</p><div class="button-bar_item skeleton skeleton-button">Edit</div></section><section class="button-bar button-bar--full-width bg-white rounded loading__item skeleton-anim skeleton-wrapper" v-if="loading"><h3 class="button-bar_item button-bar__item--main skeleton-text skeleton">My first websiteMy first websiteMy first websiteMy first</h3><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Updated 1h ago by lexoyo</p><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Created 2023-02-16 by lexoyo</p><div class="button-bar_item skeleton skeleton-button">Edit</div></section><section class="button-bar button-bar--full-width bg-white rounded loading__item skeleton-anim skeleton-wrapper" v-if="loading"><h3 class="button-bar_item button-bar__item--main skeleton-text skeleton">My first websiteMy first websiteMy first websiteMy first</h3><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Updated 1h ago by lexoyo</p><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Created 2023-02-16 by lexoyo</p><div class="button-bar_item skeleton skeleton-button">Edit</div></section></div><div id="i7ej6j" class="box horizontal" v-if="error"><div id="iv0eyi" class="full-width v-space h-space" v-text="error">Insert your text here</div><div id="i4656n" class="button rounded button--small button--tertiary" @click="error = null">Dismiss</div></div><div id="ilteie" class="box horizontal" v-if="message"><div id="i2d31v" class="full-width v-space h-space" v-text="message">Insert your text here</div><div id="i2urco" class="button rounded button--small button--tertiary" @click="message = null">Dismiss</div></div></main><footer id="ilzpl" class="header footer"><div id="i238z" class="section"></div></footer></body></html>
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
<!DOCTYPE html><html lang=""><head><link rel="stylesheet" href="/css/main.css">
|
|
2
|
+
<link
|
|
3
|
+
rel="alternate"
|
|
4
|
+
hreflang="en"
|
|
5
|
+
href="/en/" /> <!--
|
|
6
|
+
<div class="app">
|
|
7
|
+
<div v-if="showLoginForm">
|
|
8
|
+
<h2>Login</h2>
|
|
9
|
+
<form @submit.prevent="login">
|
|
10
|
+
<label>
|
|
11
|
+
Username:
|
|
12
|
+
<input type="text" v-model="username" required />
|
|
13
|
+
</label>
|
|
14
|
+
<label>
|
|
15
|
+
Password:
|
|
16
|
+
<input type="password" v-model="password" required />
|
|
17
|
+
</label>
|
|
18
|
+
<button type="submit">Login</button>
|
|
19
|
+
</form>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div v-if="loggedIn">
|
|
23
|
+
<button @click="showLoginForm = true; loggedIn = false; websites = []">Logout</button>
|
|
24
|
+
<h2>Websites</h2>
|
|
25
|
+
<ul>
|
|
26
|
+
<li v-for="(website, index) in websites" :key="index">
|
|
27
|
+
<div v-text="website.name || website.id"></div>
|
|
28
|
+
<button @click="deleteWebsite(website.id)">Delete</button>
|
|
29
|
+
</li>
|
|
30
|
+
</ul>
|
|
31
|
+
|
|
32
|
+
<button @click="showCreationForm = true">Create Website</button>
|
|
33
|
+
|
|
34
|
+
<div v-if="showCreationForm">
|
|
35
|
+
<h2>Create Website</h2>
|
|
36
|
+
<form @submit.prevent="createWebsite">
|
|
37
|
+
<label>
|
|
38
|
+
Website Name:
|
|
39
|
+
<input type="text" v-model="newWebsiteName" required />
|
|
40
|
+
</label>
|
|
41
|
+
<button type="submit">Create</button>
|
|
42
|
+
</form>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div v-if="error">
|
|
47
|
+
<p>Error: </p>
|
|
48
|
+
<button @click="error = null">Dismiss</button>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<div v-if="message">
|
|
52
|
+
<p></p>
|
|
53
|
+
<button @click="message = null">Dismiss</button>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
-->
|
|
57
|
+
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
|
|
58
|
+
<script>
|
|
59
|
+
const { createApp, ref, onMounted, reactive } = Vue;
|
|
60
|
+
const apiUrl = 'http://localhost:6805';
|
|
61
|
+
|
|
62
|
+
const App = {
|
|
63
|
+
data() {
|
|
64
|
+
return {
|
|
65
|
+
websites: [],
|
|
66
|
+
newWebsiteName: '',
|
|
67
|
+
showCreationForm: false,
|
|
68
|
+
error: null,
|
|
69
|
+
message: null,
|
|
70
|
+
showLoginForm: false,
|
|
71
|
+
username: '',
|
|
72
|
+
password: '',
|
|
73
|
+
loggedIn: true,
|
|
74
|
+
loading: true,
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
mounted() {
|
|
78
|
+
if (this.loggedIn) this.fetchWebsites()
|
|
79
|
+
else this.showLoginForm = true
|
|
80
|
+
},
|
|
81
|
+
methods: {
|
|
82
|
+
openEditor(id) {
|
|
83
|
+
window.open(`${apiUrl}/?id=${id}`)
|
|
84
|
+
},
|
|
85
|
+
async fetchWebsites() {
|
|
86
|
+
this.loading = true
|
|
87
|
+
try {
|
|
88
|
+
const response = await fetch(`${apiUrl}/website/`)
|
|
89
|
+
if (!response.ok) {
|
|
90
|
+
throw new Error(`HTTP error! status: ${response.status}`)
|
|
91
|
+
}
|
|
92
|
+
this.websites = await response.json();
|
|
93
|
+
} catch (error) {
|
|
94
|
+
this.error = 'Erreur, impossible de récupérer la liste des sites'
|
|
95
|
+
}
|
|
96
|
+
this.loading = false
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
async login() {
|
|
100
|
+
this.loading = true
|
|
101
|
+
try {
|
|
102
|
+
const response = await fetch(`${apiUrl}/me/`, {
|
|
103
|
+
method: 'POST',
|
|
104
|
+
headers: {
|
|
105
|
+
'Content-Type': 'application/json',
|
|
106
|
+
},
|
|
107
|
+
body: JSON.stringify({
|
|
108
|
+
username: this.username,
|
|
109
|
+
password: this.password,
|
|
110
|
+
}),
|
|
111
|
+
})
|
|
112
|
+
if (!response.ok) {
|
|
113
|
+
throw new Error(`Erreur HTTP ! status: ${response.status}`)
|
|
114
|
+
}
|
|
115
|
+
this.loggedIn = true;
|
|
116
|
+
this.showLoginForm = false;
|
|
117
|
+
await this.fetchWebsites()
|
|
118
|
+
} catch (error) {
|
|
119
|
+
this.error = 'Failed to log in'
|
|
120
|
+
}
|
|
121
|
+
this.loading = false
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
async createWebsite() {
|
|
125
|
+
if(!this.newWebsiteName) throw new Error('Vous n\'avez pas donné de nom à votre site')
|
|
126
|
+
this.loading = true
|
|
127
|
+
try {
|
|
128
|
+
const id = this.newWebsiteName.replace(/[/\\?%*:|"<>]/g, '_')
|
|
129
|
+
const response = await fetch(`${apiUrl}/website/?id=${id}`, {
|
|
130
|
+
method: 'POST',
|
|
131
|
+
headers: {
|
|
132
|
+
'Content-Type': 'application/json',
|
|
133
|
+
},
|
|
134
|
+
body: JSON.stringify({
|
|
135
|
+
name: this.newWebsiteName,
|
|
136
|
+
}),
|
|
137
|
+
})
|
|
138
|
+
if (!response.ok) {
|
|
139
|
+
throw new Error(`Erreur HTTP ! status: ${response.status}`)
|
|
140
|
+
}
|
|
141
|
+
this.message = 'Le site a bien été créé'
|
|
142
|
+
this.newWebsiteName = ''
|
|
143
|
+
this.showCreationForm = false;
|
|
144
|
+
await this.fetchWebsites()
|
|
145
|
+
} catch (error) {
|
|
146
|
+
this.error = 'Erreur, le site n\'a pas été créé'
|
|
147
|
+
}
|
|
148
|
+
this.loading = false
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
async deleteWebsite(id) {
|
|
152
|
+
const ok = confirm('Etes vous sûr.e de vouloir supprimer définitivement ce site ?')
|
|
153
|
+
if(!ok) return
|
|
154
|
+
this.loading = true
|
|
155
|
+
try {
|
|
156
|
+
const response = await fetch(`${apiUrl}/website/?id=${id}`, {
|
|
157
|
+
method: 'DELETE',
|
|
158
|
+
})
|
|
159
|
+
if (!response.ok) {
|
|
160
|
+
throw new Error(`HTTP error! status: ${response.status}`)
|
|
161
|
+
}
|
|
162
|
+
this.message = 'Le site a bien été effacé'
|
|
163
|
+
await this.fetchWebsites()
|
|
164
|
+
} catch (error) {
|
|
165
|
+
this.error = 'Erreur, le site n\'a pas été effacé'
|
|
166
|
+
}
|
|
167
|
+
this.loading = false
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
window.addEventListener('load', () => {
|
|
173
|
+
createApp(App).mount('.app');
|
|
174
|
+
})
|
|
175
|
+
</script>
|
|
176
|
+
<style>.button{cursor:pointer}.skeleton-anim:after{width:100%;height:100%;position:absolute;top:0;left:0;content:"";background:linear-gradient(.25turn,transparent,rgba(255,255,255,.75),transparent),linear-gradient(transparent,transparent),radial-gradient(38px circle at 19px 19px,transparent 50%,transparent 51%),linear-gradient(transparent,transparent);background-repeat:no-repeat;background-size:315px 250px,315px 180px,100px 100px,225px 30px;background-position:-315px 0,0 0,0 190px,50px 195px;animation:loading 1.5s infinite}@keyframes loading{to{background-position:200% 0,0 0,0 190px,50px 195px}}</style><title>Dashboard Silex</title><link rel="icon" href=""><meta property="description" content=""><meta property="og:title" content=""><meta property="og:description" content=""><meta property="og:image" content=""></head><body id="ik0i" class="body loading"><header id="igrg" class="header padding-normal"><img id="ir7s" src="/assets//silex-icon-2018@200px.png"><nav id="i9jq" class="nav"><a id="iels" href="/" class="nav__item active" target="">Sites</a><a id="iels" href="http://docs.silex.me/" class="nav__item " target="_blank">Docs</a><a id="iels" href="https://www.silex.me/" class="nav__item " target="_blank">A propos</a><a id="iels" href="https://mail-list.silexlabs.org/subscription/cemnfkaVrK?locale=fr-FR&source=silex-dashboard" class="nav__item " target="_blank">Info</a></nav><div id="i2red7" class="lang h-space"><a href="/en" id="iciz" class="lang__item nav__item " hreflang="en">en</a><a href="/fr" id="iciz" class="lang__item nav__item active" hreflang="fr">fr</a></div><div id="i24ew"><img id="idkdk" src="/assets//alex-small.jpg" src="${json.avatar.url}"></div></header><main id="iz63r" class="padding-normal section app"><h1 id="itp1f">Bienvenue !</h1><div id="iyex8" class="subtitle color--light">Plongez-vous dans un projet ou créez-en un nouveau</div><div id="ickx4" class="button-bar margin-20"><div id="i2x0l" class="button button--primary rounded top-space-40" @click="showCreationForm = !showCreationForm" v-if="!showCreationForm"><span id="ibsgw" class="icon-font">+</span><span id="itl2n8">Créer un site</span></div><div id="i0ro3" class="button button--secondary rounded">Import</div></div><div id="ihwwxz" class="box top-space-40" v-if="showCreationForm"><h3 id="i3gd1b" class="box__header">Créer un nouveau site internet</h3><form method="get" id="i50acf" class="form" @submit.prevent="createWebsite"><div id="igtg1t" class="v-space"><label id="i1nmbc" class="v-space">Nom du site</label><input type="text" id="ij5iwh" placeholder="Mon super projet" class="input full-width" v-model="newWebsiteName"></div><div id="ie0xes"><button type="submit" id="i021na" class="button rounded button--primary right-space">Créer</button><button type="reset" class="button rounded button--secondary" @click="showCreationForm = !showCreationForm">Annuler</button></div></form></div><div id="if80m"><section id="idgvg" class="button-bar button-bar--full-width bg-white rounded loaded__item" v-if="!loading" v-for="(website, index) in websites" :key="index"><h3 id="i69a7" class="button-bar_item button-bar__item--main" v-text="website.name || website.id">My first website</h3><p id="i65hn" class="button-bar_item button-bar__item--secondary flex-no-shrink" v-text="'Mis à jour le ' + new Date(website.stats.mtime).toLocaleDateString(undefined, { day: 'numeric', month: 'long', year: 'numeric' })">Updated 1h ago by lexoyo</p><p id="i64qa" class="button-bar_item button-bar__item--secondary flex-no-shrink" v-text="'Créé le ' + new Date(website.stats.birthtime).toLocaleDateString(undefined, { day: 'numeric', month: 'long', year: 'numeric' })">Created 2023-02-16 by lexoyo</p><div id="i3b4tr" class="button-bar_item flex-no-shrink"><div id="ifyf6p" href="" class="button rounded button--primary button--small right-space" @click="openEditor(website.id)">Editer</div><div id="iol4h" class="button rounded button--secondary button--small" @click="deleteWebsite(website.id)" title="Supprimer">X</div></div></section><section id="i1fjn" class="button-bar button-bar--full-width bg-white rounded loading__item skeleton-anim skeleton-wrapper" v-if="loading"><h3 class="button-bar_item button-bar__item--main skeleton-text skeleton">My first websiteMy first websiteMy first websiteMy first</h3><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Updated 1h ago by lexoyo</p><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Created 2023-02-16 by lexoyo</p><div id="ixz6c" class="button-bar_item skeleton skeleton-button">Edit</div></section><section class="button-bar button-bar--full-width bg-white rounded loading__item skeleton-anim skeleton-wrapper" v-if="loading"><h3 class="button-bar_item button-bar__item--main skeleton-text skeleton">My first websiteMy first websiteMy first websiteMy first</h3><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Updated 1h ago by lexoyo</p><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Created 2023-02-16 by lexoyo</p><div class="button-bar_item skeleton skeleton-button">Edit</div></section><section class="button-bar button-bar--full-width bg-white rounded loading__item skeleton-anim skeleton-wrapper" v-if="loading"><h3 class="button-bar_item button-bar__item--main skeleton-text skeleton">My first websiteMy first websiteMy first websiteMy first</h3><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Updated 1h ago by lexoyo</p><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Created 2023-02-16 by lexoyo</p><div class="button-bar_item skeleton skeleton-button">Edit</div></section><section class="button-bar button-bar--full-width bg-white rounded loading__item skeleton-anim skeleton-wrapper" v-if="loading"><h3 class="button-bar_item button-bar__item--main skeleton-text skeleton">My first websiteMy first websiteMy first websiteMy first</h3><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Updated 1h ago by lexoyo</p><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Created 2023-02-16 by lexoyo</p><div class="button-bar_item skeleton skeleton-button">Edit</div></section><section class="button-bar button-bar--full-width bg-white rounded loading__item skeleton-anim skeleton-wrapper" v-if="loading"><h3 class="button-bar_item button-bar__item--main skeleton-text skeleton">My first websiteMy first websiteMy first websiteMy first</h3><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Updated 1h ago by lexoyo</p><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Created 2023-02-16 by lexoyo</p><div class="button-bar_item skeleton skeleton-button">Edit</div></section><section class="button-bar button-bar--full-width bg-white rounded loading__item skeleton-anim skeleton-wrapper" v-if="loading"><h3 class="button-bar_item button-bar__item--main skeleton-text skeleton">My first websiteMy first websiteMy first websiteMy first</h3><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Updated 1h ago by lexoyo</p><p class="button-bar_item button-bar__item--secondary skeleton-text skeleton">Created 2023-02-16 by lexoyo</p><div class="button-bar_item skeleton skeleton-button">Edit</div></section></div><div id="i7ej6j" class="box horizontal" v-if="error"><div id="iv0eyi" class="full-width v-space h-space" v-text="error">Insert your text here</div><div id="i4656n" class="button rounded button--small button--tertiary" @click="error = null">Fermer</div></div><div id="ilteie" class="box horizontal" v-if="message"><div id="i2d31v" class="full-width v-space h-space" v-text="message">Insert your text here</div><div id="i2urco" class="button rounded button--small button--tertiary" @click="message = null">Fermer</div></div></main><footer id="ilzpl" class="header footer"><div id="i238z" class="section"><p><a href="https://www.silex.me/">Silex website builder</a> est un projet libre et open source, supporté par l'<a href="https://www.silexlabs.org/">association Silex Labs</a></p>
|
|
177
|
+
</div></footer></body></html>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
---
|
|
2
|
+
permalink: /css/main.css
|
|
3
|
+
---
|
|
4
|
+
* { box-sizing: border-box; } body {margin: 0;}.nav__item{margin:0px 10px 0px 10px;font-size:0.8rem;padding:24px 0px 24px 0px;color:grey;font-weight:700;}.body{font-family:"Roboto", sans-serif;background-color:#f0f0f0;}.header{display:flex;align-items:center;justify-content:space-between;background-color:#ffffff;}#ir7s{color:black;width:32px;height:32px;}.padding-normal{padding:0px 24px 0px 24px;}#i9jq{display:flex;}.nav{width:100%;margin:0px 20px 0px 20px;}#iz63r{min-height:90vh;}#itp1f{font-size:2rem;margin:0px 0px 10px 0px;}.subtitle{font-size:1rem;margin:0px 0px 20px 0px;}.section{max-width:1200px;margin:80px auto 80px auto;}.subtitle.color--light{color:#636363;font-weight:700;}#idkdk{color:black;border-radius:100% 100% 100% 100%;}.button{font-weight:700;background-color:#dddddd;font-size:0.8rem;padding:12px 12px 12px 12px;display:inline-block;border:0 none black;}.button.button--primary{background-color:#5e85a8;color:white;}.button-bar{margin:10px 0px 10px 0px;display:flex;}#ibsgw{position:relative;top:3px;}.button-bar.button-bar--full-width{justify-content:space-between;align-items:center;}.button-bar_item{margin:20px 20px 20px 20px;}.button-bar_item.button-bar__item--secondary{font-size:0.8rem;color:#444444;}.button.button--secondary{font-weight:400;}.bg-white{background-color:#ffffff;}.rounded{border-radius:5px 5px 5px 5px;}#ilzpl{min-height:100px;}#i238z{padding:10px;}.footer{display:block;margin:20px 0px 0 0px;padding:1px 0px 1px 0px;}.skeleton-text.skeleton{background-color:#dddddd;color:transparent;opacity:0.31;border-radius:5px 5px 5px 5px;}.skeleton.skeleton-button{color:transparent;opacity:0.16;}.skeleton-anim{position:relative;}#ixz6c{padding:10px;}.nav__item.active{color:black;}.margin-20{margin:20px 0px 20px 0px;}#i0ro3{display:none;}.loading__item.loaded-true{display:none;}#il9yj{padding:10px;}#i4szg{padding:10px;}#iajsm{padding:10px;}#i6hzwc{padding:10px;}#i69a7{width:100%;}.flex-no-shrink{flex-shrink:0;}.button--small{padding:5px 10px 5px 10px;}.form{padding:10px 10px 10px 10px;border-radius:5px 5px 5px 5px;}#i1nmbc{flex-shrink:0;}.input{padding:10px 10px 10px 10px;background-color:transparent;border:1px solid #5e85a8;}.full-width{width:100%;}.v-space{margin:10px 0px 10px 0px;}#ihwwxz{min-height:100px;}.box{border:2px solid #5e85a8;}.box__header{margin:0px 0px 0px 0px;padding:10px 0px 10px 10px;}.box.horizontal{align-items:center;}.horizontal{display:flex;align-items:center;}.h-space{margin:0px 10px 0px 10px;}.button.button--tertiary{border:0px none black;}.button--tertiary{background-color:transparent;font-weight:400;}.icon-font{font-size:1.5rem;line-height:1px;margin:0px 2px 0px 2px;}.lang__item{margin:0px 5px 0px 5px;}.button--primary.right-space{margin:0 10px 0 0;}.top-space-40{margin:40px 0 0 0;}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@silexlabs/silex-dashboard",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Dashboard for Silex v3",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"start": "SILEX_CORS_URL=* FS_ROOT=`pwd`/.silex SILEX_DEBUG=true silex",
|
|
8
|
+
"build": "eleventy",
|
|
9
|
+
"serve": "eleventy --serve"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+ssh://git@github.com/silexlabs/silex-dashboard.git"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"silex",
|
|
17
|
+
"plugin"
|
|
18
|
+
],
|
|
19
|
+
"author": "lexoyo",
|
|
20
|
+
"license": "GPL-3.0-or-later",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/silexlabs/silex-dashboard/issues"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/silexlabs/silex-dashboard#readme",
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@11ty/eleventy": "^2.0.1",
|
|
27
|
+
"@silexlabs/silex": "^3.0.0-alpha.30"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: main
|
|
3
|
+
lang: en
|
|
4
|
+
title: Silex Dashboard
|
|
5
|
+
title2: Welcome back!
|
|
6
|
+
subtitle: Dive into your projects or kickstart a new one
|
|
7
|
+
add-button: Create website
|
|
8
|
+
add-title: Create a new website
|
|
9
|
+
add-name-label: Website name
|
|
10
|
+
add-name-placeholder: My project website
|
|
11
|
+
add-ok: Create
|
|
12
|
+
add-cancel: Cancel
|
|
13
|
+
list-item-updated: Updated
|
|
14
|
+
list-item-created: Created
|
|
15
|
+
list-edit: Edit
|
|
16
|
+
list-delete: Delete
|
|
17
|
+
message-dismiss: Dismiss
|
|
18
|
+
nav:
|
|
19
|
+
- label: Sites
|
|
20
|
+
url: /
|
|
21
|
+
- label: Docs
|
|
22
|
+
url: http://docs.silex.me/
|
|
23
|
+
target: _blank
|
|
24
|
+
- label: About
|
|
25
|
+
url: https://www.silex.me/
|
|
26
|
+
target: _blank
|
|
27
|
+
- label: News
|
|
28
|
+
url: https://mail-list.silexlabs.org/subscription/cemnfkaVrK?locale=en-US&source=silex-dashboard
|
|
29
|
+
target: _blank
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
---
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: main
|
|
3
|
+
lang: fr
|
|
4
|
+
title: Dashboard Silex
|
|
5
|
+
title2: Bienvenue !
|
|
6
|
+
subtitle: Plongez-vous dans un projet ou créez-en un nouveau
|
|
7
|
+
add-button: Créer un site
|
|
8
|
+
add-title: Créer un nouveau site internet
|
|
9
|
+
add-name-label: Nom du site
|
|
10
|
+
add-name-placeholder: Mon super projet
|
|
11
|
+
add-ok: Créer
|
|
12
|
+
add-cancel: Annuler
|
|
13
|
+
list-item-updated: Mis à jour le
|
|
14
|
+
list-item-created: Créé le
|
|
15
|
+
list-edit: Editer
|
|
16
|
+
list-delete: Supprimer
|
|
17
|
+
message-dismiss: Fermer
|
|
18
|
+
nav:
|
|
19
|
+
- label: Sites
|
|
20
|
+
url: /
|
|
21
|
+
- label: Docs
|
|
22
|
+
url: http://docs.silex.me/
|
|
23
|
+
target: _blank
|
|
24
|
+
- label: A propos
|
|
25
|
+
url: https://www.silex.me/
|
|
26
|
+
target: _blank
|
|
27
|
+
- label: Info
|
|
28
|
+
url: https://mail-list.silexlabs.org/subscription/cemnfkaVrK?locale=fr-FR&source=silex-dashboard
|
|
29
|
+
target: _blank
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
[Silex website builder](https://www.silex.me/) est un projet libre et open source, supporté par l'[association Silex Labs](https://www.silexlabs.org/)
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
---
|
|
2
|
+
permalink: /css/main.css
|
|
3
|
+
---
|
|
4
|
+
* { box-sizing: border-box; } body {margin: 0;}.nav__item{margin:0px 10px 0px 10px;font-size:0.8rem;padding:24px 0px 24px 0px;color:grey;font-weight:700;}.body{font-family:"Roboto", sans-serif;background-color:#f0f0f0;}.header{display:flex;align-items:center;justify-content:space-between;background-color:#ffffff;}#ir7s{color:black;width:32px;height:32px;}.padding-normal{padding:0px 24px 0px 24px;}#i9jq{display:flex;}.nav{width:100%;margin:0px 20px 0px 20px;}#iz63r{min-height:90vh;}#itp1f{font-size:2rem;margin:0px 0px 10px 0px;}.subtitle{font-size:1rem;margin:0px 0px 20px 0px;}.section{max-width:1200px;margin:80px auto 80px auto;}.subtitle.color--light{color:#636363;font-weight:700;}#idkdk{color:black;border-radius:100% 100% 100% 100%;}.button{font-weight:700;background-color:#dddddd;font-size:0.8rem;padding:12px 12px 12px 12px;display:inline-block;border:0 none black;}.button.button--primary{background-color:#5e85a8;color:white;}.button-bar{margin:10px 0px 10px 0px;display:flex;}#ibsgw{position:relative;top:3px;}.button-bar.button-bar--full-width{justify-content:space-between;align-items:center;}.button-bar_item{margin:20px 20px 20px 20px;}.button-bar_item.button-bar__item--secondary{font-size:0.8rem;color:#444444;}.button.button--secondary{font-weight:400;}.bg-white{background-color:#ffffff;}.rounded{border-radius:5px 5px 5px 5px;}#ilzpl{min-height:100px;}#i238z{padding:10px;}.footer{display:block;margin:20px 0px 0 0px;padding:1px 0px 1px 0px;}.skeleton-text.skeleton{background-color:#dddddd;color:transparent;opacity:0.31;border-radius:5px 5px 5px 5px;}.skeleton.skeleton-button{color:transparent;opacity:0.16;}.skeleton-anim{position:relative;}.nav__item.active{color:black;}.margin-20{margin:20px 0px 20px 0px;}#i0ro3{display:none;}.loading__item.loaded-true{display:none;}#i69a7{width:100%;}.flex-no-shrink{flex-shrink:0;}.button--small{padding:5px 10px 5px 10px;}.form{padding:10px 10px 10px 10px;border-radius:5px 5px 5px 5px;}#i1nmbc{flex-shrink:0;}.input{padding:10px 10px 10px 10px;background-color:transparent;border:1px solid #5e85a8;}.full-width{width:100%;}.v-space{margin:10px 0px 10px 0px;}#ihwwxz{min-height:100px;}.box{border:2px solid #5e85a8;}.box__header{margin:0px 0px 0px 0px;padding:10px 0px 10px 10px;}.box.horizontal{align-items:center;}.horizontal{display:flex;align-items:center;}.h-space{margin:0px 10px 0px 10px;}.button.button--tertiary{border:0px none black;}.button--tertiary{background-color:transparent;font-weight:400;}.icon-font{font-size:1.5rem;line-height:1px;margin:0px 2px 0px 2px;}.lang__item{margin:0px 5px 0px 5px;}.button--primary.right-space{margin:0 10px 0 0;}.top-space-40{margin:40px 0 0 0;}
|