synchro du labo (0bf0da65) : app.blade.php, README.md
This commit is contained in:
22
README.md
22
README.md
@@ -1,3 +1,21 @@
|
||||
# ploxion-forge-apps
|
||||
# 🏭 Forge d'apps
|
||||
|
||||
PLOXION · Découvre les importeurs d'apps : le catalogue est généré DÉTERMINISTIQUEMENT (services × types de données × méthodes = des centaines de milliers). Cherche, swipe, adopte dans Libre, ou forge le tien → publié au nexus. Les gens découvrent eux-mêmes. · fournit: forge, decouverte, import, catalogue, nexus
|
||||
Découvre les importeurs d'apps : le catalogue est généré DÉTERMINISTIQUEMENT (services × types de données × méthodes = des centaines de milliers). Cherche, swipe, adopte dans Libre, ou forge le tien → publié au nexus. Les gens découvrent eux-mêmes.
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| id | `forge-apps` |
|
||||
| fournit | `forge` `decouverte` `import` `catalogue` `nexus` |
|
||||
| bions qu'il nomme | `jOSApps` `jOSPorts` |
|
||||
| fichiers | `app.blade.php` |
|
||||
| dans le labo | `resources/views/ploxions/forge-apps/` (dépôt `my_website2`) |
|
||||
|
||||
## Contribuer
|
||||
|
||||
- **Dans le xer** : https://labo.j0bot.ch/px/atelier?ploxion=forge-apps — prends-le, modifie-le, vois-le tourner, « ⧗ envoyer le tsoin ».
|
||||
- **Dans VS Code** : `xb prendre forge-apps` (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
|
||||
|
||||
140
app.blade.php
Normal file
140
app.blade.php
Normal file
@@ -0,0 +1,140 @@
|
||||
{{-- Ploxion FORGE D'APPS 🏭 — découvre les importeurs. Le catalogue est généré
|
||||
DÉTERMINISTIQUEMENT (services × catégories × méthodes = des centaines de milliers)
|
||||
par /px/forge/importers. Les gens cherchent, swipent, adoptent dans Libre, ou
|
||||
forgent le leur → publié au nexus décentralisé. --}}
|
||||
<style>
|
||||
.fga { display:flex; flex-direction:column; gap:11px; height:100%; overflow:auto; padding:14px;
|
||||
background:#080b13; color:#e7eefb; font-family:ui-sans-serif,system-ui,-apple-system,sans-serif; -webkit-overflow-scrolling:touch; }
|
||||
.fga__hd { display:flex; align-items:baseline; gap:9px; flex-wrap:wrap; }
|
||||
.fga__hd b { font-size:1.15rem; }
|
||||
.fga__cnt { font-size:.74rem; color:#7fe0c8; }
|
||||
.fga__bar { display:flex; gap:7px; flex-wrap:wrap; }
|
||||
.fga__in { flex:1 1 180px; min-width:0; background:#0b1220; border:1px solid rgba(120,160,230,.3); border-radius:9px; padding:8px 11px; color:#eaf3ff; font:inherit; font-size:.85rem; outline:none; }
|
||||
.fga__chips { display:flex; gap:6px; flex-wrap:wrap; }
|
||||
.fga__chip { cursor:pointer; font-size:.7rem; padding:5px 9px; border-radius:8px; border:1px solid rgba(120,160,230,.25); background:rgba(20,30,50,.6); color:#bcd; }
|
||||
.fga__chip.on { background:rgba(0,255,159,.16); border-color:rgba(0,255,159,.45); color:#bfe; }
|
||||
.fga__grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:9px; }
|
||||
.fga__c { text-align:left; cursor:pointer; padding:11px 12px; border-radius:12px; background:rgba(14,22,38,.7);
|
||||
border:1px solid rgba(120,160,230,.2); color:inherit; font:inherit; display:flex; flex-direction:column; gap:4px; }
|
||||
.fga__c:hover { border-color:rgba(120,160,230,.5); }
|
||||
.fga__c .top { display:flex; align-items:center; gap:7px; }
|
||||
.fga__c .ic { font-size:1.2rem; }
|
||||
.fga__c .app { font-weight:700; font-size:.85rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
|
||||
.fga__c .cat { font-size:.78rem; color:#cdd; }
|
||||
.fga__c .meta { display:flex; gap:5px; flex-wrap:wrap; margin-top:3px; }
|
||||
.fga__t { font-size:.58rem; text-transform:uppercase; letter-spacing:.03em; padding:2px 6px; border-radius:6px; background:rgba(120,160,230,.16); color:#9db6de; }
|
||||
.fga__more { align-self:center; cursor:pointer; padding:8px 18px; border-radius:9px; border:1px solid rgba(120,160,230,.4); background:rgba(20,30,50,.7); color:#e7eefb; font:inherit; font-size:.8rem; }
|
||||
.fga__b { cursor:pointer; padding:8px 13px; border-radius:9px; border:1px solid rgba(120,160,230,.4); background:rgba(20,30,50,.7); color:#e7eefb; font:inherit; font-size:.78rem; }
|
||||
.fga__b.go { background:linear-gradient(145deg,rgba(0,255,159,.24),rgba(0,255,159,.08)); border-color:rgba(0,255,159,.5); color:#d6ffe9; }
|
||||
.fga__empty { color:#5f7699; font-size:.82rem; padding:10px 0; }
|
||||
.fga__ov { position:absolute; inset:0; background:rgba(5,8,14,.9); z-index:50; display:flex; align-items:center; justify-content:center; padding:18px; }
|
||||
.fga__card { max-width:340px; width:100%; background:#0c1424; border:1px solid rgba(120,160,230,.3); border-radius:16px; padding:18px; display:flex; flex-direction:column; gap:9px; }
|
||||
.fga__card h3 { margin:0; font-size:1.05rem; }
|
||||
.fga__card .how { font-size:.78rem; color:#9db; line-height:1.4; }
|
||||
.fga__card label { font-size:.72rem; color:#9ab; display:block; margin-top:4px; }
|
||||
.fga__card input, .fga__card select { width:100%; box-sizing:border-box; background:#0b1220; border:1px solid rgba(120,160,230,.3); border-radius:8px; padding:7px 9px; color:#eaf3ff; font:inherit; font-size:.82rem; }
|
||||
.fga__row { display:flex; gap:7px; flex-wrap:wrap; }
|
||||
</style>
|
||||
<script>
|
||||
(function () {
|
||||
var VIEWS = ['timeline', 'gallery', 'table', 'list', 'chat', 'map', 'stats'];
|
||||
|
||||
function esc(s) { return String(s == null ? '' : s).replace(/[<>&"]/g, function (c) { return ({ '<': '<', '>': '>', '&': '&', '"': '"' }[c]); }); }
|
||||
|
||||
function mount(container) {
|
||||
container.innerHTML = '';
|
||||
var root = document.createElement('div'); root.className = 'fga'; container.appendChild(root);
|
||||
root.innerHTML =
|
||||
'<div class="fga__hd"><b>🏭 Forge d\'apps</b><span class="fga__cnt" data-cnt>…</span></div>'
|
||||
+ '<div class="fga__bar"><input class="fga__in" data-q placeholder="cherche une app, un type de données… (spotify, messages, transactions)"><button class="fga__b" data-forge>➕ forger le mien</button></div>'
|
||||
+ '<div class="fga__chips" data-methods></div>'
|
||||
+ '<div class="fga__grid" data-grid></div>'
|
||||
+ '<div style="text-align:center"><button class="fga__more" data-more hidden>charger plus</button><div class="fga__empty" data-empty hidden></div></div>';
|
||||
|
||||
var qEl = root.querySelector('[data-q]'), grid = root.querySelector('[data-grid]'), cntEl = root.querySelector('[data-cnt]'),
|
||||
moreEl = root.querySelector('[data-more]'), emptyEl = root.querySelector('[data-empty]'), methodsEl = root.querySelector('[data-methods]');
|
||||
var page = 1, method = '', q = '', total = 0, timer = null;
|
||||
|
||||
['', 'gdpr', 'api', 'scrape'].forEach(function (m) {
|
||||
var lbl = { '': 'tout', gdpr: '⬇️ export', api: '🔌 API', scrape: '🔬 scan' }[m];
|
||||
var b = document.createElement('span'); b.className = 'fga__chip' + (m === '' ? ' on' : ''); b.textContent = lbl; b.setAttribute('data-m', m);
|
||||
b.onclick = function () { methodsEl.querySelectorAll('.fga__chip').forEach(function (x) { x.classList.remove('on'); }); b.classList.add('on'); method = m; reload(); };
|
||||
methodsEl.appendChild(b);
|
||||
});
|
||||
|
||||
function url() { return '/px/forge/importers?per=24&page=' + page + '&method=' + encodeURIComponent(method) + (q ? '&q=' + encodeURIComponent(q) : ''); }
|
||||
|
||||
function load(append) {
|
||||
fetch(url(), { headers: { Accept: 'application/json' } }).then(function (r) { return r.json(); }).then(function (d) {
|
||||
total = d.total || 0;
|
||||
cntEl.textContent = total.toLocaleString('fr-CH') + ' importeurs à découvrir · ' + (d.services || 0) + ' apps';
|
||||
if (!append) grid.innerHTML = '';
|
||||
(d.items || []).forEach(function (it) { grid.appendChild(cardEl(it)); });
|
||||
moreEl.hidden = (page * d.per) >= total || (d.items || []).length === 0;
|
||||
emptyEl.hidden = total > 0; if (total === 0) emptyEl.textContent = 'Aucun importeur — élargis ta recherche.';
|
||||
}).catch(function () { cntEl.textContent = 'catalogue indisponible'; });
|
||||
}
|
||||
function reload() { page = 1; load(false); }
|
||||
|
||||
function cardEl(it) {
|
||||
var el = document.createElement('button'); el.className = 'fga__c';
|
||||
el.innerHTML = '<div class="top"><span class="ic">' + esc(it.icon) + '</span><span class="app">' + esc(it.appName || it.app) + '</span></div>'
|
||||
+ '<span class="cat">' + esc(it.catName) + '</span>'
|
||||
+ '<div class="meta"><span class="fga__t">' + esc(it.view) + '</span><span class="fga__t">' + esc(it.methodIcon || '') + ' ' + esc(it.method) + '</span></div>';
|
||||
el.onclick = function () { detail(it); };
|
||||
return el;
|
||||
}
|
||||
|
||||
function detail(it) {
|
||||
var ov = document.createElement('div'); ov.className = 'fga__ov';
|
||||
ov.innerHTML = '<div class="fga__card"><h3>' + esc(it.icon) + ' ' + esc(it.appName || it.app) + '</h3>'
|
||||
+ '<div>' + esc(it.catName) + ' · <span class="fga__t">' + esc(it.view) + '</span></div>'
|
||||
+ '<div class="how"><b>' + esc(it.methodName) + '</b> — ' + esc(it.how) + '</div>'
|
||||
+ '<div class="fga__row"><button class="fga__b go" data-open>🧲 ouvrir dans Libre</button><button class="fga__b" data-pub>☁ publier au nexus</button><button class="fga__b" data-close>fermer</button></div></div>';
|
||||
ov.onclick = function (e) { if (e.target === ov) ov.remove(); };
|
||||
ov.querySelector('[data-close]').onclick = function () { ov.remove(); };
|
||||
ov.querySelector('[data-open]').onclick = function () {
|
||||
ov.remove();
|
||||
try { if (window.jOSApps && window.jOSApps.libre && window.jOS && window.jOS.openPloxion) window.jOS.openPloxion('libre'); else if (window.jOSPorts) window.jOSPorts.emit('forge-apps', 'open', { app: it.app }); } catch (e) {}
|
||||
};
|
||||
ov.querySelector('[data-pub]').onclick = function () { publish(it); ov.remove(); };
|
||||
container.appendChild(ov);
|
||||
}
|
||||
|
||||
function publish(spec) {
|
||||
fetch('/px/nexus/publish-spec', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': (window.jOSb && jOSb.csrf ? jOSb.csrf() : ''), 'Accept': 'application/json' }, credentials: 'same-origin', body: JSON.stringify({ id: 'imp-' + spec.id, name: (spec.appName || spec.app) + ' · ' + spec.catName, icon: spec.icon || '🧲', spec: spec }) })
|
||||
.then(function (r) { if (window.jOSb && jOSb.toast) jOSb.toast(r.ok ? '☁ publié au nexus' : '✗ publication'); }).catch(function () {});
|
||||
}
|
||||
|
||||
// forger le sien
|
||||
root.querySelector('[data-forge]').onclick = function () {
|
||||
var ov = document.createElement('div'); ov.className = 'fga__ov';
|
||||
ov.innerHTML = '<div class="fga__card"><h3>➕ Forger un importeur</h3>'
|
||||
+ '<label>App / service</label><input data-fa placeholder="ex : Vinted">'
|
||||
+ '<label>Type de données</label><input data-fc placeholder="ex : ventes">'
|
||||
+ '<label>Vue</label><select data-fv>' + VIEWS.map(function (v) { return '<option>' + v + '</option>'; }).join('') + '</select>'
|
||||
+ '<div class="fga__row"><button class="fga__b go" data-fok>forger + publier au nexus</button><button class="fga__b" data-close>annuler</button></div></div>';
|
||||
ov.onclick = function (e) { if (e.target === ov) ov.remove(); };
|
||||
ov.querySelector('[data-close]').onclick = function () { ov.remove(); };
|
||||
ov.querySelector('[data-fok]').onclick = function () {
|
||||
var a = ov.querySelector('[data-fa]').value.trim(), c = ov.querySelector('[data-fc]').value.trim(), v = ov.querySelector('[data-fv]').value;
|
||||
if (!a) return;
|
||||
var slug = a.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');
|
||||
publish({ id: slug + '.' + (c.toLowerCase().replace(/[^a-z0-9]+/g, '-') || 'data') + '.custom', app: slug, appName: a, catName: c || 'données', view: v, icon: '🧲', method: 'custom', methodName: 'forgé', how: 'importeur communautaire' });
|
||||
if (window.jOSb && jOSb.toast) jOSb.toast('🔨 « ' + a + ' » forgé + publié au nexus');
|
||||
ov.remove();
|
||||
};
|
||||
container.appendChild(ov);
|
||||
};
|
||||
|
||||
qEl.addEventListener('input', function () { clearTimeout(timer); timer = setTimeout(function () { q = qEl.value.trim(); reload(); }, 280); });
|
||||
moreEl.onclick = function () { page++; load(true); };
|
||||
load(false);
|
||||
|
||||
return { unmount: function () { container.innerHTML = ''; } };
|
||||
}
|
||||
|
||||
window.jOSApps = window.jOSApps || {};
|
||||
window.jOSApps['forge-apps'] = { manifest: { id: 'forge-apps', name: 'Forge d\'apps', icon: '🏭' }, mount: mount };
|
||||
})();
|
||||
</script>
|
||||
Reference in New Issue
Block a user