Merge pull request #87 from simple-login/show-hide-api-key
Show hide api key
This commit is contained in:
commit
6486d4dd6e
|
@ -19,11 +19,12 @@
|
|||
You can install the Chrome extension on
|
||||
<a href="https://chrome.google.com/webstore/detail/simplelogin-extension/dphilobhebphkdjbpfohgikllaljmgbn"
|
||||
target="_blank">Chrome Store<i class="fe fe-external-link"></i></a>,
|
||||
Firefox add-on on <a href="https://addons.mozilla.org/en-GB/firefox/addon/simplelogin/" target="_blank">Firefox<i
|
||||
class="fe fe-external-link"></i></a>
|
||||
and Safari extension on <a
|
||||
href="https://apps.apple.com/us/app/simplelogin/id1494051017?mt=12&fbclid=IwAR0M0nnEKgoieMkmx91TSXrtcScj7GouqRxGgXeJz2un_5ydhIKlbAI79Io"
|
||||
target="_blank">AppStore<i class="fe fe-external-link"></i></a>
|
||||
Firefox add-on on <a href="https://addons.mozilla.org/en-GB/firefox/addon/simplelogin/"
|
||||
target="_blank">Firefox<i
|
||||
class="fe fe-external-link"></i></a>
|
||||
and Safari extension on <a
|
||||
href="https://apps.apple.com/us/app/simplelogin/id1494051017?mt=12&fbclid=IwAR0M0nnEKgoieMkmx91TSXrtcScj7GouqRxGgXeJz2un_5ydhIKlbAI79Io"
|
||||
target="_blank">AppStore<i class="fe fe-external-link"></i></a>
|
||||
<br>
|
||||
Please copy and paste the API key below into the extension to get started. <br>
|
||||
<span class="text-danger">
|
||||
|
@ -44,7 +45,16 @@
|
|||
{% endif %}
|
||||
</h6>
|
||||
|
||||
<input class="form-control w-100" id="apikey-{{ api_key.id }}" readonly value="**********">
|
||||
<div class="input-group">
|
||||
<input class="form-control" id="apikey-{{ api_key.id }}" readonly value="**********">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">
|
||||
<i class="fe fe-eye toggle-api-key" data-show="off" data-secret="{{ api_key.code }}"
|
||||
></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="row">
|
||||
|
@ -105,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");
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
|
@ -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@")
|
||||
|
|
Loading…
Reference in a new issue