diff --git a/24608.4c719776.async.js b/11882.fb02e559.async.js
similarity index 83%
rename from 24608.4c719776.async.js
rename to 11882.fb02e559.async.js
index cccf4eb60c..7966d3cae2 100644
--- a/24608.4c719776.async.js
+++ b/11882.fb02e559.async.js
@@ -1,5 +1,5 @@
"use strict";
-(self["webpackChunk"] = self["webpackChunk"] || []).push([[24608],{
+(self["webpackChunk"] = self["webpackChunk"] || []).push([[11882],{
/***/ 28287:
/*!******************************************!*\
@@ -339,9 +339,9 @@ var Dialog = /*#__PURE__*/function (_React$Component) {
/***/ }),
-/***/ 18335:
+/***/ 85053:
/*!**********************************************************!*\
- !*** ./src/components/vnc-setting/index.tsx + 1 modules ***!
+ !*** ./src/components/vnc-setting/index.tsx + 4 modules ***!
\**********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
@@ -357,6 +357,9 @@ var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorR
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(41498);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
+// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
+var slicedToArray = __webpack_require__(79800);
+var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./src/components/tpi-code-setting/index.less
@@ -365,8 +368,6 @@ var tpi_code_setting = __webpack_require__(87829);
var modal = __webpack_require__(43418);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
var message = __webpack_require__(8591);
-// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
-var input = __webpack_require__(36920);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
var row = __webpack_require__(95237);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
@@ -383,9 +384,6 @@ var MultiUpload = __webpack_require__(50473);
var env = __webpack_require__(19219);
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(52774);
-// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
-var slicedToArray = __webpack_require__(79800);
-var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(65327);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
@@ -514,6 +512,357 @@ var lodash = __webpack_require__(89392);
var MarkdownModal = __webpack_require__(22520);
// EXTERNAL MODULE: ./src/components/ui-customization/reset.less?modules
var resetmodules = __webpack_require__(18678);
+// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js
+var toConsumableArray = __webpack_require__(37205);
+var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
+// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
+var objectSpread2 = __webpack_require__(82242);
+var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
+// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
+var input = __webpack_require__(36920);
+// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
+var tooltip = __webpack_require__(6848);
+// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
+var table = __webpack_require__(2595);
+;// CONCATENATED MODULE: ./src/components/vnc-setting/ServicePreview/index.less?modules
+// extracted by mini-css-extract-plugin
+/* harmony default export */ var ServicePreviewmodules = ({"tip":"tip___G7f9K","title":"title___IQM0U","primary":"primary___GvQEk","del":"del___VIxYG"});
+;// CONCATENATED MODULE: ./src/components/vnc-setting/ServicePreview/icon.png
+var icon_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjJJREFUWEftlz9oE3EUx7+/+9veeWmatAlNvBqsWl0UizgpKKWCQwcnly4O3RwEHQWRUpysCFIsDoLgYjcDouDg4CKi1UFbXCJNDKklzR+TNMnd/X6So1fBtEnReEW42969d7/3eV/ee9yPROaYggoOE4oexoGHCw8HmIwi59exSPQZdsIEAi7kbUohAt9I9C4bpZY7lf9OQAjKZGCGnduN6hs5BQ7VJoAozVwUqXHQgZo85ddjQVH9mjXKD17nk2cOqb1jR5Rww3/96epSn8aLV84Ghhr2k3c/Uh9T1dK1seD+XoWTPiRr+fn3xYxzVp3Ib9N86IVjbwkQM5NTPMyTTtDN8TCODypYWK7gRnwF40d9mDwdtN0XZhMI+QTMTei2Pf1sBW8SFdyf2ItIj4jnn4qYfZXdFLhOpHiSj97zAP4vBQYDIlSJQ7lOsbxmIKDyCGuCXcRipgaJJxjql2w7mTdQqlLbbrzPrVvIFMy/64FOjugfNaHrAAPricscs2KdTOycZfHyQkbWH7dswlDh8xShxuYe6CSIKXTFs9pw6z3gAXgKeAoEC0tXeWocaxo/Apkw6t/ZWHJZBvzawRsfWUL3y6x24FHLPbBdAq2SHlFqq7d2ApDX9l2qCf50u9gtf0g8AE8BT4HtFJDNfGRP9fv5dqPV8Bdlfd4Qu4vtYu0xjN5mo5Ts0tWMR4lE7rARxtDXjvZf+EWKFIk9ZF3GGoY5Ah9zSQmLwBQpcv0qvvwEnl+9DjPi88gAAAAASUVORK5CYII=";
+// EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 32 modules
+var ui_customization = __webpack_require__(88174);
+// EXTERNAL MODULE: ./src/components/NoData/index.tsx
+var NoData = __webpack_require__(94398);
+;// CONCATENATED MODULE: ./src/components/vnc-setting/ServicePreview/index.tsx
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+var ServicePreview = function ServicePreview(_ref) {
+ var _data$2;
+ var taskId = _ref.taskId,
+ _ref$gather = _ref.gather,
+ gather = _ref$gather === void 0 ? {} : _ref$gather,
+ visible = _ref.visible,
+ setVisible = _ref.setVisible;
+ var _useState = (0,_react_17_0_2_react.useState)(true),
+ _useState2 = slicedToArray_default()(_useState, 2),
+ loading = _useState2[0],
+ setLoading = _useState2[1];
+ var _useState3 = (0,_react_17_0_2_react.useState)([]),
+ _useState4 = slicedToArray_default()(_useState3, 2),
+ data = _useState4[0],
+ setData = _useState4[1];
+ var _useState5 = (0,_react_17_0_2_react.useState)(''),
+ _useState6 = slicedToArray_default()(_useState5, 2),
+ value = _useState6[0],
+ setValue = _useState6[1];
+ var inputRef = (0,_react_17_0_2_react.useRef)(null);
+ (0,_react_17_0_2_react.useEffect)(function () {
+ if (visible) {
+ getData();
+ }
+ }, [visible]);
+ (0,_react_17_0_2_react.useEffect)(function () {
+ var _data$;
+ if (!!(data !== null && data !== void 0 && (_data$ = data[0]) !== null && _data$ !== void 0 && _data$.add) && inputRef.current) {
+ inputRef.current.focus();
+ }
+ }, [!!(data !== null && data !== void 0 && (_data$2 = data[0]) !== null && _data$2 !== void 0 && _data$2.add)]);
+ var getData = /*#__PURE__*/function () {
+ var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
+ var res, _res$data;
+ return regeneratorRuntime_default()().wrap(function _callee$(_context) {
+ while (1) switch (_context.prev = _context.next) {
+ case 0:
+ setLoading(true);
+ _context.next = 3;
+ return (0,fetch/* default */.ZP)("/api/tasks/".concat(taskId, "/proxy_list"), {
+ method: "post",
+ body: gather
+ });
+ case 3:
+ res = _context.sent;
+ if (res.status === 0) {
+ setData(res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list);
+ }
+ setLoading(false);
+ case 6:
+ case "end":
+ return _context.stop();
+ }
+ }, _callee);
+ }));
+ return function getData() {
+ return _ref2.apply(this, arguments);
+ };
+ }();
+ var handleSave = /*#__PURE__*/function () {
+ var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
+ var _data$map;
+ var res;
+ return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
+ while (1) switch (_context2.prev = _context2.next) {
+ case 0:
+ if (value) {
+ _context2.next = 3;
+ break;
+ }
+ message/* default */.ZP.warning('端口号不能为空');
+ return _context2.abrupt("return");
+ case 3:
+ if (!value.includes(" ")) {
+ _context2.next = 6;
+ break;
+ }
+ message/* default */.ZP.warning('端口号不能有空格');
+ return _context2.abrupt("return");
+ case 6:
+ if (!(value && (value.includes('.') || isNaN(Number(value)) || Number(value) > 65535 || Number(value) <= 0 || value.length > 1 && value[0] === "0"))) {
+ _context2.next = 9;
+ break;
+ }
+ message/* default */.ZP.warning('请输入正确的端口号');
+ return _context2.abrupt("return");
+ case 9:
+ if (!(data !== null && data !== void 0 && (_data$map = data.map(function (e) {
+ return e.port;
+ })) !== null && _data$map !== void 0 && _data$map.includes(value))) {
+ _context2.next = 12;
+ break;
+ }
+ message/* default */.ZP.warning('端口号不允许重复');
+ return _context2.abrupt("return");
+ case 12:
+ setLoading(true);
+ _context2.next = 15;
+ return (0,fetch/* default */.ZP)("/api/tasks/".concat(taskId, "/port_proxy"), {
+ method: "post",
+ body: objectSpread2_default()({
+ port: Number(value)
+ }, gather)
+ });
+ case 15:
+ res = _context2.sent;
+ if (!(res.status === 0)) {
+ _context2.next = 19;
+ break;
+ }
+ getData();
+ return _context2.abrupt("return");
+ case 19:
+ setLoading(false);
+ case 20:
+ case "end":
+ return _context2.stop();
+ }
+ }, _callee2);
+ }));
+ return function handleSave() {
+ return _ref3.apply(this, arguments);
+ };
+ }();
+ var handleDel = /*#__PURE__*/function () {
+ var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(port) {
+ return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
+ while (1) switch (_context4.prev = _context4.next) {
+ case 0:
+ modal/* default */.Z.confirm({
+ title: "提示",
+ centered: true,
+ icon: null,
+ content: '确认删除吗',
+ onOk: function () {
+ var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
+ var res;
+ return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
+ while (1) switch (_context3.prev = _context3.next) {
+ case 0:
+ _context3.next = 2;
+ return (0,fetch/* default */.ZP)("/api/tasks/".concat(taskId, "/proxy_del"), {
+ method: "delete",
+ body: objectSpread2_default()({
+ port: port
+ }, gather)
+ });
+ case 2:
+ res = _context3.sent;
+ if (!(res.status === 0)) {
+ _context3.next = 7;
+ break;
+ }
+ message/* default */.ZP.success('删除成功');
+ getData();
+ return _context3.abrupt("return");
+ case 7:
+ case "end":
+ return _context3.stop();
+ }
+ }, _callee3);
+ }));
+ function onOk() {
+ return _onOk.apply(this, arguments);
+ }
+ return onOk;
+ }()
+ });
+ case 1:
+ case "end":
+ return _context4.stop();
+ }
+ }, _callee4);
+ }));
+ return function handleDel(_x) {
+ return _ref4.apply(this, arguments);
+ };
+ }();
+ var handleAdd = function handleAdd() {
+ var _data$3;
+ if (data !== null && data !== void 0 && (_data$3 = data[0]) !== null && _data$3 !== void 0 && _data$3.add) {
+ message/* default */.ZP.warning('只能添加一行');
+ return;
+ }
+ setValue('');
+ var item = {
+ port: '',
+ proxyUrl: '',
+ add: true
+ };
+ setData([item].concat(toConsumableArray_default()(data)));
+ };
+ var columns = [{
+ title: '内部端口',
+ dataIndex: 'port',
+ render: function render(v, record) {
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
+ children: record.add ? /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
+ ref: inputRef,
+ maxLength: 5,
+ placeholder: "\u8BF7\u8F93\u5165",
+ value: value,
+ onChange: function onChange(e) {
+ return setValue(e.target.value);
+ }
+ }) : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
+ children: v
+ })
+ });
+ }
+ }, {
+ title: '外部访问',
+ dataIndex: 'proxyUrl',
+ render: function render(v) {
+ var _v$split;
+ return (v === null || v === void 0 || (_v$split = v.split('//')) === null || _v$split === void 0 ? void 0 : _v$split[1]) || '- -';
+ }
+ }, {
+ title: '操作',
+ dataIndex: 'action',
+ align: 'right',
+ render: function render(_, record, index) {
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
+ children: record.add ? /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
+ children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
+ onClick: handleSave,
+ className: ServicePreviewmodules.primary,
+ children: "\u4FDD\u5B58"
+ }), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
+ onClick: function onClick() {
+ return setData(function (p) {
+ return p.filter(function (e, i) {
+ return index !== i;
+ });
+ });
+ },
+ style: {
+ marginLeft: 48
+ },
+ className: ServicePreviewmodules.primary,
+ children: "\u53D6\u6D88"
+ })]
+ }) : /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
+ children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
+ onClick: function onClick() {
+ return (0,util/* openNewWindow */.xg)(record === null || record === void 0 ? void 0 : record.proxyUrl);
+ },
+ className: ServicePreviewmodules.primary,
+ children: "\u6253\u5F00Web\u9884\u89C8"
+ }), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
+ onClick: function onClick() {
+ return handleDel(record === null || record === void 0 ? void 0 : record.port);
+ },
+ className: "".concat(ServicePreviewmodules.del, " ml20"),
+ children: "\u5220\u9664\u7AEF\u53E3"
+ })]
+ })
+ });
+ }
+ }];
+ return /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
+ centered: true,
+ open: visible,
+ title: "\u670D\u52A1\u9884\u89C8",
+ width: 930,
+ afterClose: function afterClose() {
+ setData([]);
+ },
+ onCancel: function onCancel() {
+ return setVisible(false);
+ },
+ footer: null,
+ children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
+ className: ServicePreviewmodules.tip,
+ children: "\u670D\u52A1\u9884\u89C8\u5C06\u4E3A\u5B9E\u9A8C\u73AF\u5883\u5185\u90E8\u670D\u52A1\u6620\u5C04\u5230\u4E34\u65F6\u57DF\u540D\uFF0C\u4EC5\u4F9B\u9884\u89C8\u6D4B\u8BD5\u4F7F\u7528\u3002\u8BF7\u586B\u5199\u5185\u90E8\u670D\u52A1\u7AEF\u53E3\uFF0C\u5E76\u786E\u8BA4\u670D\u52A1\u6B63\u5E38\u542F\u52A8\u3002"
+ }), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
+ align: "middle",
+ justify: "space-between",
+ children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
+ className: ServicePreviewmodules.title,
+ children: [/*#__PURE__*/(0,jsx_runtime.jsx)("b", {}), "\u7AEF\u53E3\u5217\u8868"]
+ }), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
+ title: data.length > 4 ? '最多只能添加5个端口号' : '',
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomButton */.op, {
+ disabled: data.length > 4,
+ onClick: handleAdd,
+ shape: "default",
+ icon: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
+ src: icon_namespaceObject,
+ width: 16
+ }),
+ children: "\u6DFB\u52A0\u7AEF\u53E3"
+ })
+ })]
+ }), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
+ style: {
+ marginBottom: 15
+ },
+ dataSource: data,
+ columns: columns,
+ locale: {
+ emptyText: /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
+ styles: {
+ margin: '40px auto'
+ }
+ })
+ },
+ loading: loading,
+ pagination: false
+ })]
+ });
+};
+/* harmony default export */ var vnc_setting_ServicePreview = (ServicePreview);
;// CONCATENATED MODULE: ./src/components/vnc-setting/index.tsx
@@ -534,6 +883,7 @@ var resetmodules = __webpack_require__(18678);
+
var difficultyDesc = {
1: '简单',
2: '中等',
@@ -567,6 +917,10 @@ var difficultyDesc = {
port = _ref.port;
var params = (0,_umi_production_exports.useParams)();
var recordRef = (0,_react_17_0_2_react.useRef)();
+ var _useState = (0,_react_17_0_2_react.useState)(false),
+ _useState2 = slicedToArray_default()(_useState, 2),
+ servicePreviewVisible = _useState2[0],
+ setServicePreviewVisible = _useState2[1];
//params.taskId 普通实训 params.identifier jupyter实训
@@ -655,129 +1009,85 @@ var difficultyDesc = {
(_recordRef$current = recordRef.current) === null || _recordRef$current === void 0 || (_recordRef$current$st = _recordRef$current.startScreenRecord) === null || _recordRef$current$st === void 0 || _recordRef$current$st.call(_recordRef$current);
};
var serverPreview = /*#__PURE__*/function () {
- var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
- var value, domId;
- return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
- while (1) switch (_context3.prev = _context3.next) {
+ var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
+ return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
+ while (1) switch (_context2.prev = _context2.next) {
case 0:
onHideToolBar();
- value = '';
- domId = String(Math.random());
- modal/* default */.Z.confirm({
- icon: null,
- className: resetmodules/* default */.Z.CustomTipsModalCss,
- okButtonProps: {
- type: 'primary'
- },
- centered: true,
- width: 460,
- okText: '预览',
- cancelText: '取消',
- title: '服务预览',
- content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
- style: {
- height: 95
- },
- children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
- className: "mb5 c-grey-333 font14 mb10",
- children: "\u670D\u52A1\u9884\u89C8\u5C06\u4E3A\u5B9E\u9A8C\u73AF\u5883\u5185\u90E8\u670D\u52A1\u6620\u5C04\u5230\u4E34\u65F6\u57DF\u540D\uFF0C\u4EC5\u4F9B\u9884\u89C8\u6D4B\u8BD5\u4F7F\u7528\u3002\u8BF7\u586B\u5199\u5185\u90E8\u670D\u52A1\u7AEF\u53E3\uFF0C\u5E76\u786E\u8BA4\u670D\u52A1\u6B63\u5E38\u542F\u52A8\u3002"
- }), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
- children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
- className: "c-grey-999 font14 mr10",
- children: "\u7AEF\u53E3\u53F7"
- }), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
- defaultValue: value,
- onChange: function onChange(e) {
- var dom = document.getElementById(domId);
- dom.style.display = 'none';
- value = e.target.value;
- },
- maxLength: 5,
- style: {
- width: 326
- }
- })]
- }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
- style: {
- display: 'none',
- marginTop: 4,
- marginLeft: 52
- },
- id: domId,
- className: "c-red"
- })]
- }),
- onOk: function () {
- var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
- var _res$data;
- var dom, res, _res$data2;
- return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
- while (1) switch (_context2.prev = _context2.next) {
- case 0:
- dom = document.getElementById(domId);
- if (value) {
- _context2.next = 5;
- break;
- }
- dom.style.display = 'block';
- dom.innerText = '端口号不能为空';
- return _context2.abrupt("return", Promise.reject());
- case 5:
- if (!value.includes(" ")) {
- _context2.next = 9;
- break;
- }
- dom.style.display = 'block';
- dom.innerText = '端口号不能有空格';
- return _context2.abrupt("return", Promise.reject());
- case 9:
- if (!(value && (value.includes('.') || isNaN(Number(value)) || Number(value) > 65535 || Number(value) <= 0 || value.length > 1 && value[0] === "0"))) {
- _context2.next = 13;
- break;
- }
- dom.style.display = 'block';
- dom.innerText = '请输入正确的端口号';
- return _context2.abrupt("return", Promise.reject());
- case 13:
- _context2.next = 15;
- return (0,fetch/* default */.ZP)("/api/tasks/".concat(params.taskId || params.identifier, "/port_proxy"), {
- method: "post",
- body: {
- port: Number(value),
- shixun_environment_id: shixun_environment_id || null,
- tab_type: tab_type || null,
- is_jupyter: is_jupyter || false
- }
- });
- case 15:
- res = _context2.sent;
- _context2.next = 18;
- return new Promise(function (resolve, reject) {
- setTimeout(function () {
- resolve('');
- }, 1000);
- });
- case 18:
- if (res !== null && res !== void 0 && (_res$data = res.data) !== null && _res$data !== void 0 && _res$data.url) {
- (0,util/* openNewWindow */.xg)(res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.url);
- }
- case 19:
- case "end":
- return _context2.stop();
- }
- }, _callee2);
- }));
- function onOk() {
- return _onOk2.apply(this, arguments);
- }
- return onOk;
- }()
- });
- case 4:
+ setServicePreviewVisible(true);
+ // let value: any = '';
+ // const domId: string = String(Math.random());
+ // Modal.confirm({
+ // icon: null,
+ // className: reset.CustomTipsModalCss,
+ // okButtonProps: {
+ // type: 'primary'
+ // },
+ // centered: true,
+ // width: 460,
+ // okText: '预览',
+ // cancelText: '取消',
+ // title: '服务预览',
+ // content:
+ //
服务预览将为实验环境内部服务映射到临时域名,仅供预览测试使用。请填写内部服务端口,并确认服务正常启动。
+ //
+ // 端口号
+ // {
+ // const dom = document.getElementById(domId)
+ // dom.style.display = 'none'
+ // value = e.target.value
+ // }}
+ // maxLength={5}
+ // style={{ width: 326 }}
+ // />
+
+ //
+ //
+ //
,
+ // onOk: async () => {
+ // const dom = document.getElementById(domId)
+ // if (!value) {
+ // dom.style.display = 'block'
+ // dom.innerText = '端口号不能为空'
+ // return Promise.reject()
+ // }
+ // if (value.includes(" ")) {
+ // dom.style.display = 'block'
+ // dom.innerText = '端口号不能有空格'
+ // return Promise.reject()
+ // }
+ // if (value && (value.includes('.') || isNaN(Number(value)) || Number(value) > 65535 || Number(value) <= 0 || (value.length > 1 && value[0] === "0"))) {
+ // dom.style.display = 'block'
+ // dom.innerText = '请输入正确的端口号'
+ // return Promise.reject()
+ // }
+ // const res = await Fetch(`/api/tasks/${params.taskId || params.identifier}/port_proxy`, {
+ // method: "post",
+ // body: {
+ // port: Number(value),
+ // shixun_environment_id: shixun_environment_id || null,
+ // tab_type: tab_type || null,
+ // is_jupyter: is_jupyter || false
+
+ // }
+ // })
+ // await new Promise(function (resolve, reject) {
+ // setTimeout(() => {
+ // resolve('');
+ // }, 1000);
+ // });
+ // if (res?.data?.url) {
+ // openNewWindow(res?.data?.url);
+ // }
+ // },
+ // })
+ case 2:
case "end":
- return _context3.stop();
+ return _context2.stop();
}
- }, _callee3);
+ }, _callee2);
}));
return function serverPreview() {
return _ref2.apply(this, arguments);
@@ -1067,6 +1377,15 @@ var difficultyDesc = {
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(record, {
ref: recordRef
+ }), /*#__PURE__*/(0,jsx_runtime.jsx)(vnc_setting_ServicePreview, {
+ visible: servicePreviewVisible,
+ setVisible: setServicePreviewVisible,
+ taskId: params.taskId || params.identifier,
+ gather: {
+ shixun_environment_id: shixun_environment_id || null,
+ tab_type: tab_type || null,
+ is_jupyter: is_jupyter || false
+ }
})]
});
});
diff --git a/98050.66b56c6e.async.js b/30795.43d56eb7.async.js
similarity index 90%
rename from 98050.66b56c6e.async.js
rename to 30795.43d56eb7.async.js
index 63542c5203..2dc4400ff1 100644
--- a/98050.66b56c6e.async.js
+++ b/30795.43d56eb7.async.js
@@ -1,4 +1,4 @@
-(self["webpackChunk"] = self["webpackChunk"] || []).push([[98050],{
+(self["webpackChunk"] = self["webpackChunk"] || []).push([[30795],{
/***/ 80205:
/*!*******************************************************************************************************************!*\
@@ -138,323 +138,6 @@ if (false) {}
/***/ }),
-/***/ 31797:
-/*!*************************************************************************!*\
- !*** ./node_modules/_antd@5.9.0@antd/es/statistic/index.js + 5 modules ***!
- \*************************************************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-
-// EXPORTS
-__webpack_require__.d(__webpack_exports__, {
- Z: function() { return /* binding */ es_statistic; }
-});
-
-// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
-var _react_17_0_2_react = __webpack_require__(59301);
-// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/hooks/useForceUpdate.js
-var useForceUpdate = __webpack_require__(56762);
-// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/reactNode.js
-var reactNode = __webpack_require__(92343);
-// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
-var _classnames_2_5_1_classnames = __webpack_require__(92310);
-var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
-// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
-var context = __webpack_require__(36355);
-// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/skeleton/index.js + 12 modules
-var skeleton = __webpack_require__(78485);
-;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/Number.js
-"use client";
-
-
-const StatisticNumber = props => {
- const {
- value,
- formatter,
- precision,
- decimalSeparator,
- groupSeparator = '',
- prefixCls
- } = props;
- let valueNode;
- if (typeof formatter === 'function') {
- // Customize formatter
- valueNode = formatter(value);
- } else {
- // Internal formatter
- const val = String(value);
- const cells = val.match(/^(-?)(\d*)(\.(\d+))?$/);
- // Process if illegal number
- if (!cells || val === '-') {
- valueNode = val;
- } else {
- const negative = cells[1];
- let int = cells[2] || '0';
- let decimal = cells[4] || '';
- int = int.replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator);
- if (typeof precision === 'number') {
- decimal = decimal.padEnd(precision, '0').slice(0, precision > 0 ? precision : 0);
- }
- if (decimal) {
- decimal = `${decimalSeparator}${decimal}`;
- }
- valueNode = [/*#__PURE__*/_react_17_0_2_react.createElement("span", {
- key: "int",
- className: `${prefixCls}-content-value-int`
- }, negative, int), decimal && /*#__PURE__*/_react_17_0_2_react.createElement("span", {
- key: "decimal",
- className: `${prefixCls}-content-value-decimal`
- }, decimal)];
- }
- }
- return /*#__PURE__*/_react_17_0_2_react.createElement("span", {
- className: `${prefixCls}-content-value`
- }, valueNode);
-};
-/* harmony default export */ var statistic_Number = (StatisticNumber);
-// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
-var style = __webpack_require__(17313);
-// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/genComponentStyleHook.js
-var genComponentStyleHook = __webpack_require__(83116);
-// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/statistic.js
-var statistic = __webpack_require__(37613);
-;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/style/index.js
-"use client";
-
-
-
-const genStatisticStyle = token => {
- const {
- componentCls,
- marginXXS,
- padding,
- colorTextDescription,
- titleFontSize,
- colorTextHeading,
- contentFontSize,
- fontFamily
- } = token;
- return {
- [`${componentCls}`]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
- [`${componentCls}-title`]: {
- marginBottom: marginXXS,
- color: colorTextDescription,
- fontSize: titleFontSize
- },
- [`${componentCls}-skeleton`]: {
- paddingTop: padding
- },
- [`${componentCls}-content`]: {
- color: colorTextHeading,
- fontSize: contentFontSize,
- fontFamily,
- [`${componentCls}-content-value`]: {
- display: 'inline-block',
- direction: 'ltr'
- },
- [`${componentCls}-content-prefix, ${componentCls}-content-suffix`]: {
- display: 'inline-block'
- },
- [`${componentCls}-content-prefix`]: {
- marginInlineEnd: marginXXS
- },
- [`${componentCls}-content-suffix`]: {
- marginInlineStart: marginXXS
- }
- }
- })
- };
-};
-// ============================== Export ==============================
-/* harmony default export */ var statistic_style = ((0,genComponentStyleHook/* default */.Z)('Statistic', token => {
- const statisticToken = (0,statistic/* merge */.TS)(token, {});
- return [genStatisticStyle(statisticToken)];
-}, token => {
- const {
- fontSizeHeading3,
- fontSize
- } = token;
- return {
- titleFontSize: fontSize,
- contentFontSize: fontSizeHeading3
- };
-}));
-;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/Statistic.js
-"use client";
-
-
-
-
-
-
-
-const Statistic = props => {
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- style,
- valueStyle,
- value = 0,
- title,
- valueRender,
- prefix,
- suffix,
- loading = false,
- onMouseEnter,
- onMouseLeave,
- decimalSeparator = '.',
- groupSeparator = ','
- } = props;
- const {
- getPrefixCls,
- direction,
- statistic
- } = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
- const prefixCls = getPrefixCls('statistic', customizePrefixCls);
- const [wrapSSR, hashId] = statistic_style(prefixCls);
- const valueNode = /*#__PURE__*/_react_17_0_2_react.createElement(statistic_Number, Object.assign({
- decimalSeparator: decimalSeparator,
- groupSeparator: groupSeparator,
- prefixCls: prefixCls
- }, props, {
- value: value
- }));
- const cls = _classnames_2_5_1_classnames_default()(prefixCls, {
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, statistic === null || statistic === void 0 ? void 0 : statistic.className, className, rootClassName, hashId);
- return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("div", {
- className: cls,
- style: Object.assign(Object.assign({}, statistic === null || statistic === void 0 ? void 0 : statistic.style), style),
- onMouseEnter: onMouseEnter,
- onMouseLeave: onMouseLeave
- }, title && /*#__PURE__*/_react_17_0_2_react.createElement("div", {
- className: `${prefixCls}-title`
- }, title), /*#__PURE__*/_react_17_0_2_react.createElement(skeleton/* default */.Z, {
- paragraph: false,
- loading: loading,
- className: `${prefixCls}-skeleton`
- }, /*#__PURE__*/_react_17_0_2_react.createElement("div", {
- style: valueStyle,
- className: `${prefixCls}-content`
- }, prefix && /*#__PURE__*/_react_17_0_2_react.createElement("span", {
- className: `${prefixCls}-content-prefix`
- }, prefix), valueRender ? valueRender(valueNode) : valueNode, suffix && /*#__PURE__*/_react_17_0_2_react.createElement("span", {
- className: `${prefixCls}-content-suffix`
- }, suffix)))));
-};
-if (false) {}
-/* harmony default export */ var statistic_Statistic = (Statistic);
-;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/utils.js
-// Countdown
-const timeUnits = [['Y', 1000 * 60 * 60 * 24 * 365], ['M', 1000 * 60 * 60 * 24 * 30], ['D', 1000 * 60 * 60 * 24], ['H', 1000 * 60 * 60], ['m', 1000 * 60], ['s', 1000], ['S', 1] // million seconds
-];
-
-function formatTimeStr(duration, format) {
- let leftDuration = duration;
- const escapeRegex = /\[[^\]]*]/g;
- const keepList = (format.match(escapeRegex) || []).map(str => str.slice(1, -1));
- const templateText = format.replace(escapeRegex, '[]');
- const replacedText = timeUnits.reduce((current, _ref) => {
- let [name, unit] = _ref;
- if (current.includes(name)) {
- const value = Math.floor(leftDuration / unit);
- leftDuration -= value * unit;
- return current.replace(new RegExp(`${name}+`, 'g'), match => {
- const len = match.length;
- return value.toString().padStart(len, '0');
- });
- }
- return current;
- }, templateText);
- let index = 0;
- return replacedText.replace(escapeRegex, () => {
- const match = keepList[index];
- index += 1;
- return match;
- });
-}
-function formatCountdown(value, config) {
- const {
- format = ''
- } = config;
- const target = new Date(value).getTime();
- const current = Date.now();
- const diff = Math.max(target - current, 0);
- return formatTimeStr(diff, format);
-}
-;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/Countdown.js
-"use client";
-
-
-
-
-
-
-const REFRESH_INTERVAL = 1000 / 30;
-function getTime(value) {
- return new Date(value).getTime();
-}
-const Countdown = props => {
- const {
- value,
- format = 'HH:mm:ss',
- onChange,
- onFinish
- } = props;
- const forceUpdate = (0,useForceUpdate/* default */.Z)();
- const countdown = _react_17_0_2_react.useRef(null);
- const stopTimer = () => {
- onFinish === null || onFinish === void 0 ? void 0 : onFinish();
- if (countdown.current) {
- clearInterval(countdown.current);
- countdown.current = null;
- }
- };
- const syncTimer = () => {
- const timestamp = getTime(value);
- if (timestamp >= Date.now()) {
- countdown.current = setInterval(() => {
- forceUpdate();
- onChange === null || onChange === void 0 ? void 0 : onChange(timestamp - Date.now());
- if (timestamp < Date.now()) {
- stopTimer();
- }
- }, REFRESH_INTERVAL);
- }
- };
- _react_17_0_2_react.useEffect(() => {
- syncTimer();
- return () => {
- if (countdown.current) {
- clearInterval(countdown.current);
- countdown.current = null;
- }
- };
- }, [value]);
- const formatter = (formatValue, config) => formatCountdown(formatValue, Object.assign(Object.assign({}, config), {
- format
- }));
- const valueRender = node => (0,reactNode/* cloneElement */.Tm)(node, {
- title: undefined
- });
- return /*#__PURE__*/_react_17_0_2_react.createElement(statistic_Statistic, Object.assign({}, props, {
- valueRender: valueRender,
- formatter: formatter
- }));
-};
-/* harmony default export */ var statistic_Countdown = (/*#__PURE__*/_react_17_0_2_react.memo(Countdown));
-;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/index.js
-"use client";
-
-
-
-statistic_Statistic.Countdown = statistic_Countdown;
-/* harmony default export */ var es_statistic = (statistic_Statistic);
-
-/***/ }),
-
/***/ 25769:
/*!**************************************************************************!*\
!*** ./node_modules/_copy-to-clipboard@3.3.3@copy-to-clipboard/index.js ***!
diff --git a/25343.9c0b440e.async.js b/83695.6052778b.async.js
similarity index 78%
rename from 25343.9c0b440e.async.js
rename to 83695.6052778b.async.js
index 666fbf156f..fc0ab1afe1 100644
--- a/25343.9c0b440e.async.js
+++ b/83695.6052778b.async.js
@@ -1,5 +1,5 @@
"use strict";
-(self["webpackChunk"] = self["webpackChunk"] || []).push([[25343],{
+(self["webpackChunk"] = self["webpackChunk"] || []).push([[83695],{
/***/ 88544:
/*!********************************************************************************************************!*\
@@ -1024,598 +1024,6 @@ const genWireframeStyle = token => {
/***/ }),
-/***/ 39978:
-/*!********************************************************************!*\
- !*** ./node_modules/_antd@5.9.0@antd/es/rate/index.js + 8 modules ***!
- \********************************************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-
-// EXPORTS
-__webpack_require__.d(__webpack_exports__, {
- Z: function() { return /* binding */ rate; }
-});
-
-// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.0@@babel/runtime/helpers/esm/extends.js
-var esm_extends = __webpack_require__(5891);
-// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
-var _react_17_0_2_react = __webpack_require__(59301);
-;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/StarFilled.js
-// This icon file is generated automatically.
-var StarFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z" } }] }, "name": "star", "theme": "filled" };
-/* harmony default export */ var asn_StarFilled = (StarFilled);
-
-// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.5.2@@ant-design/icons/es/components/AntdIcon.js + 3 modules
-var AntdIcon = __webpack_require__(88853);
-;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.5.2@@ant-design/icons/es/icons/StarFilled.js
-
-// GENERATE BY ./scripts/generate.ts
-// DON NOT EDIT IT MANUALLY
-
-
-
-
-var StarFilled_StarFilled = function StarFilled(props, ref) {
- return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
- ref: ref,
- icon: asn_StarFilled
- }));
-};
-
-/** */
-var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(StarFilled_StarFilled);
-if (false) {}
-/* harmony default export */ var icons_StarFilled = (RefIcon);
-// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
-var _classnames_2_5_1_classnames = __webpack_require__(92310);
-var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
-// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.0@@babel/runtime/helpers/esm/defineProperty.js
-var defineProperty = __webpack_require__(80962);
-// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.0@@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
-var slicedToArray = __webpack_require__(29043);
-// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.0@@babel/runtime/helpers/esm/objectWithoutProperties.js
-var objectWithoutProperties = __webpack_require__(19149);
-// EXTERNAL MODULE: ./node_modules/_rc-util@5.43.0@rc-util/es/hooks/useMergedState.js
-var useMergedState = __webpack_require__(71366);
-// EXTERNAL MODULE: ./node_modules/_rc-util@5.43.0@rc-util/es/KeyCode.js
-var KeyCode = __webpack_require__(20287);
-// EXTERNAL MODULE: ./node_modules/_rc-util@5.43.0@rc-util/es/pickAttrs.js
-var pickAttrs = __webpack_require__(47413);
-;// CONCATENATED MODULE: ./node_modules/_rc-rate@2.12.0@rc-rate/es/Star.js
-
-
-
-function Star(props, ref) {
- var disabled = props.disabled,
- prefixCls = props.prefixCls,
- character = props.character,
- characterRender = props.characterRender,
- index = props.index,
- count = props.count,
- value = props.value,
- allowHalf = props.allowHalf,
- focused = props.focused,
- onHover = props.onHover,
- onClick = props.onClick;
- // =========================== Events ===========================
- var onInternalHover = function onInternalHover(e) {
- onHover(e, index);
- };
- var onInternalClick = function onInternalClick(e) {
- onClick(e, index);
- };
- var onInternalKeyDown = function onInternalKeyDown(e) {
- if (e.keyCode === KeyCode/* default */.Z.ENTER) {
- onClick(e, index);
- }
- };
- // =========================== Render ===========================
- // >>>>> ClassName
- var starValue = index + 1;
- var classNameList = new Set([prefixCls]);
- // TODO: Current we just refactor from CC to FC. This logic seems can be optimized.
- if (value === 0 && index === 0 && focused) {
- classNameList.add("".concat(prefixCls, "-focused"));
- } else if (allowHalf && value + 0.5 >= starValue && value < starValue) {
- classNameList.add("".concat(prefixCls, "-half"));
- classNameList.add("".concat(prefixCls, "-active"));
- if (focused) {
- classNameList.add("".concat(prefixCls, "-focused"));
- }
- } else {
- if (starValue <= value) {
- classNameList.add("".concat(prefixCls, "-full"));
- } else {
- classNameList.add("".concat(prefixCls, "-zero"));
- }
- if (starValue === value && focused) {
- classNameList.add("".concat(prefixCls, "-focused"));
- }
- }
- // >>>>> Node
- var characterNode = typeof character === 'function' ? character(props) : character;
- var start = /*#__PURE__*/_react_17_0_2_react.createElement("li", {
- className: _classnames_2_5_1_classnames_default()(Array.from(classNameList)),
- ref: ref
- }, /*#__PURE__*/_react_17_0_2_react.createElement("div", {
- onClick: disabled ? null : onInternalClick,
- onKeyDown: disabled ? null : onInternalKeyDown,
- onMouseMove: disabled ? null : onInternalHover,
- role: "radio",
- "aria-checked": value > index ? 'true' : 'false',
- "aria-posinset": index + 1,
- "aria-setsize": count,
- tabIndex: disabled ? -1 : 0
- }, /*#__PURE__*/_react_17_0_2_react.createElement("div", {
- className: "".concat(prefixCls, "-first")
- }, characterNode), /*#__PURE__*/_react_17_0_2_react.createElement("div", {
- className: "".concat(prefixCls, "-second")
- }, characterNode)));
- if (characterRender) {
- start = characterRender(start, props);
- }
- return start;
-}
-/* harmony default export */ var es_Star = (/*#__PURE__*/_react_17_0_2_react.forwardRef(Star));
-;// CONCATENATED MODULE: ./node_modules/_rc-rate@2.12.0@rc-rate/es/useRefs.js
-
-function useRefs() {
- var nodeRef = _react_17_0_2_react.useRef({});
- function getRef(index) {
- return nodeRef.current[index];
- }
- function setRef(index) {
- return function (node) {
- nodeRef.current[index] = node;
- };
- }
- return [getRef, setRef];
-}
-;// CONCATENATED MODULE: ./node_modules/_rc-rate@2.12.0@rc-rate/es/util.js
-function getScroll(w) {
- var ret = w.pageXOffset;
- var method = 'scrollLeft';
- if (typeof ret !== 'number') {
- var d = w.document;
- // ie6,7,8 standard mode
- ret = d.documentElement[method];
- if (typeof ret !== 'number') {
- // quirks mode
- ret = d.body[method];
- }
- }
- return ret;
-}
-function getClientPosition(elem) {
- var x;
- var y;
- var doc = elem.ownerDocument;
- var body = doc.body;
- var docElem = doc && doc.documentElement;
- var box = elem.getBoundingClientRect();
- x = box.left;
- y = box.top;
- x -= docElem.clientLeft || body.clientLeft || 0;
- y -= docElem.clientTop || body.clientTop || 0;
- return {
- left: x,
- top: y
- };
-}
-function getOffsetLeft(el) {
- var pos = getClientPosition(el);
- var doc = el.ownerDocument;
- // Only IE use `parentWindow`
- var w = doc.defaultView || doc.parentWindow;
- pos.left += getScroll(w);
- return pos.left;
-}
-;// CONCATENATED MODULE: ./node_modules/_rc-rate@2.12.0@rc-rate/es/Rate.js
-
-
-
-
-var _excluded = ["prefixCls", "className", "defaultValue", "value", "count", "allowHalf", "allowClear", "character", "characterRender", "disabled", "direction", "tabIndex", "autoFocus", "onHoverChange", "onChange", "onFocus", "onBlur", "onKeyDown", "onMouseLeave"];
-
-
-
-
-
-
-
-
-function Rate(props, ref) {
- var _classNames;
- var _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-rate' : _props$prefixCls,
- className = props.className,
- defaultValue = props.defaultValue,
- propValue = props.value,
- _props$count = props.count,
- count = _props$count === void 0 ? 5 : _props$count,
- _props$allowHalf = props.allowHalf,
- allowHalf = _props$allowHalf === void 0 ? false : _props$allowHalf,
- _props$allowClear = props.allowClear,
- allowClear = _props$allowClear === void 0 ? true : _props$allowClear,
- _props$character = props.character,
- character = _props$character === void 0 ? '★' : _props$character,
- characterRender = props.characterRender,
- disabled = props.disabled,
- _props$direction = props.direction,
- direction = _props$direction === void 0 ? 'ltr' : _props$direction,
- _props$tabIndex = props.tabIndex,
- tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,
- autoFocus = props.autoFocus,
- onHoverChange = props.onHoverChange,
- onChange = props.onChange,
- onFocus = props.onFocus,
- onBlur = props.onBlur,
- onKeyDown = props.onKeyDown,
- onMouseLeave = props.onMouseLeave,
- restProps = (0,objectWithoutProperties/* default */.Z)(props, _excluded);
- var _useRefs = useRefs(),
- _useRefs2 = (0,slicedToArray/* default */.Z)(_useRefs, 2),
- getStarRef = _useRefs2[0],
- setStarRef = _useRefs2[1];
- var rateRef = _react_17_0_2_react.useRef(null);
- // ============================ Ref =============================
- var triggerFocus = function triggerFocus() {
- if (!disabled) {
- var _rateRef$current;
- (_rateRef$current = rateRef.current) === null || _rateRef$current === void 0 ? void 0 : _rateRef$current.focus();
- }
- };
- _react_17_0_2_react.useImperativeHandle(ref, function () {
- return {
- focus: triggerFocus,
- blur: function blur() {
- if (!disabled) {
- var _rateRef$current2;
- (_rateRef$current2 = rateRef.current) === null || _rateRef$current2 === void 0 ? void 0 : _rateRef$current2.blur();
- }
- }
- };
- });
- // =========================== Value ============================
- var _useMergedState = (0,useMergedState/* default */.Z)(defaultValue || 0, {
- value: propValue
- }),
- _useMergedState2 = (0,slicedToArray/* default */.Z)(_useMergedState, 2),
- value = _useMergedState2[0],
- setValue = _useMergedState2[1];
- var _useMergedState3 = (0,useMergedState/* default */.Z)(null),
- _useMergedState4 = (0,slicedToArray/* default */.Z)(_useMergedState3, 2),
- cleanedValue = _useMergedState4[0],
- setCleanedValue = _useMergedState4[1];
- var getStarValue = function getStarValue(index, x) {
- var reverse = direction === 'rtl';
- var starValue = index + 1;
- if (allowHalf) {
- var starEle = getStarRef(index);
- var leftDis = getOffsetLeft(starEle);
- var width = starEle.clientWidth;
- if (reverse && x - leftDis > width / 2) {
- starValue -= 0.5;
- } else if (!reverse && x - leftDis < width / 2) {
- starValue -= 0.5;
- }
- }
- return starValue;
- };
- // >>>>> Change
- var changeValue = function changeValue(nextValue) {
- setValue(nextValue);
- onChange === null || onChange === void 0 ? void 0 : onChange(nextValue);
- };
- // =========================== Focus ============================
- var _React$useState = _react_17_0_2_react.useState(false),
- _React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
- focused = _React$useState2[0],
- setFocused = _React$useState2[1];
- var onInternalFocus = function onInternalFocus() {
- setFocused(true);
- onFocus === null || onFocus === void 0 ? void 0 : onFocus();
- };
- var onInternalBlur = function onInternalBlur() {
- setFocused(false);
- onBlur === null || onBlur === void 0 ? void 0 : onBlur();
- };
- // =========================== Hover ============================
- var _React$useState3 = _react_17_0_2_react.useState(null),
- _React$useState4 = (0,slicedToArray/* default */.Z)(_React$useState3, 2),
- hoverValue = _React$useState4[0],
- setHoverValue = _React$useState4[1];
- var onHover = function onHover(event, index) {
- var nextHoverValue = getStarValue(index, event.pageX);
- if (nextHoverValue !== cleanedValue) {
- setHoverValue(nextHoverValue);
- setCleanedValue(null);
- }
- onHoverChange === null || onHoverChange === void 0 ? void 0 : onHoverChange(nextHoverValue);
- };
- var onMouseLeaveCallback = function onMouseLeaveCallback(event) {
- if (!disabled) {
- setHoverValue(null);
- setCleanedValue(null);
- onHoverChange === null || onHoverChange === void 0 ? void 0 : onHoverChange(undefined);
- }
- if (event) {
- onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave(event);
- }
- };
- // =========================== Click ============================
- var onClick = function onClick(event, index) {
- var newValue = getStarValue(index, event.pageX);
- var isReset = false;
- if (allowClear) {
- isReset = newValue === value;
- }
- onMouseLeaveCallback();
- changeValue(isReset ? 0 : newValue);
- setCleanedValue(isReset ? newValue : null);
- };
- var onInternalKeyDown = function onInternalKeyDown(event) {
- var keyCode = event.keyCode;
- var reverse = direction === 'rtl';
- var nextValue = value;
- if (keyCode === KeyCode/* default */.Z.RIGHT && nextValue < count && !reverse) {
- if (allowHalf) {
- nextValue += 0.5;
- } else {
- nextValue += 1;
- }
- changeValue(nextValue);
- event.preventDefault();
- } else if (keyCode === KeyCode/* default */.Z.LEFT && nextValue > 0 && !reverse) {
- if (allowHalf) {
- nextValue -= 0.5;
- } else {
- nextValue -= 1;
- }
- changeValue(nextValue);
- event.preventDefault();
- } else if (keyCode === KeyCode/* default */.Z.RIGHT && nextValue > 0 && reverse) {
- if (allowHalf) {
- nextValue -= 0.5;
- } else {
- nextValue -= 1;
- }
- changeValue(nextValue);
- event.preventDefault();
- } else if (keyCode === KeyCode/* default */.Z.LEFT && nextValue < count && reverse) {
- if (allowHalf) {
- nextValue += 0.5;
- } else {
- nextValue += 1;
- }
- changeValue(nextValue);
- event.preventDefault();
- }
- onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);
- };
- // =========================== Effect ===========================
- _react_17_0_2_react.useEffect(function () {
- if (autoFocus && !disabled) {
- triggerFocus();
- }
- }, []);
- // =========================== Render ===========================
- // >>> Star
- var starNodes = new Array(count).fill(0).map(function (item, index) {
- return /*#__PURE__*/_react_17_0_2_react.createElement(es_Star, {
- ref: setStarRef(index),
- index: index,
- count: count,
- disabled: disabled,
- prefixCls: "".concat(prefixCls, "-star"),
- allowHalf: allowHalf,
- value: hoverValue === null ? value : hoverValue,
- onClick: onClick,
- onHover: onHover,
- key: item || index,
- character: character,
- characterRender: characterRender,
- focused: focused
- });
- });
- var classString = _classnames_2_5_1_classnames_default()(prefixCls, className, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-disabled"), disabled), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-rtl"), direction === 'rtl'), _classNames));
- // >>> Node
- return /*#__PURE__*/_react_17_0_2_react.createElement("ul", (0,esm_extends/* default */.Z)({
- className: classString,
- onMouseLeave: onMouseLeaveCallback,
- tabIndex: disabled ? -1 : tabIndex,
- onFocus: disabled ? null : onInternalFocus,
- onBlur: disabled ? null : onInternalBlur,
- onKeyDown: disabled ? null : onInternalKeyDown,
- ref: rateRef,
- role: "radiogroup"
- }, (0,pickAttrs/* default */.Z)(restProps, {
- aria: true,
- data: true,
- attr: true
- })), starNodes);
-}
-/* harmony default export */ var es_Rate = (/*#__PURE__*/_react_17_0_2_react.forwardRef(Rate));
-;// CONCATENATED MODULE: ./node_modules/_rc-rate@2.12.0@rc-rate/es/index.js
-
-/* harmony default export */ var es = (es_Rate);
-// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
-var context = __webpack_require__(36355);
-// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
-var tooltip = __webpack_require__(6848);
-// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
-var style = __webpack_require__(17313);
-// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/genComponentStyleHook.js
-var genComponentStyleHook = __webpack_require__(83116);
-// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/statistic.js
-var statistic = __webpack_require__(37613);
-;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/rate/style/index.js
-"use client";
-
-
-
-const genRateStarStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [`${componentCls}-star`]: {
- position: 'relative',
- display: 'inline-block',
- color: 'inherit',
- cursor: 'pointer',
- '&:not(:last-child)': {
- marginInlineEnd: token.marginXS
- },
- '> div': {
- transition: `all ${token.motionDurationMid}, outline 0s`,
- '&:hover': {
- transform: token.starHoverScale
- },
- '&:focus': {
- outline: 0
- },
- '&:focus-visible': {
- outline: `${token.lineWidth}px dashed ${token.starColor}`,
- transform: token.starHoverScale
- }
- },
- '&-first, &-second': {
- color: token.starBg,
- transition: `all ${token.motionDurationMid}`,
- userSelect: 'none',
- [token.iconCls]: {
- verticalAlign: 'middle'
- }
- },
- '&-first': {
- position: 'absolute',
- top: 0,
- insetInlineStart: 0,
- width: '50%',
- height: '100%',
- overflow: 'hidden',
- opacity: 0
- },
- [`&-half ${componentCls}-star-first, &-half ${componentCls}-star-second`]: {
- opacity: 1
- },
- [`&-half ${componentCls}-star-first, &-full ${componentCls}-star-second`]: {
- color: 'inherit'
- }
- }
- };
-};
-const genRateRtlStyle = token => ({
- [`&-rtl${token.componentCls}`]: {
- direction: 'rtl'
- }
-});
-const genRateStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
- display: 'inline-block',
- margin: 0,
- padding: 0,
- color: token.starColor,
- fontSize: token.starSize,
- lineHeight: 'unset',
- listStyle: 'none',
- outline: 'none',
- // disable styles
- [`&-disabled${componentCls} ${componentCls}-star`]: {
- cursor: 'default',
- '> div:hover': {
- transform: 'scale(1)'
- }
- }
- }), genRateStarStyle(token)), {
- // text styles
- [`+ ${componentCls}-text`]: {
- display: 'inline-block',
- marginInlineStart: token.marginXS,
- fontSize: token.fontSize
- }
- }), genRateRtlStyle(token))
- };
-};
-// ============================== Export ==============================
-/* harmony default export */ var rate_style = ((0,genComponentStyleHook/* default */.Z)('Rate', token => {
- const rateToken = (0,statistic/* merge */.TS)(token, {});
- return [genRateStyle(rateToken)];
-}, token => ({
- starColor: token.yellow6,
- starSize: token.controlHeightLG * 0.5,
- starHoverScale: 'scale(1.1)',
- starBg: token.colorFillContent
-})));
-;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/rate/index.js
-"use client";
-
-var __rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
-};
-
-
-
-
-
-
-
-const rate_Rate = /*#__PURE__*/_react_17_0_2_react.forwardRef((props, ref) => {
- const {
- prefixCls,
- className,
- rootClassName,
- style,
- tooltips,
- character = /*#__PURE__*/_react_17_0_2_react.createElement(icons_StarFilled, null)
- } = props,
- rest = __rest(props, ["prefixCls", "className", "rootClassName", "style", "tooltips", "character"]);
- const characterRender = (node, _ref) => {
- let {
- index
- } = _ref;
- if (!tooltips) {
- return node;
- }
- return /*#__PURE__*/_react_17_0_2_react.createElement(tooltip/* default */.Z, {
- title: tooltips[index]
- }, node);
- };
- const {
- getPrefixCls,
- direction,
- rate
- } = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
- const ratePrefixCls = getPrefixCls('rate', prefixCls);
- // Style
- const [wrapSSR, hashId] = rate_style(ratePrefixCls);
- const mergedStyle = Object.assign(Object.assign({}, rate === null || rate === void 0 ? void 0 : rate.style), style);
- return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(es, Object.assign({
- ref: ref,
- character: character,
- characterRender: characterRender
- }, rest, {
- className: _classnames_2_5_1_classnames_default()(className, rootClassName, hashId, rate === null || rate === void 0 ? void 0 : rate.className),
- style: mergedStyle,
- prefixCls: ratePrefixCls,
- direction: direction
- })));
-});
-if (false) {}
-/* harmony default export */ var rate = (rate_Rate);
-
-/***/ }),
-
/***/ 65615:
/*!*********************************************************************!*\
!*** ./node_modules/_antd@5.9.0@antd/es/tour/index.js + 12 modules ***!
diff --git a/index.html b/index.html
index 4e5f8618ce..16d753dde2 100644
--- a/index.html
+++ b/index.html
@@ -26,7 +26,7 @@
display: block !important;
}
-
+