On Tue, Nov 10, 2020 at 1:03 AM Vieri <[email protected]> wrote:
> Hi,
>
> I'm currently customizing Guacamole client with extensions.
> An example manifest file would be:
>
> # cat guac-manifest.json
> {
>
> "guacamoleVersion" : "*",
> "name" : "custom pages",
> "namespace" : "custompages",
>
> "html" : [
> "Note.html",
> "CustomURLs.html"
> ]
>
> }
>
> The content of my html files is obviously static, but I understand they
> are used as templates, right?
>
Not *as* templates, but to modify *existing* templates. They function as
patches for existing HTML structure:
https://guacamole.apache.org/doc/gug/guacamole-ext.html#ext-patch-html
Is there a way to get the authenticated username in any of these custom
> pages?
> Something like ${GUAC_USERNAME} in a custom .html file?
>
Yes, by invoking authenticationService.getCurrentUsername():
https://github.com/apache/guacamole-client/blob/43f8cc0400266288a70448ad7ddc12b10734c83f/guacamole/src/main/webapp/app/auth/service/authenticationService.js#L317-L335
To do that from within a template that you've patched, you would need to
create an AngularJS directive that handles invoking that function and
rendering the result.
Michael Jumper
CEO, Lead Developer
Glyptodon Inc <https://enterprise.glyptodon.com/>.