sqlui 0.1.61 → 0.1.63
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 +96 -36
- 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: 728b5c2df39daf318b2936df45ddfd20bf1e33d2ae4545cae7484e8abeddacc9
|
4
|
+
data.tar.gz: 814be017688d908e4db747959146ecbd1eed4ed5558619b75a275573242e044e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ad46193307ad7c1b3c0e6f1c95f33bfd82994a28d7327088326ace510e4e51c4328a911c4546557d01d4fce8a6e8f735b6e636c82dadc7589256fb921b1877f
|
7
|
+
data.tar.gz: bc37ae6f014b3b53953a34f578db586e60d39c3959deb25631ce2fe06f46a914d105ecaa42fd15856874b04f196f82008e1680ea9779b206aa9f1b44f18f8a85
|
data/.release-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.63
|
data/client/resources/sqlui.css
CHANGED
data/client/resources/sqlui.js
CHANGED
@@ -24695,48 +24695,97 @@
|
|
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 margin: 0;\n padding: 10px;\n}\n\n.popup_button__CkIzv {\n width: 150px;\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
|
-
|
24740
|
+
popupElement.appendChild(titleElement);
|
24727
24741
|
|
24728
|
-
const
|
24729
|
-
|
24730
|
-
|
24731
|
-
|
24732
|
-
preElement.innerText = text;
|
24742
|
+
const contentElement = document.createElement('pre');
|
24743
|
+
contentElement.classList.add(styles$1.content);
|
24744
|
+
contentElement.innerText = text;
|
24745
|
+
popupElement.appendChild(contentElement);
|
24733
24746
|
|
24734
|
-
|
24735
|
-
|
24747
|
+
const buttonBarElement = document.createElement('div');
|
24748
|
+
buttonBarElement.classList.add(styles$1['button-bar']);
|
24749
|
+
popupElement.appendChild(buttonBarElement);
|
24750
|
+
|
24751
|
+
const jsonElement = document.createElement('input');
|
24752
|
+
jsonElement.classList.add(styles$1.button);
|
24753
|
+
jsonElement.type = 'button';
|
24754
|
+
jsonElement.value = 'Parse JSON';
|
24755
|
+
buttonBarElement.appendChild(jsonElement);
|
24756
|
+
|
24757
|
+
jsonElement.addEventListener('click', (event) => {
|
24758
|
+
try {
|
24759
|
+
contentElement.innerText = JSON.stringify(JSON.parse(text), null, 2);
|
24760
|
+
} catch (_) {
|
24761
|
+
toast('Failed to parse JSON.');
|
24762
|
+
}
|
24736
24763
|
});
|
24737
24764
|
|
24738
|
-
|
24739
|
-
|
24765
|
+
const copyElement = document.createElement('input');
|
24766
|
+
copyElement.classList.add(styles$1.button);
|
24767
|
+
copyElement.type = 'button';
|
24768
|
+
copyElement.value = 'Copy';
|
24769
|
+
buttonBarElement.appendChild(copyElement);
|
24770
|
+
|
24771
|
+
copyElement.addEventListener('click', (event) => {
|
24772
|
+
copyTextToClipboard(contentElement.innerText);
|
24773
|
+
toast('Text copied to clipboard.');
|
24774
|
+
});
|
24775
|
+
|
24776
|
+
const spacerElement = document.createElement('div');
|
24777
|
+
spacerElement.style.flex = 1;
|
24778
|
+
buttonBarElement.appendChild(spacerElement);
|
24779
|
+
|
24780
|
+
const closeElement = document.createElement('input');
|
24781
|
+
closeElement.id = 'popup-close';
|
24782
|
+
closeElement.classList.add(styles$1.button);
|
24783
|
+
closeElement.type = 'button';
|
24784
|
+
closeElement.value = 'Close';
|
24785
|
+
buttonBarElement.appendChild(closeElement);
|
24786
|
+
|
24787
|
+
closeElement.addEventListener('click', (event) => {
|
24788
|
+
document.body.removeChild(popupWrapperElement);
|
24740
24789
|
});
|
24741
24790
|
|
24742
24791
|
closeElement.focus();
|
@@ -24744,13 +24793,13 @@
|
|
24744
24793
|
|
24745
24794
|
document.addEventListener('keydown', (event) => {
|
24746
24795
|
if (event.code === 'Escape') {
|
24747
|
-
const wrapperElement = document.getElementById('popup');
|
24796
|
+
const wrapperElement = document.getElementById('popup-wrapper');
|
24748
24797
|
if (wrapperElement) {
|
24749
24798
|
event.preventDefault();
|
24750
24799
|
document.body.removeChild(wrapperElement);
|
24751
24800
|
}
|
24752
24801
|
} else if (event.code === 'Tab') {
|
24753
|
-
const wrapperElement = document.getElementById('popup');
|
24802
|
+
const wrapperElement = document.getElementById('popup-wrapper');
|
24754
24803
|
if (wrapperElement) {
|
24755
24804
|
event.preventDefault();
|
24756
24805
|
document.getElementById('popup-close').focus();
|
@@ -25668,25 +25717,36 @@
|
|
25668
25717
|
|
25669
25718
|
function registerTableCellPopup (tableElement) {
|
25670
25719
|
const listener = (event) => {
|
25671
|
-
if (event.which === 1 && event.metaKey) {
|
25720
|
+
if (event.which === 1 && (event.metaKey || event.altKey)) {
|
25672
25721
|
let node = event.target;
|
25673
25722
|
while (!['td', 'th', 'table'].includes(node.tagName.toLowerCase()) && node.parentNode) {
|
25674
25723
|
node = node.parentNode;
|
25675
25724
|
}
|
25725
|
+
|
25676
25726
|
if (node.tagName.toLowerCase() === 'td') {
|
25677
|
-
if (event.type === 'mousedown') {
|
25727
|
+
if (event.type === 'mousedown' && node.dataset.row) {
|
25678
25728
|
const row = parseInt(node.dataset.row);
|
25679
25729
|
const column = parseInt(node.dataset.column);
|
25680
25730
|
const title = window.sqlFetch.result.columns[column].replaceAll('\n', '¶');
|
25681
|
-
|
25731
|
+
if (event.metaKey) {
|
25732
|
+
createPopup(title, window.sqlFetch.result.rows[row][column]);
|
25733
|
+
} else if (event.altKey) {
|
25734
|
+
copyTextToClipboard(window.sqlFetch.result.rows[row][column]);
|
25735
|
+
toast('Text copied to clipboard.');
|
25736
|
+
}
|
25682
25737
|
}
|
25683
25738
|
event.preventDefault();
|
25684
25739
|
} else if (node.tagName.toLowerCase() === 'th') {
|
25685
|
-
if (event.type === 'mousedown') {
|
25740
|
+
if (event.type === 'mousedown' && node.dataset.column) {
|
25686
25741
|
const column = parseInt(node.dataset.column);
|
25687
25742
|
const value = window.sqlFetch.result.columns[column];
|
25688
25743
|
const title = value.replaceAll('\n', '¶');
|
25689
|
-
|
25744
|
+
if (event.metaKey) {
|
25745
|
+
createPopup(title, value);
|
25746
|
+
} else if (event.altKey) {
|
25747
|
+
copyTextToClipboard(value);
|
25748
|
+
toast('Text copied to clipboard.');
|
25749
|
+
}
|
25690
25750
|
}
|
25691
25751
|
event.preventDefault();
|
25692
25752
|
}
|
@@ -25774,7 +25834,7 @@
|
|
25774
25834
|
return
|
25775
25835
|
}
|
25776
25836
|
|
25777
|
-
document.getElementById('cancel-button').style.
|
25837
|
+
document.getElementById('cancel-button').style.visibility = 'hidden';
|
25778
25838
|
document.getElementById('fetch-sql-box').style.display = 'none';
|
25779
25839
|
document.getElementById('graph-box').style.display = 'flex';
|
25780
25840
|
|
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.63
|
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
|