Added agent customization install text, supported by upcoming agent.

Ylian Saint-Hilaire committed Feb 4, 2022 at 14:02 UTC 50d56b86974f7a9dce84e706cd35741b2c691d91
2 files changed +12
meshcentral-config-schema.json
+1
@@ -512,6 +512,7 @@
512 "description": { "type": "string", "default": "Mesh Agent background service", "description": "The description of the agent as displayed to the user." },
513 "companyName": { "type": "string", "default": "Mesh Agent", "description": "This will be used as the path to install the agent, by default this is 'Mesh Agent' in Windows and 'meshagent' in other OS's." },
514 "serviceName": { "type": "string", "default": "Mesh Agent", "description": "The name of the background service, by default this is 'Mesh Agent' in Windows and 'meshagent' in other OS's but should be set to an all lower case, no space string." },
515 + "installText": { "type": "string", "default": null, "description": "Text string to show in the agent installation dialog box." },
516 "image": { "type": "string", "default": null, "description": "The filename of a image file in .png format located in meshcentral-data to display in the MeshCentral Agent installation dialog, image should be square and from 64x64 to 200x200." },
517 "fileName": { "type": "string", "default": "meshagent", "description": "The agent filename." }
518 }
meshcentral.js
+11
@@ -1560,6 +1560,17 @@ function CreateMeshCentralServer(config, args) {
1560 if (translations['zh-chs']) { translations['zh-hans'] = translations['zh-chs']; delete translations['zh-chs']; }
1561 if (translations['zh-cht']) { translations['zh-hant'] = translations['zh-cht']; delete translations['zh-cht']; }
1562 obj.agentTranslations = JSON.stringify(translations);
1563 +
1564 + // If there is domain customizations to the agent strings, do this here.
1565 + for (var i in obj.config.domains) {
1566 + var domainTranslations = translations;
1567 + if ((typeof obj.config.domains[i].agentcustomization == 'object') && (typeof obj.config.domains[i].agentcustomization.installtext == 'string')) {
1568 + domainTranslations = Object.assign({}, domainTranslations); // Shallow clone
1569 + for (var j in domainTranslations) { delete domainTranslations[j].description; }
1570 + domainTranslations.en.description = obj.config.domains[i].agentcustomization.installtext;
1571 + }
1572 + obj.config.domains[i].agentTranslations = domainTranslations;
1573 + }
1574 } catch (ex) { }
1575
1576 // Load the list of mesh agents and install scripts