@next-core/brick-container 2.62.1 → 2.63.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-core/brick-container",
3
- "version": "2.62.1",
3
+ "version": "2.63.0",
4
4
  "description": "Brick Container Server",
5
5
  "homepage": "https://github.com/easyops-cn/next-core/tree/master/packages/brick-container",
6
6
  "license": "GPL-3.0",
@@ -44,7 +44,7 @@
44
44
  "@next-core/brick-dll": "^2.28.8",
45
45
  "@next-core/brick-icons": "^2.26.1",
46
46
  "@next-core/color-theme": "^0.4.0",
47
- "@next-core/custom-antd-styles": "^1.23.0",
47
+ "@next-core/custom-antd-styles": "^1.23.2",
48
48
  "@next-core/illustrations": "^0.4.6",
49
49
  "@next-core/less-plugin-css-variables": "^0.2.1",
50
50
  "@next-core/webpack-config-factory": "^2.15.2",
@@ -72,5 +72,5 @@
72
72
  "webpack-dev-server": "^4.6.0",
73
73
  "webpack-merge": "^5.8.0"
74
74
  },
75
- "gitHead": "7a0bd9f093ebf713a979cea1915b489203e7a58b"
75
+ "gitHead": "a53fd6dda3d21aa9312337470c86a2c17536d996"
76
76
  }
@@ -52,14 +52,14 @@ module.exports = (env) => {
52
52
  },
53
53
  };
54
54
  if (useRemote) {
55
- const assetRoot = standaloneMicroApps ? `${standaloneAppDir}-` : "";
55
+ const assetRoot = standaloneMicroApps ? `${standaloneAppDir}-/` : "";
56
56
  if (standaloneMicroApps) {
57
57
  // 在「独立应用」模式中,静态资源路径在 `your-app/-/` 目录下。
58
58
  proxyPaths.push(assetRoot);
59
59
  }
60
60
 
61
61
  const assetPaths = ["bricks", "micro-apps", "templates"];
62
- proxyPaths.push(...assetPaths.map((p) => `${assetRoot}/${p}`));
62
+ proxyPaths.push(...assetPaths.map((p) => `${assetRoot}${p}`));
63
63
 
64
64
  apiProxyOptions.onProxyRes = (proxyRes, req, res) => {
65
65
  // 设定透传远端请求时,可以指定特定的 brick-packages, micro-apps, templates 使用本地文件。
@@ -0,0 +1,45 @@
1
+ # -*- coding: utf-8 -*-
2
+ import sys
3
+ import os
4
+ import simplejson
5
+ import requests
6
+ import ens_api
7
+
8
+ def collect(install_path):
9
+ if not os.path.exists(install_path):
10
+ raise Exception("could not find install path {}".format(install_path))
11
+ theme_template_path = os.path.join(install_path, "theme.json")
12
+ if not os.path.exists(theme_template_path):
13
+ raise Exception("could not find theme path {}".format(theme_template_path))
14
+ with open(theme_template_path) as f:
15
+ theme_content = f.read()
16
+ theme_json = simplejson.loads(theme_content)
17
+ return theme_json
18
+
19
+
20
+ def create_or_update_theme_template_data(data, org):
21
+ session_id, ip, port = ens_api.get_service_by_name("web.brick_next", "logic.next_builder_service")
22
+ if session_id <= 0:
23
+ raise Exception("get nameservice logic.micro_app_service error, session_id={}".format(session_id))
24
+ address = "{}:{}".format(ip, port)
25
+ headers = {"org": str(org), "user": "defaultUser"}
26
+ url = "http://{}/api/v1/next-builder/theme-data-import".format(address)
27
+ param = {"themeData": data}
28
+ rsp = requests.post(url, json=param, headers=headers)
29
+ rsp.raise_for_status()
30
+
31
+
32
+ def report(org, theme_template_data):
33
+ create_or_update_theme_template_data(theme_template_data, org)
34
+
35
+
36
+ if __name__ == "__main__":
37
+ if len(sys.argv) < 3:
38
+ print "Usage: ./report_installed_theme_template.py $org $install_path"
39
+ sys.exit(1)
40
+
41
+ org = sys.argv[1]
42
+ install_path = sys.argv[2]
43
+ theme_template_json = collect(install_path)
44
+ if theme_template_json:
45
+ report(org, theme_template_json)