Fix bugs with Collectors not stopping & not recognizing '*' origin types properly.
This commit is contained in:
@@ -1845,6 +1845,7 @@ class CollectorsDialog(QtWidgets.QDialog):
|
||||
currentClientCollectors = self.mainWindow.getClientCollectors()
|
||||
try:
|
||||
currentClientCollectors.pop(collectorToStop)
|
||||
self.mainWindow.stopRunningCollector(collectorToStop)
|
||||
self.mainWindow.setClientCollectors(currentClientCollectors)
|
||||
except KeyError:
|
||||
self.mainWindow.MESSAGEHANDLER.error('Trying to stop Collector that was never ran. Was confirmation that '
|
||||
@@ -1892,7 +1893,7 @@ class CollectorStartDialog(QtWidgets.QDialog):
|
||||
self.entitySelector.header().setSectionResizeMode(0, QtWidgets.QHeaderView.Stretch)
|
||||
relevantEntityFields = [(entity['uid'], entity[list(entity)[1]], entity['Entity Type'], entity['Icon'])
|
||||
for entity in entityDB.getAllEntities()
|
||||
if entity['Entity Type'] in originTypes or originTypes == '*']
|
||||
if entity['Entity Type'] in originTypes or '*' in originTypes]
|
||||
for eligibleEntity in relevantEntityFields:
|
||||
newTreeWidgetItem = QtWidgets.QTreeWidgetItem(self.entitySelector)
|
||||
newTreeWidgetItemPixmap = QtGui.QPixmap()
|
||||
|
||||
11
LinkScope.py
11
LinkScope.py
@@ -1296,6 +1296,17 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
currentCollectors[collector_uid] = time.time_ns() // 1000
|
||||
self.setClientCollectors(currentCollectors)
|
||||
|
||||
def stopRunningCollector(self, collectorUID: str):
|
||||
"""
|
||||
Stops collector. Need to be ran before setClientCollectors.
|
||||
"""
|
||||
with self.serverCollectorsLock:
|
||||
for collectorCategory in self.runningCollectors:
|
||||
for collectorName in self.runningCollectors[collectorCategory]:
|
||||
for collector in self.runningCollectors[collectorCategory][collectorName]:
|
||||
if collector['uid'] == collectorUID:
|
||||
self.runningCollectors[collectorCategory][collectorName].remove(collector)
|
||||
|
||||
def receiveProjectsListListener(self, projects: list) -> None:
|
||||
with self.serverProjectsLock:
|
||||
self.serverProjects = projects
|
||||
|
||||
Reference in New Issue
Block a user