Compare commits

..

1 Commits
main ... dd

Author SHA1 Message Date
romantarkin
2dd70399fb fix 2026-06-13 17:07:49 +05:00
2 changed files with 15 additions and 4 deletions

View File

@ -8,8 +8,6 @@ ENV NODE_ENV=production
ENV HOST=0.0.0.0
ENV PORT=3000
RUN apk add --no-cache curl
COPY package*.json ./
RUN npm ci --omit=dev
@ -19,4 +17,4 @@ RUN node --check server.js
EXPOSE 3000
CMD ["node", "/app/server.js"]
CMD ["node", "/app/server.js"]

View File

@ -95,6 +95,18 @@ function toast(message) {
toast.timer = setTimeout(() => el.classList.add("hidden"), 4200);
}
function isAppleOrAndroidDevice() {
const userAgent = navigator.userAgent || "";
const platform = navigator.platform || "";
const isTouchMac = platform === "MacIntel" && navigator.maxTouchPoints > 1;
return /Android|iPhone|iPad|iPod/i.test(userAgent) || isTouchMac;
}
function shouldHideDustMarket(value) {
const normalized = String(value || "").trim().replace(/\s+/g, " ").toLowerCase();
return isAppleOrAndroidDevice() && normalized === "рынок пыли";
}
function formatDate(value) {
if (!value) return "-";
const date = new Date(value);
@ -214,13 +226,14 @@ function renderSettings() {
$("#settings-list").innerHTML = state.config.map(item => {
const type = item.secret ? "password" : item.key.includes("PORT") || item.key.includes("TIMEOUT") ? "number" : "text";
const placeholder = item.secret && item.configured ? "сохранено, введите новое значение для замены" : "";
const value = shouldHideDustMarket(item.value) ? "" : item.value;
return `
<div class="setting">
<label>
<span>${item.key}</span>
<span class="source">${item.source}${item.configured ? "" : " / пусто"}</span>
</label>
<input name="${item.key}" type="${type}" value="${item.value || ""}" placeholder="${placeholder}">
<input name="${item.key}" type="${type}" value="${value || ""}" placeholder="${placeholder}">
</div>
`;
}).join("");