handle word-breaks and overflow on misc elements

This commit is contained in:
Jordan Blasenhauer 2024-05-06 10:47:06 +02:00
parent 206107f156
commit af692012de
15 changed files with 138 additions and 43 deletions

View file

@ -18,8 +18,8 @@
- [UI] Global config : fix script error while fragment relate to a missing plugin
- [UI] Global config / services page : filtering settings now open plugin select to highlight remaining plugin
- [UI] Global config / services page : add combobox on plugin select open to search a plugin quick
- [UI] Global config / services page : add combobox on plugin select open to search a plugin quick
- [UI] Global config / services page : add order for settings to always respect the order defined in the plugin
- [UI] Services page : show any invalid setting value on setting modal and disabled save if case
- [UI] Reporting page : fix missing data and add new ones
- [UI] Account page : keep license key form even if pro register to easy update
- [UI] Wizard : Add the possibility to still configure reverse proxy even if an admin user already exists

View file

@ -685,4 +685,3 @@ Allow access based on internal and external IP/network/rDNS/ASN whitelists.
|`WHITELIST_ASN_URLS` | |global |no |List of URLs, separated with spaces, containing ASN to whitelist. |
|`WHITELIST_USER_AGENT_URLS`| |global |no |List of URLs, separated with spaces, containing good User-Agent to whitelist. |
|`WHITELIST_URI_URLS` | |global |no |List of URLs, separated with spaces, containing bad URI to whitelist. |

File diff suppressed because one or more lines are too long

View file

