Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh UI and modernize its dependencies #22831

Merged
merged 9 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions core/trino-web-ui/src/main/resources/oauth2/failure.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@
<!-- Bootstrap core -->
<link href="/ui/vendor/bootstrap/css/bootstrap.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->

<!-- jQuery -->
<script type="text/javascript" src="/ui/vendor/jquery/jquery-3.5.1.min.js"></script>

Expand Down
6 changes: 0 additions & 6 deletions core/trino-web-ui/src/main/resources/oauth2/logout.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@
<!-- Bootstrap core -->
<link href="/ui/vendor/bootstrap/css/bootstrap.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->

<!-- CSS loader -->
<link href="/ui/vendor/css-loaders/loader.css" rel="stylesheet">

Expand Down
6 changes: 0 additions & 6 deletions core/trino-web-ui/src/main/resources/oauth2/success.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@
<!-- Bootstrap core -->
<link href="/ui/vendor/bootstrap/css/bootstrap.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->

<!-- jQuery -->
<script type="text/javascript" src="/ui/vendor/jquery/jquery-3.5.1.min.js"></script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@
* limitations under the License.
*/

.vis.timeline .item {
.vis-timeline .vis-item {
padding: 0px;
}
.vis.timeline .labelset .vlabel .inner {
.vis-timeline .vis-labelset .vis-label .vis-inner {
padding: 0px;
}
.vis.timeline .item.range {
height: 3px;
.vis-timeline .vis-item.vis-range {
height: 0.6em;
}
.vis.timeline .red {
.vis-timeline .red {
background-color: #F2DEDE;
border-color: #F2AEAE;
}
.vis.timeline .green {
.vis-timeline .green {
background-color: #DFF0DB;
border-color: #B8F0AA;
}
.vis.timeline .blue {
.vis-timeline .blue {
background-color: #E3E9FC;
border-color: #B0C3FC;
}
.vis.timeline .orange {
.vis-timeline .orange {
background-color: #FFA500;
border-color: #B0C3FC;
}
Expand Down
158 changes: 80 additions & 78 deletions core/trino-web-ui/src/main/resources/webapp/assets/js/timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,88 +12,90 @@
* limitations under the License.
*/

d3.json('/ui/api/query/' + window.location.search.substring(1), function (query) {
d3.select('#queryId').text(query.queryId);
renderTimeline(query);
});
$(document).ready(function () {
$.ajax({url: '/ui/api/query/' + window.location.search.substring(1)})
.done(function(data) {
$('#queryId').text(data.queryId);
renderTimeline(data);

function renderTimeline(data) {
function getTasks(stage) {
return [].concat.apply(
stage.tasks,
stage.subStages.map(getTasks));
}
tasks = getTasks(data.outputStage);
tasks = tasks.map(function(task) {
return {
taskId: task.taskStatus.taskId.substring(task.taskStatus.taskId.indexOf('.') + 1),
time: {
create: task.stats.createTime,
firstStart: task.stats.firstStartTime,
lastStart: task.stats.lastStartTime,
lastEnd: task.stats.lastEndTime,
end: task.stats.endTime,
},
};
});
});

var groups = new vis.DataSet();
var items = new vis.DataSet();
for (var i = 0; i < tasks.length; i++) {
var task = tasks[i];
var stageId = task.taskId.substr(0, task.taskId.indexOf("."));
var taskNumber = task.taskId.substr(task.taskId.indexOf(".") + 1);
if (taskNumber == 0) {
groups.add({
id: stageId,
content: stageId,
sort: stageId,
subgroupOrder: 'sort',
});
function renderTimeline(data) {
function getTasks(stage) {
return [].concat.apply(
stage.tasks,
stage.subStages.map(getTasks));
}
items.add({
group: stageId,
start: task.time.create,
end: task.time.firstStart,
className: 'red',
subgroup: taskNumber,
sort: -taskNumber,
});
items.add({
group: stageId,
start: task.time.firstStart,
end: task.time.lastStart,
className: 'green',
subgroup: taskNumber,
sort: -taskNumber,
});
items.add({
group: stageId,
start: task.time.lastStart,
end: task.time.lastEnd,
className: 'blue',
subgroup: taskNumber,
sort: -taskNumber,
});
items.add({
group: stageId,
start: task.time.lastEnd,
end: task.time.end,
className: 'orange',
subgroup: taskNumber,
sort: -taskNumber,

tasks = getTasks(data.outputStage);
tasks = tasks.map(function (task) {
return {
taskId: task.taskStatus.taskId.substring(task.taskStatus.taskId.indexOf('.') + 1),
time: {
create: task.stats.createTime,
firstStart: task.stats.firstStartTime,
lastStart: task.stats.lastStartTime,
lastEnd: task.stats.lastEndTime,
end: task.stats.endTime,
},
};
});
}

var options = {
stack: false,
groupOrder: 'sort',
padding: 0,
margin: 0,
clickToUse: true,
};
var groups = new vis.DataSet();
var items = new vis.DataSet();
for (var i = 0; i < tasks.length; i++) {
var task = tasks[i];
var stageId = task.taskId.substr(0, task.taskId.indexOf("."));
var taskNumber = task.taskId.substr(task.taskId.indexOf(".") + 1);
if (taskNumber == 0) {
groups.add({
id: stageId,
content: stageId,
sort: stageId,
subgroupOrder: 'sort',
});
}
items.add({
group: stageId,
start: task.time.create,
end: task.time.firstStart,
className: 'red',
subgroup: taskNumber,
sort: -taskNumber,
});
items.add({
group: stageId,
start: task.time.firstStart,
end: task.time.lastStart,
className: 'green',
subgroup: taskNumber,
sort: -taskNumber,
});
items.add({
group: stageId,
start: task.time.lastStart,
end: task.time.lastEnd,
className: 'blue',
subgroup: taskNumber,
sort: -taskNumber,
});
items.add({
group: stageId,
start: task.time.lastEnd,
end: task.time.end,
className: 'orange',
subgroup: taskNumber,
sort: -taskNumber,
});
}

var container = document.getElementById('timeline');
var options = {
stack: false,
groupOrder: 'sort',
margin: 0,
clickToUse: true,
};

var timeline = new vis.Timeline(container, items, groups, options);
}
new vis.Timeline(document.getElementById('timeline'), items, groups, options);
}
});
8 changes: 1 addition & 7 deletions core/trino-web-ui/src/main/resources/webapp/disabled.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,8 @@
<!-- Bootstrap core -->
<link href="vendor/bootstrap/css/bootstrap.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->

<!-- jQuery -->
<script type="text/javascript" src="vendor/jquery/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="vendor/jquery/jquery-3.7.1.min.js"></script>

<!-- Bootstrap JS -->
<script type="text/javascript" src="vendor/bootstrap/js/bootstrap.js"></script>
Expand Down
11 changes: 2 additions & 9 deletions core/trino-web-ui/src/main/resources/webapp/embedded_plan.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,8 @@
<!-- Bootstrap core -->
<link href="vendor/bootstrap/css/bootstrap.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->

<!-- jQuery -->
<script type="text/javascript" src="vendor/jquery/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="vendor/jquery/jquery-3.7.1.min.js"></script>

<!-- Bootstrap JS -->
<script type="text/javascript" src="vendor/bootstrap/js/bootstrap.js"></script>
Expand All @@ -28,8 +22,7 @@
<script type="text/javascript" src="vendor/jquery.sparkline/jquery.sparkline.min.js"></script>

<!-- Code highlighting -->
<link rel="stylesheet" href="vendor/highlightjs/9.3/styles/solarized-dark.css">
<script src="vendor/highlightjs/9.3/highlight.pack.js"></script>
<link rel="stylesheet" href="vendor/highlightjs/styles/stackoverflow-dark.css">

<!-- CSS loader -->
<link href="vendor/css-loaders/loader.css" rel="stylesheet">
Expand Down
9 changes: 3 additions & 6 deletions core/trino-web-ui/src/main/resources/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@
<!-- Bootstrap core -->
<link href="vendor/bootstrap/css/bootstrap.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- Code highlighting -->
<link href="vendor/highlightjs/styles/stackoverflow-dark.css" rel="stylesheet">

<!-- jQuery -->
<script type="text/javascript" src="vendor/jquery/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="vendor/jquery/jquery-3.7.1.min.js"></script>

<!-- Bootstrap JS -->
<script type="text/javascript" src="vendor/bootstrap/js/bootstrap.js"></script>
Expand Down
8 changes: 1 addition & 7 deletions core/trino-web-ui/src/main/resources/webapp/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,8 @@
<!-- Bootstrap core -->
<link href="vendor/bootstrap/css/bootstrap.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->

<!-- jQuery -->
<script type="text/javascript" src="vendor/jquery/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="vendor/jquery/jquery-3.7.1.min.js"></script>

<!-- Bootstrap JS -->
<script type="text/javascript" src="vendor/bootstrap/js/bootstrap.js"></script>
Expand Down
11 changes: 2 additions & 9 deletions core/trino-web-ui/src/main/resources/webapp/plan.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,8 @@
<!-- Bootstrap core -->
<link href="vendor/bootstrap/css/bootstrap.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->

<!-- jQuery -->
<script type="text/javascript" src="vendor/jquery/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="vendor/jquery/jquery-3.7.1.min.js"></script>

<!-- Bootstrap JS -->
<script type="text/javascript" src="vendor/bootstrap/js/bootstrap.js"></script>
Expand All @@ -28,8 +22,7 @@
<script type="text/javascript" src="vendor/jquery.sparkline/jquery.sparkline.min.js"></script>

<!-- Code highlighting -->
<link rel="stylesheet" href="vendor/highlightjs/9.3/styles/solarized-dark.css">
<script src="vendor/highlightjs/9.3/highlight.pack.js"></script>
<link rel="stylesheet" href="vendor/highlightjs/styles/stackoverflow-dark.css">

<!-- Clipboard -->
<script src="vendor/clipboardjs/clipboard.min.js"></script>
Expand Down
11 changes: 2 additions & 9 deletions core/trino-web-ui/src/main/resources/webapp/query.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,8 @@
<!-- Bootstrap core -->
<link href="vendor/bootstrap/css/bootstrap.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->

<!-- jQuery -->
<script type="text/javascript" src="vendor/jquery/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="vendor/jquery/jquery-3.7.1.min.js"></script>

<!-- Bootstrap JS -->
<script type="text/javascript" src="vendor/bootstrap/js/bootstrap.js"></script>
Expand All @@ -28,8 +22,7 @@
<script type="text/javascript" src="vendor/jquery.sparkline/jquery.sparkline.min.js"></script>

<!-- Code highlighting -->
<link rel="stylesheet" href="vendor/highlightjs/9.3/styles/solarized-dark.css">
<script src="vendor/highlightjs/9.3/highlight.pack.js"></script>
<link rel="stylesheet" href="vendor/highlightjs/styles/stackoverflow-dark.css">

<!-- Clipboard -->
<script src="vendor/clipboardjs/clipboard.min.js"></script>
Expand Down
6 changes: 1 addition & 5 deletions core/trino-web-ui/src/main/resources/webapp/references.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,14 @@
<link href="vendor/bootstrap/css/bootstrap.css" rel="stylesheet">

<!-- jQuery -->
<script type="text/javascript" src="vendor/jquery/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="vendor/jquery/jquery-3.7.1.min.js"></script>

<!-- Bootstrap JS -->
<script type="text/javascript" src="vendor/bootstrap/js/bootstrap.js"></script>

<!-- Sparkline -->
<script type="text/javascript" src="vendor/jquery.sparkline/jquery.sparkline.min.js"></script>

<!-- Code highlighting -->
<link rel="stylesheet" href="vendor/highlightjs/9.3/styles/solarized-dark.css">
<script src="vendor/highlightjs/9.3/highlight.pack.js"></script>

<!-- Clipboard -->
<script src="vendor/clipboardjs/clipboard.min.js"></script>

Expand Down
Loading
Loading