Esempio n. 1
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),
    )
Esempio n. 2
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,
    )
Esempio n. 3
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'))
Esempio n. 4
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"),
    )
Esempio n. 5
0
File: routes.py Progetto: fublu/eNMS
def link_management() -> dict:
    return dict(fields=link_table_properties, add_link_form=AddLink(request.form))
Esempio n. 6
0
def link_management() -> dict:
    return dict(
        fields=link_table_properties,
        add_link_form=AddLink(request.form),
        pool_restriction_form=PoolRestrictionForm(request.form),
    )
Esempio n. 7
0
def link_management():
    return dict(
        fields=link_table_properties,
        links=serialize('Link'),
        add_link_form=AddLink(request.form)
    )