Commit a2cad97c6cc936f0ad3f0a040e0b021956799f53

Authored by ww
1 parent 4de08df8

fix: change get proxy prefix method

Showing 28 changed files with 34 additions and 29 deletions
... ... @@ -7,3 +7,8 @@ const OSS_Prefix = 'https://oss.yuntengcloud.com/iotdocs/thingskit-scada/'
7 7 * @description enable load script form oss server
8 8 */
9 9 const Enable_OSS = true
  10 +
  11 +/**
  12 + * @description 代理配置项
  13 + */
  14 +const Proxy_Prefix = window.location.pathname.startsWith('/') ? window.location.pathname.replace(/\/$/, '') : window.location.pathname
... ...
... ... @@ -253,7 +253,7 @@ App.DROPBOX_APPKEY = window.DRAWIO_DROPBOX_ID;
253 253 /**
254 254 * Sets URL to load the Dropbox SDK from
255 255 */
256   -App.DROPBOX_URL = window.DRAWIO_BASE_URL + '/thingskit-drawio/js/dropbox/Dropbox-sdk.min.js';
  256 +App.DROPBOX_URL = window.DRAWIO_BASE_URL + Proxy_Prefix + '/js/dropbox/Dropbox-sdk.min.js';
257 257
258 258 /**
259 259 * Sets URL to load the Dropbox dropins JS from.
... ... @@ -266,7 +266,7 @@ App.DROPINS_URL = '';
266 266 * OneDrive Client JS (file/folder picker). This is a slightly modified version to allow using accessTokens
267 267 * But it doesn't work for IE11, so we fallback to the original one
268 268 */
269   -App.ONEDRIVE_URL = mxClient.IS_IE11? 'https://js.live.net/v7.2/OneDrive.js' : window.DRAWIO_BASE_URL + '/thingskit-drawio/js/onedrive/OneDrive.js';
  269 +App.ONEDRIVE_URL = mxClient.IS_IE11? 'https://js.live.net/v7.2/OneDrive.js' : window.DRAWIO_BASE_URL + Proxy_Prefix + '/js/onedrive/OneDrive.js';
