summaryrefslogtreecommitdiff
path: root/cli/app/controllers/graph_controller.py
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2021-03-17 18:11:26 +0100
committerJules Laplace <julescarbon@gmail.com>2021-03-17 18:11:26 +0100
commitd165a0727e42349d935ab3ee287242f1e5029742 (patch)
treeb4fa68209127efdd4eb46c82eaef280535692611 /cli/app/controllers/graph_controller.py
parent92566ba17f5e921d5bff1f3fb4e4b0d92ca4fd39 (diff)
frontend. export/view button. interactivity sanity check
Diffstat (limited to 'cli/app/controllers/graph_controller.py')
-rw-r--r--cli/app/controllers/graph_controller.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/cli/app/controllers/graph_controller.py b/cli/app/controllers/graph_controller.py
index 7efda73..fcca50a 100644
--- a/cli/app/controllers/graph_controller.py
+++ b/cli/app/controllers/graph_controller.py
@@ -7,6 +7,7 @@ from app.sql.models.graph import Graph, GraphForm
from app.sql.models.page import Page
from app.sql.models.tile import Tile
from app.controllers.crud_controller import CrudView
+from app.site.export import export_site
class GraphView(CrudView):
model = Graph
@@ -20,7 +21,7 @@ class GraphView(CrudView):
@route('/name/<graph_path>', methods=['GET'])
def get_name(self, graph_path: str):
"""
- Fetch a single {model}.
+ Fetch a single graph.
"""
session = Session()
item = session.query(self.model).filter(self.model.path == graph_path).first()
@@ -36,3 +37,11 @@ class GraphView(CrudView):
}
session.close()
return jsonify(result)
+
+ @route('/export/<graph_path>', methods=['GET'])
+ def export(self, graph_path: str):
+ export_site(opt_graph_path=graph_path)
+ result = {
+ 'status': 'ok',
+ }
+ return jsonify(result)