@ -223,7 +223,10 @@ class ServiceModal {
const [action, serviceName, oldServName, isDraft, method] =
this.getActionData(target);
this.currAction = action;
this.modalTitle.textContent = `${action} ${serviceName}`;
// truncate serviceName if more than 15 characters
const servName =
serviceName.length > 15 ? `${serviceName.slice(0, 15)}...` : serviceName;
this.modalTitle.textContent = `${action} ${servName}`;
// show / hide components
this.hideForms();

View file

@ -155,7 +155,11 @@
}
.settings-tabs-select-btn-text {
@apply transition duration-300 ease-in-out dark:text-gray-400 text-primary;
@apply transition break-all duration-300 ease-in-out dark:text-gray-400 text-primary;
}
.settings-tabs-select-btn-svg {
@apply ml-4 min-w-fit transition-transform h-4 w-4 fill-primary dark:fill-gray-300;
}
.active.settings-tabs-select-dropdown-btn {
@ -171,7 +175,7 @@
}
.settings-tabs-select-dropdown-btn {
@apply flex justify-between border-b border-l border-r border-gray-300 dark:hover:brightness-90 hover:brightness-90 bg-white text-gray-700 my-0 relative px-6 py-2 text-center align-middle transition-all rounded-none cursor-pointer leading-normal text-sm ease-in tracking-tight-rem dark:border-slate-600 dark:bg-slate-700 dark:text-gray-200;
@apply break-all flex justify-between border-b border-l border-r border-gray-300 dark:hover:brightness-90 hover:brightness-90 bg-white text-gray-700 my-0 relative px-6 py-2 text-left align-middle transition-all rounded-none cursor-pointer leading-normal text-sm ease-in tracking-tight-rem dark:border-slate-600 dark:bg-slate-700 dark:text-gray-200;
}
/*---------------------------------------------*/
@ -183,7 +187,7 @@
/*---------------------------------------------*/
.home-card {
@apply dark:brightness-110 sm:max-h-28 hover:scale-102 transition col-span-12 md:col-span-6 2xl:col-span-4 flex p-4 justify-between w-full shadow-md break-words bg-white dark:bg-slate-850 dark:shadow-dark-xl rounded-2xl bg-clip-border;
@apply break-all break-words dark:brightness-110 sm:max-h-28 hover:scale-102 transition col-span-12 md:col-span-6 2xl:col-span-4 flex p-4 justify-between w-full shadow-md break-words bg-white dark:bg-slate-850 dark:shadow-dark-xl rounded-2xl bg-clip-border;
}
.home-card-name {
@ -215,7 +219,7 @@
}
.home-card-svg-container {
@apply dark:brightness-90 inline-block w-12 h-12 text-center rounded-circle;
@apply min-w-12 dark:brightness-90 inline-block w-12 h-12 text-center rounded-circle;
}
.version.home-card-svg-container {
@ -255,11 +259,11 @@
}
.card-detail-item-title {
@apply transition duration-300 ease-in-out font-bold mb-0 font-sans text-sm leading-normal uppercase dark:text-gray-500;
@apply min-w-fit transition duration-300 ease-in-out font-bold mb-0 font-sans text-sm leading-normal uppercase dark:text-gray-500;
}
.card-detail-item-subtitle {
@apply break-all transition duration-300 ease-in-out pl-2 col-span-1 mb-0 font-sans text-sm font-semibold leading-normal uppercase dark:text-gray-100;
@apply min-w-[2rem] break-all transition duration-300 ease-in-out pl-2 col-span-1 mb-0 font-sans text-sm font-semibold leading-normal uppercase dark:text-gray-100;
}
/*---------------------------------------------*/
@ -387,7 +391,7 @@
}
.core-card-list-title {
@apply mb-4 mt-2 font-bold dark:text-white/90 mx-2;
@apply mb-4 font-bold dark:text-white/90;
}
.core-card-list-container {
@ -585,3 +589,87 @@
.file-manager-actions-item-btn {
@apply rounded dark:text-gray-200 text-primary whitespace-nowrap md:block border-primary dark:hover:bg-slate-800 dark:border-slate-600 dark:bg-slate-700 border m-1 relative pl-4 pr-5 pb-2.5 pt-3 font-bold text-center uppercase align-middle transition-all cursor-pointer bg-white hover:bg-gray-100 leading-normal text-sm ease-in tracking-tight-rem shadow-xs hover:shadow-md disabled:cursor-not-allowed dark:disabled:text-gray-300 disabled:text-gray-700 disabled:bg-gray-400 disabled:border-gray-400/0 dark:disabled:bg-gray-700 dark:disabled:border-gray-700/0 disabled:hover:translate-y-0 disabled:hover:bg-gray-400 disabled:hover:border-gray-400/0 dark:disabled:hover:translate-y-0 dark:disabled:hover:bg-gray-700 dark:disabled:hover:border-gray-700/0;
}
/*----------------------------------------------*/
/*---------------PLUGINS PAGE-------------------*/
/*----------------------------------------------*/
.plugins-list-container {
@apply overflow-auto w-full col-span-12 p-4 relative break-words bg-white shadow-xl dark:bg-slate-850 dark:shadow-dark-xl rounded-2xl bg-clip-border;
}
.plugins-list-container-title-container {
@apply col-span-12;
}
.plugins-list-container-title {
@apply mx-2 font-bold dark:text-white/90 mx-2;
}
.plugins-list-items-container {
@apply min-h-[55vh] max-h-80 overflow-auto p-2 col-span-12 relative;
}
.plugins-list-items-wrap {
@apply grid grid-cols-12 gap-3;
}
.plugins-list-items {
@apply py-3 min-h-12 relative col-span-12 sm:col-span-6 2xl:col-span-4 3xl:col-span-3 p-1 flex justify-between items-center transition rounded;
}
.enabled.plugins-list-items {
@apply bg-gray-100 hover:bg-gray-300 dark:bg-slate-700 dark:hover:bg-slate-800;
}
.disabled.plugins-list-items {
@apply cursor-not-allowed bg-gray-300 dark:bg-gray-800;
}
.plugins-list-items-name {
@apply ml-3 mr-2 break-all break-words mb-0 transition duration-300 ease-in-out text-left text-sm md:text-base text-slate-700 dark:text-gray-200;
}
.disabled.plugins-list-items-name {
@apply opacity-80 dark:opacity-60;
}
.plugins-list-items-actions {
@apply flex items-center;
}
.plugins-list-items-delete {
@apply z-20 mx-2 inline-block font-bold text-left text-white uppercase align-middle transition-all cursor-pointer text-xs ease-in tracking-tight-rem hover:-translate-y-px;
}
.plugins-list-items-delete-svg {
@apply h-5 w-5 fill-red-500 dark:brightness-90;
}
.plugins-list-items-link {
@apply hover:-translate-y-px mx-1;
}
.plugins-list-items-link-svg {
@apply h-6 w-6 fill-sky-500 dark dark:brightness-90;
}
.plugins-list-items-pro {
@apply hover:-translate-y-px mx-1 -translate-y-0.5;
}
.plugins-list-items-pro-svg {
@apply h-6 w-6 dark:brightness-90;
}
/*----------------------------------------------*/
/*---------------END PLUGINS PAGE---------------*/
/*----------------------------------------------*/
/*----------------------------------------------*/
/*---------------SERVICES PAGE------------------*/
/*----------------------------------------------*/
/*----------------------------------------------*/
/*---------------END SERVICES PAGE--------------*/
/*----------------------------------------------*/

View file

@ -74,6 +74,7 @@
"values": terms
}
] %}
{% set is_filter_hidden = True if bans|length == 0 else False %}
{% include "card_filter.html" %}
{% include "filter_nomatch.html" %}

