def pool_management() -> dict: return dict( add_pool_form=AddPoolForm(request.form), pool_object_form=PoolObjectsForm(request.form), fields=pool_table_properties, add_device_form=AddDevice(request.form), add_link_form=AddLink(request.form), device_automation_form=DeviceAutomationForm(request.form), gotty_connection_form=GottyConnectionForm(request.form), )
def view(view_type: str) -> dict: parameters = get_one("Parameters").serialized return dict( add_pool_form=AddPoolForm(request.form), template=f"geographical_view.html", parameters=parameters, add_device_form=AddDevice(request.form), add_link_form=AddLink(request.form), device_automation_form=DeviceAutomationForm(request.form), subtype_sizes=subtype_sizes, gotty_connection_form=GottyConnectionForm(request.form), link_colors=link_subtype_to_color, pool_restriction_form=PoolRestrictionForm(request.form), view_type=view_type, )
def view(view_type): devices, parameters = fetch_all('Device'), get_one('Parameters').serialized return dict(template=f'{view_type}_view.html', pools=fetch_all('Pool'), parameters=parameters, view=request.form.get('view', parameters['default_view']), google_earth_form=GoogleEarthForm(request.form), add_device_form=AddDevice(request.form), add_link_form=AddLink(request.form), device_subtypes=device_subtypes, gotty_connection_form=GottyConnectionForm(request.form), link_colors=link_subtype_to_color, name_to_id={d.name: id for id, d in enumerate(devices)}, devices=serialize('Device'), links=serialize('Link'))
def view(view_type: str) -> dict: devices, parameters = fetch_all("Device"), get_one("Parameters").serialized return dict( template=f"{view_type}_view.html", pools=fetch_all("Pool"), parameters=parameters, view=request.form.get("view", parameters["default_view"]), google_earth_form=GoogleEarthForm(request.form), add_device_form=AddDevice(request.form), add_link_form=AddLink(request.form), device_subtypes=device_subtypes, gotty_connection_form=GottyConnectionForm(request.form), link_colors=link_subtype_to_color, name_to_id={d.name: id for id, d in enumerate(devices)}, devices=serialize("Device"), links=serialize("Link"), )
def link_management() -> dict: return dict(fields=link_table_properties, add_link_form=AddLink(request.form))
def link_management() -> dict: return dict( fields=link_table_properties, add_link_form=AddLink(request.form), pool_restriction_form=PoolRestrictionForm(request.form), )
def link_management(): return dict( fields=link_table_properties, links=serialize('Link'), add_link_form=AddLink(request.form) )