mirror of
https://github.com/Novartis/cellxgene-gateway.git
synced 2026-10-02 08:08:11 +08:00
added support for GATEWAY_EXTRA_SCRIPTS
This commit is contained in:
@@ -14,6 +14,7 @@ cellxgene_data = os.environ.get("CELLXGENE_DATA")
|
||||
gateway_host = os.environ.get("GATEWAY_HOST")
|
||||
gateway_protocol = os.environ.get("GATEWAY_PROTOCOL")
|
||||
ip = os.environ.get("GATEWAY_IP")
|
||||
extra_scripts = os.environ.get("GATEWAY_EXTRA_SCRIPTS")
|
||||
|
||||
env_vars = {
|
||||
"CELLXGENE_LOCATION": cellxgene_location,
|
||||
|
||||
@@ -7,10 +7,11 @@
|
||||
# OR CONDITIONS OF ANY KIND, either express or implied. See the License for
|
||||
# the specific language governing permissions and limitations under the License.
|
||||
|
||||
from cellxgene_gateway import env
|
||||
|
||||
def get_extra_scripts():
|
||||
# can be array of script tags to inject on every page, e.g. for google analytics could be
|
||||
# ['https://www.googletagmanager.com/gtag/js?id=UA-123456-2',
|
||||
# f"{env.gateway_protocol}://{env.gateway_host}/static/js/google_ua.js"]
|
||||
# where google_ua.js is a script you add to the static/js folder prior to deployment.
|
||||
return []
|
||||
return [] if env.extra_scripts is None else [p.strip() for p in env.extra_scripts.split(",") if len(p.strip()) > 0]
|
||||
|
||||
Reference in New Issue
Block a user