Skip to content

Commit 0cb8f03

Browse files
committed
Add an optional flags param for gocam_connections
Refs pombase/pombase-gocam#107
1 parent 2f8bd88 commit 0cb8f03

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

gocam_connections/templates/gocam_connections/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,16 @@
165165

166166
const summaryType = '{{summary_type}}';
167167
const apiPath = '{{api_path}}';
168+
const flags = '{{flags}}';
168169
const modelViewPath = '{{model_view_path}}';
169170

170171
let currentModels = [];
171172

172173
document.addEventListener('DOMContentLoaded', async function(){
173-
const url = apiPath + '/' + summaryType;
174+
let url = apiPath + '/' + summaryType;
175+
if (flags.length > 0) {
176+
url += ':' + flags;
177+
}
174178
const response = await fetch(url);
175179

176180
const modelConnections = await response.json();

gocam_connections/views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
def index(request):
44
summary_type = request.GET.get('summary_type', 'connected_only').strip()
55
api_path = request.GET.get('api_path', '').strip()
6+
flags = request.GET.get('flags', '').strip()
67
model_view_path = request.GET.get('model_view_path', '').strip()
78

89
context = {
910
'summary_type': summary_type,
1011
'api_path': api_path,
12+
'flags': flags,
1113
'model_view_path': model_view_path
1214
}
1315

0 commit comments

Comments
 (0)