View file

@ -1,5 +1,5 @@
{% set grid_cols = 'col-span-12 md:col-span-8 2xl:col-span-6 3xl:col-span-5' if attribute_name == 'bans'
else 'md:col-span-8 lg:col-span-5 2xl:col-span-4 3xl:col-span-3' if attribute_name == 'configs'
else 'md:col-span-8 lg:col-span-6 3xl:col-span-4' if attribute_name == 'configs'
else 'col-span-12 md:col-span-6 3xl:col-span-4' if attribute_name == 'global-config'
else 'col-span-12 md:col-span-8 2xl:col-span-6 3xl:col-span-5' if attribute_name == 'jobs'
else 'col-span-12 md:col-span-6 2xl:col-span-4' if attribute_name == 'plugins'
@ -8,8 +8,9 @@
else 'col-span-12 md:col-span-8 2xl:col-span-6 3xl:col-span-4'
%}
<div data-{{attribute_name}}-filter
class="h-fit {{grid_cols}} p-4 relative flex flex-col min-w-0 break-words bg-white shadow-xl dark:bg-slate-850 dark:shadow-dark-xl rounded-2xl bg-clip-border">
class="{% if is_filter_hidden %} hidden {%endif%} h-fit {{grid_cols}} p-4 relative flex flex-col min-w-0 break-words bg-white shadow-xl dark:bg-slate-850 dark:shadow-dark-xl rounded-2xl bg-clip-border">
<h5 class="mb-2 font-bold dark:text-white/90">FILTER</h5>
<div class="mx-2 grid grid-cols-12 gap-4">
{% for filter in filters %}

View file

@ -17,7 +17,7 @@
{% if card['link'].startswith('http') %}target="_blank"{% endif %}
rel="noopener">
<!-- text -->
<div>
<div class="mr-1">
<p class="home-card-name">{{ card['name'] }}</p>
<!-- version of user -->
<h5 class="home-card-title">{{ card['title'] }}</h5>

View file

