@blocklet/launcher-workflow 1.6.10 → 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 = [
|
|
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' : '')
|
|
@@ -147,7 +177,10 @@ function OperationPage(_ref) {
|
|
|
147
177
|
className: "center"
|
|
148
178
|
}, /*#__PURE__*/_react.default.createElement(_Spinner.default, null)), launchState.status === STATUS.launching && /*#__PURE__*/_react.default.createElement(WaiterContainer, null, /*#__PURE__*/_react.default.createElement(_AnimationWaiter.default, {
|
|
149
179
|
message: message,
|
|
150
|
-
increaseSpeed: 0.3
|
|
180
|
+
increaseSpeed: 0.3,
|
|
181
|
+
messageLoop: false,
|
|
182
|
+
maybeDuration: 180000,
|
|
183
|
+
messageDuration: messageDuration
|
|
151
184
|
})), successful && /*#__PURE__*/_react.default.createElement(_launchResultMessage.default, {
|
|
152
185
|
variant: successful ? 'success' : 'loading',
|
|
153
186
|
title: successful ? t('launch.launched') : '',
|
|
@@ -186,19 +219,24 @@ function OperationPage(_ref) {
|
|
|
186
219
|
}));
|
|
187
220
|
}
|
|
188
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
|
+
|
|
189
227
|
const LinkEle = _styledComponents.default.a.withConfig({
|
|
190
228
|
displayName: "instance-operation__LinkEle",
|
|
191
|
-
componentId: "sc-1fcaixs-
|
|
229
|
+
componentId: "sc-1fcaixs-1"
|
|
192
230
|
})(["display:flex;justify-content:center;align-items:center;height:36px;color:", ";"], props => props.theme.palette.primary.main);
|
|
193
231
|
|
|
194
232
|
const WaiterContainer = _styledComponents.default.div.withConfig({
|
|
195
233
|
displayName: "instance-operation__WaiterContainer",
|
|
196
|
-
componentId: "sc-1fcaixs-
|
|
234
|
+
componentId: "sc-1fcaixs-2"
|
|
197
235
|
})(["color:#1dc1c7;"]);
|
|
198
236
|
|
|
199
237
|
const Content = _styledComponents.default.div.withConfig({
|
|
200
238
|
displayName: "instance-operation__Content",
|
|
201
|
-
componentId: "sc-1fcaixs-
|
|
239
|
+
componentId: "sc-1fcaixs-3"
|
|
202
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);
|
|
203
241
|
|
|
204
242
|
OperationPage.propTypes = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/launcher-workflow",
|
|
3
|
-
"version": "1.6.
|
|
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.
|
|
41
|
-
"@arcblock/icons": "^1.17.
|
|
42
|
-
"@arcblock/license": "^1.17.
|
|
43
|
-
"@arcblock/ux": "^1.17.
|
|
44
|
-
"@blocklet/launcher-constant": "1.6.
|
|
45
|
-
"@blocklet/launcher-layout": "1.6.
|
|
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": "
|
|
73
|
+
"gitHead": "a6c496c41e9970d60f3db51a7038aa0c566e2dbb"
|
|
74
74
|
}
|