@steedos/service-pages 2.4.0-beta.15 → 2.4.0-beta.18

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.
@@ -254,55 +254,7 @@
254
254
  }
255
255
 
256
256
  Steedos.Page.render = function (root, page, data, options = {}) {
257
- const loadingContentData = {
258
- "inputs": [],
259
- // "title": "loading",
260
- "blocks": [
261
- {
262
- "@type": "@builder.io/sdk:Element",
263
- "@version": 2,
264
- "layerName": "Box",
265
- "id": "builder-8070f86b1aed4e78a5878fa5c0d79e49",
266
- "children": [
267
- {
268
- "@type": "@builder.io/sdk:Element",
269
- "@version": 2,
270
- "layerName": "Loading...\n...",
271
- "id": "builder-4b16375a68dc4e49b4844843091bf91d",
272
- "component": {
273
- "name": "Text",
274
- "options": {
275
- "text": "<p>Loading...</p>\n"
276
- }
277
- },
278
- "responsiveStyles": {
279
- "large": {
280
- "display": "flex",
281
- "flexDirection": "column",
282
- "position": "relative",
283
- "flexShrink": "0",
284
- "boxSizing": "border-box",
285
- "marginTop": "20px",
286
- "lineHeight": "normal",
287
- "height": "auto",
288
- "textAlign": "center"
289
- }
290
- }
291
- }
292
- ],
293
- "responsiveStyles": {
294
- "large": {
295
- "display": "flex",
296
- "flexDirection": "column",
297
- "position": "relative",
298
- "flexShrink": "0",
299
- "boxSizing": "border-box"
300
- }
301
- }
302
- }
303
- ]
304
- };
305
-
257
+
306
258
  if (page.render_engine && page.render_engine != 'redash') {
307
259
 
308
260
  let schema = typeof page.schema === 'string' ? JSON.parse(page.schema) : page.schema;
@@ -359,24 +311,20 @@
359
311
 
360
312
  if(!lodash.isFunction(root)){
361
313
  //渲染loading
362
- // render(BuilderComponent, {
363
- // model: "page", content: {
364
- // "data": loadingContentData
365
- // }
366
- // }, root)
367
314
  }
368
315
 
369
316
  Promise.all([
317
+ waitForThing(window, 'renderAmis'),
370
318
  waitForThing(window, 'BuilderComponent'),
371
319
  waitForThing(Builder.components, upperFirst(page.render_engine), findComponent)
372
320
  ]).then(()=>{
373
321
  //渲染page
374
322
  if(!lodash.isFunction(root)){
375
- render(BuilderComponent, {
376
- model: "page", content: {
377
- "data": pageContentData
378
- }
379
- }, root)
323
+ renderAmis(
324
+ root,
325
+ schema,
326
+ data,
327
+ )
380
328
  }else{
381
329
  if(root === SteedosUI.Drawer){
382
330
  data.drawerName = data.drawerName || lodash.uniqueId(`drawer-${page.object_name}`);
@@ -801,12 +749,6 @@
801
749
  type: "wrapper",
802
750
  className: 'p-0 flex flex-1 items-center',
803
751
  body: [
804
- {
805
- "className": 'block h-10 w-auto mr-4',
806
- "hiddenOn": "${isMobile}",
807
- "type": "tpl",
808
- "tpl": `<a href='/app' class='flex items-center '><img class='block h-10 w-auto' src='${logoSrc}'></a>`,
809
- },
810
752
  {
811
753
  "type": "button",
812
754
  "className": "toggle-sidebar flex items-center pr-4",
@@ -833,9 +775,9 @@
833
775
  ],
834
776
  },
835
777
  {
836
- "type": "steedos-app-launcher",
837
- "visibleOn": "${isMobile}",
838
- "showAppName": true
778
+ "className": 'block h-10 w-auto mr-4',
779
+ "type": "tpl",
780
+ "tpl": `<a href='/app' class='flex items-center '><img class='block h-10 w-auto' src='${logoSrc}'></a>`,
839
781
  },
840
782
  ],
841
783
  },
@@ -926,11 +868,17 @@
926
868
  type: "wrapper",
927
869
  className: 'sidebar-wrapper px-0 pt-4 pb-16 fixed z-20 h-full ease-in-out duration-300 flex flex-col border-r overflow-y-auto bg-white border-slate-200 block -translate-x-0 sm:w-[220px] w-64',
928
870
  body: [
929
- {
930
- "type": "steedos-app-menu",
931
- "stacked": true,
932
- "appId": "${app.id}",
933
- },
871
+ {
872
+ "type": "steedos-app-launcher",
873
+ "className": "px-4 pb-4",
874
+ "visibleOn": "${isMobile}",
875
+ "showAppName": true
876
+ },
877
+ {
878
+ "type": "steedos-app-menu",
879
+ "stacked": true,
880
+ "appId": "${app.id}",
881
+ },
934
882
  ]
935
883
  }],
936
884
  "onEvent": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/service-pages",
3
- "version": "2.4.0-beta.15",
3
+ "version": "2.4.0-beta.18",
4
4
  "main": "package.service.js",
5
5
  "scripts": {},
6
6
  "license": "MIT",
@@ -8,7 +8,7 @@
8
8
  "publishConfig": {
9
9
  "access": "public"
10
10
  },
11
- "gitHead": "095294ab9e56a8fbbffd17ce1aefa1f55ae4c676",
11
+ "gitHead": "62ac67a437778039d0b498d09ffde85912e33dd9",
12
12
  "dependencies": {
13
13
  "ejs": "^3.1.8"
14
14
  }