class Squid(SectionPlugin): def init(self): self.title = 'Squid' self.icon = 'exchange' self.category = _('Software') self.append(self.ui.inflate('squid:main')) self.find('servicebar').name = platform_select( debian='squid3', centos='squid', default='squid', ) self.find('servicebar').reload() self.binder = Binder(None, self.find('config')) self.find('acl').new_item = lambda c: ACLData(name='new') self.find('http_access').new_item = lambda c: HTTPAccessData() self.find('http_port').new_item = lambda c: HTTPPortData() self.find('https_port').new_item = lambda c: HTTPSPortData() for e in self.nearest(lambda x: x.id == 'options'): e.new_item = lambda c: ArgumentData() self.config = SquidConfig(path='/etc/squid3/squid.conf') def on_page_load(self): self.refresh() def refresh(self): self.config.load() self.binder.setup(self.config.tree).populate() @on('save', 'click') def on_save(self): self.binder.update() self.config.save() self.refresh()
class Squid (SectionPlugin): def init(self): self.title = _('Squid') self.icon = 'exchange' self.category = _('Software') self.append(self.ui.inflate('squid:main')) self.binder = Binder(None, self.find('config')) self.find('acl').new_item = lambda c: ACLData() self.find('http_access').new_item = lambda c: HTTPAccessData() self.find('http_port').new_item = lambda c: HTTPPortData() self.find('https_port').new_item = lambda c: HTTPSPortData() self.config = SquidConfig(path='/etc/squid3/squid.conf') def on_page_load(self): self.refresh() def refresh(self): self.config.load() self.binder.reset(self.config.tree).autodiscover().populate() @on('save', 'click') def on_save(self): self.binder.update() self.config.save() self.refresh()
class Squid(SectionPlugin): def init(self): self.title = 'Squid' self.icon = 'exchange' self.category = 'Software' self.append(self.ui.inflate('squid:main')) self.binder = Binder(None, self.find('config')) self.find('acl').new_item = lambda c: ACLData() self.find('http_access').new_item = lambda c: HTTPAccessData() self.find('http_port').new_item = lambda c: HTTPPortData() self.find('https_port').new_item = lambda c: HTTPSPortData() self.config = SquidConfig(path='/etc/squid3/squid.conf') #def post_item_bind(object, collection, item, ui): # ui.find('disconnect').on('click', self.on_disconnect, item) #self.find('connections').post_item_bind = post_item_bind def on_page_load(self): self.refresh() def refresh(self): self.config.load() self.binder.reset(self.config.tree).autodiscover().populate() @on('save', 'click') def on_save(self): self.binder.update() self.config.save() self.refresh()
class Squid (SectionPlugin): def init(self): self.title = 'Squid' self.icon = 'exchange' self.category = _('Software') self.append(self.ui.inflate('squid:main')) self.find('servicebar').name = platform_select( debian='squid3', centos='squid', default='squid', ) self.find('servicebar').reload() self.binder = Binder(None, self.find('config')) self.find('acl').new_item = lambda c: ACLData(name='new') self.find('http_access').new_item = lambda c: HTTPAccessData() self.find('http_port').new_item = lambda c: HTTPPortData() self.find('https_port').new_item = lambda c: HTTPSPortData() for e in self.nearest(lambda x: x.id == 'options'): e.new_item = lambda c: ArgumentData() self.config = SquidConfig(path='/etc/squid3/squid.conf') def on_page_load(self): self.refresh() def refresh(self): self.config.load() self.binder.setup(self.config.tree).populate() @on('save', 'click') def on_save(self): self.binder.update() self.config.save() self.refresh()
def init(self): self.title = 'Squid' self.icon = 'exchange' self.category = 'Software' self.append(self.ui.inflate('squid:main')) self.binder = Binder(None, self.find('config')) self.find('acl').new_item = lambda c: ACLData() self.find('http_access').new_item = lambda c: HTTPAccessData() self.find('http_port').new_item = lambda c: HTTPPortData() self.find('https_port').new_item = lambda c: HTTPSPortData() self.config = SquidConfig(path='/etc/squid3/squid.conf')
def init(self): self.title = 'Squid' self.icon = 'exchange' self.category = _('Software') self.append(self.ui.inflate('squid:main')) self.find('servicebar').name = platform_select( debian='squid3', centos='squid', default='squid', ) self.find('servicebar').reload() self.binder = Binder(None, self.find('config')) self.find('acl').new_item = lambda c: ACLData() self.find('http_access').new_item = lambda c: HTTPAccessData() self.find('http_port').new_item = lambda c: HTTPPortData() self.find('https_port').new_item = lambda c: HTTPSPortData() self.config = SquidConfig(path='/etc/squid3/squid.conf')
def init(self): self.title = _('Squid') self.icon = 'exchange' self.category = _('Software') self.append(self.ui.inflate('squid:main')) self.binder = Binder(None, self.find('config')) self.find('acl').new_item = lambda c: ACLData() self.find('http_access').new_item = lambda c: HTTPAccessData() self.find('http_port').new_item = lambda c: HTTPPortData() self.find('https_port').new_item = lambda c: HTTPSPortData() self.config = SquidConfig(path='/etc/squid3/squid.conf')
def init(self): self.title = 'Squid' self.icon = 'exchange' self.category = _('Software') self.append(self.ui.inflate('squid:main')) self.find('servicebar').name = platform_select( debian='squid3', centos='squid', default='squid', ) self.find('servicebar').reload() self.binder = Binder(None, self.find('config')) self.find('acl').new_item = lambda c: ACLData('new') self.find('http_access').new_item = lambda c: HTTPAccessData() self.find('http_port').new_item = lambda c: HTTPPortData() self.find('https_port').new_item = lambda c: HTTPSPortData() self.config = SquidConfig(path='/etc/squid3/squid.conf')