Skip to content

Commit

Permalink
added client side keypairs to participant summary
Browse files Browse the repository at this point in the history
  • Loading branch information
ssundahlTTD committed Sep 9, 2024
1 parent 84f690b commit 897e240
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
13 changes: 11 additions & 2 deletions webroot/adm/oncall/participant-summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,27 @@ <h5>Participant API Keys</h5>
<pre class="errorDiv" id="participantKeysErrorOutput"></pre>
<pre id="participantKeysStandardOutput"></pre>
</div>
</div>
<div class="row px-2">
<div class="col section">
<h5>Client Side Keypairs</h5>
<pre class="errorDiv" id="keyPairsErrorOutput"></pre>
<pre id="keyPairsStandardOutput"></pre>
</div>
</div>
<div class="row px-2">
<div class="col section">
<h5>Participant Encryption Keys</h5>
<pre class="errorDiv" id="encryptionKeysErrorOutput"></pre>
<pre id="encryptionKeysStandardOutput"></pre>
</div>
</div>
<div class="row px-2">
<div class="col section">
<h5>Participant Operator Keys</h5>
<pre class="errorDiv" id="operatorKeysErrorOutput"></pre>
<pre id="operatorKeysStandardOutput"></pre>
</div>
</div>
<div class="row px-2">
<div class="col section">
<h5>Participant Opt-out Webhook</h5>
<pre class="errorDiv" id="webhooksErrorOutput"></pre>
Expand Down
10 changes: 10 additions & 0 deletions webroot/js/participantSummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ function loadAPIKeysCallback(result) {
$('#participantKeysStandardOutput').html(highlightedText);
};

function loadKeyPairsCallback(result, siteId) {
let resultJson = JSON.parse(result);
let filteredResults = resultJson.filter((item) => { return item.site_id === siteId });
const formatted = prettifyJson(JSON.stringify(filteredResults));
$('#keyPairsStandardOutput').html(formatted);
};

function loadEncryptionKeysCallback(result, siteId) {
const resultJson = JSON.parse(result);
let filteredResults = resultJson.filter((item) => { return item.site_id === siteId });
Expand Down Expand Up @@ -156,6 +163,9 @@ $(document).ready(() => {
url = `/api/client/list/${site.id}`;
doApiCallWithCallback('GET', url, loadAPIKeysCallback, (err) => { participantSummaryErrorHandler(err, '#participantKeysErrorOutput') });

url = `/api/client_side_keypairs/list`;
doApiCallWithCallback('GET', url, (r) => { loadKeyPairsCallback(r, site.id) }, (err) => { participantSummaryErrorHandler(err, '#keyPairsErrorOutput') });

url = '/api/key/list';
doApiCallWithCallback('GET', url, (r) => { loadEncryptionKeysCallback(r, site.id) }, (err) => { participantSummaryErrorHandler(err, '#encryptionKeysErrorOutput') });

Expand Down

0 comments on commit 897e240

Please sign in to comment.