Example #1
0
File: routes.py Project: fublu/eNMS
def device_management() -> dict:
    return dict(
        fields=device_table_properties,
        add_device_form=AddDevice(request.form),
        device_automation_form=DeviceAutomationForm(request.form),
        gotty_connection_form=GottyConnectionForm(request.form),
    )
Example #2
0
def configuration_management() -> dict:
    return dict(
        add_device_form=AddDevice(request.form),
        fields=device_configuration_properties,
        compare_configurations_form=CompareConfigurationsForm(request.form),
        pool_restriction_form=PoolRestrictionForm(request.form),
    )
Example #3
0
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),
    )
Example #4
0
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,
    )
Example #5
0
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'))
Example #6
0
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"),
    )