示例#1
0
文件: routes.py 项目: 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),
    )
示例#2
0
def configuration_management():
    return dict(
        fields=device_configuration_properties,
        devices=serialize('Device'),
        compare_configurations_form=CompareConfigurationsForm(request.form),
        add_device_form=ConfigurationManagementForm(request.form),
        gotty_connection_form=GottyConnectionForm(request.form),
        poller_form=PollerForm(request.form),
        search_configurations_form=SearchConfigurationForm(request.form))
示例#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),
    )
示例#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,
    )
示例#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'))
示例#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"),
    )