From 43d0fdfc67ab286c20aeb749a20fd38f74a81e42 Mon Sep 17 00:00:00 2001 From: banko-marton Date: Fri, 24 Sep 2021 14:31:20 +0200 Subject: [PATCH] #62 Added MV link proto, working with local domain --- .../iqs_jupyter/analysis_extensions.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/source/incqueryserver-jupyter/iqs_jupyter/analysis_extensions.py b/source/incqueryserver-jupyter/iqs_jupyter/analysis_extensions.py index a55a1c2..266d062 100644 --- a/source/incqueryserver-jupyter/iqs_jupyter/analysis_extensions.py +++ b/source/incqueryserver-jupyter/iqs_jupyter/analysis_extensions.py @@ -145,7 +145,7 @@ def _monkey_patch_analysis_result_repr_html(self : iqs_client.AnalysisResult, he param_headers = " ".join(["{} ".format(html.escape(param)) for param in pattern_params]) match_rows = "\n".join([ "{}{}{}\n".format(row_index, self.matches[row_index].message, " ".join([ - " {}".format(_cell_to_html(_dict_to_element(argument_value.value))) + " {} LINK".format(_cell_to_html(_dict_to_element(argument_value.value)), _create_model_viewer_link(argument_value.value['element'])) # copartmentURI és relativeElementID for argument_value in self.matches[row_index].matching_elements ])) for row_index in range(len(self.matches)) ]) @@ -170,7 +170,18 @@ def _monkey_patch_analysis_result_repr_html(self : iqs_client.AnalysisResult, he '''.format(header_report, style, param_headers, match_rows) +from iqs_jupyter.authentication import IQSConnectorWidget +import requests +def _create_model_viewer_link(element): + # iqs_host = self.configuration + # req = requests.get(iqs_host+"/api/web-console-config") + # start = req.json()["modelViewerBaseURL"] + start = "127.0.0.1:8080/" + compURI = element['compartmentURI'] + relElementID = element['relativeElementID'] + + return start + '?compartmentURI='+compURI+'&elementId='+relElementID def _do_monkey_patching(): iqs_client.AnalysisResults._repr_html_ = _monkey_patch_analysis_results_repr_html