server-studio 1.2.1 → 1.2.2
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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/index.html +33 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Notable changes to Server Studio. Dates are release dates.
|
|
4
4
|
|
|
5
|
+
## 1.2.2 — 2026-08-30
|
|
6
|
+
|
|
7
|
+
- The version badge no longer keeps offering an update you have already installed. Once you start
|
|
8
|
+
one it reads **restart to finish**, because the running process keeps the old code until it is
|
|
9
|
+
reopened. It returns to a plain version once you restart.
|
|
10
|
+
|
|
5
11
|
## 1.2.1 — 2026-08-30
|
|
6
12
|
|
|
7
13
|
- **Fixed:** an installed app reported its version as `0.0.0`, because the code looks for
|
package/package.json
CHANGED
package/src/index.html
CHANGED
|
@@ -113,6 +113,7 @@
|
|
|
113
113
|
.ver.has-update:hover { background: rgba(62,207,142,.24); }
|
|
114
114
|
.ver .dot-new { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex: none; }
|
|
115
115
|
.ver.checking { opacity: .55; }
|
|
116
|
+
.ver.pending { color: var(--amber); border-color: rgba(245,179,67,.4); background: rgba(245,179,67,.12); padding: 3px 9px; margin-left: -10px; }
|
|
116
117
|
@keyframes verPulse {
|
|
117
118
|
0%, 100% { box-shadow: 0 0 0 0 rgba(62,207,142,0); }
|
|
118
119
|
50% { box-shadow: 0 0 0 4px rgba(62,207,142,.18); }
|
|
@@ -831,6 +832,15 @@ function ssPrompt(title, opts) {
|
|
|
831
832
|
/* ---------- version + update ---------- */
|
|
832
833
|
let updateInfo = null;
|
|
833
834
|
|
|
835
|
+
function isNewerVersion(a, b) {
|
|
836
|
+
const pa = String(a).split('.').map(Number), pb = String(b).split('.').map(Number);
|
|
837
|
+
for (let i = 0; i < 3; i++) {
|
|
838
|
+
const x = pa[i] || 0, y = pb[i] || 0;
|
|
839
|
+
if (x !== y) return x > y;
|
|
840
|
+
}
|
|
841
|
+
return false;
|
|
842
|
+
}
|
|
843
|
+
|
|
834
844
|
async function checkUpdate() {
|
|
835
845
|
const pill = document.getElementById('verPill');
|
|
836
846
|
if (!pill) return;
|
|
@@ -840,6 +850,22 @@ async function checkUpdate() {
|
|
|
840
850
|
updateInfo = r;
|
|
841
851
|
pill.classList.remove('checking');
|
|
842
852
|
|
|
853
|
+
// An update was kicked off from here and this process is still the old one.
|
|
854
|
+
let pending = null;
|
|
855
|
+
try { pending = localStorage.getItem('ss_updating_to'); } catch (e) {}
|
|
856
|
+
if (pending && !isNewerVersion(pending, r.current)) {
|
|
857
|
+
// Already running it, so the restart happened. Clear the flag.
|
|
858
|
+
try { localStorage.removeItem('ss_updating_to'); } catch (e) {}
|
|
859
|
+
pending = null;
|
|
860
|
+
}
|
|
861
|
+
if (pending) {
|
|
862
|
+
pill.className = 'ver pending';
|
|
863
|
+
pill.textContent = 'restart to finish ' + pending;
|
|
864
|
+
pill.title = 'Version ' + pending + ' has been installed. Quit and reopen Server Studio to run it.';
|
|
865
|
+
pill.onclick = null;
|
|
866
|
+
return;
|
|
867
|
+
}
|
|
868
|
+
|
|
843
869
|
if (r.newer) {
|
|
844
870
|
pill.className = 'ver has-update';
|
|
845
871
|
pill.innerHTML = '<span class="dot-new"></span>v' + esc(r.current) + ' → ' + esc(r.latest);
|
|
@@ -864,7 +890,13 @@ async function runUpdate() {
|
|
|
864
890
|
r = await api('/api/run', { method: 'POST', headers: { 'Content-Type': 'application/json' },
|
|
865
891
|
body: JSON.stringify({ cwd: '', command: 'npm install -g server-studio' }) });
|
|
866
892
|
} catch (e) { /* server gone: fall through to the error toast rather than doing nothing */ }
|
|
867
|
-
if (r && r.ok)
|
|
893
|
+
if (r && r.ok) {
|
|
894
|
+
// The running process keeps the old code until it restarts, so stop offering the
|
|
895
|
+
// update. Continuing to show it after a successful update reads as a failure.
|
|
896
|
+
try { localStorage.setItem('ss_updating_to', updateInfo.latest); } catch (e) {}
|
|
897
|
+
checkUpdate();
|
|
898
|
+
toast('Updating in ' + TERM_NAME + '. Restart Server Studio when it finishes.');
|
|
899
|
+
}
|
|
868
900
|
else toast('Could not start the update. Run this yourself: npm install -g server-studio', true);
|
|
869
901
|
}
|
|
870
902
|
|