@ -117,7 +117,7 @@
class="items-center grid grid-cols-12 border-b border-gray-300 py-2.5">
{% for data in jobs_data %}
{% if data['type'] == "text" %}
<p class="{{ data['custom_class'] }} dark:text-gray-400 text-sm m-0 my-1" data-{{attribute_name}}-{{ data['filter_name'] }}="{{ data['value'] }}">
<p class="{{ data['custom_class'] }} dark:text-gray-400 text-sm m-0 my-1 mr-2" data-{{attribute_name}}-{{ data['filter_name'] }}="{{ data['value'] }}">
{{ data['value'] }}
</p>
{% endif %}
@ -168,7 +168,7 @@
value="files"
class="{% if loop.index == loop.length %}rounded-b-lg {% endif %}{% if loop.first %}rounded-t-lg{% endif %} border-b border-l border-r border-gray-300 dark:hover:brightness-90 hover:brightness-90 my-0 relative py-2 px-3 text-left align-middle transition-all rounded-none cursor-pointer leading-normal text-sm ease-in tracking-tight-rem dark:border-slate-600 dark:text-gray-300 bg-white dark:bg-slate-700 text-gray-700">
<span class="flex justify-start items-center">
<svg class="h-5.5 w-5.5 stroke-sky-500"
<svg class="min-w-fit h-5.5 w-5.5 stroke-sky-500"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
@ -176,7 +176,7 @@
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75l3 3m0 0l3-3m-3 3v-7.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
<span class="transition duration-300 ease-in-out text-gray-700 dark:text-gray-300 ml-2">{{ file['file_name'] }}</span>
<span class="overflow-hidden break-word transition duration-300 ease-in-out text-gray-700 dark:text-gray-300 ml-2">{{ file['file_name'] }}</span>
</span>
</button>
{% endfor %}

View file

@ -16,6 +16,7 @@
class="disabled:opacity-75 dark:disabled:text-gray-300 disabled:text-gray-700 disabled:bg-gray-400 disabled:border-gray-400 dark:disabled:bg-gray-800 dark:disabled:border-gray-800 duration-300 ease-in-out dark:opacity-90 dark:border-slate-600 dark:bg-slate-700 dark:text-gray-300 focus:border-green-500 flex justify-between align-middle items-center text-left text-sm leading-5.6 ease w-full rounded-lg border border-solid border-gray-300 bg-white bg-clip-padding px-1.5 py-1 md:px-3 font-normal text-gray-700 transition-all placeholder:text-gray-500">
<span id="logs-instance"
data-name="logs-instance"
class="overflow-hidden break-all"
data-{{attribute_name}}-setting-select-text="instances">
{% for instance in instances %}
{% if loop.first %}
@ -30,7 +31,7 @@
</span>
<!-- chevron -->
<svg data-{{attribute_name}}-setting-select="instances"
class="transition-transform h-4 w-4 fill-gray-500"
class="min-w-fit ml-2 transition-transform h-4 w-4 fill-gray-500"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 512 512">
<path d="M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z" />
@ -179,7 +180,7 @@
}
] %}
<div data-{{attribute_name}}-filter
class="h-fit col-span-12 md:col-span-6 lg:col-span-4 p-4 relative flex flex-col min-w-0 break-words bg-white shadow-xl dark:bg-slate-850 dark:shadow-dark-xl rounded-2xl bg-clip-border">
class="h-fit col-span-12 lg:col-span-4 p-4 relative flex flex-col min-w-0 break-words bg-white shadow-xl dark:bg-slate-850 dark:shadow-dark-xl rounded-2xl bg-clip-border">
<h5 class="mb-2 font-bold dark:text-white/90">FILTERS</h5>
<div class="mx-2 grid grid-cols-12 gap-x-4 gap-y-2">
{% for filter in filters %}

View file

@ -47,7 +47,7 @@
</div>
<div class="mt-2 w-full px-1">
<h1 class="mb-0.5 tracking-normal text-primary text-center text-lg break-words whitespace-normal dark:text-gray-300">
{{ username }}
{{ username|truncate(10, True, '...')}}
</h1>
<a class="block underline mb-2 text-gray-600 dark:text-gray-400 text-sm text-center hover:brightness-90"
href="{% if current_endpoint == 'account' %}#{% else %}{{ url_for("account") }}{% endif %}">manage account

View file

