def workflow_management() -> dict: return dict( compare_results_form=CompareResultsForm(request.form), fields=workflow_table_properties, workflows=serialize("Workflow"), workflow_creation_form=JobForm(request.form), )
def service_management() -> dict: return dict( compare_results_form=CompareResultsForm(request.form), fields=service_table_properties, service_form=JobForm(request.form), services_classes=sorted(service_classes), services=serialize("Service"), )
def object_export(request: dict, path_app: PosixPath) -> bool: workbook = Workbook() for obj_type in ("Device", "Link"): sheet = workbook.add_sheet(obj_type) for index, property in enumerate(export_properties[obj_type]): sheet.write(0, index, property) for obj_index, obj in enumerate(serialize(obj_type), 1): sheet.write(obj_index, index, obj[property]) workbook.save(path_app / "projects" / f'{request["export_filename"]}.xls') return True
def instance_management() -> dict: return dict( fields=instance_table_properties, instances=serialize("Instance"), form=AddInstance(request.form), )
def user_management() -> dict: return dict( fields=user_table_properties, users=serialize("User"), form=AddUser(request.form), )
def log_management() -> dict: return dict(fields=log_public_properties, logs=serialize("Log"))
def log_automation() -> dict: return dict( log_automation_form=LogAutomationForm(request.form), fields=log_rule_table_properties, log_rules=serialize("LogRule"), )