mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
handle disabled pro on settings
This commit is contained in:
parent
47d32e33b9
commit
b79bfca2e0
2 changed files with 22 additions and 9 deletions
|
|
@ -1148,6 +1148,13 @@ class Settings {
|
|||
}
|
||||
|
||||
setDisabledByMethod(inp, method) {
|
||||
// Check if pro
|
||||
const proDisabled = inp
|
||||
.closest("[data-plugin-item]")
|
||||
.hasAttribute("data-pro-disabled")
|
||||
? true
|
||||
: false;
|
||||
if (proDisabled) return inp.setAttribute("disabled", "");
|
||||
if (method === "ui" || method === "default") {
|
||||
inp.removeAttribute("disabled");
|
||||
} else {
|
||||
|
|
@ -1269,17 +1276,23 @@ class Settings {
|
|||
inp.setAttribute("data-method", method);
|
||||
}
|
||||
|
||||
if (this.forceEnabled) {
|
||||
const proDisabled = inp
|
||||
.closest("[data-plugin-item]")
|
||||
.hasAttribute("data-pro-disabled")
|
||||
? true
|
||||
: false;
|
||||
|
||||
if (proDisabled) return inp.setAttribute("disabled", "");
|
||||
|
||||
if (this.forceEnabled) return inp.removeAttribute("disabled");
|
||||
|
||||
if (method === "ui" || method === "default") {
|
||||
inp.removeAttribute("disabled");
|
||||
} else {
|
||||
if (method === "ui" || method === "default") {
|
||||
inp.removeAttribute("disabled");
|
||||
} else {
|
||||
inp.setAttribute("disabled", "");
|
||||
}
|
||||
|
||||
if (global) inp.removeAttribute("disabled");
|
||||
inp.setAttribute("disabled", "");
|
||||
}
|
||||
|
||||
if (global) inp.removeAttribute("disabled");
|
||||
});
|
||||
} catch (err) {}
|
||||
}
|
||||
|
|
|
|||
2
src/ui/templates/settings_plugins.html
vendored
2
src/ui/templates/settings_plugins.html
vendored
|
|
@ -1,7 +1,7 @@
|
|||
{% set current_endpoint = current_endpoint or url_for(request.endpoint)[1:].split("/")[-1].strip().replace('_', '-') %}
|
||||
<!-- plugin item -->
|
||||
{% for plugin in plugins %}
|
||||
<div data-advanced data-plugin-item="{{ plugin['id'] }}"
|
||||
<div data-advanced data-plugin-item="{{ plugin['id'] }}" {% if plugin['type'] == 'pro' and not is_pro_version %} data-pro-disabled {% endif %}"
|
||||
id="{{ plugin['id'] }}"
|
||||
class="{% if loop.index != 1 %}hidden{% endif %} w-full px-1">
|
||||
<!-- title and desc -->
|
||||
|
|
|
|||
Loading…
Reference in a new issue