1
0
mirror of https://github.com/dkmstr/openuds-gui.git synced 2024-10-26 08:55:23 +03:00

Added support for custom message launcher, so we can include some advice at launch time per poool basis. Also, this is controlable by scheduled actions (show, hide, not changing text)...

This commit is contained in:
Adolfo Gómez García 2024-03-15 01:49:31 +01:00
parent fc7e44e364
commit 37b0b44ab3
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23
2 changed files with 7 additions and 1 deletions

View File

@ -93,7 +93,7 @@ export class ServiceComponent implements OnInit {
this.api.gui.alert('<p align="center"><b>' + django.gettext('Launcher') + '</b></p>', message); this.api.gui.alert('<p align="center"><b>' + django.gettext('Launcher') + '</b></p>', message);
} }
launch(transport: JSONTransport|null) { async launch(transport: JSONTransport|null) {
if (this.service.maintenance) { if (this.service.maintenance) {
this.notifyNotLaunching(django.gettext('Service is in maintenance and cannot be launched')); this.notifyNotLaunching(django.gettext('Service is in maintenance and cannot be launched'));
} else if (this.service.not_accesible) { } else if (this.service.not_accesible) {
@ -111,6 +111,11 @@ export class ServiceComponent implements OnInit {
if (transport === null || this.service.show_transports === false) { if (transport === null || this.service.show_transports === false) {
transport = this.service.transports[0]; transport = this.service.transports[0];
} }
if (this.service.custom_message_text !== null && this.service.custom_message_text !== undefined) {
if ((await this.api.gui.yesno(django.gettext('Service message'), this.service.custom_message_text)) === false) {
return;
}
}
this.api.executeCustomJSForServiceLaunch(); this.api.executeCustomJSForServiceLaunch();
this.api.launchURL(transport.link); this.api.launchURL(transport.link);
} }

View File

@ -33,6 +33,7 @@ export interface JSONService {
to_be_replaced: boolean; to_be_replaced: boolean;
to_be_replaced_text: string; to_be_replaced_text: string;
custom_calendar_text: string; custom_calendar_text: string;
custom_message_text: string|null;
in_use: boolean; in_use: boolean;
transports: JSONTransport[]; transports: JSONTransport[];
} }