diff --git a/data/proxypass-pakkit.jar b/data/proxypass-pakkit.jar index a485478..0905866 100644 Binary files a/data/proxypass-pakkit.jar and b/data/proxypass-pakkit.jar differ diff --git a/html/mainPage/index.html b/html/mainPage/index.html index 172ee7c..a283bd6 100644 --- a/html/mainPage/index.html +++ b/html/mainPage/index.html @@ -79,6 +79,11 @@

Scripting (beta)

+ + +
diff --git a/html/mainPage/script.js b/html/mainPage/script.js index 922ed1d..b3ae8d6 100644 --- a/html/mainPage/script.js +++ b/html/mainPage/script.js @@ -31,6 +31,20 @@ if (!proxyCapabilities.modifyPackets) { // let currentPacket Not currently used let currentPacketType +let lastFilter = '' +const filterInput = document.getElementById('filter') + +function updateFilter () { + const newValue = filterInput.value + if (lastFilter !== newValue) { + lastFilter = newValue + deselectPacket() + refreshPackets() + } +} + +setInterval(updateFilter, 100) + // TODO: Seperate them like this /* let hiddenPackets = { server: {}, client: {} @@ -79,7 +93,7 @@ window.scriptEditor = CodeMirror.fromTextArea(document.getElementById('scriptEdi }) resetScriptEditor() -function updateScript(fromCheckbox) { +function updateScript (fromCheckbox) { if (!((fromCheckbox === true) || document.getElementById('enableScripting').checked)) return ipcRenderer.send('scriptStateChange', JSON.stringify({ // scriptingEnabled: document.getElementById('enableScripting').checked, @@ -172,11 +186,28 @@ function refreshPackets () { } } +function isHiddenByFilter (packet) { + if (lastFilter === '') { + return false + } + console.log('Filter applied') + if (packet.meta.name.includes(lastFilter)) { + console.log(packet.meta.name, 'includes', lastFilter) + return false + } + /* if (JSON.stringify(packet.data).includes(lastFilter)) { + return false + } */ + return true +} + function addPacketToDOM (packet, noUpdate) { /* if (!noUpdate) { var wasScrolledToBottom = (packetlist.parentElement.scrollTop >= (packetlist.parentElement.scrollHeight - packetlist.parentElement.offsetHeight)) } */ - if (hiddenPackets.includes(packet.meta.name)) { + const hiddenByFilter = isHiddenByFilter(packet) + + if (hiddenPackets.includes(packet.meta.name) || hiddenByFilter) { updateHidden() return } diff --git a/html/mainPage/style.css b/html/mainPage/style.css index b0be826..e4772d5 100644 --- a/html/mainPage/style.css +++ b/html/mainPage/style.css @@ -12,7 +12,7 @@ body { } .container { - height: calc(100% - 120px); + height: calc(100% - 154px); } .split, .gutter.gutter-horizontal { @@ -224,3 +224,13 @@ div#Scripting .CodeMirror.CodeMirror { background: #242424; height: calc(100vh - 52px); } + +div.search { + height: 34px; +} + +input.filter { + box-sizing: border-box; + height: 28px; + width: 100%; +} diff --git a/html/startPage/index.html b/html/startPage/index.html index dc73e60..651d8bf 100644 --- a/html/startPage/index.html +++ b/html/startPage/index.html @@ -64,7 +64,7 @@

pakkit



diff --git a/src/setupDataFolder.js b/src/setupDataFolder.js index 623b71c..6f84c6b 100644 --- a/src/setupDataFolder.js +++ b/src/setupDataFolder.js @@ -14,10 +14,10 @@ exports.setup = function (osDataFolder, resourcesPath) { if (!fs.existsSync(dataFolder + '/proxypass/proxypass-pakkit.jar')) { fs.copyFileSync(resourcesPath + 'data/proxypass-pakkit.jar', dataFolder + '/proxypass/proxypass-pakkit.jar') } else { - const packagedHash = md5File.sync(dataFolder + '/proxypass/proxypass-pakkit.jar') - console.log('The MD5 has of the packaged ProxyPass is', packagedHash) + const packagedHash = md5File.sync(resourcesPath + 'data/proxypass-pakkit.jar') + console.log('The MD5 hash of the packaged ProxyPass is', packagedHash) const savedHash = md5File.sync(dataFolder + '/proxypass/proxypass-pakkit.jar') - console.log('The MD5 has of the saved ProxyPass is', savedHash) + console.log('The MD5 hash of the saved ProxyPass is', savedHash) if (packagedHash === savedHash) { console.log('Match! Not copying.') } else {