aiot-toolkit 2.0.5-widget-provider-beta.2 → 2.0.5

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.
@@ -1,167 +1,167 @@
1
- .alert-warning {
2
- color: #8a6d3b;
3
- background-color: #fcf8e3;
4
- border-color: #faebcc;
5
- text-align: left;
6
- }
7
-
8
- .alert {
9
- padding: 8px;
10
- margin: 10px auto;
11
- width: 400px;
12
- min-width: 350px;
13
- border: 1px solid transparent;
14
- border-radius: 6px;
15
- box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
16
- }
17
-
18
- .alert p {
19
- margin: 6px;
20
- }
21
-
22
- .panel-default {
23
- border-color: #ddd;
24
- }
25
-
26
- .panel {
27
- margin-bottom: 20px;
28
- background-color: #fff;
29
- border-radius: 4px;
30
- -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
31
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
32
- margin: 10px auto;
33
- box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
34
- width: 400px;
35
- min-width: 350px;
36
- padding: 8px;
37
- }
38
-
39
- .panel-default > .panel-heading {
40
- color: #333;
41
- border-color: #ddd;
42
- text-align: left;
43
- }
44
-
45
- .panel-heading {
46
- padding: 8px 15px;
47
- border-bottom: 1px solid transparent;
48
- border-top-left-radius: 3px;
49
- border-top-right-radius: 3px;
50
- }
51
-
52
- .table {
53
- width: 100%;
54
- max-width: 100%;
55
- margin: 6px;
56
- background-color: transparent;
57
- border-spacing: 0;
58
- border-collapse: collapse;
59
- }
60
-
61
- .table td {
62
- color: black;
63
- text-shadow: none;
64
- text-align: left;
65
- }
66
-
67
- .table td.tname {
68
- width: 70%;
69
- }
70
-
71
- body {
72
- margin: 0;
73
- display: block;
74
- position: absolute;
75
- top: 0;
76
- bottom: 0;
77
- left: 0;
78
- right: 0;
79
- }
80
-
81
- .hide {
82
- display: none !important;
83
- }
84
-
85
- .qr-code-panel {
86
- text-align: center;
87
- display: flex;
88
- flex-direction: column;
89
- }
90
-
91
- .qr-code-panel .qr-img {
92
- margin: 10px 200px;
93
- min-width: 350px;
94
- }
95
-
96
- .bd-bg {
97
- position: relative;
98
- padding: 40px 0;
99
- color: black;
100
- text-align: center;
101
- background: #eee;
102
- }
103
-
104
- .updatetip-link {
105
- padding: 0 5px;
106
- }
107
-
108
- table.tunning tr {
109
- padding: 8px 15px;
110
- }
111
-
112
- .btn {
113
- display: inline-block;
114
- padding: 6px 12px;
115
- margin-bottom: 0;
116
- font-size: 14px;
117
- font-weight: 400;
118
- line-height: 1.42857143;
119
- text-align: center;
120
- white-space: nowrap;
121
- vertical-align: middle;
122
- -ms-touch-action: manipulation;
123
- touch-action: manipulation;
124
- cursor: pointer;
125
- -webkit-user-select: none;
126
- -moz-user-select: none;
127
- -ms-user-select: none;
128
- user-select: none;
129
- background-image: none;
130
- border: 1px solid transparent;
131
- border-radius: 4px;
132
- margin-left: 5px;
133
- }
134
-
135
- .btn-default {
136
- color: #333;
137
- background-color: #fff;
138
- border-color: #ccc;
139
- }
140
-
141
- .label {
142
- display: inline;
143
- padding: 0.7em;
144
- font-size: 75%;
145
- font-weight: 700;
146
- line-height: 1;
147
- color: #fff;
148
- text-align: center;
149
- text-decoration: none;
150
- white-space: nowrap;
151
- vertical-align: baseline;
152
- border-radius: 0.25em;
153
- }
154
-
155
- .label-info {
156
- background-color: #5bc0de;
157
- }
158
- .block {
159
- width: 420px;
160
- }
161
- .block .block-title {
162
- font-size: 16px;
163
- margin: 0.5em 0;
164
- }
165
- .block a {
166
- color: #0055ff;
167
- }
1
+ .alert-warning {
2
+ color: #8a6d3b;
3
+ background-color: #fcf8e3;
4
+ border-color: #faebcc;
5
+ text-align: left;
6
+ }
7
+
8
+ .alert {
9
+ padding: 8px;
10
+ margin: 10px auto;
11
+ width: 400px;
12
+ min-width: 350px;
13
+ border: 1px solid transparent;
14
+ border-radius: 6px;
15
+ box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
16
+ }
17
+
18
+ .alert p {
19
+ margin: 6px;
20
+ }
21
+
22
+ .panel-default {
23
+ border-color: #ddd;
24
+ }
25
+
26
+ .panel {
27
+ margin-bottom: 20px;
28
+ background-color: #fff;
29
+ border-radius: 4px;
30
+ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
31
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
32
+ margin: 10px auto;
33
+ box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
34
+ width: 400px;
35
+ min-width: 350px;
36
+ padding: 8px;
37
+ }
38
+
39
+ .panel-default > .panel-heading {
40
+ color: #333;
41
+ border-color: #ddd;
42
+ text-align: left;
43
+ }
44
+
45
+ .panel-heading {
46
+ padding: 8px 15px;
47
+ border-bottom: 1px solid transparent;
48
+ border-top-left-radius: 3px;
49
+ border-top-right-radius: 3px;
50
+ }
51
+
52
+ .table {
53
+ width: 100%;
54
+ max-width: 100%;
55
+ margin: 6px;
56
+ background-color: transparent;
57
+ border-spacing: 0;
58
+ border-collapse: collapse;
59
+ }
60
+
61
+ .table td {
62
+ color: black;
63
+ text-shadow: none;
64
+ text-align: left;
65
+ }
66
+
67
+ .table td.tname {
68
+ width: 70%;
69
+ }
70
+
71
+ body {
72
+ margin: 0;
73
+ display: block;
74
+ position: absolute;
75
+ top: 0;
76
+ bottom: 0;
77
+ left: 0;
78
+ right: 0;
79
+ }
80
+
81
+ .hide {
82
+ display: none !important;
83
+ }
84
+
85
+ .qr-code-panel {
86
+ text-align: center;
87
+ display: flex;
88
+ flex-direction: column;
89
+ }
90
+
91
+ .qr-code-panel .qr-img {
92
+ margin: 10px 200px;
93
+ min-width: 350px;
94
+ }
95
+
96
+ .bd-bg {
97
+ position: relative;
98
+ padding: 40px 0;
99
+ color: black;
100
+ text-align: center;
101
+ background: #eee;
102
+ }
103
+
104
+ .updatetip-link {
105
+ padding: 0 5px;
106
+ }
107
+
108
+ table.tunning tr {
109
+ padding: 8px 15px;
110
+ }
111
+
112
+ .btn {
113
+ display: inline-block;
114
+ padding: 6px 12px;
115
+ margin-bottom: 0;
116
+ font-size: 14px;
117
+ font-weight: 400;
118
+ line-height: 1.42857143;
119
+ text-align: center;
120
+ white-space: nowrap;
121
+ vertical-align: middle;
122
+ -ms-touch-action: manipulation;
123
+ touch-action: manipulation;
124
+ cursor: pointer;
125
+ -webkit-user-select: none;
126
+ -moz-user-select: none;
127
+ -ms-user-select: none;
128
+ user-select: none;
129
+ background-image: none;
130
+ border: 1px solid transparent;
131
+ border-radius: 4px;
132
+ margin-left: 5px;
133
+ }
134
+
135
+ .btn-default {
136
+ color: #333;
137
+ background-color: #fff;
138
+ border-color: #ccc;
139
+ }
140
+
141
+ .label {
142
+ display: inline;
143
+ padding: 0.7em;
144
+ font-size: 75%;
145
+ font-weight: 700;
146
+ line-height: 1;
147
+ color: #fff;
148
+ text-align: center;
149
+ text-decoration: none;
150
+ white-space: nowrap;
151
+ vertical-align: baseline;
152
+ border-radius: 0.25em;
153
+ }
154
+
155
+ .label-info {
156
+ background-color: #5bc0de;
157
+ }
158
+ .block {
159
+ width: 420px;
160
+ }
161
+ .block .block-title {
162
+ font-size: 16px;
163
+ margin: 0.5em 0;
164
+ }
165
+ .block a {
166
+ color: #0055ff;
167
+ }
@@ -1,58 +1,58 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="UTF-8" />
5
- <title>调试器</title>
6
- <link href="./index.css" rel="stylesheet" />
7
- </head>
8
- <body class="bd-bg">
9
- <section class="qr-code-wrapper">
10
- <div>
11
- <div class="qr-code-panel">
12
- <div class="qr-img">
13
- <img src="" id="j-qr-icon" class="qr-icon" />
14
- </div>
15
- <div class="block alert alert-warning updatetip">
16
- <div class="block">
17
- <h2 class="block-title" title="在设备上预览">手机预览</h2>
18
- <p>1. 扫码安装rpk包</p>
19
- <p>
20
- 2. 在手机的调试器上点击
21
- <button class="btn btn-default">开始调试</button> ,启动调试界面
22
- </p>
23
- </div>
24
- <!-- <div class="block">
25
- <h2 class="block-title" title="在浏览器中预览">web 预览</h2>
26
- <p><a href="/preview" target="_blank">打开 web 预览</a></p>
27
- </div> -->
28
- </div>
29
- </div>
30
- </div>
31
- </section>
32
- <section class="inform-tip-wrapper"></section>
33
- <section class="result inspector-link-panel hide">
34
- <div class="panel panel-default">
35
- <div class="panel-heading">调试</div>
36
- <div class="panel-body">
37
- <table class="table tunning">
38
- <tbody></tbody>
39
- </table>
40
- </div>
41
- </div>
42
- </section>
43
- <script type="text/template" id="j-tpl-appinfo">
44
- <tr>
45
- <td class="tname">{{data_app_name}}</td>
46
- <td class="tlink"><a href='{{data_href_value}}' target='_blank' class="label label-info">{{data_href_name}}</a>
47
- </td>
48
- </tr>
49
- </script>
50
- <script src="./index.js"></script>
51
- <script type="text/template" id="j-tpl-updatetip">
52
- <div class="alert alert-warning updatetip">
53
- <p>调试器已有重要更新,请更新调试器</p>
54
- </div>
55
- </script>
56
- <script src="/socket.io/socket.io.js"></script>
57
- </body>
58
- </html>
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <title>调试器</title>
6
+ <link href="./index.css" rel="stylesheet" />
7
+ </head>
8
+ <body class="bd-bg">
9
+ <section class="qr-code-wrapper">
10
+ <div>
11
+ <div class="qr-code-panel">
12
+ <div class="qr-img">
13
+ <img src="" id="j-qr-icon" class="qr-icon" />
14
+ </div>
15
+ <div class="block alert alert-warning updatetip">
16
+ <div class="block">
17
+ <h2 class="block-title" title="在设备上预览">手机预览</h2>
18
+ <p>1. 扫码安装rpk包</p>
19
+ <p>
20
+ 2. 在手机的调试器上点击
21
+ <button class="btn btn-default">开始调试</button> ,启动调试界面
22
+ </p>
23
+ </div>
24
+ <!-- <div class="block">
25
+ <h2 class="block-title" title="在浏览器中预览">web 预览</h2>
26
+ <p><a href="/preview" target="_blank">打开 web 预览</a></p>
27
+ </div> -->
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </section>
32
+ <section class="inform-tip-wrapper"></section>
33
+ <section class="result inspector-link-panel hide">
34
+ <div class="panel panel-default">
35
+ <div class="panel-heading">调试</div>
36
+ <div class="panel-body">
37
+ <table class="table tunning">
38
+ <tbody></tbody>
39
+ </table>
40
+ </div>
41
+ </div>
42
+ </section>
43
+ <script type="text/template" id="j-tpl-appinfo">
44
+ <tr>
45
+ <td class="tname">{{data_app_name}}</td>
46
+ <td class="tlink"><a href='{{data_href_value}}' target='_blank' class="label label-info">{{data_href_name}}</a>
47
+ </td>
48
+ </tr>
49
+ </script>
50
+ <script src="./index.js"></script>
51
+ <script type="text/template" id="j-tpl-updatetip">
52
+ <div class="alert alert-warning updatetip">
53
+ <p>调试器已有重要更新,请更新调试器</p>
54
+ </div>
55
+ </script>
56
+ <script src="/socket.io/socket.io.js"></script>
57
+ </body>
58
+ </html>
@@ -1,66 +1,66 @@
1
- /**
2
- * Copyright (C) 2017, hapjs.org. All rights reserved.
3
- */
4
-
5
- const $ = (selector, elem) => {
6
- return typeof elem === 'undefined'
7
- ? document.querySelector(selector)
8
- : elem.querySelector(selector)
9
- }
10
-
11
- function init() {
12
- const qrImgId = '#j-qr-icon'
13
- const $qrCodeImg = $(qrImgId)
14
- const timeStamp = Date.now() % 1e5
15
- $qrCodeImg.src = `/qrcode?ws_id=${timeStamp}`
16
- bindEvents()
17
- }
18
-
19
- function bindEvents() {
20
- const socket = io(location.origin) // eslint-disable-line no-undef
21
-
22
- socket.on('appRegistered', (data) => {
23
- console.info(`on receiving appRegistered message: ${JSON.stringify(data)}`)
24
- updateTableElement(data)
25
- })
26
- socket.on('informUpdate', () => {
27
- console.info('on receiving informUpdate')
28
- appendUpdateInfo()
29
- })
30
- }
31
-
32
- /**
33
- * 更新页面调试信息
34
- * @param data{ inspectorUrl, application }
35
- */
36
- function updateTableElement(data) {
37
- const wrapper = '.inspector-link-panel'
38
- const tplId = '#j-tpl-appinfo'
39
- const $panelWrapper = $(wrapper)
40
- const $tplAppInfoElem = $(tplId)
41
- const $tbodyElem = $('tbody', $panelWrapper)
42
- let tplTextContent = $tplAppInfoElem.textContent
43
-
44
- $panelWrapper.classList.add('hide')
45
- const dataToFill = {
46
- data_app_name: data.application,
47
- data_href_value: data.inspectorUrl,
48
- data_href_name: 'Enter the debug page'
49
- }
50
- Object.keys(dataToFill).forEach((key) => {
51
- tplTextContent = tplTextContent.replace(`{{${key}}}`, dataToFill[key])
52
- })
53
-
54
- $tbodyElem.innerHTML = tplTextContent
55
- $panelWrapper.classList.remove('hide')
56
- }
57
-
58
- function appendUpdateInfo() {
59
- const tplId = '#j-tpl-updatetip'
60
- const wrapper = '.inform-tip-wrapper'
61
- const $tplUpdateTipElem = $(tplId)
62
- const $panelWrapper = $(wrapper)
63
- $panelWrapper.innerHTML = $tplUpdateTipElem.textContent
64
- }
65
-
66
- init()
1
+ /**
2
+ * Copyright (C) 2017, hapjs.org. All rights reserved.
3
+ */
4
+
5
+ const $ = (selector, elem) => {
6
+ return typeof elem === 'undefined'
7
+ ? document.querySelector(selector)
8
+ : elem.querySelector(selector)
9
+ }
10
+
11
+ function init() {
12
+ const qrImgId = '#j-qr-icon'
13
+ const $qrCodeImg = $(qrImgId)
14
+ const timeStamp = Date.now() % 1e5
15
+ $qrCodeImg.src = `/qrcode?ws_id=${timeStamp}`
16
+ bindEvents()
17
+ }
18
+
19
+ function bindEvents() {
20
+ const socket = io(location.origin) // eslint-disable-line no-undef
21
+
22
+ socket.on('appRegistered', (data) => {
23
+ console.info(`on receiving appRegistered message: ${JSON.stringify(data)}`)
24
+ updateTableElement(data)
25
+ })
26
+ socket.on('informUpdate', () => {
27
+ console.info('on receiving informUpdate')
28
+ appendUpdateInfo()
29
+ })
30
+ }
31
+
32
+ /**
33
+ * 更新页面调试信息
34
+ * @param data{ inspectorUrl, application }
35
+ */
36
+ function updateTableElement(data) {
37
+ const wrapper = '.inspector-link-panel'
38
+ const tplId = '#j-tpl-appinfo'
39
+ const $panelWrapper = $(wrapper)
40
+ const $tplAppInfoElem = $(tplId)
41
+ const $tbodyElem = $('tbody', $panelWrapper)
42
+ let tplTextContent = $tplAppInfoElem.textContent
43
+
44
+ $panelWrapper.classList.add('hide')
45
+ const dataToFill = {
46
+ data_app_name: data.application,
47
+ data_href_value: data.inspectorUrl,
48
+ data_href_name: 'Enter the debug page'
49
+ }
50
+ Object.keys(dataToFill).forEach((key) => {
51
+ tplTextContent = tplTextContent.replace(`{{${key}}}`, dataToFill[key])
52
+ })
53
+
54
+ $tbodyElem.innerHTML = tplTextContent
55
+ $panelWrapper.classList.remove('hide')
56
+ }
57
+
58
+ function appendUpdateInfo() {
59
+ const tplId = '#j-tpl-updatetip'
60
+ const wrapper = '.inform-tip-wrapper'
61
+ const $tplUpdateTipElem = $(tplId)
62
+ const $panelWrapper = $(wrapper)
63
+ $panelWrapper.innerHTML = $tplUpdateTipElem.textContent
64
+ }
65
+
66
+ init()
@@ -8,8 +8,8 @@ var _sharedUtils = require("@aiot-toolkit/shared-utils");
8
8
  var adbMiwt = _interopRequireWildcard(require("@miwt/adb"));
9
9
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
10
10
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
11
- /**
12
- * AdbUtils
11
+ /**
12
+ * AdbUtils
13
13
  */
14
14
  class AdbUtils {
15
15
  // 连接设备