mirror of
https://github.com/evilsocket/opensnitch.git
synced 2025-03-04 08:34:40 +01:00
ui,stats: fixed adding rules to the db from context menu
When cloning a rule, or applying a rule to a node, if the rule was of type List (had multiple operators), the operators were not saved to the DB. Closes: #1027
This commit is contained in:
parent
2fc9ed276b
commit
4499a5aaf0
1 changed files with 2 additions and 2 deletions
|
@ -1121,7 +1121,7 @@ class StatsDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
|
|||
if records == None or records.size() == -1:
|
||||
rule = Rule.new_from_records(records)
|
||||
rule.name = "cloned-{0}-{1}".format(idx, rule.name)
|
||||
self._db.insert_rule(rule, node_addr)
|
||||
self._rules.add_rules(node_addr, [rule])
|
||||
break
|
||||
|
||||
if records != None and records.size() == -1:
|
||||
|
@ -1140,7 +1140,7 @@ class StatsDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
|
|||
noti = ui_pb2.Notification(type=ui_pb2.CHANGE_RULE, rules=[rule])
|
||||
nid = self._nodes.send_notification(node_addr, noti, self._notification_callback)
|
||||
if nid != None:
|
||||
self._db.insert_rule(rule, node_addr)
|
||||
self._rules.add_rules(node_addr, [rule])
|
||||
self._notifications_sent[nid] = noti
|
||||
|
||||
def _table_menu_change_rule_field(self, cur_idx, model, selection, field, value):
|
||||
|
|
Loading…
Add table
Reference in a new issue