@ -75,26 +75,26 @@
{% include "card_filter.html" %}
{% include "filter_nomatch.html" %}
<div data-{{attribute_name}}-list-container class="overflow-auto w-full col-span-12 p-4 relative break-words bg-white shadow-xl dark:bg-slate-850 dark:shadow-dark-xl rounded-2xl bg-clip-border">
<div class="col-span-12">
<h5 class="mx-2 font-bold dark:text-white/90 mx-2">PLUGINS LIST</h5>
<div data-{{attribute_name}}-list-container class="plugins-list-container">
<div class="plugins-list-container-title-container">
<h5 class="plugins-list-container-title">PLUGINS LIST</h5>
</div>
<div
class="min-h-[55vh] max-h-80 overflow-auto p-2 col-span-12 relative">
<div data-{{attribute_name}}-list class="grid grid-cols-12 gap-3">
class="plugins-list-items-container">
<div data-{{attribute_name}}-list class="plugins-list-items-wrap">
{% for plugin in plugins %}
<div data-{{attribute_name}}-type="{{ plugin['type'] }}"
class="py-3 min-h-12 relative col-span-12 sm:col-span-6 2xl:col-span-4 3xl:col-span-3 p-1 flex justify-between items-center transition rounded {% if plugin['type'] != 'pro' or plugin['type'] == 'pro' and is_pro_version %} bg-gray-100 hover:bg-gray-300 dark:bg-slate-700 dark:hover:bg-slate-800 {% else %} cursor-not-allowed bg-gray-300 dark:bg-gray-800 {% endif %}">
class="plugins-list-items {% if plugin['type'] != 'pro' or plugin['type'] == 'pro' and is_pro_version %} enabled {% else %} disabled {% endif %}">
<p data-{{attribute_name}}-content
class="{% if plugin['type'] == 'pro' and not is_pro_version %} opacity-80 dark:opacity-60 {% endif %} ml-3 mr-2 break-words mb-0 transition duration-300 ease-in-out text-left text-sm md:text-base text-slate-700 dark:text-gray-200">
class="plugins-list-items-name {% if plugin['type'] == 'pro' and not is_pro_version %} disabled {% endif %} ">
{{ plugin['name'] }}
</p>
<div class="flex items-center">
<div class="plugins-list-items-actions">
{% if plugin['page'] and plugin['type'] != "pro" or (plugin['page'] and plugin['type'] == "pro" and is_pro_version) %}
<a aria-label="plugin page link"
class="hover:-translate-y-px mx-1"
class="plugins-list-items-link"
href="{{ request.url_root }}plugins/{{ plugin['id'] }}">
<svg class="h-6 w-6 fill-sky-500 dark dark:brightness-90"
<svg class="plugins-list-items-link-svg"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 448 512">
<path d="M288 32c-17.7 0-32 14.3-32 32s14.3 32 32 32h50.7L169.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L384 141.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V64c0-17.7-14.3-32-32-32H288zM80 64C35.8 64 0 99.8 0 144V400c0 44.2 35.8 80 80 80H336c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32v80c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V144c0-8.8 7.2-16 16-16h80c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z">
@ -106,8 +106,8 @@
<button data-{{attribute_name}}-action="delete"
name="{{ plugin['id'] }}"
aria-label="delete plugin"
class="z-20 mx-2 inline-block font-bold text-left text-white uppercase align-middle transition-all cursor-pointer text-xs ease-in tracking-tight-rem hover:-translate-y-px">
<svg class="h-5 w-5 fill-red-500 dark:brightness-90"
class="plugins-list-items-delete">
<svg class="plugins-list-items-delete-svg"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 448 512">
<path d="M135.2 17.7L128 32H32C14.3 32 0 46.3 0 64S14.3 96 32 96H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H320l-7.2-14.3C307.4 6.8 296.3 0 284.2 0H163.8c-12.1 0-23.2 6.8-28.6 17.7zM416 128H32L53.2 467c1.6 25.3 22.6 45 47.9 45H346.9c25.3 0 46.3-19.7 47.9-45L416 128z" />
@ -117,9 +117,9 @@
{% if plugin['type'] == "pro" %}
<a {% if not is_pro_version %}target="_blank" rel="noopener"{% endif %}
aria-label="pro plugin"
class="hover:-translate-y-px mx-1 -translate-y-0.5"
class="plugins-list-items-pro"
href="{% if not is_pro_version %}https://panel.bunkerweb.io/?utm_campaign=self&utm_source=ui#pro{% else %}javascript:void(0){% endif %}">
<svg class="h-6 w-6 dark:brightness-90"
<svg class="plugins-list-items-pro-svg"
viewBox="0 0 48 46"
fill="none"
xmlns="http://www.w3.org/2000/svg">

