Додана сторінка "Розклад зібрань"

Перероблен генератор карточок територій APІ
This commit is contained in:
2025-11-22 20:17:50 +02:00
parent 04f39da611
commit 4b96ef0806
50 changed files with 1486 additions and 494 deletions

View File

@@ -8,6 +8,8 @@ RUN npm install
RUN apt-get update RUN apt-get update
RUN apt-get update && apt-get install -y chromium
COPY . . COPY . .
EXPOSE 4000 EXPOSE 4000

View File

@@ -1,77 +1,58 @@
const path = require('path'); const os = require('os');
const fs = require('fs'); const fs = require('fs');
const puppeteer = require('puppeteer'); const path = require('path');
const { chromium } = require('playwright');
const sharp = require('sharp'); const sharp = require('sharp');
const DIR = process.env.CARDS_PATH || '../cards'; const DIR = process.env.CARDS_PATH || '../cards';
async function genCards({ center, type, wayId, zoom, number, address }) { async function genCards({ id, type }) {
const browser = await puppeteer.launch({ if (!process.env.DOMAIN) throw new Error("❌ DOMAIN не заданий у .env");
if (!process.env.ADMIN_TOKEN) throw new Error("❌ ADMIN_TOKEN не заданий у .env");
if (!process.env.CARDS_PATH) throw new Error("❌ CARDS_PATH не заданий у .env");
const name = type == 'homestead' ? `H${id}` : `T${id}`
const URL = `https://${process.env.DOMAIN}/api/${type}/${id}`; // Замени на свой URL
const AUTH_TOKEN = process.env.ADMIN_TOKEN;
const DIR = process.env.CARDS_PATH || '../cards';
const SCREENSHOT_FILE = path.resolve(`${DIR}/cache/${type}/${name}.png`);
const OUTPUT_FILE = path.resolve(`${DIR}/${type}/${name}.webp`);
// --- Отримуємо дані ---
const res = await fetch(URL, {
headers: { 'Authorization': AUTH_TOKEN, 'Accept': 'application/json' }
});
if (!res.ok) throw new Error(`Помилка запиту: ${res.status}`);
const data = await res.json();
// --- Генеруємо HTML ---
const html = `<!DOCTYPE html><html><head><meta charset="UTF-8" /><link rel="stylesheet" href="https://sheep-service.com/lib/components/leaflet/leaflet.css" /><script src="https://sheep-service.com/lib/components/leaflet/leaflet.js"></script><script src="https://sheep-service.com/lib/components/qrcode.min.js"></script><style>@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap");html, body {height: calc(100% + 50px);}* {border: 0;padding: 0;font-family: "Roboto", sans-serif;margin: 0;font-weight: 500;outline: none;}#content {width: 100%;height: 100%;position: absolute;z-index: 9999;display: flex;flex-direction: column;}#content > #title {width: calc(100% - 30px);min-height: 90px;background: rgb(255 255 255 / 51%);backdrop-filter: blur(10px);display: flex;flex-direction: row;justify-content: space-between;padding: 15px;align-items: center;color: #333;}#content > #title > div {display: flex;flex-direction: column;width: 100%;align-items: center;}#content > #title > h1 {font-size: 60px;font-weight: 700;margin: 0;min-width: 200px;text-align: center;}#content > #title > div > h2 {font-size: 35px;font-weight: 700;margin: 0;}#content > #title > div > h3 {font-size: 28px;font-weight: 500;margin: 0px 0 10px 0;}#qrcode {position: absolute;bottom: 20px;left: 20px;width: 100px;height: 100px;background: #fff;padding: 10px;border-radius: 2px;}.line-left {position: absolute;left: 0;top: 120px;width: 10px;height: calc(100% - 120px);background: rgb(255 255 255 / 51%);backdrop-filter: blur(10px);}.line-right {position: absolute;right: 0;top: 120px;width: 10px;height: calc(100% - 120px);background: rgb(255 255 255 / 51%);backdrop-filter: blur(10px);}.line-bottom {position: absolute;left: 10px;bottom: 0;width: calc(100% - 20px);height: 10px;background: rgb(255 255 255 / 51%);backdrop-filter: blur(10px);}#map {width: 100%;height: 100%;}</style></head><body><div id="content"><div id="title"><div><h3>Картка плану території</h3><h2 id="address"></h2></div><h1 id="number"></h1></div><div id="qrcode"></div><div class="line-left"></div><div class="line-right"></div><div class="line-bottom"></div></div><div id="map"></div><script>const urlParams = new URLSearchParams(window.location.search);let coordinates = ${JSON.stringify(data.points)};let center = [${data.geo.lat}, ${data.geo.lng}];let zoom = ${data.zoom};let type = "${type}";let address = "${data.title} ${data.number ?? ""}";let osm = L.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{});let mytile = L.tileLayer("https://sheep-service.com/map/{z}/{x}/{y}.webp",{maxZoom: 20,minZoom: 15,tms: true,});let map = L.map("map", {renderer: L.canvas(),center,zoom,zoomControl: false,layers: [osm, mytile],});let baseMaps = {OpenStreetMap: osm,"Sheep Service Map": mytile,};let polygonOptions =type === "homestead"? {color: "#f2bd53",radius: 500,fillOpacity: 0.3,dashArray: "20,15",dashOffset: "20",}: {color: "#585858",fillColor: "#f2bd53",fillOpacity: 0.8,};window.onload = async function () {let polygon = L.polygon(coordinates, polygonOptions).addTo(map);let text = 'https://www.google.com/maps/search/?api=1&query='+center[0]+','+center[1];new QRCode(document.getElementById("qrcode"), {text: text,width: 100,height: 100,correctLevel: QRCode.CorrectLevel.L,version: 5,});document.getElementById("address").innerText = address;document.getElementById("number").innerText = '${name}';};</script></body></html>`;
// --- Зберігаємо тимчасовий HTML ---
const tmpFile = path.join(os.tmpdir(), 'map.html');
fs.writeFileSync(tmpFile, html, 'utf-8');
// --- Зберігаємо ---
// const browser = await chromium.launch();
const browser = await chromium.launch({
executablePath: process.env.PUPPETEER_EXECUTABLE_PATH || '/usr/bin/chromium-browser', executablePath: process.env.PUPPETEER_EXECUTABLE_PATH || '/usr/bin/chromium-browser',
args: ['--no-sandbox', '--disable-setuid-sandbox'] args: ['--no-sandbox', '--disable-setuid-sandbox']
}); });
const page = await browser.newPage({ viewport: { width: 811, height: 531 } });
await page.goto(`file://${tmpFile}`);
let latlng = center && center.lat && center.lng ? `lat=${center.lat}&lng=${center.lng}&` : ''; await page.waitForTimeout(2000); // пауза 1 секунда для провантаження карти
await page.screenshot({ path: SCREENSHOT_FILE });
const page = await browser.newPage();
await page.setViewport({ width: 1144, height: (750 + 140) })
await page.goto(`https://sheep-service.com/screenshot.html?${latlng}type=${type}&wayId=${wayId}&zoom=${zoom}&address=${address}&number=${number}`, { timeout: 0 });
await page.waitForSelector('.leaflet-tile-loaded', { timeout: 30000 });
await new Promise(resolve => setTimeout(resolve, 1000));
let name = () => {
if (type == "house") return `T${number}.png`
else if (type == "entrance") return `E${number}.png`
else if (type == "homestead") return `H${number}.png`
return `${Date.now()}.png`
}
if (!fs.existsSync(path.join(DIR, 'cache'))) {
fs.mkdirSync(path.join(DIR, 'cache'), { recursive: true })
}
await page.screenshot({ path: path.join(DIR, "cache", name()) });
await browser.close(); await browser.close();
return name(); await sharp(SCREENSHOT_FILE)
.webp()
.toFile(OUTPUT_FILE);
console.log(`Зображеня збережене: ${name}.png`);
// return fs.existsSync(OUTPUT_FILE);
} }
async function saveCards({ center, type, wayId, zoom, number, address }) { module.exports = genCards;
let name = await genCards({ center, type, wayId, zoom, number, address });
if (!fs.existsSync(path.join(DIR, type))) {
fs.mkdirSync(path.join(DIR, type), { recursive: true });
}
try {
const metadata = await sharp(path.join(DIR, 'cache', name)).metadata();
const width = metadata.width;
const height = metadata.height;
if (width > 20 && height > 140) {
const outputPath = path.join(DIR, type, name.replace(path.extname(name), '.webp'));
await sharp(path.join(DIR, 'cache', name))
.extract({
left: 0,
top: 0,
width: width,
height: height - 140
})
.webp()
.toFile(outputPath);
return fs.existsSync(outputPath);
} else {
console.error('Изображение слишком маленькое для обрезки!');
return false;
}
} catch (err) {
console.error('Ошибка при обработке изображения:', err);
return false;
}
}
module.exports = saveCards;

