Rebranding fixes
Ylian Saint-Hilaire committed
Sep 15, 2019 at 12:47 UTC
cb27ef4e8b2ddfa9c2395f2e09399840ee594fa7
3 files changed
+33
-16
package.json
+1
-1
@@ -1,6 +1,6 @@
1
{
2
"name": "meshcentral",
3
- "version": "0.4.0-u",
3
+ "version": "0.4.0-v",
4
"keywords": [
5
"Remote Management",
6
"Intel AMT",
public/player.htm
+7
-2
@@ -260,8 +260,13 @@
260
agentDesktop.ProcessData(data);
261
} else if (recFileProtocol == 101) {
262
// Intel AMT KVM
263
- if ((readState == 0) && (rstr2hex(data) == '4100000000000000')) { readState = 1; } // We are not authenticated, KVM data starts here.
264
- else if (readState == 1) { amtDesktop.ProcessData(data); }
263
+ if ((readState == 0) && (rstr2hex(data) == '4100000000000000')) {
264
+ // We are not authenticated, KVM data starts here.
265
+ readState = 1;
266
+ if (data.length > 8) { amtDesktop.ProcessData(data.substring(8)); }
267
+ } else if (readState == 1) {
268
+ amtDesktop.ProcessData(data);
269
+ }
270
}
271
} else if ((type == 2) && flagBinary && flagUser) {
272
// User --> Device data
webserver.js
+25
-13
@@ -1856,14 +1856,19 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
1856
// Use the logo in the database
1857
res.set({ 'Content-Type': 'image/jpeg' });
1858
res.send(parent.configurationFiles[domain.titlepicture]);
1859
+ return;
1860
} else {
1861
// Use the logo on file
1861
- try { res.sendFile(obj.path.join(obj.parent.datapath, domain.titlepicture)); } catch (e) {
1862
- try { res.sendFile(obj.path.join(obj.parent.webPublicPath, 'images/logoback.png')); } catch (e) { res.sendStatus(404); }
1863
- }
1862
+ try { res.sendFile(obj.path.join(obj.parent.datapath, domain.titlepicture)); return; } catch (ex) { }
1863
}
1864
+ }
1865
+
1866
+ if (parent.webPublicOverridePath && obj.fs.existsSync(obj.path.join(obj.parent.webPublicOverridePath, 'images/logoback.png'))) {
1867
+ // Use the override logo picture
1868
+ try { res.sendFile(obj.path.join(obj.parent.webPublicOverridePath, 'images/logoback.png')); } catch (ex) { res.sendStatus(404); }
1869
} else {
1866
- try { res.sendFile(obj.path.join(obj.parent.webPublicPath, 'images/logoback.png')); } catch (e) { res.sendStatus(404); }
1870
+ // Use the default logo picture
1871
+ try { res.sendFile(obj.path.join(obj.parent.webPublicPath, 'images/logoback.png')); } catch (ex) { res.sendStatus(404); }
1872
}
1873
}
1874
@@ -1877,14 +1882,16 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
1882
// Use the welcome image in the database
1883
res.set({ 'Content-Type': 'image/jpeg' });
1884
res.send(parent.configurationFiles[domain.welcomepicture]);
1880
- } else {
1881
- // Use the logo on file
1882
- try { res.sendFile(obj.path.join(obj.parent.datapath, domain.welcomepicture)); } catch (e) {
1883
- try { res.sendFile(obj.path.join(obj.parent.webPublicPath, 'images/mainwelcome.jpg')); } catch (e) { res.sendStatus(404); }
1884
- }
1885
+ return;
1886
}
1887
+ }
1888
+
1889
+ if (parent.webPublicOverridePath && obj.fs.existsSync(obj.path.join(obj.parent.webPublicOverridePath, 'images/mainwelcome.jpg'))) {
1890
+ // Use the override logo picture
1891
+ try { res.sendFile(obj.path.join(obj.parent.webPublicOverridePath, 'images/mainwelcome.jpg')); } catch (ex) { res.sendStatus(404); }
1892
} else {
1887
- try { res.sendFile(obj.path.join(obj.parent.webPublicPath, 'images/mainwelcome.jpg')); } catch (e) { res.sendStatus(404); }
1893
+ // Use the default logo picture
1894
+ try { res.sendFile(obj.path.join(obj.parent.webPublicPath, 'images/mainwelcome.jpg')); } catch (ex) { res.sendStatus(404); }
1895
}
1896
}
1897
@@ -3252,10 +3259,15 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
3259
var p = obj.path.join(obj.parent.datapath, 'server.png');
3260
if (obj.fs.existsSync(p)) {
3261
// Use the data folder server picture
3255
- try { res.sendFile(p); } catch (e) { res.sendStatus(404); }
3262
+ try { res.sendFile(p); } catch (ex) { res.sendStatus(404); }
3263
} else {
3257
- // Use the default server picture
3258
- try { res.sendFile(obj.path.join(obj.parent.webPublicPath, 'images/server-256.png')); } catch (e) { res.sendStatus(404); }
3264
+ if (parent.webPublicOverridePath && obj.fs.existsSync(obj.path.join(obj.parent.webPublicOverridePath, 'images/server-256.png'))) {
3265
+ // Use the override server picture
3266
+ try { res.sendFile(obj.path.join(obj.parent.webPublicOverridePath, 'images/server-256.png')); } catch (ex) { res.sendStatus(404); }
3267
+ } else {
3268
+ // Use the default server picture
3269
+ try { res.sendFile(obj.path.join(obj.parent.webPublicPath, 'images/server-256.png')); } catch (ex) { res.sendStatus(404); }
3270
+ }
3271
}
3272
}
3273
});