@silexlabs/silex-dashboard 1.0.36 → 1.0.38

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 (32) hide show
  1. package/.gitmodules +3 -0
  2. package/.silex-client.js +4 -4
  3. package/.silex.js +8 -8
  4. package/_data/api-translations.json +8 -2
  5. package/_includes/api-websites.js.html +24 -1
  6. package/_includes/connectors.html +145 -166
  7. package/_includes/websites.html +155 -171
  8. package/_silex/old/meta.json +1 -0
  9. package/_site/css/connectors.css +1 -1
  10. package/_site/css/websites.css +1 -1
  11. package/_site/en/connectors/index.html +145 -166
  12. package/_site/en/index.html +179 -172
  13. package/_site/fr/connectors/index.html +145 -166
  14. package/_site/fr/index.html +179 -172
  15. package/package.json +2 -2
  16. package/pages/connectors.css.liquid +1 -1
  17. package/pages/en/index.md +2 -0
  18. package/pages/fr/index.md +2 -0
  19. package/pages/websites.css.liquid +1 -1
  20. package/_silex/default/meta.json +0 -1
  21. /package/_silex/{default → old}/assets/alex-hoyau.jpg +0 -0
  22. /package/_silex/{default → old}/assets/alex-small.jpg +0 -0
  23. /package/_silex/{default → old}/assets/bg-purpel-silex.webp +0 -0
  24. /package/_silex/{default → old}/assets/bg-silex-purpel.webp +0 -0
  25. /package/_silex/{default → old}/assets/empty-projects-sos.gif +0 -0
  26. /package/_silex/{default → old}/assets/empty-projects.gif +0 -0
  27. /package/_silex/{default → old}/assets/gitlab.svg +0 -0
  28. /package/_silex/{default → old}/assets/logo-silex.svg +0 -0
  29. /package/_silex/{default → old}/assets/picto-silex.png +0 -0
  30. /package/_silex/{default → old}/assets/picto-silex@3x.png +0 -0
  31. /package/_silex/{default → old}/assets/silex-icon-2018@200px.png +0 -0
  32. /package/_silex/{default → old}/website.json +0 -0
package/.gitmodules ADDED
@@ -0,0 +1,3 @@
1
+ [submodule "_silex/dashboard"]
2
+ path = _silex/dashboard
3
+ url = git@gitlab.com:ceubri/dashboard-silexv3.git
package/.silex-client.js CHANGED
@@ -9,14 +9,14 @@ export default async function(config, options) {
9
9
  await config.addPlugin(templatePlugin)
10
10
  await config.addPlugin(eleventyPlugin, {
11
11
  css: {
12
- path: '../../pages',
12
+ path: '../pages',
13
13
  url: '/css', // Used in the permalink in liquid
14
14
  },
15
15
  html: {
16
- path: '../../_includes',
16
+ path: '../_includes',
17
17
  },
18
18
  assets: {
19
- path: '../../assets',
19
+ path: '../assets',
20
20
  },
21
21
  })
22
- }
22
+ }
package/.silex.js CHANGED
@@ -11,9 +11,9 @@ const nodeModules = require('node_modules-path')
11
11
  const { ConnectorType } = require('@silexlabs/silex/dist/server/types')
12
12
  const StaticPlugin = require('@silexlabs/silex/dist/plugins/server/plugins/server/StaticPlugin').default
13
13
 
14
- const FtpConnector = require('@silexlabs/silex/dist/plugins/server/plugins/server/FtpConnector').default
15
- const GitlabConnector = require('@silexlabs/silex/dist/plugins/server/plugins/server/GitlabConnector').default
16
- const {FsStorage} = require('@silexlabs/silex/dist/server/server/connectors/FsStorage')
14
+ //const FtpConnector = require('@silexlabs/silex/dist/plugins/server/plugins/server/FtpConnector').default
15
+ //const GitlabConnector = require('@silexlabs/silex/dist/plugins/server/plugins/server/GitlabConnector').default
16
+ //const {FsStorage} = require('@silexlabs/silex/dist/server/server/connectors/FsStorage')
17
17
  const {FsHosting} = require('@silexlabs/silex/dist/server/server/connectors/FsHosting')
