Added agent customization install text, supported by upcoming agent.

This commit is contained in:
Ylian Saint-Hilaire 2022-02-04 14:02:21 -08:00
parent 4b6c5f38bd
commit 50d56b8697
2 changed files with 12 additions and 0 deletions

View File

@ -512,6 +512,7 @@
"description": { "type": "string", "default": "Mesh Agent background service", "description": "The description of the agent as displayed to the user." },
"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." },
"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." },
"installText": { "type": "string", "default": null, "description": "Text string to show in the agent installation dialog box." },
"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." },
"fileName": { "type": "string", "default": "meshagent", "description": "The agent filename." }
}

View File

@ -1560,6 +1560,17 @@ function CreateMeshCentralServer(config, args) {
if (translations['zh-chs']) { translations['zh-hans'] = translations['zh-chs']; delete translations['zh-chs']; }
if (translations['zh-cht']) { translations['zh-hant'] = translations['zh-cht']; delete translations['zh-cht']; }
obj.agentTranslations = JSON.stringify(translations);
// If there is domain customizations to the agent strings, do this here.
for (var i in obj.config.domains) {
var domainTranslations = translations;
if ((typeof obj.config.domains[i].agentcustomization == 'object') && (typeof obj.config.domains[i].agentcustomization.installtext == 'string')) {
domainTranslations = Object.assign({}, domainTranslations); // Shallow clone
for (var j in domainTranslations) { delete domainTranslations[j].description; }
domainTranslations.en.description = obj.config.domains[i].agentcustomization.installtext;
}
obj.config.domains[i].agentTranslations = domainTranslations;
}
} catch (ex) { }
// Load the list of mesh agents and install scripts