mirror of
https://github.com/Py-KMS-Organization/py-kms.git
synced 2025-12-06 07:42:00 +01:00
Merge branch 'feature/konk22/pr120' into feature/web-ui-update
This commit is contained in:
commit
3f586f4f9f
7
py-kms/static/scripts/2.0.8/clipboard.min.js
vendored
7
py-kms/static/scripts/2.0.8/clipboard.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -55,8 +55,9 @@
|
||||||
<td>
|
<td>
|
||||||
<div style="position: relative; display: flex; align-items: center;">
|
<div style="position: relative; display: flex; align-items: center;">
|
||||||
<pre class="gvlk-value">{{ gvlk }}</pre>
|
<pre class="gvlk-value">{{ gvlk }}</pre>
|
||||||
<button class="button is-small is-primary copy-button" data-clipboard-text="{{ gvlk }}" title="Copy to clipboard">
|
<button class="button is-small ml-3" title="Copy to clipboard"
|
||||||
Copy
|
onclick="copyClick(this, '{{ gvlk }}');">
|
||||||
|
📋
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
@ -66,34 +67,31 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<!-- Include the clipboard.js library -->
|
|
||||||
<script src="{{ url_for('static', filename='scripts/2.0.8/clipboard.min.js') }}"></script>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Initialize Clipboard.js
|
// Clipboard copy functionality
|
||||||
var clipboard = new ClipboardJS('.copy-button');
|
function copyClick(button, gvlk) {
|
||||||
|
navigator.clipboard.writeText(gvlk).then(function () {
|
||||||
clipboard.on('success', function(e) {
|
button.classList.add('is-success');
|
||||||
e.trigger.innerText = 'Copied!';
|
button.textContent = '✅';
|
||||||
setTimeout(function() {
|
console.log('GVLK copied to clipboard: ' + gvlk);
|
||||||
e.trigger.innerText = 'Copy';
|
}, function (err) {
|
||||||
}, 1000);
|
button.classList.add('is-danger');
|
||||||
e.clearSelection();
|
button.textContent = '⚠️';
|
||||||
});
|
alert('Could not copy "' + gvlk + '" to clipboard: ' + err);
|
||||||
|
|
||||||
clipboard.on('error', function(e) {
|
|
||||||
e.trigger.innerText = 'Failed';
|
|
||||||
setTimeout(function() {
|
|
||||||
e.trigger.innerText = 'Copy';
|
|
||||||
}, 1000);
|
|
||||||
});
|
});
|
||||||
|
// reset the color after a few seconds
|
||||||
|
setTimeout(function () {
|
||||||
|
button.classList.remove('is-success', 'is-danger');
|
||||||
|
button.textContent = '📋';
|
||||||
|
}, 3000);
|
||||||
|
}
|
||||||
|
|
||||||
// Search functionality
|
// Search functionality
|
||||||
document.getElementById('search').addEventListener('input', function() {
|
document.getElementById('search').addEventListener('input', function () {
|
||||||
var searchValue = this.value.toLowerCase();
|
var searchValue = this.value.toLowerCase();
|
||||||
var rows = document.querySelectorAll('#product-table-body tr');
|
var rows = document.querySelectorAll('#product-table-body tr');
|
||||||
|
|
||||||
rows.forEach(function(row) {
|
rows.forEach(function (row) {
|
||||||
var nameCell = row.querySelector('.product-name');
|
var nameCell = row.querySelector('.product-name');
|
||||||
var nameText = nameCell.textContent.toLowerCase();
|
var nameText = nameCell.textContent.toLowerCase();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue