@silexlabs/silex-dashboard 1.0.48 → 1.0.49

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.
Files changed (25) hide show
  1. package/_site/connectors/index.html +354 -0
  2. package/_site/css/connectors-187142925083dd32992cd4c78462f9a7e20f6fc462524b566ed616fd6d3d2b46.css +1 -0
  3. package/_site/css/connectors-bb5104e4124d29465b3866b632c9a173d84b60bc78e4cd1607bc92a1ca85fb5b.css +1 -0
  4. package/_site/css/connectors-d7d00ca2aa235acdf7535c1e8faba94fe05e8a8863db5fc4421cd9369c811928.css +1 -0
  5. package/_site/css/websites-5cf941724b3798508df646193a48dcf4ec08e709d92aa33e06f09632a8b1b0a5.css +1 -0
  6. package/_site/en/connectors/index.html +5 -5
  7. package/_site/en/index.html +1 -1
  8. package/_site/fr/connectors/index.html +5 -5
  9. package/_site/fr/index.html +1 -1
  10. package/_site/js/main.js +105 -104
  11. package/_site/websites/index.html +350 -0
  12. package/package.json +1 -1
  13. package/templates/connectors-en.11tydata.mjs +1 -1
  14. package/templates/connectors-en.html +56 -56
  15. package/templates/connectors-fr.11tydata.mjs +1 -1
  16. package/templates/connectors-fr.html +56 -56
  17. package/templates/connectors.html +354 -0
  18. package/templates/css/connectors-187142925083dd32992cd4c78462f9a7e20f6fc462524b566ed616fd6d3d2b46.css +1 -0
  19. package/templates/css/connectors-bb5104e4124d29465b3866b632c9a173d84b60bc78e4cd1607bc92a1ca85fb5b.css +1 -0
  20. package/templates/css/connectors-d7d00ca2aa235acdf7535c1e8faba94fe05e8a8863db5fc4421cd9369c811928.css +1 -0
  21. package/templates/css/websites-5cf941724b3798508df646193a48dcf4ec08e709d92aa33e06f09632a8b1b0a5.css +1 -0
  22. package/templates/websites-en.html +80 -80
  23. package/templates/websites-fr.html +80 -80
  24. package/templates/websites.html +350 -0
  25. package/tina/tina-lock.json +1 -1
