pinokiod 3.273.0 → 3.281.0
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
CHANGED
package/server/public/common.js
CHANGED
|
@@ -2857,16 +2857,14 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
2857
2857
|
return;
|
|
2858
2858
|
}
|
|
2859
2859
|
trigger.dataset.createLauncherInit = 'true';
|
|
2860
|
-
trigger.addEventListener('click', () =>
|
|
2861
|
-
api.showModal();
|
|
2862
|
-
});
|
|
2860
|
+
trigger.addEventListener('click', () => guardCreateLauncher(api));
|
|
2863
2861
|
}
|
|
2864
2862
|
|
|
2865
2863
|
function openPendingCreateLauncherModal(api) {
|
|
2866
2864
|
if (!api || !createLauncherState.pendingDefaults) {
|
|
2867
2865
|
return;
|
|
2868
2866
|
}
|
|
2869
|
-
api
|
|
2867
|
+
guardCreateLauncher(api, createLauncherState.pendingDefaults);
|
|
2870
2868
|
createLauncherState.pendingDefaults = null;
|
|
2871
2869
|
if (createLauncherState.shouldCleanupQuery) {
|
|
2872
2870
|
cleanupCreateLauncherParams();
|
|
@@ -2874,6 +2872,96 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
2874
2872
|
}
|
|
2875
2873
|
}
|
|
2876
2874
|
|
|
2875
|
+
function guardCreateLauncher(api, defaults = null) {
|
|
2876
|
+
if (!api || typeof api.showModal !== 'function') {
|
|
2877
|
+
return;
|
|
2878
|
+
}
|
|
2879
|
+
const openModal = () => {
|
|
2880
|
+
if (defaults) {
|
|
2881
|
+
api.showModal(defaults);
|
|
2882
|
+
} else {
|
|
2883
|
+
api.showModal();
|
|
2884
|
+
}
|
|
2885
|
+
};
|
|
2886
|
+
const createMinimalLoadingSwal = () => {
|
|
2887
|
+
if (typeof window === 'undefined' || typeof window.Swal === 'undefined') {
|
|
2888
|
+
return () => {};
|
|
2889
|
+
}
|
|
2890
|
+
const swal = window.Swal;
|
|
2891
|
+
if (typeof swal.fire !== 'function') {
|
|
2892
|
+
return () => {};
|
|
2893
|
+
}
|
|
2894
|
+
const close = () => {
|
|
2895
|
+
if (swal.isVisible()) {
|
|
2896
|
+
swal.close();
|
|
2897
|
+
}
|
|
2898
|
+
};
|
|
2899
|
+
swal.fire({
|
|
2900
|
+
html: "<i class='fa-solid fa-circle-notch fa-spin'></i> Loading...",
|
|
2901
|
+
allowOutsideClick: false,
|
|
2902
|
+
allowEscapeKey: false,
|
|
2903
|
+
showConfirmButton: false,
|
|
2904
|
+
customClass: {
|
|
2905
|
+
container: 'loader-container',
|
|
2906
|
+
popup: 'loader-popup',
|
|
2907
|
+
htmlContainer: 'loader-dialog',
|
|
2908
|
+
footer: 'hidden',
|
|
2909
|
+
actions: 'hidden'
|
|
2910
|
+
}
|
|
2911
|
+
});
|
|
2912
|
+
return close;
|
|
2913
|
+
};
|
|
2914
|
+
const check_ready = () => {
|
|
2915
|
+
return fetch("/pinokio/requirements_ready").then((res) => {
|
|
2916
|
+
return res.json()
|
|
2917
|
+
}).then((res) => {
|
|
2918
|
+
if (res.error) {
|
|
2919
|
+
return false
|
|
2920
|
+
} else if (!res.requirements_pending) {
|
|
2921
|
+
return true
|
|
2922
|
+
}
|
|
2923
|
+
return false
|
|
2924
|
+
})
|
|
2925
|
+
}
|
|
2926
|
+
let closeMinimalLoadingModal
|
|
2927
|
+
let promise = new Promise((resolve, reject) => {
|
|
2928
|
+
check_ready().then((ready) => {
|
|
2929
|
+
if (ready) {
|
|
2930
|
+
console.log("ready 1", ready)
|
|
2931
|
+
resolve()
|
|
2932
|
+
} else {
|
|
2933
|
+
closeMinimalLoadingModal = createMinimalLoadingSwal();
|
|
2934
|
+
let interval = setInterval(() => {
|
|
2935
|
+
check_ready().then((ready) => {
|
|
2936
|
+
console.log("ready 2", ready)
|
|
2937
|
+
if (ready) {
|
|
2938
|
+
clearInterval(interval)
|
|
2939
|
+
resolve()
|
|
2940
|
+
}
|
|
2941
|
+
})
|
|
2942
|
+
}, 500)
|
|
2943
|
+
}
|
|
2944
|
+
})
|
|
2945
|
+
})
|
|
2946
|
+
promise.then(() => {
|
|
2947
|
+
if (closeMinimalLoadingModal) {
|
|
2948
|
+
closeMinimalLoadingModal()
|
|
2949
|
+
}
|
|
2950
|
+
console.log("ready")
|
|
2951
|
+
fetch('/bundle/dev')
|
|
2952
|
+
.then((response) => response.json())
|
|
2953
|
+
.then((data) => {
|
|
2954
|
+
console.log("Data", data)
|
|
2955
|
+
if (data && data.available === false) {
|
|
2956
|
+
const callback = encodeURIComponent(window.location.pathname + window.location.search + window.location.hash);
|
|
2957
|
+
window.location.href = `/setup/dev?callback=${callback}`;
|
|
2958
|
+
} else {
|
|
2959
|
+
openModal();
|
|
2960
|
+
}
|
|
2961
|
+
})
|
|
2962
|
+
})
|
|
2963
|
+
}
|
|
2964
|
+
|
|
2877
2965
|
function parseCreateLauncherDefaults() {
|
|
2878
2966
|
try {
|
|
2879
2967
|
const params = new URLSearchParams(window.location.search);
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
<title>Pinokio</title>
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
|
|
6
|
+
<link href="/xterm.min.css" rel="stylesheet" />
|
|
6
7
|
<link href="/css/fontawesome.min.css" rel="stylesheet">
|
|
7
8
|
<link href="/css/solid.min.css" rel="stylesheet">
|
|
8
9
|
<link href="/css/regular.min.css" rel="stylesheet">
|
|
@@ -156,6 +157,10 @@ body.dark .browser-options-row {
|
|
|
156
157
|
<script src="/sweetalert2.js"></script>
|
|
157
158
|
<script src="/noty.js"></script>
|
|
158
159
|
<script src="/notyq.js"></script>
|
|
160
|
+
<script src="/xterm.js"></script>
|
|
161
|
+
<script src="/xterm-addon-fit.js"></script>
|
|
162
|
+
<script src="/xterm-addon-web-links.js"></script>
|
|
163
|
+
<script src="/xterm-theme.js"></script>
|
|
159
164
|
<script src="/Socket.js"></script>
|
|
160
165
|
<script src="/install.js"></script>
|
|
161
166
|
<script src="/common.js"></script>
|
package/server/views/index.ejs
CHANGED
|
@@ -692,7 +692,7 @@ body.dark aside .current.selected {
|
|
|
692
692
|
<div>Get started by installing or creating some pinokio scripts.</div>
|
|
693
693
|
<a href="/home?mode=explore" class='btn'><i class="fa-solid fa-globe"></i> Discover</a>
|
|
694
694
|
<span> or </span>
|
|
695
|
-
<
|
|
695
|
+
<button type='button' class='btn' onclick="(function(btn){ if(btn){ btn.click(); } })(document.getElementById('create-launcher-button'))"><i class="fa-solid fa-wand-magic-sparkles"></i> Create</button>
|
|
696
696
|
</div>
|
|
697
697
|
<% } %>
|
|
698
698
|
<% } else { %>
|
package/server/views/pro.ejs
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
<script src="/xterm-addon-search-bar.js"></script>
|
|
15
15
|
<script src="/sweetalert2.js"></script>
|
|
16
16
|
<script src="/Socket.js"></script>
|
|
17
|
+
<script src="/resizeSync.js"></script>
|
|
17
18
|
<script src="/terminal-settings.js"></script>
|
|
18
19
|
<script src="/pinokio-touch.js"></script>
|
|
19
20
|
<script src="/common.js"></script>
|