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

servershell: Add column helper buttons #380

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
9 changes: 9 additions & 0 deletions serveradmin/servershell/static/css/fontawesome.min.css

Large diffs are not rendered by default.

20 changes: 19 additions & 1 deletion serveradmin/servershell/static/js/servershell/result.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,25 @@ servershell.update_result = function() {
header.empty();
header.append('<th scope="col"></th>');
header.append('<th scope="col">#</th>');
servershell.shown_attributes.forEach((attribute, index) => header.append($('<th scope="col">').text(attribute)));
servershell.shown_attributes.forEach((attribute, index) => header.append(
$('<th scope="col">').append(
$('<span>').text(attribute),
$(`<a href="#" class="attr-tooltip" title="Order by ${attribute} attribute">`).append(
$('<i class="fa-solid fa-arrow-down-a-z">')
).click(function(e) {
e.preventDefault();
servershell.commands.orderby(attribute);
}),
$(`<a href="#" class="attr-tooltip" title="Remove ${attribute} column">`).append(
$('<i class="fa-solid fa-xmark">')
).click(function(e) {
e.preventDefault();
servershell.commands.attr(attribute);
}),
// Add 1 space after minus icon to visually separate the columns
$('<span>').html('&nbsp;')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is preferably done via CSS (margin right).

)
));

// Recreate table body
let body = table.find('tbody');
Expand Down
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the webfonts directory to the setup.py so it is included in the package:

Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions serveradmin/servershell/templates/servershell/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<link rel="stylesheet" href="{{ STATIC_URL }}css/states.css">
<link rel="stylesheet" href="{{ STATIC_URL }}css/servershell.css">
<link rel="stylesheet" href="{{ STATIC_URL }}css/jquery-ui.min.css">
<link rel="stylesheet" href="{{ STATIC_URL }}css/fontawesome.min.css">
{% endblock %}

{% block content %}
Expand Down
Loading