Commit a3bf5842 authored by Mathieu Giraud's avatar Mathieu Giraud

Merge branch 'feature-sc/2927-identify-server' into 'dev'

Add server identifier to conf.js

See merge request !841
parents d084f99f cc0a5b3e
Pipeline #188052 passed with stages
in 9 minutes and 31 seconds
......@@ -423,6 +423,7 @@ deploy_review_server:
- make -C browser icons
- cp ./docker/vidjil-client/conf/conf.js ./browser/js/conf.js
- sed -i -r "s/localhost/${CI_BUILD_REF_SLUG}.server.ci.vidjil.org/g" ./browser/js/conf.js
- 'sed -i "s/\"server_id\" : \"\"/\"server_id\" : \"${CI_BUILD_REF_SLUG}.server.ci.vidjil.org\"/" ./browser/js/conf.js'
- sed -r 's/^.*FILE_SOURCE.*$/FILE_SOURCE="\/usr\/share\/vidjil\/demo"/' ./docker/vidjil-server/conf/defs.py > ./server/web2py/applications/vidjil/modules/defs.py
- sed -i -e "/EMAIL_SUBJECT_START/c EMAIL_SUBJECT_START='[Vidjil/CI][$CI_COMMIT_REF_NAME]'" -e '/FROM_EMAIL/c FROM_EMAIL="server.ci@vidjil.org"' ./server/web2py/applications/vidjil/modules/defs.py
- mv docker docker_${CI_BUILD_REF_SLUG}
......
......@@ -307,6 +307,7 @@
<div id="menu_right_part">
<div id="server-id" class="menu"></div>
<div id="fps" style="display: none"> </div>
<div id="header_messages" class="message_container header"></div>
......
......@@ -45,6 +45,9 @@ Model_loader.prototype = {
if (typeof config != 'undefined' && typeof config.autoload_analysis != 'undefined')
params.analysis = config.autoload_analysis
if (typeof config != 'undefined' && typeof config.server_id != 'undefined')
document.getElementById('server-id').innerText = config.server_id
/** load the default vidjil file, open the database or display the welcome popup depending on the case*/
if (typeof params.data !== "undefined") {
if (typeof params.analysis !== "undefined"){
......
......@@ -731,6 +731,8 @@ Now we need to configure the database connection parameters:
```
This tells the browser to access the server on the current domain.
You may also add a variable called `server_id` in order to name different
instances and environments; it will be displayed in the top menu.
- copy vidjil/server/web2py/applications/vidjil/modules/defs.py.sample
to vidjil/server/web2py/applications/vidjil/modules/defs.py
......
......@@ -16,6 +16,7 @@ var config = {
*/
/* 1) Patient database */
"server_id" : "",
"use_database" : true,
"db_address" : "https://localhost/vidjil/", // Public test server
"login" : "",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment