bug fix with context handling

This commit is contained in:
Steve Nyemba 2022-10-27 22:23:21 -05:00
parent 1a22662fb8
commit dd81e23d67
7 changed files with 24 additions and 13 deletions

View File

@ -1,10 +1,11 @@
{ {
"system": { "system": {
"id":"genomix.studio",
"version": "0.0.1", "version": "0.0.1",
"context": "", "context": "/studio",
"logo": "logo.svg", "logo": "logo.svg",
"app": { "app": {
"debug": true, "debug": true, "host":"0.0.0.0","threaded":true,
"port": "9000" "port": "9000"
} }
}, },

View File

@ -63,7 +63,7 @@
outline: 0px; outline: 0px;
} }
</style> </style>
<script src="static/js/studio.js"></script> <script src="{{system.context}}/static/js/studio.js"></script>
<div class="studio-pane"> <div class="studio-pane">

View File

@ -1,7 +1,7 @@
<link href="{{context}}/static/css/default.css" type="text/css" rel="stylesheet"> <link href="{{system.context}}/static/css/default.css" type="text/css" rel="stylesheet">
<link href="{{context}}/static/css/border.css" type="text/css" rel="stylesheet"> <link href="{{system.context}}/static/css/border.css" type="text/css" rel="stylesheet">
<link href="{{context}}/static/css/border.css" type="text/css" rel="stylesheet"> <link href="{{system.context}}/static/css/border.css" type="text/css" rel="stylesheet">
<script src="{{system.context}}/static/js/fontawesome/js/all.js"></script> <script src="{{system.context}}/static/js/fontawesome/js/all.js"></script>
<script src="{{system.context}}/static/js/jquery/jquery.js"></script> <script src="{{system.context}}/static/js/jquery/jquery.js"></script>
<script src="{{system.context}}/static/js/search.js"></script> <script src="{{system.context}}/static/js/search.js"></script>

View File

@ -13,7 +13,9 @@ var _build = function(){
var http = HttpClient.instance() var http = HttpClient.instance()
http.setHeader('Content-Type','application/json') http.setHeader('Content-Type','application/json')
http.setData (JSON.stringify(_body)) http.setData (JSON.stringify(_body))
http.post('/api/studio/_build',function(x){ var _context = sessionStorage.getItem('genomix.studio')
var _uri = _context + '/api/studio/_build'
http.post(_uri,function(x){
stream = 'data:image/png;base64,' + x.responseText stream = 'data:image/png;base64,' + x.responseText
jx.dom.set.attribute('image','src',stream) jx.dom.set.attribute('image','src',stream)
// jx.dom.set.attribute('_avatar2','src',stream) // jx.dom.set.attribute('_avatar2','src',stream)
@ -55,7 +57,9 @@ _save = function(){
http = HttpClient.instance() http = HttpClient.instance()
http.setHeader('content-type','application/json') http.setHeader('content-type','application/json')
http.setData(JSON.stringify(_body)) http.setData(JSON.stringify(_body))
http.post('/api/studio/_save',function(x){ var _context = sessionStorage.getItem('genomix.studio')
var _uri = _context+'/api/studio/_save'
http.post(_uri,function(x){
if(x.status == 200){ if(x.status == 200){
// //
// //
@ -77,7 +81,9 @@ var _dialog = function(title,icon,msg,_pointer){
var http = HttpClient.instance() var http = HttpClient.instance()
http.setHeader('uri','dialog.html') http.setHeader('uri','dialog.html')
http.setHeader('dom','_dialog') http.setHeader('dom','_dialog')
http.post('/page',function(x){ var _context = sessionStorage.getItem('genomix.studio')
var _uri = _context + '/page'
http.post(_uri,function(x){
var _html = x.responseText.replace(/:title/,title).replace(/:message/,msg).replace(/:icon/,icon) var _html = x.responseText.replace(/:title/,title).replace(/:message/,msg).replace(/:icon/,icon)
jx.modal.show({html:_html,id:'_dialog'}) jx.modal.show({html:_html,id:'_dialog'})
if (_pointer == null){ if (_pointer == null){
@ -97,3 +103,4 @@ var _reset = function(){
_open('basic') _open('basic')
_build() _build()
} }

View File

@ -1,5 +1,5 @@
{% if layout.header.logo == True %} {% if layout.header.logo == True %}
<img src="{{context}}/static/img/{{system.logo}}"> <img src="{{system.context}}/static/img/{{system.logo}}">
{% endif %} {% endif %}
<div> <div>
<div class="title">{{layout.header.title}}</div> <div class="title">{{layout.header.title}}</div>

View File

@ -36,7 +36,10 @@ Vanderbilt University Medical Center
<script src="{{system.context}}/static/js/search.js"></script> <script src="{{system.context}}/static/js/search.js"></script>
<script src="{{system.context}}/static/js/fontawesome/js/all.js"></script> <script src="{{system.context}}/static/js/fontawesome/js/all.js"></script>
</head> </head>
<script>
sessionStorage.setItem('{{system.id}}','{{system.context|safe}}')
</script>
<body> <body>
<div class="main"> <div class="main">

View File

@ -20,7 +20,7 @@
</style> </style>
<div class="border-round border"> <div class="border-round border">
<div class="bold">Existing Avatars</div> <div class="bold">Existing Avatars</div>
<iframe width="100%" height="255px" scrolling="no" src="/page?uri=participants.html" frameborder="0" allowfullscreen></iframe> <iframe width="100%" height="255px" scrolling="no" src="{{system.context}}/page?uri=participants.html" frameborder="0" allowfullscreen></iframe>
</div> </div>