Skip to content

Commit

Permalink
webui: copy apikey to clipboard button (#12884)
Browse files Browse the repository at this point in the history
  • Loading branch information
Salvatore Catroppa committed Jan 26, 2022
1 parent d006150 commit f84f492
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/Jackett.Common/Content/custom.js
Expand Up @@ -1367,6 +1367,13 @@ function bindUIButtons() {
return false;
});

$('#api-key-copy-button').click(function () {
var apiKey = api.key;
if (apiKey !== null || apiKey !== undefined) {
copyToClipboard(apiKey);
}
});

$('#jackett-add-indexer').click(function () {
$("#modals").empty();
displayUnconfiguredIndexersList();
Expand Down
5 changes: 4 additions & 1 deletion src/Jackett.Common/Content/index.html
Expand Up @@ -43,6 +43,9 @@
<div class="pull-right jackett-apikey">
<span class="input-header">API Key: </span>
<input id="api-key-input" class="form-control input-right" type="text" value="" placeholder="API Key" readonly="">
<button id="api-key-copy-button" title="Copy API Key to clipboard" class="btn btn-primary btn-xs">
<span class="glyphicon glyphicon-copy" aria-hidden="true"></span>
</button>
</div>
<hr />

Expand Down Expand Up @@ -743,6 +746,6 @@ <h4>Capabilities</h4>
</script>

<script type="text/javascript" src="../libs/api.js?changed=2017083001"></script>
<script type="text/javascript" src="../custom.js?changed=2022012301"></script>
<script type="text/javascript" src="../custom.js?changed=2022012602"></script>
</body>
</html>

0 comments on commit f84f492

Please sign in to comment.