Commit 393afbe5 by Czémán Arnold

Hide command strings, it solves issue #474

parent 47e837a2
Pipeline #502 passed with stage
in 0 seconds
...@@ -70,12 +70,12 @@ $(function() { ...@@ -70,12 +70,12 @@ $(function() {
}); });
/* for js fallback */ /* for js fallback */
$("#vm-details-pw-show").parent("div").children("input").prop("type", "password"); $(".vm-details-show-password").parent("div").children("input").prop("type", "password");
/* show password */ /* show password */
$("#vm-details-pw-show").click(function() { $(".vm-details-show-password").click(function() {
var input = $(this).parent("div").children("input"); var input = $(this).parent("div").children("input");
var eye = $(this).children("#vm-details-pw-eye"); var eye = $(this).children(".vm-details-password-eye");
var span = $(this); var span = $(this);
span.tooltip("destroy"); span.tooltip("destroy");
...@@ -253,6 +253,11 @@ $(function() { ...@@ -253,6 +253,11 @@ $(function() {
}); });
// Clipboard for connection strings // Clipboard for connection strings
if(Clipboard.isSupported()) if(Clipboard.isSupported()) {
new Clipboard(".vm-details-connection-string-copy"); new Clipboard(".vm-details-connection-string-copy", {
text: function(trigger) {
return $($(trigger).data("clipboard-target")).val();
}
});
}
}); });
...@@ -133,9 +133,9 @@ ...@@ -133,9 +133,9 @@
<div class="input-group"> <div class="input-group">
<input type="text" id="vm-details-pw-input" class="form-control input-sm input-tags" <input type="text" id="vm-details-pw-input" class="form-control input-sm input-tags"
value="{{ instance.pw }}" spellcheck="false" autocomplete="new-password"/> value="{{ instance.pw }}" spellcheck="false" autocomplete="new-password"/>
<span class="input-group-addon btn btn-default input-tags" id="vm-details-pw-show" <span class="input-group-addon btn btn-default input-tags vm-details-show-password"
title="{% trans "Show password" %}" data-container="body"> title="{% trans "Show password" %}" data-container="body">
<i class="fa fa-eye" id="vm-details-pw-eye"></i> <i class="fa fa-eye vm-details-password-eye"></i>
</span> </span>
</div> </div>
</dd> </dd>
...@@ -160,6 +160,10 @@ ...@@ -160,6 +160,10 @@
<input type="text" spellcheck="false" <input type="text" spellcheck="false"
value="{{ c.cmd }}" value="{{ c.cmd }}"
id="vm-details-connection-string-{{ c.id }}" class="form-control input-tags" /> id="vm-details-connection-string-{{ c.id }}" class="form-control input-tags" />
<span class="input-group-addon btn btn-default input-tags vm-details-show-password"
title="{% trans "Show password" %}" data-container="body">
<i class="fa fa-eye vm-details-password-eye"></i>
</span>
<span class="input-group-addon input-tags btn btn-default vm-details-connection-string-copy" <span class="input-group-addon input-tags btn btn-default vm-details-connection-string-copy"
title="{% trans "Copy to clipboard" %}" title="{% trans "Copy to clipboard" %}"
data-container="body" data-container="body"
...@@ -167,15 +171,11 @@ ...@@ -167,15 +171,11 @@
<i class="fa fa-copy"></i> <i class="fa fa-copy"></i>
</span> </span>
</div> </div>
{% empty %} {% empty %}
<div class="input-group dashboard-vm-details-connect-command"> <div class="input-group dashboard-vm-details-connect-command">
<span class="input-group-addon input-tags">{% trans "Command" %}</span> <span class="input-group-addon input-tags">{% trans "Command" %}</span>
<input type="text" spellcheck="false" value="{% trans "Connection is not possible." %}" <input type="text" spellcheck="false" value="{% trans "Connection is not possible." %}"
id="vm-details-connection-string" class="form-control input-tags" /> id="vm-details-connection-string" class="form-control input-tags" />
<span class="input-group-addon input-tags" id="vm-details-connection-string-copy">
<i class="fa fa-copy" title="{% trans "Select all" %}"></i>
</span>
</div> </div>
{% endfor %} {% endfor %}
{% if instance.get_connect_uri %} {% if instance.get_connect_uri %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment