def change_webapp(self, old_id, new_id, type, port): servers = ServerManager(self.app) rm = RuleManager(self.app) s = servers.get(old_id)[0] r = rm.get(s) rm.remove(s) servers.update(old_id, new_id, new_id + ' (' + type + ')', 'gen-earth', [('tcp', port)]) rm.set(s, r) FWMonitor(self.app).regen() FWMonitor(self.app).save()
def change_webapp(self, oldsite, newsite): servers = ServerManager(self.app) rm = RuleManager(self.app) s = servers.get(oldsite.name)[0] r = rm.get(s) rm.remove(s) servers.update(oldsite.name, newsite.name, newsite.name + ' (' + newsite.stype + ')', 'gen-earth', [('tcp', newsite.port)]) rm.set(s, r) FWMonitor(self.app).regen() FWMonitor(self.app).save()
def port_changed(self, s): sm = ServerManager(self.app) rm = RuleManager(self.app) for p in s.services: try: if p[2] != [] and sm.get(p[1]) != []: sg = sm.get(p[1])[0] r = rm.get(sg) rm.remove(sg) sm.update(p[1], p[1], p[0], s.iconfont, p[2]) rm.set(sg, r) elif p[2] != []: sg = sm.get(p[1])[0] sm.add(s.plugin_id, p[1], p[0], s.iconfont, p[2]) rm.set(sg, 2) FWMonitor(self.app).regen() FWMonitor(self.app).save() except IndexError: continue
def port_changed(self, s): sm = ServerManager(self.app) rm = RuleManager(self.app) for p in s.services: try: if p['ports'] != [] and sm.get(p['binary']) != []: sg = sm.get(p['binary'])[0] r = rm.get(sg) rm.remove(sg) sm.update(p['binary'], p['binary'], p['name'], s.icon, p['ports']) rm.set(sg, r) elif p['ports'] != []: sg = sm.get(p['binary'])[0] sm.add(s.plugin_id, p['binary'], p['name'], s.icon, p['ports']) rm.set(sg, 2) FWMonitor(self.app).regen() FWMonitor(self.app).save() except IndexError: continue