From c4765a28d6962d3c20500486704a5f754a018371 Mon Sep 17 00:00:00 2001 From: Son NK Date: Wed, 19 Feb 2020 23:44:48 +0700 Subject: [PATCH 1/3] pycharm format --- app/dashboard/templates/dashboard/api_key.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/dashboard/templates/dashboard/api_key.html b/app/dashboard/templates/dashboard/api_key.html index fa9ec87d..f6bb04e2 100644 --- a/app/dashboard/templates/dashboard/api_key.html +++ b/app/dashboard/templates/dashboard/api_key.html @@ -19,11 +19,12 @@ You can install the Chrome extension on Chrome Store, - Firefox add-on on Firefox - and Safari extension on AppStore + Firefox add-on on Firefox + and Safari extension on AppStore
Please copy and paste the API key below into the extension to get started.
From 8639265946167063b56c2061c4b90c5ff9b5eff7 Mon Sep 17 00:00:00 2001 From: Son NK Date: Wed, 19 Feb 2020 23:45:08 +0700 Subject: [PATCH 2/3] allow user to show/hide api-key --- .../templates/dashboard/api_key.html | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/app/dashboard/templates/dashboard/api_key.html b/app/dashboard/templates/dashboard/api_key.html index f6bb04e2..8981f155 100644 --- a/app/dashboard/templates/dashboard/api_key.html +++ b/app/dashboard/templates/dashboard/api_key.html @@ -45,7 +45,16 @@ {% endif %} - +
+ +
+ + + +
+
+
@@ -106,5 +115,23 @@ } }); }); + + $(".toggle-api-key").on('click', function (event) { + let that = $(this); + let apiInput = that.parent().parent().parent().find("input"); + if (that.attr("data-show") === "off") { + let apiKey = $(this).attr("data-secret"); + apiInput.val(apiKey); + that.addClass("fe-eye-off"); + that.removeClass("fe-eye"); + that.attr("data-show", "on"); + } else { + that.removeClass("fe-eye-off"); + that.addClass("fe-eye"); + apiInput.val("**********"); + that.attr("data-show", "off"); + } + + }); {% endblock %} \ No newline at end of file From 9727473b450ea40745c20368f2e699da968c8c55 Mon Sep 17 00:00:00 2001 From: Son NK Date: Wed, 19 Feb 2020 23:45:48 +0700 Subject: [PATCH 3/3] Add more fake data --- server.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index 5931d7fa..498d4d24 100644 --- a/server.py +++ b/server.py @@ -151,7 +151,10 @@ def fake_data(): db.session.commit() api_key = ApiKey.create(user_id=user.id, name="Chrome") - api_key.code = "code" + api_key.code = "codeCH" + + api_key = ApiKey.create(user_id=user.id, name="Firefox") + api_key.code = "codeFF" GenEmail.create_new(user.id, "e1@") GenEmail.create_new(user.id, "e2@")