pinokiod 0.1.75 → 0.1.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/server/public/style.css +22 -3
- package/server/views/editor.ejs +45 -26
- package/server/views/fullscreen_editor.ejs +46 -30
package/package.json
CHANGED
package/server/public/style.css
CHANGED
|
@@ -458,11 +458,9 @@ body.columns .containers {
|
|
|
458
458
|
}
|
|
459
459
|
.containers {
|
|
460
460
|
display: flex;
|
|
461
|
-
height: 100%;
|
|
462
461
|
}
|
|
463
462
|
.containers main {
|
|
464
463
|
width: 100%;
|
|
465
|
-
height: 100%;
|
|
466
464
|
}
|
|
467
465
|
.containers .terminal-container {
|
|
468
466
|
position: fixed;
|
|
@@ -658,6 +656,7 @@ body.dark .memory {
|
|
|
658
656
|
.memory table:empty {
|
|
659
657
|
margin-top: 0;
|
|
660
658
|
}
|
|
659
|
+
/*
|
|
661
660
|
.memory table {
|
|
662
661
|
margin-top: 10px;
|
|
663
662
|
}
|
|
@@ -665,6 +664,26 @@ body.dark .memory {
|
|
|
665
664
|
background: rgba(0,0,200,0.04);
|
|
666
665
|
border-left: 5px solid black;
|
|
667
666
|
}
|
|
667
|
+
*/
|
|
668
|
+
.memory {
|
|
669
|
+
position: absolute;
|
|
670
|
+
z-index: 10000;
|
|
671
|
+
top: 10;
|
|
672
|
+
right: 10;
|
|
673
|
+
background: white;
|
|
674
|
+
cursor: pointer;
|
|
675
|
+
}
|
|
676
|
+
.memory.collapsed table {
|
|
677
|
+
display: none;
|
|
678
|
+
}
|
|
679
|
+
.memory-header {
|
|
680
|
+
display: flex;
|
|
681
|
+
padding: 0 10px;
|
|
682
|
+
align-items: center;
|
|
683
|
+
}
|
|
684
|
+
#lv {
|
|
685
|
+
padding: 5px;
|
|
686
|
+
}
|
|
668
687
|
.memory td:first-child {
|
|
669
688
|
font-weight: bold;
|
|
670
689
|
}
|
|
@@ -1421,7 +1440,6 @@ header .home {
|
|
|
1421
1440
|
width: 200px;
|
|
1422
1441
|
display: block;
|
|
1423
1442
|
}
|
|
1424
|
-
*/
|
|
1425
1443
|
footer.status {
|
|
1426
1444
|
position: fixed;
|
|
1427
1445
|
z-index: 10000;
|
|
@@ -1433,3 +1451,4 @@ footer.status {
|
|
|
1433
1451
|
display: block;
|
|
1434
1452
|
background: black;
|
|
1435
1453
|
}
|
|
1454
|
+
*/
|
package/server/views/editor.ejs
CHANGED
|
@@ -670,6 +670,15 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
670
670
|
await reloadMemory()
|
|
671
671
|
}
|
|
672
672
|
})
|
|
673
|
+
document.querySelector("#lv").addEventListener("click", (e) => {
|
|
674
|
+
let m = e.target.closest(".memory")
|
|
675
|
+
m.classList.toggle("collapsed")
|
|
676
|
+
if (m.classList.contains("collapsed")) {
|
|
677
|
+
m.querySelector("i").className = "fa-solid fa-sort-down"
|
|
678
|
+
} else {
|
|
679
|
+
m.querySelector("i").className = "fa-solid fa-sort-up"
|
|
680
|
+
}
|
|
681
|
+
})
|
|
673
682
|
})
|
|
674
683
|
const reloadMemory = async () => {
|
|
675
684
|
let url = "/pinokio/memory?filepath=" + encodeURI("<%-filepath%>")
|
|
@@ -679,7 +688,7 @@ const reloadMemory = async () => {
|
|
|
679
688
|
})
|
|
680
689
|
console.log("memory", memory)
|
|
681
690
|
document.querySelector(".memory table").innerHTML = memory.map((m) => {
|
|
682
|
-
let html = `<tr><td
|
|
691
|
+
let html = `<tr><td>local.${m.key}</td><td>${m.val}</td>`
|
|
683
692
|
if (m.localhost) {
|
|
684
693
|
if (m.tunnel) {
|
|
685
694
|
html += `<td>${m.tunnel}</td>
|
|
@@ -747,31 +756,6 @@ const reloadMemory = async () => {
|
|
|
747
756
|
<div id='save' class='btn disabled'>
|
|
748
757
|
<span class='save'><i class="fa-solid fa-check"></i> Save</span>
|
|
749
758
|
</div>
|
|
750
|
-
<% if (memory.length > 0) { %>
|
|
751
|
-
<div class='memory'>
|
|
752
|
-
<table>
|
|
753
|
-
<% memory.forEach((m) => { %>
|
|
754
|
-
<tr>
|
|
755
|
-
<td>local.<%=m.key%></td>
|
|
756
|
-
<td><%=m.val%></td>
|
|
757
|
-
<% if (m.localhost) { %>
|
|
758
|
-
<% if (m.tunnel) { %>
|
|
759
|
-
<td><%=m.tunnel%></td>
|
|
760
|
-
<td><a class='btn2' target="_blank" href="<%=m.tunnel%>"><i class="fa-solid fa-arrow-up-right-from-square"></i> Open</a></td>
|
|
761
|
-
<td><button data-url="<%=m.val%>" class='btn2 tunnel-stop'><i class="fa-solid fa-lock-closed"></i> Make Private</button></td>
|
|
762
|
-
<% } else { %>
|
|
763
|
-
<td><button data-url="<%=m.val%>" class='btn2 tunnel'><i class="fa-solid fa-lock-open"></i> Make Public</button></td>
|
|
764
|
-
<% } %>
|
|
765
|
-
<% } %>
|
|
766
|
-
</tr>
|
|
767
|
-
<% }) %>
|
|
768
|
-
</table>
|
|
769
|
-
</div>
|
|
770
|
-
<% } else { %>
|
|
771
|
-
<div class='memory'>
|
|
772
|
-
<table></table>
|
|
773
|
-
</div>
|
|
774
|
-
<% } %>
|
|
775
759
|
</div>
|
|
776
760
|
<% } %>
|
|
777
761
|
</header>
|
|
@@ -819,6 +803,41 @@ const reloadMemory = async () => {
|
|
|
819
803
|
<div id='editor'><%=content%></div>
|
|
820
804
|
</main>
|
|
821
805
|
<div class='terminal-container'>
|
|
806
|
+
<% if (memory.length > 0) { %>
|
|
807
|
+
<div class='memory'>
|
|
808
|
+
<div class='memory-header'>
|
|
809
|
+
<div>Memory</div>
|
|
810
|
+
<div class='flexible'></div>
|
|
811
|
+
<div id='lv' class='btn2'><i class="fa-solid fa-sort-up"></i></div>
|
|
812
|
+
</div>
|
|
813
|
+
<table>
|
|
814
|
+
<% memory.forEach((m) => { %>
|
|
815
|
+
<tr>
|
|
816
|
+
<td>local.<%=m.key%></td>
|
|
817
|
+
<td><%=m.val%></td>
|
|
818
|
+
<% if (m.localhost) { %>
|
|
819
|
+
<% if (m.tunnel) { %>
|
|
820
|
+
<td><%=m.tunnel%></td>
|
|
821
|
+
<td><a class='btn2' target="_blank" href="<%=m.tunnel%>"><i class="fa-solid fa-arrow-up-right-from-square"></i> Open</a></td>
|
|
822
|
+
<td><button data-url="<%=m.val%>" class='btn2 tunnel-stop'><i class="fa-solid fa-lock-closed"></i> Make Private</button></td>
|
|
823
|
+
<% } else { %>
|
|
824
|
+
<td><button data-url="<%=m.val%>" class='btn2 tunnel'><i class="fa-solid fa-lock-open"></i> Make Public</button></td>
|
|
825
|
+
<% } %>
|
|
826
|
+
<% } %>
|
|
827
|
+
</tr>
|
|
828
|
+
<% }) %>
|
|
829
|
+
</table>
|
|
830
|
+
</div>
|
|
831
|
+
<% } else { %>
|
|
832
|
+
<div class='memory'>
|
|
833
|
+
<div class='memory-header'>
|
|
834
|
+
<div>Memory</div>
|
|
835
|
+
<div class='flexible'></div>
|
|
836
|
+
<div id='lv' class='btn2'><i class="fa-solid fa-sort-up"></i></div>
|
|
837
|
+
</div>
|
|
838
|
+
<table></table>
|
|
839
|
+
</div>
|
|
840
|
+
<% } %>
|
|
822
841
|
<div id='terminal'></div>
|
|
823
842
|
</div>
|
|
824
843
|
<!--
|
|
@@ -97,9 +97,6 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
97
97
|
document.querySelector(".requirements .content").innerHTML = '<div class="loading"><i class="fa-solid fa-circle-exclamation"></i> <%=error%></div>'
|
|
98
98
|
<% } %>
|
|
99
99
|
<% if (!install_required) { %>
|
|
100
|
-
document.querySelector("footer").addEventListener("click", (e) => {
|
|
101
|
-
document.querySelector("footer").classList.add('hidden')
|
|
102
|
-
})
|
|
103
100
|
/*
|
|
104
101
|
document.querySelector("footer").addEventListener("click", (e) => {
|
|
105
102
|
if (e.target.classList.contains("toggle-expand") || e.target.closest(".toggle-expand")) {
|
|
@@ -667,6 +664,15 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
667
664
|
})
|
|
668
665
|
})
|
|
669
666
|
*/
|
|
667
|
+
document.querySelector("#lv").addEventListener("click", (e) => {
|
|
668
|
+
let m = e.target.closest(".memory")
|
|
669
|
+
m.classList.toggle("collapsed")
|
|
670
|
+
if (m.classList.contains("collapsed")) {
|
|
671
|
+
m.querySelector("i").className = "fa-solid fa-sort-down"
|
|
672
|
+
} else {
|
|
673
|
+
m.querySelector("i").className = "fa-solid fa-sort-up"
|
|
674
|
+
}
|
|
675
|
+
})
|
|
670
676
|
})
|
|
671
677
|
const reloadMemory = async () => {
|
|
672
678
|
let url = "/pinokio/memory?filepath=<%=encodedFilePath%>"
|
|
@@ -676,7 +682,7 @@ const reloadMemory = async () => {
|
|
|
676
682
|
})
|
|
677
683
|
console.log("memory", memory)
|
|
678
684
|
document.querySelector(".memory table").innerHTML = memory.map((m) => {
|
|
679
|
-
let html = `<tr><td
|
|
685
|
+
let html = `<tr><td>local.${m.key}</td><td>${m.val}</td>`
|
|
680
686
|
if (m.localhost) {
|
|
681
687
|
if (m.tunnel) {
|
|
682
688
|
html += `<td>${m.tunnel}</td>
|
|
@@ -735,31 +741,6 @@ const reloadMemory = async () => {
|
|
|
735
741
|
<span class='save'><i class="fa-solid fa-check"></i> Save</span>
|
|
736
742
|
</div>
|
|
737
743
|
-->
|
|
738
|
-
<% if (memory.length > 0) { %>
|
|
739
|
-
<div class='memory'>
|
|
740
|
-
<table>
|
|
741
|
-
<% memory.forEach((m) => { %>
|
|
742
|
-
<tr>
|
|
743
|
-
<td>local.<%=m.key%></td>
|
|
744
|
-
<td><%=m.val%></td>
|
|
745
|
-
<% if (m.localhost) { %>
|
|
746
|
-
<% if (m.tunnel) { %>
|
|
747
|
-
<td><%=m.tunnel%></td>
|
|
748
|
-
<td><a class='btn2' target="_blank" href="<%=m.tunnel%>"><i class="fa-solid fa-arrow-up-right-from-square"></i> Open</a></td>
|
|
749
|
-
<td><button data-url="<%=m.val%>" class='btn2 tunnel-stop'><i class="fa-solid fa-lock-closed"></i> Make Private</button></td>
|
|
750
|
-
<% } else { %>
|
|
751
|
-
<td><button data-url="<%=m.val%>" class='btn2 tunnel'><i class="fa-solid fa-lock-open"></i> Make Public</button></td>
|
|
752
|
-
<% } %>
|
|
753
|
-
<% } %>
|
|
754
|
-
</tr>
|
|
755
|
-
<% }) %>
|
|
756
|
-
</table>
|
|
757
|
-
</div>
|
|
758
|
-
<% } else { %>
|
|
759
|
-
<div class='memory'>
|
|
760
|
-
<table></table>
|
|
761
|
-
</div>
|
|
762
|
-
<% } %>
|
|
763
744
|
</div>
|
|
764
745
|
<% } %>
|
|
765
746
|
</header>
|
|
@@ -800,9 +781,44 @@ const reloadMemory = async () => {
|
|
|
800
781
|
</div>
|
|
801
782
|
<% } else { %>
|
|
802
783
|
<div class='terminal-container'>
|
|
784
|
+
<% if (memory.length > 0) { %>
|
|
785
|
+
<div class='memory'>
|
|
786
|
+
<div class='memory-header'>
|
|
787
|
+
<div>Memory</div>
|
|
788
|
+
<div class='flexible'></div>
|
|
789
|
+
<div id='lv' class='btn2'><i class="fa-solid fa-sort-up"></i></div>
|
|
790
|
+
</div>
|
|
791
|
+
<table>
|
|
792
|
+
<% memory.forEach((m) => { %>
|
|
793
|
+
<tr>
|
|
794
|
+
<td>local.<%=m.key%></td>
|
|
795
|
+
<td><%=m.val%></td>
|
|
796
|
+
<% if (m.localhost) { %>
|
|
797
|
+
<% if (m.tunnel) { %>
|
|
798
|
+
<td><%=m.tunnel%></td>
|
|
799
|
+
<td><a class='btn2' target="_blank" href="<%=m.tunnel%>"><i class="fa-solid fa-arrow-up-right-from-square"></i> Open</a></td>
|
|
800
|
+
<td><button data-url="<%=m.val%>" class='btn2 tunnel-stop'><i class="fa-solid fa-lock-closed"></i> Make Private</button></td>
|
|
801
|
+
<% } else { %>
|
|
802
|
+
<td><button data-url="<%=m.val%>" class='btn2 tunnel'><i class="fa-solid fa-lock-open"></i> Make Public</button></td>
|
|
803
|
+
<% } %>
|
|
804
|
+
<% } %>
|
|
805
|
+
</tr>
|
|
806
|
+
<% }) %>
|
|
807
|
+
</table>
|
|
808
|
+
</div>
|
|
809
|
+
<% } else { %>
|
|
810
|
+
<div class='memory'>
|
|
811
|
+
<div class='memory-header'>
|
|
812
|
+
<div>Memory</div>
|
|
813
|
+
<div class='flexible'></div>
|
|
814
|
+
<div id='lv' class='btn2'><i class="fa-solid fa-sort-up"></i></div>
|
|
815
|
+
</div>
|
|
816
|
+
<table></table>
|
|
817
|
+
</div>
|
|
818
|
+
<% } %>
|
|
803
819
|
<div id='terminal'></div>
|
|
804
820
|
</div>
|
|
805
|
-
<footer
|
|
821
|
+
<footer><b>Ready</b></footer>
|
|
806
822
|
<% } %>
|
|
807
823
|
<% } %>
|
|
808
824
|
</body>
|