testing- add blacklist button

testing
Cole Deck 2 years ago
parent b4a46ad253
commit f6cc6b6fef

@ -149,6 +149,7 @@ class ServerPanel(wx.Panel):
self.sub_sizer_left = wx.BoxSizer(wx.VERTICAL) self.sub_sizer_left = wx.BoxSizer(wx.VERTICAL)
self.sub_sizer_right = wx.BoxSizer(wx.VERTICAL) self.sub_sizer_right = wx.BoxSizer(wx.VERTICAL)
self.sub_sizer_stats = wx.BoxSizer(wx.VERTICAL) self.sub_sizer_stats = wx.BoxSizer(wx.VERTICAL)
self.sub_sizer_filter = wx.BoxSizer(wx.VERTICAL)
self.row_obj_dict = {} self.row_obj_dict = {}
self.list_ctrl = wx.ListCtrl( self.list_ctrl = wx.ListCtrl(
self, size=(-1, 400), self, size=(-1, 400),
@ -184,6 +185,7 @@ class ServerPanel(wx.Panel):
self.main_sizer.Add(self.secondary_sizer, 0, wx.ALL | wx.EXPAND, 20) self.main_sizer.Add(self.secondary_sizer, 0, wx.ALL | wx.EXPAND, 20)
self.secondary_sizer.Add(self.sub_sizer_left, 0, wx.ALL | wx.CENTER, 20) self.secondary_sizer.Add(self.sub_sizer_left, 0, wx.ALL | wx.CENTER, 20)
self.secondary_sizer.Add(self.sub_sizer_right, 0, wx.ALL | wx.CENTER, 20) self.secondary_sizer.Add(self.sub_sizer_right, 0, wx.ALL | wx.CENTER, 20)
self.secondary_sizer.Add(self.sub_sizer_filter, 0, wx.ALL | wx.CENTER, 20)
self.secondary_sizer.Add(self.sub_sizer_stats, 0, wx.ALL | wx.CENTER, 20) self.secondary_sizer.Add(self.sub_sizer_stats, 0, wx.ALL | wx.CENTER, 20)
self.start_button = wx.Button(self, label='Start IPPigeon') self.start_button = wx.Button(self, label='Start IPPigeon')
self.start_button.SetBackgroundColour((205, 215, 206)) self.start_button.SetBackgroundColour((205, 215, 206))
@ -203,6 +205,10 @@ class ServerPanel(wx.Panel):
#self.login_button.SetBackgroundColour((205, 215, 206)) #self.login_button.SetBackgroundColour((205, 215, 206))
self.quit_button.Bind(wx.EVT_BUTTON, self.on_quit) self.quit_button.Bind(wx.EVT_BUTTON, self.on_quit)
self.blacklist_button = wx.Button(self, label='Add to blacklist')
#self.login_button.SetBackgroundColour((205, 215, 206))
self.blacklist_button.Bind(wx.EVT_BUTTON, self.on_blacklist)
self.sub_sizer_right.Add(self.statustext, 0, wx.CENTER | wx.ALL | 100, 5) self.sub_sizer_right.Add(self.statustext, 0, wx.CENTER | wx.ALL | 100, 5)
self.sub_sizer_right.Add(self.logintext, 0, wx.CENTER | wx.ALL | 100, 5) self.sub_sizer_right.Add(self.logintext, 0, wx.CENTER | wx.ALL | 100, 5)
self.sub_sizer_left.Add(self.start_button, 0, wx.CENTER | wx.ALL | 100, 5) self.sub_sizer_left.Add(self.start_button, 0, wx.CENTER | wx.ALL | 100, 5)
@ -211,6 +217,7 @@ class ServerPanel(wx.Panel):
self.sub_sizer_right.Add(self.login_button, 0, wx.CENTER | wx.ALL | 100, 5) self.sub_sizer_right.Add(self.login_button, 0, wx.CENTER | wx.ALL | 100, 5)
self.sub_sizer_right.Add(self.quit_button, 0, wx.CENTER | wx.ALL | 100, 5) self.sub_sizer_right.Add(self.quit_button, 0, wx.CENTER | wx.ALL | 100, 5)
self.sub_sizer_stats.Add(self.stattext, 0, wx.CENTER | wx.ALL | 100, 5) self.sub_sizer_stats.Add(self.stattext, 0, wx.CENTER | wx.ALL | 100, 5)
self.sub_sizer_filter.Add(self.blacklist_button, 0, wx.CENTER | wx.ALL | 100, 5)
self.SetSizer(self.main_sizer) self.SetSizer(self.main_sizer)
self.start_button.Enable(enable=settings["loggedin"]) self.start_button.Enable(enable=settings["loggedin"])
self.stop_button.Enable(enable=settings["loggedin"]) self.stop_button.Enable(enable=settings["loggedin"])
@ -229,6 +236,10 @@ class ServerPanel(wx.Panel):
self.stop_button.Enable(enable=settings["loggedin"]) self.stop_button.Enable(enable=settings["loggedin"])
self.secondary_frame_button.Enable(enable=settings["loggedin"]) self.secondary_frame_button.Enable(enable=settings["loggedin"])
self.quit_button.Enable(enable=settings["loggedin"]) self.quit_button.Enable(enable=settings["loggedin"])
if self.list_ctrl.GetFirstSelected() < 0:
self.blacklist_button.Enable(enable=False)
else:
self.blacklist_button.Enable(enable=settings["loggedin"])
def updatedata(self): def updatedata(self):
global settings global settings
if settings["running"] == True: if settings["running"] == True:
@ -312,7 +323,21 @@ class ServerPanel(wx.Panel):
def on_quit(self, event): def on_quit(self, event):
global killme global killme
killme.value += 1 killme.value += 1
self.close_popup() self.Close()
self.Parent.Close()
def on_blacklist(self, event):
global settings
tmp = settings["appendbad"]
idx = self.list_ctrl.GetFirstSelected()
if idx < 0:
return
proto = self.list_ctrl.GetItem(idx, 1).GetText()
dest = self.list_ctrl.GetItem(idx, 3).GetText()
destip, destport = dest.split(":")
fprint([proto, destip, destport])
tmp.append(["N/A", proto, "N/A", "N/A", destip, destport, "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A"])
settings["appendbad"] = tmp
def ShowImage(self, imageFile): def ShowImage(self, imageFile):
if imageFile == "": if imageFile == "":

Loading…
Cancel
Save