示例#1
0
文件: routes.py 项目: taycom/eNMS
def export():
    for cls_name, cls in diagram_classes.items():
        path = app.path / 'migrations' / 'export' / f'{cls_name}.yaml'
        with open(path, 'w') as migration_file:
            instances = diagram_classes[cls_name].export()
            dump(instances, migration_file, default_flow_style=False)
    return jsonify(True)
示例#2
0
文件: routes.py 项目: stenpiren/eNMS
def dashboard():
    return render_template(
        'dashboard.html',
        names=pretty_names,
        properties=type_to_diagram_properties,
        default_properties=default_diagrams_properties,
        counters={name: len(cls.query.all()) for name, cls in diagram_classes.items()}
    )