18
18
 
19
19
  module.exports = async function(config, options) {
@@ -26,13 +26,10 @@ module.exports = async function(config, options) {
26
26
  ...options,
27
27
  }
28
28
 
29
- config.addHostingConnector([
29
+ config.setHostingConnectors([
30
30
  new FsHosting(config, {
31
31
  path: process.env.SILEX_FS_ROOT,
32
32
  }),
33
- new FtpConnector(config, {
34
- type: ConnectorType.HOSTING,
35
- }),
36
33
  ])
37
34
 
38
35
  //config.addStorageConnector([
@@ -56,6 +53,9 @@ module.exports = async function(config, options) {
56
53
  }, {
57
54
  path: nodeModules('@silexlabs/silex') + '/@silexlabs/silex/dist/plugins/client/plugins/client/',
58
55
  route: '/js',
56
+ }, {
57
+ path: nodeModules('lit-html') + '/lit-html/',
58
+ route: '/js/lit-html/',
59
59
  }],
60
60
  })
61
61
 
@@ -89,4 +89,4 @@ module.exports = async function(config, options) {
89
89
  })
90
90
  app.use(editorRouter)
91
91
  })
92
- }
92
+ }
@@ -17,7 +17,10 @@
17
17
  "Logging out": "Logging out",
18
18
  "Back to home": "< Back",
19
19
  "Welcome to Silex": "Welcome to Silex",
20
- "Please login to continue": "Please login to continue"
20
+ "Please login to continue": "Please login to continue",
21
+ "New name for the duplicated website": "New name for the duplicated website",
22
+ "Failed to duplicate website": "Failed to duplicate website",
23
+ "Website duplicated successfully": "Website duplicated successfully"
21
24
  },
22
25
  "fr": {
23
26
  "Failed to start dashboard": "Erreur, impossible de démarrer le tableau de bord",
@@ -37,6 +40,9 @@
37
40
  "Logging out": "Déconnexion en cours",
38
41
  "Back to home": "< Retour",
39
42
  "Welcome to Silex": "Bienvenue sur Silex",
40
- "Please login to continue": "Merci de vous connecter pour continuer"
43
+ "Please login to continue": "Merci de vous connecter pour continuer",
44
+ "New name for the duplicated website": "Nouveau nom pour votre site",
45
+ "Failed to duplicate website": "Erreur, le site n'a pas été dupliqué",
46
+ "Website duplicated successfully": "Le site a bien été dupliqué"
41
47
  }
42
48
  }
