@blocklet/launcher-workflow 1.6.12 → 1.6.13

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.
@@ -85,6 +85,12 @@ function OperationPage(_ref) {
85
85
  const {
86
86
  api
87
87
  } = (0, _request.default)();
88
+ let createServerTime = sessionStorage.getItem("launcher-create-server-".concat(nftId, "-time"));
89
+
90
+ if (!createServerTime) {
91
+ createServerTime = Date.now();
92
+ sessionStorage.setItem("launcher-create-server-".concat(nftId, "-time"), createServerTime);
93
+ }
88
94
 
89
95
  const getInstanceStatus = async () => {
90
96
  try {
@@ -107,6 +113,8 @@ function OperationPage(_ref) {
107
113
  });
108
114
  }
109
115
  } catch (error) {
116
+ sessionStorage.removeItem("launcher-create-server-".concat(nftId, "-time"));
117
+
110
118
  if ((0, _lodash.default)(error, 'response.status') === 404 && launchState.status !== STATUS.launching) {
111
119
  setLaunchState(state => _objectSpread(_objectSpread({}, state), {}, {
112
120
  status: STATUS.notFoundError
@@ -139,7 +147,29 @@ function OperationPage(_ref) {
139
147
  }, [nftId]); // eslint-disable-line
140
148
 
141
149
  const successful = launchState.status === STATUS.success;
142
- const message = [t('launch.waiting.starting'), t('launch.waiting.securing'), t('launch.waiting.prepare'), t('launch.waiting.waiting')];
150
+ const message = [/*#__PURE__*/_react.default.createElement(MessageDiv, null, /*#__PURE__*/_react.default.createElement("span", {
151
+ className: "msg-before"
152
+ }, "1/5"), t('launch.waiting.starting')), /*#__PURE__*/_react.default.createElement(MessageDiv, null, /*#__PURE__*/_react.default.createElement("span", {
153
+ className: "msg-before"
154
+ }, "2/5"), t('launch.waiting.securing')), /*#__PURE__*/_react.default.createElement(MessageDiv, null, /*#__PURE__*/_react.default.createElement("span", {
155
+ className: "msg-before"
156
+ }, "3/5"), t('launch.waiting.prepare')), /*#__PURE__*/_react.default.createElement(MessageDiv, null, /*#__PURE__*/_react.default.createElement("span", {
157
+ className: "msg-before"
158
+ }, "4/5"), t('launch.waiting.waiting'))];
159
+ const messageDuration = 40000; // 防止用户刷新后message进度重新开始,修正 message 展示的信息
160
+
161
+ const nowTime = Date.now();
162
+ const creatingTime = nowTime - createServerTime;
163
+ let step = Math.floor(creatingTime / messageDuration);
164
+
165
+ if (step > 0) {
166
+ if (step > message.length) {
167
+ step = message.length - 1;
168
+ }
169
+
170
+ message.splice(0, step);
171
+ }
172
+
143
173
  return /*#__PURE__*/_react.default.createElement(Content, null, /*#__PURE__*/_react.default.createElement(_pageHeader.default, {
144
174
  title: t("".concat(type, ".title")),
145
175
  className: "launch-page-header ".concat(successful ? 'header-hide' : '')
@@ -150,7 +180,7 @@ function OperationPage(_ref) {
150
180
  increaseSpeed: 0.3,
151
181
  messageLoop: false,
152
182
  maybeDuration: 180000,
153
- messageDuration: 40000
183
+ messageDuration: messageDuration
154
184
  })), successful && /*#__PURE__*/_react.default.createElement(_launchResultMessage.default, {
155
185
  variant: successful ? 'success' : 'loading',
156
186
  title: successful ? t('launch.launched') : '',
@@ -189,19 +219,24 @@ function OperationPage(_ref) {
189
219
  }));
190
220
  }
191
221
 
222
+ const MessageDiv = _styledComponents.default.div.withConfig({
223
+ displayName: "instance-operation__MessageDiv",
224
+ componentId: "sc-1fcaixs-0"
225
+ })([".msg-before{display:inline-block;color:#aaa;font-size:14px;margin-right:6px;}"]);
226
+
192
227
  const LinkEle = _styledComponents.default.a.withConfig({
193
228
  displayName: "instance-operation__LinkEle",
194
- componentId: "sc-1fcaixs-0"
229
+ componentId: "sc-1fcaixs-1"
195
230
  })(["display:flex;justify-content:center;align-items:center;height:36px;color:", ";"], props => props.theme.palette.primary.main);
196
231
 
197
232
  const WaiterContainer = _styledComponents.default.div.withConfig({
198
233
  displayName: "instance-operation__WaiterContainer",
199
- componentId: "sc-1fcaixs-1"
234
+ componentId: "sc-1fcaixs-2"
200
235
  })(["color:#1dc1c7;"]);
201
236
 
202
237
  const Content = _styledComponents.default.div.withConfig({
203
238
  displayName: "instance-operation__Content",
204
- componentId: "sc-1fcaixs-2"
239
+ componentId: "sc-1fcaixs-3"
205
240
  })(["margin:auto;height:100%;.link{color:", ";}.link:hover{text-decoration:underline !important;}.status{color:", ";display:flex;flex-direction:column;align-items:center;.status-spinner{color:inherit !important;}.status-text{display:inline-block;padding:0 20px;max-width:420px;margin-top:24px;text-align:center;}}.button{min-width:150px;margin-bottom:100px;}.center{display:flex;align-items:center;justify-content:center;width:100%;height:100%;}.launch-page-header{transition:all ease 0.3s;&.header-hide{opacity:0;}}"], props => props.theme.palette.primary.main, props => props.theme.palette.primary.main);
206
241
 
207
242
  OperationPage.propTypes = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/launcher-workflow",
3
- "version": "1.6.12",
3
+ "version": "1.6.13",
4
4
  "description": "Purchase components for Launcher UI",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -37,12 +37,12 @@
37
37
  "react": ">=16.12.0"
38
38
  },
39
39
  "dependencies": {
40
- "@arcblock/did-connect": "^1.17.14",
41
- "@arcblock/icons": "^1.17.14",
42
- "@arcblock/license": "^1.17.14",
43
- "@arcblock/ux": "^1.17.14",
44
- "@blocklet/launcher-constant": "1.6.12",
45
- "@blocklet/launcher-layout": "1.6.12",
40
+ "@arcblock/did-connect": "^1.17.17",
41
+ "@arcblock/icons": "^1.17.17",
42
+ "@arcblock/license": "^1.17.17",
43
+ "@arcblock/ux": "^1.17.17",
44
+ "@blocklet/launcher-constant": "1.6.13",
45
+ "@blocklet/launcher-layout": "1.6.13",
46
46
  "@material-ui/core": "^4.12.3",
47
47
  "@material-ui/icons": "^4.11.2",
48
48
  "@material-ui/lab": "^4.0.0-alpha.60",
@@ -70,5 +70,5 @@
70
70
  "babel-plugin-inline-react-svg": "^2.0.1",
71
71
  "babel-plugin-styled-components": "^1.10.7"
72
72
  },
73
- "gitHead": "010f0dd72bed0bea52749dd5bb69f96b2a0f2717"
73
+ "gitHead": "a6c496c41e9970d60f3db51a7038aa0c566e2dbb"
74
74
  }