Files
uno-click/site/.next/server/app/result/page.js
T
2026-05-13 14:20:41 +00:00

1 line
11 KiB
JavaScript

(()=>{var e={};e.id=609,e.ids=[609],e.modules={2934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},4580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},5869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},5554:(e,t,r)=>{"use strict";r.r(t),r.d(t,{GlobalError:()=>a.a,__next_app__:()=>x,originalPathname:()=>c,pages:()=>p,routeModule:()=>u,tree:()=>o}),r(5556),r(1506),r(5866);var i=r(3191),n=r(8716),s=r(7922),a=r.n(s),d=r(5231),l={};for(let e in d)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(l[e]=()=>d[e]);r.d(t,l);let o=["",{children:["result",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(r.bind(r,5556)),"/opt/uno-click/site/app/result/page.tsx"]}]},{}]},{layout:[()=>Promise.resolve().then(r.bind(r,1506)),"/opt/uno-click/site/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(r.t.bind(r,5866,23)),"next/dist/client/components/not-found-error"]}],p=["/opt/uno-click/site/app/result/page.tsx"],c="/result/page",x={require:r,loadChunk:()=>Promise.resolve()},u=new i.AppPageRouteModule({definition:{kind:n.x.APP_PAGE,page:"/result/page",pathname:"/result",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:o}})},4199:()=>{},7594:(e,t,r)=>{Promise.resolve().then(r.bind(r,7367))},9682:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,2994,23)),Promise.resolve().then(r.t.bind(r,6114,23)),Promise.resolve().then(r.t.bind(r,9727,23)),Promise.resolve().then(r.t.bind(r,9671,23)),Promise.resolve().then(r.t.bind(r,1868,23)),Promise.resolve().then(r.t.bind(r,4759,23))},7367:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>d});var i=r(326),n=r(7577),s=r(5047);function a(){var e;(0,s.useRouter)();let t=(0,s.useSearchParams)().get("generationUuid"),[r,a]=(0,n.useState)(null),[d,o]=(0,n.useState)(!0),[p,c]=(0,n.useState)(""),[x,u]=(0,n.useState)(!1);async function h(){if(t)try{let e=await fetch(`/api/result/${t}`,{credentials:"same-origin"}),r=await e.json();if(!e.ok)throw Error(r.message||"Ошибка загрузки результата");a(r.result),c(""),o(!1),"running"===r.result.status||"waiting_for_input"===r.result.status?(u(!0),setTimeout(h,3e3)):u(!1)}catch(e){c(e instanceof Error?e.message:"Ошибка загрузки"),o(!1)}}return d?i.jsx("div",{style:l.page,children:(0,i.jsxs)("div",{style:l.container,children:[(0,i.jsxs)("div",{style:l.header,children:[i.jsx("h1",{style:l.headerTitle,children:"Результат"}),i.jsx("a",{href:"/dashboard",style:l.btnSmall,children:"К сценариям"})]}),i.jsx("div",{style:l.card,children:(0,i.jsxs)("div",{style:l.emptyState,children:[i.jsx("div",{style:l.emptyStateIcon,children:i.jsx("span",{style:l.spinnerLarge})}),i.jsx("div",{style:l.emptyStateText,children:"Загружаем результат..."})]})})]})}):p&&!r?i.jsx("div",{style:l.page,children:(0,i.jsxs)("div",{style:l.container,children:[(0,i.jsxs)("div",{style:l.header,children:[i.jsx("h1",{style:l.headerTitle,children:"Результат"}),i.jsx("a",{href:"/dashboard",style:l.btnSmall,children:"К сценариям"})]}),i.jsx("div",{style:l.card,children:i.jsx("div",{style:l.error,children:p})})]})}):i.jsx("div",{style:l.page,children:(0,i.jsxs)("div",{style:l.container,children:[(0,i.jsxs)("div",{style:l.header,children:[i.jsx("h1",{style:l.headerTitle,children:"Результат"}),i.jsx("div",{style:l.headerActions,children:i.jsx("a",{href:"/dashboard",style:l.btnSmall,children:"К сценариям"})})]}),(0,i.jsxs)("div",{style:l.card,children:[(0,i.jsxs)("div",{style:l.cardHeader,children:[i.jsx("span",{style:l.cardTitle,children:r?.scenarioName||"Загрузка..."}),i.jsx("span",{style:{...l.statusBadge,...r?.status==="completed"?l.statusCompleted:r?.status==="failed"?l.statusFailed:l.statusRunning},children:r?({running:"Генерация...",completed:"Готово",failed:"Ошибка",waiting_for_input:"Ожидание...",created:"Создано"})[e=r.status]||e:"Загрузка..."})]}),(0,i.jsxs)("div",{style:l.cardBody,children:[p&&i.jsx("div",{style:l.error,children:p}),r?.requestPayload?.prompt&&(0,i.jsxs)("div",{style:l.promptInfo,children:[i.jsx("div",{style:l.promptLabel,children:"Промпт"}),i.jsx("div",{style:l.promptText,children:r.requestPayload.prompt})]}),r?.files&&r.files.length>0?i.jsx("div",{style:l.fileContainer,children:r.files.map((e,t)=>(function(e,t){var r;let n="video"===e.contentType?i.jsx("video",{src:e.url,controls:!0,style:l.previewMedia}):i.jsx("img",{src:e.url,alt:`Result ${t+1}`,style:l.previewMedia});return(0,i.jsxs)("div",{style:l.fileCard,children:[i.jsx("div",{style:l.filePreview,children:n}),(0,i.jsxs)("div",{style:l.fileInfo,children:[(0,i.jsxs)("div",{style:l.fileMeta,children:[e.format&&(0,i.jsxs)("span",{style:l.fileMetaItem,children:[i.jsx("strong",{children:"Формат:"})," ",e.format.toUpperCase()]}),e.width&&e.height&&(0,i.jsxs)("span",{style:l.fileMetaItem,children:[i.jsx("strong",{children:"Размер:"})," ",e.width,"\xd7",e.height]}),e.duration&&(0,i.jsxs)("span",{style:l.fileMetaItem,children:[i.jsx("strong",{children:"Длительность:"})," ",(r=e.duration,`${Math.floor(r/60)}:${Math.floor(r%60).toString().padStart(2,"0")}`)]})]}),(0,i.jsxs)("div",{style:l.fileActions,children:[i.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",style:l.btnPrimary,children:"\uD83D\uDC41 Открыть"}),i.jsx("a",{href:e.url,download:!0,style:l.btnSecondary,children:"⬇ Скачать"})]})]})]},t)})(e,t))}):r?.status==="completed"?(0,i.jsxs)("div",{style:l.emptyState,children:[i.jsx("div",{style:l.emptyStateIcon,children:"⏳"}),i.jsx("div",{style:l.emptyStateText,children:"Результат получен, но файлы не найдены"})]}):r?.status==="failed"?(0,i.jsxs)("div",{style:l.emptyState,children:[i.jsx("div",{style:l.emptyStateIcon,children:"❌"}),i.jsx("div",{style:l.emptyStateText,children:"Произошла ошибка при генерации"})]}):(0,i.jsxs)("div",{style:l.emptyState,children:[i.jsx("div",{style:l.emptyStateIcon,children:"⏳"}),i.jsx("div",{style:l.emptyStateText,children:"Результат ещё не готов"}),(0,i.jsxs)("button",{onClick:h,style:l.refreshBtn,children:[i.jsx("span",{style:{...l.spinner,display:x?"inline-block":"none"}}),i.jsx("span",{children:"Проверить снова"})]})]})]})]})]})})}function d(){return i.jsx(n.Suspense,{fallback:i.jsx("div",{style:l.page,children:i.jsx("div",{style:l.container,children:i.jsx("div",{style:l.emptyState,children:"Загрузка..."})})}),children:i.jsx(a,{})})}let l={page:{minHeight:"100vh",padding:"40px 20px",background:"#f5f5f5"},container:{maxWidth:"900px",margin:"0 auto"},header:{background:"white",padding:"20px 30px",borderRadius:"8px",boxShadow:"0 2px 10px rgba(0,0,0,0.1)",marginBottom:"20px",display:"flex",justifyContent:"space-between",alignItems:"center"},headerTitle:{fontSize:"20px",fontWeight:600,color:"#333"},headerActions:{display:"flex",gap:"10px"},btnSmall:{padding:"8px 16px",borderRadius:"6px",fontSize:"13px",cursor:"pointer",border:"1px solid #ddd",background:"white",color:"#666",textDecoration:"none"},card:{background:"white",borderRadius:"8px",boxShadow:"0 2px 10px rgba(0,0,0,0.1)",overflow:"hidden"},cardHeader:{padding:"20px 30px",borderBottom:"1px solid #eee",display:"flex",alignItems:"center"},cardTitle:{fontSize:"16px",fontWeight:600,color:"#333"},cardBody:{padding:"30px"},statusBadge:{display:"inline-block",padding:"4px 12px",borderRadius:"20px",fontSize:"12px",fontWeight:500,marginLeft:"10px"},statusRunning:{background:"#fff3cd",color:"#856404"},statusCompleted:{background:"#d4edda",color:"#155724"},statusFailed:{background:"#f8d7da",color:"#721c24"},emptyState:{textAlign:"center",padding:"60px 20px",color:"#666"},emptyStateIcon:{fontSize:"48px",marginBottom:"16px"},emptyStateText:{fontSize:"16px",marginBottom:"24px"},refreshBtn:{display:"inline-flex",alignItems:"center",gap:"8px",padding:"12px 24px",background:"#007bff",color:"white",border:"none",borderRadius:"6px",fontSize:"14px",fontWeight:500,cursor:"pointer"},spinner:{display:"inline-block",width:"16px",height:"16px",border:"2px solid rgba(255,255,255,0.3)",borderTopColor:"white",borderRadius:"50%",animation:"spin 1s linear infinite"},spinnerLarge:{width:"32px",height:"32px",border:"2px solid rgba(0,123,255,0.3)",borderTopColor:"#007bff",borderRadius:"50%",animation:"spin 1s linear infinite"},error:{background:"#fee",color:"#c00",padding:"12px",borderRadius:"6px",marginBottom:"20px",fontSize:"14px"},promptInfo:{background:"#f8f9fa",padding:"16px 20px",borderRadius:"6px",marginBottom:"20px"},promptLabel:{fontSize:"12px",color:"#666",marginBottom:"4px"},promptText:{fontSize:"14px",color:"#333"},fileContainer:{display:"flex",flexDirection:"column",gap:"20px"},fileCard:{border:"1px solid #eee",borderRadius:"8px",overflow:"hidden"},filePreview:{width:"100%",background:"#f5f5f5",display:"flex",alignItems:"center",justifyContent:"center",minHeight:"300px",maxHeight:"600px"},previewMedia:{maxWidth:"100%",maxHeight:"600px",objectFit:"contain"},fileInfo:{padding:"16px 20px",background:"#fafafa",display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:"12px"},fileMeta:{display:"flex",gap:"16px",flexWrap:"wrap"},fileMetaItem:{fontSize:"13px",color:"#666"},fileActions:{display:"flex",gap:"10px"},btnPrimary:{padding:"10px 20px",borderRadius:"6px",fontSize:"13px",fontWeight:500,cursor:"pointer",textDecoration:"none",border:"none",display:"inline-flex",alignItems:"center",gap:"6px",background:"#007bff",color:"white"},btnSecondary:{padding:"10px 20px",borderRadius:"6px",fontSize:"13px",fontWeight:500,cursor:"pointer",textDecoration:"none",border:"1px solid #ddd",display:"inline-flex",alignItems:"center",gap:"6px",background:"#f5f5f5",color:"#333"}}},5047:(e,t,r)=>{"use strict";var i=r(7389);r.o(i,"useRouter")&&r.d(t,{useRouter:function(){return i.useRouter}}),r.o(i,"useSearchParams")&&r.d(t,{useSearchParams:function(){return i.useSearchParams}})},1506:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s,metadata:()=>n});var i=r(9510);r(7272);let n={title:"Uno Click",description:"Uno Click - платформа для генерации контента"};function s({children:e}){return i.jsx("html",{lang:"ru",children:i.jsx("body",{children:e})})}},5556:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>i});let i=(0,r(8570).createProxy)(String.raw`/opt/uno-click/site/app/result/page.tsx#default`)},7272:()=>{}};var t=require("../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),i=t.X(0,[819],()=>r(5554));module.exports=i})();