Rebranding fixes

This commit is contained in:
Ylian Saint-Hilaire 2019-09-15 12:47:59 -07:00
parent edd1e37de2
commit cb27ef4e8b
3 changed files with 33 additions and 16 deletions

View File

@ -1,6 +1,6 @@
{
"name": "meshcentral",
"version": "0.4.0-u",
"version": "0.4.0-v",
"keywords": [
"Remote Management",
"Intel AMT",

View File

@ -260,8 +260,13 @@
agentDesktop.ProcessData(data);
} else if (recFileProtocol == 101) {
// Intel AMT KVM
if ((readState == 0) && (rstr2hex(data) == '4100000000000000')) { readState = 1; } // We are not authenticated, KVM data starts here.
else if (readState == 1) { amtDesktop.ProcessData(data); }
if ((readState == 0) && (rstr2hex(data) == '4100000000000000')) {
// We are not authenticated, KVM data starts here.
readState = 1;
if (data.length > 8) { amtDesktop.ProcessData(data.substring(8)); }
} else if (readState == 1) {
amtDesktop.ProcessData(data);
}
}
} else if ((type == 2) && flagBinary && flagUser) {
// User --> Device data

View File

@ -1856,14 +1856,19 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
// Use the logo in the database
res.set({ 'Content-Type': 'image/jpeg' });
res.send(parent.configurationFiles[domain.titlepicture]);
return;
} else {
// Use the logo on file
try { res.sendFile(obj.path.join(obj.parent.datapath, domain.titlepicture)); } catch (e) {
try { res.sendFile(obj.path.join(obj.parent.webPublicPath, 'images/logoback.png')); } catch (e) { res.sendStatus(404); }
}
try { res.sendFile(obj.path.join(obj.parent.datapath, domain.titlepicture)); return; } catch (ex) { }
}
}
if (parent.webPublicOverridePath && obj.fs.existsSync(obj.path.join(obj.parent.webPublicOverridePath, 'images/logoback.png'))) {
// Use the override logo picture
try { res.sendFile(obj.path.join(obj.parent.webPublicOverridePath, 'images/logoback.png')); } catch (ex) { res.sendStatus(404); }
} else {
try { res.sendFile(obj.path.join(obj.parent.webPublicPath, 'images/logoback.png')); } catch (e) { res.sendStatus(404); }
// Use the default logo picture
try { res.sendFile(obj.path.join(obj.parent.webPublicPath, 'images/logoback.png')); } catch (ex) { res.sendStatus(404); }
}
}
@ -1877,14 +1882,16 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
// Use the welcome image in the database
res.set({ 'Content-Type': 'image/jpeg' });
res.send(parent.configurationFiles[domain.welcomepicture]);
} else {
// Use the logo on file
try { res.sendFile(obj.path.join(obj.parent.datapath, domain.welcomepicture)); } catch (e) {
try { res.sendFile(obj.path.join(obj.parent.webPublicPath, 'images/mainwelcome.jpg')); } catch (e) { res.sendStatus(404); }
}
return;
}
}
if (parent.webPublicOverridePath && obj.fs.existsSync(obj.path.join(obj.parent.webPublicOverridePath, 'images/mainwelcome.jpg'))) {
// Use the override logo picture
try { res.sendFile(obj.path.join(obj.parent.webPublicOverridePath, 'images/mainwelcome.jpg')); } catch (ex) { res.sendStatus(404); }
} else {
try { res.sendFile(obj.path.join(obj.parent.webPublicPath, 'images/mainwelcome.jpg')); } catch (e) { res.sendStatus(404); }
// Use the default logo picture
try { res.sendFile(obj.path.join(obj.parent.webPublicPath, 'images/mainwelcome.jpg')); } catch (ex) { res.sendStatus(404); }
}
}
@ -3252,10 +3259,15 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
var p = obj.path.join(obj.parent.datapath, 'server.png');
if (obj.fs.existsSync(p)) {
// Use the data folder server picture
try { res.sendFile(p); } catch (e) { res.sendStatus(404); }
try { res.sendFile(p); } catch (ex) { res.sendStatus(404); }
} else {
// Use the default server picture
try { res.sendFile(obj.path.join(obj.parent.webPublicPath, 'images/server-256.png')); } catch (e) { res.sendStatus(404); }
if (parent.webPublicOverridePath && obj.fs.existsSync(obj.path.join(obj.parent.webPublicOverridePath, 'images/server-256.png'))) {
// Use the override server picture
try { res.sendFile(obj.path.join(obj.parent.webPublicOverridePath, 'images/server-256.png')); } catch (ex) { res.sendStatus(404); }
} else {
// Use the default server picture
try { res.sendFile(obj.path.join(obj.parent.webPublicPath, 'images/server-256.png')); } catch (ex) { res.sendStatus(404); }
}
}
}
});