Skip to content

Commit

Permalink
Add button for listing host CPUs
Browse files Browse the repository at this point in the history
  • Loading branch information
Achref Hawech committed Jul 6, 2022
1 parent 75e46bd commit 4537a3c
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/css/components/icons.less
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@
background-size: contain;
}

&.cpu {
background-image: url("img/icons/icon-mini-cpu.svg");
background-size: contain;
filter: invert(100%);
}

&.icon-xs {
font-size: floor(@icon-xs-height*@icon-xs-scale);
line-height: floor(@icon-xs-height*@icon-xs-scale);
Expand Down
3 changes: 3 additions & 0 deletions src/js/components/TaskListComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ var TaskListComponent = React.createClass({
<th className="text-center">
Traffic dump
</th>
<th className="text-center">
Host CPUs
</th>
<th className="text-center">
Debug
</th>
Expand Down
10 changes: 10 additions & 0 deletions src/js/components/TaskListItemComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,13 @@ var TaskListItemComponent = React.createClass({
</a>);
},

getHostCpuListLink: function () {
const Link = Config.hostCpuListLinkGenerator();
return (<a href={Link} target="_blank">
<div className="icon icon-small cpu"></div>
</a>);
},

getDebugLink: function () {
const debugLink = Config.debugLinkGenerator(this.props.task.id);
return (<a href={debugLink} target="_blank">
Expand Down Expand Up @@ -349,6 +356,9 @@ var TaskListItemComponent = React.createClass({
<td className="text-center">
{this.getTrafficDumpTaskLink()}
</td>
<td className="text-center">
{this.getHostCpuListLink()}
</td>
<td className="text-center">
{this.getDebugLink()}
</td>
Expand Down
7 changes: 7 additions & 0 deletions src/js/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ var config = Object.assign({
return "";
},

// The generator building the traffic dump link for tasks
// input: appId, taskId
// output: the link to the logs
hostCpuListLinkGenerator: function () {
return "";
},

// Size of page size on task list
taskPageSize: 8,
// The generator build the exec links for tasks debugging
Expand Down
5 changes: 5 additions & 0 deletions src/js/config/runtimeConfig.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ var runtimeConfig = {
return "http://some-traffic-dump-tool/" + task.host;
},

// The generator building the traffic dump link for tasks
hostCpuListLinkGenerator: function () {
return "http://mesos-agent-watcher/cpus";
},

// The generator building the web terminal link for debugging tasks
debugLinkGenerator: function (taskId) {
return "http://webterminal/?taskId=" + taskId;
Expand Down

0 comments on commit 4537a3c

Please sign in to comment.