View file

@ -109,7 +109,7 @@
data-settings="{{ service['settings'] }}"
data-{{attribute_name}}-service="{{ service['SERVER_NAME']['value'] }}"
class="dark:brightness-110 overflow-hidden hover:scale-102 transition col-span-12 lg:col-span-6 3xl:col-span-4 p-4 w-full shadow-md break-words bg-white dark:bg-slate-850 dark:shadow-dark-xl rounded-2xl bg-clip-border">
class="flex flex-col justify-between dark:brightness-110 overflow-hidden hover:scale-102 transition col-span-12 lg:col-span-6 3xl:col-span-4 p-4 w-full shadow-md break-words bg-white dark:bg-slate-850 dark:shadow-dark-xl rounded-2xl bg-clip-border">
<div data-old-name
class="hidden"
data-value="{{ service['SERVER_NAME']['full_value'] }}"></div>
@ -120,10 +120,16 @@
class="hidden"
data-value="{{ service['SERVER_NAME']['method'] }}"></div>
<div class="flex justify-between items-start">
<h5 data-{{attribute_name}}-name="{{ service["SERVER_NAME"]['value'] }}"
class="transition duration-300 ease-in-out text-center sm:text-left mb-1 font-bold dark:text-white/90">
<div class="flex flex-col">
<h5 data-{{attribute_name}}-name="{{ service["SERVER_NAME"]['value'] }}"
class="break-all transition duration-300 ease-in-out text-center sm:text-left mb-1 mr-2 font-bold dark:text-white/90">
{{ service["SERVER_NAME"]['value'] }}
</h5>
<h6 data-{{attribute_name}}-method="{{ service["SERVER_NAME"]['method'] }}"
class="text-left sm:mb-2 font-semibold text-gray-600 dark:text-white/80">
{{ service["SERVER_NAME"]['method'] }}
</h6>
</div>
{% if service.get('IS_DRAFT', "no") == "yes" and service["SERVER_NAME"]['method'] in ["ui", "default"] %}
<button class="group relative">
<p data-{{attribute_name}}-state="draft"
@ -153,10 +159,6 @@
</button>
{% endif %}
</div>
<h6 data-{{attribute_name}}-method="{{ service["SERVER_NAME"]['method'] }}"
class="text-left sm:mb-2 font-semibold text-gray-600 dark:text-white/80">
{{ service["SERVER_NAME"]['method'] }}
</h6>
{% set details = [
{
"name": "Reverse proxy",

View file

@ -11,7 +11,7 @@
SERVICE MODAL
</p>
<button data-toggle-draft-btn
class="transition hover:brightness-75 dark:hover:brightness-110 sm:ml-4 flex items-center border border-gray-700 dark:border-gray-300 dark:bg-slate-700 bg-gray-50/10 text-gray-800 rounded py-1 px-2">
class="min-w-fit transition hover:brightness-75 dark:hover:brightness-110 sm:ml-4 flex items-center border border-gray-700 dark:border-gray-300 dark:bg-slate-700 bg-gray-50/10 text-gray-800 rounded py-1 px-2">
<p data-toggle-draft="true"
class="hidden dark:text-gray-100 mb-0 mr-2 pointer-events-none">Draft</p>
<p data-toggle-draft="false"

View file

@ -10,7 +10,7 @@
</span>
<!-- chevron -->
<svg data-tab-select-dropdown-arrow
class="transition-transform h-4 w-4 fill-primary dark:fill-gray-300"
class="settings-tabs-select-btn-svg"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 512 512">
<path d="M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z" />