fogact 1.1.10 → 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/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/bin/web-server.js +303 -97
- package/frontend/admin/admin-panel-v2.js +8 -5
- package/frontend/assets/market-ui.css +11 -84
- package/frontend/user/assets/Dashboard-rPsmltm5.js +1 -1
- package/frontend/user/assets/DashboardLayout-DDkxHYFj.js +2 -2
- package/frontend/user/assets/Welcome-Dtfp6oER.js +1 -1
- package/frontend/user/assets/announcement-35mOnjRL.js +1 -1
- package/frontend/user/assets/index-Da98HOxL.js +3 -3
- package/frontend/user/index.html +5 -5
- package/lib/commands/activate.js +1 -8
- package/lib/commands/restore.js +41 -38
- package/lib/commands/test.js +15 -21
- package/lib/config/claude.js +1 -0
- package/lib/config/codex.js +1 -1
- package/lib/config/upstream.js +3 -0
- package/lib/index.js +77 -35
- package/lib/platforms/openclaw.js +4 -4
- package/lib/platforms/opencode.js +3 -3
- package/lib/services/activation-orchestrator.js +170 -246
- package/lib/services/backup-service.js +65 -13
- package/lib/services/fogact-api.js +40 -26
- package/lib/services/node-service.js +85 -14
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as K,r as f,d as S,L as P,x as w,A as t,H as a,u as s,P as d,E as x,_ as C,D as n,y as o,F as I}from"./chart-vendor-CULJE59K.js";import{u as V,a as j,b as E,_ as g,K as N,L as $,A as B,t as L}from"./index-Da98HOxL.js";import{_ as v,E as M}from"./Input.vue_vue_type_script_setup_true_lang-B0SyPmYb.js";import{_ as h}from"./Label.vue_vue_type_script_setup_true_lang-CxYORSgN.js";import{C as T,S as z,M as F,_ as R}from"./_plugin-vue_export-helper-5cjT4u0R.js";import{Z as U,S as _}from"./zap-l5zbZqrM.js";import{A as D}from"./activity-wYWtyqTJ.js";import{E as W}from"./eye-CY62vip0.js";const Z={class:"min-h-screen flex flex-col md:flex-row"},H={class:"relative w-full md:w-1/2 lg:w-[55%] bg-gradient-to-br from-slate-900 via-slate-800 to-slate-900 dark:from-gray-950 dark:via-slate-900 dark:to-gray-950 overflow-hidden flex flex-col justify-center py-12 px-6 md:py-16 md:px-10 lg:px-16"},O={class:"relative z-10 max-w-lg mx-auto md:mx-0 md:max-w-none"},q={class:"flex items-center gap-3 mb-8 opacity-0 animate-slide-in-left [animation-fill-mode:forwards]",style:{"animation-delay":"0.1s"}},G={class:"w-10 h-10 rounded-xl bg-white/10 border border-white/20 flex items-center justify-center backdrop-blur-sm"},J={class:"hidden md:grid grid-cols-1 lg:grid-cols-3 gap-3 mb-10"},Q={class:"rounded-xl bg-white/[0.05] border border-white/[0.08] p-4 opacity-0 animate-scale-in [animation-fill-mode:forwards]",style:{"animation-delay":"0.4s"}},X={class:"w-8 h-8 rounded-lg bg-blue-500/20 flex items-center justify-center mb-3"},Y={class:"rounded-xl bg-white/[0.05] border border-white/[0.08] p-4 opacity-0 animate-scale-in [animation-fill-mode:forwards]",style:{"animation-delay":"0.5s"}},ee={class:"w-8 h-8 rounded-lg bg-emerald-500/20 flex items-center justify-center mb-3"},te={class:"rounded-xl bg-white/[0.05] border border-white/[0.08] p-4 opacity-0 animate-scale-in [animation-fill-mode:forwards]",style:{"animation-delay":"0.6s"}},se={class:"w-8 h-8 rounded-lg bg-violet-500/20 flex items-center justify-center mb-3"},ae={class:"right-panel relative w-full md:w-1/2 lg:w-[45%] bg-background flex flex-col justify-center px-6 py-8 md:px-8 lg:px-12"},le={class:"absolute top-4 right-4 z-20"},oe={class:"w-full max-w-sm mx-auto opacity-0 animate-slide-in-right [animation-fill-mode:forwards]",style:{"animation-delay":"0.2s"}},ie={class:"space-y-2"},de={class:"relative"},ne=["disabled"],re={class:"space-y-2"},me={class:"mt-8 pt-6 border-t border-border"},ue={class:"flex items-center justify-center gap-2 text-xs text-muted-foreground"},fe=K({__name:"Welcome",setup(xe){const b=E(),r=V(),c=j(),m=f(""),p=f(""),l=f(!1),u=f(!1),y=S(()=>m.value.trim().length>0);P(()=>{r.hasKeys&&b.push({name:"dashboard"})});async function k(){if(!y.value)return;l.value=!0,r.clearError(),await r.addKey(m.value.trim(),p.value.trim())?b.push({name:"dashboard"}):L.error("验证失败",r.error||"请检查 API Key"),l.value=!1}return(A,e)=>(o(),w("div",Z,[t("div",H,[e[14]||(e[14]=t("div",{class:"absolute inset-0 dot-grid opacity-[0.03]"},null,-1)),e[15]||(e[15]=t("div",{class:"absolute top-[-10%] left-[-5%] w-[400px] h-[400px] bg-blue-500/10 rounded-full blur-3xl animate-float"},null,-1)),e[16]||(e[16]=t("div",{class:"absolute bottom-[-15%] right-[-10%] w-[350px] h-[350px] bg-indigo-500/10 rounded-full blur-3xl animate-float",style:{"animation-duration":"8s","animation-delay":"-2s"}},null,-1)),e[17]||(e[17]=t("div",{class:"absolute top-[40%] right-[20%] w-[250px] h-[250px] bg-cyan-500/8 rounded-full blur-3xl animate-float",style:{"animation-duration":"10s","animation-delay":"-4s"}},null,-1)),t("div",O,[t("div",q,[t("div",G,[a(s(T),{class:"w-5 h-5 text-white"})]),e[4]||(e[4]=t("span",{class:"text-xl font-semibold text-white tracking-wide"},"
|
|
1
|
+
import{j as K,r as f,d as S,L as P,x as w,A as t,H as a,u as s,P as d,E as x,_ as C,D as n,y as o,F as I}from"./chart-vendor-CULJE59K.js";import{u as V,a as j,b as E,_ as g,K as N,L as $,A as B,t as L}from"./index-Da98HOxL.js";import{_ as v,E as M}from"./Input.vue_vue_type_script_setup_true_lang-B0SyPmYb.js";import{_ as h}from"./Label.vue_vue_type_script_setup_true_lang-CxYORSgN.js";import{C as T,S as z,M as F,_ as R}from"./_plugin-vue_export-helper-5cjT4u0R.js";import{Z as U,S as _}from"./zap-l5zbZqrM.js";import{A as D}from"./activity-wYWtyqTJ.js";import{E as W}from"./eye-CY62vip0.js";const Z={class:"min-h-screen flex flex-col md:flex-row"},H={class:"relative w-full md:w-1/2 lg:w-[55%] bg-gradient-to-br from-slate-900 via-slate-800 to-slate-900 dark:from-gray-950 dark:via-slate-900 dark:to-gray-950 overflow-hidden flex flex-col justify-center py-12 px-6 md:py-16 md:px-10 lg:px-16"},O={class:"relative z-10 max-w-lg mx-auto md:mx-0 md:max-w-none"},q={class:"flex items-center gap-3 mb-8 opacity-0 animate-slide-in-left [animation-fill-mode:forwards]",style:{"animation-delay":"0.1s"}},G={class:"w-10 h-10 rounded-xl bg-white/10 border border-white/20 flex items-center justify-center backdrop-blur-sm"},J={class:"hidden md:grid grid-cols-1 lg:grid-cols-3 gap-3 mb-10"},Q={class:"rounded-xl bg-white/[0.05] border border-white/[0.08] p-4 opacity-0 animate-scale-in [animation-fill-mode:forwards]",style:{"animation-delay":"0.4s"}},X={class:"w-8 h-8 rounded-lg bg-blue-500/20 flex items-center justify-center mb-3"},Y={class:"rounded-xl bg-white/[0.05] border border-white/[0.08] p-4 opacity-0 animate-scale-in [animation-fill-mode:forwards]",style:{"animation-delay":"0.5s"}},ee={class:"w-8 h-8 rounded-lg bg-emerald-500/20 flex items-center justify-center mb-3"},te={class:"rounded-xl bg-white/[0.05] border border-white/[0.08] p-4 opacity-0 animate-scale-in [animation-fill-mode:forwards]",style:{"animation-delay":"0.6s"}},se={class:"w-8 h-8 rounded-lg bg-violet-500/20 flex items-center justify-center mb-3"},ae={class:"right-panel relative w-full md:w-1/2 lg:w-[45%] bg-background flex flex-col justify-center px-6 py-8 md:px-8 lg:px-12"},le={class:"absolute top-4 right-4 z-20"},oe={class:"w-full max-w-sm mx-auto opacity-0 animate-slide-in-right [animation-fill-mode:forwards]",style:{"animation-delay":"0.2s"}},ie={class:"space-y-2"},de={class:"relative"},ne=["disabled"],re={class:"space-y-2"},me={class:"mt-8 pt-6 border-t border-border"},ue={class:"flex items-center justify-center gap-2 text-xs text-muted-foreground"},fe=K({__name:"Welcome",setup(xe){const b=E(),r=V(),c=j(),m=f(""),p=f(""),l=f(!1),u=f(!1),y=S(()=>m.value.trim().length>0);P(()=>{r.hasKeys&&b.push({name:"dashboard"})});async function k(){if(!y.value)return;l.value=!0,r.clearError(),await r.addKey(m.value.trim(),p.value.trim())?b.push({name:"dashboard"}):L.error("验证失败",r.error||"请检查 API Key"),l.value=!1}return(A,e)=>(o(),w("div",Z,[t("div",H,[e[14]||(e[14]=t("div",{class:"absolute inset-0 dot-grid opacity-[0.03]"},null,-1)),e[15]||(e[15]=t("div",{class:"absolute top-[-10%] left-[-5%] w-[400px] h-[400px] bg-blue-500/10 rounded-full blur-3xl animate-float"},null,-1)),e[16]||(e[16]=t("div",{class:"absolute bottom-[-15%] right-[-10%] w-[350px] h-[350px] bg-indigo-500/10 rounded-full blur-3xl animate-float",style:{"animation-duration":"8s","animation-delay":"-2s"}},null,-1)),e[17]||(e[17]=t("div",{class:"absolute top-[40%] right-[20%] w-[250px] h-[250px] bg-cyan-500/8 rounded-full blur-3xl animate-float",style:{"animation-duration":"10s","animation-delay":"-4s"}},null,-1)),t("div",O,[t("div",q,[t("div",G,[a(s(T),{class:"w-5 h-5 text-white"})]),e[4]||(e[4]=t("span",{class:"text-xl font-semibold text-white tracking-wide"},"FogAct",-1))]),e[11]||(e[11]=t("h1",{class:"text-3xl lg:text-5xl font-bold text-white leading-tight mb-4 opacity-0 animate-slide-in-left [animation-fill-mode:forwards]",style:{"animation-delay":"0.2s"}},[d(" Fog Coding"),t("br"),d("网关入口 ")],-1)),e[12]||(e[12]=t("p",{class:"text-base lg:text-lg text-white/60 mb-10 max-w-md opacity-0 animate-slide-in-left [animation-fill-mode:forwards]",style:{"animation-delay":"0.3s"}}," 连接 Codex、Claude 等服务,处理激活码、用户和额度,一站完成。 ",-1)),t("div",J,[t("div",Q,[t("div",X,[a(s(U),{class:"w-4 h-4 text-blue-400"})]),e[5]||(e[5]=t("h3",{class:"text-sm font-medium text-white mb-1"},"多服务接入",-1)),e[6]||(e[6]=t("p",{class:"text-xs text-white/40 leading-relaxed"},"统一连接 Codex、Claude 等 CLI 服务",-1))]),t("div",Y,[t("div",ee,[a(s(D),{class:"w-4 h-4 text-emerald-400"})]),e[7]||(e[7]=t("h3",{class:"text-sm font-medium text-white mb-1"},"额度管理",-1)),e[8]||(e[8]=t("p",{class:"text-xs text-white/40 leading-relaxed"},"清晰查看激活码、用户与额度状态",-1))]),t("div",te,[t("div",se,[a(s(_),{class:"w-4 h-4 text-violet-400"})]),e[9]||(e[9]=t("h3",{class:"text-sm font-medium text-white mb-1"},"本地入口",-1)),e[10]||(e[10]=t("p",{class:"text-xs text-white/40 leading-relaxed"},"本地 Web 服务快速进入常用管理页面",-1))])]),e[13]||(e[13]=t("div",{class:"hidden md:flex items-center gap-2 opacity-0 animate-slide-in-left [animation-fill-mode:forwards]",style:{"animation-delay":"0.7s"}},[t("span",{class:"px-3 py-1.5 rounded-full text-xs font-medium bg-white/[0.06] border border-white/[0.1] text-white/50"},"Codex"),t("span",{class:"px-3 py-1.5 rounded-full text-xs font-medium bg-white/[0.06] border border-white/[0.1] text-white/50"},"Claude"),t("span",{class:"px-3 py-1.5 rounded-full text-xs font-medium bg-white/[0.06] border border-white/[0.1] text-white/50"},"FogAct Gateway")],-1))])]),t("div",ae,[t("div",le,[a(s(g),{variant:"ghost",size:"icon",class:"h-9 w-9 text-muted-foreground hover:text-foreground",onClick:e[0]||(e[0]=i=>s(c).toggleTheme()),title:"切换主题"},{default:x(()=>[s(c).isDark?(o(),n(s(z),{key:0,class:"h-4 w-4"})):(o(),n(s(F),{key:1,class:"h-4 w-4"}))]),_:1})]),t("div",oe,[e[22]||(e[22]=t("div",{class:"mb-8"},[t("h2",{class:"text-2xl font-bold text-foreground mb-2"},"进入 FogAct"),t("p",{class:"text-sm text-muted-foreground"}," 输入您的 FogAct API Key,进入网关服务面板。 ")],-1)),t("form",{onSubmit:C(k,["prevent"]),class:"space-y-5"},[t("div",ie,[a(s(h),{for:"apiKey",class:"flex items-center gap-2 text-sm font-medium"},{default:x(()=>[a(s(N),{class:"h-3.5 w-3.5 text-muted-foreground"}),e[18]||(e[18]=d(" API Key ",-1))]),_:1}),t("div",de,[a(s(v),{id:"apiKey",modelValue:m.value,"onUpdate:modelValue":e[1]||(e[1]=i=>m.value=i),type:u.value?"text":"password",placeholder:"请输入 FogAct API Key",class:"pr-10 h-10",disabled:l.value,autocomplete:"off"},null,8,["modelValue","type","disabled"]),t("button",{type:"button",class:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",onClick:e[2]||(e[2]=i=>u.value=!u.value),disabled:l.value},[u.value?(o(),n(s(M),{key:1,class:"h-4 w-4"})):(o(),n(s(W),{key:0,class:"h-4 w-4"}))],8,ne)])]),t("div",re,[a(s(h),{for:"keyName",class:"text-sm font-medium"},{default:x(()=>[...e[19]||(e[19]=[d("备注名称(选填)",-1)])]),_:1}),a(s(v),{id:"keyName",modelValue:p.value,"onUpdate:modelValue":e[3]||(e[3]=i=>p.value=i),placeholder:"例如:我的 FogAct Key",class:"h-10",disabled:l.value},null,8,["modelValue","disabled"])]),a(s(g),{type:"submit",class:"w-full h-11 gap-2",disabled:l.value||!y.value},{default:x(()=>[l.value?(o(),n(s($),{key:0,class:"h-4 w-4 animate-spin"})):(o(),w(I,{key:1},[e[20]||(e[20]=d(" 进入 FogAct ",-1)),a(s(B),{class:"h-4 w-4"})],64))]),_:1},8,["disabled"])],32),t("div",me,[t("div",ue,[a(s(_),{class:"h-3.5 w-3.5"}),e[21]||(e[21]=t("span",null,"您的 FogAct API Key 仅存储在本地浏览器中",-1))])])])])]))}}),_e=R(fe,[["__scopeId","data-v-699caeec"]]);export{_e as default};
|
|
@@ -13,4 +13,4 @@ import{c as D,aF as G,ay as H}from"./index-Da98HOxL.js";import{r as c,d as o}fro
|
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const ne=D("PinIcon",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]),b="
|
|
16
|
+
*/const ne=D("PinIcon",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]),b="fogact_user_announcement_state",f=2,K=20;let z=!1;function h(){return{version:f,readIds:[],tracked:{},snoozedUntilDate:null}}function q(e){return"content_html"in e}function O(e){return{id:e.id,title:e.title,intro:e.intro||"",isPinned:e.isPinned===!0,publishedAt:e.publishedAt||"",updatedAt:e.updatedAt||e.publishedAt||""}}function _(e){return"publishedAt"in e?O(e):{id:e.id,title:e.title,intro:e.intro||"",isPinned:e.is_pinned===!0,publishedAt:e.published_at,updatedAt:(q(e),e.updated_at)}}function Q(e,n){if(e.isPinned!==n.isPinned)return e.isPinned?-1:1;const a=new Date(n.publishedAt).getTime()-new Date(e.publishedAt).getTime();if(a!==0)return a;const r=new Date(n.updatedAt).getTime()-new Date(e.updatedAt).getTime();return r!==0?r:n.id.localeCompare(e.id)}function M(e){return[...e].sort(Q)}function U(){const e=new Date,n=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${n}-${a}-${r}`}function W(e){if(!e||typeof e!="object")return h();const n=e;if(n.version!==1&&n.version!==f)return h();const a=Object.fromEntries(Object.entries(n.tracked||{}).flatMap(([r,s])=>!s||!s.title?[]:[[r,O({...s,id:r})]]));return{version:f,readIds:Array.from(new Set((n.readIds||[]).filter(Boolean))),tracked:a,snoozedUntilDate:n.snoozedUntilDate||null}}const ae=G("announcement",()=>{const e=c(!1),n=c([]),a=c({}),r=c([]),s=c(null),v=c("");function y(){try{localStorage.setItem(b,JSON.stringify({version:f,readIds:n.value,tracked:a.value,snoozedUntilDate:s.value}))}catch{}}function m(t){n.value=t.readIds,a.value=t.tracked,s.value=t.snoozedUntilDate}function T(){try{const t=localStorage.getItem(b);if(!t){m(h());return}m(W(JSON.parse(t)))}catch{m(h())}}function C(t){t.key===b&&T()}function L(){z||(window.addEventListener("storage",C),z=!0)}function l(){e.value||(T(),L(),e.value=!0)}function A(t){if(t.length===0)return;const u={...a.value};let p=!1;t.forEach(Y=>{const i=_(Y),d=u[i.id];(!d||d.title!==i.title||d.intro!==i.intro||d.isPinned!==i.isPinned||d.publishedAt!==i.publishedAt||d.updatedAt!==i.updatedAt)&&(u[i.id]=i,p=!0)}),p&&(a.value=u,y())}async function R(){l();try{const t=await H.getList({limit:K}),u=M(t.items.map(p=>_(p)));return r.value=u,A(u),u}catch{return r.value}}function j(t,u){l(),t&&(u&&A([u]),!n.value.includes(t)&&(n.value=[...n.value,t],y()))}function x(t=I.value){v.value=t}function F(t=U()){l(),s.value=t,v.value=I.value,y()}function V(t){return k.value.has(t)}const k=o(()=>new Set(n.value)),E=o(()=>M(Object.values(a.value))),g=o(()=>E.value.filter(t=>!k.value.has(t.id))),S=o(()=>M(r.value.filter(t=>!k.value.has(t.id)))),N=o(()=>S.value.slice(0,5)),$=o(()=>g.value[0]||null),P=o(()=>g.value.length),B=o(()=>P.value>0),w=o(()=>s.value===U()),I=o(()=>S.value.map(t=>t.id).join("|")),J=o(()=>N.value.length===0||w.value?!1:v.value!==I.value);return{hydrated:e,recentItems:r,snoozedUntilDate:s,trackedItems:E,knownUnreadItems:g,recentUnreadItems:S,popupItems:N,latestUnreadItem:$,unreadCount:P,hasUnread:B,isSnoozedToday:w,shouldShowPopup:J,hydrate:l,refreshRecent:R,trackAnnouncements:A,markAsRead:j,dismissPopupOnce:x,dismissPopupForToday:F,isAnnouncementRead:V}});export{ee as C,te as M,ne as P,ae as u};
|