Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in cpdbviz that previously caused any data not listed in /viz… #24

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ def list_projects(request: Request):
projectName2Title = {case_example: projectName2Title[case_example] for case_example in case_examples if case_example in projectName2Title}
return dict(sorted(projectName2Title.items(), key=lambda item: item[1]))

#Get title for project
@api.get("/title/{project}")
def get_title(project: str):
return dir_name2project_data[project]['title']

@api.get("/data/{project}/{viz}")
def get_viz_data(project: str,
viz: str,
Expand Down
8 changes: 3 additions & 5 deletions public/js/cpdbviz.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,14 @@ document.addEventListener('DOMContentLoaded', function() {
options = {};
instances = M.Collapsible.init(elems, options);



// Populate page title
$.ajax({
url: './api/list',
url: './api/title/'+projectId,
contentType: "application/json",
dataType: 'json',
success: function(res) {
$("#page_header").text(res[projectId]);
$("#page_title").text(res[projectId]);
$("#page_header").text(res);
$("#page_title").text(res);
}
});

Expand Down