additional ui changes
parent
f80115da99
commit
4420f8251c
@ -1,41 +1,186 @@
|
|||||||
import glob
|
import glob
|
||||||
import wx
|
import wx
|
||||||
|
import wx.lib.buttons as buttons
|
||||||
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
class ServerPanel(wx.Panel):
|
BG_IMG = 'icon.png'
|
||||||
|
COLUMN_NAMES = np.flip(['Server name', 'Port number', 'Status', 'Source IP', 'Destination IP', 'Source port number', 'Destination port number', 'Number of requests made since flag', 'Date', 'Process Name', 'Address hostname', 'Refresh rate'])
|
||||||
|
TEST_FILE = pd.read_csv('out.csv', )
|
||||||
|
TEST_FILE = TEST_FILE.iloc[1:, :]
|
||||||
|
TEST_FILE.columns = ['Server name', 'Port number', 'Status', 'Source IP', 'Destination IP', 'Source port']
|
||||||
|
print(TEST_FILE)
|
||||||
|
print(len(TEST_FILE))
|
||||||
|
print(TEST_FILE.iloc[1, 1])
|
||||||
|
class OtherFrame(wx.Frame):
|
||||||
|
"""
|
||||||
|
Class used for creating frames other than the main one
|
||||||
|
"""
|
||||||
|
def __init__(self):
|
||||||
|
wx.Frame.__init__(self, None, -1, 'Server Panel', size=(600, 250))
|
||||||
|
panel = ServerPanel(self)
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def on_edit(self, event):
|
||||||
|
print('in on_edit')
|
||||||
|
|
||||||
|
|
||||||
|
def update_mp3_listing(self, folder_path):
|
||||||
|
print(folder_path)
|
||||||
|
|
||||||
|
def on_window(self, event):
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
class HelpFrame(wx.Frame):
|
||||||
|
"""
|
||||||
|
Class used for creating frames other than the main one
|
||||||
|
"""
|
||||||
|
def __init__(self):
|
||||||
|
wx.Frame.__init__(self, None, -1, 'Help', size=(600, 250))
|
||||||
|
panel = HelpPanel(self)
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
|
||||||
|
# Panel with all the login widgets
|
||||||
|
class LoginPanel(wx.Panel):
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
super().__init__(parent)
|
super(LoginPanel, self).__init__(parent)
|
||||||
|
self.SetBackgroundColour((44, 51, 51))
|
||||||
|
basicLabel = wx.StaticText(self, -1, "Username")
|
||||||
|
basicLabel.SetForegroundColour((255,255,255))
|
||||||
|
basicText = wx.TextCtrl(self, -1, "", size=(175, -1))
|
||||||
|
# basicText.SetInsertionPoint(0)
|
||||||
|
pwdLabel = wx.StaticText(self, -1, "Password")
|
||||||
|
pwdText = wx.TextCtrl(self, -1, "", size=(175, -1), style=wx.TE_PASSWORD)
|
||||||
|
pwdLabel.SetForegroundColour((255, 255, 255))
|
||||||
|
vbox = wx.BoxSizer(wx.VERTICAL)
|
||||||
|
hbox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
|
vbox.Add(basicLabel, 0, wx.ALIGN_CENTER | 100, 5)
|
||||||
|
vbox.Add(basicText, 0, wx.ALIGN_CENTER | 100, 5)
|
||||||
|
vbox.Add(pwdLabel, 0, wx.ALIGN_CENTER | 100, 5)
|
||||||
|
vbox.Add(pwdText, 0, wx.ALIGN_CENTER | 100, 5)
|
||||||
|
login_button = wx.Button(self, label='Login')
|
||||||
|
login_button.Bind(wx.EVT_BUTTON, self.on_login)
|
||||||
|
help_button = wx.Button(self, label='Help')
|
||||||
|
help_button.Bind(wx.EVT_BUTTON, self.on_help)
|
||||||
|
# signup_button = wx.Button(self, label='Sign Up')
|
||||||
|
hbox.Add(login_button, 0, wx.ALL | 200, 20)
|
||||||
|
# hbox.Add(signup_button, 0, wx.ALL | 200, 20)
|
||||||
|
hbox.Add(help_button, 0, wx.ALL | 200, 20)
|
||||||
|
vbox.Add(hbox, 0, wx.ALIGN_CENTER | 100, 5)
|
||||||
|
self.SetSizer(vbox)
|
||||||
|
|
||||||
|
def on_login(self, event):
|
||||||
|
OtherFrame()
|
||||||
|
|
||||||
|
def on_help(self, event):
|
||||||
|
HelpFrame()
|
||||||
|
|
||||||
|
|
||||||
|
# Panel with all the login widgets
|
||||||
|
class HelpPanel(wx.Panel):
|
||||||
|
def __init__(self, parent):
|
||||||
|
super(HelpPanel, self).__init__(parent)
|
||||||
|
self.SetBackgroundColour((44, 51, 51))
|
||||||
|
# basicLabel = wx.StaticText(self, -1, "Username")
|
||||||
|
# basicLabel.SetForegroundColour((255,255,255))
|
||||||
|
# basicText = wx.TextCtrl(self, -1, "", size=(175, -1))
|
||||||
|
#
|
||||||
|
# # basicText.SetInsertionPoint(0)
|
||||||
|
# pwdLabel = wx.StaticText(self, -1, "Password")
|
||||||
|
# pwdText = wx.TextCtrl(self, -1, "", size=(175, -1), style=wx.TE_PASSWORD)
|
||||||
|
# pwdLabel.SetForegroundColour((255, 255, 255))
|
||||||
|
# vbox = wx.BoxSizer(wx.VERTICAL)
|
||||||
|
# hbox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
|
# vbox.Add(basicLabel, 0, wx.ALIGN_CENTER | 100, 5)
|
||||||
|
# vbox.Add(basicText, 0, wx.ALIGN_CENTER | 100, 5)
|
||||||
|
# vbox.Add(pwdLabel, 0, wx.ALIGN_CENTER | 100, 5)
|
||||||
|
# vbox.Add(pwdText, 0, wx.ALIGN_CENTER | 100, 5)
|
||||||
|
# login_button = wx.Button(self, label='Login')
|
||||||
|
# login_button.Bind(wx.EVT_BUTTON, self.on_login)
|
||||||
|
# help_button = wx.Button(self, label='Help')
|
||||||
|
# # signup_button = wx.Button(self, label='Sign Up')
|
||||||
|
# hbox.Add(login_button, 0, wx.ALL | 200, 20)
|
||||||
|
# # hbox.Add(signup_button, 0, wx.ALL | 200, 20)
|
||||||
|
# hbox.Add(help_button, 0, wx.ALL | 200, 20)
|
||||||
|
# vbox.Add(hbox, 0, wx.ALIGN_CENTER | 100, 5)
|
||||||
|
# self.SetSizer(vbox)
|
||||||
|
|
||||||
|
|
||||||
|
class ServerPanel(wx.Panel):
|
||||||
|
def __init__(self, parent):
|
||||||
|
super().__init__(parent, size=(500, 500))
|
||||||
|
self.SetBackgroundColour((44, 51, 51))
|
||||||
|
# self.toolbar = self.CreateToolBar()
|
||||||
|
# tb = wx.ToolBar(self, -1)
|
||||||
|
|
||||||
main_sizer = wx.BoxSizer(wx.VERTICAL)
|
main_sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
|
secondary_sizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
self.row_obj_dict = {}
|
self.row_obj_dict = {}
|
||||||
|
|
||||||
self.list_ctrl = wx.ListCtrl(
|
self.list_ctrl = wx.ListCtrl(
|
||||||
self, size=(-1, 100),
|
self, size=(-1, 75),
|
||||||
style=wx.LC_REPORT | wx.BORDER_SUNKEN
|
style=wx.LC_REPORT | wx.BORDER_SUNKEN
|
||||||
)
|
)
|
||||||
self.list_ctrl.InsertColumn(0, 'Server name', width=140)
|
|
||||||
self.list_ctrl.InsertColumn(1, 'Port number', width=140)
|
# self.pnl1.SetBackgroundColour(wx.BLACK)
|
||||||
self.list_ctrl.InsertColumn(2, 'Status', width=200)
|
self.handle_columns()
|
||||||
main_sizer.Add(self.list_ctrl, 0, wx.ALL | wx.EXPAND, 5)
|
for i in range(len(TEST_FILE)):
|
||||||
|
self.list_ctrl.InsertItem(i, TEST_FILE.iloc[i, 0])
|
||||||
|
for j in range(1, 5):
|
||||||
|
self.list_ctrl.SetItem(i, j, TEST_FILE.iloc[i, j])
|
||||||
|
|
||||||
|
main_sizer.Add(self.list_ctrl, 0, wx.ALL | wx.EXPAND, 20)
|
||||||
start_button = wx.Button(self, label='Start')
|
start_button = wx.Button(self, label='Start')
|
||||||
|
start_button.SetBackgroundColour((205, 215, 206))
|
||||||
start_button.Bind(wx.EVT_BUTTON, self.on_edit)
|
start_button.Bind(wx.EVT_BUTTON, self.on_edit)
|
||||||
|
start_button.Bind(wx.EVT_ENTER_WINDOW, self.on_edit)
|
||||||
stop_button = wx.Button(self, label='Stop')
|
stop_button = wx.Button(self, label='Stop')
|
||||||
|
stop_button.SetBackgroundColour('#F08080')
|
||||||
|
|
||||||
|
secondary_frame_button = wx.Button(self, label='Window')
|
||||||
|
secondary_frame_button.Bind(wx.EVT_BUTTON, self.on_window)
|
||||||
|
# wx.BORDER(stop_button, wx.BORDER_NONE)
|
||||||
stop_button.Bind(wx.EVT_BUTTON, self.on_edit)
|
stop_button.Bind(wx.EVT_BUTTON, self.on_edit)
|
||||||
main_sizer.Add(start_button, 0, wx.ALL | 100, 5)
|
main_sizer.Add(start_button, 0, wx.CENTER | wx.ALL | 100, 5)
|
||||||
main_sizer.Add(stop_button, 0, wx.ALL | 100, 5)
|
main_sizer.Add(stop_button, 0, wx.CENTER | 100, 5)
|
||||||
|
main_sizer.Add(secondary_frame_button, 0, wx.CENTER | 100, 5)
|
||||||
self.SetSizer(main_sizer)
|
self.SetSizer(main_sizer)
|
||||||
|
|
||||||
|
def handle_columns(self):
|
||||||
|
for col in COLUMN_NAMES:
|
||||||
|
self.list_ctrl.InsertColumn(0, col, width=200)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def on_edit(self, event):
|
def on_edit(self, event):
|
||||||
print('in on_edit')
|
print('in on_edit')
|
||||||
|
|
||||||
def update_mp3_listing(self, folder_path):
|
def update_mp3_listing(self, folder_path):
|
||||||
print(folder_path)
|
print(folder_path)
|
||||||
|
|
||||||
class ServerFrame(wx.Frame):
|
def on_window(self, event):
|
||||||
|
OtherFrame()
|
||||||
|
|
||||||
|
def ShowImage(self, imageFile):
|
||||||
|
if imageFile == "":
|
||||||
|
self.bitmap = wx.StaticBitmap(self, -1, size=(0, 0))
|
||||||
|
else:
|
||||||
|
bmp = wx.Image(imageFile, wx.BITMAP_TYPE_ANY).ConvertToBitmap()
|
||||||
|
self.bitmap = wx.StaticBitmap(self, -1, bmp, (0, 0))
|
||||||
|
|
||||||
|
|
||||||
|
class ServerFrame(wx.Frame):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__(parent=None,
|
super().__init__(parent=None,
|
||||||
title='Server Dashboard')
|
title='Server Dashboard')
|
||||||
self.panel = ServerPanel(self)
|
|
||||||
|
self.panel = LoginPanel(self)
|
||||||
|
# image = wx.StaticBitmap(self, wx.ID_ANY)
|
||||||
|
# image.SetBitmap(wx.Bitmap('WXPython.png'))
|
||||||
self.Show()
|
self.Show()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app = wx.App(False)
|
app = wx.App(False)
|
||||||
frame = ServerFrame()
|
frame = ServerFrame()
|
||||||
|
@ -0,0 +1,85 @@
|
|||||||
|
0xf44ee3942e7d,FRAMEWORKWIN,Cole,1663646899
|
||||||
|
firefox.exe,TCP,[2620:f3:8000:5060:5939:a4c0:4f5b:113f]:53338,[2607:f518:5::4816:b9c7]:80,ESTABLISHED,8008
|
||||||
|
firefox.exe,TCP,[2620:f3:8000:5060:5939:a4c0:4f5b:113f]:53301,[2607:f8b0:4009:817::200e]:443,ESTABLISHED,8008
|
||||||
|
firefox.exe,TCP,[2620:f3:8000:5060:5939:a4c0:4f5b:113f]:53292,[2607:f8b0:4009:808::2003]:80,TIME_WAIT,0
|
||||||
|
firefox.exe,TCP,[2620:f3:8000:5060:5939:a4c0:4f5b:113f]:53285,[2606:4700:4400::6812:2962]:443,TIME_WAIT,0
|
||||||
|
python.exe,TCP,127.0.0.1:51987,127.0.0.1:51986,ESTABLISHED,17244
|
||||||
|
python.exe,TCP,127.0.0.1:51986,127.0.0.1:51987,ESTABLISHED,17244
|
||||||
|
VSCodium.exe,TCP,127.0.0.1:51978,127.0.0.1:51977,ESTABLISHED,17828
|
||||||
|
VSCodium.exe,TCP,127.0.0.1:51977,127.0.0.1:51978,ESTABLISHED,17828
|
||||||
|
firefox.exe,TCP,127.0.0.1:51761,127.0.0.1:51760,ESTABLISHED,10420
|
||||||
|
firefox.exe,TCP,127.0.0.1:51760,127.0.0.1:51761,ESTABLISHED,10420
|
||||||
|
firefox.exe,TCP,127.0.0.1:51759,127.0.0.1:51758,ESTABLISHED,8008
|
||||||
|
firefox.exe,TCP,127.0.0.1:51758,127.0.0.1:51759,ESTABLISHED,8008
|
||||||
|
nxserver.bin,TCP,127.0.0.1:50792,127.0.0.1:22890,ESTABLISHED,8116
|
||||||
|
nxserver.bin,TCP,127.0.0.1:50778,127.0.0.1:4742,ESTABLISHED,8116
|
||||||
|
tailscale-ipn.exe,TCP,127.0.0.1:50530,127.0.0.1:41112,ESTABLISHED,14552
|
||||||
|
nxclient.bin,TCP,127.0.0.1:50409,127.0.0.1:19231,ESTABLISHED,11836
|
||||||
|
nxclient.bin,TCP,127.0.0.1:50408,127.0.0.1:26068,ESTABLISHED,11836
|
||||||
|
nxclient.bin,TCP,127.0.0.1:50407,127.0.0.1:10632,ESTABLISHED,11836
|
||||||
|
nxnode.bin,TCP,127.0.0.1:50406,127.0.0.1:25001,ESTABLISHED,11608
|
||||||
|
nxnode.bin,TCP,127.0.0.1:50405,127.0.0.1:23938,ESTABLISHED,11608
|
||||||
|
nxnode.bin,TCP,127.0.0.1:50402,127.0.0.1:28488,ESTABLISHED,11608
|
||||||
|
nxnode.bin,TCP,127.0.0.1:50397,127.0.0.1:17311,ESTABLISHED,11608
|
||||||
|
nxnode.bin,TCP,127.0.0.1:50395,127.0.0.1:21968,ESTABLISHED,11608
|
||||||
|
nxnode.bin,TCP,127.0.0.1:50174,127.0.0.1:10055,ESTABLISHED,11608
|
||||||
|
nxservice64.exe,TCP,127.0.0.1:50160,127.0.0.1:19492,ESTABLISHED,5544
|
||||||
|
nxserver.bin,TCP,127.0.0.1:49772,127.0.0.1:16950,ESTABLISHED,8116
|
||||||
|
nxserver.bin,TCP,127.0.0.1:49767,127.0.0.1:16619,ESTABLISHED,8116
|
||||||
|
nxserver.bin,TCP,127.0.0.1:49766,127.0.0.1:31770,ESTABLISHED,8116
|
||||||
|
nxserver.bin,TCP,127.0.0.1:49765,127.0.0.1:7039,ESTABLISHED,8116
|
||||||
|
nxserver.bin,TCP,127.0.0.1:49762,127.0.0.1:22921,ESTABLISHED,8116
|
||||||
|
nxserver.bin,TCP,127.0.0.1:49761,127.0.0.1:6363,ESTABLISHED,8116
|
||||||
|
nxserver.bin,TCP,127.0.0.1:49698,127.0.0.1:15907,ESTABLISHED,8116
|
||||||
|
AppleMobileDeviceService.exe,TCP,127.0.0.1:49674,127.0.0.1:5354,ESTABLISHED,4280
|
||||||
|
AppleMobileDeviceService.exe,TCP,127.0.0.1:49670,127.0.0.1:5354,ESTABLISHED,4280
|
||||||
|
tailscaled.exe,TCP,127.0.0.1:41112,127.0.0.1:50530,ESTABLISHED,8076
|
||||||
|
nxserver.bin,TCP,127.0.0.1:31770,127.0.0.1:49766,ESTABLISHED,8116
|
||||||
|
nxnode.bin,TCP,127.0.0.1:28488,127.0.0.1:50402,ESTABLISHED,11608
|
||||||
|
nxclient.bin,TCP,127.0.0.1:26068,127.0.0.1:50408,ESTABLISHED,11836
|
||||||
|
nxclient.bin,TCP,127.0.0.1:25001,127.0.0.1:50406,ESTABLISHED,11836
|
||||||
|
nxnode.bin,TCP,127.0.0.1:23938,127.0.0.1:50405,ESTABLISHED,11608
|
||||||
|
nxserver.bin,TCP,127.0.0.1:22921,127.0.0.1:49762,ESTABLISHED,8116
|
||||||
|
nxserver.bin,TCP,127.0.0.1:22890,127.0.0.1:50792,ESTABLISHED,8116
|
||||||
|
nxserver.bin,TCP,127.0.0.1:21968,127.0.0.1:50395,ESTABLISHED,8116
|
||||||
|
nxservice64.exe,TCP,127.0.0.1:19492,127.0.0.1:50160,ESTABLISHED,5544
|
||||||
|
nxclient.bin,TCP,127.0.0.1:19231,127.0.0.1:50409,ESTABLISHED,11836
|
||||||
|
nxnode.bin,TCP,127.0.0.1:17311,127.0.0.1:50397,ESTABLISHED,11608
|
||||||
|
nxserver.bin,TCP,127.0.0.1:16950,127.0.0.1:49772,ESTABLISHED,8116
|
||||||
|
nxserver.bin,TCP,127.0.0.1:16619,127.0.0.1:49767,ESTABLISHED,8116
|
||||||
|
nxserver.bin,TCP,127.0.0.1:15907,127.0.0.1:49698,ESTABLISHED,8116
|
||||||
|
nxclient.bin,TCP,127.0.0.1:10632,127.0.0.1:50407,ESTABLISHED,11836
|
||||||
|
nxnode.bin,TCP,127.0.0.1:10055,127.0.0.1:50174,ESTABLISHED,11608
|
||||||
|
nxserver.bin,TCP,127.0.0.1:7039,127.0.0.1:49765,ESTABLISHED,8116
|
||||||
|
nxserver.bin,TCP,127.0.0.1:6363,127.0.0.1:49761,ESTABLISHED,8116
|
||||||
|
mDNSResponder.exe,TCP,127.0.0.1:5354,127.0.0.1:49674,ESTABLISHED,4076
|
||||||
|
mDNSResponder.exe,TCP,127.0.0.1:5354,127.0.0.1:49670,ESTABLISHED,4076
|
||||||
|
nxserver.bin,TCP,127.0.0.1:4742,127.0.0.1:50778,ESTABLISHED,8116
|
||||||
|
nxserver.bin,TCP,104.194.122.206:53343,208.59.79.12:443,TIME_WAIT,0
|
||||||
|
nxserver.bin,TCP,104.194.122.206:53340,54.212.237.219:443,TIME_WAIT,0
|
||||||
|
firefox.exe,TCP,104.194.122.206:53339,54.212.237.219:443,ESTABLISHED,8008
|
||||||
|
firefox.exe,TCP,104.194.122.206:53337,54.212.237.219:443,ESTABLISHED,8008
|
||||||
|
firefox.exe,TCP,104.194.122.206:53335,208.59.79.12:443,TIME_WAIT,0
|
||||||
|
firefox.exe,TCP,104.194.122.206:53334,208.59.79.12:443,ESTABLISHED,8008
|
||||||
|
VSCodium.exe,TCP,104.194.122.206:53314,76.76.21.61:443,ESTABLISHED,3816
|
||||||
|
VSCodium.exe,TCP,104.194.122.206:53313,76.76.21.164:443,ESTABLISHED,3816
|
||||||
|
VSCodium.exe,TCP,104.194.122.206:53312,76.76.21.164:443,CLOSE_WAIT,3816
|
||||||
|
firefox.exe,TCP,104.194.122.206:53307,104.192.142.9:443,ESTABLISHED,8008
|
||||||
|
firefox.exe,TCP,104.194.122.206:53300,54.201.164.58:443,TIME_WAIT,0
|
||||||
|
firefox.exe,TCP,104.194.122.206:53299,35.186.227.140:443,ESTABLISHED,8008
|
||||||
|
firefox.exe,TCP,104.194.122.206:53298,162.159.130.232:443,TIME_WAIT,0
|
||||||
|
firefox.exe,TCP,104.194.122.206:53297,162.159.128.232:443,TIME_WAIT,0
|
||||||
|
firefox.exe,TCP,104.194.122.206:53290,162.159.138.232:443,TIME_WAIT,0
|
||||||
|
firefox.exe,TCP,104.194.122.206:53289,162.159.135.234:443,ESTABLISHED,8008
|
||||||
|
firefox.exe,TCP,104.194.122.206:53284,72.21.91.29:80,TIME_WAIT,0
|
||||||
|
firefox.exe,TCP,104.194.122.206:53160,142.250.191.106:443,ESTABLISHED,8008
|
||||||
|
firefox.exe,TCP,104.194.122.206:53154,142.250.191.106:443,ESTABLISHED,8008
|
||||||
|
firefox.exe,TCP,104.194.122.206:52525,104.192.142.11:443,ESTABLISHED,8008
|
||||||
|
syncthing.exe,TCP,104.194.122.206:51451,172.245.94.35:22067,ESTABLISHED,8896
|
||||||
|
tailscaled.exe,TCP,104.194.122.206:51107,18.156.90.224:80,ESTABLISHED,8076
|
||||||
|
firefox.exe,TCP,104.194.122.206:50786,54.148.242.254:443,ESTABLISHED,8008
|
||||||
|
tailscaled.exe,TCP,104.194.122.206:50750,199.38.182.118:443,ESTABLISHED,8076
|
||||||
|
svchost.exe,TCP,104.194.122.206:49413,40.83.240.146:443,ESTABLISHED,6108
|
||||||
|
VcomSvc.exe,TCP,100.106.209.107:56843,192.168.1.173:5000,ESTABLISHED,5936
|
||||||
|
Windows System,TCP,100.106.209.107:52378,192.168.1.11:445,ESTABLISHED,4
|
||||||
|
Windows System,TCP,100.106.209.107:52377,192.168.1.216:445,ESTABLISHED,4
|
|
Loading…
Reference in New Issue