ioBroker.admin
ioBroker.admin copied to clipboard
Add a jsonconfig element to "sendToAndOpenReturnedUrl"
I would like to send a message to the adapter to construct an URL that the user needs to visit. The idea is to use this to start an OAuth2 Flow.
Techncially it should support the same like "sendTo" (including sendung data to the server side) and can return an URL or an error. If error is returned the error is displayed. The returned URL is opened in a new windows ("_blank"?)
Ideally we get somehow an option to get the "Admin Base URL" as a value that we can also send to server side. "Admin base URL" being "protocol, host, port and potential "rteverse proxy path parts".
sendto- button that sends request to instance (https://github.com/iobroker-community-adapters/ioBroker.email/blob/master/admin/index_m.html#L128)command- (Defaultsend)jsonData- string -{"subject1": "${data.subject}", "options1": {"host": "${data.host}"}}. You can use special variable_originto send to instance the caller URL, likehttp://localhost:8081/admin.data- object -{"subject1": 1, "data": "static"}. You can specify jsonData or data, but not both.result-{result1: {en: 'A'}, result2: {en: 'B'}}error-{error1: {en: 'E'}, error2: {en: 'E2'}}variant-contained,outlinedor nothingopenUrl- if true - open URL in new tab, if response contains attributeopenUrl, like{"openUrl": "http://1.2.3.4:80/aaa", "window": "_blank"}window- ifopenUrlis true, this is name of new window. Could be overwritten if response consistwindowattribute.this.props.socket.sendTo(adapterName.instance, command || 'send', data, result => {});
So the simpliest example looks like:
"_send": {
"newLine": true,
"label": "SEND",
type: "sendto",
"command": "url",
"openUrl": true,
"window": "netatmo"
}
@Apollon77 Can you please check with current admin version if this issue is fixed?