@@ -0,0 +1,350 @@
1
+ <!DOCTYPE html>
2
+ <html lang="">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <link rel="stylesheet" href="/css/websites-5cf941724b3798508df646193a48dcf4ec08e709d92aa33e06f09632a8b1b0a5.css" />
6
+ <!-- font google -->
7
+ <link rel="preconnect" href="https://fonts.gstatic.com" />
8
+ <link href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;700&display=swap" rel="stylesheet">
9
+ {% render "alternate.liquid" languages: languages lang: lang page: page %}
10
+ <style>
11
+ .before-js > * {
12
+ visibility: hidden;
13
+ opacity: 0;
14
+ transition: opacity .5s ease;
15
+ }
16
+ .before-js[data-gjs-type] > *, /* This is only inside the editor, .before-js needs to be on the body */
17
+ .after-js > * {
18
+ visibility: visible;
19
+ opacity: 1;
20
+ }
21
+ .before-js:before {
22
+ content: 'Loading';
23
+ position: absolute;
24
+ top: 49%;
25
+ left: 49%;
26
+ }
27
+ .before-js[data-gjs-type]:before, /* This is only inside the editor, .before-js needs to be on the body */
28
+ .after-js:before {
29
+ content: none;
30
+ }
31
+ /*BTNS*/
32
+ .button, .pointer {
33
+ cursor: pointer!important}
34
+ .button{
35
+ min-width:110px;
36
+ }
37
+ /*BTNS*/
38
+ a {
39
+ text-decoration: none;
40
+ color:#8873FE;
41
+ }
42
+ a:hover {
43
+ text-decoration: underline;
44
+ }
45
+ .uppercase {
46
+ text-transform: uppercase;
47
+ }
48
+ .underline:hover{
49
+ text-decoration: underline;
50
+ text-decoration-thickness: from-font;
51
+ text-underline-position: under;
52
+ }
53
+ /*footer position*/
54
+ .main-min-height {
55
+ min-height: calc(100vh - 560px);
56
+ }
57
+ /*footer position*/
58
+ /*label*/
59
+ ::placeholder {
60
+ color: #8873FE;
61
+ }
62
+ input:focus {
63
+ border: 2px solid #9977FE;
64
+ background-color:#ffffff;
65
+ }
66
+ :focus {
67
+ outline: none;
68
+ }
69
+ /*label*/
70
+ .skeleton-anim:after {
71
+ width: 100%;
72
+ height: 100%;
73
+ position: absolute;
74
+ top: 0;
75
+ left: 0;
76
+ content: "";
77
+ background:
78
+ linear-gradient(0.25turn, transparent, rgba(255,255,255,.75), transparent),
79
+ linear-gradient(transparent, transparent),
80
+ radial-gradient(38px circle at 19px 19px, transparent 50%, transparent 51%),
81
+ linear-gradient(transparent, transparent);
82
+ background-repeat: no-repeat;
83
+ background-size: 315px 250px, 315px 180px, 100px 100px, 225px 30px;
84
+ background-position: -315px 0, 0 0, 0px 190px, 50px 195px;
85
+ animation: loading 1.5s infinite;
86
+ }
87
+ @keyframes loading {
88
+ to {
89
+ background-position: 200% 0, 0 0, 0 190px, 50px 195px;
90
+ }
91
+ }
92
+ /*FX ANIMATIONS*/
93
+ /*scale-round-inside_pour-BTN*/
94
+ .fx-scale-round {
95
+ position:relative;
96
+ z-index: 10;
97
+ overflow: hidden;
98
+ }
99
+ .fx-scale-round::after {
100
+ content: "";
101
+ background: #ffffff;
102
+ position: absolute;
103
+ z-index: -1;
104
+ border-radius: 50%;
105
+ left: -50%;
106
+ right: -50%;
107
+ top: -100%;
108
+ bottom: -100%;
109
+ transform: scale(0, 0);
110
+ transform-origin: center bottom;
111
+ transition: all 0.3s ease-out;
112
+ }
113
+ .fx-scale-round:hover {
114
+ transform-origin: center bottom;
115
+ transform: scale(1.1);
116
+ transition: transform 0.2s cubic-bezier(0, -0.530, 0.405, 2.8);
117
+ }
118
+ .fx-scale-round:hover::after {
119
+ transform: scale(1, 1);
120
+ transition: transform 0.2s cubic-bezier(0, -0.530, 0.405, 2.8);
121
+ }
122
+ /*scale-round-inside_pour-BTN*/
123
+ /*scale*/
124
+ .fx-scale:hover {
125
+ transform-origin: center bottom;
126
+ transform: scale(1.1);
127
+ transition: transform 0.2s cubic-bezier(0, -0.530, 0.405, 2.8);
128
+ }
129
+ /*flash*/
130
+ .fx-flash:hover {
131
+ animation: flash-in .25s ;
132
+ }
133
+ /*flash-in animation*/
134
+ @keyframes flash-in{
135
+ 0% {
136
+ opacity:.25;
137
+ }
138
+ 100% {
139
+ opacity:1;
140
+ }
141
+ }
142
+ /*flash-in animation*/
143
+ /*FX ANIMATIONS*/
144
+ </style>
145
+ <script src="/js/vue.global.prod.js"></script>
146
+ <script src="/js/main.js"></script>
147
+ <script type="module">
148
+ const CONNECTORS_PATH = '/connectors/'
149
+ window.addEventListener('load', function() {
150
+ const { createApp } = Vue;
151
+ const { api, constants, types } = silex;
152
+ const {
153
+ ConnectorType,
154
+ } = types
155
+ const {
156
+ setServerUrl,
157
+ getUser,
158
+ logout,
159
+ websiteDelete,
160
+ websiteDuplicate,
161
+ websiteList,
162
+ websiteCreate,
163
+ websiteMetaWrite,
164
+ } = api
165
+ function toSafeId(name) {
166
+ return name.replace(/[/\\?%*:|"<>]/g, '_')
167
+ }
168
+
169
+ const App = {
170
+ data() {
171
+ return {
172
+ websites: [],
173
+ newWebsiteName: '',
174
+ showCreationForm: false,
175
+ error: null,
176
+ message: null,
177
+ loggedIn: false,
178
+ loading: true,
179
+ storage: null,
180
+ user: null,
181
+ showMenu: false,
182
+ empty: false,
183
+ }
184
+ },
185
+ mounted() {
186
+ this.init()
187
+ },
188
+
189
+ methods: {
190
+ async init() {
191
+ try {
192
+ // Init Silex server path
193
+ // Go up one level because of the language prefix
194
+ setServerUrl(window.location.origin)
195
+ // Start
196
+ const user = await getUser({type: ConnectorType.STORAGE})
197
+ // Escape single quotes in the picture URL and decode the picture URL
198
+ user.picture = decodeURIComponent(user.picture).replace(/'/g, "\\'")
199
+ if(user) {
200
+ this.user = user
201
+ this.loggedIn = true
202
+ this.websites = await websiteList({connectorId: this.user.storage.connectorId})
203
+ this.empty = this.websites.length === 0
204
+ this.loading = false
205
+ } else {
206
+ this.openLogin()
207
+ }
208
+ } catch (error) {
209
+ console.error(error)
210
+ this.loading = false
211
+ if(error.code === 401 || error.httpStatusCode === 401) {
212
+ this.loggedIn = false
213
+ this.openLogin()
214
+ } else {
215
+ this.error = `{{ api-translations[lang]["Failed to start dashboard"] }} - ${error.message}`
216
+ this.message = ''
217
+ }
218
+ }
219
+ },
220
+
221
+ openLogin(id, lang) {
222
+ //throw new Error('debug')
223
+ const path = `/{{lang}}${CONNECTORS_PATH}`
224
+ console.log(window.location.pathname, window.location.path, path)
225
+ if(window.location.pathname === path) return
226
+ window.open(path, '_self')
227
+ },
228
+
229
+ openEditor(id, lang) {
230
+ window.open(`/?id=${id}&lang=${lang}&connectorId=${this.user.storage.connectorId}`, '_self')
231
+ },
232
+
233
+ async logout() {
234
+ await logout({
235
+ type: ConnectorType.STORAGE,
236
+ connectorId: this.user.storage.connectorId,
237
+ })
238
+ window.location.reload()
239
+ },
240
+
241
+ async createWebsite() {
242
+ try {
243
+ if (!this.newWebsiteName) throw new Error('{{ api-translations[lang]["You need to provide a website name"] }}')
244
+ this.loading = true
245
+ const websiteId = toSafeId(this.newWebsiteName)
246
+ const result = await websiteCreate({
247
+ websiteId,
248
+ data: {
249
+ name: this.newWebsiteName,
250
+ imageUrl: null,
251
+ },
252
+ connectorId: this.user.storage.connectorId
253
+ })
254
+ this.message = '{{ api-translations[lang]["Website created successfully"] }}'
255
+ this.error = ''
256
+ this.newWebsiteName = ''
257
+ this.showCreationForm = false;
258
+ this.websites = await websiteList({connectorId: this.user.storage.connectorId})
259
+ this.empty = this.websites.length === 0
260
+ this.loading = false
261
+ return result
262
+ } catch (error) {
263
+ this.loading = false
264
+ console.error(error)
265
+ this.error = `{{ api-translations[lang]["Failed to create website"] }} - ${error.message}`
266
+ this.message = ''
267
+ }
268
+ },
269
+
270
+ async deleteWebsite(websiteId) {
271
+ const ok = confirm('{{ api-translations[lang]["Deleting a website? Are your sure? Really?"] }}')
272
+ if (!ok) return
273
+ this.loading = true
274
+ try {
275
+ const result = await websiteDelete({websiteId, connectorId: this.user.storage.connectorId})
276
+ this.message = '{{ api-translations[lang]["Website deleted successfully"] }}'
277
+ this.error = ''
278
+ this.websites = await websiteList({connectorId: this.user.storage.connectorId})
279
+ this.empty = this.websites.length === 0
280
+ this.loading = false
281
+ return result
282
+ } catch (error) {
283
+ this.loading = false
284
+ this.error = `{{ api-translations[lang]["Failed to delete website"] }} - ${error.message}`
285
+ this.message = ''
286
+ }
287
+ },
288
+
289
+ async duplicateWebsite(websiteId) {
290
+ this.loading = true
291
+ try {
292
+ await websiteDuplicate({websiteId, connectorId: this.user.storage.connectorId, data: { name }})
293
+ this.error = ''
294
+ this.websites = await websiteList({connectorId: this.user.storage.connectorId})
295
+ this.message = '{{ api-translations[lang]["Website duplicated successfully"] }}'
296
+ this.empty = this.websites.length === 0
297
+ this.loading = false
298
+ } catch (error) {
299
+ this.loading = false
300
+ this.error = `{{ api-translations[lang]["Failed to duplicate website"] }} - ${error.message}`
301
+ this.message = ''
302
+ }
303
+ },
304
+
305
+ async renameWebsite(websiteId) {
306
+ const website = this.websites.find(w => w.websiteId === websiteId)
307
+ const name = prompt('{{ api-translations[lang]["New name for this website"] }}', website.name)
308
+ if (!name) return
309
+ this.loading = true
310
+ try {
311
+ const result = await websiteMetaWrite({websiteId, connectorId: this.user.storage.connectorId, data: { name }})
312
+ this.message = '{{ api-translations[lang]["Website renamed successfully"] }}'
313
+ this.error = ''
314
+ this.websites = await websiteList({connectorId: this.user.storage.connectorId})
315
+ this.empty = this.websites.length === 0
316
+ this.loading = false
317
+ return result
318
+ } catch (error) {
319
+ this.loading = false
320
+ this.error = `{{ api-translations[lang]["Failed to rename website"] }} - ${error.message}`
321
+ this.message = ''
322
+ }
323
+ },
324
+ },
325
+ };
326
+ // Prepare elements for vue
327
+ document.querySelectorAll('[v-text], [v-html]')
328
+ .forEach(el => el.innerText = '')
329
+
330
+
331
+ // Create the app
332
+ const app = createApp(App);
333
+
334
+ // Mount the app
335
+ app.mount('.app');
336
+
337
+
338
+ // Remove loading
339
+ setTimeout(() => {
340
+ document.querySelector('.before-js').classList.add('after-js')
341
+ }, 100)
342
+ })
343
+ </script>
344
+
345
+ <title>Silex Dashboard</title>
346
+ <link rel="icon" href="/assets/favicon-32x32.png" />
347
+ <meta name="og:title" property="og:title" content="Silex Dashboard"/>
348
+ <link href="https://fonts.googleapis.com" rel="preconnect" ><link href="https://fonts.gstatic.com" rel="preconnect" crossorigin ><link href="https://fonts.googleapis.com/css?family=Ubuntu&display=swap" rel="stylesheet" ></head>
349
+ <body id="ik0i" class="body loading app before-js"><HEADER id="igrg" class="menu-bar"><A id="igvu43" href="/"><img src="/assets/favicon-32x32.png" id="iel80b-2" class="nav__logo"/></A><NAV id="i9jq" class="nav"><A id="iels" href="{{ item.url }}" class="nav__item uppercase fx-flash nav_item--active">Sites</A></NAV><div id="i2red7" class="lang"><A href="/{{ link.code }}" id="iciz" class="lang__item nav__item uppercase">en</A></div><div id="i24ew" class="user__wrapper pointer"><div id="i5xsbd" class="user-icon__wrapper"><div id="i5wlbq" class="user-icon__image"></div></div><div id="ic9eoa"><div id="iksw4d" class="button button--tertiary text-centered">Logout</div></div></div></HEADER><HEADER id="iy8ax3" class="bg-silex-purpel"><div id="iisz8f" class="section-top text-centered text-white"><H1 id="ic31o" class="title-40">Welcome back!<br/></H1><P id="iyex8" class="subtitle-16">Dive into your projects or kickstart a new one</P><H1 id="i4ybc" class="title-40">Welcome, let's get started<br/></H1><P id="iino6r" class="subtitle-16">Create your first project, click on the button "Create a website"<br/></P></div></HEADER><MAIN id="iz63r" class="padding-normal main-min-height website-max-width margin-80"><SECTION id="iqmx38"></SECTION><div id="ickx4" class="margin-20"><BUTTON id="ic92g" class="button button--primary rounded top-space-40 fx-scale-round"><span id="igsxoc" class="icon-font">+</span> <span id="ixu14">Create website</span></BUTTON><div id="i0ro3" class="button button--secondary rounded">Import</div></div><div id="ihwwxz" class="box top-space-40 padding-30 box_transp"><H3 id="i3gd1b" class="box__header text-centered">Create a new website</H3><form method="get" id="i50acf" class="form"><div id="igtg1t" class="v-space"><label id="i1nmbc" class="v-space bold color-2B1B63-80">Website name</label><input type="text" id="ij5iwh" placeholder="" class="input full-width"/></div><div id="ie0xes"><button type="submit" id="i021na" class="button rounded button--primary right-space-20 fx-scale-round">Create</button><button type="reset" class="button rounded button--secondary fx-scale-round">Cancel</button></div></form></div><div id="if80m" class="margin-20"><SECTION id="idgvg" class="button-bar loaded__item"><H3 id="i69a7" class="right-space-40 color-2B1B63-80 uppercase pointer fx-flash full-width button-bar__title underline">My first website</H3><P id="i65hn" class="button-bar__item--secondary flex-no-shrink right-space-40">Updated 1h ago by lexoyo</P><P id="i64qa" class="button-bar__item--secondary flex-no-shrink right-space-40">Created 2023-02-16 by lexoyo</P><div id="i3b4tr" class="flex-no-shrink"><BUTTON id="ifyf6p" title="" class="button-bar__item--link pointer fx-scale fx-flash button-bar__item--icon">Edit</BUTTON><BUTTON id="ihf6ew" title="" class="button-bar__item--link pointer fx-scale fx-flash button-bar__item--icon">Rename</BUTTON><BUTTON id="iol4h" title="" class="button-bar__item--link pointer fx-flash fx-scale button-bar__item--icon">⎘</BUTTON><BUTTON id="it5ia" class="button-bar__item--link pointer fx-flash fx-scale">X</BUTTON></div></SECTION><SECTION id="i1fjn" class="button-bar loading__item skeleton-anim skeleton-wrapper"><H3 id="iwu6a" class="skeleton-text skeleton right-space-40">My first websiteMy first websiteMy first websiteMy first</H3><P id="i26fn" class="button-bar__item--secondary skeleton-text skeleton right-space-40">Updated 1h ago by lexoyo</P><P id="iywbk" class="button-bar__item--secondary skeleton-text skeleton right-space-40">Created 2023-02-16 by lexoyo</P><div id="ixz6c" class="skeleton skeleton-button">Edit</div></SECTION><SECTION id="iwxxo5" class="button-bar loading__item skeleton-anim skeleton-wrapper"><H3 id="inmp3" class="skeleton-text skeleton right-space-40">My first websiteMy first websiteMy first websiteMy first</H3><P id="icjz8" class="button-bar__item--secondary skeleton-text skeleton right-space-40">Updated 1h ago by lexoyo</P><P id="illbe" class="button-bar__item--secondary skeleton-text skeleton right-space-40">Created 2023-02-16 by lexoyo</P><div id="i9fx3l" class="skeleton skeleton-button">Edit</div></SECTION><SECTION id="isld3r" class="button-bar loading__item skeleton-anim skeleton-wrapper"><H3 class="button-bar_item button-bar__item--main skeleton-text skeleton right-space-40">My first websiteMy first websiteMy first websiteMy first</H3><P class="button-bar_item button-bar__item--secondary skeleton-text skeleton right-space-40">Updated 1h ago by lexoyo</P><P class="button-bar_item button-bar__item--secondary skeleton-text skeleton right-space-40">Created 2023-02-16 by lexoyo</P><div id="i8oes3" class="button-bar_item skeleton skeleton-button">Edit</div></SECTION></div><div id="ipccl7"><div id="i2fkm9" class="margin-20 empty-image"></div><div id="i5ydxo" class="box padding-50-30 box--centered"><P id="ikl1qu" class="text-centered title-26">C'est bien calme ici..<br/></P><H3 id="iwzrqi" class="text-centered title-26">Prêt à démarrer une nouvelle aventure ?</H3><BUTTON id="i2x0l" class="button button--primary rounded top-space-40 fx-scale-round"><span id="ibsgw" class="icon-font">+</span> <span id="itl2n8">Create website</span></BUTTON></div></div><div id="i7ej6j" class="flex-between box-message text-white"><H3 id="iv0eyi" class="box-message-text">Insert your text here</H3><div id="i4656n" class="pointer button-bar__item--link text-white">Dismiss</div></div><div id="ilteie" class="flex-between box-message text-white"><H3 id="i2d31v" class="box-message-text">Insert your text here</H3><div id="i2urco" class="rounded pointer button-bar__item--link text-white">Dismiss</div></div></MAIN><FOOTER id="ilzpl" class="footer"><div id="isucae" class="footer__column"><H3 id="ipa5zg" href="" class="footer__item">Insert your text here</H3><A href="#" class="footer__item">Insert your text here</A></div></FOOTER></body>
350
+ </html>