diff --git a/core/trino-main/src/main/resources/webapp/dist/workers.js b/core/trino-main/src/main/resources/webapp/dist/workers.js index 1fe4237dd035..67cb56d94711 100644 --- a/core/trino-main/src/main/resources/webapp/dist/workers.js +++ b/core/trino-main/src/main/resources/webapp/dist/workers.js @@ -106,7 +106,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n}); /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.WorkerList = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nvar SMALL_SPARKLINE_PROPERTIES = {\n width: '100%',\n height: '57px',\n fillColor: '#3F4552',\n lineColor: '#747F96',\n spotColor: '#1EDCFF',\n tooltipClassname: 'sparkline-tooltip',\n disableHiddenCheck: true\n};\n\nvar WorkerList = exports.WorkerList = function (_React$Component) {\n _inherits(WorkerList, _React$Component);\n\n function WorkerList(props) {\n _classCallCheck(this, WorkerList);\n\n var _this = _possibleConstructorReturn(this, (WorkerList.__proto__ || Object.getPrototypeOf(WorkerList)).call(this, props));\n\n _this.state = {\n initialized: false,\n workers: []\n };\n _this.refreshLoop = _this.refreshLoop.bind(_this);\n return _this;\n }\n\n _createClass(WorkerList, [{\n key: 'refreshLoop',\n value: function refreshLoop() {\n var _this2 = this;\n\n clearTimeout(this.timeoutId);\n $.get('/ui/api/worker', function (workers) {\n this.setState({\n initialized: true,\n workers: workers\n });\n this.resetTimer();\n }.bind(this)).fail(function () {\n _this2.setState({\n initialized: true\n });\n _this2.resetTimer();\n });\n }\n }, {\n key: 'resetTimer',\n value: function resetTimer() {\n clearTimeout(this.timeoutId);\n this.timeoutId = setTimeout(this.refreshLoop.bind(this), 1000);\n }\n }, {\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.refreshLoop();\n }\n }, {\n key: 'render',\n value: function render() {\n var workers = this.state.workers;\n if (workers === null) {\n if (this.state.initialized === false) {\n return _react2.default.createElement(\n 'div',\n { className: 'loader' },\n 'Loading...'\n );\n } else {\n return _react2.default.createElement(\n 'div',\n { className: 'row error-message' },\n _react2.default.createElement(\n 'div',\n { className: 'col-xs-12' },\n _react2.default.createElement(\n 'h4',\n null,\n 'Worker list information could not be loaded'\n )\n )\n );\n }\n }\n var workerList = function workerList() {\n var trs = [];\n workers.forEach(function (worker) {\n trs.push(_react2.default.createElement(\n 'tr',\n null,\n _react2.default.createElement(\n 'td',\n { className: 'info-text wrap-text' },\n _react2.default.createElement(\n 'a',\n { href: \"worker.html?\" + worker.nodeId, className: 'font-light', target: '_blank' },\n worker.nodeId\n )\n ),\n _react2.default.createElement(\n 'td',\n { className: 'info-text wrap-text' },\n _react2.default.createElement(\n 'a',\n { href: \"worker.html?\" + worker.nodeId, className: 'font-light', target: '_blank' },\n worker.nodeIp\n )\n ),\n _react2.default.createElement(\n 'td',\n { className: 'info-text wrap-text' },\n worker.nodeVersion\n ),\n _react2.default.createElement(\n 'td',\n { className: 'info-text wrap-text' },\n String(worker.coordinator)\n ),\n _react2.default.createElement(\n 'td',\n { className: 'info-text wrap-text' },\n worker.state\n )\n ));\n });\n return trs;\n };\n\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'div',\n { className: 'row' },\n _react2.default.createElement(\n 'div',\n { className: 'col-xs-12' },\n _react2.default.createElement(\n 'h3',\n null,\n 'Overview'\n ),\n _react2.default.createElement('hr', { className: 'h3-hr' }),\n _react2.default.createElement(\n 'table',\n { className: 'table' },\n _react2.default.createElement(\n 'tbody',\n null,\n _react2.default.createElement(\n 'tr',\n null,\n _react2.default.createElement(\n 'td',\n { className: 'info-title stage-table-stat-text' },\n 'Node ID'\n ),\n _react2.default.createElement(\n 'td',\n { className: 'info-title stage-table-stat-text' },\n 'Node IP'\n ),\n _react2.default.createElement(\n 'td',\n { className: 'info-title stage-table-stat-text' },\n 'Node Version'\n ),\n _react2.default.createElement(\n 'td',\n { className: 'info-title stage-table-stat-text' },\n 'Coordinator'\n ),\n _react2.default.createElement(\n 'td',\n { className: 'info-title stage-table-stat-text' },\n 'State'\n )\n ),\n workerList()\n )\n )\n )\n )\n );\n }\n }]);\n\n return WorkerList;\n}(_react2.default.Component);\n\n//# sourceURL=webpack:///./components/WorkerList.jsx?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.WorkerList = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nvar SMALL_SPARKLINE_PROPERTIES = {\n width: '100%',\n height: '57px',\n fillColor: '#3F4552',\n lineColor: '#747F96',\n spotColor: '#1EDCFF',\n tooltipClassname: 'sparkline-tooltip',\n disableHiddenCheck: true\n};\n\nvar WorkerList = exports.WorkerList = function (_React$Component) {\n _inherits(WorkerList, _React$Component);\n\n function WorkerList(props) {\n _classCallCheck(this, WorkerList);\n\n var _this = _possibleConstructorReturn(this, (WorkerList.__proto__ || Object.getPrototypeOf(WorkerList)).call(this, props));\n\n _this.state = {\n initialized: false,\n workers: []\n };\n _this.refreshLoop = _this.refreshLoop.bind(_this);\n return _this;\n }\n\n _createClass(WorkerList, [{\n key: 'refreshLoop',\n value: function refreshLoop() {\n var _this2 = this;\n\n clearTimeout(this.timeoutId);\n $.get('/ui/api/worker', function (workers) {\n if (workers != null) {\n workers.sort(function (workerA, workerB) {\n if (workerA.coordinator && !workerB.coordinator) {\n return -1;\n }\n if (!workerA.coordinator && workerB.coordinator) {\n return 1;\n }\n return workerA.nodeId.localeCompare(workerB.nodeId);\n });\n }\n this.setState({\n initialized: true,\n workers: workers\n });\n this.resetTimer();\n }.bind(this)).fail(function () {\n _this2.setState({\n initialized: true\n });\n _this2.resetTimer();\n });\n }\n }, {\n key: 'resetTimer',\n value: function resetTimer() {\n clearTimeout(this.timeoutId);\n this.timeoutId = setTimeout(this.refreshLoop.bind(this), 1000);\n }\n }, {\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.refreshLoop();\n }\n }, {\n key: 'render',\n value: function render() {\n var workers = this.state.workers;\n if (workers === null) {\n if (this.state.initialized === false) {\n return _react2.default.createElement(\n 'div',\n { className: 'loader' },\n 'Loading...'\n );\n } else {\n return _react2.default.createElement(\n 'div',\n { className: 'row error-message' },\n _react2.default.createElement(\n 'div',\n { className: 'col-xs-12' },\n _react2.default.createElement(\n 'h4',\n null,\n 'Worker list information could not be loaded'\n )\n )\n );\n }\n }\n var workerList = function workerList() {\n var trs = [];\n workers.forEach(function (worker) {\n trs.push(_react2.default.createElement(\n 'tr',\n null,\n _react2.default.createElement(\n 'td',\n { className: 'info-text wrap-text' },\n _react2.default.createElement(\n 'a',\n { href: \"worker.html?\" + worker.nodeId, className: 'font-light', target: '_blank' },\n worker.nodeId\n )\n ),\n _react2.default.createElement(\n 'td',\n { className: 'info-text wrap-text' },\n _react2.default.createElement(\n 'a',\n { href: \"worker.html?\" + worker.nodeId, className: 'font-light', target: '_blank' },\n worker.nodeIp\n )\n ),\n _react2.default.createElement(\n 'td',\n { className: 'info-text wrap-text' },\n worker.nodeVersion\n ),\n _react2.default.createElement(\n 'td',\n { className: 'info-text wrap-text' },\n String(worker.coordinator)\n ),\n _react2.default.createElement(\n 'td',\n { className: 'info-text wrap-text' },\n worker.state\n )\n ));\n });\n return trs;\n };\n\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'div',\n { className: 'row' },\n _react2.default.createElement(\n 'div',\n { className: 'col-xs-12' },\n _react2.default.createElement(\n 'h3',\n null,\n 'Overview'\n ),\n _react2.default.createElement('hr', { className: 'h3-hr' }),\n _react2.default.createElement(\n 'table',\n { className: 'table' },\n _react2.default.createElement(\n 'tbody',\n null,\n _react2.default.createElement(\n 'tr',\n null,\n _react2.default.createElement(\n 'td',\n { className: 'info-title stage-table-stat-text' },\n 'Node ID'\n ),\n _react2.default.createElement(\n 'td',\n { className: 'info-title stage-table-stat-text' },\n 'Node IP'\n ),\n _react2.default.createElement(\n 'td',\n { className: 'info-title stage-table-stat-text' },\n 'Node Version'\n ),\n _react2.default.createElement(\n 'td',\n { className: 'info-title stage-table-stat-text' },\n 'Coordinator'\n ),\n _react2.default.createElement(\n 'td',\n { className: 'info-title stage-table-stat-text' },\n 'State'\n )\n ),\n workerList()\n )\n )\n )\n )\n );\n }\n }]);\n\n return WorkerList;\n}(_react2.default.Component);\n\n//# sourceURL=webpack:///./components/WorkerList.jsx?"); /***/ }), diff --git a/core/trino-main/src/main/resources/webapp/src/components/WorkerList.jsx b/core/trino-main/src/main/resources/webapp/src/components/WorkerList.jsx index f57cd731bc67..a6c9a6a5e05d 100644 --- a/core/trino-main/src/main/resources/webapp/src/components/WorkerList.jsx +++ b/core/trino-main/src/main/resources/webapp/src/components/WorkerList.jsx @@ -37,6 +37,17 @@ export class WorkerList extends React.Component { refreshLoop() { clearTimeout(this.timeoutId); $.get('/ui/api/worker', function (workers) { + if (workers != null) { + workers.sort(function (workerA, workerB) { + if (workerA.coordinator && !workerB.coordinator) { + return -1; + } + if (!workerA.coordinator && workerB.coordinator) { + return 1; + } + return workerA.nodeId.localeCompare(workerB.nodeId); + }); + } this.setState({ initialized: true, workers: workers