auto-sync: 2026-05-06 18:30:01
This commit is contained in:
124
tasks/enduro-trails/prototype/deploy-wheel-svg.js
vendored
Normal file
124
tasks/enduro-trails/prototype/deploy-wheel-svg.js
vendored
Normal file
@@ -0,0 +1,124 @@
|
||||
const { Client } = require('ssh2');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const conn = new Client();
|
||||
|
||||
const config = {
|
||||
host: '82.22.50.71',
|
||||
username: 'slin',
|
||||
password: 'motoZ@yaz2010',
|
||||
readyTimeout: 30000
|
||||
};
|
||||
|
||||
const staticDir = path.join(__dirname, 'static');
|
||||
const remoteDir = '/home/slin/enduro-trails/prototype/static/';
|
||||
const containerName = 'prototype-enduro-trails-1';
|
||||
|
||||
console.log('🔌 Connecting to server...');
|
||||
|
||||
conn.on('ready', () => {
|
||||
console.log('✅ Connected');
|
||||
|
||||
conn.sftp((err, sftp) => {
|
||||
if (err) {
|
||||
console.error('❌ SFTP error:', err);
|
||||
conn.end();
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Upload index.html
|
||||
console.log('📤 Uploading index.html...');
|
||||
const indexStream = sftp.createWriteStream(remoteDir + 'index.html');
|
||||
fs.createReadStream(path.join(staticDir, 'index.html')).pipe(indexStream);
|
||||
|
||||
indexStream.on('close', () => {
|
||||
console.log('✅ index.html uploaded');
|
||||
|
||||
// Upload app.css
|
||||
console.log('📤 Uploading app.css...');
|
||||
const cssStream = sftp.createWriteStream(remoteDir + 'app.css');
|
||||
fs.createReadStream(path.join(staticDir, 'app.css')).pipe(cssStream);
|
||||
|
||||
cssStream.on('close', () => {
|
||||
console.log('✅ app.css uploaded');
|
||||
|
||||
// docker compose restart
|
||||
console.log('🔄 Restarting container via docker compose...');
|
||||
conn.exec('cd /home/slin/enduro-trails/prototype && docker compose restart', (err, stream) => {
|
||||
if (err) {
|
||||
console.error('❌ docker compose restart error:', err);
|
||||
conn.end();
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
let out = '';
|
||||
stream.on('data', d => out += d.toString());
|
||||
stream.stderr.on('data', d => out += d.toString());
|
||||
|
||||
stream.on('close', code => {
|
||||
console.log('docker compose restart output:', out.trim());
|
||||
if (code !== 0) {
|
||||
console.error('❌ docker compose restart failed (code ' + code + ')');
|
||||
conn.end();
|
||||
process.exit(1);
|
||||
}
|
||||
console.log('✅ Container restarted');
|
||||
|
||||
// Wait 8 seconds then docker cp
|
||||
console.log('⏳ Waiting 8s for container to come up...');
|
||||
setTimeout(() => {
|
||||
const cpCmd = [
|
||||
`docker cp ${remoteDir}index.html ${containerName}:/app/static/index.html`,
|
||||
`docker cp ${remoteDir}app.css ${containerName}:/app/static/app.css`
|
||||
].join(' && ');
|
||||
|
||||
console.log('📦 Copying files into container...');
|
||||
conn.exec(cpCmd, (err, stream) => {
|
||||
if (err) {
|
||||
console.error('❌ docker cp error:', err);
|
||||
conn.end();
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
let cpOut = '';
|
||||
stream.on('data', d => cpOut += d.toString());
|
||||
stream.stderr.on('data', d => cpOut += d.toString());
|
||||
|
||||
stream.on('close', code => {
|
||||
if (code !== 0) {
|
||||
console.error('❌ docker cp failed:', cpOut);
|
||||
conn.end();
|
||||
process.exit(1);
|
||||
}
|
||||
console.log('✅ Files copied into container');
|
||||
console.log('🎉 Deploy complete!');
|
||||
conn.end();
|
||||
});
|
||||
});
|
||||
}, 8000);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
cssStream.on('error', err => {
|
||||
console.error('❌ app.css upload error:', err);
|
||||
conn.end();
|
||||
process.exit(1);
|
||||
});
|
||||
});
|
||||
|
||||
indexStream.on('error', err => {
|
||||
console.error('❌ index.html upload error:', err);
|
||||
conn.end();
|
||||
process.exit(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
conn.on('error', err => {
|
||||
console.error('❌ Connection error:', err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
conn.connect(config);
|
||||
@@ -758,6 +758,7 @@ body.has-map-mode #sheet-backdrop.visible { pointer-events: none; }
|
||||
width: 32px; height: 32px;
|
||||
flex-shrink: 0;
|
||||
display: none;
|
||||
transform-origin: center;
|
||||
}
|
||||
.moto-wheel.spinning {
|
||||
display: block;
|
||||
|
||||
@@ -246,20 +246,97 @@
|
||||
<div id="mini-onboard-search-results" style="max-height:200px; overflow-y:auto; margin-top:4px;"></div>
|
||||
</div>
|
||||
<!-- Moto wheel loading indicator -->
|
||||
<svg id="mini-wheel" class="moto-wheel" width="22" height="22" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
||||
<!-- Обод -->
|
||||
<circle cx="12" cy="12" r="10"/>
|
||||
<!-- Втулка -->
|
||||
<circle cx="12" cy="12" r="2"/>
|
||||
<!-- Спицы (8 штук) -->
|
||||
<line x1="12" y1="2" x2="12" y2="10"/>
|
||||
<line x1="12" y1="14" x2="12" y2="22"/>
|
||||
<line x1="2" y1="12" x2="10" y2="12"/>
|
||||
<line x1="14" y1="12" x2="22" y2="12"/>
|
||||
<line x1="4.93" y1="4.93" x2="10.59" y2="10.59"/>
|
||||
<line x1="13.41" y1="13.41" x2="19.07" y2="19.07"/>
|
||||
<line x1="19.07" y1="4.93" x2="13.41" y2="10.59"/>
|
||||
<line x1="10.59" y1="13.41" x2="4.93" y2="19.07"/>
|
||||
<svg id="mini-wheel" class="moto-wheel" width="22" height="22" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<!-- Кноблинг: 36 зубцов по внешнему краю -->
|
||||
<rect x="92.50" y="47.50" width="3" height="5" fill="currentColor" transform="rotate(0,94.00,50.00)"/>
|
||||
<rect x="91.83" y="55.14" width="3" height="5" fill="currentColor" transform="rotate(10,93.33,57.64)"/>
|
||||
<rect x="89.85" y="62.55" width="3" height="5" fill="currentColor" transform="rotate(20,91.35,65.05)"/>
|
||||
<rect x="86.61" y="69.50" width="3" height="5" fill="currentColor" transform="rotate(30,88.11,72.00)"/>
|
||||
<rect x="82.21" y="75.78" width="3" height="5" fill="currentColor" transform="rotate(40,83.71,78.28)"/>
|
||||
<rect x="76.78" y="81.21" width="3" height="5" fill="currentColor" transform="rotate(50,78.28,83.71)"/>
|
||||
<rect x="70.50" y="85.61" width="3" height="5" fill="currentColor" transform="rotate(60,72.00,88.11)"/>
|
||||
<rect x="63.55" y="88.85" width="3" height="5" fill="currentColor" transform="rotate(70,65.05,91.35)"/>
|
||||
<rect x="56.14" y="90.83" width="3" height="5" fill="currentColor" transform="rotate(80,57.64,93.33)"/>
|
||||
<rect x="48.50" y="91.50" width="3" height="5" fill="currentColor" transform="rotate(90,50.00,94.00)"/>
|
||||
<rect x="40.86" y="90.83" width="3" height="5" fill="currentColor" transform="rotate(100,42.36,93.33)"/>
|
||||
<rect x="33.45" y="88.85" width="3" height="5" fill="currentColor" transform="rotate(110,34.95,91.35)"/>
|
||||
<rect x="26.50" y="85.61" width="3" height="5" fill="currentColor" transform="rotate(120,28.00,88.11)"/>
|
||||
<rect x="20.22" y="81.21" width="3" height="5" fill="currentColor" transform="rotate(130,21.72,83.71)"/>
|
||||
<rect x="14.79" y="75.78" width="3" height="5" fill="currentColor" transform="rotate(140,16.29,78.28)"/>
|
||||
<rect x="10.39" y="69.50" width="3" height="5" fill="currentColor" transform="rotate(150,11.89,72.00)"/>
|
||||
<rect x="7.15" y="62.55" width="3" height="5" fill="currentColor" transform="rotate(160,8.65,65.05)"/>
|
||||
<rect x="5.17" y="55.14" width="3" height="5" fill="currentColor" transform="rotate(170,6.67,57.64)"/>
|
||||
<rect x="4.50" y="47.50" width="3" height="5" fill="currentColor" transform="rotate(180,6.00,50.00)"/>
|
||||
<rect x="5.17" y="39.86" width="3" height="5" fill="currentColor" transform="rotate(190,6.67,42.36)"/>
|
||||
<rect x="7.15" y="32.45" width="3" height="5" fill="currentColor" transform="rotate(200,8.65,34.95)"/>
|
||||
<rect x="10.39" y="25.50" width="3" height="5" fill="currentColor" transform="rotate(210,11.89,28.00)"/>
|
||||
<rect x="14.79" y="19.22" width="3" height="5" fill="currentColor" transform="rotate(220,16.29,21.72)"/>
|
||||
<rect x="20.22" y="13.79" width="3" height="5" fill="currentColor" transform="rotate(230,21.72,16.29)"/>
|
||||
<rect x="26.50" y="9.39" width="3" height="5" fill="currentColor" transform="rotate(240,28.00,11.89)"/>
|
||||
<rect x="33.45" y="6.15" width="3" height="5" fill="currentColor" transform="rotate(250,34.95,8.65)"/>
|
||||
<rect x="40.86" y="4.17" width="3" height="5" fill="currentColor" transform="rotate(260,42.36,6.67)"/>
|
||||
<rect x="48.50" y="3.50" width="3" height="5" fill="currentColor" transform="rotate(270,50.00,6.00)"/>
|
||||
<rect x="56.14" y="4.17" width="3" height="5" fill="currentColor" transform="rotate(280,57.64,6.67)"/>
|
||||
<rect x="63.55" y="6.15" width="3" height="5" fill="currentColor" transform="rotate(290,65.05,8.65)"/>
|
||||
<rect x="70.50" y="9.39" width="3" height="5" fill="currentColor" transform="rotate(300,72.00,11.89)"/>
|
||||
<rect x="76.78" y="13.79" width="3" height="5" fill="currentColor" transform="rotate(310,78.28,16.29)"/>
|
||||
<rect x="82.21" y="19.22" width="3" height="5" fill="currentColor" transform="rotate(320,83.71,21.72)"/>
|
||||
<rect x="86.61" y="25.50" width="3" height="5" fill="currentColor" transform="rotate(330,88.11,28.00)"/>
|
||||
<rect x="89.85" y="32.45" width="3" height="5" fill="currentColor" transform="rotate(340,91.35,34.95)"/>
|
||||
<rect x="91.83" y="39.86" width="3" height="5" fill="currentColor" transform="rotate(350,93.33,42.36)"/>
|
||||
<!-- Шина -->
|
||||
<circle cx="50" cy="50" r="45" fill="currentColor" opacity="0.1"/>
|
||||
<circle cx="50" cy="50" r="42" fill="none" stroke="currentColor" stroke-width="6"/>
|
||||
<!-- Обод: двойное кольцо -->
|
||||
<circle cx="50" cy="50" r="34" fill="none" stroke="currentColor" stroke-width="2"/>
|
||||
<circle cx="50" cy="50" r="31" fill="none" stroke="currentColor" stroke-width="1"/>
|
||||
<!-- Спицы: 32 штуки -->
|
||||
<line x1="57.00" y1="50.00" x2="80.00" y2="50.00" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="56.87" y1="51.37" x2="79.42" y2="55.85" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="56.47" y1="52.68" x2="77.72" y2="61.48" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="55.82" y1="53.89" x2="74.94" y2="66.67" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="54.95" y1="54.95" x2="71.21" y2="71.21" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="53.89" y1="55.82" x2="66.67" y2="74.94" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="52.68" y1="56.47" x2="61.48" y2="77.72" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="51.37" y1="56.87" x2="55.85" y2="79.42" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="50.00" y1="57.00" x2="50.00" y2="80.00" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="48.63" y1="56.87" x2="44.15" y2="79.42" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="47.32" y1="56.47" x2="38.52" y2="77.72" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="46.11" y1="55.82" x2="33.33" y2="74.94" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="45.05" y1="54.95" x2="28.79" y2="71.21" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="44.18" y1="53.89" x2="25.06" y2="66.67" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="43.53" y1="52.68" x2="22.28" y2="61.48" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="43.13" y1="51.37" x2="20.58" y2="55.85" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="43.00" y1="50.00" x2="20.00" y2="50.00" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="43.13" y1="48.63" x2="20.58" y2="44.15" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="43.53" y1="47.32" x2="22.28" y2="38.52" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="44.18" y1="46.11" x2="25.06" y2="33.33" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="45.05" y1="45.05" x2="28.79" y2="28.79" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="46.11" y1="44.18" x2="33.33" y2="25.06" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="47.32" y1="43.53" x2="38.52" y2="22.28" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="48.63" y1="43.13" x2="44.15" y2="20.58" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="50.00" y1="43.00" x2="50.00" y2="20.00" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="51.37" y1="43.13" x2="55.85" y2="20.58" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="52.68" y1="43.53" x2="61.48" y2="22.28" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="53.89" y1="44.18" x2="66.67" y2="25.06" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="54.95" y1="45.05" x2="71.21" y2="28.79" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="55.82" y1="46.11" x2="74.94" y2="33.33" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="56.47" y1="47.32" x2="77.72" y2="38.52" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<line x1="56.87" y1="48.63" x2="79.42" y2="44.15" stroke="currentColor" stroke-width="0.8" opacity="0.7"/>
|
||||
<!-- Ступица -->
|
||||
<circle cx="50" cy="50" r="8" fill="currentColor" opacity="0.3"/>
|
||||
<circle cx="50" cy="50" r="8" fill="none" stroke="currentColor" stroke-width="1.5"/>
|
||||
<!-- Болты ступицы: 8 штук -->
|
||||
<circle cx="62.00" cy="50.00" r="1.5" fill="currentColor"/>
|
||||
<circle cx="58.49" cy="58.49" r="1.5" fill="currentColor"/>
|
||||
<circle cx="50.00" cy="62.00" r="1.5" fill="currentColor"/>
|
||||
<circle cx="41.51" cy="58.49" r="1.5" fill="currentColor"/>
|
||||
<circle cx="38.00" cy="50.00" r="1.5" fill="currentColor"/>
|
||||
<circle cx="41.51" cy="41.51" r="1.5" fill="currentColor"/>
|
||||
<circle cx="50.00" cy="38.00" r="1.5" fill="currentColor"/>
|
||||
<circle cx="58.49" cy="41.51" r="1.5" fill="currentColor"/>
|
||||
<!-- Центр -->
|
||||
<circle cx="50" cy="50" r="3" fill="currentColor"/>
|
||||
</svg>
|
||||
<div class="mini-route-dot" id="mini-dot"></div>
|
||||
<div class="mini-route-text">
|
||||
|
||||
Reference in New Issue
Block a user