179
api/package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "API Sheep Service", "name": "API Sheep Service",
"version": "2.0.1", "version": "2.0.5",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "API Sheep Service", "name": "API Sheep Service",
"version": "2.0.1", "version": "2.0.5",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"cors": "^2.8.5", "cors": "^2.8.5",
@@ -14,7 +14,7 @@
"exceljs": "^4.4.0", "exceljs": "^4.4.0",
"express": "^4.21.0", "express": "^4.21.0",
"node-telegram-bot-api": "^0.66.0", "node-telegram-bot-api": "^0.66.0",
"pg": "^8.16.3", "playwright": "^1.56.1",
"puppeteer": "^24.4.0", "puppeteer": "^24.4.0",
"sharp": "^0.33.5", "sharp": "^0.33.5",
"sqlite3": "^5.1.7", "sqlite3": "^5.1.7",
@@ -2362,6 +2362,19 @@
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
}, },
"node_modules/fsevents": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
"hasInstallScript": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/fstream": { "node_modules/fstream": {
"version": "1.0.12", "version": "1.0.12",
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz",
@@ -4252,92 +4265,39 @@
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
"integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==" "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow=="
}, },
"node_modules/pg": {
"version": "8.16.3",
"resolved": "https://registry.npmjs.org/pg/-/pg-8.16.3.tgz",
"integrity": "sha512-enxc1h0jA/aq5oSDMvqyW3q89ra6XIIDZgCX9vkMrnz5DFTw/Ny3Li2lFQ+pt3L6MCgm/5o2o8HW9hiJji+xvw==",
"dependencies": {
"pg-connection-string": "^2.9.1",
"pg-pool": "^3.10.1",
"pg-protocol": "^1.10.3",
"pg-types": "2.2.0",
"pgpass": "1.0.5"
},
"engines": {
"node": ">= 16.0.0"
},
"optionalDependencies": {
"pg-cloudflare": "^1.2.7"
},
"peerDependencies": {
"pg-native": ">=3.0.1"
},
"peerDependenciesMeta": {
"pg-native": {
"optional": true
}
}
},
"node_modules/pg-cloudflare": {
"version": "1.2.7",
"resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.2.7.tgz",
"integrity": "sha512-YgCtzMH0ptvZJslLM1ffsY4EuGaU0cx4XSdXLRFae8bPP4dS5xL1tNB3k2o/N64cHJpwU7dxKli/nZ2lUa5fLg==",
"optional": true
},
"node_modules/pg-connection-string": {
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.9.1.tgz",
"integrity": "sha512-nkc6NpDcvPVpZXxrreI/FOtX3XemeLl8E0qFr6F2Lrm/I8WOnaWNhIPK2Z7OHpw7gh5XJThi6j6ppgNoaT1w4w=="
},
"node_modules/pg-int8": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz",
"integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==",
"engines": {
"node": ">=4.0.0"
}
},
"node_modules/pg-pool": {
"version": "3.10.1",
"resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.10.1.tgz",
"integrity": "sha512-Tu8jMlcX+9d8+QVzKIvM/uJtp07PKr82IUOYEphaWcoBhIYkoHpLXN3qO59nAI11ripznDsEzEv8nUxBVWajGg==",
"peerDependencies": {
"pg": ">=8.0"
}
},
"node_modules/pg-protocol": {
"version": "1.10.3",
"resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.10.3.tgz",
"integrity": "sha512-6DIBgBQaTKDJyxnXaLiLR8wBpQQcGWuAESkRBX/t6OwA8YsqP+iVSiond2EDy6Y/dsGk8rh/jtax3js5NeV7JQ=="
},
"node_modules/pg-types": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz",
"integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==",
"dependencies": {
"pg-int8": "1.0.1",
"postgres-array": "~2.0.0",
"postgres-bytea": "~1.0.0",
"postgres-date": "~1.0.4",
"postgres-interval": "^1.1.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/pgpass": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz",
"integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==",
"dependencies": {
"split2": "^4.1.0"
}
},
"node_modules/picocolors": { "node_modules/picocolors": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
"integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="
}, },
"node_modules/playwright": {
"version": "1.56.1",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.56.1.tgz",
"integrity": "sha512-aFi5B0WovBHTEvpM3DzXTUaeN6eN0qWnTkKx4NQaH4Wvcmc153PdaY2UBdSYKaGYw+UyWXSVyxDUg5DoPEttjw==",
"dependencies": {
"playwright-core": "1.56.1"
},
"bin": {
"playwright": "cli.js"
},
"engines": {
"node": ">=18"
},
"optionalDependencies": {
"fsevents": "2.3.2"
}
},
"node_modules/playwright-core": {
"version": "1.56.1",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.56.1.tgz",
"integrity": "sha512-hutraynyn31F+Bifme+Ps9Vq59hKuUCz7H1kDOcBs+2oGguKkWTU50bBWrtz34OUWmIwpBTWDxaRPXrIXkgvmQ==",
"bin": {
"playwright-core": "cli.js"
},
"engines": {
"node": ">=18"
}
},
"node_modules/possible-typed-array-names": { "node_modules/possible-typed-array-names": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz",
@@ -4346,41 +4306,6 @@
"node": ">= 0.4" "node": ">= 0.4"
} }
}, },
"node_modules/postgres-array": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",
"integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==",
"engines": {
"node": ">=4"
}
},
"node_modules/postgres-bytea": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz",
"integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/postgres-date": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz",
"integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/postgres-interval": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz",
"integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==",
"dependencies": {
"xtend": "^4.0.0"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/prebuild-install": { "node_modules/prebuild-install": {
"version": "7.1.3", "version": "7.1.3",
"resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz", "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz",
@@ -5345,14 +5270,6 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/split2": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz",
"integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==",
"engines": {
"node": ">= 10.x"
}
},
"node_modules/sqlite3": { "node_modules/sqlite3": {
"version": "5.1.7", "version": "5.1.7",
"resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.7.tgz", "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.7.tgz",
@@ -6132,14 +6049,6 @@
"resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",
"integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==" "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw=="
}, },
"node_modules/xtend": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
"engines": {
"node": ">=0.4"
}
},
"node_modules/y18n": { "node_modules/y18n": {
"version": "5.0.8", "version": "5.0.8",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",

View File

@@ -1,6 +1,6 @@
{ {
"name": "API Sheep Service", "name": "API Sheep Service",
"version": "2.0.1", "version": "2.0.5",
"main": "app.js", "main": "app.js",
"scripts": { "scripts": {
"start": "node app.js" "start": "node app.js"
@@ -14,6 +14,7 @@
"exceljs": "^4.4.0", "exceljs": "^4.4.0",
"express": "^4.21.0", "express": "^4.21.0",
"node-telegram-bot-api": "^0.66.0", "node-telegram-bot-api": "^0.66.0",
"playwright": "^1.56.1",
"puppeteer": "^24.4.0", "puppeteer": "^24.4.0",
"sharp": "^0.33.5", "sharp": "^0.33.5",
"sqlite3": "^5.1.7", "sqlite3": "^5.1.7",

View File

@@ -1,204 +1,7 @@
const db = require("../config/db"); const db = require("../config/db");
const saveCards = require("../middleware/genCards"); const genCards = require("../middleware/genCards");
class ConstructorService { class ConstructorService {
// createPack(data) {
// return new Promise((res, rej) => {
// let sql = `
// INSERT INTO
// house(
// group_id,
// title,
// number,
// points,
// points_number,
// geo,
// osm_id,
// settlement,
// created_at
// )
// VALUES
// (?, ?, ?, ?, ?, ?, ?, ?, ?)
// `;
// db.run(sql, [
// Number(data.house.group_id),
// data.house.title,
// data.house.number,
// JSON.stringify(data.house.points),
// JSON.stringify(data.house.points_number),
// JSON.stringify(data.house.geo),
// JSON.stringify(data.house.osm_id),
// data.house.settlement,
// Math.floor(Date.now())
// ], function (err) {
// if (err) {
// console.error(err.message);
// return res(false);
// } else if (this.changes === 0) {
// return res(false);
// } else {
// const houseId = this.lastID;
// const entranceStmt = db.prepare(`
// INSERT INTO
// entrance(
// house_id,
// entrance_number,
// title,
// points,
// points_number,
// created_at
// )
// VALUES
// (?, ?, ?, ?, ?, ?)`);
// const apartmentStmt = db.prepare(`
// INSERT INTO
// apartments(
// entrance_id,
// apartment_number,
// floors_number,
// updated_at
// )
// VALUES
// (?, ?, ?, ?)`);
// data.entrance.forEach((e, index) => {
// entranceStmt.run(
// houseId,
// Number(e.entrance_number),
// e.title,
// JSON.stringify(e.points),
// JSON.stringify(e.points_number),
// Math.floor(Date.now()),
// function (err) {
// if (err) {
// console.error(err.message);
// return;
// }
// const entranceId = this.lastID;
// if (data.apartments[e.editor_id]) {
// data.apartments[e.editor_id].forEach(apartment => {
// apartmentStmt.run(
// entranceId,
// apartment.apartment_number,
// apartment.floors_number,
// Math.floor(Date.now())
// );
// });
// }
// }
// );
// });
// entranceStmt.finalize();
// apartmentStmt.finalize();
// // res({ "status": "ok", "id": houseId });
// }
// });
// });
// }
// createPack(data) {
// return new Promise((res, rej) => {
// if (data.type == "house") {
// const sql = `
// INSERT INTO house (
// title, number, points, points_number, geo, osm_id, settlement, created_at
// ) VALUES (?, ?, ?, ?, ?, ?, ?, ?)`;
// db.run(sql, [
// data.title,
// data.number,
// JSON.stringify(data.points),
// JSON.stringify(data.points_number),
// JSON.stringify(data.geo),
// JSON.stringify(data.osm_id),
// data.settlement,
// Math.floor(Date.now())
// ], function (err) {
// if (err) {
// console.error(err.message);
// return res(false);
// }
// if (this.changes === 0) {
// return res(false);
// }
// const houseId = this.lastID;
// saveCards({ center: data.geo, wayId: data.osm_id, zoom: data.zoom ?? 18, type: "house", number: houseId, address: `${data.title} ${data.number}` });
// const entranceStmt = db.prepare(`
// INSERT INTO entrance (
// house_id, entrance_number, title, points, points_number, created_at
// ) VALUES (?, ?, ?, ?, ?, ?)`);
// const apartmentStmt = db.prepare(`
// INSERT INTO apartments (
// entrance_id, apartment_number, title, floors_number
// ) VALUES (?, ?, ?, ?)`);
// const entranceIdMap = {}; // Для сопоставления editor_id → entrance_id
// let pendingEntrances = data.entrance.length;
// data.entrance.forEach((e) => {
// entranceStmt.run(
// houseId,
// Number(e.entrance_number),
// e.title,
// JSON.stringify(e.points),
// JSON.stringify(e.points_number),
// Math.floor(Date.now()),
// function (err) {
// if (err) {
// console.error(err.message);
// return;
// }
// const entranceId = this.lastID;
// entranceIdMap[e.editor_id] = entranceId;
// if (--pendingEntrances === 0) {
// insertApartments();
// }
// }
// );
// });
// function insertApartments() {
// for (const [editor_id, apartments] of Object.entries(data.apartments)) {
// const entranceId = entranceIdMap[editor_id];
// if (!entranceId) continue;
// apartments.forEach(apartment => {
// apartmentStmt.run(
// entranceId,
// Number(apartment.apartment_number),
// apartment.title,
// apartment.floors_number
// );
// });
// }
// entranceStmt.finalize();
// apartmentStmt.finalize();
// res({ "status": "ok", "id": houseId });
// }
// });
// } else if (data.type == "homestead") {
// return res(false);
// } else {
// return res(false);
// }
// });
// }
createPack(data) { createPack(data) {
return new Promise((res, rej) => { return new Promise((res, rej) => {
@@ -228,8 +31,6 @@ class ConstructorService {
const houseId = this.lastID; const houseId = this.lastID;
// saveCards({ center: data.geo, wayId: data.osm_id, zoom: data.zoom ?? 18, type: "house", number: houseId, address: `${data.title} ${data.number}` });
const entranceStmt = db.prepare(` const entranceStmt = db.prepare(`
INSERT INTO entrance ( INSERT INTO entrance (
house_id, entrance_number, title, created_at house_id, entrance_number, title, created_at
@@ -287,6 +88,8 @@ class ConstructorService {
); );
}); });
genCards({type: "house", id: houseId});
function finalize() { function finalize() {
entranceStmt.finalize(); entranceStmt.finalize();
apartmentStmt.finalize(); apartmentStmt.finalize();
@@ -321,8 +124,6 @@ class ConstructorService {
const homesteadId = this.lastID; const homesteadId = this.lastID;
// saveCards({ center: data.geo, wayId: data.osm_id, zoom: data.zoom ?? 17, type: "homestead", number: homesteadId, address: `${data.title} ${data.number}` });
const buildingStmt = db.prepare(` const buildingStmt = db.prepare(`
INSERT INTO buildings ( INSERT INTO buildings (
homestead_id, title, geo homestead_id, title, geo
@@ -351,6 +152,8 @@ class ConstructorService {
); );
}); });
genCards({type: "homestead", id: homesteadId});
function finalize() { function finalize() {
buildingStmt.finalize(); buildingStmt.finalize();
res({ status: "ok", id: homesteadId }); res({ status: "ok", id: homesteadId });

View File

@@ -272,11 +272,11 @@ class StandService {
console.error(err.message); console.error(err.message);
return res(false); return res(false);
} }
// Notification.sendStand({ Notification.sendStand({
// title: "Додан новий день служіння", title: "Додан новий день служіння",
// body: `Стенд «${stand.title}» поповнився, встигніть записатися.`, body: `Стенд «${stand.title}» поповнився, встигніть записатися.`,
// page: `/stand/card/${stand.id}` page: `/stand/card/${stand.id}`
// }); });
res({ status: "ok", inserted: list.length }); res({ status: "ok", inserted: list.length });
}); });

View File

@@ -0,0 +1,11 @@
[
{
"id": 1,
"date": 100000001,
"type": 0,
"number": "",
"sheep_1": "",
"sheep_2": "",
"title": ""
}
]

View File

@@ -30,6 +30,8 @@ services:
- VAPID_PUBLIC_KEY=${VAPID_PUBLIC_KEY} - VAPID_PUBLIC_KEY=${VAPID_PUBLIC_KEY}
- VAPID_PRIVATE_KEY=${VAPID_PRIVATE_KEY} - VAPID_PRIVATE_KEY=${VAPID_PRIVATE_KEY}
- DOMAIN=${DOMAIN} - DOMAIN=${DOMAIN}
- ADMIN_TOKEN=${ADMIN_TOKEN}
shm_size: '1gb'
networks: networks:
- network - network

View File

@@ -1,4 +1,5 @@
const CONFIG = { const CONFIG = {
"web": "https://test.sheep-service.com/",
"api": "https://test.sheep-service.com/api/", "api": "https://test.sheep-service.com/api/",
"wss": "wss://test.sheep-service.com/ws" "wss": "wss://test.sheep-service.com/ws"
} }

View File

@@ -6,6 +6,17 @@
--FontSize3: 14px; --FontSize3: 14px;
--FontSize4: 15px; --FontSize4: 15px;
--FontSize5: 16px; --FontSize5: 16px;
--FontSize6: 22px;
--C0: #9a77c9;
--C1: #7c7c7c;
--C2: #c5ba59;
--C3: #a14a2e;
--C4: #779953;
--C5: #537299;
--C6: #bb4444;
--C7: #539974;
--C8: #537299;
} }
@media (prefers-color-scheme: light) { @media (prefers-color-scheme: light) {
@@ -740,7 +751,11 @@ body.modal-open {
color: var(--ColorThemes3) !important; color: var(--ColorThemes3) !important;
} }
.leaflet_drop {} .leaflet_drop {
display: flex;
flex-direction: column;
align-items: center;
}
.leaflet_drop>div { .leaflet_drop>div {
background: #C14D4D; background: #C14D4D;
@@ -751,6 +766,12 @@ body.modal-open {
margin: -3px 0 0 -3px; margin: -3px 0 0 -3px;
} }
.leaflet_drop>span {
font-size: var(--FontSize1);
opacity: 0.8;
margin-bottom: 10px;
}
.leaflet-pm-tooltip { .leaflet-pm-tooltip {
display: none !important; display: none !important;
} }

BIN
web/img/stand/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

BIN
web/img/stand/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

BIN
web/img/stand/3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

BIN
web/img/stand/4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 MiB

BIN
web/img/stand/5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

BIN
web/img/stand/6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

BIN
web/img/stand/7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

BIN
web/img/stand/8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

View File

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 MiB

After

Width:  |  Height:  |  Size: 3.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 MiB

After

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 MiB

View File

@@ -93,6 +93,9 @@
<script src="/lib/pages/territory/card/script.js" defer></script> <script src="/lib/pages/territory/card/script.js" defer></script>
<link href="/lib/pages/territory/card/style.css" rel="stylesheet" /> <link href="/lib/pages/territory/card/style.css" rel="stylesheet" />
<script src="/lib/pages/territory/map/script.js" defer></script>
<link href="/lib/pages/territory/map/style.css" rel="stylesheet" />
<script src="/lib/pages/options/script.js" defer></script> <script src="/lib/pages/options/script.js" defer></script>
<link href="/lib/pages/options/style.css" rel="stylesheet" /> <link href="/lib/pages/options/style.css" rel="stylesheet" />
@@ -111,8 +114,8 @@
<script src="/lib/pages/stand/editor/script.js" defer></script> <script src="/lib/pages/stand/editor/script.js" defer></script>
<link href="/lib/pages/stand/editor/style.css" rel="stylesheet" /> <link href="/lib/pages/stand/editor/style.css" rel="stylesheet" />
<script src="/lib/pages/schedule/script.js" defer></script> <script src="/lib/pages/schedule/list/script.js" defer></script>
<link href="/lib/pages/schedule/style.css" rel="stylesheet" /> <link href="/lib/pages/schedule/list/style.css" rel="stylesheet" />
<script src="/lib/app.js" defer></script> <script src="/lib/app.js" defer></script>
</head> </head>

View File

@@ -1,5 +1,19 @@
<div class="page-home"> <div class="page-home">
<details id="details-personal-territory" open style="display: none;"> <div class="buttons-list" id="buttons-list">
<a href="/territory/map" data-route id="mapButton">
<?xml version="1.0"?><svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
>
<path
d="M 18 0 C 15.791 0 14 1.791 14 4 C 14 6.062 16.082187 8.7932969 17.242188 10.154297 C 17.641188 10.622297 18.358812 10.622297 18.757812 10.154297 C 19.916813 8.7932969 22 6.062 22 4 C 22 1.791 20.209 0 18 0 z M 18 2.5703125 C 18.789 2.5703125 19.429688 3.211 19.429688 4 C 19.429688 4.789 18.789 5.4296875 18 5.4296875 C 17.211 5.4296875 16.570312 4.789 16.570312 4 C 16.570312 3.211 17.211 2.5703125 18 2.5703125 z M 8.9726562 3.0644531 C 8.7399063 3.0713281 8.5085625 3.1195313 8.2890625 3.2070312 L 4.2578125 4.8203125 C 3.4988125 5.1243125 3 5.8597344 3 6.6777344 L 3 18.521484 C 3 19.936484 4.4281875 20.903906 5.7421875 20.378906 L 9.03125 19.064453 L 14.337891 20.832031 C 14.786891 20.982031 15.273891 20.967969 15.712891 20.792969 L 19.742188 19.179688 C 20.501188 18.876688 21 18.140266 21 17.322266 L 21 10.585938 C 20.308 11.465937 19.6965 12.122625 19.4375 12.390625 C 18.6515 13.204625 17.346547 13.204625 16.560547 12.390625 C 16.301547 12.122625 15.690047 11.465938 14.998047 10.585938 L 14.998047 17.541016 C 14.998047 18.222016 14.332547 18.703234 13.685547 18.490234 L 9.6855469 17.173828 C 9.2765469 17.037828 9 16.653656 9 16.222656 L 9 6.4550781 C 9 5.7750781 9.6645469 5.2948594 10.310547 5.5058594 L 12.427734 6.1972656 C 12.165734 5.4612656 12 4.718 12 4 C 12 3.982 12.003906 3.9652656 12.003906 3.9472656 L 9.6640625 3.1679688 C 9.4395625 3.0929687 9.2054062 3.0575781 8.9726562 3.0644531 z"
/>
</svg>
<span>Карта території</span>
</a>
</div>
<details id="details-personal-territory" open style="display: none">
<summary> <summary>
<span>Території для опрацювання</span> <span>Території для опрацювання</span>
</summary> </summary>
@@ -7,7 +21,7 @@
<div id="home-personal-territory-list"></div> <div id="home-personal-territory-list"></div>
</details> </details>
<details id="details-group-territory" open style="display: none;"> <details id="details-group-territory" open style="display: none">
<summary> <summary>
<span>Групові території</span> <span>Групові території</span>
</summary> </summary>

View File

@@ -128,7 +128,7 @@ const Home = {
card.className = "card"; card.className = "card";
card.innerHTML = ` card.innerHTML = `
<i style="background-image: url(https://sheep-service.com/cards/${type}/${type === "house" ? "T" : "H"}${el.id}.webp);"></i> <i style="background-image: url(${CONFIG.web}cards/${type}/${type === "house" ? "T" : "H"}${el.id}.webp);"></i>
<div class="contents"> <div class="contents">
<div class="info"> <div class="info">
<div><p>${el.title} ${el.number}</p></div> <div><p>${el.title} ${el.number}</p></div>

View File

@@ -5,6 +5,47 @@
margin: 20px 20px 0 20px; margin: 20px 20px 0 20px;
} }
.page-home>.buttons-list {
padding: 10px;
margin-bottom: 40px;
background: var(--ColorThemes1);
color: var(--ColorThemes3);
border: 1px solid var(--ColorThemes2);
box-shadow: var(--shadow-l1);
border-radius: var(--border-radius);
overflow: auto;
display: flex;
}
.page-home>.buttons-list>button,
.page-home>.buttons-list>a {
cursor: pointer;
border-radius: calc(var(--border-radius) - 5px);
padding: 0 10px;
margin-right: 20px;
min-width: fit-content;
min-height: 40px;
background: var(--PrimaryColor);
display: flex;
align-items: center;
justify-content: center;
}
.page-home>.buttons-list>button>span,
.page-home>.buttons-list>a>span {
color: var(--PrimaryColorText);
font-size: var(--FontSize3);
font-weight: normal;
}
.page-home>.buttons-list>button>svg,
.page-home>.buttons-list>a>svg {
width: 20px;
height: 20px;
fill: var(--PrimaryColorText);
margin-right: 10px;
}
.page-home details { .page-home details {
border-radius: var(--border-radius); border-radius: var(--border-radius);
width: 100%; width: 100%;
@@ -71,7 +112,7 @@
margin: 10px; margin: 10px;
overflow: hidden; overflow: hidden;
cursor: pointer; cursor: pointer;
border-radius: 10px; border-radius: calc(var(--border-radius) - 5px);
} }
@media (max-width: 2300px) { @media (max-width: 2300px) {
@@ -121,6 +162,7 @@
background-size: cover; background-size: cover;
background-position: center; background-position: center;
background-color: var(--PrimaryColor); background-color: var(--PrimaryColor);
border-radius: calc(var(--border-radius) - 5px);
} }
.page-home .card>a { .page-home .card>a {
@@ -143,6 +185,7 @@
flex-direction: column; flex-direction: column;
align-items: stretch; align-items: stretch;
justify-content: space-between; justify-content: space-between;
border-radius: calc(var(--border-radius) - 5px);
} }
.page-home .info { .page-home .info {

View File

@@ -0,0 +1,384 @@
<div class="page-schedule-list">
<div class="buttons-list" id="buttons-list"></div>
<div>
<span>Тиждень від 03.10.2025</span>
<div id="list">
<details class="card">
<summary>
<span>Життя і служіння</span>
</summary>
<div>
<div class="column">
<div class="row">
<div class="block_info">
<p class="c0">Ведучий</p>
<h2><span title="Сервісна інформація">1.1</span>Тест</h2>
</div>
<div class="block_info">
<p class="c0">Молитва</p>
<h2><span title="Сервісна інформація">1.2</span>Тест</h2>
</div>
</div>
</div>
<hr>
<div class="column">
<span class="c1">Скарби з Божого слова</span>
<div class="block_info">
<p class="c1">Промова</p>
<h2><span title="Сервісна інформація">2</span>Тест</h2>
</div>
<div class="block_info">
<p class="c1">Перлини</p>
<h2><span title="Сервісна інформація">3</span>Тест</h2>
</div>
</div>
<hr>
<div class="column">
<div class="block_separator">
<p class="c5">Головний зал</p>
<h2><span title="Сервісна інформація">4</span>Тест</h2>
</div>
<div class="block_info">
<p class="c1">Читання Біблії</p>
<h2><span title="Сервісна інформація">5</span>Тест</h2>
</div>
<span class="c2">Вдосконалюймо своє служіння</span>
<div class="block_info">
<p class="c2">Починаємо розмову</p>
<h2><span title="Сервісна інформація">6.1</span>Тест</h2>
<h2><span title="Сервісна інформація">6.2</span>Тест</h2>
</div>
<div class="block_info">
<p class="c2">Розвиваємо інтерес</p>
<h2><span title="Сервісна інформація">7.1</span>Тест</h2>
<h2><span title="Сервісна інформація">7.2</span>Тест</h2>
</div>
<div class="block_info">
<p class="c2">Підготовка учнів</p>
<h2><span title="Сервісна інформація">8.1</span>Тест</h2>
<h2><span title="Сервісна інформація">8.2</span>Тест</h2>
</div>
<div class="block_info">
<p class="c2">Пояснюємо свої переконання</p>
<h2><span title="Сервісна інформація">9.1</span>Тест</h2>
<h2><span title="Сервісна інформація">9.2</span>Тест</h2>
</div>
</div>
<hr>
<div class="column">
<div class="block_separator">
<p class="c5">Додатковий клас</p>
<h2><span title="Сервісна інформація">10</span>Тест</h2>
</div>
<div class="block_info">
<p class="c1">Читання Біблії</p>
<h2><span title="Сервісна інформація">11</span>Тест</h2>
</div>
<span class="c2">Вдосконалюймо своє служіння</span>
<div class="block_info">
<p class="c2">Починаємо розмову</p>
<h2><span title="Сервісна інформація">12.1</span>Тест</h2>
<h2><span title="Сервісна інформація">12.2</span>Тест</h2>
</div>
<div class="block_info">
<p class="c2">Розвиваємо інтерес</p>
<h2><span title="Сервісна інформація">13.1</span>Тест</h2>
<h2><span title="Сервісна інформація">13.2</span>Тест</h2>
</div>
<div class="block_info">
<p class="c2">Підготовка учнів</p>
<h2><span title="Сервісна інформація">14.1</span>Тест</h2>
<h2><span title="Сервісна інформація">14.2</span>Тест</h2>
</div>
<div class="block_info">
<p class="c2">Пояснюємо свої переконання</p>
<h2><span title="Сервісна інформація">15.1</span>Тест</h2>
<h2><span title="Сервісна інформація">15.2</span>Тест</h2>
</div>
</div>
<hr>
<div class="column">
<div class="block_separator">
<p class="c5">Додатковий клас 2</p>
<h2><span title="Сервісна інформація">16</span>Тест</h2>
</div>
<div class="block_info">
<p class="c1">Читання Біблії</p>
<h2><span title="Сервісна інформація">17</span>Тест</h2>
</div>
<span class="c2">Вдосконалюймо своє служіння</span>
<div class="block_info">
<p class="c2">Починаємо розмову</p>
<h2><span title="Сервісна інформація">18.1</span>Тест</h2>
<h2><span title="Сервісна інформація">18.2</span>Тест</h2>
</div>
<div class="block_info">
<p class="c2">Розвиваємо інтерес</p>
<h2><span title="Сервісна інформація">19.1</span>Тест</h2>
<h2><span title="Сервісна інформація">19.2</span>Тест</h2>
</div>
<div class="block_info">
<p class="c2">Підготовка учнів</p>
<h2><span title="Сервісна інформація">20.1</span>Тест</h2>
<h2><span title="Сервісна інформація">20.2</span>Тест</h2>
</div>
<div class="block_info">
<p class="c2">Пояснюємо свої переконання</p>
<h2><span title="Сервісна інформація">21.1</span>Тест</h2>
<h2><span title="Сервісна інформація">21.2</span>Тест</h2>
</div>
</div>
<hr>
<div class="column">
<span class="c3">Християнське життя</span>
<div class="block_info">
<p class="c3">Пункт 1</p>
<h2><span title="Сервісна інформація">22</span>Тест</h2>
</div>
<div class="block_info">
<p class="c3">Пункт 2</p>
<h2><span title="Сервісна інформація">23</span>Тест</h2>
</div>
<div class="block_info">
<p class="c3">Пункт 3</p>
<h2><span title="Сервісна інформація">24</span>Тест</h2>
</div>
<div class="row">
<div class="block_info">
<p class="c3">Вивчення</p>
<h2><span title="Сервісна інформація">25.1</span>Тест</h2>
</div>
<div class="block_info">
<p class="c3">Читець</p>
<h2><span title="Сервісна інформація">25.2</span>Тест</h2>
</div>
</div>
<div class="block_info">
<p class="c3">Молитва</p>
<h2><span title="Сервісна інформація">26</span>Тест</h2>
</div>
</div>
</div>
<div>
<div class="column">
<span class="c5">Прибирання</span>
<div class="block_info">
<p class="c5">Група</p>
<h2>1</h2>
</div>
</div>
</div>
<div>
<div class="column">
<span class="c6">Озвучення</span>
<div class="block_info">
<p class="c6">Сцена</p>
<h2>Тест</h2>
</div>
<div class="block_info">
<p class="c6">Відео</p>
<h2>Тест</h2>
</div>
<div class="block_info">
<p class="c6">Аудіо</p>
<h2>Тест</h2>
</div>
<div class="block_info">
<p class="c6">Мікрофон 1</p>
<h2>Тест</h2>
</div>
<div class="block_info">
<p class="c6">Мікрофон 2</p>
<h2>Тест</h2>
</div>
</div>
</div>
<div>
<div class="column">
<span class="c7">Обслуговування</span>
<div class="block_info">
<p class="c7">Головний вхід</p>
<h2>Тест</h2>
</div>
<div class="block_info">
<p class="c7">Запасний вхід</p>
<h2>Тест</h2>
</div>
</div>
</div>
</details>
<details class="card">
<summary>
<span>Вивчення «Вартової башти»</span>
</summary>
<div>
<div class="column">
<div class="row">
<div class="block_info">
<p class="c4">Ведучий</p>
<h2><span title="Сервісна інформація">30.1</span>Тест</h2>
</div>
<div class="block_info">
<p class="c4">Пісня</p>
<h2><span title="Сервісна інформація">30.2</span>10</h2>
</div>
</div>
<div class="row">
<div class="block_info">
<p class="c4">Молитва</p>
<h2><span title="Сервісна інформація">31</span>Тест</h2>
</div>
</div>
</div>
<hr>
<div class="column">
<div class="block_info">
<p class="c4">Промовець</p>
<h2><span title="Сервісна інформація">32.1</span>Тест</h2>
</div>
<div class="block_info">
<p class="c4">Тема</p>
<h2><span title="Сервісна інформація">32.2</span>Тест</h2>
</div>
</div>
<hr>
<div class="column">
<div class="row">
<div class="block_info">
<p class="c4">Вивчення</p>
<h2><span title="Сервісна інформація">33.1</span>Тест</h2>
</div>
<div class="block_info">
<p class="c4">Читець</p>
<h2><span title="Сервісна інформація">33.2</span>Тест</h2>
</div>
</div>
<div class="block_info">
<p class="c4">Молитва</p>
<h2><span title="Сервісна інформація">34</span>Тест</h2>
</div>
</div>
</div>
<div>
<div class="column">
<span class="c5">Прибирання</span>
<div class="block_info">
<p class="c5">Група</p>
<h2>1</h2>
</div>
</div>
</div>
<div>
<div class="column">
<span class="c6">Озвучення</span>
<div class="block_info">
<p class="c6">Сцена</p>
<h2>Тест</h2>
</div>
<div class="block_info">
<p class="c6">Відео</p>
<h2>Тест</h2>
</div>
<div class="block_info">
<p class="c6">Аудіо</p>
<h2>Тест</h2>
</div>
<div class="block_info">
<p class="c6">Мікрофон 1</p>
<h2>Тест</h2>
</div>
<div class="block_info">
<p class="c6">Мікрофон 2</p>
<h2>Тест</h2>
</div>
</div>
</div>
<div>
<div class="column">
<span class="c7">Обслуговування</span>
<div class="block_info">
<p class="c7">Головний вхід</p>
<h2>Тест</h2>
</div>
<div class="block_info">
<p class="c7">Запасний вхід</p>
<h2>Тест</h2>
</div>
</div>
</div>
</details>
</div>
</div>
</div>

View File

@@ -0,0 +1,8 @@
const Schedule_list = {
init: async () => {
let html = await fetch('/lib/pages/schedule/list/index.html').then((response) => response.text());
app.innerHTML = html;
}
}

View File

@@ -0,0 +1,361 @@
.c0 {
background: var(--C0) !important;
color: #ffffff !important;
}
.c1 {
background: var(--C1) !important;
color: #ffffff !important;
}
.c2 {
background: var(--C2) !important;
color: #ffffff !important;
}
.c3 {
background: var(--C3) !important;
color: #ffffff !important;
}
.c4 {
background: var(--C4) !important;
color: #ffffff !important;
}
.c5 {
background: var(--C5) !important;
color: #ffffff !important;
}
.c6 {
background: var(--C6) !important;
color: #ffffff !important;
}
.c7 {
background: var(--C7) !important;
color: #ffffff !important;
}
.c8 {
background: var(--C8) !important;
color: #ffffff !important;
}
.page-schedule-list {
width: calc(100% - 40px);
display: flex;
flex-direction: column;
align-items: stretch;
margin: 20px 20px 0 20px;
}
.page-schedule-list>.buttons-list {
padding: 10px;
margin-bottom: 40px;
background: var(--ColorThemes1);
color: var(--ColorThemes3);
border: 1px solid var(--ColorThemes2);
box-shadow: var(--shadow-l1);
border-radius: var(--border-radius);
overflow: auto;
display: none;
}
.page-schedule-list>.buttons-list>button,
.page-schedule-list>.buttons-list>a {
cursor: pointer;
border-radius: calc(var(--border-radius) - 5px);
padding: 0 10px;
margin-right: 20px;
min-width: fit-content;
min-height: 40px;
background: var(--PrimaryColor);
display: flex;
align-items: center;
justify-content: center;
}
.page-schedule-list>.buttons-list>button>span,
.page-schedule-list>.buttons-list>a>span {
color: var(--PrimaryColorText);
font-size: var(--FontSize3);
font-weight: normal;
}
.page-schedule-list>.buttons-list>button>svg,
.page-schedule-list>.buttons-list>a>svg {
width: 20px;
height: 20px;
fill: var(--PrimaryColorText);
margin-right: 10px;
}
.page-schedule-list>.list-controls {
padding: 10px;
margin: 0px 0 10px 0;
background: var(--ColorThemes1);
color: var(--ColorThemes3);
border: 1px solid var(--ColorThemes2);
box-shadow: var(--shadow-l1);
border-radius: var(--border-radius);
overflow: auto;
display: flex;
}
.page-schedule-list>.list-controls>select {
min-width: 140px;
height: 30px;
background-color: var(--ColorThemes2);
border: 1px solid var(--ColorThemes0);
box-shadow: var(--shadow-l1);
color: var(--ColorThemes3);
font-size: var(--FontSize1);
cursor: pointer;
padding: 0 5px;
margin-right: 10px;
border-radius: calc(var(--border-radius) - 5px - 2px);
}
.page-schedule-list>div {
border-radius: var(--border-radius);
width: 100%;
display: flex;
flex-direction: column;
align-items: stretch;
margin-bottom: 10px;
background: var(--ColorThemes1);
color: var(--ColorThemes3);
border: 1px solid var(--ColorThemes2);
box-shadow: var(--shadow-l1);
}
.page-schedule-list>div>span {
width: calc(100% - 40px);
color: var(--ColorThemes3);
border-radius: var(--border-radius);
font-size: var(--FontSize5);
padding: 20px 20px 10px 20px;
position: relative;
font-weight: 500;
}
.page-schedule-list>div>#list {
width: 100%;
margin: 0;
display: flex;
flex-wrap: wrap;
flex-direction: row;
align-content: flex-start;
justify-content: center;
overflow-y: auto;
align-items: flex-start;
transition: .3s ease;
}
.page-schedule-list>div>#list>.mess-list {
height: 200px;
display: none;
flex-direction: column;
align-items: center;
justify-content: space-evenly;
}
.page-schedule-list>div>#list>.mess-list[data-visible="true"] {
display: flex;
}
.page-schedule-list>div>#list>.mess-list>svg {
width: 100px;
height: 100px;
fill: var(--ColorThemes3);
opacity: 0.7;
}
.page-schedule-list>div>#list>.mess-list>h3 {
font-size: var(--FontSize5);
color: var(--ColorThemes3);
opacity: 0.7;
}
.page-schedule-list>div>#list>.card {
position: relative;
width: 100%;
height: fit-content;
background-color: var(--ColorThemes2);
margin: 10px;
overflow: auto;
border-radius: calc(var(--border-radius) - 5px);
}
.page-schedule-list>div>#list>.card>summary {
width: calc(100% - 40px);
cursor: pointer;
color: var(--ColorThemes3);
border-radius: var(--border-radius);
font-size: var(--FontSize5);
padding: 20px;
position: relative;
display: flex;
justify-content: space-between;
align-items: center;
}
.page-schedule-list>div>#list>.card>summary>span {
font-weight: 500;
width: 100%;
}
.page-schedule-list>div>#list>.card>div {
border: 2px solid var(--ColorThemes3);
margin: 10px;
border-radius: calc(var(--border-radius) - 5px);
width: calc(100% - 24px);
min-width: fit-content;
}
.page-schedule-list .column {
background: var(--ColorThemes1);
border-radius: calc(var(--border-radius) - 5px - 2px);
margin: 10px;
text-align: left;
display: flex;
justify-content: space-between;
flex-direction: column;
}
.page-schedule-list hr {
margin: 10px;
}
.page-schedule-list .column>span {
font-size: var(--FontSize5);
color: var(--ColorThemes3);
background: var(--ColorThemes0);
width: calc(100% - 10px);
padding: 5px 0;
text-align: center;
margin: 5px;
border-radius: calc(var(--border-radius) - 5px - 5px);
}
.page-schedule-list .block_info {
display: flex;
flex-direction: row;
width: 100%;
}
.page-schedule-list .column .block_info>p {
font-size: var(--FontSize4);
color: var(--ColorThemes3);
background: var(--C0);
padding: 5px 10px;
min-width: 110px;
height: auto;
display: flex;
align-items: center;
justify-content: center;
margin: 5px;
border-radius: calc(var(--border-radius) - 5px - 5px);
text-align: center;
}
.page-schedule-list .column .block_info>h2 {
font-size: var(--FontSize3);
color: var(--ColorThemes3);
background: var(--ColorThemes0);
width: 100%;
min-width: 150px;
min-height: 30px;
display: flex;
align-items: center;
justify-content: center;
margin: 5px;
border-radius: calc(var(--border-radius) - 5px - 5px);
position: relative;
}
.page-schedule-list .column .block_info>h2>span{
position: absolute;
left: 5px;
min-width: 10px;
padding: 5px;
height: calc(100% - 20px);
background: var(--PrimaryColor);
color: var(--PrimaryColorText);
display: flex;
align-items: center;
justify-content: center;
border-radius: calc(var(--border-radius) - 12px);
font-size: var(--FontSize1);
cursor: help;
}
.page-schedule-list .column .block_separator {
display: flex;
flex-direction: row;
width: 100%;
}
.page-schedule-list .column .block_separator>p {
font-size: var(--FontSize5);
color: var(--ColorThemes3);
background: var(--C1);
width: 100%;
padding: 5px 10px;
min-width: 110px;
min-height: 30px;
display: flex;
align-items: center;
justify-content: center;
margin: 5px;
border-radius: calc(var(--border-radius) - 5px - 2px);
text-align: center;
}
.page-schedule-list .column .block_separator>h2 {
font-size: var(--FontSize3);
color: var(--ColorThemes3);
background: var(--ColorThemes0);
width: 100%;
padding: 5px 10px;
min-width: 200px;
min-height: 30px;
display: flex;
align-items: center;
justify-content: center;
margin: 5px;
border-radius: calc(var(--border-radius) - 5px - 2px);
text-align: center;
position: relative;
}
.page-schedule-list .column .block_separator>h2>span{
position: absolute;
left: 5px;
min-width: 10px;
padding: 5px;
height: calc(100% - 20px);
background: var(--PrimaryColor);
color: var(--PrimaryColorText);
display: flex;
align-items: center;
justify-content: center;
border-radius: calc(var(--border-radius) - 12px);
font-size: var(--FontSize1);
cursor: help;
}
@media (min-width: 800px) {
.page-schedule-list .column>.row {
display: flex;
justify-content: space-between;
flex-direction: row;
}
.page-schedule-list .column>.row>.block_info:nth-child(2n) {
margin-left: 10px;
}
}

View File

@@ -1,8 +0,0 @@
const Schedule = {
init: async () => {
let html = await fetch('/lib/pages/schedule/index.html').then((response) => response.text());
app.innerHTML = html;
}
}

View File

@@ -321,7 +321,7 @@ const Stand_card = {
textContent: `${formattedDate(timestamp)}${formattedDayName(timestamp)}` textContent: `${formattedDate(timestamp)}${formattedDayName(timestamp)}`
})); }));
const step = day[1]?.[0]?.hour - day[0]?.[0]?.hour || 0.5; // крок між інтервалами const step = day[1]?.[0]?.hour - day[0]?.[0]?.hour || Stand_card.info.list.processing_time; // крок між інтервалами
day.forEach((hour, hourIndex) => { day.forEach((hour, hourIndex) => {
const hourDiv = Object.assign(document.createElement("div"), { const hourDiv = Object.assign(document.createElement("div"), {

View File

@@ -1,9 +1,13 @@
const Stand_list = { const Stand_list = {
list: [], list: [],
renderIndex: 0,
init: async () => { init: async () => {
let html = await fetch('/lib/pages/stand/list/index.html').then((response) => response.text()); let html = await fetch('/lib/pages/stand/list/index.html').then((response) => response.text());
app.innerHTML = html; app.innerHTML = html;
Stand_list.renderIndex = 0;
Stand_list.setHTML(); Stand_list.setHTML();
if (USER.possibilities.can_add_stand) { if (USER.possibilities.can_add_stand) {
@@ -11,6 +15,7 @@ const Stand_list = {
document.getElementById("constructorButton").style.display = ""; document.getElementById("constructorButton").style.display = "";
} }
}, },
loadAPI: async function (url) { loadAPI: async function (url) {
const uuid = localStorage.getItem("uuid"); const uuid = localStorage.getItem("uuid");
const response = await fetch(url, { const response = await fetch(url, {
@@ -23,6 +28,7 @@ const Stand_list = {
Stand_list.list = await response.json(); Stand_list.list = await response.json();
return Stand_list.list; return Stand_list.list;
}, },
setHTML: async function () { setHTML: async function () {
const block = document.getElementById('list'); const block = document.getElementById('list');
const null_list = document.getElementById('null-list'); const null_list = document.getElementById('null-list');
@@ -52,12 +58,12 @@ const Stand_list = {
block.innerHTML = html; block.innerHTML = html;
} }
}, },
renderCard: ({ element, pack=0 }) => {
const images = [ renderCard: ({ element }) => {
['stand_1.png', 'stand_2.png', 'stand_3.png'], const imagesList = ['1.png', '2.png', '3.png', '4.png', '5.png', '6.png', '7.png', '8.png'];
['stand_4.png', 'stand_5.png'] // const randomImage = images[Math.floor(Math.random() * images.length)];
]; const image = imagesList[Stand_list.renderIndex % imagesList.length];
const randomImage = images[pack][Math.floor(Math.random() * images[pack].length)]; Stand_list.renderIndex++;
const editor = USER.possibilities.can_add_stand const editor = USER.possibilities.can_add_stand
? `<a id="editor_button" class="button-edit" data-route title="Змінити графік" href="/stand/editor/${element.id}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M 22.828125 3 C 22.316375 3 21.804562 3.1954375 21.414062 3.5859375 L 19 6 L 24 11 L 26.414062 8.5859375 C 27.195062 7.8049375 27.195062 6.5388125 26.414062 5.7578125 L 24.242188 3.5859375 C 23.851688 3.1954375 23.339875 3 22.828125 3 z M 17 8 L 5.2597656 19.740234 C 5.2597656 19.740234 6.1775313 19.658 6.5195312 20 C 6.8615312 20.342 6.58 22.58 7 23 C 7.42 23.42 9.6438906 23.124359 9.9628906 23.443359 C 10.281891 23.762359 10.259766 24.740234 10.259766 24.740234 L 22 13 L 17 8 z M 4 23 L 3.0566406 25.671875 A 1 1 0 0 0 3 26 A 1 1 0 0 0 4 27 A 1 1 0 0 0 4.328125 26.943359 A 1 1 0 0 0 4.3378906 26.939453 L 4.3632812 26.931641 A 1 1 0 0 0 4.3691406 26.927734 L 7 26 L 5.5 24.5 L 4 23 z"></path></svg></a>` ? `<a id="editor_button" class="button-edit" data-route title="Змінити графік" href="/stand/editor/${element.id}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M 22.828125 3 C 22.316375 3 21.804562 3.1954375 21.414062 3.5859375 L 19 6 L 24 11 L 26.414062 8.5859375 C 27.195062 7.8049375 27.195062 6.5388125 26.414062 5.7578125 L 24.242188 3.5859375 C 23.851688 3.1954375 23.339875 3 22.828125 3 z M 17 8 L 5.2597656 19.740234 C 5.2597656 19.740234 6.1775313 19.658 6.5195312 20 C 6.8615312 20.342 6.58 22.58 7 23 C 7.42 23.42 9.6438906 23.124359 9.9628906 23.443359 C 10.281891 23.762359 10.259766 24.740234 10.259766 24.740234 L 22 13 L 17 8 z M 4 23 L 3.0566406 25.671875 A 1 1 0 0 0 3 26 A 1 1 0 0 0 4 27 A 1 1 0 0 0 4.328125 26.943359 A 1 1 0 0 0 4.3378906 26.939453 L 4.3632812 26.931641 A 1 1 0 0 0 4.3691406 26.927734 L 7 26 L 5.5 24.5 L 4 23 z"></path></svg></a>`
@@ -67,7 +73,7 @@ const Stand_list = {
<div class="card"> <div class="card">
<div class="contents"> <div class="contents">
<div class="image"> <div class="image">
<img src="/img/${randomImage}"> <img src="/img/stand/${image}">
</div> </div>
<div class="info"> <div class="info">
<div> <div>

View File

@@ -59,7 +59,7 @@
display: flex; display: flex;
} }
.page-stand-list>.list-controls select { .page-stand-list>.list-controls>select {
min-width: 140px; min-width: 140px;
height: 30px; height: 30px;
background-color: var(--ColorThemes2); background-color: var(--ColorThemes2);
@@ -73,7 +73,7 @@
border-radius: calc(var(--border-radius) - 5px - 2px); border-radius: calc(var(--border-radius) - 5px - 2px);
} }
.page-stand-list details { .page-stand-list>details {
border-radius: var(--border-radius); border-radius: var(--border-radius);
width: 100%; width: 100%;
display: flex; display: flex;
@@ -86,19 +86,19 @@
box-shadow: var(--shadow-l1); box-shadow: var(--shadow-l1);
} }
.page-stand-list>details[disabled] summary, .page-stand-list>details[disabled]>summary,
.page-stand-list>details.disabled summary { .page-stand-list>details.disabled>summary {
pointer-events: none; pointer-events: none;
user-select: none; user-select: none;
} }
.page-stand-list>details summary::-webkit-details-marker, .page-stand-list>details>summary::-webkit-details-marker,
.page-stand-list>details summary::marker { .page-stand-list>details>summary::marker {
display: none; display: none;
content: ""; content: "";
} }
.page-stand-list summary { .page-stand-list>details>summary {
width: calc(100% - 40px); width: calc(100% - 40px);
cursor: pointer; cursor: pointer;
color: var(--ColorThemes3); color: var(--ColorThemes3);
@@ -111,12 +111,12 @@
align-items: center; align-items: center;
} }
.page-stand-list summary span { .page-stand-list>details>summary>span {
font-weight: 500; font-weight: 500;
width: 100%; width: 100%;
} }
.page-stand-list #list { .page-stand-list>details>#list {
width: 100%; width: 100%;
margin: 0; margin: 0;
display: flex; display: flex;
@@ -129,7 +129,7 @@
transition: .3s ease; transition: .3s ease;
} }
.page-stand-list #list>.mess-list { .page-stand-list>details>#list>.mess-list {
height: 200px; height: 200px;
display: none; display: none;
flex-direction: column; flex-direction: column;
@@ -137,24 +137,24 @@
justify-content: space-evenly; justify-content: space-evenly;
} }
.page-stand-list #list>.mess-list[data-visible="true"] { .page-stand-list>details>#list>.mess-list[data-visible="true"] {
display: flex; display: flex;
} }
.page-stand-list #list>.mess-list>svg { .page-stand-list>details>#list>.mess-list>svg {
width: 100px; width: 100px;
height: 100px; height: 100px;
fill: var(--ColorThemes3); fill: var(--ColorThemes3);
opacity: 0.7; opacity: 0.7;
} }
.page-stand-list #list>.mess-list>h3 { .page-stand-list>details>#list>.mess-list>h3 {
font-size: var(--FontSize5); font-size: var(--FontSize5);
color: var(--ColorThemes3); color: var(--ColorThemes3);
opacity: 0.7; opacity: 0.7;
} }
.page-stand-list .card { .page-stand-list>details>#list>.card {
position: relative; position: relative;
width: 300px; width: 300px;
height: 200px; height: 200px;
@@ -166,42 +166,42 @@
} }
@media (max-width: 2300px) { @media (max-width: 2300px) {
.page-stand-list .card { .page-stand-list>details>#list>.card {
width: calc((100% / 5) - 40px); width: calc((100% / 5) - 40px);
} }
} }
@media (max-width: 1960px) { @media (max-width: 1960px) {
.page-stand-list .card { .page-stand-list>details>#list>.card {
width: calc((100% / 4) - 40px); width: calc((100% / 4) - 40px);
} }
} }
@media (max-width: 1640px) { @media (max-width: 1640px) {
.page-stand-list .card { .page-stand-list>details>#list>.card {
width: calc((100% / 3) - 40px); width: calc((100% / 3) - 40px);
} }
} }
@media (max-width: 1280px) { @media (max-width: 1280px) {
.page-stand-list .card { .page-stand-list>details>#list>.card {
width: calc((100% / 2) - 40px); width: calc((100% / 2) - 40px);
} }
} }
@media (max-width: 650px) { @media (max-width: 650px) {
.page-stand-list .card { .page-stand-list>details>#list>.card {
width: 100%; width: 100%;
} }
} }
@media(hover: hover) { @media(hover: hover) {
.page-stand-list .card:hover { .page-stand-list>details>#list>.card:hover {
opacity: 0.8; opacity: 0.8;
} }
} }
.page-stand-list .card>i { .page-stand-list>details>#list>.card>i {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
@@ -214,7 +214,7 @@
background-color: var(--PrimaryColor); background-color: var(--PrimaryColor);
} }
.page-stand-list .card>a { .page-stand-list>details>#list>.card>a {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
@@ -222,7 +222,7 @@
} }
.page-stand-list .card>.contents { .page-stand-list>details>#list>.card>.contents {
position: absolute; position: absolute;
background: rgb(64 64 64 / 0.7); background: rgb(64 64 64 / 0.7);
width: 100%; width: 100%;
@@ -236,25 +236,27 @@
justify-content: space-between; justify-content: space-between;
} }
.page-stand-list .card>.contents>.image { .page-stand-list>details>#list>.card>.contents>.image {
position: absolute; position: absolute;
width: 100%; width: 100%;
border-radius: calc(var(--border-radius) - 5px);
} }
.page-stand-list .card>.contents>.image>img { .page-stand-list>details>#list>.card>.contents>.image>img {
width: 100%; width: 100%;
height: 200px; height: 200px;
object-fit: cover; object-fit: cover;
filter: brightness(0.9) contrast(80%) saturate(110%) drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3)); filter: brightness(0.9) contrast(80%) saturate(110%) drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
border-radius: calc(var(--border-radius) - 5px);
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
.page-stand-list .card>.contents>.image>img { .page-stand-list>details>#list>.card>.contents>.image>img {
filter: brightness(0.6) contrast(80%) saturate(110%) drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3)); filter: brightness(0.6) contrast(80%) saturate(110%) drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
} }
} }
.page-stand-list .card>.contents>.info { .page-stand-list>details>#list>.card>.contents>.info {
width: calc(100% - 20px); width: calc(100% - 20px);
position: absolute; position: absolute;
bottom: 0; bottom: 0;
@@ -262,7 +264,7 @@
display: flex; display: flex;
} }
.page-stand-list .card>.contents>.info>div { .page-stand-list>details>#list>.card>.contents>.info>div {
width: 100%; width: 100%;
height: 35px; height: 35px;
display: flex; display: flex;
@@ -277,14 +279,14 @@
box-shadow: var(--shadow-l1); box-shadow: var(--shadow-l1);
} }
.page-stand-list .card>.contents>.info>div>span { .page-stand-list>details>#list>.card>.contents>.info>div>span {
color: var(--ColorThemes3); color: var(--ColorThemes3);
font-size: var(--FontSize3); font-size: var(--FontSize3);
font-weight: 300; font-weight: 300;
z-index: 2; z-index: 2;
} }
.page-stand-list .card>.contents>.info>div>p { .page-stand-list>details>#list>.card>.contents>.info>div>p {
color: var(--ColorThemes3); color: var(--ColorThemes3);
font-size: var(--FontSize3); font-size: var(--FontSize3);
font-weight: 400; font-weight: 400;
@@ -292,7 +294,7 @@
z-index: 2; z-index: 2;
} }
.page-stand-list .card>.contents>.info>.button-edit { .page-stand-list>details>#list>.card>.contents>.info>.button-edit {
min-width: 35px; min-width: 35px;
height: 35px; height: 35px;
border-radius: calc(var(--border-radius) - 5px - 4px); border-radius: calc(var(--border-radius) - 5px - 4px);
@@ -306,7 +308,7 @@
box-shadow: var(--shadow-l1); box-shadow: var(--shadow-l1);
} }
.page-stand-list .card>.contents>.info>.button-edit>svg { .page-stand-list>details>#list>.card>.contents>.info>.button-edit>svg {
width: 20px; width: 20px;
height: 20px; height: 20px;
fill: var(--PrimaryColorText); fill: var(--PrimaryColorText);

View File

@@ -893,8 +893,8 @@ const Territory_constructor = {
.then(data => { .then(data => {
console.log(data); console.log(data);
Territory.house.list = []; Territory_list.house.list = [];
Territory.homestead.list = []; Territory_list.homestead.list = [];
Router.navigate(`/territory/manager/${Territory_constructor.info.type}/${data.id}`); Router.navigate(`/territory/manager/${Territory_constructor.info.type}/${data.id}`);
setTimeout(() => { setTimeout(() => {

View File

@@ -73,3 +73,7 @@
padding: 10px; padding: 10px;
border-radius: 8px; border-radius: 8px;
} }
.page-territory_history>#list>.card>.description>p {
color: var(--ColorThemes3);
font-size: var(--FontSize2);
}

View File

@@ -36,11 +36,24 @@
</svg> </svg>
<span>Історія служіння</span> <span>Історія служіння</span>
</a> </a>
<a href="/territory/map" data-route id="mapButton">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path
d="M 18 0 C 15.791 0 14 1.791 14 4 C 14 6.062 16.082187 8.7932969 17.242188 10.154297 C 17.641188 10.622297 18.358812 10.622297 18.757812 10.154297 C 19.916813 8.7932969 22 6.062 22 4 C 22 1.791 20.209 0 18 0 z M 18 2.5703125 C 18.789 2.5703125 19.429688 3.211 19.429688 4 C 19.429688 4.789 18.789 5.4296875 18 5.4296875 C 17.211 5.4296875 16.570312 4.789 16.570312 4 C 16.570312 3.211 17.211 2.5703125 18 2.5703125 z M 8.9726562 3.0644531 C 8.7399063 3.0713281 8.5085625 3.1195313 8.2890625 3.2070312 L 4.2578125 4.8203125 C 3.4988125 5.1243125 3 5.8597344 3 6.6777344 L 3 18.521484 C 3 19.936484 4.4281875 20.903906 5.7421875 20.378906 L 9.03125 19.064453 L 14.337891 20.832031 C 14.786891 20.982031 15.273891 20.967969 15.712891 20.792969 L 19.742188 19.179688 C 20.501188 18.876688 21 18.140266 21 17.322266 L 21 10.585938 C 20.308 11.465937 19.6965 12.122625 19.4375 12.390625 C 18.6515 13.204625 17.346547 13.204625 16.560547 12.390625 C 16.301547 12.122625 15.690047 11.465938 14.998047 10.585938 L 14.998047 17.541016 C 14.998047 18.222016 14.332547 18.703234 13.685547 18.490234 L 9.6855469 17.173828 C 9.2765469 17.037828 9 16.653656 9 16.222656 L 9 6.4550781 C 9 5.7750781 9.6645469 5.2948594 10.310547 5.5058594 L 12.427734 6.1972656 C 12.165734 5.4612656 12 4.718 12 4 C 12 3.982 12.003906 3.9652656 12.003906 3.9472656 L 9.6640625 3.1679688 C 9.4395625 3.0929687 9.2054062 3.0575781 8.9726562 3.0644531 z"
/>
</svg>
<span>Карта території</span>
</a>
</div> </div>
<div class="list-controls"> <div class="list-controls">
<div id="page-territory-sort"> <div id="page-territory-sort">
<button id="sort_1" onclick="Territory_list.sort('2')" data-state="active"> <button
id="sort_1"
onclick="Territory_list.sort('2')"
data-state="active"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
<path <path
d="M 32.476562 5.9785156 A 1.50015 1.50015 0 0 0 31 7.5 L 31 37.878906 L 26.560547 33.439453 A 1.50015 1.50015 0 1 0 24.439453 35.560547 L 31.439453 42.560547 A 1.50015 1.50015 0 0 0 33.560547 42.560547 L 40.560547 35.560547 A 1.50015 1.50015 0 1 0 38.439453 33.439453 L 34 37.878906 L 34 7.5 A 1.50015 1.50015 0 0 0 32.476562 5.9785156 z M 14.375 8.0058594 C 14.257547 8.01575 14.139641 8.0379219 14.025391 8.0761719 L 11.025391 9.0761719 C 10.239391 9.3381719 9.8141719 10.188609 10.076172 10.974609 C 10.338172 11.760609 11.190609 12.188828 11.974609 11.923828 L 13 11.580078 L 13 20.5 C 13 21.329 13.671 22 14.5 22 C 15.329 22 16 21.329 16 20.5 L 16 9.5 C 16 9.018 15.767953 8.5652031 15.376953 8.2832031 C 15.082953 8.0717031 14.727359 7.9761875 14.375 8.0058594 z M 14 27 C 11.344 27 9.387625 28.682109 9.015625 31.287109 C 8.898625 32.107109 9.4671094 32.867375 10.287109 32.984375 C 11.106109 33.102375 11.867375 32.533891 11.984375 31.712891 C 12.096375 30.931891 12.537 30 14 30 C 15.103 30 16 30.897 16 32 C 16 33.103 15.103 34 14 34 C 11.592 34 9 35.721 9 39.5 C 9 40.329 9.672 41 10.5 41 L 17.5 41 C 18.329 41 19 40.329 19 39.5 C 19 38.671 18.329 38 17.5 38 L 12.308594 38 C 12.781594 37.093 13.664 37 14 37 C 16.757 37 19 34.757 19 32 C 19 29.243 16.757 27 14 27 z" d="M 32.476562 5.9785156 A 1.50015 1.50015 0 0 0 31 7.5 L 31 37.878906 L 26.560547 33.439453 A 1.50015 1.50015 0 1 0 24.439453 35.560547 L 31.439453 42.560547 A 1.50015 1.50015 0 0 0 33.560547 42.560547 L 40.560547 35.560547 A 1.50015 1.50015 0 1 0 38.439453 33.439453 L 34 37.878906 L 34 7.5 A 1.50015 1.50015 0 0 0 32.476562 5.9785156 z M 14.375 8.0058594 C 14.257547 8.01575 14.139641 8.0379219 14.025391 8.0761719 L 11.025391 9.0761719 C 10.239391 9.3381719 9.8141719 10.188609 10.076172 10.974609 C 10.338172 11.760609 11.190609 12.188828 11.974609 11.923828 L 13 11.580078 L 13 20.5 C 13 21.329 13.671 22 14.5 22 C 15.329 22 16 21.329 16 20.5 L 16 9.5 C 16 9.018 15.767953 8.5652031 15.376953 8.2832031 C 15.082953 8.0717031 14.727359 7.9761875 14.375 8.0058594 z M 14 27 C 11.344 27 9.387625 28.682109 9.015625 31.287109 C 8.898625 32.107109 9.4671094 32.867375 10.287109 32.984375 C 11.106109 33.102375 11.867375 32.533891 11.984375 31.712891 C 12.096375 30.931891 12.537 30 14 30 C 15.103 30 16 30.897 16 32 C 16 33.103 15.103 34 14 34 C 11.592 34 9 35.721 9 39.5 C 9 40.329 9.672 41 10.5 41 L 17.5 41 C 18.329 41 19 40.329 19 39.5 C 19 38.671 18.329 38 17.5 38 L 12.308594 38 C 12.781594 37.093 13.664 37 14 37 C 16.757 37 19 34.757 19 32 C 19 29.243 16.757 27 14 27 z"

View File

@@ -8,11 +8,9 @@ const Territory_list = {
selectStatus.value = territory_list_filter; selectStatus.value = territory_list_filter;
if (USER.mode == 2) { if (USER.mode == 2) {
document.getElementById("buttons-list").style.display = "flex";
document.getElementById("historyButton").style.display = ""; document.getElementById("historyButton").style.display = "";
} }
if (USER.possibilities.can_add_territory) { if (USER.possibilities.can_add_territory) {
document.getElementById("buttons-list").style.display = "flex";
document.getElementById("constructorButton").style.display = ""; document.getElementById("constructorButton").style.display = "";
} }
@@ -64,11 +62,14 @@ const Territory_list = {
const url = `${CONFIG.api}houses/list${territory_entrances ? '/entrances' : ''}`; const url = `${CONFIG.api}houses/list${territory_entrances ? '/entrances' : ''}`;
let list = this.list.length > 0 ? this.list : await this.loadAPI(url); let list = this.list.length > 0 ? this.list : await this.loadAPI(url);
const isEnd = territory_list_filter === "2";
const field = isEnd ? "end" : "start";
const compare = { const compare = {
"1": (a, b) => this.compareAB(a, b, territory_entrances, 'asc'), "1": (a, b) => this.compareAB(a, b, territory_entrances, 'asc'),
"2": (a, b) => this.compareAB(a, b, territory_entrances, 'desc'), "2": (a, b) => this.compareAB(a, b, territory_entrances, 'desc'),
"3": (a, b) => a.history?.date?.start - b.history?.date?.start, "3": (a, b) => (a.history?.date?.[field] ?? 0) - (b.history?.date?.[field] ?? 0),
"4": (a, b) => b.history?.date?.start - a.history?.date?.start, "4": (a, b) => (b.history?.date?.[field] ?? 0) - (a.history?.date?.[field] ?? 0),
}[sort_mode] ?? ((a, b) => a.id - b.id); }[sort_mode] ?? ((a, b) => a.id - b.id);
list.sort(compare); list.sort(compare);
@@ -120,7 +121,7 @@ const Territory_list = {
return ` return `
<div class="card"> <div class="card">
<i style="background-image: url(https://sheep-service.com/cards/house/T${element.house.id}.webp);"></i> <i style="background-image: url(${CONFIG.web}cards/house/T${element.house.id}.webp);"></i>
<div class="contents"> <div class="contents">
<div class="info"> <div class="info">
<div> <div>
@@ -140,7 +141,7 @@ const Territory_list = {
const progress = ((work / qty) * 100).toFixed(1); const progress = ((work / qty) * 100).toFixed(1);
return ` return `
<div class="card"> <div class="card">
<i style="background-image: url(https://sheep-service.com/cards/house/T${element.id}.webp);"></i> <i style="background-image: url(${CONFIG.web}cards/house/T${element.id}.webp);"></i>
<div class="contents"> <div class="contents">
<div class="info"> <div class="info">
<div> <div>
@@ -225,7 +226,7 @@ const Territory_list = {
return ` return `
<div class="card"> <div class="card">
<i style="background-image: url(https://sheep-service.com/cards/homestead/H${element.id}.webp);"></i> <i style="background-image: url(${CONFIG.web}cards/homestead/H${element.id}.webp);"></i>
<div class="contents"> <div class="contents">
<div class="info"> <div class="info">
<div> <div>

View File

@@ -15,7 +15,7 @@
box-shadow: var(--shadow-l1); box-shadow: var(--shadow-l1);
border-radius: var(--border-radius); border-radius: var(--border-radius);
overflow: auto; overflow: auto;
display: none; display: flex;
} }
.page-territory>.buttons-list>button, .page-territory>.buttons-list>button,
@@ -272,6 +272,7 @@
background-size: cover; background-size: cover;
background-position: center; background-position: center;
background-color: var(--PrimaryColor); background-color: var(--PrimaryColor);
border-radius: calc(var(--border-radius) - 5px);
} }
.page-territory .card>a { .page-territory .card>a {
@@ -294,6 +295,7 @@
flex-direction: column; flex-direction: column;
align-items: stretch; align-items: stretch;
justify-content: space-between; justify-content: space-between;
border-radius: calc(var(--border-radius) - 5px);
} }

View File

@@ -175,22 +175,29 @@ const Territory_Manager = {
</div> </div>
`; `;
const renderFree = (element, i = 0) => ` const renderFree = (element, i = 0) => {
<div class="entrance"> let name = () => {
<div id="title"> if(element.history.name == "Групова") return `Групова №${element.history.group_id}`
<h1>${element.title ?? ''}</h1> else return element.history.name ?? "..."
<a href="/territory/card/${type}/${id}" title="Редактор квартир" data-route> }
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M 12.5 6 C 8.9280619 6 6 8.9280619 6 12.5 L 6 35.5 C 6 39.071938 8.9280619 42 12.5 42 L 35.5 42 C 39.071938 42 42 39.071938 42 35.5 L 42 12.5 C 42 8.9280619 39.071938 6 35.5 6 L 12.5 6 z M 12.5 9 L 14 9 L 14 15 L 9 15 L 9 12.5 C 9 10.549938 10.549938 9 12.5 9 z M 17 9 L 35.5 9 C 37.450062 9 39 10.549938 39 12.5 L 39 15 L 17 15 L 17 9 z M 9 18 L 14 18 L 14 23 L 9 23 L 9 18 z M 17 18 L 39 18 L 39 23 L 17 23 L 17 18 z M 9 26 L 14 26 L 14 31 L 9 31 L 9 26 z M 17 26 L 39 26 L 39 31 L 17 31 L 17 26 z M 9 34 L 14 34 L 14 39 L 12.5 39 C 10.549938 39 9 37.450062 9 35.5 L 9 34 z M 17 34 L 39 34 L 39 35.5 C 39 37.450062 37.450062 39 35.5 39 L 17 39 L 17 34 z"/></svg>
</a> return `
<div class="entrance">
<div id="title">
<h1>${element.title ?? ''}</h1>
<a href="/territory/card/${type}/${id}" title="Редактор квартир" data-route>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M 12.5 6 C 8.9280619 6 6 8.9280619 6 12.5 L 6 35.5 C 6 39.071938 8.9280619 42 12.5 42 L 35.5 42 C 39.071938 42 42 39.071938 42 35.5 L 42 12.5 C 42 8.9280619 39.071938 6 35.5 6 L 12.5 6 z M 12.5 9 L 14 9 L 14 15 L 9 15 L 9 12.5 C 9 10.549938 10.549938 9 12.5 9 z M 17 9 L 35.5 9 C 37.450062 9 39 10.549938 39 12.5 L 39 15 L 17 15 L 17 9 z M 9 18 L 14 18 L 14 23 L 9 23 L 9 18 z M 17 18 L 39 18 L 39 23 L 17 23 L 17 18 z M 9 26 L 14 26 L 14 31 L 9 31 L 9 26 z M 17 26 L 39 26 L 39 31 L 17 31 L 17 26 z M 9 34 L 14 34 L 14 39 L 12.5 39 C 10.549938 39 9 37.450062 9 35.5 L 9 34 z M 17 34 L 39 34 L 39 35.5 C 39 37.450062 37.450062 39 35.5 39 L 17 39 L 17 34 z"/></svg>
</a>
</div>
<div><h1>Територія не опрацьовується</h1></div>
<div><h1>Останнє опрацювання:</h1><h2>${formattedDate(element.history.date.end) ?? "..."} (${name()})</h2></div>
<div class="edit">
<button onclick="Territory_Manager.mess.open({type: '${type}', id: ${id}, number: ${i}, mode: false})" style="color: var(--ColorThemes0);background: var(--ColorThemes3);">Призначити груповою</button>
<button onclick="Territory_Manager.mess.open({type: '${type}', id: ${id}, number: ${i}, mode: true})">Призначити вісника</button>
</div>
</div> </div>
<div><h1>Територія не опрацьовується</h1></div> `
<div><h1>Останнє опрацювання:</h1><h2>${formattedDate(element.history.date.end) ?? "..."}</h2></div> };
<div class="edit">
<button onclick="Territory_Manager.mess.open({type: '${type}', id: ${id}, number: ${i}, mode: false})" style="color: var(--ColorThemes0);background: var(--ColorThemes3);">Призначити груповою</button>
<button onclick="Territory_Manager.mess.open({type: '${type}', id: ${id}, number: ${i}, mode: true})">Призначити вісника</button>
</div>
</div>
`;
let html = ""; let html = "";

View File

@@ -0,0 +1,5 @@
<div class="page-territory_map">
<div id="map"></div>
</div>
<datalist id="list_sheeps"></datalist>

View File

@@ -0,0 +1,183 @@
let map_all;
const Territory_Map = {
init: async () => {
let html = await fetch('/lib/pages/territory/map/index.html').then((response) => response.text());
app.innerHTML = html;
Territory_Map.map.init();
Territory_Map.info.setHTML();
},
info: {
loadAPI: async (url) => {
const uuid = localStorage.getItem("uuid");
const response = await fetch(url, {
method: 'GET',
headers: {
"Content-Type": "application/json",
"Authorization": uuid
}
});
return await response.json();
},
setHTML: async () => {
const houses = await Territory_Map.info.loadAPI(`${CONFIG.api}houses/list`);
const homestead = await Territory_Map.info.loadAPI(`${CONFIG.api}homestead/list`);
Territory_Map.map.added({ type: "houses", data: houses });
Territory_Map.map.added({ type: "homestead", data: homestead });
}
},
map: {
polygons: [],
init: () => {
if (map_all && map_all.remove) map_all.remove();
const mapElement = document.getElementById('map');
if (!mapElement) return;
let googleHybrid = L.tileLayer('http://{s}.google.com/vt/lyrs=s,h&x={x}&y={y}&z={z}', {
maxZoom: 20,
minZoom: 15,
subdomains: ['mt0', 'mt1', 'mt2', 'mt3']
});
let osm = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
});
let mytile = L.tileLayer('https://sheep-service.com/map/{z}/{x}/{y}.webp', {
maxZoom: 20,
minZoom: 15,
tms: true
});
map_all = L.map(mapElement, {
renderer: L.canvas(),
center: [49.5629016, 25.6145625],
zoom: 17,
zoomControl: false,
layers: [
googleHybrid,
osm,
mytile
]
});
let baseMaps = {
"Google Hybrid": googleHybrid,
"OpenStreetMap": osm,
"Sheep Service Map": mytile,
};
let layerControl = L.control.layers(baseMaps, [], { position: 'bottomright' }).addTo(map_all);
map_all.pm.setLang("ua");
},
added: ({ type, data }) => {
for (let index = 0; index < data.length; index++) {
const element = data[index];
let posPersonal, posGroup;
let polygonOptions = type === "homestead" ? {
color: "#f2bd53",
radius: 500,
fillOpacity: 0.3,
dashArray: '20,15',
dashOffset: '20',
} : {
color: "#585858",
fillColor: "#f2bd53",
fillOpacity: 0.8
};
if (type === "homestead") {
posPersonal = Home.personal.homestead.list.map(e => e.id).indexOf(element.id);
posGroup = Home.group.homestead.list.map(e => e.id).indexOf(element.id);
if (posPersonal != -1 || posGroup != -1) {
polygonOptions = {
color: "#9a77c9",
fradius: 500,
fillOpacity: 0.3,
dashArray: '20,15',
dashOffset: '20',
}
}
} else {
posPersonal = Home.personal.house.list.map(e => e.id).indexOf(element.id);
posGroup = Home.group.house.list.map(e => e.id).indexOf(element.id);
if (posPersonal != -1 || posGroup != -1) {
polygonOptions = {
color: "#585858",
fillColor: "#9a77c9",
fillOpacity: 0.8
}
}
}
const polygon = L.polygon(element.points, polygonOptions).addTo(map_all);
polygon.bindPopup("");
// при открытии popup генерим div заново
polygon.on("popupopen", () => {
const div = document.createElement("div");
let text = () => {
if (posPersonal != -1) return "<span>Моя територія</span>"
else if (posGroup != -1) return "<span>Групова територія</span>"
return ""
}
div.innerHTML = `${text()} ${element.title} ${element.number}`;
div.className = "leaflet_drop"
polygon.setPopupContent(div);
});
// Territory_Map.map.polygons[type][element.id] = polygon; // сохраним ссылку на маркер
}
},
marker: ({ data, personal = false, group = false }) => {
console.log(data);
for (let index = 0; index < data.length; index++) {
const element = data[index];
console.log(element);
const redDot = L.divIcon({
className: "leaflet_drop",
html: `<div id="redDot_${element.id}"></div>`,
iconSize: [16, 16],
iconAnchor: [8, 8]
});
// создаём маркер
const marker = L.marker([element.geo.lat, element.geo.lng], { icon: redDot }).addTo(map_all);
marker.bindPopup("");
// при открытии popup генерим div заново
marker.on("popupopen", () => {
const div = document.createElement("div");
let text = () => {
if (personal) return "Моя територія"
else if (group) return "Групова територія"
return ""
}
div.innerHTML = text();
marker.setPopupContent(div);
});
}
}
}
}

View File

@@ -0,0 +1,11 @@
.page-territory_map {
width: 100%;
display: flex;
position: relative;
}
.page-territory_map>#map {
margin: 20px;
width: calc(100% - 40px);
height: calc(100% - 40px);
border-radius: calc(var(--border-radius) - 5px);
}

View File

@@ -3,6 +3,10 @@ Router
pageActive(''); pageActive('');
Auth.init();; Auth.init();;
}) })
.add('territory/map', function () {
pageActive();
Territory_Map.init();;
})
.add('territory/constructor', function () { .add('territory/constructor', function () {
pageActive(); pageActive();
Territory_constructor.init();; Territory_constructor.init();;
@@ -41,7 +45,7 @@ Router
}) })
.add('schedule', function () { .add('schedule', function () {
pageActive('schedule'); pageActive('schedule');
Schedule.init();; Schedule_list.init();;
}) })
.add('stand/constructor', function () { .add('stand/constructor', function () {
pageActive(); pageActive();

199
web/map.html Normal file
View File

@@ -0,0 +1,199 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<link rel="stylesheet" href="https://sheep-service.com/lib/components/leaflet/leaflet.css" />
<script src="https://sheep-service.com/lib/components/leaflet/leaflet.js"></script>
<script src="https://sheep-service.com/lib/components/qrcode.min.js"></script>
<style>
* {
border: 0;
padding: 0;
font-family: "Roboto", sans-serif;
margin: 0;
font-weight: 400;
outline: none;
}
#content {
width: 100%;
height: 100%;
position: absolute;
z-index: 9999;
display: flex;
flex-direction: column;
}
#content > #title {
width: calc(100% - 30px);
min-height: 120px;
background: rgb(255 255 255 / 51%);
backdrop-filter: blur(10px);
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 15px;
align-items: center;
color: #333;
}
#content > #title > div {
display: flex;
flex-direction: column;
width: 100%;
align-items: center;
}
#content > #title > h1 {
font-size: 65px;
font-weight: 700;
margin: 0;
min-width: 200px;
text-align: center;
}
#content > #title > div > h2 {
font-size: 45px;
font-weight: 700;
margin: 0;
}
#content > #title > div > h3 {
font-size: 38px;
font-weight: 500;
margin: 0px 0 10px 0;
}
#qrcode {
position: absolute;
bottom: 160px;
left: 20px;
width: 130px;
height: 130px;
background: #fff;
padding: 10px;
border-radius: 2px;
}
.line-left {
position: absolute;
left: 0;
top: 150px;
width: 10px;
height: calc(100% - 150px);
background: rgb(255 255 255 / 51%);
backdrop-filter: blur(10px);
}
.line-right {
position: absolute;
right: 0;
top: 150px;
width: 10px;
height: calc(100% - 150px);
background: rgb(255 255 255 / 51%);
backdrop-filter: blur(10px);
}
.line-bottom {
position: absolute;
left: 10px;
bottom: 0;
width: calc(100% - 20px);
height: 150px;
background: rgb(255 255 255 / 51%);
backdrop-filter: blur(10px);
}
#map {
height: 531px; width: 811px;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="content">
<div id="title">
<div>
<h3>Картка плану території</h3>
<h2 id="address"></h2>
</div>
<h1 id="number"></h1>
</div>
<div id="qrcode"></div>
<div class="line-left"></div>
<div class="line-right"></div>
<div class="line-bottom"></div>
</div>
<div id="map"></div>
<script>
let googleHybrid = L.tileLayer(
"http://{s}.google.com/vt/lyrs=s,h&x={x}&y={y}&z={z}",
{
maxZoom: 20,
minZoom: 15,
subdomains: ["mt0", "mt1", "mt2", "mt3"],
}
);
let osm = L.tileLayer(
"http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
{}
);
let mytile = L.tileLayer(
"https://sheep-service.com/map/{z}/{x}/{y}.webp",
{
maxZoom: 20,
minZoom: 15,
tms: true,
}
);
let map = L.map("map", {
renderer: L.canvas(),
center: [49.56090195025773, 25.623682250000012],
zoom: 20,
zoomControl: false,
layers: [googleHybrid, osm, mytile],
});
let baseMaps = {
"Google Hybrid": googleHybrid,
OpenStreetMap: osm,
"Sheep Service Map": mytile,
};
let type = "house";
let polygonOptions =
type === "homestead"
? {
color: "#f2bd53",
radius: 500,
fillOpacity: 0.3,
dashArray: "20,15",
dashOffset: "20",
}
: {
color: "#585858",
fillColor: "#f2bd53",
fillOpacity: 0.8,
};
let polygon = L.polygon(
[
[49.5609183, 25.623816],
[49.5608184, 25.6237487],
[49.5608394, 25.6236746],
[49.5607433, 25.6236089],
[49.5608009, 25.6234088],
[49.5609008, 25.6234771],
[49.560879, 25.623553],
[49.5609804, 25.6236213],
[49.5609591, 25.6236963],
[49.5610606, 25.6237647],
[49.5610065, 25.6239557],
[49.5608992, 25.6238834],
],
polygonOptions
).addTo(map);
</script>
</body>
</html>

