Skip to content

Commit

Permalink
precommit config
Browse files Browse the repository at this point in the history
  • Loading branch information
syrk4web committed Dec 20, 2023
1 parent 29c8802 commit 20c2f4f
Show file tree
Hide file tree
Showing 17 changed files with 107 additions and 107 deletions.
16 changes: 8 additions & 8 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,14 @@ regex==2023.10.3 \
requests==2.31.0 \
--hash=sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f \
--hash=sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1
# via
# importlib-metadata
# importlib-resources

# The following packages are considered to be unsafe in a requirements file:
setuptools==69.0.2 \
--hash=sha256:1e8fdff6797d3865f37397be788a4e3cba233608e9b509382a2777d25ebde7f2 \
--hash=sha256:735896e78a4742605974de002ac60562d286fa8051a7e2299445e8e8fbb01aa6
# via mkdocs-material
six==1.16.0 \
--hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \
Expand Down Expand Up @@ -671,12 +679,4 @@ webencodings==0.5.1 \
zipp==3.17.0 \
--hash=sha256:0e923e726174922dce09c53c59ad483ff7bbb8e572e00c7f7c46b88556409f31 \
--hash=sha256:84e64a1c28cf7e91ed2078bb8cc8c259cb19b76942096c8d7b84947690cabaf0
# via
# importlib-metadata
# importlib-resources

# The following packages are considered to be unsafe in a requirements file:
setuptools==69.0.2 \
--hash=sha256:1e8fdff6797d3865f37397be788a4e3cba233608e9b509382a2777d25ebde7f2 \
--hash=sha256:735896e78a4742605974de002ac60562d286fa8051a7e2299445e8e8fbb01aa6
# via pytablewriter
2 changes: 1 addition & 1 deletion src/autoconf/IngressController.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def _to_services(self, controller_service) -> List[dict]:
variable = variable.replace(f"{server_name}_", "", 1)
if self._is_setting_context(variable, "multisite"):
service[variable] = value

# parse tls
if controller_service.spec.tls:
for tls in controller_service.spec.tls:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ ssl_dhparam /etc/nginx/dhparam;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
{% endif %}

{% endif %}
{% endif %}
2 changes: 1 addition & 1 deletion src/common/core/customcert/customcert.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@ function customcert:load_data(data, server_name)
return true
end

return customcert
return customcert
2 changes: 1 addition & 1 deletion src/common/core/customcert/jobs/custom-cert.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def check_cert(cert_path: str, key_path: str, first_server: Optional[str] = None
cert_path = str(file_path)
else:
key_path = str(file_path)

if cert_data != b"":
with open()

Expand Down
12 changes: 6 additions & 6 deletions src/ui/static/js/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class News {
news.photo.url,
news.excerpt,
news.tags,
news.date
news.date,
);
let cleanHTML = DOMPurify.sanitize(cardHTML);
//add to DOM
Expand Down Expand Up @@ -205,7 +205,7 @@ class darkMode {
};
const send = await fetch(
`${location.href.split("/").slice(0, -1).join("/")}/darkmode`,
data
data,
);
}
}
Expand Down Expand Up @@ -245,7 +245,7 @@ class FlashMsg {
flashEl.remove();
//update count
this.flashCount.textContent = document.querySelectorAll(
"[data-flash-message]"
"[data-flash-message]",
).length;
}
} catch (err) {}
Expand Down Expand Up @@ -338,7 +338,7 @@ class Banner {
this.bannerEl.querySelector(
`[role="listitem"][data-id="${
+visibleEl.getAttribute("data-id") + 1
}"]`
}"]`,
) || this.bannerEl.querySelector(`[role="listitem"][data-id="0"]`);

// Hide current one
Expand Down Expand Up @@ -416,11 +416,11 @@ const setMenu = new Menu();
const setNewsSidebar = new Sidebar(
"[data-sidebar-info]",
"[data-sidebar-info-open]",
"[data-sidebar-info-close]"
"[data-sidebar-info-close]",
);

const setFlashSidebar = new Sidebar(
"[data-flash-sidebar]",
"[data-flash-sidebar-open]",
"[data-flash-sidebar-close]"
"[data-flash-sidebar-close]",
);
44 changes: 22 additions & 22 deletions src/ui/static/js/logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Dropdown {
const btn = e.target.closest("button");
const btnValue = btn.getAttribute("value");
const btnSetting = btn.getAttribute(
`data-${this.prefix}-setting-select-dropdown-btn`
`data-${this.prefix}-setting-select-dropdown-btn`,
);
//stop if same value to avoid new fetching
const isSameVal = this.isSameValue(btnSetting, btnValue);
Expand All @@ -56,55 +56,55 @@ class Dropdown {

closeAllDrop() {
const drops = document.querySelectorAll(
`[data-${this.prefix}-setting-select-dropdown]`
`[data-${this.prefix}-setting-select-dropdown]`,
);
drops.forEach((drop) => {
drop.classList.add("hidden");
drop.classList.remove("flex");
document
.querySelector(
`svg[data-${this.prefix}-setting-select="${drop.getAttribute(
`data-${this.prefix}-setting-select-dropdown`
)}"]`
`data-${this.prefix}-setting-select-dropdown`,
)}"]`,
)
.classList.remove("rotate-180");
});
}

isSameValue(btnSetting, value) {
const selectCustom = document.querySelector(
`[data-${this.prefix}-setting-select-text="${btnSetting}"]`
`[data-${this.prefix}-setting-select-text="${btnSetting}"]`,
);
const currVal = selectCustom.textContent;
return currVal === value ? true : false;
}

