Browse Source

redirect the graphvizlib.wasm file to make firefox browser access the computed graph properly

tags/v1.1.0
shenghong96 5 years ago
parent
commit
6c7bff7c7a
1 changed files with 13 additions and 0 deletions
  1. +13
    -0
      mindinsight/backend/datavisual/static_resource_api.py

+ 13
- 0
mindinsight/backend/datavisual/static_resource_api.py View File

@@ -18,6 +18,7 @@ import sys

from flask import current_app
from flask import make_response
from flask import redirect
from flask import Blueprint

from mindinsight.conf import settings
@@ -36,6 +37,18 @@ def index():
return make_response(html_content)


@BLUEPRINT.route("/graphvizlib.wasm", methods=["GET"])
def return_wasm_file():
"""
Interface to redirect graphvizlib.wasm

When accessing the graphvizlib.wasm file in front module via Firefox browser, the file path will change to
"/graphvizlib.wasm" which makes the computed diagram inaccessible. Redirecting the path to correct address can
ensure the computed graph accessible properly.
"""
return redirect(location="static/js/graphvizlib.wasm")


def init_module(app):
"""
Init module entry.


Loading…
Cancel
Save