View File

@@ -145,7 +145,7 @@
zoom, zoom,
zoomControl: false, zoomControl: false,
}); });
let layer = L.tileLayer("https://tm.rozenrod.com/webp/{z}/{x}/{y}.webp", { let layer = L.tileLayer("https://sheep-service.com/map/{z}/{x}/{y}.webp", {
maxZoom: 20, maxZoom: 20,
minZoom: 15, minZoom: 15,
tms: true, tms: true,

View File

@@ -1,4 +1,4 @@
const STATIC_CACHE_NAME = 'v2.0.13'; const STATIC_CACHE_NAME = 'v2.0.40';
const FILES_TO_CACHE = [ const FILES_TO_CACHE = [
'/', '/',
@@ -29,48 +29,67 @@ const FILES_TO_CACHE = [
"/lib/pages/auth/script.js", "/lib/pages/auth/script.js",
"/lib/pages/auth/style.css", "/lib/pages/auth/style.css",
"/lib/pages/auth/index.html",
"/lib/pages/home/script.js", "/lib/pages/home/script.js",
"/lib/pages/home/style.css", "/lib/pages/home/style.css",
"/lib/pages/home/index.html",
"/lib/pages/territory/list/script.js", "/lib/pages/territory/list/script.js",
"/lib/pages/territory/list/style.css", "/lib/pages/territory/list/style.css",
"/lib/pages/territory/list/index.html",
"/lib/pages/territory/manager/script.js", "/lib/pages/territory/manager/script.js",
"/lib/pages/territory/manager/style.css", "/lib/pages/territory/manager/style.css",
"/lib/pages/territory/manager/index.html",
"/lib/pages/territory/map/script.js",
"/lib/pages/territory/map/style.css",
"/lib/pages/territory/map/index.html",
"/lib/pages/territory/history/script.js", "/lib/pages/territory/history/script.js",
"/lib/pages/territory/history/style.css", "/lib/pages/territory/history/style.css",
"/lib/pages/territory/history/index.html",
"/lib/pages/territory/constructor/script.js", "/lib/pages/territory/constructor/script.js",
"/lib/pages/territory/constructor/style.css", "/lib/pages/territory/constructor/style.css",
"/lib/pages/territory/constructor/index.html",
"/lib/pages/territory/editor/script.js", "/lib/pages/territory/editor/script.js",
"/lib/pages/territory/editor/style.css", "/lib/pages/territory/editor/style.css",
"/lib/pages/territory/editor/index.html",
"/lib/pages/territory/editor/script.js", "/lib/pages/territory/editor/script.js",
"/lib/pages/territory/editor/style.css", "/lib/pages/territory/editor/style.css",
"/lib/pages/territory/editor/index.html",
"/lib/pages/territory/card/script.js", "/lib/pages/territory/card/script.js",
"/lib/pages/territory/card/style.css", "/lib/pages/territory/card/style.css",
"/lib/pages/territory/card/index.html",
"/lib/pages/options/script.js", "/lib/pages/options/script.js",
"/lib/pages/options/style.css", "/lib/pages/options/style.css",
"/lib/pages/options/index.html",
"/lib/pages/sheeps/script.js", "/lib/pages/sheeps/script.js",
"/lib/pages/sheeps/style.css", "/lib/pages/sheeps/style.css",
"/lib/pages/sheeps/index.html",
"/lib/pages/stand/list/script.js", "/lib/pages/stand/list/script.js",
"/lib/pages/stand/list/style.css", "/lib/pages/stand/list/style.css",
"/lib/pages/stand/list/index.html",
"/lib/pages/stand/card/script.js", "/lib/pages/stand/card/script.js",
"/lib/pages/stand/card/style.css", "/lib/pages/stand/card/style.css",
"/lib/pages/stand/card/index.html",
"/lib/pages/stand/constructor/script.js", "/lib/pages/stand/constructor/script.js",
"/lib/pages/stand/constructor/style.css", "/lib/pages/stand/constructor/style.css",
"/lib/pages/stand/constructor/index.html",
"/lib/pages/schedule/script.js", "/lib/pages/schedule/list/script.js",
"/lib/pages/schedule/style.css", "/lib/pages/schedule/list/style.css",
"/lib/pages/schedule/list/index.html",
"/lib/app.js" "/lib/app.js"
]; ];