synchro du labo (0bf0da65) : app.blade.php, README.md

This commit is contained in:
cloudion
2026-11-03 22:41:57 +00:00
parent d26521f05d
commit e00ad98e49
2 changed files with 117 additions and 2 deletions

View File

@@ -1,3 +1,21 @@
# ploxion-instances # ▦ Instances
PLOXION · Tout ce qui tourne : chaque fenêtre = une instance. Liste les instances live aux 4 échelles (@px ploxions · @cbion cubions · @sbion services · @bion atomes WASM). Tue une instance, une échelle, ou tout (/kill @px…). · fournit: instances, runtime, kill, meta Tout ce qui tourne : chaque fenêtre = une instance. Liste les instances live aux 4 échelles (@px ploxions · @cbion cubions · @sbion services · @bion atomes WASM). Tue une instance, une échelle, ou tout (/kill @px…).
| | |
| --- | --- |
| id | `instances` |
| fournit | `instances` `runtime` `kill` `meta` |
| bions qu'il nomme | `jOSApps` `jOSInstances` |
| fichiers | `app.blade.php` |
| dans le labo | `resources/views/ploxions/instances/` (dépôt `my_website2`) |
## Contribuer
- **Dans le xer** : https://labo.j0bot.ch/px/atelier?ploxion=instances — prends-le, modifie-le, vois-le tourner, « ⧗ envoyer le tsoin ».
- **Dans VS Code** : `xb prendre instances` (ou l'extension xerboxion › ⇩ Prendre), puis ⧗ Envoyer.
- Le chemin complet : https://labo.j0bot.ch/px/contribuer
Ce dépôt est un **miroir** du labo (synchronisé par `bin/ploxions-forge.mjs`, depuis le commit `0bf0da65`) : une modif se propose par un tsoin ou une branche du labo, pas directement ici.
© 2026 chill-tekk · ne pas nuire

97
app.blade.php Normal file
View File

@@ -0,0 +1,97 @@
{{-- PL0XION instances — TOUT CE QUI TOURNE (RS-7 : « un ploxion instances qui liste
toutes les instances qui tournent ; chaque fenêtre c'est une instance ; on peut
/kill @px / @cbion / @sbion / @bion »). Lit window.jOSInstances (registre runtime
unifié, 4 échelles). Live (poll + abonnement). Tue : une instance (✕), une échelle
(kill @scale), ou tout. window.jOSApps['instances']. mount(c,ctx)->{unmount}. --}}
<style>
.ix{display:flex;flex-direction:column;height:100%;background:#080b0a;color:#e6f2ec;font-family:ui-sans-serif,system-ui;font-size:.84rem}
.ix__bar{flex:0 0 auto;display:flex;align-items:center;gap:9px;padding:9px 12px;border-bottom:1px solid rgba(0,255,159,.2);flex-wrap:wrap}
.ix__t{font-weight:700;color:rgba(0,255,159,.95)} .ix__sub{font-size:.62rem;color:rgba(170,210,195,.6)} .ix__sp{flex:1}
.ix__cnt{font:0.7rem ui-monospace;color:rgba(160,235,195,.85)}
.ix__btn{cursor:pointer;border-radius:7px;border:1px solid rgba(0,255,159,.4);background:rgba(0,255,159,.08);color:#dffff0;font:700 .68rem ui-sans-serif;padding:5px 9px} .ix__btn:hover{background:rgba(0,255,159,.18)}
.ix__btn.kill{border-color:rgba(255,110,100,.5);background:rgba(120,40,40,.25);color:#ffd9d4} .ix__btn.kill:hover{background:rgba(160,50,50,.4)}
.ix__body{flex:1;min-height:0;overflow:auto;padding:11px 12px;display:flex;flex-direction:column;gap:13px}
.ix__grp{border:1px solid rgba(0,255,159,.14);border-radius:12px;overflow:hidden}
.ix__gh{display:flex;align-items:center;gap:8px;padding:8px 11px;background:rgba(0,255,159,.05);border-bottom:1px solid rgba(0,255,159,.12)}
.ix__gn{font-weight:700;color:rgba(120,235,190,.95);font-size:.78rem} .ix__gt{font-size:.6rem;color:rgba(170,210,195,.55)} .ix__gc{font:0.66rem ui-monospace;color:rgba(150,225,190,.8)}
.ix__row{display:flex;align-items:center;gap:9px;padding:7px 11px;border-top:1px solid rgba(255,255,255,.03)}
.ix__ic{font-size:1.05rem;flex:0 0 auto;width:20px;text-align:center}
.ix__nm{font-weight:600;color:rgba(220,240,232,.97);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ix__dt{font-size:.62rem;color:rgba(165,205,190,.6);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ix__st{font:0.58rem ui-monospace;padding:1px 7px;border-radius:11px;background:rgba(0,255,159,.1);color:rgba(150,235,195,.9);flex:0 0 auto}
.ix__st.actif{background:rgba(255,200,60,.16);color:#ffe49a} .ix__st.idle{background:rgba(150,170,190,.12);color:rgba(190,210,225,.7)}
.ix__x{cursor:pointer;border:1px solid rgba(255,110,100,.4);background:rgba(120,40,40,.2);color:#ffc;border-radius:6px;font:700 .66rem ui-monospace;padding:2px 8px;flex:0 0 auto} .ix__x:hover{background:rgba(160,50,50,.4);color:#fff} .ix__x:disabled{opacity:.35;cursor:default}
.ix__empty{font-size:.72rem;color:rgba(170,210,195,.45);text-align:center;padding:30px 12px}
.ix__foot{flex:0 0 auto;padding:6px 12px;border-top:1px solid rgba(0,255,159,.14);font:0.6rem ui-monospace;color:rgba(160,200,185,.6)}
</style>
<script>
(function () {
var ID = 'instances';
function esc(s) { return window.jOSb.esc(s); }
var SCALES = [
{ k:'px', label:'@px', icon:'▣', desc:'ploxions — fenêtres / écrans ouverts' },
{ k:'cbion', label:'@cbion', icon:'▦', desc:'cubions — compositions montées' },
{ k:'sbion', label:'@sbion', icon:'⚙', desc:'sbions — services en arrière-plan' },
{ k:'bion', label:'@bion', icon:'⬡', desc:'bions — atomes WASM instanciés' }
];
function describe() {
var API = window.jOSInstances;
var snap = API ? API.snapshot() : [];
return { v: 1, id: ID, title: 'Instances', icon: '▦', items: [
{ p: 1, kind: 'stat', label: 'tout ce qui tourne', value: snap.length }
] };
}
function mount(container, ctx) {
var off = null, timer = null;
container.innerHTML =
'<div class="ix"><div class="ix__bar"><span class="ix__t">▦ Instances</span><span class="ix__sub">tout ce qui tourne</span>'
+ '<span class="ix__sp"></span><span class="ix__cnt" data-cnt></span><button class="ix__btn" data-refresh>↻</button>'
+ '<button class="ix__btn kill" data-killall>💀 kill tout</button></div>'
+ '<div class="ix__body" data-body></div>'
+ '<div class="ix__foot">live · « tout est un OS » : boote / tourne / s\'arrête · /kill @px · @cbion · @sbion · @bion · ou ✕ une instance</div></div>';
var body = container.querySelector('[data-body]'), cntEl = container.querySelector('[data-cnt]');
function render() {
var API = window.jOSInstances;
if (!API) { body.innerHTML = '<div class="ix__empty">runtime instances indisponible.</div>'; cntEl.textContent=''; return; }
var snap = API.snapshot();
cntEl.textContent = snap.length + ' instance' + (snap.length>1?'s':'');
body.innerHTML = SCALES.map(function (S) {
var items = snap.filter(function (x) { return x.scale === S.k; });
var rows = items.length ? items.map(function (it) {
var stc = (it.state==='actif'||it.state==='idle') ? (' '+it.state) : '';
return '<div class="ix__row"><span class="ix__ic">'+esc(it.icon||'·')+'</span>'
+ '<span class="ix__nm">'+esc(it.name)+'</span>'
+ (it.detail?'<span class="ix__dt">'+esc(it.detail)+'</span>':'')
+ '<span class="ix__sp"></span>'
+ '<span class="ix__st'+stc+'">'+esc(it.state||'live')+'</span>'
+ '<button class="ix__x" data-kill="'+esc(it.id)+'"'+(it.kill?'':' disabled title="rien à arrêter"')+'>✕</button></div>';
}).join('') : '<div class="ix__row"><span class="ix__dt" style="opacity:.6">— rien —</span></div>';
return '<div class="ix__grp"><div class="ix__gh"><span class="ix__gn">'+S.icon+' '+esc(S.label)+'</span>'
+ '<span class="ix__gt">'+esc(S.desc)+'</span><span class="ix__sp"></span>'
+ '<span class="ix__gc">'+items.length+'</span>'
+ '<button class="ix__btn kill" data-killscale="'+S.k+'"'+(items.length?'':' disabled')+'>kill '+esc(S.label)+'</button></div>'
+ rows + '</div>';
}).join('');
}
body.addEventListener('click', function (e) {
var API = window.jOSInstances; if (!API) return;
var one = e.target.closest('[data-kill]'), sc = e.target.closest('[data-killscale]');
if (one) { API.kill(one.getAttribute('data-kill')); render(); }
else if (sc) { API.kill('@' + sc.getAttribute('data-killscale')); render(); }
});
container.querySelector('[data-refresh]').onclick = render;
container.querySelector('[data-killall]').onclick = function () { if (window.jOSInstances) { window.jOSInstances.kill(''); render(); } };
render();
if (window.jOSInstances && window.jOSInstances.on) off = window.jOSInstances.on(render);
timer = setInterval(render, 1200); // px (fenêtres) changent hors registre -> poll
return { unmount: function () { if (off) off(); if (timer) clearInterval(timer); container.innerHTML=''; } };
}
window.jOSApps = window.jOSApps || {};
window.jOSApps[ID] = { manifest:{ id:ID, name:'Instances', icon:'▦' }, mount:mount, describe:describe };
})();
</script>