setSelectNewValue(btnSetting, value) {
const selectCustom = document.querySelector(
`[data-${this.prefix}-setting-select="${btnSetting}"]`
`[data-${this.prefix}-setting-select="${btnSetting}"]`,
);
selectCustom.querySelector(
`[data-${this.prefix}-setting-select-text]`
`[data-${this.prefix}-setting-select-text]`,
).textContent = value;
}

hideDropdown(btnSetting) {
//hide dropdown
const dropdownEl = document.querySelector(
`[data-${this.prefix}-setting-select-dropdown="${btnSetting}"]`
`[data-${this.prefix}-setting-select-dropdown="${btnSetting}"]`,
);
dropdownEl.classList.add("hidden");
dropdownEl.classList.remove("flex");
//svg effect
const dropdownChevron = document.querySelector(
`svg[data-${this.prefix}-setting-select="${btnSetting}"]`
`svg[data-${this.prefix}-setting-select="${btnSetting}"]`,
);
dropdownChevron.classList.remove("rotate-180");
}

changeDropBtnStyle(btnSetting, selectedBtn) {
const dropdownEl = document.querySelector(
`[data-${this.prefix}-setting-select-dropdown="${btnSetting}"]`
`[data-${this.prefix}-setting-select-dropdown="${btnSetting}"]`,
);
//reset dropdown btns
const btnEls = dropdownEl.querySelectorAll("button");
Expand All @@ -114,15 +114,15 @@ class Dropdown {
"bg-primary",
"dark:bg-primary",
"text-gray-300",
"text-gray-300"
"text-gray-300",
);
btn.classList.add("bg-white", "dark:bg-slate-700", "text-gray-700");
});
//highlight clicked btn
selectedBtn.classList.remove(
"bg-white",
"dark:bg-slate-700",
"text-gray-700"
"text-gray-700",
);
selectedBtn.classList.add("dark:bg-primary", "bg-primary", "text-gray-300");
}
Expand All @@ -133,10 +133,10 @@ class Dropdown {
.getAttribute(`data-${this.prefix}-setting-select`);
//toggle dropdown
const dropdownEl = document.querySelector(
`[data-${this.prefix}-setting-select-dropdown="${attribute}"]`
`[data-${this.prefix}-setting-select-dropdown="${attribute}"]`,
);
const dropdownChevron = document.querySelector(
`svg[data-${this.prefix}-setting-select="${attribute}"]`
`svg[data-${this.prefix}-setting-select="${attribute}"]`,
);
dropdownEl.classList.toggle("hidden");
dropdownEl.classList.toggle("flex");
Expand Down Expand Up @@ -171,7 +171,7 @@ class FetchLogs {
constructor(prefix = "logs") {
this.prefix = prefix;
this.instance = document.querySelector(
`[data-${this.prefix}-setting-select-text="instances"]`
`[data-${this.prefix}-setting-select-text="instances"]`,
);
this.instanceName = "";
this.updateInp = document.querySelector("input#update-date");
Expand All @@ -186,7 +186,7 @@ class FetchLogs {
this.lastUpdate = Date.now() - 86400000;
this.container = document.querySelector(`[data-${this.prefix}-settings]`);
this.logListContainer = document.querySelector(
`[data-${this.prefix}-list]`
`[data-${this.prefix}-list]`,
);
this.submitDate = document.querySelector("button[data-submit-date]");
this.submitLive = document.querySelector("button[data-submit-live]");
Expand Down Expand Up @@ -216,7 +216,7 @@ class FetchLogs {
"data-submit-live",
this.submitLive.getAttribute("data-submit-live") === "yes"
? "no"
: "yes"
: "yes",
);

if (this.submitLive.getAttribute("data-submit-live") === "yes") {
Expand Down Expand Up @@ -312,7 +312,7 @@ class FetchLogs {
.querySelector(`[data-${this.prefix}-list]`)
.scrollTo(
0,
document.querySelector(`[data-${this.prefix}-list]`).scrollHeight
document.querySelector(`[data-${this.prefix}-list]`).scrollHeight,
);
}

Expand All @@ -321,15 +321,15 @@ class FetchLogs {
//case from date defined only
if (this.toDate) {
res = await fetch(
`${location.href}/${this.instanceName}?from_date=${this.fromDate}&to_date=${this.toDate}`
`${location.href}/${this.instanceName}?from_date=${this.fromDate}&to_date=${this.toDate}`,
);
const data = await res.json();
return await this.showLogsDate(data);
}
//case from date and to date defined
if (!this.toDate) {
res = await fetch(
`${location.href}/${this.instanceName}?from_date=${this.fromDate}`
`${location.href}/${this.instanceName}?from_date=${this.fromDate}`,
);
const data = await res.json();
return await this.showLogsDate(data);
Expand All @@ -339,7 +339,7 @@ class FetchLogs {
async getLogsSinceLastUpdate() {
const response = await fetch(
`${location.href}/${this.instanceName}` +
(this.lastUpdate ? `?last_update=${this.lastUpdate}` : "")
(this.lastUpdate ? `?last_update=${this.lastUpdate}` : ""),
);
const data = await response.json();
return await this.showLogsLive(data);
Expand Down Expand Up @@ -435,7 +435,7 @@ class Filter {
const btn = e.target.closest("button");
const btnValue = btn.getAttribute("value");
const btnSetting = btn.getAttribute(
`data-${this.prefix}-setting-select-dropdown-btn`
`data-${this.prefix}-setting-select-dropdown-btn`,
);

this.lastType = btnValue;
Expand Down
Loading

0 comments on commit 20c2f4f

Please sign in to comment.