Skip to content

Commit

Permalink
Add a lot of QOL in web UI
Browse files Browse the repository at this point in the history
  • Loading branch information
TheophileDiot committed Oct 25, 2024
1 parent a01b0a2 commit 6d342ab
Show file tree
Hide file tree
Showing 19 changed files with 261 additions and 67 deletions.
34 changes: 34 additions & 0 deletions src/ui/app/static/css/overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,17 @@ button.list-group-item-secondary.active {
) !important; /* Keep the primary color on hover */
}

.btn-pro-now {
background-color: var(--bs-bw-green); /* Initial background color */
color: #fff;
}

.btn-pro-now:hover {
background-color: var(
--bs-bw-green
) !important; /* Keep the primary color on hover */
}

.avatar.avatar-offline:after {
background-color: var(--bs-secondary);
}
Expand Down Expand Up @@ -858,3 +869,26 @@ a.courier-prime:hover {
.text-maroon {
color: #800000;
}

.blur-overlay {
position: relative;
}

.blur-overlay .card-body,
.blur-overlay .card-header {
filter: blur(3px);
pointer-events: none;
}

.blur-overlay .blur-message {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: var(--bs-bw-green);
color: #fff;
padding: 20px;
border-radius: 8px;
text-align: center;
font-weight: bold;
}
9 changes: 9 additions & 0 deletions src/ui/app/static/img/brands/Twitter-X-Logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 8 additions & 14 deletions src/ui/app/static/img/flags/zz.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 19 additions & 2 deletions src/ui/app/static/js/pages/bans.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,15 @@ $(document).ready(function () {

bans_table.searchPanes.container().hide();

$(".action-button")
.parent()
.attr(
"data-bs-original-title",
"Please select one or more rows to perform an action.",
)
.attr("data-bs-placement", "top")
.tooltip();

$("#bans").removeClass("d-none");
$("#bans-waiting").addClass("visually-hidden");

Expand Down Expand Up @@ -504,13 +513,21 @@ $(document).ready(function () {

bans_table.on("select", function (e, dt, type, indexes) {
// Enable the actions button
$(".action-button").removeClass("disabled");
$(".action-button").removeClass("disabled").parent().tooltip("dispose");
});

bans_table.on("deselect", function (e, dt, type, indexes) {
// If no rows are selected, disable the actions button
if (bans_table.rows({ selected: true }).count() === 0) {
$(".action-button").addClass("disabled");
$(".action-button")
.addClass("disabled")
.parent()
.attr(
"data-bs-original-title",
"Please select one or more rows to perform an action.",
)
.attr("data-bs-placement", "top")
.tooltip();
$("#select-all-rows").prop("checked", false);
}
});
Expand Down
10 changes: 9 additions & 1 deletion src/ui/app/static/js/pages/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,15 @@ $(document).ready(function () {
];

$.fn.dataTable.ext.buttons.toggle_filters = {
text: '<span class="tf-icons bx bx-filter bx-18px me-2"></span><span id="show-filters">Show</span><span id="hide-filters" class="d-none">Hide</span><span class="d-none d-md-inline"> filters</span>',
text: `<span class="tf-icons bx bx-filter bx-18px me-2"></span><span id="show-filters"${
cacheJobNameSelection || cachePluginSelection || cacheServiceSelection
? ' class="d-none"'
: ""
}>Show</span><span id="hide-filters"${
!cacheJobNameSelection && !cachePluginSelection && !cacheServiceSelection
? ' class="d-none"'
: ""
}>Hide</span><span class="d-none d-md-inline"> filters</span>`,
action: function (e, dt, node, config) {
cache_table.searchPanes.container().slideToggle(); // Smoothly hide or show the container
$("#show-filters").toggleClass("d-none"); // Toggle the visibility of the 'Show' span
Expand Down
27 changes: 24 additions & 3 deletions src/ui/app/static/js/pages/configs.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,11 @@ $(document).ready(function () {
};

$.fn.dataTable.ext.buttons.toggle_filters = {
text: '<span class="tf-icons bx bx-filter bx-18px me-2"></span><span id="show-filters">Show</span><span id="hide-filters" class="d-none">Hide</span><span class="d-none d-md-inline"> filters</span>',
text: `<span class="tf-icons bx bx-filter bx-18px me-2"></span><span id="show-filters"${
configTypeSelection || configServiceSelection ? ' class="d-none"' : ""
}>Show</span><span id="hide-filters"${
!configTypeSelection && !configServiceSelection ? ' class="d-none"' : ""
}>Hide</span><span class="d-none d-md-inline"> filters</span>`,
action: function (e, dt, node, config) {
configs_table.searchPanes.container().slideToggle(); // Smoothly hide or show the container
$("#show-filters").toggleClass("d-none"); // Toggle the visibility of the 'Show' span
Expand Down Expand Up @@ -462,6 +466,15 @@ $(document).ready(function () {
if (!configTypeSelection && !configServiceSelection)
configs_table.searchPanes.container().hide();

$(".action-button")
.parent()
.attr(
"data-bs-original-title",
"Please select one or more rows to perform an action.",
)
.attr("data-bs-placement", "top")
.tooltip();

$("#configs").removeClass("d-none");
$("#configs-waiting").addClass("visually-hidden");

Expand Down Expand Up @@ -492,13 +505,21 @@ $(document).ready(function () {

configs_table.on("select", function (e, dt, type, indexes) {
// Enable the actions button
$(".action-button").removeClass("disabled");
$(".action-button").removeClass("disabled").parent().tooltip("dispose");
});

configs_table.on("deselect", function (e, dt, type, indexes) {
// If no rows are selected, disable the actions button
if (configs_table.rows({ selected: true }).count() === 0) {
$(".action-button").addClass("disabled");
$(".action-button")
.addClass("disabled")
.parent()
.attr(
"data-bs-original-title",
"Please select one or more rows to perform an action.",
)
.attr("data-bs-placement", "top")
.tooltip();
$("#select-all-rows").prop("checked", false);
}
});
Expand Down
21 changes: 19 additions & 2 deletions src/ui/app/static/js/pages/instances.js
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,15 @@ $(document).ready(function () {

instances_table.searchPanes.container().hide();

$(".action-button")
.parent()
.attr(
"data-bs-original-title",
"Please select one or more rows to perform an action.",
)
.attr("data-bs-placement", "top")
.tooltip();

$("#instances").removeClass("d-none");
$("#instances-waiting").addClass("visually-hidden");

Expand Down Expand Up @@ -612,13 +621,21 @@ $(document).ready(function () {

instances_table.on("select", function (e, dt, type, indexes) {
// Enable the actions button
$(".action-button").removeClass("disabled");
$(".action-button").removeClass("disabled").parent().tooltip("dispose");
});

instances_table.on("deselect", function (e, dt, type, indexes) {
// If no rows are selected, disable the actions button
if (instances_table.rows({ selected: true }).count() === 0) {
$(".action-button").addClass("disabled");
$(".action-button")
.addClass("disabled")
.parent()
.attr(
"data-bs-original-title",
"Please select one or more rows to perform an action.",
)
.attr("data-bs-placement", "top")
.tooltip();
$("#select-all-rows").prop("checked", false);
}
});
Expand Down
21 changes: 19 additions & 2 deletions src/ui/app/static/js/pages/jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,15 @@ $(document).ready(function () {

jobs_table.searchPanes.container().hide();

$(".action-button")
.parent()
.attr(
"data-bs-original-title",
"Please select one or more rows to perform an action.",
)
.attr("data-bs-placement", "top")
.tooltip();

$("#jobs").removeClass("d-none");
$("#jobs-waiting").addClass("visually-hidden");

Expand Down Expand Up @@ -370,13 +379,21 @@ $(document).ready(function () {

jobs_table.on("select", function (e, dt, type, indexes) {
// Enable the actions button
$(".action-button").removeClass("disabled");
$(".action-button").removeClass("disabled").parent().tooltip("dispose");
});

jobs_table.on("deselect", function (e, dt, type, indexes) {
// If no rows are selected, disable the actions button
if (jobs_table.rows({ selected: true }).count() === 0) {
$(".action-button").addClass("disabled");
$(".action-button")
.addClass("disabled")
.parent()
.attr(
"data-bs-original-title",
"Please select one or more rows to perform an action.",
)
.attr("data-bs-placement", "top")
.tooltip();
$("#select-all-rows").prop("checked", false);
}
});
Expand Down
21 changes: 19 additions & 2 deletions src/ui/app/static/js/pages/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,15 @@ $(document).ready(function () {

plugins_table.searchPanes.container().hide();

$(".action-button")
.parent()
.attr(
"data-bs-original-title",
"Please select one or more rows to perform an action.",
)
.attr("data-bs-placement", "top")
.tooltip();

$("#plugins").removeClass("d-none");
$("#plugins-waiting").addClass("visually-hidden");

Expand Down Expand Up @@ -488,13 +497,21 @@ $(document).ready(function () {

plugins_table.on("select", function (e, dt, type, indexes) {
// Enable the actions button
$(".action-button").removeClass("disabled");
$(".action-button").removeClass("disabled").parent().tooltip("dispose");
});

plugins_table.on("deselect", function (e, dt, type, indexes) {
// If no rows are selected, disable the actions button
if (plugins_table.rows({ selected: true }).count() === 0) {
$(".action-button").addClass("disabled");
$(".action-button")
.addClass("disabled")
.parent()
.attr(
"data-bs-original-title",
"Please select one or more rows to perform an action.",
)
.attr("data-bs-placement", "top")
.tooltip();
$("#select-all-rows").prop("checked", false);
}
});
Expand Down
21 changes: 19 additions & 2 deletions src/ui/app/static/js/pages/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,15 @@ $(function () {

services_table.searchPanes.container().hide();

$(".action-button")
.parent()
.attr(
"data-bs-original-title",
"Please select one or more rows to perform an action.",
)
.attr("data-bs-placement", "top")
.tooltip();

$("#services").removeClass("d-none");
$("#services-waiting").addClass("visually-hidden");

Expand Down Expand Up @@ -478,13 +487,21 @@ $(function () {

services_table.on("select", function (e, dt, type, indexes) {
// Enable the actions button
$(".action-button").removeClass("disabled");
$(".action-button").removeClass("disabled").parent().tooltip("dispose");
});

services_table.on("deselect", function (e, dt, type, indexes) {
// If no rows are selected, disable the actions button
if (services_table.rows({ selected: true }).count() === 0) {
$(".action-button").addClass("disabled");
$(".action-button")
.addClass("disabled")
.parent()
.attr(
"data-bs-original-title",
"Please select one or more rows to perform an action.",
)
.attr("data-bs-placement", "top")
.tooltip();
$("#select-all-rows").prop("checked", false);
}
});
Expand Down
10 changes: 8 additions & 2 deletions src/ui/app/templates/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,10 @@ <h5 class="card-title don-jose">Socials</h5>
class="btn btn-sm btn-link"
target="_blank"
rel="noreferrer">
<i class='bx bxl-twitter bx-sm'></i>
<img src="{{ url_for('static', filename='img/brands/Twitter-X-Logo.svg') }}"
alt="X logo"
width="20px"
height="20px">
</a>
</div>
</div>
Expand Down Expand Up @@ -243,7 +246,10 @@ <h5 class="card-title don-jose">Socials</h5>
class="btn btn-sm btn-link"
target="_blank"
rel="noreferrer">
<i class='bx bxl-twitter bx-sm'></i>
<img src="{{ url_for('static', filename='img/brands/Twitter-X-Logo.svg') }}"
alt="X logo"
width="20px"
height="20px">
</a>
</div>
</div>
Expand Down
Loading

0 comments on commit 6d342ab

Please sign in to comment.