upd: view.main (api et wsclientbuilder en fonction de si local ou pas)
upd: view.vue-config (gstore.data.is_local : bool)
This commit is contained in:
parent
7092a5f9c8
commit
3c442e48a5
15
view/main.js
15
view/main.js
|
@ -16,17 +16,18 @@ import wrapper_vue from './vue/wrapper.vue'
|
||||||
|
|
||||||
/* (2) Initialisation
|
/* (2) Initialisation
|
||||||
---------------------------------------------------------*/
|
---------------------------------------------------------*/
|
||||||
/* (1) API */
|
/* (1) global store init */
|
||||||
window.api = new API("http://ndli1718/api/v/1.0/");
|
|
||||||
|
|
||||||
/* (2) wsclient */
|
|
||||||
window.wsc = new WSClientBuilder("wss://websocket.xdrm.io");
|
|
||||||
|
|
||||||
/* (3) global store init */
|
|
||||||
require('./vue-config');
|
require('./vue-config');
|
||||||
window.gstore.add('server', window._SERVER);
|
window.gstore.add('server', window._SERVER);
|
||||||
window.infobox = new InfoBox(gstore.data.info);
|
window.infobox = new InfoBox(gstore.data.info);
|
||||||
|
|
||||||
|
/* (2) API */
|
||||||
|
window.api = new API(gstore.data.is_local ? 'http://ndli1718/api/v/1.0/' : 'https://ndli1718.xdrm.io/api/v/1.0/');
|
||||||
|
|
||||||
|
/* (3) wsclient */
|
||||||
|
window.wsc = new WSClientBuilder(gstore.data.is_local ? 'ws://localhost:9999' : 'wss://websocket.xdrm.io');
|
||||||
|
|
||||||
|
|
||||||
/* (4) Init vue router */
|
/* (4) Init vue router */
|
||||||
Vue.use(VueRouter);
|
Vue.use(VueRouter);
|
||||||
const router = new VueRouter({
|
const router = new VueRouter({
|
||||||
|
|
|
@ -34,6 +34,7 @@ gstore.add('menu_item', {
|
||||||
});
|
});
|
||||||
|
|
||||||
gstore.add('URI', document.URL.replace(/^(?:\/\/|[^\/]+)*/, ''));
|
gstore.add('URI', document.URL.replace(/^(?:\/\/|[^\/]+)*/, ''));
|
||||||
|
gstore.add('is_local', document.URL.replace(/^http:\/\/([^\/]+).*$/, '$1') == 'ndli1718');
|
||||||
gstore.add('min_menu', false);
|
gstore.add('min_menu', false);
|
||||||
|
|
||||||
// Proccess current page from url
|
// Proccess current page from url
|
||||||
|
|
Loading…
Reference in New Issue