Skip to content

Commit a84284d

Browse files
committed
Added new width/height config so it better fits smaller screens.
1 parent 1d1fb5c commit a84284d

4 files changed

Lines changed: 52 additions & 36 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "packetsnitch",
33
"executableName": "packetsnitch",
44
"productName": "packetsnitch",
5-
"version": "1.5.618",
5+
"version": "1.5.705",
66
"description": "A High Level Network Analysis Tool",
77
"main": ".webpack/main",
88
"private": false,

src/back-comm.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ ipcMain.handle("run-backend-command", async (event, filename, useLLM) => {
3030
fs.rmSync(testcaseOutputDir, { recursive: true, force: true });
3131
}
3232

33-
global.logBackend("[Bridge] ", backendCommand);
33+
global.logBackend("[Bridge]", backendCommand);
3434

3535
function sendError(message) {
3636
const mainWin = BrowserWindow.getAllWindows()[0]; // or track your main window
@@ -42,7 +42,7 @@ ipcMain.handle("run-backend-command", async (event, filename, useLLM) => {
4242
return new Promise((resolve) => {
4343
exec(
4444
backendCommand,
45-
{ maxBuffer: 1024 * 1024 * 50 },
45+
{ maxBuffer: 1024 * 1024 * 20 },
4646
(error, stdout, stderr) => {
4747
resolve(stdout);
4848
global.logBackend("", stdout);
@@ -57,14 +57,12 @@ ipcMain.handle("run-backend-command", async (event, filename, useLLM) => {
5757
sendError("[Bridge] Backend execution error! " + error);
5858
}
5959
} else {
60-
setTimeout(() => {
61-
const hostsJsonPath = path.join(testcaseOutputDir, "hosts.json");
62-
const mainWin = BrowserWindow.getAllWindows()[0];
63-
if (mainWin && fs.existsSync(hostsJsonPath)) {
64-
const hostsJsonData = fs.readFileSync(hostsJsonPath, "utf8");
65-
mainWin.webContents.send("json-data", hostsJsonData);
66-
}
67-
}, 200);
60+
const hostsJsonPath = path.join(testcaseOutputDir, "hosts.json");
61+
const mainWin = BrowserWindow.getAllWindows()[0];
62+
if (mainWin && fs.existsSync(hostsJsonPath)) {
63+
const hostsJsonData = fs.readFileSync(hostsJsonPath, "utf8");
64+
mainWin.webContents.send("json-data", hostsJsonData);
65+
}
6866
}
6967
},
7068
);

src/index.html

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
>
141141
<div id="llm-toggle">
142142
<label class="menu-btns">
143-
<input type="checkbox" id="use-llm" checked />
143+
<input type="checkbox" id="use-llm" />
144144
Enable LLM
145145
</label>
146146
</div>
@@ -243,22 +243,24 @@ <h2>Error!</h2>
243243
></textarea>
244244
</div>
245245
<div id="data-tools-history">
246-
<select
247-
id="data-tools-history-select"
248-
aria-label="Previous Conv inputs"
249-
>
250-
<option value="" selected>No previous inputs</option>
251-
</select>
246+
<select
247+
id="data-tools-history-select"
248+
aria-label="Previous Conv inputs"
249+
>
250+
<option value="" selected>No previous inputs</option>
251+
</select>
252252
</div>
253253
<div class="data-tools-actions">
254-
<button id="data-tools-convert-btn">Convert</button>
255-
<button id="data-tools-clear-btn">Clear</button>
254+
<button id="data-tools-convert-btn">Convert</button>
255+
<button id="data-tools-clear-btn">Clear</button>
256256
</div>
257257
<div id="data-tools-error" role="alert"></div>
258258
</div>
259259
<div class="data-tools-section">
260260
<div class="data-tools-title">Converted Output</div>
261-
<div class="data-tools-output-label data-tools-output-label-hex">
261+
<div
262+
class="data-tools-output-label data-tools-output-label-hex"
263+
>
262264
Hex
263265
</div>
264266
<div class="data-tools-highlight-wrap">
@@ -269,26 +271,36 @@ <h2>Error!</h2>
269271
></pre>
270272
<textarea id="data-tools-hex-output" readonly></textarea>
271273
</div>
272-
<div class="data-tools-output-label data-tools-output-label-binary">
274+
<div
275+
class="data-tools-output-label data-tools-output-label-binary"
276+
>
273277
Binary
274278
</div>
275279
<textarea id="data-tools-binary-output" readonly></textarea>
276-
<div class="data-tools-output-label data-tools-output-label-decimal">
280+
<div
281+
class="data-tools-output-label data-tools-output-label-decimal"
282+
>
277283
Decimal bytes
278284
</div>
279285
<textarea id="data-tools-decimal-output" readonly></textarea>
280-
<div class="data-tools-output-label data-tools-output-label-decimal-integer">
286+
<div
287+
class="data-tools-output-label data-tools-output-label-decimal-integer"
288+
>
281289
Decimal integer
282290
</div>
283291
<textarea
284292
id="data-tools-decimal-integer-output"
285293
readonly
286294
></textarea>
287-
<div class="data-tools-output-label data-tools-output-label-ascii">
295+
<div
296+
class="data-tools-output-label data-tools-output-label-ascii"
297+
>
288298
ASCII
289299
</div>
290300
<textarea id="data-tools-ascii-output" readonly></textarea>
291-
<div class="data-tools-output-label data-tools-output-label-base64">
301+
<div
302+
class="data-tools-output-label data-tools-output-label-base64"
303+
>
292304
Base64
293305
</div>
294306
<textarea id="data-tools-base64-output" readonly></textarea>
@@ -495,7 +507,9 @@ <h2>Error!</h2>
495507
<div class="crypt-section">
496508
<div class="crypt-section-title">TLS/SSL Decrypt</div>
497509
<div class="crypt-actions-row">
498-
<button id="crypt-decrypt-entry-btn">Decrypt selected</button>
510+
<button id="crypt-decrypt-entry-btn">
511+
Decrypt selected
512+
</button>
499513
<button id="crypt-send-decrypted-conv-btn" disabled>
500514
Send to Conv
501515
</button>
@@ -637,7 +651,9 @@ <h2>Error!</h2>
637651
/>
638652
<div class="crypt-actions-row">
639653
<button id="crypt-keystore-manual-uri-confirm-btn">Save</button>
640-
<button id="crypt-keystore-manual-uri-cancel-btn">Cancel</button>
654+
<button id="crypt-keystore-manual-uri-cancel-btn">
655+
Cancel
656+
</button>
641657
</div>
642658
</div>
643659
</div>
@@ -1022,7 +1038,11 @@ <h2>Error!</h2>
10221038
</div>
10231039
</div>
10241040
<div id="ctx-keystore-uri-submenu" class="ctx-submenu">
1025-
<button id="ctx-keystore-uri-branch" class="ctx-branch" type="button">
1041+
<button
1042+
id="ctx-keystore-uri-branch"
1043+
class="ctx-branch"
1044+
type="button"
1045+
>
10261046
As URI / URL (Manual)
10271047
</button>
10281048
<div class="ctx-submenu-panel">

src/main.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@ function checkNewInstall() {
8080

8181
function createWindow() {
8282
mainWindow = new BrowserWindow({
83-
minWidth: 1550,
84-
minHeight: 800,
83+
minWidth: 1275,
84+
minHeight: 600,
85+
width: 1400,
86+
height: 820,
8587
icon: path.join(__dirname, "./assets/icons/icons/png/64x64.png"),
8688
frame: false,
8789
webPreferences: {
@@ -92,7 +94,7 @@ function createWindow() {
9294
});
9395
mainWindow.loadURL(MAIN_WINDOW_WEBPACK_ENTRY);
9496
mainWindow.webContents.on("did-finish-load", () => {
95-
mainWindow.webContents.setZoomFactor(0.8); // makes everything fit snuggly
97+
mainWindow.webContents.setZoomFactor(0.7); // makes everything fit snuggly
9698
});
9799
mainWindow.once("close", () => {
98100
appendActivityLogLine(
@@ -223,10 +225,6 @@ app.whenReady().then(() => {
223225
if (canceled) return null;
224226
console.log("Accepted pcapng.. Checking for json existence...");
225227
isBackendLoaded = true;
226-
// Remove stale output directory so snitch always starts with a clean slate
227-
if (fs.existsSync(testcaseTempDir)) {
228-
fs.rmSync(testcaseTempDir, { recursive: true, force: true });
229-
}
230228
console.log("File selected:", filePaths[0]);
231229
selectedFilePath = filePaths[0];
232230
return filePaths[0];

0 commit comments

Comments
 (0)