Herr Doctor, hat mal n bissel von a nach B und so

This commit is contained in:
PaulaBras 2022-10-14 13:01:49 +02:00
parent 0a4d47f222
commit f43e22c811
6 changed files with 444 additions and 830 deletions

View File

@ -4,5 +4,4 @@ cid:
password: password:
save: true save: true
pass: NaN pass: NaN
customUrl: ''
currentInstalledAirac: 0 currentInstalledAirac: 0

1218
updater/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -4,5 +4,4 @@ cid:
password: password:
save: false save: false
pass: "Testen123" pass: "Testen123"
customUrl: ""
currentInstalledAirac: 2205 currentInstalledAirac: 2205

View File

@ -7,7 +7,7 @@
</head> </head>
<body> <body>
<button id="download" class"button is-primary">Download</button> <button id="download" class"button is-primary">Download</button>
<button id="dirs">Open</button> <button id="dirs">Select Directory</button>
<button id="extract">Extract ZIP</button> <button id="extract">Extract ZIP</button>
<p id="ouput">Output Test here</p> <p id="ouput">Output Test here</p>

View File

@ -22,7 +22,6 @@ let data = {
save: true, save: true,
pass: "NaN" pass: "NaN"
}, },
customUrl: "",
currentInstalledAirac: 0 currentInstalledAirac: 0
}; };
@ -42,7 +41,7 @@ const createWindow = () => {
}); });
mainWindow.loadFile(path.join(__dirname, 'index.html')); mainWindow.loadFile(path.join(__dirname, 'index.html'));
mainWindow.webContents.openDevTools(); mainWindow.webContents.openDevTools();
/*
// Read system yaml // Read system yaml
try { try {
let fileContents = fs.readFileSync('sectorfileUpdater.yaml', 'utf8'); let fileContents = fs.readFileSync('sectorfileUpdater.yaml', 'utf8');
@ -60,7 +59,7 @@ const createWindow = () => {
} catch (e) { } catch (e) {
console.log(e); console.log(e);
ipcRenderer.send("savefile", {}); ipcRenderer.send("savefile", {});
} }*/
// Select Directory // Select Directory
ipcMain.on('select-dirs', async(event, arg) => { ipcMain.on('select-dirs', async(event, arg) => {
@ -68,6 +67,7 @@ const createWindow = () => {
properties: ['openDirectory'] properties: ['openDirectory']
}) })
console.log('directories selected', filepath.filePaths) console.log('directories selected', filepath.filePaths)
mainWindow.webContents.send("filepath", filepath.filePaths);
// Save directory to file // Save directory to file
}); });
@ -87,14 +87,12 @@ const createWindow = () => {
}); });
// Unzip content // Unzip content
ipcMain.on("extract", (event, directory) => { ipcMain.on("extract", () => {
console.log(directory.directoryPath); //console.log(directory.directoryPath);
var unzipper = new DecompressZip("F:\\Desktop.zip"); var unzipper = new DecompressZip("F:\\Desktop.zip");
console.log("Töfte querdrad");
unzipper.extract({ unzipper.extract({
path: "F:\\test\\" // directory.directoryPath path: "F:\\test\\" // directory.directoryPath
}); });
console.log("Töfte cubique");
// Notify "progress" of the decompressed files // Notify "progress" of the decompressed files
unzipper.on('progress', function(fileIndex, fileCount) { unzipper.on('progress', function(fileIndex, fileCount) {
console.log('Extracted file ' + (fileIndex + 1) + ' of ' + fileCount); console.log('Extracted file ' + (fileIndex + 1) + ' of ' + fileCount);
@ -103,7 +101,6 @@ const createWindow = () => {
unzipper.on('extract', function(log) { unzipper.on('extract', function(log) {
console.log('Finished extracting', log); console.log('Finished extracting', log);
}); });
console.log("Töfte donna");
}); });
}; };

View File

@ -28,13 +28,16 @@ directoryBtn.addEventListener('click', (e) => {
}) })
}); });
ipcRenderer.on("filepath", (event, file) => {
document.getElementById('dirBox').innerText = file;
});
let extractBtn = document.getElementById('extract'); let extractBtn = document.getElementById('extract');
extractBtn.addEventListener('click', (e) => { extractBtn.addEventListener('click', () => {
let directoryPath = document.getElementById('dirBox'); let directoryPath = document.getElementById('dirBox');
let urlPath = document.getElementById('urlBox'); let urlPath = document.getElementById('urlBox');
ipcRenderer.send("extract", { ipcRenderer.send("extract", {
url: urlPath.value, url: urlPath.value,
properties: { directory: directoryPath.value } properties: { directory: directoryPath.value }
}); });
console.log("Töfte");
}); });