Mostra una progress bar con messaggio contestuale nelle 4 fasi: scansione sorgente, analisi cartella destinazione (con contatore cartelle), ricerca duplicati (con contatore file CAD), smistamento (N / totale). La barra è indeterminata nelle prime tre fasi e determinata durante la copia. Il canale IPC progress viene aperto all'inizio e chiuso al termine dell'operazione
359 lines
8.4 KiB
HTML
359 lines
8.4 KiB
HTML
<!doctype html>
|
|
<html lang="it">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>CadRoute</title>
|
|
<style>
|
|
:root {
|
|
color-scheme: light;
|
|
--bg: #f6f8fb;
|
|
--card: #ffffff;
|
|
--text: #0f172a;
|
|
--muted: #475569;
|
|
--accent: #0b5fff;
|
|
--border: #dbe2ea;
|
|
}
|
|
|
|
* {
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
margin: 0;
|
|
background: linear-gradient(130deg, #eaf0ff 0%, var(--bg) 45%, #f9fbff 100%);
|
|
color: var(--text);
|
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
font-size: 16px;
|
|
}
|
|
|
|
.page {
|
|
max-width: 980px;
|
|
margin: 40px auto;
|
|
background: var(--card);
|
|
border: 1px solid var(--border);
|
|
border-radius: 14px;
|
|
padding: 32px;
|
|
}
|
|
|
|
h1 {
|
|
margin-top: 0;
|
|
margin-bottom: 8px;
|
|
font-size: 26px;
|
|
}
|
|
|
|
p {
|
|
margin: 0;
|
|
color: var(--muted);
|
|
font-size: 15px;
|
|
}
|
|
|
|
.actions {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 14px;
|
|
margin-top: 22px;
|
|
}
|
|
|
|
button {
|
|
border: 1px solid transparent;
|
|
background: var(--accent);
|
|
color: white;
|
|
border-radius: 10px;
|
|
padding: 13px 20px;
|
|
font-size: 16px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
button.secondary {
|
|
background: #1f2937;
|
|
}
|
|
|
|
button:hover {
|
|
opacity: 0.92;
|
|
}
|
|
|
|
button:disabled {
|
|
opacity: 0.5;
|
|
cursor: wait;
|
|
}
|
|
|
|
.info {
|
|
margin-top: 18px;
|
|
padding: 14px;
|
|
border-radius: 10px;
|
|
border: 1px solid var(--border);
|
|
background: #f8fafc;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.rules {
|
|
margin-top: 18px;
|
|
border: 1px solid var(--border);
|
|
border-radius: 10px;
|
|
padding: 14px;
|
|
background: #f8fafc;
|
|
}
|
|
|
|
.drop-zone {
|
|
margin-top: 18px;
|
|
border: 2px dashed #9db4d8;
|
|
border-radius: 12px;
|
|
background: #f2f7ff;
|
|
color: #1e3a5f;
|
|
padding: 20px;
|
|
text-align: center;
|
|
font-size: 14px;
|
|
transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
|
|
}
|
|
|
|
.drop-zone.active {
|
|
border-color: var(--accent);
|
|
background: #e8f0ff;
|
|
}
|
|
|
|
.drop-zone.error {
|
|
border-color: #dc2626;
|
|
background: #fff1f2;
|
|
color: #991b1b;
|
|
}
|
|
|
|
.rules h2 {
|
|
margin: 0 0 12px;
|
|
font-size: 19px;
|
|
}
|
|
|
|
.rule-row {
|
|
display: grid;
|
|
grid-template-columns: 180px 1fr auto auto;
|
|
gap: 10px;
|
|
align-items: center;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.rule-row.single-row {
|
|
grid-template-columns: 1fr auto auto;
|
|
margin-top: 12px;
|
|
}
|
|
|
|
.rule-row.preview-actions {
|
|
grid-template-columns: auto auto auto;
|
|
justify-content: start;
|
|
}
|
|
|
|
.rule-label {
|
|
font-size: 15px;
|
|
color: var(--muted);
|
|
}
|
|
|
|
.rule-row input {
|
|
min-width: 0;
|
|
padding: 11px 12px;
|
|
border: 1px solid var(--border);
|
|
border-radius: 8px;
|
|
font-size: 16px;
|
|
}
|
|
|
|
.rule-row button {
|
|
padding: 11px 16px;
|
|
border-radius: 8px;
|
|
}
|
|
|
|
.rule-row button.browse {
|
|
background: #334155;
|
|
}
|
|
|
|
.rule-status {
|
|
margin-top: 4px;
|
|
font-size: 14px;
|
|
color: var(--muted);
|
|
}
|
|
|
|
.preview-overlay {
|
|
position: fixed;
|
|
inset: 0;
|
|
background: rgba(15, 23, 42, 0.55);
|
|
display: none;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 16px;
|
|
z-index: 20;
|
|
}
|
|
|
|
.preview-overlay.visible {
|
|
display: flex;
|
|
}
|
|
|
|
.preview-card {
|
|
width: min(900px, 100%);
|
|
max-height: 85vh;
|
|
background: #ffffff;
|
|
border: 1px solid var(--border);
|
|
border-radius: 12px;
|
|
padding: 14px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 10px;
|
|
}
|
|
|
|
.preview-header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 10px;
|
|
}
|
|
|
|
.preview-header-actions {
|
|
display: flex;
|
|
gap: 8px;
|
|
align-items: center;
|
|
}
|
|
|
|
.preview-header h2 {
|
|
margin: 0;
|
|
font-size: 18px;
|
|
}
|
|
|
|
.danger {
|
|
background: #b91c1c;
|
|
}
|
|
|
|
.preview-meta {
|
|
font-size: 12px;
|
|
color: var(--muted);
|
|
word-break: break-all;
|
|
}
|
|
|
|
.preview-list {
|
|
margin: 0;
|
|
background: #0f172a;
|
|
color: #e2e8f0;
|
|
border: 1px solid var(--border);
|
|
border-radius: 10px;
|
|
padding: 12px;
|
|
overflow: auto;
|
|
min-height: 220px;
|
|
max-height: 58vh;
|
|
font-size: 13px;
|
|
white-space: pre-wrap;
|
|
}
|
|
|
|
@media (max-width: 760px) {
|
|
.rule-row {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
}
|
|
|
|
pre {
|
|
margin-top: 18px;
|
|
padding: 14px;
|
|
border-radius: 10px;
|
|
border: 1px solid var(--border);
|
|
background: #0f172a;
|
|
color: #e2e8f0;
|
|
overflow: auto;
|
|
min-height: 180px;
|
|
}
|
|
|
|
.progress-container {
|
|
margin-top: 18px;
|
|
display: none;
|
|
}
|
|
|
|
.progress-label {
|
|
font-size: 13px;
|
|
color: var(--muted);
|
|
margin-bottom: 6px;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
progress {
|
|
width: 100%;
|
|
height: 6px;
|
|
border-radius: 4px;
|
|
border: none;
|
|
appearance: none;
|
|
-webkit-appearance: none;
|
|
background: var(--border);
|
|
overflow: hidden;
|
|
}
|
|
|
|
progress::-webkit-progress-bar {
|
|
background: var(--border);
|
|
border-radius: 4px;
|
|
}
|
|
|
|
progress::-webkit-progress-value {
|
|
background: var(--accent);
|
|
border-radius: 4px;
|
|
transition: width 80ms ease;
|
|
}
|
|
|
|
progress:indeterminate {
|
|
background: linear-gradient(90deg, var(--border) 25%, var(--accent) 50%, var(--border) 75%);
|
|
background-size: 200% 100%;
|
|
animation: progress-indeterminate 1.2s linear infinite;
|
|
}
|
|
|
|
@keyframes progress-indeterminate {
|
|
0% { background-position: 100% 0; }
|
|
100% { background-position: -100% 0; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<main class="page">
|
|
<h1>CadRoute - Smistatore automatico</h1>
|
|
<p>Seleziona una cartella o uno ZIP con i disegni da smistare</p>
|
|
|
|
<div class="actions">
|
|
<button id="folderBtn">Process Folder</button>
|
|
<button id="zipBtn" class="secondary">Process ZIP</button>
|
|
</div>
|
|
|
|
<section class="drop-zone" id="dropZone">
|
|
Trascina qui una cartella o un file .zip
|
|
</section>
|
|
|
|
<div class="progress-container" id="progressContainer">
|
|
<div class="progress-label" id="progressLabel">In corso...</div>
|
|
<progress id="progressBar"></progress>
|
|
</div>
|
|
|
|
<section class="rules">
|
|
<h2>Destinazione file CAD</h2>
|
|
<div class="rule-row single-row">
|
|
<input id="destinationInput" type="text" placeholder="Percorso destinazione..." />
|
|
<button id="browseDestinationBtn" class="browse">Sfoglia</button>
|
|
<button id="saveDestinationBtn">Salva</button>
|
|
</div>
|
|
<div class="rule-row single-row preview-actions">
|
|
<button id="openUnroutedBtn" class="browse">Anteprima non smistati</button>
|
|
<button id="openDuplicatesBtn" class="browse">Anteprima duplicati</button>
|
|
<button id="openSkippedBtn" class="browse">Anteprima saltati</button>
|
|
</div>
|
|
<div class="rule-status" id="destinationStatus"></div>
|
|
</section>
|
|
<pre id="output">Pronto.</pre>
|
|
</main>
|
|
|
|
<section class="preview-overlay" id="previewOverlay">
|
|
<article class="preview-card">
|
|
<div class="preview-header">
|
|
<h2 id="previewTitle">Anteprima</h2>
|
|
<div class="preview-header-actions">
|
|
<button id="clearPreviewBtn" class="danger">Pulisci cartella</button>
|
|
<button id="closePreviewBtn" class="secondary">Chiudi</button>
|
|
</div>
|
|
</div>
|
|
<div class="preview-meta" id="previewMeta"></div>
|
|
<pre class="preview-list" id="previewList">Nessun dato.</pre>
|
|
</article>
|
|
</section>
|
|
|
|
<script src="./renderer.js"></script>
|
|
</body>
|
|
</html>
|