@@ -13,10 +13,14 @@ window.addEventListener('load', function() {
13
13
  getUser,
14
14
  logout,
15
15
  websiteDelete,
16
+ websiteDuplicate,
16
17
  websiteList,
17
18
  websiteCreate,
18
19
  websiteMetaWrite,
19
20
  } = api
21
+ function toSafeId(name) {
22
+ return name.replace(/[/\\?%*:|"<>]/g, '_')
23
+ }
20
24
 
21
25
  const App = {
22
26
  data() {
@@ -92,7 +96,7 @@ window.addEventListener('load', function() {
92
96
  try {
93
97
  if (!this.newWebsiteName) throw new Error('{{ api-translations[lang]["You need to provide a website name"] }}')
94
98
  this.loading = true
95
- const websiteId = this.newWebsiteName.replace(/[/\\?%*:|"<>]/g, '_')
99
+ const websiteId = toSafeId(this.newWebsiteName)
96
100
  const result = await websiteCreate({
97
101
  websiteId,
98
102
  data: {
@@ -136,6 +140,25 @@ window.addEventListener('load', function() {
136
140
  }
137
141
  },
138
142
 
143
+ async duplicateWebsite(fromId) {
144
+ const name = prompt('{{ api-translations[lang]["New name for the duplicated website"] }}')
145
+ if (!name) return
146
+ this.loading = true
147
+ try {
148
+ const toId = toSafeId(name)
149
+ await websiteDuplicate({fromId, toId, connectorId: this.user.storage.connectorId, data: { name }})
150
+ this.error = ''
151
+ this.websites = await websiteList({connectorId: this.user.storage.connectorId})
152
+ this.message = '{{ api-translations[lang]["Website duplicated successfully"] }}'
153
+ this.empty = this.websites.length === 0
154
+ this.loading = false
155
+ } catch (error) {
156
+ this.loading = false
157
+ this.error = `{{ api-translations[lang]["Failed to duplicate website"] }} - ${error.message}`
158
+ this.message = ''
159
+ }
160
+ },
161
+
139
162
  async renameWebsite(websiteId) {
140
163
  const website = this.websites.find(w => w.websiteId === websiteId)
141
164
  const name = prompt('{{ api-translations[lang]["New name for this website"] }}', website.name)
@@ -1,174 +1,154 @@
1
-
2
- <!DOCTYPE html>
3
- <html lang="">
4
- <head>
5
- <link rel="stylesheet" href="/css/connectors.css" />
6
- <!-- font google -->
1
+ <!DOCTYPE html>
2
+ <html lang="">
3
+ <head>
4
+ <link rel="stylesheet" href="/css/connectors.css" />
5
+ <!-- font google -->
7
6
  <link rel="preconnect" href="https://fonts.gstatic.com" />
8
7
  <link href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;700&display=swap" rel="stylesheet">
9
-
10
8
  {% render "alternate.liquid" languages: languages lang: lang page: page %}
11
-
12
9
  <style>
13
- .before-js > * {
14
- visibility: hidden;
15
- opacity: 0;
16
- transition: opacity .5s ease;
17
- }
18
- .after-js > * {
19
- visibility: visible;
20
- opacity: 1;
21
- }
22
- .before-js:before {
23
- content: 'Loading';
24
- position: absolute;
25
- top: 49%;
26
- left: 49%;
27
- }
28
- .after-js:before {
29
- content: none;
30
- }
31
-
32
- body { color:#2B1B63;}
33
- /*BTNS*/
34
- .button, .pointer { cursor: pointer!important}
35
- .button{min-width:110px;}
36
- /*BTNS*/
37
- a {
38
- text-decoration: none;
39
- color:#8873FE;}
40
- a:hover { text-decoration: underline; }
41
- .uppercase {text-transform: uppercase;}
42
-
43
- /*footer position*/
44
- .main-min-height {min-height: calc(100vh - 560px);}
45
- /*footer position*/
46
-
47
- /*label*/
48
- ::placeholder {color: #8873FE;}
49
- input:focus {
50
- border: 2px solid ##9977FE;
51
- background-color:#ffffff;}
52
- :focus { outline: none;}
53
- /*label*/
54
- .skeleton-anim:after {
55
- width: 100%;
56
- height: 100%;
57
- position: absolute;
58
- top: 0;
59
- left: 0;
60
- content: "";
61
- background:
62
- linear-gradient(0.25turn, transparent, rgba(255,255,255,.75), transparent),
63
- linear-gradient(transparent, transparent),
64
- radial-gradient(38px circle at 19px 19px, transparent 50%, transparent 51%),
65
- linear-gradient(transparent, transparent);
66
- background-repeat: no-repeat;
67
- background-size: 315px 250px, 315px 180px, 100px 100px, 225px 30px;
68
- background-position: -315px 0, 0 0, 0px 190px, 50px 195px;
69
- animation: loading 1.5s infinite;
70
- }
71
-
72
- @keyframes loading {
73
- to {
74
- background-position: 200% 0, 0 0, 0 190px, 50px 195px;
10
+ .before-js > * {
11
+ visibility: hidden;
12
+ opacity: 0;
13
+ transition: opacity .5s ease;
75
14
  }
76
- }
77
- /*FX ANIMATIONS*/
78
- /*scale-round-inside*/
79
- .fx-scale-round {
80
- position:relative;
81
- z-index: 10;
82
- overflow: hidden;
83
- }
84
- .fx-scale-round::after {
85
- content: "";
86
- background: #ffffff;
87
- position: absolute;
88
- z-index: -1;
89
- border-radius: 50%;
90
- left: -50%;
91
- right: -50%;
92
- top: -100%;
93
- bottom: -100%;
94
- transform: scale(0, 0);
95
- transform-origin: center bottom;
96
- transition: all 0.3s ease-out;
97
-
98
- }
99
- .fx-scale-round:hover {
100
- transform-origin: center bottom;
101
- transform: scale(1.1);
102
- transition: transform 0.2s cubic-bezier(0, -0.530, 0.405, 2.8);
103
- }
104
- .fx-scale-round:hover::after {
105
- transform: scale(1, 1);
106
- transition: transform 0.2s cubic-bezier(0, -0.530, 0.405, 2.8);
107
- }
108
- /*scale-round-inside*/
109
- /*scale*/
110
- .fx-scale:hover {
111
- transform-origin: center bottom;
112
- transform: scale(1.1);
113
- transition: transform 0.2s cubic-bezier(0, -0.530, 0.405, 2.8);
114
- }
115
- /*flash*/
116
- .fx-underline:hover, .fx-flash:hover {
117
- animation: flash-in .5s ;
118
- }
119
- /* Underline animation */
120
- .fx-underline {
121
- position: relative;
122
- }
123
- /* Fade in */
124
- .fx-underline::after {
125
- content: '';
126
- position: absolute;
127
- bottom: -3px;
128
- left: 0;
129
- width: 100%;
130
- height: 0.1em;
131
- background-color: #8873fe;
132
- opacity: 0;
133
- transition: transform 0.2s cubic-bezier(0, -0.530, 0.405, 1.8);
134
- }
135
-
136
- .fx-underline:hover::after,
137
- .fx-underline:focus::after {
138
- opacity: 1;
139
- transform: translate3d(0, 2.2em, 0);
140
- }
141
-
142
- /* Scale from center */
143
- .fx-underline:after {
144
- transform: scale(0);
145
- transform-origin: center;
146
- }
147
-
148
- .fx-underline:hover::after,
149
- .fx-underline:focus::after{
150
- transform: scale(1);
151
- }
152
- /* Underline animation */
153
- /*flash-in animation*/
154
- @keyframes flash-in{
155
- 0% {opacity:0;}
156
- 100% {opacity:1;}
157
- }
158
- /*flash-in animation*/
159
-
160
- /*FX ANIMATIONS*/
15
+ .after-js > * {
16
+ visibility: visible;
17
+ opacity: 1;
18
+ }
19
+ .before-js:before {
20
+ content: 'Loading';
21
+ position: absolute;
22
+ top: 49%;
23
+ left: 49%;
24
+ }
25
+ .after-js:before {
26
+ content: none;
27
+ }
28
+ /*BTNS*/
29
+ .button, .pointer {
30
+ cursor: pointer!important}
31
+ .button{
32
+ min-width:110px;
33
+ }
34
+ /*BTNS*/
35
+ a {
36
+ text-decoration: none;
37
+ color:#8873FE;
38
+ }
39
+ a:hover {
40
+ text-decoration: underline;
41
+ }
42
+ .uppercase {
43
+ text-transform: uppercase;
44
+ }
45
+ .underline:hover{
46
+ text-decoration: underline;
47
+ text-decoration-thickness: from-font;
48
+ text-underline-position: under;
49
+ }
50
+ /*footer position*/
51
+ .main-min-height {
52
+ min-height: calc(100vh - 560px);
53
+ }
54
+ /*footer position*/
55
+ /*label*/
56
+ ::placeholder {
57
+ color: #8873FE;
58
+ }
59
+ input:focus {
60
+ border: 2px solid ##9977FE;
61
+ background-color:#ffffff;
62
+ }
63
+ :focus {
64
+ outline: none;
65
+ }
66
+ /*label*/
67
+ .skeleton-anim:after {
68
+ width: 100%;
69
+ height: 100%;
70
+ position: absolute;
71
+ top: 0;
72
+ left: 0;
73
+ content: "";
74
+ background:
75
+ linear-gradient(0.25turn, transparent, rgba(255,255,255,.75), transparent),
76
+ linear-gradient(transparent, transparent),
77
+ radial-gradient(38px circle at 19px 19px, transparent 50%, transparent 51%),
78
+ linear-gradient(transparent, transparent);
79
+ background-repeat: no-repeat;
80
+ background-size: 315px 250px, 315px 180px, 100px 100px, 225px 30px;
81
+ background-position: -315px 0, 0 0, 0px 190px, 50px 195px;
82
+ animation: loading 1.5s infinite;
83
+ }
84
+ @keyframes loading {
85
+ to {
86
+ background-position: 200% 0, 0 0, 0 190px, 50px 195px;
87
+ }
88
+ }
89
+ /*FX ANIMATIONS*/
90
+ /*scale-round-inside_pour-BTN*/
91
+ .fx-scale-round {
92
+ position:relative;
93
+ z-index: 10;
94
+ overflow: hidden;
95
+ }
96
+ .fx-scale-round::after {
97
+ content: "";
98
+ background: #ffffff;
99
+ position: absolute;
100
+ z-index: -1;
101
+ border-radius: 50%;
102
+ left: -50%;
103
+ right: -50%;
104
+ top: -100%;
105
+ bottom: -100%;
106
+ transform: scale(0, 0);
107
+ transform-origin: center bottom;
108
+ transition: all 0.3s ease-out;
109
+ }
110
+ .fx-scale-round:hover {
111
+ transform-origin: center bottom;
112
+ transform: scale(1.1);
113
+ transition: transform 0.2s cubic-bezier(0, -0.530, 0.405, 2.8);
114
+ }
115
+ .fx-scale-round:hover::after {
116
+ transform: scale(1, 1);
117
+ transition: transform 0.2s cubic-bezier(0, -0.530, 0.405, 2.8);
118
+ }
119
+ /*scale-round-inside_pour-BTN*/
120
+ /*scale*/
121
+ .fx-scale:hover {
122
+ transform-origin: center bottom;
123
+ transform: scale(1.1);
124
+ transition: transform 0.2s cubic-bezier(0, -0.530, 0.405, 2.8);
125
+ }
126
+ /*flash*/
127
+ .fx-flash:hover {
128
+ animation: flash-in .5s ;
129
+ }
130
+ /*flash-in animation*/
131
+ @keyframes flash-in{
132
+ 0% {
133
+ opacity:0;
134
+ }
135
+ 100% {
136
+ opacity:1;
137
+ }
138
+ }
139
+ /*flash-in animation*/
140
+ /*FX ANIMATIONS*/
161
141
  </style>
162
- {% render "api-connectors.js.html" frontmatter: frontmatter page: page site: site api-translations: api-translations lang: lang %}
142
+ {% render "api-connectors.js.html" frontmatter: frontmatter page: page site: site api-translations: api-translations lang: lang %}
163
143
 
164
- <title>{{ title }}</title>
165
- <link rel="icon" href="" />
166
- <meta property="description" content=""/>
167
- <meta property="og:title" content=""/>
168
- <meta property="og:description" content=""/>
169
- <meta property="og:image" content=""/>
170
- </head>
171
- <body
144
+ <title>{{ title }}</title>
145
+ <link rel="icon" href="/assets/favicon-32x32.png" />
146
+ <meta name="description" property="description" content=""/>
147
+ <meta name="og:title" property="og:title" content=""/>
148
+ <meta name="og:description" property="og:description" content=""/>
149
+ <meta name="og:image" property="og:image" content=""/>
150
+ </head>
151
+ <body
172
152
  id="i2hcfw"
173
153
  class="body app"
174
154
 
@@ -270,5 +250,4 @@ input:focus {
270
250
  v-if="error" @click="logout()"
271
251
 
272
252
  >{{ api-translations[lang]["Logout"] }}</div></div></div></body>
273
- </html>
274
-
253
+ </html>