Anteprima __NON_SMISTATI
+ +Nessun dato.+
diff --git a/main.js b/main.js index 2af64b7..6bfff93 100644 --- a/main.js +++ b/main.js @@ -1,9 +1,10 @@ -const { app, BrowserWindow, dialog, ipcMain } = require('electron'); +const { app, BrowserWindow, dialog, ipcMain, shell } = require('electron'); const path = require('path'); const fs = require('fs-extra'); const { processFolder } = require('./services/folderProcessor'); const { processZip } = require('./services/zipProcessor'); +const { resolveUnroutedDir, listUnroutedFiles } = require('./services/unrouted'); const CAD_EXTENSIONS = ['prt', 'asm', 'dwr']; const DEFAULT_DESTINATION = './output/cad'; @@ -168,3 +169,16 @@ ipcMain.handle('update-destination', async (_event, payload) => { await persistDestination(config.destination); return { destination: config.destination }; }); + +ipcMain.handle('open-unrouted-folder', async () => { + const unroutedDir = await resolveUnroutedDir(); + const openResult = await shell.openPath(unroutedDir); + + if (openResult) { + throw new Error(`Impossibile aprire la cartella: ${openResult}`); + } + + return { path: unroutedDir }; +}); + +ipcMain.handle('list-unrouted-files', async () => listUnroutedFiles()); diff --git a/preload.js b/preload.js index e69c810..8729748 100644 --- a/preload.js +++ b/preload.js @@ -8,4 +8,6 @@ contextBridge.exposeInMainWorld('api', { getDestination: () => ipcRenderer.invoke('get-destination'), selectDestinationFolder: () => ipcRenderer.invoke('select-destination-folder'), updateDestination: (destination) => ipcRenderer.invoke('update-destination', { destination }), + openUnroutedFolder: () => ipcRenderer.invoke('open-unrouted-folder'), + listUnroutedFiles: () => ipcRenderer.invoke('list-unrouted-files'), }); diff --git a/renderer/index.html b/renderer/index.html index d4ce8c1..19ca720 100644 --- a/renderer/index.html +++ b/renderer/index.html @@ -161,6 +161,65 @@ 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 h2 { + margin: 0; + font-size: 18px; + } + + .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; @@ -200,11 +259,25 @@ +
Pronto.+ +