Add some $variables to the post install message
This way the post install messages can be better. Removed it as a filter because I cannot figure how to pass args to it
This commit is contained in:
@@ -1798,6 +1798,23 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
|
||||
if (!app.manifest.title) app.manifest.title = 'Untitled';
|
||||
|
||||
if (app.manifest.postInstallMessage) {
|
||||
var text= app.manifest.postInstallMessage;
|
||||
// we chose - because underscore has special meaning in markdown
|
||||
text = text.replace('$CLOUDRON-APP-DOMAIN', app.fqdn);
|
||||
text = text.replace('$CLOUDRON-APP-ORIGIN', 'https://' + app.fqdn);
|
||||
text = text.replace('$CLOUDRON-API-DOMAIN', this._config.adminFqdn);
|
||||
text = text.replace('$CLOUDRON-API-ORIGIN', 'https://' + this._config.adminFqdn);
|
||||
text = text.replace('$CLOUDRON-USERNAME', this._userInfo.username);
|
||||
text = text.replace('$CLOUDRON-APP-ID', app.id);
|
||||
|
||||
// [^] matches even newlines. '?' makes it non-greedy
|
||||
if (app.sso) text = text.replace(/<nosso>[^]*?<\/nosso>/g, '');
|
||||
else text = text.replace(/<sso>[^]*?<\/sso>/g, '');
|
||||
|
||||
app.manifest.postInstallMessage = text;
|
||||
}
|
||||
|
||||
return app;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user