@blocklet/launcher-workflow 1.7.55 → 1.7.58
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/lib/components/instance-operation.js +51 -50
- package/lib/locales/en.js +2 -1
- package/lib/locales/zh.js +2 -1
- package/package.json +9 -8
|
@@ -31,6 +31,8 @@ var _pageHeader = _interopRequireDefault(require("@blocklet/launcher-layout/lib/
|
|
|
31
31
|
|
|
32
32
|
var _launchResultMessage = _interopRequireDefault(require("@blocklet/launcher-layout/lib/launch-result-message"));
|
|
33
33
|
|
|
34
|
+
var _progressMessage = _interopRequireDefault(require("@blocklet/launcher-ux/lib/progress-message"));
|
|
35
|
+
|
|
34
36
|
var _util = require("../util");
|
|
35
37
|
|
|
36
38
|
var _query = _interopRequireDefault(require("../hooks/query"));
|
|
@@ -83,6 +85,8 @@ function OperationPage(_ref) {
|
|
|
83
85
|
const {
|
|
84
86
|
api
|
|
85
87
|
} = (0, _request.default)();
|
|
88
|
+
const [progressStepIndex, setProgressStepIndex] = (0, _react.useState)(0);
|
|
89
|
+
const [isDone, setIsDone] = (0, _react.useState)(false);
|
|
86
90
|
let createServerTime = sessionStorage.getItem("launcher-create-server-".concat(nftId, "-time"));
|
|
87
91
|
|
|
88
92
|
if (!createServerTime) {
|
|
@@ -100,15 +104,18 @@ function OperationPage(_ref) {
|
|
|
100
104
|
|
|
101
105
|
if (instance.status >= _constant.INSTANCE_STATUS.running) {
|
|
102
106
|
const url = (0, _util.getLaunchBlockletUrl)(instance.serverUrl, blockletMetaUrl, locale);
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
setIsDone(true);
|
|
108
|
+
setTimeout(() => {
|
|
109
|
+
setLaunchState(pre => _objectSpread(_objectSpread({}, pre), {}, {
|
|
110
|
+
status: STATUS.success,
|
|
111
|
+
appUrl: url
|
|
112
|
+
}));
|
|
113
|
+
(0, _util.loadURL)(url).finally(() => {
|
|
114
|
+
setTimeout(() => {
|
|
115
|
+
window.location.href = url;
|
|
116
|
+
}, 1000);
|
|
117
|
+
});
|
|
118
|
+
}, 1000);
|
|
112
119
|
}
|
|
113
120
|
} catch (error) {
|
|
114
121
|
sessionStorage.removeItem("launcher-create-server-".concat(nftId, "-time"));
|
|
@@ -145,41 +152,31 @@ function OperationPage(_ref) {
|
|
|
145
152
|
}, [nftId]); // eslint-disable-line
|
|
146
153
|
|
|
147
154
|
const successful = launchState.status === STATUS.success;
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
children: "3/5"
|
|
162
|
-
}), t('launch.waiting.prepare')]
|
|
163
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(MessageDiv, {
|
|
164
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
165
|
-
className: "msg-before",
|
|
166
|
-
children: "4/5"
|
|
167
|
-
}), t('launch.waiting.waiting')]
|
|
168
|
-
})];
|
|
169
|
-
const messageDuration = 40000; // 防止用户刷新后message进度重新开始,修正 message 展示的信息
|
|
170
|
-
|
|
171
|
-
const nowTime = Date.now();
|
|
172
|
-
const creatingTime = nowTime - createServerTime;
|
|
173
|
-
let step = Math.floor(creatingTime / messageDuration);
|
|
174
|
-
|
|
175
|
-
if (step > 0) {
|
|
176
|
-
if (step >= message.length) {
|
|
177
|
-
step = message.length - 1;
|
|
155
|
+
const progressSteps = [t('launch.waiting.starting'), t('launch.waiting.securing'), t('launch.waiting.prepare'), t('launch.waiting.waiting'), t('launch.waiting.done')];
|
|
156
|
+
const messageDuration = 40000;
|
|
157
|
+
|
|
158
|
+
const fixStepIndex = () => {
|
|
159
|
+
// 防止用户刷新后message进度重新开始,修正 message 展示的信息
|
|
160
|
+
const nowTime = Date.now();
|
|
161
|
+
const creatingTime = nowTime - createServerTime;
|
|
162
|
+
let step = Math.floor(creatingTime / messageDuration);
|
|
163
|
+
|
|
164
|
+
if (step > 0) {
|
|
165
|
+
if (step >= progressSteps.length - 1) {
|
|
166
|
+
step = progressSteps.length - 2;
|
|
167
|
+
}
|
|
178
168
|
}
|
|
179
169
|
|
|
180
|
-
|
|
181
|
-
}
|
|
170
|
+
setProgressStepIndex(step);
|
|
171
|
+
};
|
|
182
172
|
|
|
173
|
+
(0, _react.useEffect)(() => {
|
|
174
|
+
fixStepIndex();
|
|
175
|
+
const timer = setInterval(() => {
|
|
176
|
+
fixStepIndex();
|
|
177
|
+
}, 1000);
|
|
178
|
+
return () => clearInterval(timer); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
179
|
+
}, []);
|
|
183
180
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Content, {
|
|
184
181
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_pageHeader.default, {
|
|
185
182
|
title: t("".concat(type, ".title")),
|
|
@@ -189,7 +186,16 @@ function OperationPage(_ref) {
|
|
|
189
186
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spinner.default, {})
|
|
190
187
|
}), launchState.status === STATUS.launching && /*#__PURE__*/(0, _jsxRuntime.jsx)(WaiterContainer, {
|
|
191
188
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_AnimationWaiter.default, {
|
|
192
|
-
message:
|
|
189
|
+
message: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
190
|
+
style: {
|
|
191
|
+
textAlign: 'center'
|
|
192
|
+
},
|
|
193
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_progressMessage.default, {
|
|
194
|
+
steps: progressSteps,
|
|
195
|
+
stepIndex: isDone ? 4 : progressStepIndex,
|
|
196
|
+
autoGrowth: isDone ? 500 : 20000
|
|
197
|
+
})
|
|
198
|
+
}),
|
|
193
199
|
increaseSpeed: 0.3,
|
|
194
200
|
messageLoop: false,
|
|
195
201
|
maybeDuration: 180000,
|
|
@@ -237,24 +243,19 @@ function OperationPage(_ref) {
|
|
|
237
243
|
});
|
|
238
244
|
}
|
|
239
245
|
|
|
240
|
-
const MessageDiv = _styledComponents.default.div.withConfig({
|
|
241
|
-
displayName: "instance-operation__MessageDiv",
|
|
242
|
-
componentId: "sc-1fcaixs-0"
|
|
243
|
-
})([".msg-before{display:inline-block;color:#aaa;font-size:14px;margin-right:6px;}"]);
|
|
244
|
-
|
|
245
246
|
const LinkEle = _styledComponents.default.a.withConfig({
|
|
246
247
|
displayName: "instance-operation__LinkEle",
|
|
247
|
-
componentId: "sc-1fcaixs-
|
|
248
|
+
componentId: "sc-1fcaixs-0"
|
|
248
249
|
})(["display:flex;justify-content:center;align-items:center;height:36px;color:", ";"], props => props.theme.palette.primary.main);
|
|
249
250
|
|
|
250
251
|
const WaiterContainer = _styledComponents.default.div.withConfig({
|
|
251
252
|
displayName: "instance-operation__WaiterContainer",
|
|
252
|
-
componentId: "sc-1fcaixs-
|
|
253
|
+
componentId: "sc-1fcaixs-1"
|
|
253
254
|
})(["color:#1dc1c7;"]);
|
|
254
255
|
|
|
255
256
|
const Content = _styledComponents.default.div.withConfig({
|
|
256
257
|
displayName: "instance-operation__Content",
|
|
257
|
-
componentId: "sc-1fcaixs-
|
|
258
|
+
componentId: "sc-1fcaixs-2"
|
|
258
259
|
})(["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);
|
|
259
260
|
|
|
260
261
|
OperationPage.propTypes = {
|
package/lib/locales/en.js
CHANGED
|
@@ -60,7 +60,8 @@ module.exports = {
|
|
|
60
60
|
starting: 'Starting Server Instance',
|
|
61
61
|
securing: 'Securing Server Network',
|
|
62
62
|
prepare: 'Prepare Server Storage',
|
|
63
|
-
waiting: 'Waiting Server Ready'
|
|
63
|
+
waiting: 'Waiting Server Ready',
|
|
64
|
+
done: 'Server is Ready'
|
|
64
65
|
},
|
|
65
66
|
dialog: {
|
|
66
67
|
title: 'Launch Blocklet Server',
|
package/lib/locales/zh.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/launcher-workflow",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.58",
|
|
4
4
|
"description": "Purchase components for Launcher UI",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -37,12 +37,13 @@
|
|
|
37
37
|
"react": ">=18.1.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@arcblock/did-connect": "^2.1.
|
|
41
|
-
"@arcblock/icons": "^2.1.
|
|
42
|
-
"@arcblock/license": "^2.1.
|
|
43
|
-
"@arcblock/ux": "^2.1.
|
|
44
|
-
"@blocklet/launcher-layout": "1.7.
|
|
45
|
-
"@blocklet/launcher-util": "1.7.
|
|
40
|
+
"@arcblock/did-connect": "^2.1.58",
|
|
41
|
+
"@arcblock/icons": "^2.1.58",
|
|
42
|
+
"@arcblock/license": "^2.1.58",
|
|
43
|
+
"@arcblock/ux": "^2.1.58",
|
|
44
|
+
"@blocklet/launcher-layout": "1.7.58",
|
|
45
|
+
"@blocklet/launcher-util": "1.7.58",
|
|
46
|
+
"@blocklet/launcher-ux": "1.7.58",
|
|
46
47
|
"@emotion/react": "^11.9.0",
|
|
47
48
|
"@emotion/styled": "^11.8.1",
|
|
48
49
|
"@mui/icons-material": "^5.6.2",
|
|
@@ -73,5 +74,5 @@
|
|
|
73
74
|
"babel-plugin-inline-react-svg": "^2.0.1",
|
|
74
75
|
"babel-plugin-styled-components": "^1.10.7"
|
|
75
76
|
},
|
|
76
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "42a3cca652d1f2703a8e43be65014411933d48e1"
|
|
77
78
|
}
|