WIP Mail Rest API: UI for application passwords/tokens for admin

This commit is contained in:
ralf
2023-07-03 17:09:26 +02:00
parent e210d4b3c6
commit 07300704bc
10 changed files with 625 additions and 25 deletions

View File

@ -19,6 +19,7 @@ import {egw} from "../../api/js/jsapi/egw_global.js";
import {egwAction, egwActionObject} from '../../api/js/egw_action/egw_action.js';
import {LitElement} from "@lion/core";
import {et2_nextmatch} from "../../api/js/etemplate/et2_extension_nextmatch";
import {et2_DOMWidget} from "../../api/js/etemplate/et2_core_DOMWidget";
/**
* UI for Admin
@ -1643,6 +1644,24 @@ class AdminApp extends EgwApp
}
}, this).sendRequest();
}
/**
* Clickhandler to copy given text or widget content to clipboard
* @param _widget
* @param _text default widget content
*/
copyClipboard(_widget : et2_DOMWidget, _text? : string, _event? : Event)
{
let value = _text || (typeof _widget.get_value === 'function' ? _widget.get_value() : _widget.options.value);
let node = _widget.getDOMNode() !== _widget ? _widget.getDOMNode() : _widget;
this.egw.copyTextToClipboard(value, node, _event).then((success) =>
{
if(success !== false)
{
this.egw.message(this.egw.lang("Copied '%1' to clipboard", value), 'success');
}
});
}
}
app.classes.admin = AdminApp;