270 270
271 271 /**
272 272 * Trello URL
... ...
... ... @@ -5580,7 +5580,7 @@
5580 5580 return ((lightbox && urlParams['dev'] != '1') ? EditorUi.lightboxHost :
5581 5581 (((mxClient.IS_CHROMEAPP || EditorUi.isElectronApp ||
5582 5582 !(/.*\.draw\.io$/.test(window.location.hostname))) ?
5583   - EditorUi.drawHost : 'https://' + window.location.host))) + '/thingskit-drawio/' +
  5583 + EditorUi.drawHost : 'https://' + window.location.host))) + Proxy_Prefix + '/' +
5584 5584 ((params.length > 0) ? '?' + params.join('&') : '') + data;
5585 5585 };
5586 5586
... ...
... ... @@ -10,7 +10,7 @@
10 10 const label = '空气'
11 11 const width = 66;
12 12 const height = 74;
13   - const staticPath = '/thingskit-drawio/img/lib/thingskit/'
  13 + const staticPath = `${Proxy_Prefix}/img/lib/thingskit/`
14 14 const prefix = 'image;image=img/lib/thingskit/'
15 15 const defaultStyle = ';imageAspect=0;'
16 16 this.setCurrentSearchEntryLibrary(dt);
... ...
... ... @@ -90,7 +90,7 @@
90 90 const mp4 = 'http://vjs.zencdn.net/v/oceans.mp4'
91 91 const m3u8Type = 'application/x-mpegURL'
92 92 const mp4Type = 'video/mp4'
93   - const poster = `/thingskit-drawio/images/youtube.png`
  93 + const poster = `${Proxy_Prefix}/images/youtube.png`
94 94
95 95 // const cell = new mxCell('<video></video>', new mxGeometry(0, 0, 100, 95), 'image;image=images/thingskit/video.svg;imageAspect=0;');
96 96 const template = `<video controls preload="auto" muted="muted" width="${width}" height="${height}" poster="${poster}" data-setup='{}'>
... ...
... ... @@ -10,7 +10,7 @@
10 10 const label = '按钮'
11 11 const width = 66;
12 12 const height = 74;
13   - const staticPath = '/thingskit-drawio/img/lib/thingskit/'
  13 + const staticPath = `${Proxy_Prefix}/img/lib/thingskit/`
14 14 const prefix = 'image;image=img/lib/thingskit/'
15 15 const defaultStyle = ';imageAspect=0;'
16 16 this.setCurrentSearchEntryLibrary(dt);
... ...
... ... @@ -67,7 +67,7 @@
67 67 })),
68 68 this.addEntry('bar chart', mxUtils.bind(this, function () {
69 69 const id = self.generatorChartsId()
70   - const cell = self.generatorCell(id, enumConst.CHART_IMG_PLACEHOLDER_SIZE, enumConst.CHART_IMG_PLACEHOLDER_SIZE, componentType.BAR_CHART, '/thingskit-drawio/images/thingskit/bar-chart.png')
  70 + const cell = self.generatorCell(id, enumConst.CHART_IMG_PLACEHOLDER_SIZE, enumConst.CHART_IMG_PLACEHOLDER_SIZE, componentType.BAR_CHART, `${Proxy_Prefix}/images/thingskit/bar-chart.png`)
71 71 return this.createVertexTemplateFromCells([cell], cell.geometry.width, cell.geometry.height, '柱状图');
72 72 })),
73 73 ];
... ... @@ -167,7 +167,7 @@
167 167 * @param placeholderPath
168 168 * @returns {string}
169 169 */
170   - Sidebar.prototype.createChartsNode = function (id, width = 400, height = 400, placeholderPath = '/thingskit-drawio/images/thingskit/line-chart.png') {
  170 + Sidebar.prototype.createChartsNode = function (id, width = 400, height = 400, placeholderPath = `${Proxy_Prefix}/images/thingskit/line-chart.png`) {
171 171 return `<div class="echarts__instance" style="width: ${width}px; height: ${height}px" id="${id}"><img src="${placeholderPath}" alt=""></div>`
172 172 }
173 173
... ...
... ... @@ -10,7 +10,7 @@
10 10 const label = '管道'
11 11 const width = 66;
12 12 const height = 74;
13   - const staticPath = '/thingskit-drawio/img/lib/thingskit/'
  13 + const staticPath = `${Proxy_Prefix}/img/lib/thingskit/`
14 14 const prefix = 'image;image=img/lib/thingskit/'
15 15 const defaultStyle = ';imageAspect=0;'
16 16 this.setCurrentSearchEntryLibrary(dt);
... ...
... ... @@ -10,7 +10,7 @@
10 10 const label = '控制元件'
11 11 const width = 66;
12 12 const height = 74;
13   - const staticPath = '/thingskit-drawio/img/lib/thingskit/'
  13 + const staticPath = `${Proxy_Prefix}/img/lib/thingskit/`
14 14 const prefix = 'image;image=img/lib/thingskit/'
15 15 const defaultStyle = ';imageAspect=0;'
16 16 this.setCurrentSearchEntryLibrary(dt);
... ...
... ... @@ -10,7 +10,7 @@
10 10 const label = '发动机'
11 11 const width = 66;
12 12 const height = 74;
13   - const staticPath = '/thingskit-drawio/img/lib/thingskit/'
  13 + const staticPath = `${Proxy_Prefix}/img/lib/thingskit/`
14 14 const prefix = 'image;image=img/lib/thingskit/'
15 15 const defaultStyle = ';imageAspect=0;'
16 16 this.setCurrentSearchEntryLibrary(dt);
... ...
... ... @@ -10,7 +10,7 @@
10 10 const label = '工厂设施'
11 11 const width = 66;
12 12 const height = 74;
13   - const staticPath = '/thingskit-drawio/img/lib/thingskit/'
  13 + const staticPath = `${Proxy_Prefix}/img/lib/thingskit/`
14 14 const prefix = 'image;image=img/lib/thingskit/'
15 15 const defaultStyle = ';imageAspect=0;'
16 16 this.setCurrentSearchEntryLibrary(dt);
... ...
... ... @@ -10,7 +10,7 @@
10 10 const label = '风机'
11 11 const width = 66;
12 12 const height = 74;
13   - const staticPath = '/thingskit-drawio/img/lib/thingskit/'
  13 + const staticPath = `${Proxy_Prefix}/img/lib/thingskit/`
14 14 const prefix = 'image;image=img/lib/thingskit/'
15 15 const defaultStyle = ';imageAspect=0;'
16 16 this.setCurrentSearchEntryLibrary(dt);
... ...
... ... @@ -10,7 +10,7 @@
10 10 const label = '过滤器';
11 11 const width = 66;
12 12 const height = 74;
13   - const staticPath = '/thingskit-drawio/img/lib/thingskit/'
  13 + const staticPath = `${Proxy_Prefix}/img/lib/thingskit/`
14 14 const prefix = 'image;image=img/lib/thingskit/'
15 15 const defaultStyle = ';imageAspect=0;'
16 16 this.setCurrentSearchEntryLibrary(dt);
... ...
... ... @@ -10,7 +10,7 @@
10 10 const label = '流量计'
11 11 const width = 66;
12 12 const height = 74;
13   - const staticPath = '/thingskit-drawio/img/lib/thingskit/'
  13 + const staticPath = `${Proxy_Prefix}/img/lib/thingskit/`
14 14 const prefix = 'image;image=img/lib/thingskit/'
15 15 const defaultStyle = ';imageAspect=0;'
16 16 this.setCurrentSearchEntryLibrary(dt);
... ...
... ... @@ -10,7 +10,7 @@
10 10 const label = '食品加工'
11 11 const width = 66;
12 12 const height = 74;
13   - const staticPath = '/thingskit-drawio/img/lib/thingskit/'
  13 + const staticPath = `${Proxy_Prefix}/img/lib/thingskit/`
14 14 const prefix = 'image;image=img/lib/thingskit/'
15 15 const defaultStyle = ';imageAspect=0;'
16 16 this.setCurrentSearchEntryLibrary(dt);
... ...
... ... @@ -10,7 +10,7 @@
10 10 const label = '加热器'
11 11 const width = 66;
12 12 const height = 74;
13   - const staticPath = '/thingskit-drawio/img/lib/thingskit/'
  13 + const staticPath = `${Proxy_Prefix}/img/lib/thingskit/`
14 14 const prefix = 'image;image=img/lib/thingskit/'
15 15 const defaultStyle = ';imageAspect=0;'
16 16 this.setCurrentSearchEntryLibrary(dt);
... ...
... ... @@ -10,7 +10,7 @@
10 10 const label = '工业'
11 11 const width = 66;
12 12 const height = 74;
13   - const staticPath = '/thingskit-drawio/img/lib/thingskit/'
  13 + const staticPath = `${Proxy_Prefix}/img/lib/thingskit/`
14 14 const prefix = 'image;image=img/lib/thingskit/'
15 15 const defaultStyle = ';imageAspect=0;'
16 16 this.setCurrentSearchEntryLibrary(dt);
... ...
... ... @@ -10,7 +10,7 @@
10 10 const label = '仪表'
11 11 const width = 66;
12 12 const height = 74;
13   - const staticPath = '/thingskit-drawio/img/lib/thingskit/'
  13 + const staticPath = `${Proxy_Prefix}/img/lib/thingskit/`
14 14 const prefix = 'image;image=img/lib/thingskit/'
15 15 const defaultStyle = ';imageAspect=0;'
16 16 this.setCurrentSearchEntryLibrary(dt);
... ...
... ... @@ -10,7 +10,7 @@
10 10 const label = '灯'
11 11 const width = 66;
12 12 const height = 74;
13   - const staticPath = '/thingskit-drawio/img/lib/thingskit/'
  13 + const staticPath = `${Proxy_Prefix}/img/lib/thingskit/`
14 14 const prefix = 'image;image=img/lib/thingskit/'
15 15 const defaultStyle = ';imageAspect=0;'
16 16 this.setCurrentSearchEntryLibrary(dt);
... ...
... ... @@ -10,7 +10,7 @@
10 10 const label = '植物'
11 11 const width = 66;
12 12 const height = 74;
13   - const staticPath = '/thingskit-drawio/img/lib/thingskit/'
  13 + const staticPath = `${Proxy_Prefix}/img/lib/thingskit/`
14 14 const prefix = 'image;image=img/lib/thingskit/'
15 15 const defaultStyle = ';imageAspect=0;'
16 16 this.setCurrentSearchEntryLibrary(dt);
... ...
... ... @@ -10,7 +10,7 @@
10 10 const label = '电源'
11 11 const width = 66;
12 12 const height = 74;
13   - const staticPath = '/thingskit-drawio/img/lib/thingskit/'
  13 + const staticPath = `${Proxy_Prefix}/img/lib/thingskit/`
14 14 const prefix = 'image;image=img/lib/thingskit/'
15 15 const defaultStyle = ';imageAspect=0;'
16 16 this.setCurrentSearchEntryLibrary(dt);
... ...
... ... @@ -10,7 +10,7 @@
10 10 const label = '制程冷却'
11 11 const width = 66;
12 12 const height = 74;
13   - const staticPath = '/thingskit-drawio/img/lib/thingskit/'
  13 + const staticPath = `${Proxy_Prefix}/img/lib/thingskit/`
14 14 const prefix = 'image;image=img/lib/thingskit/'
15 15 const defaultStyle = ';imageAspect=0;'
16 16 this.setCurrentSearchEntryLibrary(dt);
... ...
... ... @@ -10,7 +10,7 @@
10 10 const label = '制程加热'
11 11 const width = 66;
12 12 const height = 74;
13   - const staticPath = '/thingskit-drawio/img/lib/thingskit/'
  13 + const staticPath = `${Proxy_Prefix}/img/lib/thingskit/`
14 14 const prefix = 'image;image=img/lib/thingskit/'
15 15 const defaultStyle = ';imageAspect=0;'
16 16 this.setCurrentSearchEntryLibrary(dt);
... ...
... ... @@ -10,7 +10,7 @@
10 10 const label = '泵'
11 11 const width = 66;
12 12 const height = 74;
13   - const staticPath = '/thingskit-drawio/img/lib/thingskit/'
  13 + const staticPath = `${Proxy_Prefix}/img/lib/thingskit/`
14 14 const prefix = 'image;image=img/lib/thingskit/'
15 15 const defaultStyle = ';imageAspect=0;'
16 16 this.setCurrentSearchEntryLibrary(dt);
... ...
... ... @@ -10,7 +10,7 @@
10 10 const label = '污水处理'
11 11 const width = 66;
12 12 const height = 74;
13   - const staticPath = '/thingskit-drawio/img/lib/thingskit/'
  13 + const staticPath = `${Proxy_Prefix}/img/lib/thingskit/`
14 14 const prefix = 'image;image=img/lib/thingskit/'
15 15 const defaultStyle = ';imageAspect=0;'
16 16 this.setCurrentSearchEntryLibrary(dt);
... ...
... ... @@ -10,7 +10,7 @@
10 10 const label = '水槽'
11 11 const width = 66;
12 12 const height = 74;
13   - const staticPath = '/thingskit-drawio/img/lib/thingskit/'
  13 + const staticPath = `${Proxy_Prefix}/img/lib/thingskit/`
14 14 const prefix = 'image;image=img/lib/thingskit/'
15 15 const defaultStyle = ';imageAspect=0;'
16 16 this.setCurrentSearchEntryLibrary(dt);
... ...
... ... @@ -10,7 +10,7 @@
10 10 const label = '阀门'
11 11 const width = 66;
12 12 const height = 74;
13   - const staticPath = '/thingskit-drawio/img/lib/thingskit/'
  13 + const staticPath = `${Proxy_Prefix}/img/lib/thingskit/`
14 14 const prefix = 'image;image=img/lib/thingskit/'
15 15 const defaultStyle = ';imageAspect=0;'
16 16 this.setCurrentSearchEntryLibrary(dt);
... ...
... ... @@ -13884,7 +13884,7 @@ class HandleDynamicEffect {
13884 13884
13885 13885
13886 13886 createVideoTemplate(idEl, width, height, videoUrl, videoType = 'video/mp4') {
13887   - const poster = `/thingskit-drawio/images/youtube.png`
  13887 + const poster = `${Proxy_Prefix}/images/youtube.png`
13888 13888 const template = `<video id="${idEl}" class="video-js" controls preload="auto" muted="muted" width="${width}" height="${height}" poster="${poster}" data-setup='{}'>
13889 13889 <source src="${videoUrl}" type="${videoType}">
13890 13890 <p class="vjs-no-js">
... ...