Skip to content

Commit 7db987a

Browse files
committed
Added Lock icon on encrypted databases
1 parent eca5c27 commit 7db987a

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

debug-db/src/main/assets/app.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,11 @@ function getDBList() {
6868
$('#db-list').empty();
6969
var isSelectionDone = false;
7070
for(var count = 0; count < dbList.length; count++){
71-
if(dbList[count].indexOf("journal") == -1){
72-
$("#db-list").append("<a href='#' id=" +dbList[count] + " class='list-group-item' onClick='openDatabaseAndGetTableList(\""+ dbList[count] + "\");'>" +dbList[count] + "</a>");
71+
var dbName = dbList[count][0];
72+
var isEncrypted = dbList[count][1];
73+
var dbAttribute = isEncrypted == "true" ? ' <span class="glyphicon glyphicon-lock" aria-hidden="true" style="color:blue"></span>' : "";
74+
if(dbName.indexOf("journal") == -1){
75+
$("#db-list").append("<a href='#' id=" + dbName + " class='list-group-item' onClick='openDatabaseAndGetTableList(\""+ dbName + "\");'>" + dbName + dbAttribute + "</a>");
7376
if(!isSelectionDone){
7477
isSelectionDone = true;
7578
$('#db-list').find('a').trigger('click');
44.3 KB
Binary file not shown.

debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,11 @@ private String getDBListResponse() {
191191
Response response = new Response();
192192
if (mDatabaseFiles != null) {
193193
for (HashMap.Entry<String, Pair<File, String>> entry : mDatabaseFiles.entrySet()) {
194-
response.rows.add(entry.getKey());
194+
String[] dbEntry = { entry.getKey(), entry.getValue().second != "" ? "true" : "false" };
195+
response.rows.add(dbEntry);
195196
}
196197
}
197-
response.rows.add(Constants.APP_SHARED_PREFERENCES);
198+
response.rows.add(new String[] { Constants.APP_SHARED_PREFERENCES, "false" });
198199
response.isSuccessful = true;
199200
return mGson.toJson(response);
200201
}

0 commit comments

Comments
 (0)