import BaseRenderer from './base'; import ConfirmModal from './modal/confirm'; import {Decorators} from '../decorator/factory'; import {Logger} from '../util/logger'; import RequiredArgsModal from './modal/required'; import {Utilities} from '../util/utilities';
/** *Runscallbackfunction.Ifthiscallbackisconfiguredtogetinputfromtheuser, *thiswillbepromptbeforeexecution. * *@returns{object}theoutputfromthecallbackfunction *@public
*/
@Decorators.Data.requires('callback')
async execute() { if (this.data.callback.confirm) { return await this.handlePromise(this._showConfirmModal());
} elseif (!Utilities.isObjectEmpty(this.data.callback.requiredArgs)) { return await this.handlePromise(this._showRequiredModal.call(this));
} // Trigger is the expected command on GAP for this event! return await this._execute(this.data.callback);
}
/** *Buildsandshowsa{ConfirmModal} * *@private
*/
async _showConfirmModal() {
let options = this.options; if (!Utilities.isObjectEmpty(this.data.callback.requiredArgs)) {
options.callbackHandler = () => this._showRequiredModal.call(this);
}
let modal = new ConfirmModal(options, this.context); return await this.handlePromise(modal.load(this.data).render());
}
/** *Buildsandshowsa{RequiredArgsModal} * *@private
*/
async _showRequiredModal() {
let options = this.options;
options.callbackHandler = o => this._execute.call(this, o);
let modal = new RequiredArgsModal(options, this.context); return await this.handlePromise(modal.load(this.data).render());
}
/** *Thismethodexecutesthecallbackwiththeresultfromthe{RequiredArgsModal} *modalwindowsifrequired * *@param{object}object-theobjecttostringifyandpasstothecallback *@private
*/
_execute(object) { // FIXME Trigger(<json>); is the entrypoint back to GAP // while JupyterKernel doesn't support comms:
Logger.debug('Executing Trigger function:', object); returnthis.callback(`Trigger(${JSON.stringify(JSON.stringify(object))});`);
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-18)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.