def post_process_table(self, field_options): resolution = field_options['resolution'] if resolution != 'auto': if isinstance(resolution, int): res = resolution else: res = int(timedelta_total_seconds(parse_timedelta(resolution))) resolution = Report.RESOLUTION_MAP[res] field_options['resolution'] = resolution fields_add_device_selection(self, keyword='netprofiler_device', label='NetProfiler', module='netprofiler', enabled=True) duration = field_options['duration'] if isinstance(duration, int): duration = "%d min" % duration fields_add_time_selection(self, initial_duration=duration, durations=field_options['durations']) fields_add_resolution(self, initial=field_options['resolution'], resolutions=field_options['resolutions'], special_values=['auto']) self.fields_add_filterexpr()
def post_process_table(self, field_options): # Add a time selection field fields_add_time_selection(self, show_end=False, initial_duration=field_options['duration'], durations=field_options['durations']) # Add time resolution selection fields_add_resolution(self, initial=field_options['resolution'], resolutions=field_options['resolutions']) # Add end date field self.fields_add_end_date()
def post_process_table(self, field_options): # # Add criteria fields that are required by this table # TableField.create(keyword='entire_pcap', obj=self, field_cls=forms.BooleanField, label='Entire PCAP', initial=True, required=False) fields_add_time_selection(self, show_start=True, show_end=True, show_duration=False) fields_add_resolution(obj=self, initial=field_options['resolution'], resolutions=field_options['resolutions']) fields_add_pcapfile( obj=self, astextfield=field_options['pcapfile_astextfield']) fields_add_filterexpr(obj=self)
def post_process_table(self, field_options): duration = field_options['duration'] if isinstance(duration, int): duration = "{}m".format(duration) fields_add_device_selection(self, keyword='netshark_device', label='NetShark', module='netshark', enabled=True) func = Function(netshark_msa_file_choices, self.options) TableField.create( keyword='netshark_source_name', label='Source', obj=self, field_cls=IDChoiceField, field_kwargs={'widget_attrs': { 'class': 'form-control' }}, parent_keywords=['netshark_device'], dynamic=True, pre_process_func=func) fields_add_time_selection(self, initial_duration=duration, durations=field_options['durations']) fields_add_resolution(self, initial=field_options['resolution'], resolutions=field_options['resolutions']) if self.options.include_filter: fields_add_filterexpr(self) if self.options.include_bpf_filter: fields_add_bpf_filterexpr(self) if self.options.show_entire_msa: TableField.create(keyword='entire_msa', obj=self, field_cls=forms.BooleanField, label='Entire MSA (ignore start/end times)', initial=True, required=False)
def post_process_table(self, field_options): duration = field_options['duration'] if isinstance(duration, int): duration = "%dm" % duration fields_add_device_selection(self, keyword='netshark_device', label='NetShark', module='netshark', enabled=True) func = Function(netshark_source_name_choices, self.options) TableField.create( keyword='netshark_source_name', label='Source', obj=self, field_cls=IDChoiceField, field_kwargs={'widget_attrs': { 'class': 'form-control' }}, parent_keywords=['netshark_device'], dynamic=True, pre_process_func=func) if self.options.include_persistent: TableField.create(keyword='netshark_persistent', label='Persistent View', obj=self, field_cls=forms.BooleanField, initial=False) fields_add_time_selection(self, initial_duration=duration, durations=field_options['durations']) fields_add_resolution(self, initial=field_options['resolution'], resolutions=field_options['resolutions']) if self.options.include_filter: fields_add_filterexpr(self) if self.options.include_bpf_filter: fields_add_bpf_filterexpr(self)
def post_process_table(self, field_options): fields_add_device_selection(self, keyword='netshark_device', label='NetShark', module='netshark', enabled=True) fields_add_time_selection(self, show_start=True, initial_start_time='now-1m', show_end=True, show_duration=False) fields_add_resolution(self, initial=field_options['resolution'], resolutions=field_options['resolutions']) func = Function(netshark_source_name_choices, self.options) TableField.create(keyword='netshark_source_name', label='Source', obj=self, field_cls=forms.ChoiceField, parent_keywords=['netshark_device'], dynamic=True, pre_process_func=func) fields_add_filterexpr(obj=self) self.add_column('filename', datatype='string')
def post_process_table(self, field_options): duration = field_options['duration'] if isinstance(duration, int): duration = "{}m".format(duration) fields_add_device_selection(self, keyword='netshark_device', label='NetShark', module='netshark', enabled=True) func = Function(netshark_msa_file_choices, self.options) TableField.create(keyword='netshark_source_name', label='Source', obj=self, field_cls=IDChoiceField, field_kwargs={ 'widget_attrs': {'class': 'form-control'} }, parent_keywords=['netshark_device'], dynamic=True, pre_process_func=func) fields_add_time_selection(self, initial_duration=duration, durations=field_options['durations']) fields_add_resolution(self, initial=field_options['resolution'], resolutions=field_options['resolutions']) if self.options.include_filter: fields_add_filterexpr(self) if self.options.include_bpf_filter: fields_add_bpf_filterexpr(self) if self.options.show_entire_msa: TableField.create(keyword='entire_msa', obj=self, field_cls=forms.BooleanField, label='Entire MSA (ignore start/end times)', initial=True, required=False)
def post_process_table(self, field_options): duration = field_options['duration'] if isinstance(duration, int): duration = "%dm" % duration fields_add_device_selection(self, keyword='netshark_device', label='NetShark', module='netshark', enabled=True) func = Function(netshark_source_name_choices, self.options) TableField.create( keyword='netshark_source_name', label='Source', obj=self, field_cls=IDChoiceField, field_kwargs={'widget_attrs': {'class': 'form-control'}}, parent_keywords=['netshark_device'], dynamic=True, pre_process_func=func ) if self.options.include_persistent: TableField.create(keyword='netshark_persistent', label='Persistent View', obj=self, field_cls=forms.BooleanField, initial=False) fields_add_time_selection(self, initial_duration=duration, durations=field_options['durations']) fields_add_resolution(self, initial=field_options['resolution'], resolutions=field_options['resolutions']) if self.options.include_filter: fields_add_filterexpr(self) if self.options.include_bpf_filter: fields_add_bpf_filterexpr(self)
def post_process_table(self, field_options): duration = field_options['duration'] if isinstance(duration, int): duration = "%dm" % duration fields_add_device_selection(self, keyword='netshark_device', label='NetShark', module='netshark', enabled=True) TableField.create(keyword='netshark_source_name', label='Source', obj=self, field_cls=forms.ChoiceField, parent_keywords=['netshark_device'], dynamic=True, pre_process_func=Function(netshark_source_name_choices)) fields_add_time_selection(self, initial_duration=duration, durations=field_options['durations']) fields_add_resolution(self, initial=field_options['resolution'], resolutions=field_options['resolutions']) self.fields_add_filterexpr()
def post_process_table(self, field_options): # # Add criteria fields that are required by this table # if self.options.show_entire_pcap: TableField.create(keyword='entire_pcap', obj=self, field_cls=forms.BooleanField, label='Entire PCAP', initial=True, required=False) fields_add_time_selection(self, show_start=True, show_end=True, show_duration=False) fields_add_resolution(obj=self, initial=field_options['resolution'], resolutions=field_options['resolutions']) if self.options.show_pcap_mgr: fields_add_pcapmgr_selection(obj=self) fields_add_filterexpr(obj=self)
def post_process_table(self, field_options): self.add_column('time', 'Time', iskey=True, datatype='time') self.add_column('value', 'Value') fields_add_time_selection(self) fields_add_resolution(self)