@fudrouter/fsrouter 0.6.5 → 0.6.6
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/README.md +2 -2
- package/package.json +1 -1
- package/public/assets/{EndpointPageClient.DDmEe96A.js → EndpointPageClient.YsGwbpYV.js} +1 -1
- package/public/assets/{Loading.CDEFuRDy.js → Loading.CjQLhSfR.js} +1 -1
- package/public/assets/{NoAuthProxyCard.BNqC9H8h.js → NoAuthProxyCard.D1e90xgk.js} +1 -1
- package/public/assets/{index.CJsl6Iwi.js → index.DAEHkWvS.js} +3 -3
- package/public/assets/{page.CIlvbz9l.js → page.-95lgZd_.js} +1 -1
- package/public/assets/{page.CxnV-uhg.js → page.61FbV9Wp.js} +1 -1
- package/public/assets/{page.CfYvWZ1T.js → page.Apg42588.js} +1 -1
- package/public/assets/{page.CvGUrx-6.js → page.B0C1xaR8.js} +1 -1
- package/public/assets/{page.8Nu4GVSJ.js → page.B4youO9X.js} +1 -1
- package/public/assets/{page.C01Q0PiE.js → page.BMbi-Sns.js} +1 -1
- package/public/assets/{page.DSOv9VVj.js → page.BUPLy5EZ.js} +1 -1
- package/public/assets/{page.zCFW8-dJ.js → page.BXh6BM3U.js} +1 -1
- package/public/assets/{page.CmXtrT5z.js → page.BZUkHLYE.js} +1 -1
- package/public/assets/{page.CczBOFRL.js → page.BZeKpmS4.js} +1 -1
- package/public/assets/{page.Cq0dTA5F.js → page.BbHtA1Vv.js} +1 -1
- package/public/assets/{page.B1cZyV9g.js → page.BbmBUUp6.js} +1 -1
- package/public/assets/{page.ealIJS1r.js → page.BedLQaFn.js} +1 -1
- package/public/assets/{page.DVbjs8Jq.js → page.BpZpjcj5.js} +1 -1
- package/public/assets/{page.DiN3kenU.js → page.C7irTNuo.js} +1 -1
- package/public/assets/{page.BypgBZYI.js → page.CVp0aTOO.js} +1 -1
- package/public/assets/{page.BVBFf4x0.js → page.CXmpgSS-.js} +1 -1
- package/public/assets/{page.BFgs6hZz.js → page.Cb9NSedz.js} +1 -1
- package/public/assets/page.CbEpgP40.js +1 -0
- package/public/assets/{page.CyMFuzWl.js → page.CcqLMlVQ.js} +1 -1
- package/public/assets/{page.9wOJKG_c.js → page.Cx0ouxNC.js} +1 -1
- package/public/assets/{page.rI2Hhj1l.js → page.D2q8p9Ho.js} +1 -1
- package/public/assets/{page.CySDNZpW.js → page.D72XZv59.js} +1 -1
- package/public/assets/{page.BxxALLso.js → page.DJLPVXk9.js} +1 -1
- package/public/assets/{page.BsfjaETs.js → page.DQFGk3ix.js} +1 -1
- package/public/assets/{page.8kR0s7Xj.js → page.DUg1jlDv.js} +1 -1
- package/public/assets/{page.DKB-XYI1.js → page.DZ-7X_uA.js} +1 -1
- package/public/assets/{page.tBmDo7od.js → page.DbcoBydG.js} +1 -1
- package/public/assets/{page.0AKBOYbN.js → page.DvfqdMbH.js} +1 -1
- package/public/assets/{page.oRz_Cfsc.js → page.XCZlByO2.js} +1 -1
- package/public/assets/{page.NvPN1liK.js → page.XxNz79L9.js} +1 -1
- package/public/assets/{page.D90dGmEN.js → page.i4WFZmkG.js} +1 -1
- package/public/assets/{page.G9fc9J4F.js → page.kzWpy5SG.js} +1 -1
- package/public/assets/{page.Cet7xdiA.js → page.nLWOXyfy.js} +1 -1
- package/public/assets/{page.D86TOazD.js → page.vnuVB-x6.js} +1 -1
- package/public/index.html +1 -1
- package/src/server.ts +1 -1
- package/public/assets/page.Zzia5WJj.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./index.
|
|
1
|
+
import{j as e}from"./index.DAEHkWvS.js";import{b as r}from"./router.Cjj1--8t.js";import{C as j}from"./Loading.CjQLhSfR.js";import"./zustand.akaTi5uX.js";function P(){return e.jsx(r.Suspense,{fallback:e.jsx(j,{}),children:e.jsx(v,{})})}function v(){const[o,u]=r.useState([]),[p,b]=r.useState(!0),[s,f]=r.useState(""),[a,n]=r.useState(null),[i,d]=r.useState(!1),[l,x]=r.useState(""),[c,m]=r.useState(null);r.useEffect(()=>{fetch("/api/media-providers/moderation").then(t=>t.json()).then(t=>{u(Array.isArray(t)?t:[]),t.length>0&&x(t[0].id)}).catch(()=>{}).finally(()=>b(!1))},[]);const h=async()=>{if(s.trim()){d(!0),m(null),n(null);try{const t=await fetch("/api/media/moderation",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:s,providerId:l||void 0})});if(!t.ok)throw new Error(`HTTP ${t.status}`);const g=await t.json();n(g)}catch(t){m(t.message)}finally{d(!1)}}};return e.jsxs("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"material-symbols-outlined text-[28px] text-primary",children:"shield"}),e.jsx("h1",{className:"text-xl font-semibold text-text-main",children:"Moderations"})]}),e.jsxs("div",{className:"rounded-xl border border-border-subtle bg-surface p-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-text-main mb-3",children:"Moderation Providers"}),p?e.jsx("p",{className:"text-xs text-text-muted",children:"Loading providers..."}):o.length===0?e.jsx("p",{className:"text-xs text-text-muted",children:"No moderation providers configured. Add one in Media Providers."}):e.jsx("div",{className:"flex flex-wrap gap-2",children:o.map(t=>e.jsx("button",{onClick:()=>x(t.id),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors cursor-pointer ${l===t.id?"bg-primary/10 text-primary border border-primary/30":"bg-surface-2 text-text-muted hover:text-text-main border border-transparent"}`,children:t.name||t.id},t.id))})]}),e.jsxs("div",{className:"rounded-xl border border-border-subtle bg-surface p-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-text-main mb-3",children:"Test Moderation"}),e.jsx("textarea",{value:s,onChange:t=>f(t.target.value),placeholder:"Enter text to moderate...",rows:4,className:"w-full rounded-lg border border-border-subtle bg-surface-2 px-3 py-2 text-sm text-text-main placeholder:text-text-muted/50 focus:outline-none focus:ring-1 focus:ring-primary/50 resize-none mb-3"}),e.jsx("button",{onClick:h,disabled:i||!s.trim(),className:"px-4 py-2 rounded-lg bg-primary text-white text-sm font-medium hover:bg-primary/90 disabled:opacity-50 transition-colors cursor-pointer",children:i?"Testing...":"Run Moderation"})]}),c&&e.jsx("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-4",children:e.jsx("p",{className:"text-sm text-red-400",children:c})}),a&&e.jsxs("div",{className:"rounded-xl border border-border-subtle bg-surface p-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-text-main mb-3",children:"Result"}),e.jsx("pre",{className:"text-xs text-text-muted overflow-auto max-h-96 bg-surface-2 rounded-lg p-3 font-mono whitespace-pre-wrap",children:JSON.stringify(a,null,2)})]})]})}export{P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as v,j as e,B as c,m as j}from"./index.
|
|
1
|
+
import{g as v,j as e,B as c,m as j}from"./index.DAEHkWvS.js";import{d as N,b as u,L as h}from"./router.Cjj1--8t.js";import{C as p,S as k,I as x,T as A}from"./NoAuthProxyCard.D1e90xgk.js";import"./zustand.akaTi5uX.js";const P=Object.values(v).map(a=>({value:a.id,label:a.name})),S=Object.values(j).map(a=>({value:a.id,label:a.name}));function E(){const a=N(),[b,m]=u.useState(!1),[t,y]=u.useState({provider:"",authMethod:"api_key",apiKey:"",displayName:"",isActive:!0}),[s,n]=u.useState({}),i=(r,o)=>{y(l=>({...l,[r]:o})),s[r]&&n(l=>({...l,[r]:null}))},f=()=>{const r={};return t.provider||(r.provider="Please select a provider"),t.authMethod==="api_key"&&!t.apiKey&&(r.apiKey="API Key is required"),n(r),Object.keys(r).length===0},g=async r=>{if(r.preventDefault(),!!f()){m(!0);try{const o=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(o.ok)a("/dashboard/providers");else{const l=await o.json();n({submit:l.error||"Failed to create provider"})}}catch{n({submit:"An error occurred. Please try again."})}finally{m(!1)}}},d=v[t.provider];return e.jsxs("div",{className:"max-w-2xl mx-auto",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs(h,{to:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[e.jsx("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),e.jsx("h1",{className:"text-3xl font-semibold tracking-tight",children:"Add New Provider"}),e.jsx("p",{className:"text-text-muted mt-2",children:"Configure a new AI provider to use with your applications."})]}),e.jsx(p,{children:e.jsxs("form",{onSubmit:g,className:"flex flex-col gap-6",children:[e.jsx(k,{label:"Provider",options:P,value:t.provider,onChange:r=>i("provider",r.target.value),placeholder:"Select a provider",error:s.provider,required:!0}),d&&e.jsxs(p.Section,{className:"flex items-center gap-3",children:[e.jsx("div",{className:"size-10 rounded-lg flex items-center justify-center bg-bg border border-border",children:e.jsx("span",{className:"material-symbols-outlined text-xl",style:{color:d.color},children:d.icon})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:d.name}),e.jsx("p",{className:"text-sm text-text-muted",children:"Selected provider"})]})]}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("label",{className:"text-sm font-medium",children:["Authentication Method ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("div",{className:"flex gap-3",children:S.map(r=>e.jsxs("button",{type:"button",onClick:()=>i("authMethod",r.value),className:`flex-1 flex items-center justify-center gap-2 p-4 rounded-lg border transition-all ${t.authMethod===r.value?"border-primary bg-primary/5 text-primary":"border-border hover:border-primary/50"}`,children:[e.jsx("span",{className:"material-symbols-outlined",children:r.value==="api_key"?"key":"lock"}),e.jsx("span",{className:"font-medium",children:r.label})]},r.value))})]}),t.authMethod==="api_key"&&e.jsx(x,{label:"API Key",type:"password",placeholder:"Enter your API key",value:t.apiKey,onChange:r=>i("apiKey",r.target.value),error:s.apiKey,hint:"Your API key will be encrypted and stored securely.",required:!0}),t.authMethod==="oauth2"&&e.jsxs(p.Section,{children:[e.jsx("p",{className:"text-sm text-text-muted mb-4",children:"Connect your account using OAuth2 authentication."}),e.jsx(c,{type:"button",variant:"secondary",icon:"link",children:"Connect with OAuth2"})]}),e.jsx(x,{label:"Display Name",placeholder:"e.g., Production API, Dev Environment",value:t.displayName,onChange:r=>i("displayName",r.target.value),hint:"Optional. A friendly name to identify this configuration."}),e.jsx(A,{checked:t.isActive,onChange:r=>i("isActive",r),label:"Active",description:"Enable this provider for use in your applications"}),s.submit&&e.jsx("div",{className:"p-4 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 text-red-600 dark:text-red-400 text-sm",children:s.submit}),e.jsxs("div",{className:"flex gap-3 pt-4 border-t border-border",children:[e.jsx(h,{to:"/dashboard/providers",className:"flex-1",children:e.jsx(c,{type:"button",variant:"ghost",fullWidth:!0,children:"Cancel"})}),e.jsx(c,{type:"submit",loading:b,fullWidth:!0,className:"flex-1",children:"Create Provider"})]})]})})]})}export{E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./index.
|
|
1
|
+
import{j as e}from"./index.DAEHkWvS.js";import{b as t}from"./router.Cjj1--8t.js";import"./zustand.akaTi5uX.js";function N(){const[a,u]=t.useState({currentVersion:"",latestVersion:"",hasUpdate:!1}),[p,o]=t.useState(!0),[b,n]=t.useState(!1),[f,i]=t.useState(""),[m,s]=t.useState(""),c=async()=>{try{o(!0);const l=await(await fetch("/api/version")).json();u(l)}catch(r){console.error(r),s("Gagal memuat informasi versi.")}finally{o(!1)}};t.useEffect(()=>{c()},[]);const g=async()=>{if(window.confirm("Apakah Anda yakin ingin memulai update otomatis? Server akan memuat ulang kode dan melakukan build.")){n(!0),i("Menghubungi server untuk memulai update..."),s("");try{const l=await(await fetch("/api/version/update",{method:"POST"})).json();if(l.success){i("Proses update dimulai di latar belakang... Mengunduh kode dari GitHub dan membangun ulang aplikasi. Halaman akan kehilangan koneksi sementara saat PM2 me-restart server.");let d=0;const x=setInterval(async()=>{d++,i(`Membangun ulang aplikasi dan merestart server... (Mencoba menghubungkan kembali: ${d}s)`);try{(await fetch("/api/health")).ok&&(clearInterval(x),i("Update selesai! Server kembali online. Memuat ulang halaman..."),setTimeout(()=>{window.location.reload()},2e3))}catch{}d>180&&(clearInterval(x),n(!1),s("Update memakan waktu terlalu lama. Silakan periksa status PM2 server Anda secara manual."))},2e3)}else s(l.message||"Gagal memulai update otomatis."),n(!1)}catch(r){console.error(r),s("Koneksi gagal saat memulai update."),n(!1)}}};return e.jsxs("div",{className:"max-w-4xl mx-auto p-4 space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("h1",{className:"text-2xl font-bold text-text-main flex items-center gap-2",children:[e.jsx("span",{className:"material-symbols-outlined text-[28px] text-primary",children:"system_update"}),"FSRouter System Update"]}),e.jsx("p",{className:"text-xs text-text-muted",children:"Kelola dan perbarui versi FSRouter Anda langsung dari repositori GitHub."})]}),p?e.jsx("div",{className:"flex items-center justify-center p-12 border border-border-subtle rounded-[14px] bg-surface",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx("span",{className:"material-symbols-outlined text-4xl animate-spin text-primary",children:"sync"}),e.jsx("span",{className:"text-sm text-text-muted",children:"Memuat informasi versi..."})]})}):e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-6 rounded-[14px] border border-border-subtle bg-surface flex flex-col gap-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-text-main",children:"Detail Versi"}),e.jsxs("div",{className:"flex items-center justify-between border-b border-border-subtle pb-3",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Versi Saat Ini"}),e.jsxs("span",{className:"text-sm font-mono font-semibold text-text-main",children:["v",a.currentVersion||"0.0.0"]})]}),e.jsxs("div",{className:"flex items-center justify-between border-b border-border-subtle pb-3",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Versi Terbaru di GitHub"}),e.jsxs("span",{className:"text-sm font-mono font-semibold text-text-main",children:["v",a.latestVersion||"0.0.0"]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Status"}),a.hasUpdate?e.jsx("span",{className:"px-2 py-0.5 rounded-full text-[10px] font-semibold bg-amber-500/10 text-amber-500 border border-amber-500/20",children:"Update Tersedia"}):e.jsx("span",{className:"px-2 py-0.5 rounded-full text-[10px] font-semibold bg-green-500/10 text-green-500 border border-green-500/20",children:"Versi Terbaru"})]})]}),e.jsxs("div",{className:"p-6 rounded-[14px] border border-border-subtle bg-surface flex flex-col justify-between gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-text-main",children:"Aksi Pembaruan"}),e.jsx("p",{className:"text-xs text-text-muted leading-relaxed",children:a.hasUpdate?"Versi baru tersedia di GitHub! Update otomatis akan melakukan 'git pull', menginstal dependensi baru, membangun ulang kode, dan me-restart layanan PM2 Anda secara mulus.":"FSRouter Anda sudah menggunakan versi terbaru di GitHub. Tidak ada pembaruan yang diperlukan saat ini."})]}),b?e.jsxs("div",{className:"p-4 rounded-lg bg-primary/5 border border-primary/20 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold text-primary",children:[e.jsx("span",{className:"material-symbols-outlined text-[16px] animate-spin",children:"sync"}),"Proses Update Sedang Berjalan"]}),e.jsx("p",{className:"text-[11px] text-text-muted leading-relaxed",children:f})]}):e.jsxs("div",{className:"space-y-2",children:[m&&e.jsx("p",{className:"text-xs text-red-500 font-semibold bg-red-500/10 border border-red-500/20 p-3 rounded-lg",children:m}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{disabled:!a.hasUpdate,onClick:g,className:`flex-1 py-2 px-4 rounded-lg text-xs font-semibold text-white transition-colors flex items-center justify-center gap-2 ${a.hasUpdate?"bg-primary hover:bg-primary/90 cursor-pointer":"bg-border-subtle text-text-muted cursor-not-allowed"}`,children:[e.jsx("span",{className:"material-symbols-outlined text-[16px]",children:"download"}),"Otomatis Update Sekarang"]}),e.jsx("button",{onClick:c,className:"py-2 px-3 rounded-lg border border-border-subtle text-text-main text-xs hover:bg-surface-2 transition-colors cursor-pointer",title:"Periksa Ulang",children:e.jsx("span",{className:"material-symbols-outlined text-[16px] block",children:"refresh"})})]})]})]})]})]})}export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./index.
|
|
1
|
+
import{j as e}from"./index.DAEHkWvS.js";import"./router.Cjj1--8t.js";import"./zustand.akaTi5uX.js";function i(){return e.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border-subtle shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex items-center justify-center size-8 rounded-lg bg-primary/10",children:e.jsx("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"menu_book"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-sm font-semibold text-text-main",children:"API Reference"}),e.jsx("p",{className:"text-xs text-text-muted",children:"Image & Video Generation — all providers, models, and parameters"})]})]}),e.jsxs("a",{href:"/image-video-docs.html",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium text-text-muted hover:text-text-main hover:bg-surface-2 transition-all",children:[e.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"open_in_new"}),"Open in new tab"]})]}),e.jsx("iframe",{src:"/image-video-docs.html",className:"flex-1 w-full border-0 min-h-0",title:"Image & Video API Reference"})]})}export{i as default};
|
package/public/index.html
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
11
11
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
12
12
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet" />
|
|
13
|
-
<script type="module" crossorigin src="/assets/index.
|
|
13
|
+
<script type="module" crossorigin src="/assets/index.DAEHkWvS.js"></script>
|
|
14
14
|
<link rel="modulepreload" crossorigin href="/assets/router.Cjj1--8t.js">
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/zustand.akaTi5uX.js">
|
|
16
16
|
<link rel="stylesheet" crossorigin href="/assets/index.CNI3Bvrp.css">
|
package/src/server.ts
CHANGED
|
@@ -44,7 +44,7 @@ SPA_ROUTES.forEach((route) => {
|
|
|
44
44
|
|
|
45
45
|
// ─── Health Check (no auth) ────────────────────────────────────────────────────
|
|
46
46
|
app.get("/api/health", (_req, res) => {
|
|
47
|
-
res.json({ status: "ok", version: "0.6.
|
|
47
|
+
res.json({ status: "ok", version: "0.6.6", ts: Date.now() });
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
// ─── Auth Middleware ───────────────────────────────────────────────────────────
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index.CJsl6Iwi.js";import{b as r}from"./router.Cjj1--8t.js";import{g as a}from"./machine.CagOtseJ.js";import{A as i}from"./EndpointPageClient.DDmEe96A.js";import"./zustand.akaTi5uX.js";import"./NoAuthProxyCard.BNqC9H8h.js";import"./Loading.CDEFuRDy.js";function d(){const[t,e]=r.useState("");return r.useEffect(()=>{a().then(e)},[]),t?o.jsx(i,{machineId:t}):null}export{d as default};
|