sqlui 0.1.61 → 0.1.62
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.release-version +1 -1
- data/client/resources/sqlui.css +0 -4
- data/client/resources/sqlui.js +80 -38
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ba6df74cbbe88d22279ec0a6a7cc9bf1ed191d695b84fcf424ee9b03a6b64cb
|
4
|
+
data.tar.gz: a9f53957b16860755a7d6d21980e573af93054bff997a205d791553b8b8dae59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9375a77c825b5036079d8e3d4b5df74e4370be1966441bc3a8a4a887e878fd58d79500187116c2492e3d27358084c0aaa70bd45f48aba5e387ac37c0d51e678
|
7
|
+
data.tar.gz: ac699985a8459edb63c8aeeca34c861471d468b9680fd767d8c69f14610c27d04d55feeaa07d2c0256fa0ee6148e4f659f9060b399847173fc4cbe67d3c9b6ea
|
data/.release-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.62
|
data/client/resources/sqlui.css
CHANGED
data/client/resources/sqlui.js
CHANGED
@@ -24695,48 +24695,79 @@
|
|
24695
24695
|
}
|
24696
24696
|
}
|
24697
24697
|
|
24698
|
-
var css_248z = ".popup_popup-wrapper__huCTg {\n position: absolute;\n
|
24699
|
-
var styles = {"popup-wrapper":"popup_popup-wrapper__huCTg","popup
|
24698
|
+
var css_248z$1 = ".popup_popup-wrapper__huCTg {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 2;\n margin: 0;\n padding: 0;\n background: rgba(0, 0, 0, 0.3);\n}\n\n.popup_popup__co5G- {\n position: absolute;\n top: 60px;\n right: 60px;\n bottom: 60px;\n left: 60px;\n display: flex;\n flex-direction: column;\n margin: 0;\n padding: 0;\n background: #fff;\n border: 1px solid #888;\n}\n\n.popup_title__JT4Lb {\n margin: 0;\n padding: 10px;\n font-weight: bold;\n font-family: Helvetica, sans-serif;\n font-size: 18px;\n color: #333;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n\n.popup_content__m7uSh {\n flex: 1;\n margin: 0;\n padding: 10px;\n overflow: auto;\n font-family: monospace;\n font-size: 18px;\n border-top: 1px solid #888;\n border-bottom: 1px solid #888;\n color: #333;\n}\n\n.popup_content__m7uSh:focus {\n outline: none;\n}\n\n.popup_button-bar__VCxAC {\n display: flex;\n flex-direction: row;\n justify-content: right;\n margin: 0;\n padding: 10px;\n}\n\n.popup_button__CkIzv {\n width: 100px;\n height: 30px;\n margin: 0 5px;\n cursor: pointer;\n font-family: Helvetica, sans-serif;\n display: flex;\n justify-content: center;\n font-size: 18px;\n color: #333;\n border: 1px solid #888;\n}\n\n.popup_button__CkIzv:active {\n background-color: #e6e6e6;\n}\n";
|
24699
|
+
var styles$1 = {"popup-wrapper":"popup_popup-wrapper__huCTg","popup":"popup_popup__co5G-","title":"popup_title__JT4Lb","content":"popup_content__m7uSh","button-bar":"popup_button-bar__VCxAC","button":"popup_button__CkIzv"};
|
24700
|
+
styleInject(css_248z$1);
|
24701
|
+
|
24702
|
+
var css_248z = ".toast_toast__019Ay {\n min-width: 250px; /* Set a default minimum width */\n margin-left: -125px; /* Divide value of min-width by 2 */\n position: fixed; /* Sit on top of the screen */\n left: 50%; /* Center on screen. */\n top: 30px; /* 30px from the top of the screen */\n z-index: 3;\n background-color: white;\n font-family: Helvetica, sans-serif;\n font-size: 18px;\n box-shadow: 2px 2px 2px rgb(0, 0, 0, .2);\n color: #333;\n border: 1px solid #888;\n text-align: center;\n border-radius: 2px;\n padding: 10px;\n -webkit-animation: toast_fadein__g6ghy 0.5s, toast_fadeout__8dF5T 0.5s 2.5s;\n animation: toast_fadein__g6ghy 0.5s, toast_fadeout__8dF5T 0.5s 2.5s;\n}\n\n@-webkit-keyframes toast_fadein__g6ghy {\n from {top: 0; opacity: 0;}\n to {top: 30px; opacity: 1;}\n}\n\n@keyframes toast_fadein__g6ghy {\n from {top: 0; opacity: 0;}\n to {top: 30px; opacity: 1;}\n}\n\n@-webkit-keyframes toast_fadeout__8dF5T {\n from {top: 30px; opacity: 1;}\n to {top: 0; opacity: 0;}\n}\n\n@keyframes toast_fadeout__8dF5T {\n from {top: 30px; opacity: 1;}\n to {top: 0; opacity: 0;}\n}\n";
|
24703
|
+
var styles = {"toast":"toast_toast__019Ay","fadein":"toast_fadein__g6ghy","fadeout":"toast_fadeout__8dF5T"};
|
24700
24704
|
styleInject(css_248z);
|
24701
24705
|
|
24706
|
+
function toast (text) {
|
24707
|
+
const toastElement = document.createElement('div');
|
24708
|
+
toastElement.innerText = text;
|
24709
|
+
toastElement.classList.add(styles.toast);
|
24710
|
+
document.body.appendChild(toastElement);
|
24711
|
+
toastElement.onanimationend = (e) => {
|
24712
|
+
if (e.animationName === styles.fadeout) {
|
24713
|
+
document.body.removeChild(toastElement);
|
24714
|
+
}
|
24715
|
+
};
|
24716
|
+
}
|
24717
|
+
|
24702
24718
|
function createPopup (title, text) {
|
24703
|
-
const
|
24704
|
-
|
24705
|
-
|
24706
|
-
document.body.appendChild(
|
24719
|
+
const popupWrapperElement = document.createElement('div');
|
24720
|
+
popupWrapperElement.id = 'popup-wrapper';
|
24721
|
+
popupWrapperElement.classList.add(styles$1['popup-wrapper']);
|
24722
|
+
document.body.appendChild(popupWrapperElement);
|
24707
24723
|
|
24708
|
-
|
24709
|
-
|
24710
|
-
|
24724
|
+
popupWrapperElement.addEventListener('click', () => {
|
24725
|
+
document.body.removeChild(popupWrapperElement);
|
24726
|
+
});
|
24711
24727
|
|
24712
|
-
const
|
24713
|
-
|
24714
|
-
|
24715
|
-
|
24716
|
-
closeElement.value = 'Close';
|
24717
|
-
contentElement.appendChild(closeElement);
|
24728
|
+
const popupElement = document.createElement('div');
|
24729
|
+
popupElement.id = 'popup';
|
24730
|
+
popupElement.classList.add(styles$1.popup);
|
24731
|
+
popupWrapperElement.appendChild(popupElement);
|
24718
24732
|
|
24719
|
-
|
24720
|
-
|
24733
|
+
popupElement.addEventListener('click', (event) => {
|
24734
|
+
event.stopPropagation();
|
24721
24735
|
});
|
24722
24736
|
|
24723
24737
|
const titleElement = document.createElement('div');
|
24724
|
-
titleElement.classList.add(styles
|
24738
|
+
titleElement.classList.add(styles$1.title);
|
24725
24739
|
titleElement.innerText = title;
|
24726
|
-
|
24727
|
-
|
24728
|
-
const
|
24729
|
-
|
24730
|
-
|
24731
|
-
|
24732
|
-
|
24733
|
-
|
24734
|
-
|
24735
|
-
|
24740
|
+
popupElement.appendChild(titleElement);
|
24741
|
+
|
24742
|
+
const contentElement = document.createElement('pre');
|
24743
|
+
contentElement.classList.add(styles$1.content);
|
24744
|
+
contentElement.innerText = text;
|
24745
|
+
popupElement.appendChild(contentElement);
|
24746
|
+
|
24747
|
+
const buttonBarElement = document.createElement('div');
|
24748
|
+
buttonBarElement.classList.add(styles$1['button-bar']);
|
24749
|
+
popupElement.appendChild(buttonBarElement);
|
24750
|
+
|
24751
|
+
const copyElement = document.createElement('input');
|
24752
|
+
copyElement.classList.add(styles$1.button);
|
24753
|
+
copyElement.type = 'button';
|
24754
|
+
copyElement.value = 'Copy';
|
24755
|
+
buttonBarElement.appendChild(copyElement);
|
24756
|
+
|
24757
|
+
copyElement.addEventListener('click', (event) => {
|
24758
|
+
copyTextToClipboard(text);
|
24759
|
+
toast('Text copied to clipboard.');
|
24736
24760
|
});
|
24737
24761
|
|
24738
|
-
|
24739
|
-
|
24762
|
+
const closeElement = document.createElement('input');
|
24763
|
+
closeElement.id = 'popup-close';
|
24764
|
+
closeElement.classList.add(styles$1.button);
|
24765
|
+
closeElement.type = 'button';
|
24766
|
+
closeElement.value = 'Close';
|
24767
|
+
buttonBarElement.appendChild(closeElement);
|
24768
|
+
|
24769
|
+
closeElement.addEventListener('click', (event) => {
|
24770
|
+
document.body.removeChild(popupWrapperElement);
|
24740
24771
|
});
|
24741
24772
|
|
24742
24773
|
closeElement.focus();
|
@@ -24744,13 +24775,13 @@
|
|
24744
24775
|
|
24745
24776
|
document.addEventListener('keydown', (event) => {
|
24746
24777
|
if (event.code === 'Escape') {
|
24747
|
-
const wrapperElement = document.getElementById('popup');
|
24778
|
+
const wrapperElement = document.getElementById('popup-wrapper');
|
24748
24779
|
if (wrapperElement) {
|
24749
24780
|
event.preventDefault();
|
24750
24781
|
document.body.removeChild(wrapperElement);
|
24751
24782
|
}
|
24752
24783
|
} else if (event.code === 'Tab') {
|
24753
|
-
const wrapperElement = document.getElementById('popup');
|
24784
|
+
const wrapperElement = document.getElementById('popup-wrapper');
|
24754
24785
|
if (wrapperElement) {
|
24755
24786
|
event.preventDefault();
|
24756
24787
|
document.getElementById('popup-close').focus();
|
@@ -25668,25 +25699,36 @@
|
|
25668
25699
|
|
25669
25700
|
function registerTableCellPopup (tableElement) {
|
25670
25701
|
const listener = (event) => {
|
25671
|
-
if (event.which === 1 && event.metaKey) {
|
25702
|
+
if (event.which === 1 && (event.metaKey || event.altKey)) {
|
25672
25703
|
let node = event.target;
|
25673
25704
|
while (!['td', 'th', 'table'].includes(node.tagName.toLowerCase()) && node.parentNode) {
|
25674
25705
|
node = node.parentNode;
|
25675
25706
|
}
|
25707
|
+
|
25676
25708
|
if (node.tagName.toLowerCase() === 'td') {
|
25677
|
-
if (event.type === 'mousedown') {
|
25709
|
+
if (event.type === 'mousedown' && node.dataset.row) {
|
25678
25710
|
const row = parseInt(node.dataset.row);
|
25679
25711
|
const column = parseInt(node.dataset.column);
|
25680
25712
|
const title = window.sqlFetch.result.columns[column].replaceAll('\n', '¶');
|
25681
|
-
|
25713
|
+
if (event.metaKey) {
|
25714
|
+
createPopup(title, window.sqlFetch.result.rows[row][column]);
|
25715
|
+
} else if (event.altKey) {
|
25716
|
+
copyTextToClipboard(window.sqlFetch.result.rows[row][column]);
|
25717
|
+
toast('Text copied to clipboard.');
|
25718
|
+
}
|
25682
25719
|
}
|
25683
25720
|
event.preventDefault();
|
25684
25721
|
} else if (node.tagName.toLowerCase() === 'th') {
|
25685
|
-
if (event.type === 'mousedown') {
|
25722
|
+
if (event.type === 'mousedown' && node.dataset.column) {
|
25686
25723
|
const column = parseInt(node.dataset.column);
|
25687
25724
|
const value = window.sqlFetch.result.columns[column];
|
25688
25725
|
const title = value.replaceAll('\n', '¶');
|
25689
|
-
|
25726
|
+
if (event.metaKey) {
|
25727
|
+
createPopup(title, value);
|
25728
|
+
} else if (event.altKey) {
|
25729
|
+
copyTextToClipboard(value);
|
25730
|
+
toast('Text copied to clipboard.');
|
25731
|
+
}
|
25690
25732
|
}
|
25691
25733
|
event.preventDefault();
|
25692
25734
|
}
|
@@ -25774,7 +25816,7 @@
|
|
25774
25816
|
return
|
25775
25817
|
}
|
25776
25818
|
|
25777
|
-
document.getElementById('cancel-button').style.
|
25819
|
+
document.getElementById('cancel-button').style.visibility = 'hidden';
|
25778
25820
|
document.getElementById('fetch-sql-box').style.display = 'none';
|
25779
25821
|
document.getElementById('graph-box').style.display = 'flex';
|
25780
25822
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sqlui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.62
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Dower
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: airbrake
|