Skip to content
This repository was archived by the owner on Sep 16, 2022. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions backend/device_registry/templates/credentials.html
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,9 @@ <h6 class="card-subtitle text-muted">View credentials.</h6>


$('#datatables-basic tbody').on( 'click', '.wott-creds-edit-btn', function () {
let data = table.row( $(this).parents('tr') ).data();
var ab=$(this);
var pb=ab.parents('tr'); if(pb.attr('class')=='child'){var pb=$(ab.parents('tbody').children()[pb.index()-1]);};
var data = table.row(pb).data();
showDialog('update', "Edit Credential", data);
} );
$('#wott-add-creds-btn').on('click', function () {
Expand All @@ -455,10 +457,10 @@ <h6 class="card-subtitle text-muted">View credentials.</h6>

var deleted_pk;
$('#datatables-basic tbody').on( 'click', '.wott-creds-del-btn', function () {
console.log('del');
let data = table.row( $(this).parents('tr') ).data();
var ab=$(this);
var pb=ab.parents('tr'); if(pb.attr('class')=='child'){var pb=$(ab.parents('tbody').children()[pb.index()-1]);};
var data = table.row(pb).data();
deleted_pk = data.pk;

show_confirm_dialog( "Confirm Removal", "Are you sure you want to delete?", "Delete" );
});

Expand Down
9 changes: 3 additions & 6 deletions backend/device_registry/templates/pairing_keys.html
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,9 @@ <h6 class="card-subtitle text-muted">List of keys not yet applied.</h6>

var deleted_pk;
function revoke_key(a){
wott_alert_hide("main-alert");
deleted_pk = a.parentElement.parentElement.parentElement.id;
show_dialog("Confirm Revoke Key",
"Are you sure you want to revoke?",
"Revoke"
);
wott_alert_hide("main-alert"); var ab=$(a), pb=ab.parents('tr');
if(pb.attr('class')=='child'){deleted_pk=$(ab.parents('tbody').children()[pb.index()-1]).attr('id');}else{deleted_pk=pb.attr('id');};
show_dialog("Confirm Revoke Key","Are you sure you want to revoke?","Revoke");
}

function show_popover(el, title, content='')
Expand Down