From c17cadbaa767e17d9827f43de0782a2b5cb8a717 Mon Sep 17 00:00:00 2001 From: Auden Woolfson Date: Thu, 23 May 2024 17:21:52 +0300 Subject: [PATCH 1/6] Cherry pick router whitesource fixes Co-authored-by: a-alosaimi --- .../src/main/resources/router_ui/index.html | 12 +- .../src/main/resources/router_ui/src/.babelrc | 3 + .../router_ui/src/components/ClusterHUD.jsx | 43 +- .../router_ui/src/components/PageTitle.jsx | 17 +- .../router_ui/src/components/QueryList.jsx | 136 +- .../main/resources/router_ui/src/index.jsx | 25 +- .../resources/router_ui/src/package-lock.json | 5502 +++++ .../main/resources/router_ui/src/package.json | 28 +- .../resources/router_ui/src/webpack.config.js | 2 +- .../main/resources/router_ui/src/yarn.lock | 117 +- .../router_ui/vendor/bootstrap/LICENSE.txt | 21 - .../router_ui/vendor/bootstrap/config.json | 435 - .../vendor/bootstrap/css/bootstrap-grid.css | 4085 ++++ .../bootstrap/css/bootstrap-grid.css.map | 1 + .../bootstrap/css/bootstrap-grid.min.css | 6 + .../bootstrap/css/bootstrap-grid.min.css.map | 1 + .../bootstrap/css/bootstrap-grid.rtl.css | 4084 ++++ .../bootstrap/css/bootstrap-grid.rtl.css.map | 1 + .../bootstrap/css/bootstrap-grid.rtl.min.css | 6 + .../css/bootstrap-grid.rtl.min.css.map | 1 + .../vendor/bootstrap/css/bootstrap-reboot.css | 597 + .../bootstrap/css/bootstrap-reboot.css.map | 1 + .../bootstrap/css/bootstrap-reboot.min.css | 6 + .../css/bootstrap-reboot.min.css.map | 1 + .../bootstrap/css/bootstrap-reboot.rtl.css | 594 + .../css/bootstrap-reboot.rtl.css.map | 1 + .../css/bootstrap-reboot.rtl.min.css | 6 + .../css/bootstrap-reboot.rtl.min.css.map | 1 + .../vendor/bootstrap/css/bootstrap-theme.css | 596 - .../bootstrap/css/bootstrap-theme.min.css | 14 - .../bootstrap/css/bootstrap-utilities.css | 5402 +++++ .../bootstrap/css/bootstrap-utilities.css.map | 1 + .../bootstrap/css/bootstrap-utilities.min.css | 6 + .../css/bootstrap-utilities.min.css.map | 1 + .../bootstrap/css/bootstrap-utilities.rtl.css | 5393 +++++ .../css/bootstrap-utilities.rtl.css.map | 1 + .../css/bootstrap-utilities.rtl.min.css | 6 + .../css/bootstrap-utilities.rtl.min.css.map | 1 + .../vendor/bootstrap/css/bootstrap.css | 16975 ++++++++++------ .../vendor/bootstrap/css/bootstrap.css.map | 1 + .../vendor/bootstrap/css/bootstrap.min.css | 20 +- .../bootstrap/css/bootstrap.min.css.map | 1 + .../vendor/bootstrap/css/bootstrap.rtl.css | 12030 +++++++++++ .../bootstrap/css/bootstrap.rtl.css.map | 1 + .../bootstrap/css/bootstrap.rtl.min.css | 6 + .../bootstrap/css/bootstrap.rtl.min.css.map | 1 + .../fonts/glyphicons-halflings-regular.eot | Bin 20127 -> 0 bytes .../fonts/glyphicons-halflings-regular.svg | 288 - .../fonts/glyphicons-halflings-regular.ttf | Bin 45404 -> 0 bytes .../fonts/glyphicons-halflings-regular.woff | Bin 23424 -> 0 bytes .../fonts/glyphicons-halflings-regular.woff2 | Bin 18028 -> 0 bytes .../vendor/bootstrap/js/bootstrap.bundle.js | 6314 ++++++ .../bootstrap/js/bootstrap.bundle.js.map | 1 + .../bootstrap/js/bootstrap.bundle.min.js | 7 + .../bootstrap/js/bootstrap.bundle.min.js.map | 1 + .../vendor/bootstrap/js/bootstrap.esm.js | 4447 ++++ .../vendor/bootstrap/js/bootstrap.esm.js.map | 1 + .../vendor/bootstrap/js/bootstrap.esm.min.js | 7 + .../bootstrap/js/bootstrap.esm.min.js.map | 1 + .../vendor/bootstrap/js/bootstrap.js | 6384 ++++-- .../vendor/bootstrap/js/bootstrap.js.map | 1 + .../vendor/bootstrap/js/bootstrap.min.js | 17 +- .../vendor/bootstrap/js/bootstrap.min.js.map | 1 + .../vendor/jquery/jquery-2.2.3.min.js | 4 - .../{jquery-2.2.3.js => jquery-3.7.1.js} | 6414 +++--- .../vendor/jquery/jquery-3.7.1.min.js | 2 + .../src/static/vendor/jquery/jquery-3.7.1.js | 4 +- 67 files changed, 67762 insertions(+), 12321 deletions(-) create mode 100644 presto-router/src/main/resources/router_ui/src/.babelrc create mode 100644 presto-router/src/main/resources/router_ui/src/package-lock.json delete mode 100755 presto-router/src/main/resources/router_ui/vendor/bootstrap/LICENSE.txt delete mode 100755 presto-router/src/main/resources/router_ui/vendor/bootstrap/config.json create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-grid.css create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-grid.css.map create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-grid.min.css create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-grid.min.css.map create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-grid.rtl.css create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-grid.rtl.css.map create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-grid.rtl.min.css create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-grid.rtl.min.css.map create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-reboot.css create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-reboot.css.map create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-reboot.min.css create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-reboot.min.css.map create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-reboot.rtl.css create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-reboot.rtl.css.map create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-reboot.rtl.min.css create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-reboot.rtl.min.css.map delete mode 100755 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-theme.css delete mode 100755 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-theme.min.css create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-utilities.css create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-utilities.css.map create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-utilities.min.css create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-utilities.min.css.map create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-utilities.rtl.css create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-utilities.rtl.css.map create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-utilities.rtl.min.css create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap-utilities.rtl.min.css.map mode change 100755 => 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap.css create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap.css.map mode change 100755 => 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap.min.css create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap.min.css.map create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap.rtl.css create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap.rtl.css.map create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap.rtl.min.css create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/css/bootstrap.rtl.min.css.map delete mode 100755 presto-router/src/main/resources/router_ui/vendor/bootstrap/fonts/glyphicons-halflings-regular.eot delete mode 100755 presto-router/src/main/resources/router_ui/vendor/bootstrap/fonts/glyphicons-halflings-regular.svg delete mode 100755 presto-router/src/main/resources/router_ui/vendor/bootstrap/fonts/glyphicons-halflings-regular.ttf delete mode 100755 presto-router/src/main/resources/router_ui/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff delete mode 100755 presto-router/src/main/resources/router_ui/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff2 create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/js/bootstrap.bundle.js create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/js/bootstrap.bundle.js.map create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/js/bootstrap.bundle.min.js create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/js/bootstrap.bundle.min.js.map create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/js/bootstrap.esm.js create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/js/bootstrap.esm.js.map create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/js/bootstrap.esm.min.js create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/js/bootstrap.esm.min.js.map mode change 100755 => 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/js/bootstrap.js create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/js/bootstrap.js.map mode change 100755 => 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/js/bootstrap.min.js create mode 100644 presto-router/src/main/resources/router_ui/vendor/bootstrap/js/bootstrap.min.js.map delete mode 100755 presto-router/src/main/resources/router_ui/vendor/jquery/jquery-2.2.3.min.js rename presto-router/src/main/resources/router_ui/vendor/jquery/{jquery-2.2.3.js => jquery-3.7.1.js} (60%) mode change 100755 => 100644 create mode 100644 presto-router/src/main/resources/router_ui/vendor/jquery/jquery-3.7.1.min.js diff --git a/presto-router/src/main/resources/router_ui/index.html b/presto-router/src/main/resources/router_ui/index.html index bc9ed179d48a1..e9e9ce5275696 100755 --- a/presto-router/src/main/resources/router_ui/index.html +++ b/presto-router/src/main/resources/router_ui/index.html @@ -9,6 +9,9 @@ + + + @@ -19,10 +22,7 @@ - - - - + @@ -38,6 +38,10 @@ + + + + diff --git a/presto-router/src/main/resources/router_ui/src/.babelrc b/presto-router/src/main/resources/router_ui/src/.babelrc new file mode 100644 index 0000000000000..1919dc8c9ad76 --- /dev/null +++ b/presto-router/src/main/resources/router_ui/src/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["@babel/preset-env", "@babel/react", "@babel/flow"] +} \ No newline at end of file diff --git a/presto-router/src/main/resources/router_ui/src/components/ClusterHUD.jsx b/presto-router/src/main/resources/router_ui/src/components/ClusterHUD.jsx index c81d7e2eff7ce..0703b0268a088 100755 --- a/presto-router/src/main/resources/router_ui/src/components/ClusterHUD.jsx +++ b/presto-router/src/main/resources/router_ui/src/components/ClusterHUD.jsx @@ -113,7 +113,7 @@ export class ClusterHUD extends React.Component { }); this.resetTimer(); }.bind(this)) - .error(function () { + .fail(function () { this.resetTimer(); }.bind(this)); } @@ -145,30 +145,30 @@ export class ClusterHUD extends React.Component { }); } - $('[data-toggle="tooltip"]').tooltip(); + $('[data-bs-toggle="tooltip"]').tooltip(); } render() { return (
-
+
-
+
- + Running queries
-
+
- + Cluster Count
-
+
{this.state.runningQueries[this.state.runningQueries.length - 1]} @@ -176,7 +176,7 @@ export class ClusterHUD extends React.Component {
Loading ...
-
+
{this.state.clusterCount[this.state.clusterCount.length - 1]} @@ -186,23 +186,23 @@ export class ClusterHUD extends React.Component {
-
+
- + Queued queries
-
+
- + Active Workers
-
+
{this.state.queuedQueries[this.state.queuedQueries.length - 1]} @@ -210,7 +210,7 @@ export class ClusterHUD extends React.Component {
Loading ...
-
+
{this.state.activeWorkers[this.state.activeWorkers.length - 1]} @@ -221,23 +221,23 @@ export class ClusterHUD extends React.Component {
-
+
- + Blocked Queries
-
+
- + Running Drivers
-
+
{this.state.blockedQueries[this.state.blockedQueries.length - 1]} @@ -245,7 +245,7 @@ export class ClusterHUD extends React.Component {
Loading ...
-
+
{formatCount(this.state.runningDrivers[this.state.runningDrivers.length - 1])} @@ -258,4 +258,3 @@ export class ClusterHUD extends React.Component {
); } } - diff --git a/presto-router/src/main/resources/router_ui/src/components/PageTitle.jsx b/presto-router/src/main/resources/router_ui/src/components/PageTitle.jsx index 4b17e0f3ae1d9..a97dce335cfab 100755 --- a/presto-router/src/main/resources/router_ui/src/components/PageTitle.jsx +++ b/presto-router/src/main/resources/router_ui/src/components/PageTitle.jsx @@ -45,9 +45,7 @@ export class PageTitle extends React.Component { refreshLoop() { clearTimeout(this.timeoutId); fetch("/v1/info") - .then(response => { - return response.json() - }) + .then(response => response.json()) .then(info => { this.setState({ info: info, @@ -56,7 +54,7 @@ export class PageTitle extends React.Component { modalShown: false, }); //$FlowFixMe$ Bootstrap 3 plugin - $('#no-connection-modal').modal('hide'); + $('#no-connection-modal').hide(); this.resetTimer(); }) .catch(error => { @@ -69,7 +67,7 @@ export class PageTitle extends React.Component { if (!this.state.modalShown && (error || (Date.now() - this.state.lastSuccess) > 30 * 1000)) { //$FlowFixMe$ Bootstrap 3 plugin - $('#no-connection-modal').modal(); + $('#no-connection-modal').hide(); this.setState({modalShown: true}); } }); @@ -104,7 +102,7 @@ export class PageTitle extends React.Component { return (
-