@acedatacloud/nexior 2.20.1 → 2.20.3
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/dist/assets/{Auth.18d3dbd5.js → Auth.0925d6d4.js} +1 -1
- package/dist/assets/{Callback.b89dfb68.js → Callback.99ea5bf6.js} +1 -1
- package/dist/assets/{Chatdoc.63a6a5c8.js → Chatdoc.b6492d4a.js} +1 -1
- package/dist/assets/{Console.7aaee105.js → Console.be569d2e.js} +1 -1
- package/dist/assets/{Conversation.4a7dd645.css → Conversation.24698768.css} +1 -1
- package/dist/assets/{Conversation.8c058528.js → Conversation.51b8eb0b.js} +1 -1
- package/dist/assets/Conversation.dc128ba7.js +1 -0
- package/dist/assets/{CopyToClipboard.6e4cac07.js → CopyToClipboard.d2c28170.js} +1 -1
- package/dist/assets/{Detail.31de63ae.js → Detail.087cc359.js} +1 -1
- package/dist/assets/{EditArray.08567600.js → EditArray.014f27be.js} +1 -1
- package/dist/assets/{Extra.00254e05.js → Extra.f16d3cf1.js} +1 -1
- package/dist/assets/{History.cc982078.js → History.d98a78a1.js} +1 -1
- package/dist/assets/{ImageNavigator.7fe0f2bc.js → ImageNavigator.8c411bf9.js} +1 -1
- package/dist/assets/{Index.352d4874.js → Index.0530c753.js} +1 -1
- package/dist/assets/{Index.e9a66783.js → Index.12c4d65d.js} +1 -1
- package/dist/assets/{Index.9e8b4725.js → Index.1a7feaa1.js} +1 -1
- package/dist/assets/{Index.da3788da.js → Index.1cbc22dd.js} +1 -1
- package/dist/assets/{Index.0c212684.js → Index.21c3fffc.js} +1 -1
- package/dist/assets/{Index.1095b265.js → Index.2b2b294f.js} +1 -1
- package/dist/assets/{Index.bb3c0047.js → Index.366dd619.js} +1 -1
- package/dist/assets/{Index.5a74ff3b.js → Index.660b2552.js} +1 -1
- package/dist/assets/{Index.7c686768.js → Index.75b7513d.js} +1 -1
- package/dist/assets/{Index.cbb50d9d.js → Index.8962cdb6.js} +1 -1
- package/dist/assets/{Index.2c1dcf22.js → Index.93797997.js} +1 -1
- package/dist/assets/{Index.68e84490.js → Index.a2f258f0.js} +1 -1
- package/dist/assets/{Index.b56d15c8.js → Index.a6e349c1.js} +1 -1
- package/dist/assets/{Index.cd660277.js → Index.b2da801d.js} +1 -1
- package/dist/assets/{Index.493dc291.js → Index.d11066b3.js} +1 -1
- package/dist/assets/{InfoIcon.0718f348.js → InfoIcon.329799b2.js} +1 -1
- package/dist/assets/{Invitees.6b5b327c.js → Invitees.e4e8b2f8.js} +1 -1
- package/dist/assets/{List.09132375.js → List.48ea87f6.js} +1 -1
- package/dist/assets/{List.341e4858.js → List.e71602b9.js} +1 -1
- package/dist/assets/{List.73ea2bd7.js → List.ef0903a0.js} +1 -1
- package/dist/assets/{Login.7793d6d2.js → Login.99c67df9.js} +1 -1
- package/dist/assets/{Main.695c88ad.js → Main.33bc9bc9.js} +1 -1
- package/dist/assets/{Manage.eead0b8e.js → Manage.5760b608.js} +1 -1
- package/dist/assets/{MarkdownRenderer.4ef5808c.js → MarkdownRenderer.74675f58.js} +1 -1
- package/dist/assets/{Navigator.4b986b5a.js → Navigator.8016fbe9.js} +1 -1
- package/dist/assets/{Pagination.ba076c41.js → Pagination.ef8fafe0.js} +1 -1
- package/dist/assets/{Setting.566798d1.js → Setting.c5471955.js} +1 -1
- package/dist/assets/{Status.dd04dd16.js → Status.546232e5.js} +1 -1
- package/dist/assets/{Subscribe.da97f0fe.js → Subscribe.be316f52.js} +1 -1
- package/dist/assets/{VideoNavigator.6d07cfaa.js → VideoNavigator.c157aa03.js} +1 -1
- package/dist/assets/{distribution.6dfc77cd.js → distribution.d3f5efb4.js} +1 -1
- package/dist/assets/index.38557f2d.css +1 -0
- package/dist/assets/{index.a3bc0f28.js → index.e160e9a8.js} +1 -1
- package/dist/assets/{order.cbc3bdd0.js → order.250bb40b.js} +1 -1
- package/dist/assets/{price.662dc55d.js → price.5338eefd.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/Conversation.ed4ff65e.js +0 -1
- package/dist/assets/index.ca27ae74.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ae as ve}from"./vendor-others.2105a885.js";import{ar as J}from"./vendor-fortawesome.fe21f86d.js";import{V as ge}from"./VideoNavigator.6d07cfaa.js";import{_ as k,aG as $e,aH as ye,aI as be,Y,a2 as q,F as ke,af as we,aJ as Ie,W as Ve}from"./index.a3bc0f28.js";import{S as Se,l as R,R as K,O as W,J as y,N as Ee,s as Ue,B as Ce,t as Le,y as Pe,Y as Ne}from"./vendor-element-plus.6158e0fe.js";import{H as w,al as n,o as r,e as p,f as i,V as s,I as H,M as m,T as l,S as $,L as P,R as v,P as B,U as fe,ai as he}from"./vendor-@vue.66ea933c.js";import{I as T}from"./InfoIcon.0718f348.js";import{A as Ae}from"./Status.dd04dd16.js";import{C as Te}from"./CopyToClipboard.6e4cac07.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.46bc4fb1.js";const Re=w({name:"LayoutLuma",components:{ElDrawer:Se,ElButton:R,FontAwesomeIcon:J,VideoNavigator:ge},data(){return{drawer:!1}}}),Ge={class:"main"},De={class:"config"},ze={class:"result"};function Oe(e,t,o,a,h,g){const c=n("video-navigator"),u=n("font-awesome-icon"),d=n("el-button"),_=n("el-drawer");return r(),p("div",Ge,[i("div",De,[s(c),H(e.$slots,"config",{},void 0,!0)]),i("div",ze,[H(e.$slots,"result",{},void 0,!0)]),s(d,{round:"",class:"menu",onClick:t[0]||(t[0]=f=>e.drawer=!0)},{default:m(()=>[s(u,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),s(_,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=f=>e.drawer=f),"with-header":!1,size:"340px",class:"drawer"},{default:m(()=>[H(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Me=k(Re,[["render",Oe],["__scopeId","data-v-234cfb9c"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Luma.vue"]]);const Fe=w({name:"EnhancementSelector",components:{ElSwitch:K,InfoIcon:T},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.enhancement},set(e){var t;console.debug("set enhancement",e),this.$store.commit("luma/setConfig",{...(t=this.$store.state.luma)==null?void 0:t.config,enhancement:e})}}},mounted(){this.value===void 0&&(this.value=$e)}}),je={class:"field"},Be={class:"title font-bold"};function qe(e,t,o,a,h,g){const c=n("el-switch"),u=n("info-icon");return r(),p("div",je,[i("h2",Be,l(e.$t("luma.name.enhancement")),1),s(c,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value"},null,8,["modelValue"]),s(u,{content:e.$t("luma.description.enhancement"),class:"info"},null,8,["content"])])}var He=k(Fe,[["render",qe],["__scopeId","data-v-175365a0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/EnhancementSelector.vue"]]);const Je=w({name:"CustomSelector",components:{ElSwitch:K,InfoIcon:T},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.custom},set(e){var t;console.debug("set custom",e),this.$store.commit("luma/setConfig",{...(t=this.$store.state.luma)==null?void 0:t.config,custom:e})}}},mounted(){this.value===void 0&&(this.value=ye)}}),Ye={class:"field"},Ke={class:"title font-bold"};function We(e,t,o,a,h,g){const c=n("el-switch"),u=n("info-icon");return r(),p("div",Ye,[i("h2",Ke,l(e.$t("luma.name.custom")),1),s(c,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value"},null,8,["modelValue"]),s(u,{content:e.$t("luma.description.custom"),class:"info"},null,8,["content"])])}var Qe=k(Je,[["render",We],["__scopeId","data-v-5ac2addb"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/CustomSelector.vue"]]);const Xe=w({name:"LoopSelector",components:{ElSwitch:K,InfoIcon:T},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.loop},set(e){var t;console.debug("set loop",e),this.$store.commit("luma/setConfig",{...(t=this.$store.state.luma)==null?void 0:t.config,loop:e})}}},mounted(){this.value===void 0&&(this.value=be)}}),Ze={class:"field"},xe={class:"title font-bold"};function et(e,t,o,a,h,g){const c=n("el-switch"),u=n("info-icon");return r(),p("div",Ze,[i("h2",xe,l(e.$t("luma.name.loop")),1),s(c,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value"},null,8,["modelValue"]),s(u,{content:e.$t("luma.description.loop"),class:"info"},null,8,["content"])])}var tt=k(Xe,[["render",et],["__scopeId","data-v-69cccd4e"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/LoopSelector.vue"]]);const ot=w({name:"ContentInput",components:{ElUpload:W,ElButton:R,InfoIcon:T},data(){return{fileList:[],uploadUrl:Y()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>{var t;return(t=e==null?void 0:e.response)==null?void 0:t.file_url})},value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.end_image_url},set(e){var o,a;const t=(o=this.urls)==null?void 0:o[0];this.$store.commit("luma/setConfig",{...(a=this.$store.state.luma)==null?void 0:a.config,end_image_url:t})}}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onExceed(){y.warning(this.$t("luma.message.uploadEndImageExceed"))},onError(){y.error(this.$t("luma.message.uploadEndImageError"))},onSetEndImageUrl(){var t,o;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("luma/setConfig",{...(o=this.$store.state.luma)==null?void 0:o.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),st={class:"field"},nt={class:"title font-bold"},at={class:"upload-wrapper"};function it(e,t,o,a,h,g){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",st,[i("h2",nt,l(e.$t("luma.name.endImageUrl")),1),i("div",at,[s(u,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:m(()=>[s(c,{size:"small",type:"primary",round:""},{default:m(()=>[$(l(e.$t("luma.button.uploadEndImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),s(d,{content:e.$t("luma.description.endImageUrl"),class:"info"},null,8,["content"])])}var lt=k(ot,[["render",it],["__scopeId","data-v-97900bb4"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/EndImageUrlInput.vue"]]);const rt=w({name:"StartImageUrlInput",components:{ElUpload:W,ElButton:R,InfoIcon:T},data(){return{fileList:[],uploadUrl:Y()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>{var t;return(t=e==null?void 0:e.response)==null?void 0:t.file_url})},value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.start_image_url},set(e){var o,a;const t=(o=this.urls)==null?void 0:o[0];this.$store.commit("luma/setConfig",{...(a=this.$store.state.luma)==null?void 0:a.config,start_image_url:t})}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){y.warning(this.$t("luma.message.uploadStartImageExceed"))},onError(){y.error(this.$t("luma.message.uploadStartImageError"))},async onRemove(){y.error(this.$t("luma.message.uploadStartImageError"))},onSetStartImageUrl(){var t,o;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("luma/setConfig",{...(o=this.$store.state.luma)==null?void 0:o.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),ct={class:"field"},ut={class:"title font-bold"},dt={class:"upload-wrapper"};function mt(e,t,o,a,h,g){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",ct,[i("h2",ut,l(e.$t("luma.name.startImageUrl")),1),i("div",dt,[s(u,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-remove":e.onRemove,"on-success":e.onSuccess,headers:e.headers},{default:m(()=>[s(c,{size:"small",type:"primary",round:""},{default:m(()=>[$(l(e.$t("luma.button.uploadStartImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-remove","on-success","headers"])]),s(d,{content:e.$t("luma.description.startImageUrl"),class:"info"},null,8,["content"])])}var pt=k(rt,[["render",mt],["__scopeId","data-v-5440a4bf"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/StartImageUrlInput.vue"]]);const _t=w({name:"UploadVideo",components:{ElUpload:W,ElButton:R,InfoIcon:T},data(){return{fileList:[],uploadUrl:Y()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>{var t;return(t=e==null?void 0:e.response)==null?void 0:t.file_url})},value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.video_url},set(e){var o,a;const t=(o=this.urls)==null?void 0:o[0];this.$store.commit("luma/setConfig",{...(a=this.$store.state.luma)==null?void 0:a.config,video_url:t})}}},mounted(){this.value||(this.value=void 0)},methods:{onExceed(){y.warning(this.$t("luma.message.uploadVideoExceed"))},onError(){y.error(this.$t("luma.message.uploadVideoError"))},beforeUpload(e){const t=e.type==="video/mp4",o=e.size/1024/1024<10;return t?o?!0:(y.error(this.$t("luma.message.uploadVideoSizeExceed")),!1):(y.error(this.$t("luma.message.uploadVideoTypeFailed")),!1)},onSetVideoUrl(){var t,o;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("luma/setConfig",{...(o=this.$store.state.luma)==null?void 0:o.config,video_url:e,action:"extend"})},async onSuccess(){this.onSetVideoUrl()}}}),ft={class:"field"},ht={class:"title font-bold"},vt={class:"upload-wrapper"};function gt(e,t,o,a,h,g){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",ft,[i("h2",ht,l(e.$t("luma.name.videoUrl")),1),i("div",vt,[s(u,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),accept:".mp4",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"before-upload":e.beforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:m(()=>[s(c,{size:"small",type:"primary",round:""},{default:m(()=>[$(l(e.$t("luma.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])]),s(d,{content:e.$t("luma.description.videoUrl"),class:"info"},null,8,["content"])])}var $t=k(_t,[["render",gt],["__scopeId","data-v-46c66c9f"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/UploadVideo.vue"]]);const yt="",bt=w({name:"PromptInput",components:{ElInput:Ee,InfoIcon:T},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("luma/setConfig",{...(t=this.$store.state.luma)==null?void 0:t.config,prompt:e})}}},mounted(){this.value||(this.value=yt)}}),kt={class:"field"},wt={class:"box"},It={class:"title font-bold"};function Vt(e,t,o,a,h,g){const c=n("info-icon"),u=n("el-input");return r(),p("div",kt,[i("div",wt,[i("h2",It,l(e.$t("luma.name.prompt")),1),s(c,{content:e.$t("luma.description.prompt"),class:"info"},null,8,["content"])]),s(u,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=d=>e.prompt=d),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("luma.placeholder.prompt"),maxlength:2e3,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var St=k(bt,[["render",Vt],["__scopeId","data-v-19a7446b"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/PromptInput.vue"]]);const Et=w({name:"ExtendFromInput",components:{VuePlyr:ve},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}},computed:{config(){var e;return(e=this.$store.state.luma)==null?void 0:e.config}}}),Ut={class:"field"},Ct={class:"box"},Lt={class:"title font-bold"},Pt={class:"task"},Nt=["data-poster"],At=["src"];function Tt(e,t,o,a,h,g){const c=n("vue-plyr");return r(),p("div",Ut,[i("div",Ct,[i("h2",Lt,l(e.$t("luma.name.extend")),1)]),i("div",Pt,[i("div",null,[s(c,{options:e.options,class:"video"},{default:m(()=>{var u,d;return[i("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(u=e.config)==null?void 0:u.thumbnail_url},[i("source",{size:"1080",src:(d=e.config)==null?void 0:d.video_url,type:"video/mp4"},null,8,At)],8,Nt)]}),_:1},8,["options"])])])])}var Rt=k(Et,[["render",Tt],["__scopeId","data-v-1cefb16b"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/ExtendFromInput.vue"]]);const Gt=w({name:"PresetPanel",components:{LoopSelector:tt,StartImageUrlInput:pt,EndImageUrlInput:lt,EnhancementSelector:He,ElButton:R,FontAwesomeIcon:J,PromptInput:St,ExtendFromInput:Rt,CustomSelector:Qe,UploadVideo:$t},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.luma)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Dt={class:"panel"},zt={class:"config"},Ot={class:"actions"};function Mt(e,t,o,a,h,g){var L,V,A,G,D,z,O,M,F;const c=n("extend-from-input"),u=n("prompt-input"),d=n("custom-selector"),_=n("upload-video"),f=n("start-image-url-input"),S=n("end-image-url-input"),E=n("enhancement-selector"),N=n("loop-selector"),U=n("font-awesome-icon"),C=n("el-button");return r(),p("div",Dt,[i("div",zt,[((L=e.config)==null?void 0:L.video_id)||((V=e.config)==null?void 0:V.video_url)?(r(),P(c,{key:0,class:"mb-4"})):v("v-if",!0),s(u,{class:"mb-4"}),(A=e.config)!=null&&A.video_id?v("v-if",!0):(r(),P(d,{key:1,class:"mb-4"})),(G=e.config)!=null&&G.custom?(r(),P(_,{key:2,class:"mb-4"})):v("v-if",!0),!(((D=e.config)==null?void 0:D.video_id)||((z=e.config)==null?void 0:z.video_url))&&!((O=e.config)!=null&&O.custom)?(r(),P(f,{key:3,class:"mb-4"})):v("v-if",!0),s(S,{class:"mb-4"}),s(E,{class:"mb-4"}),s(N,{class:"mb-4"}),i("div",Ot,[((M=e.config)==null?void 0:M.video_url)!==void 0||((F=e.config)==null?void 0:F.custom)?(r(),P(C,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[s(U,{icon:"fa-solid fa-magic",class:"mr-2"}),$(" "+l(e.$t("luma.button.extend")),1)]),_:1},8,["onClick"])):(r(),P(C,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[s(U,{icon:"fa-solid fa-magic",class:"mr-2"}),$(" "+l(e.$t("luma.button.generate")),1)]),_:1},8,["onClick"]))])])])}var Ft=k(Gt,[["render",Mt],["__scopeId","data-v-951b4cc0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/ConfigPanel.vue"]]);const jt=w({name:"VideoPlayer",components:{VuePlyr:ve},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),Bt=["data-poster"],qt=["src"];function Ht(e,t,o,a,h,g){const c=n("vue-plyr");return r(),p("div",null,[s(c,{options:e.options,class:"video"},{default:m(()=>{var u,d,_,f;return[i("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(d=(u=e.modelValue)==null?void 0:u.response)==null?void 0:d.thumbnail_url},[i("source",{size:"1080",src:(f=(_=e.modelValue)==null?void 0:_.response)==null?void 0:f.video_url,type:"video/mp4"},null,8,qt)],8,Bt)]}),_:1},8,["options"])])}var Jt=k(jt,[["render",Ht],["__scopeId","data-v-759e400c"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/VideoPlayer.vue"]]);const Yt=w({name:"TaskPreview",components:{ElImage:Ue,CopyToClipboard:Te,FontAwesomeIcon:J,ElAlert:Ce,VideoPlayer:Jt,ElTooltip:Le,ElButton:R},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.luma)==null?void 0:e.application},config(){var e;return(e=this.$store.state.luma)==null?void 0:e.config}},methods:{onExtend(e,t){var o;e.stopPropagation(),console.debug("set config",t),this.$store.commit("luma/setConfig",{...(o=this.$store.state.luma)==null?void 0:o.config,video_id:t.video_id,prompt:t.prompt,action:"extend",thumbnail_url:t.thumbnail_url,video_url:t.video_url})},onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onReload(e){const t=e.target,o=new URL(t.src),a=o.searchParams.get("retry");if(!a)o.searchParams.set("retry","1");else if(parseInt(a)<2)o.searchParams.set("retry",(parseInt(a)+1).toString());else return;t.src=o.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),Kt={class:"preview"},Wt={class:"left"},Qt={class:"main"},Xt={class:"bot"},Zt={class:"datetime"},xt={class:"info"},eo={key:0,class:"prompt mt-2"},to={key:0},oo={key:1},so={key:0,class:B({content:!0,failed:!0})},no={class:"image-wrapper"},ao={key:0,class:B({operations:!0,"mt-2":!0})},io={class:"description"},lo={key:1,class:B({content:!0})},ro={class:"description"},co={class:"description"},uo={class:"description"},mo={key:2,class:B({content:!0})},po={class:"description"};function _o(e,t,o,a,h,g){var N,U,C,L,V,A,G,D,z,O,M,F,Q,X,Z,x,ee,te,oe,se,ne,ae,ie;const c=n("el-image"),u=n("VideoPlayer"),d=n("el-button"),_=n("el-tooltip"),f=n("font-awesome-icon"),S=n("copy-to-clipboard"),E=n("el-alert");return r(),p("div",Kt,[i("div",Wt,[s(c,{src:"https://cdn.acedata.cloud/ahjfwi.png",class:"avatar"})]),i("div",Qt,[i("div",Xt,[$(l(e.$t("luma.name.lumaBot"))+" ",1),i("span",Zt,l(e.$dayjs.format(""+new Date(parseFloat(((N=e.modelValue)==null?void 0:N.created_at)||"")*1e3))),1)]),i("div",xt,[(C=(U=e.modelValue)==null?void 0:U.request)!=null&&C.prompt?(r(),p("p",eo,[$(l((V=(L=e.modelValue)==null?void 0:L.request)==null?void 0:V.prompt)+" ",1),(A=e.modelValue)!=null&&A.response?v("v-if",!0):(r(),p("span",to," - ("+l(e.$t("luma.status.pending"))+") ",1)),((D=(G=e.modelValue)==null?void 0:G.response)==null?void 0:D.state)==="processing"||((O=(z=e.modelValue)==null?void 0:z.response)==null?void 0:O.state)==="pending"?(r(),p("span",oo," - ("+l(e.$t("luma.status.processing"))+") ",1)):v("v-if",!0)])):v("v-if",!0)]),v(" Display success message "),((F=(M=e.modelValue)==null?void 0:M.response)==null?void 0:F.success)===!0?(r(),p("div",so,[i("div",no,[s(u,{"model-value":e.modelValue},null,8,["model-value"])]),((Q=e.modelValue)==null?void 0:Q.response)&&!((X=e.config)!=null&&X.custom)?(r(),p("div",ao,[s(_,{class:"box-item",effect:"dark",content:e.$t("luma.message.extendVideo"),placement:"top-start"},{default:m(()=>[s(d,{type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=I=>{var b;return e.onExtend(I,(b=e.modelValue)==null?void 0:b.response)})},{default:m(()=>[$(l(e.$t("luma.button.extend")),1)]),_:1})]),_:1},8,["content"]),s(_,{class:"box-item",effect:"dark",content:e.$t("luma.message.downloadVideo"),placement:"top-start"},{default:m(()=>[s(d,{type:"info",size:"small",class:"btn-action",onClick:t[1]||(t[1]=I=>{var b,j;return e.onDownload(I,(j=(b=e.modelValue)==null?void 0:b.response)==null?void 0:j.video_url)})},{default:m(()=>[$(l(e.$t("luma.button.download")),1)]),_:1})]),_:1},8,["content"])])):v("v-if",!0),s(E,{closable:!1,class:"mt-2 success"},{default:m(()=>{var I,b;return[i("p",io,[s(f,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+l(e.$t("luma.name.taskId"))+": "+l((I=e.modelValue)==null?void 0:I.id)+" ",1),s(S,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0),v(" Display error message "),((x=(Z=e.modelValue)==null?void 0:Z.response)==null?void 0:x.state)==="failed"||((te=(ee=e.modelValue)==null?void 0:ee.response)==null?void 0:te.success)===!1?(r(),p("div",lo,[s(E,{closable:!1,class:"failure"},{template:m(()=>[s(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),$(" "+l(e.$t("luma.name.failure")),1)]),default:m(()=>{var I,b,j,le,re,ce,ue,de,me,pe,_e;return[i("p",ro,[s(f,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+l(e.$t("luma.name.taskId"))+": "+l((I=e.modelValue)==null?void 0:I.id)+" ",1),s(S,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])]),i("p",co,[s(f,{icon:"fa-solid fa-circle-info",class:"mr-1"}),$(" "+l(e.$t("luma.name.failureReason"))+": "+l((re=(le=(j=e.modelValue)==null?void 0:j.response)==null?void 0:le.error)==null?void 0:re.message)+" ",1),s(S,{content:(de=(ue=(ce=e.modelValue)==null?void 0:ce.response)==null?void 0:ue.error)==null?void 0:de.message,class:"btn-copy"},null,8,["content"])]),i("p",uo,[s(f,{icon:"fa-solid fa-hashtag",class:"mr-1"}),$(" "+l(e.$t("luma.name.traceId"))+": "+l((me=e.modelValue)==null?void 0:me.trace_id)+" ",1),s(S,{content:(_e=(pe=e.modelValue)==null?void 0:pe.response)==null?void 0:_e.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0),v(" Display error message "),!((oe=e.modelValue)!=null&&oe.response)||((ne=(se=e.modelValue)==null?void 0:se.response)==null?void 0:ne.state)==="processing"||((ie=(ae=e.modelValue)==null?void 0:ae.response)==null?void 0:ie.state)==="pending"?(r(),p("div",mo,[s(E,{closable:!1,class:"info"},{template:m(()=>[s(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),$(" "+l(e.$t("luma.name.failure")),1)]),default:m(()=>{var I,b;return[i("p",po,[s(f,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+l(e.$t("luma.name.taskId"))+": "+l((I=e.modelValue)==null?void 0:I.id)+" ",1),s(S,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0)])])}var fo=k(Yt,[["render",_o],["__scopeId","data-v-077795a0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/task/Preview.vue"]]);const ho=w({name:"RecentPanel",components:{TaskPreview:fo,ElSkeleton:Pe,ElSkeletonItem:Ne},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,t,o,a;return{...(e=this.$store.state.luma)==null?void 0:e.tasks,items:(a=(o=(t=this.$store.state.luma)==null?void 0:t.tasks)==null?void 0:o.items)==null?void 0:a.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),vo={key:0,class:"tasks"},go={class:"left"},$o={class:"main"},yo={key:1,class:"tasks"},bo={key:2,class:"description"};function ko(e,t,o,a,h,g){var _,f,S,E,N,U,C,L;const c=n("el-skeleton-item"),u=n("el-skeleton"),d=n("task-preview");return r(),p("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...V)=>e.onHandleScroll&&e.onHandleScroll(...V))},[((_=e.tasks)==null?void 0:_.items)===void 0?(r(),p("div",vo,[(r(),p(fe,null,he(3,V=>i("div",{key:V,class:"task placeholder"},[i("div",go,[s(u,{animated:""},{template:m(()=>[s(c,{variant:"image",class:"avatar"})]),_:1})]),i("div",$o,[s(u,{animated:""},{template:m(()=>[s(c,{variant:"p",class:"title"}),s(c,{variant:"image",class:"icon"})]),_:1})])])),64))])):((S=(f=e.tasks)==null?void 0:f.items)==null?void 0:S.length)&&((N=(E=e.tasks)==null?void 0:E.items)==null?void 0:N.length)>0?(r(),p("div",yo,[(r(!0),p(fe,null,he((U=e.tasks)==null?void 0:U.items,(V,A)=>(r(),P(d,{key:A,"model-value":V,class:"preview"},null,8,["model-value"]))),128))])):v("v-if",!0),((L=(C=e.tasks)==null?void 0:C.items)==null?void 0:L.length)===0?(r(),p("p",bo,l(e.$t("luma.message.noTasks")),1)):v("v-if",!0)],544)}var wo=k(ho,[["render",ko],["__scopeId","data-v-2f8302a7"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/RecentPanel.vue"]]);const Io="https://webhook.acedata.cloud/luma",Vo=w({name:"LumaIndex",components:{ConfigPanel:Ft,Layout:Me,ApplicationStatus:Ae,RecentPanel:wo},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,t;return((t=(e=this.$store.state.luma)==null?void 0:e.status)==null?void 0:t.getApplications)===q.Request},service(){return this.$store.state.luma.service},credential(){return this.$store.state.luma.credential},config(){return this.$store.state.luma.config},initializing(){return this.$store.state.luma.status.getApplications===q.Request},needApply(){return this.$store.state.luma.status.getApplications===q.Success&&!this.application},application(){return this.$store.state.luma.application},applications(){return this.$store.state.luma.applications},tasks(){return this.$store.state.luma.tasks}},watch:{tasks:{handler(e,t){var o,a;((o=e==null?void 0:e.items)==null?void 0:o.length)>((a=t==null?void 0:t.items)==null?void 0:a.length)&&console.debug("new tasks detected")},deep:!0}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onScrollDown(),await this.onGetTasks(),this.job=setInterval(()=>{this.onGetTasks()},5e3)},async unmounted(){clearInterval(this.job),clearInterval(this.timer)},methods:{async onReachTop(){var e,t,o;console.debug("reached top"),await this.onGetTasks({createdAtMax:(o=(t=(e=this.tasks)==null?void 0:e.items)==null?void 0:t[0])==null?void 0:o.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("luma/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("luma/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){ke.create({application:this.application}).then(({data:e})=>{this.application=e,y.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var t,o;((o=(t=e==null?void 0:e.response)==null?void 0:t.data)==null?void 0:o.code)===we&&y.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},500)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:o,createdAtMax:a}=e||{};console.debug("limit",t,"createdAtMin",o,"createdAtMax",a),await this.$store.dispatch("luma/getTasks",{limit:t,createdAtMin:o,createdAtMax:a})},async onGenerateVideo(){var o;const e={...this.config,callback_url:Io},t=(o=this.credential)==null?void 0:o.token;if(!t){console.error("no token specified");return}y.info(this.$t("luma.message.startingTask")),Ie.generate(e,{token:t}).then(()=>{y.success(this.$t("luma.message.startTaskSuccess")),this.$store.commit("luma/setConfig",{config:void 0})}).catch(a=>{var g,c;const h=(g=a==null?void 0:a.response)==null?void 0:g.data;((c=h==null?void 0:h.error)==null?void 0:c.code)===Ve?y.error(this.$t("luma.message.usedUp")):y.error(this.$t("luma.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function So(e,t,o,a,h,g){const c=n("config-panel"),u=n("application-status"),d=n("recent-panel"),_=n("layout");return r(),P(_,null,{config:m(()=>[s(c,{onGenerate:e.onGenerateVideo},null,8,["onGenerate"])]),result:m(()=>[s(u,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication,onSelect:t[0]||(t[0]=f=>e.$store.dispatch("luma/setApplication",f))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),s(d,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"]),v(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var zo=k(Vo,[["render",So],["__scopeId","data-v-c45e0af8"],["__file","/home/runner/work/Nexior/Nexior/src/pages/luma/Index.vue"]]);export{zo as default};
|
|
1
|
+
import{ae as ve}from"./vendor-others.2105a885.js";import{ar as J}from"./vendor-fortawesome.fe21f86d.js";import{V as ge}from"./VideoNavigator.c157aa03.js";import{_ as k,aG as $e,aH as ye,aI as be,Y,a2 as q,F as ke,af as we,aJ as Ie,W as Ve}from"./index.e160e9a8.js";import{S as Se,l as R,R as K,O as W,J as y,N as Ee,s as Ue,B as Ce,t as Le,y as Pe,Y as Ne}from"./vendor-element-plus.6158e0fe.js";import{H as w,al as n,o as r,e as p,f as i,V as s,I as H,M as m,T as l,S as $,L as P,R as v,P as B,U as fe,ai as he}from"./vendor-@vue.66ea933c.js";import{I as T}from"./InfoIcon.329799b2.js";import{A as Ae}from"./Status.546232e5.js";import{C as Te}from"./CopyToClipboard.d2c28170.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.46bc4fb1.js";const Re=w({name:"LayoutLuma",components:{ElDrawer:Se,ElButton:R,FontAwesomeIcon:J,VideoNavigator:ge},data(){return{drawer:!1}}}),Ge={class:"main"},De={class:"config"},ze={class:"result"};function Oe(e,t,o,a,h,g){const c=n("video-navigator"),u=n("font-awesome-icon"),d=n("el-button"),_=n("el-drawer");return r(),p("div",Ge,[i("div",De,[s(c),H(e.$slots,"config",{},void 0,!0)]),i("div",ze,[H(e.$slots,"result",{},void 0,!0)]),s(d,{round:"",class:"menu",onClick:t[0]||(t[0]=f=>e.drawer=!0)},{default:m(()=>[s(u,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),s(_,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=f=>e.drawer=f),"with-header":!1,size:"340px",class:"drawer"},{default:m(()=>[H(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Me=k(Re,[["render",Oe],["__scopeId","data-v-234cfb9c"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Luma.vue"]]);const Fe=w({name:"EnhancementSelector",components:{ElSwitch:K,InfoIcon:T},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.enhancement},set(e){var t;console.debug("set enhancement",e),this.$store.commit("luma/setConfig",{...(t=this.$store.state.luma)==null?void 0:t.config,enhancement:e})}}},mounted(){this.value===void 0&&(this.value=$e)}}),je={class:"field"},Be={class:"title font-bold"};function qe(e,t,o,a,h,g){const c=n("el-switch"),u=n("info-icon");return r(),p("div",je,[i("h2",Be,l(e.$t("luma.name.enhancement")),1),s(c,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value"},null,8,["modelValue"]),s(u,{content:e.$t("luma.description.enhancement"),class:"info"},null,8,["content"])])}var He=k(Fe,[["render",qe],["__scopeId","data-v-175365a0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/EnhancementSelector.vue"]]);const Je=w({name:"CustomSelector",components:{ElSwitch:K,InfoIcon:T},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.custom},set(e){var t;console.debug("set custom",e),this.$store.commit("luma/setConfig",{...(t=this.$store.state.luma)==null?void 0:t.config,custom:e})}}},mounted(){this.value===void 0&&(this.value=ye)}}),Ye={class:"field"},Ke={class:"title font-bold"};function We(e,t,o,a,h,g){const c=n("el-switch"),u=n("info-icon");return r(),p("div",Ye,[i("h2",Ke,l(e.$t("luma.name.custom")),1),s(c,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value"},null,8,["modelValue"]),s(u,{content:e.$t("luma.description.custom"),class:"info"},null,8,["content"])])}var Qe=k(Je,[["render",We],["__scopeId","data-v-5ac2addb"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/CustomSelector.vue"]]);const Xe=w({name:"LoopSelector",components:{ElSwitch:K,InfoIcon:T},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.loop},set(e){var t;console.debug("set loop",e),this.$store.commit("luma/setConfig",{...(t=this.$store.state.luma)==null?void 0:t.config,loop:e})}}},mounted(){this.value===void 0&&(this.value=be)}}),Ze={class:"field"},xe={class:"title font-bold"};function et(e,t,o,a,h,g){const c=n("el-switch"),u=n("info-icon");return r(),p("div",Ze,[i("h2",xe,l(e.$t("luma.name.loop")),1),s(c,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value"},null,8,["modelValue"]),s(u,{content:e.$t("luma.description.loop"),class:"info"},null,8,["content"])])}var tt=k(Xe,[["render",et],["__scopeId","data-v-69cccd4e"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/LoopSelector.vue"]]);const ot=w({name:"ContentInput",components:{ElUpload:W,ElButton:R,InfoIcon:T},data(){return{fileList:[],uploadUrl:Y()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>{var t;return(t=e==null?void 0:e.response)==null?void 0:t.file_url})},value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.end_image_url},set(e){var o,a;const t=(o=this.urls)==null?void 0:o[0];this.$store.commit("luma/setConfig",{...(a=this.$store.state.luma)==null?void 0:a.config,end_image_url:t})}}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onExceed(){y.warning(this.$t("luma.message.uploadEndImageExceed"))},onError(){y.error(this.$t("luma.message.uploadEndImageError"))},onSetEndImageUrl(){var t,o;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("luma/setConfig",{...(o=this.$store.state.luma)==null?void 0:o.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),st={class:"field"},nt={class:"title font-bold"},at={class:"upload-wrapper"};function it(e,t,o,a,h,g){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",st,[i("h2",nt,l(e.$t("luma.name.endImageUrl")),1),i("div",at,[s(u,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:m(()=>[s(c,{size:"small",type:"primary",round:""},{default:m(()=>[$(l(e.$t("luma.button.uploadEndImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),s(d,{content:e.$t("luma.description.endImageUrl"),class:"info"},null,8,["content"])])}var lt=k(ot,[["render",it],["__scopeId","data-v-97900bb4"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/EndImageUrlInput.vue"]]);const rt=w({name:"StartImageUrlInput",components:{ElUpload:W,ElButton:R,InfoIcon:T},data(){return{fileList:[],uploadUrl:Y()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>{var t;return(t=e==null?void 0:e.response)==null?void 0:t.file_url})},value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.start_image_url},set(e){var o,a;const t=(o=this.urls)==null?void 0:o[0];this.$store.commit("luma/setConfig",{...(a=this.$store.state.luma)==null?void 0:a.config,start_image_url:t})}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){y.warning(this.$t("luma.message.uploadStartImageExceed"))},onError(){y.error(this.$t("luma.message.uploadStartImageError"))},async onRemove(){y.error(this.$t("luma.message.uploadStartImageError"))},onSetStartImageUrl(){var t,o;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("luma/setConfig",{...(o=this.$store.state.luma)==null?void 0:o.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),ct={class:"field"},ut={class:"title font-bold"},dt={class:"upload-wrapper"};function mt(e,t,o,a,h,g){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",ct,[i("h2",ut,l(e.$t("luma.name.startImageUrl")),1),i("div",dt,[s(u,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-remove":e.onRemove,"on-success":e.onSuccess,headers:e.headers},{default:m(()=>[s(c,{size:"small",type:"primary",round:""},{default:m(()=>[$(l(e.$t("luma.button.uploadStartImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-remove","on-success","headers"])]),s(d,{content:e.$t("luma.description.startImageUrl"),class:"info"},null,8,["content"])])}var pt=k(rt,[["render",mt],["__scopeId","data-v-5440a4bf"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/StartImageUrlInput.vue"]]);const _t=w({name:"UploadVideo",components:{ElUpload:W,ElButton:R,InfoIcon:T},data(){return{fileList:[],uploadUrl:Y()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>{var t;return(t=e==null?void 0:e.response)==null?void 0:t.file_url})},value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.video_url},set(e){var o,a;const t=(o=this.urls)==null?void 0:o[0];this.$store.commit("luma/setConfig",{...(a=this.$store.state.luma)==null?void 0:a.config,video_url:t})}}},mounted(){this.value||(this.value=void 0)},methods:{onExceed(){y.warning(this.$t("luma.message.uploadVideoExceed"))},onError(){y.error(this.$t("luma.message.uploadVideoError"))},beforeUpload(e){const t=e.type==="video/mp4",o=e.size/1024/1024<10;return t?o?!0:(y.error(this.$t("luma.message.uploadVideoSizeExceed")),!1):(y.error(this.$t("luma.message.uploadVideoTypeFailed")),!1)},onSetVideoUrl(){var t,o;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("luma/setConfig",{...(o=this.$store.state.luma)==null?void 0:o.config,video_url:e,action:"extend"})},async onSuccess(){this.onSetVideoUrl()}}}),ft={class:"field"},ht={class:"title font-bold"},vt={class:"upload-wrapper"};function gt(e,t,o,a,h,g){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",ft,[i("h2",ht,l(e.$t("luma.name.videoUrl")),1),i("div",vt,[s(u,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),accept:".mp4",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"before-upload":e.beforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:m(()=>[s(c,{size:"small",type:"primary",round:""},{default:m(()=>[$(l(e.$t("luma.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])]),s(d,{content:e.$t("luma.description.videoUrl"),class:"info"},null,8,["content"])])}var $t=k(_t,[["render",gt],["__scopeId","data-v-46c66c9f"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/UploadVideo.vue"]]);const yt="",bt=w({name:"PromptInput",components:{ElInput:Ee,InfoIcon:T},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("luma/setConfig",{...(t=this.$store.state.luma)==null?void 0:t.config,prompt:e})}}},mounted(){this.value||(this.value=yt)}}),kt={class:"field"},wt={class:"box"},It={class:"title font-bold"};function Vt(e,t,o,a,h,g){const c=n("info-icon"),u=n("el-input");return r(),p("div",kt,[i("div",wt,[i("h2",It,l(e.$t("luma.name.prompt")),1),s(c,{content:e.$t("luma.description.prompt"),class:"info"},null,8,["content"])]),s(u,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=d=>e.prompt=d),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("luma.placeholder.prompt"),maxlength:2e3,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var St=k(bt,[["render",Vt],["__scopeId","data-v-19a7446b"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/PromptInput.vue"]]);const Et=w({name:"ExtendFromInput",components:{VuePlyr:ve},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}},computed:{config(){var e;return(e=this.$store.state.luma)==null?void 0:e.config}}}),Ut={class:"field"},Ct={class:"box"},Lt={class:"title font-bold"},Pt={class:"task"},Nt=["data-poster"],At=["src"];function Tt(e,t,o,a,h,g){const c=n("vue-plyr");return r(),p("div",Ut,[i("div",Ct,[i("h2",Lt,l(e.$t("luma.name.extend")),1)]),i("div",Pt,[i("div",null,[s(c,{options:e.options,class:"video"},{default:m(()=>{var u,d;return[i("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(u=e.config)==null?void 0:u.thumbnail_url},[i("source",{size:"1080",src:(d=e.config)==null?void 0:d.video_url,type:"video/mp4"},null,8,At)],8,Nt)]}),_:1},8,["options"])])])])}var Rt=k(Et,[["render",Tt],["__scopeId","data-v-1cefb16b"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/ExtendFromInput.vue"]]);const Gt=w({name:"PresetPanel",components:{LoopSelector:tt,StartImageUrlInput:pt,EndImageUrlInput:lt,EnhancementSelector:He,ElButton:R,FontAwesomeIcon:J,PromptInput:St,ExtendFromInput:Rt,CustomSelector:Qe,UploadVideo:$t},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.luma)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Dt={class:"panel"},zt={class:"config"},Ot={class:"actions"};function Mt(e,t,o,a,h,g){var L,V,A,G,D,z,O,M,F;const c=n("extend-from-input"),u=n("prompt-input"),d=n("custom-selector"),_=n("upload-video"),f=n("start-image-url-input"),S=n("end-image-url-input"),E=n("enhancement-selector"),N=n("loop-selector"),U=n("font-awesome-icon"),C=n("el-button");return r(),p("div",Dt,[i("div",zt,[((L=e.config)==null?void 0:L.video_id)||((V=e.config)==null?void 0:V.video_url)?(r(),P(c,{key:0,class:"mb-4"})):v("v-if",!0),s(u,{class:"mb-4"}),(A=e.config)!=null&&A.video_id?v("v-if",!0):(r(),P(d,{key:1,class:"mb-4"})),(G=e.config)!=null&&G.custom?(r(),P(_,{key:2,class:"mb-4"})):v("v-if",!0),!(((D=e.config)==null?void 0:D.video_id)||((z=e.config)==null?void 0:z.video_url))&&!((O=e.config)!=null&&O.custom)?(r(),P(f,{key:3,class:"mb-4"})):v("v-if",!0),s(S,{class:"mb-4"}),s(E,{class:"mb-4"}),s(N,{class:"mb-4"}),i("div",Ot,[((M=e.config)==null?void 0:M.video_url)!==void 0||((F=e.config)==null?void 0:F.custom)?(r(),P(C,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[s(U,{icon:"fa-solid fa-magic",class:"mr-2"}),$(" "+l(e.$t("luma.button.extend")),1)]),_:1},8,["onClick"])):(r(),P(C,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[s(U,{icon:"fa-solid fa-magic",class:"mr-2"}),$(" "+l(e.$t("luma.button.generate")),1)]),_:1},8,["onClick"]))])])])}var Ft=k(Gt,[["render",Mt],["__scopeId","data-v-951b4cc0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/ConfigPanel.vue"]]);const jt=w({name:"VideoPlayer",components:{VuePlyr:ve},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),Bt=["data-poster"],qt=["src"];function Ht(e,t,o,a,h,g){const c=n("vue-plyr");return r(),p("div",null,[s(c,{options:e.options,class:"video"},{default:m(()=>{var u,d,_,f;return[i("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(d=(u=e.modelValue)==null?void 0:u.response)==null?void 0:d.thumbnail_url},[i("source",{size:"1080",src:(f=(_=e.modelValue)==null?void 0:_.response)==null?void 0:f.video_url,type:"video/mp4"},null,8,qt)],8,Bt)]}),_:1},8,["options"])])}var Jt=k(jt,[["render",Ht],["__scopeId","data-v-759e400c"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/VideoPlayer.vue"]]);const Yt=w({name:"TaskPreview",components:{ElImage:Ue,CopyToClipboard:Te,FontAwesomeIcon:J,ElAlert:Ce,VideoPlayer:Jt,ElTooltip:Le,ElButton:R},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.luma)==null?void 0:e.application},config(){var e;return(e=this.$store.state.luma)==null?void 0:e.config}},methods:{onExtend(e,t){var o;e.stopPropagation(),console.debug("set config",t),this.$store.commit("luma/setConfig",{...(o=this.$store.state.luma)==null?void 0:o.config,video_id:t.video_id,prompt:t.prompt,action:"extend",thumbnail_url:t.thumbnail_url,video_url:t.video_url})},onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onReload(e){const t=e.target,o=new URL(t.src),a=o.searchParams.get("retry");if(!a)o.searchParams.set("retry","1");else if(parseInt(a)<2)o.searchParams.set("retry",(parseInt(a)+1).toString());else return;t.src=o.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),Kt={class:"preview"},Wt={class:"left"},Qt={class:"main"},Xt={class:"bot"},Zt={class:"datetime"},xt={class:"info"},eo={key:0,class:"prompt mt-2"},to={key:0},oo={key:1},so={key:0,class:B({content:!0,failed:!0})},no={class:"image-wrapper"},ao={key:0,class:B({operations:!0,"mt-2":!0})},io={class:"description"},lo={key:1,class:B({content:!0})},ro={class:"description"},co={class:"description"},uo={class:"description"},mo={key:2,class:B({content:!0})},po={class:"description"};function _o(e,t,o,a,h,g){var N,U,C,L,V,A,G,D,z,O,M,F,Q,X,Z,x,ee,te,oe,se,ne,ae,ie;const c=n("el-image"),u=n("VideoPlayer"),d=n("el-button"),_=n("el-tooltip"),f=n("font-awesome-icon"),S=n("copy-to-clipboard"),E=n("el-alert");return r(),p("div",Kt,[i("div",Wt,[s(c,{src:"https://cdn.acedata.cloud/ahjfwi.png",class:"avatar"})]),i("div",Qt,[i("div",Xt,[$(l(e.$t("luma.name.lumaBot"))+" ",1),i("span",Zt,l(e.$dayjs.format(""+new Date(parseFloat(((N=e.modelValue)==null?void 0:N.created_at)||"")*1e3))),1)]),i("div",xt,[(C=(U=e.modelValue)==null?void 0:U.request)!=null&&C.prompt?(r(),p("p",eo,[$(l((V=(L=e.modelValue)==null?void 0:L.request)==null?void 0:V.prompt)+" ",1),(A=e.modelValue)!=null&&A.response?v("v-if",!0):(r(),p("span",to," - ("+l(e.$t("luma.status.pending"))+") ",1)),((D=(G=e.modelValue)==null?void 0:G.response)==null?void 0:D.state)==="processing"||((O=(z=e.modelValue)==null?void 0:z.response)==null?void 0:O.state)==="pending"?(r(),p("span",oo," - ("+l(e.$t("luma.status.processing"))+") ",1)):v("v-if",!0)])):v("v-if",!0)]),v(" Display success message "),((F=(M=e.modelValue)==null?void 0:M.response)==null?void 0:F.success)===!0?(r(),p("div",so,[i("div",no,[s(u,{"model-value":e.modelValue},null,8,["model-value"])]),((Q=e.modelValue)==null?void 0:Q.response)&&!((X=e.config)!=null&&X.custom)?(r(),p("div",ao,[s(_,{class:"box-item",effect:"dark",content:e.$t("luma.message.extendVideo"),placement:"top-start"},{default:m(()=>[s(d,{type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=I=>{var b;return e.onExtend(I,(b=e.modelValue)==null?void 0:b.response)})},{default:m(()=>[$(l(e.$t("luma.button.extend")),1)]),_:1})]),_:1},8,["content"]),s(_,{class:"box-item",effect:"dark",content:e.$t("luma.message.downloadVideo"),placement:"top-start"},{default:m(()=>[s(d,{type:"info",size:"small",class:"btn-action",onClick:t[1]||(t[1]=I=>{var b,j;return e.onDownload(I,(j=(b=e.modelValue)==null?void 0:b.response)==null?void 0:j.video_url)})},{default:m(()=>[$(l(e.$t("luma.button.download")),1)]),_:1})]),_:1},8,["content"])])):v("v-if",!0),s(E,{closable:!1,class:"mt-2 success"},{default:m(()=>{var I,b;return[i("p",io,[s(f,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+l(e.$t("luma.name.taskId"))+": "+l((I=e.modelValue)==null?void 0:I.id)+" ",1),s(S,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0),v(" Display error message "),((x=(Z=e.modelValue)==null?void 0:Z.response)==null?void 0:x.state)==="failed"||((te=(ee=e.modelValue)==null?void 0:ee.response)==null?void 0:te.success)===!1?(r(),p("div",lo,[s(E,{closable:!1,class:"failure"},{template:m(()=>[s(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),$(" "+l(e.$t("luma.name.failure")),1)]),default:m(()=>{var I,b,j,le,re,ce,ue,de,me,pe,_e;return[i("p",ro,[s(f,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+l(e.$t("luma.name.taskId"))+": "+l((I=e.modelValue)==null?void 0:I.id)+" ",1),s(S,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])]),i("p",co,[s(f,{icon:"fa-solid fa-circle-info",class:"mr-1"}),$(" "+l(e.$t("luma.name.failureReason"))+": "+l((re=(le=(j=e.modelValue)==null?void 0:j.response)==null?void 0:le.error)==null?void 0:re.message)+" ",1),s(S,{content:(de=(ue=(ce=e.modelValue)==null?void 0:ce.response)==null?void 0:ue.error)==null?void 0:de.message,class:"btn-copy"},null,8,["content"])]),i("p",uo,[s(f,{icon:"fa-solid fa-hashtag",class:"mr-1"}),$(" "+l(e.$t("luma.name.traceId"))+": "+l((me=e.modelValue)==null?void 0:me.trace_id)+" ",1),s(S,{content:(_e=(pe=e.modelValue)==null?void 0:pe.response)==null?void 0:_e.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0),v(" Display error message "),!((oe=e.modelValue)!=null&&oe.response)||((ne=(se=e.modelValue)==null?void 0:se.response)==null?void 0:ne.state)==="processing"||((ie=(ae=e.modelValue)==null?void 0:ae.response)==null?void 0:ie.state)==="pending"?(r(),p("div",mo,[s(E,{closable:!1,class:"info"},{template:m(()=>[s(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),$(" "+l(e.$t("luma.name.failure")),1)]),default:m(()=>{var I,b;return[i("p",po,[s(f,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+l(e.$t("luma.name.taskId"))+": "+l((I=e.modelValue)==null?void 0:I.id)+" ",1),s(S,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0)])])}var fo=k(Yt,[["render",_o],["__scopeId","data-v-077795a0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/task/Preview.vue"]]);const ho=w({name:"RecentPanel",components:{TaskPreview:fo,ElSkeleton:Pe,ElSkeletonItem:Ne},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,t,o,a;return{...(e=this.$store.state.luma)==null?void 0:e.tasks,items:(a=(o=(t=this.$store.state.luma)==null?void 0:t.tasks)==null?void 0:o.items)==null?void 0:a.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),vo={key:0,class:"tasks"},go={class:"left"},$o={class:"main"},yo={key:1,class:"tasks"},bo={key:2,class:"description"};function ko(e,t,o,a,h,g){var _,f,S,E,N,U,C,L;const c=n("el-skeleton-item"),u=n("el-skeleton"),d=n("task-preview");return r(),p("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...V)=>e.onHandleScroll&&e.onHandleScroll(...V))},[((_=e.tasks)==null?void 0:_.items)===void 0?(r(),p("div",vo,[(r(),p(fe,null,he(3,V=>i("div",{key:V,class:"task placeholder"},[i("div",go,[s(u,{animated:""},{template:m(()=>[s(c,{variant:"image",class:"avatar"})]),_:1})]),i("div",$o,[s(u,{animated:""},{template:m(()=>[s(c,{variant:"p",class:"title"}),s(c,{variant:"image",class:"icon"})]),_:1})])])),64))])):((S=(f=e.tasks)==null?void 0:f.items)==null?void 0:S.length)&&((N=(E=e.tasks)==null?void 0:E.items)==null?void 0:N.length)>0?(r(),p("div",yo,[(r(!0),p(fe,null,he((U=e.tasks)==null?void 0:U.items,(V,A)=>(r(),P(d,{key:A,"model-value":V,class:"preview"},null,8,["model-value"]))),128))])):v("v-if",!0),((L=(C=e.tasks)==null?void 0:C.items)==null?void 0:L.length)===0?(r(),p("p",bo,l(e.$t("luma.message.noTasks")),1)):v("v-if",!0)],544)}var wo=k(ho,[["render",ko],["__scopeId","data-v-2f8302a7"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/RecentPanel.vue"]]);const Io="https://webhook.acedata.cloud/luma",Vo=w({name:"LumaIndex",components:{ConfigPanel:Ft,Layout:Me,ApplicationStatus:Ae,RecentPanel:wo},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,t;return((t=(e=this.$store.state.luma)==null?void 0:e.status)==null?void 0:t.getApplications)===q.Request},service(){return this.$store.state.luma.service},credential(){return this.$store.state.luma.credential},config(){return this.$store.state.luma.config},initializing(){return this.$store.state.luma.status.getApplications===q.Request},needApply(){return this.$store.state.luma.status.getApplications===q.Success&&!this.application},application(){return this.$store.state.luma.application},applications(){return this.$store.state.luma.applications},tasks(){return this.$store.state.luma.tasks}},watch:{tasks:{handler(e,t){var o,a;((o=e==null?void 0:e.items)==null?void 0:o.length)>((a=t==null?void 0:t.items)==null?void 0:a.length)&&console.debug("new tasks detected")},deep:!0}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onScrollDown(),await this.onGetTasks(),this.job=setInterval(()=>{this.onGetTasks()},5e3)},async unmounted(){clearInterval(this.job),clearInterval(this.timer)},methods:{async onReachTop(){var e,t,o;console.debug("reached top"),await this.onGetTasks({createdAtMax:(o=(t=(e=this.tasks)==null?void 0:e.items)==null?void 0:t[0])==null?void 0:o.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("luma/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("luma/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){ke.create({application:this.application}).then(({data:e})=>{this.application=e,y.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var t,o;((o=(t=e==null?void 0:e.response)==null?void 0:t.data)==null?void 0:o.code)===we&&y.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},500)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:o,createdAtMax:a}=e||{};console.debug("limit",t,"createdAtMin",o,"createdAtMax",a),await this.$store.dispatch("luma/getTasks",{limit:t,createdAtMin:o,createdAtMax:a})},async onGenerateVideo(){var o;const e={...this.config,callback_url:Io},t=(o=this.credential)==null?void 0:o.token;if(!t){console.error("no token specified");return}y.info(this.$t("luma.message.startingTask")),Ie.generate(e,{token:t}).then(()=>{y.success(this.$t("luma.message.startTaskSuccess")),this.$store.commit("luma/setConfig",{config:void 0})}).catch(a=>{var g,c;const h=(g=a==null?void 0:a.response)==null?void 0:g.data;((c=h==null?void 0:h.error)==null?void 0:c.code)===Ve?y.error(this.$t("luma.message.usedUp")):y.error(this.$t("luma.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function So(e,t,o,a,h,g){const c=n("config-panel"),u=n("application-status"),d=n("recent-panel"),_=n("layout");return r(),P(_,null,{config:m(()=>[s(c,{onGenerate:e.onGenerateVideo},null,8,["onGenerate"])]),result:m(()=>[s(u,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication,onSelect:t[0]||(t[0]=f=>e.$store.dispatch("luma/setApplication",f))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),s(d,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"]),v(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var zo=k(Vo,[["render",So],["__scopeId","data-v-c45e0af8"],["__file","/home/runner/work/Nexior/Nexior/src/pages/luma/Index.vue"]]);export{zo as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ae as ne}from"./vendor-others.2105a885.js";import{ar as z}from"./vendor-fortawesome.fe21f86d.js";import{V as ie}from"./VideoNavigator.6d07cfaa.js";import{_ as S,aW as le,Y as re,a2 as O,F as ce,af as ue,aX as pe,W as de}from"./index.a3bc0f28.js";import{S as me,l as D,K as _e,L as he,O as fe,J as I,N as ge,s as $e,B as ve,t as ye,y as ke,Y as we}from"./vendor-element-plus.6158e0fe.js";import{H as V,al as n,o as l,e as m,f as u,V as s,I as M,M as h,T as c,U as N,ai as G,L as E,S as y,R as v,P as L}from"./vendor-@vue.66ea933c.js";import{I as ae}from"./InfoIcon.0718f348.js";import{A as be}from"./Status.dd04dd16.js";import{C as Ie}from"./CopyToClipboard.6e4cac07.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.46bc4fb1.js";const Se=V({name:"LayoutHailuo",components:{ElDrawer:me,ElButton:D,FontAwesomeIcon:z,VideoNavigator:ie},data(){return{drawer:!1}}}),Ve={class:"main"},Pe={class:"config"},Ae={class:"result"};function Ee(e,t,o,a,f,$){const p=n("video-navigator"),d=n("font-awesome-icon"),r=n("el-button"),g=n("el-drawer");return l(),m("div",Ve,[u("div",Pe,[s(p),M(e.$slots,"config",{},void 0,!0)]),u("div",Ae,[M(e.$slots,"result",{},void 0,!0)]),s(r,{round:"",class:"menu",onClick:t[0]||(t[0]=_=>e.drawer=!0)},{default:h(()=>[s(d,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),s(g,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=_=>e.drawer=_),"with-header":!1,size:"340px",class:"drawer"},{default:h(()=>[M(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Te=S(Se,[["render",Ee],["__scopeId","data-v-3c8363f5"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Hailuo.vue"]]);const Ce=V({name:"ModelSelector",components:{ElSelect:_e,ElOption:he},data(){return{}},computed:{options(){return[{value:"minimax-t2v",label:this.$t("hailuo.button.model1")},{value:"minimax-i2v",label:this.$t("hailuo.button.model2")}]},value:{get(){var e,t;return(t=(e=this.$store.state.hailuo)==null?void 0:e.config)==null?void 0:t.model},set(e){var t;this.$store.commit("hailuo/setConfig",{...(t=this.$store.state.hailuo)==null?void 0:t.config,model:e})}}},mounted(){this.value||(this.value=le)}}),Ue={class:"field"},Re={class:"title font-bold"},Ne={class:"float-left"};function Ge(e,t,o,a,f,$){const p=n("el-option"),d=n("el-select");return l(),m("div",Ue,[u("h2",Re,c(e.$t("hailuo.name.model")),1),s(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),class:"value",placeholder:e.$t("hailuo.placeholder.select"),clearable:""},{default:h(()=>[(l(!0),m(N,null,G(e.options,r=>(l(),E(p,{key:r.value,label:r.label,value:r.value},{default:h(()=>[u("span",Ne,c(r.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var De=S(Ce,[["render",Ge],["__scopeId","data-v-62190314"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/ModelSelector.vue"]]);const Le=V({name:"StartImageUrlInput",components:{ElUpload:fe,ElButton:D,InfoIcon:ae},data(){return{fileList:[],uploadUrl:re()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>{var t;return(t=e==null?void 0:e.response)==null?void 0:t.file_url})},value:{get(){var e,t;return(t=(e=this.$store.state.hailuo)==null?void 0:e.config)==null?void 0:t.first_image_url},set(e){var o,a;const t=(o=this.urls)==null?void 0:o[0];this.$store.commit("hailuo/setConfig",{...(a=this.$store.state.hailuo)==null?void 0:a.config,first_image_url:t})}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){I.warning(this.$t("hailuo.message.uploadStartImageExceed"))},onError(){I.error(this.$t("hailuo.message.uploadStartImageError"))},async onRemove(){I.error(this.$t("hailuo.message.uploadStartImageError"))},onSetStartImageUrl(){var t,o;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("hailuo/setConfig",{...(o=this.$store.state.hailuo)==null?void 0:o.config,first_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),Oe={class:"field"},Me={class:"title font-bold"},ze={class:"upload-wrapper"};function qe(e,t,o,a,f,$){const p=n("el-button"),d=n("el-upload"),r=n("info-icon");return l(),m("div",Oe,[u("h2",Me,c(e.$t("hailuo.name.startImageUrl")),1),u("div",ze,[s(d,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=g=>e.fileList=g),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-remove":e.onRemove,"on-success":e.onSuccess,headers:e.headers},{default:h(()=>[s(p,{size:"small",type:"primary",round:""},{default:h(()=>[y(c(e.$t("hailuo.button.uploadStartImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-remove","on-success","headers"])]),s(r,{content:e.$t("hailuo.description.startImageUrl"),class:"info"},null,8,["content"])])}var Be=S(Le,[["render",qe],["__scopeId","data-v-6c6b80d0"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/StartImageUrlInput.vue"]]);const He="",je=V({name:"PromptInput",components:{ElInput:ge,InfoIcon:ae},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.hailuo)==null?void 0:e.config)==null?void 0:t.prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("hailuo/setConfig",{...(t=this.$store.state.hailuo)==null?void 0:t.config,prompt:e})}}},mounted(){this.value||(this.value=He)}}),Fe={class:"field"},Ke={class:"box"},We={class:"title font-bold"};function Ye(e,t,o,a,f,$){const p=n("info-icon"),d=n("el-input");return l(),m("div",Fe,[u("div",Ke,[u("h2",We,c(e.$t("hailuo.name.prompt")),1),s(p,{content:e.$t("hailuo.description.prompt"),class:"info"},null,8,["content"])]),s(d,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("hailuo.placeholder.prompt"),maxlength:300,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var Je=S(je,[["render",Ye],["__scopeId","data-v-d785889c"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/PromptInput.vue"]]);const Xe=V({name:"PresetPanel",components:{ElButton:D,FontAwesomeIcon:z,PromptInput:Je,StartImageUrlInput:Be,ModelSelector:De},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.hailuo)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Qe={class:"panel"},Ze={class:"config"},xe={class:"actions"};function et(e,t,o,a,f,$){var k,b,i;const p=n("prompt-input"),d=n("model-selector"),r=n("start-image-url-input"),g=n("font-awesome-icon"),_=n("el-button");return l(),m("div",Qe,[u("div",Ze,[s(p,{class:"mb-4"}),s(d,{class:"mb-4"}),((k=e.config)==null?void 0:k.model)==="minimax-i2v"?(l(),E(r,{key:0,class:"mb-4"})):v("v-if",!0),u("div",xe,[((b=e.config)==null?void 0:b.video_url)!==void 0||((i=e.config)==null?void 0:i.custom)?(l(),E(_,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[s(g,{icon:"fa-solid fa-magic",class:"mr-2"}),y(" "+c(e.$t("hailuo.button.extend")),1)]),_:1},8,["onClick"])):(l(),E(_,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[s(g,{icon:"fa-solid fa-magic",class:"mr-2"}),y(" "+c(e.$t("hailuo.button.generate")),1)]),_:1},8,["onClick"]))])])])}var tt=S(Xe,[["render",et],["__scopeId","data-v-01eef439"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/ConfigPanel.vue"]]);const ot=V({name:"VideoPlayer",components:{VuePlyr:ne},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),st=["data-poster"],at=["src"];function nt(e,t,o,a,f,$){const p=n("vue-plyr");return l(),m("div",null,[s(p,{options:e.options,class:"video"},{default:h(()=>{var d,r;return[u("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(d=e.modelValue)==null?void 0:d.image_url},[u("source",{size:"1080",src:(r=e.modelValue)==null?void 0:r.video_url,type:"video/mp4"},null,8,at)],8,st)]}),_:1},8,["options"])])}var it=S(ot,[["render",nt],["__scopeId","data-v-11ad7a93"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/VideoPlayer.vue"]]);const lt=V({name:"TaskPreview",components:{ElImage:$e,CopyToClipboard:Ie,FontAwesomeIcon:z,ElAlert:ve,VideoPlayer:it,ElTooltip:ye,ElButton:D},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.hailuo)==null?void 0:e.application},config(){var e;return(e=this.$store.state.hailuo)==null?void 0:e.config},videos(){var o,a,f,$,p,d,r;let e=[];const t=(a=(o=this.modelValue)==null?void 0:o.request)==null?void 0:a.action;return Array.isArray(($=(f=this.modelValue)==null?void 0:f.response)==null?void 0:$.data)&&((r=(d=(p=this.modelValue)==null?void 0:p.response)==null?void 0:d.data)==null||r.forEach(g=>{let _=g;t&&(_.action=t),e.push(_)})),e}},methods:{onExtend(e,t){var o;e.stopPropagation(),console.debug("set config",t),this.$store.commit("hailuo/setConfig",{...(o=this.$store.state.hailuo)==null?void 0:o.config,video_id:t.video_id,prompt:t.prompt,action:"extend",thumbnail_url:t.thumbnail_url,video_url:t.video_url})},onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onReload(e){const t=e.target,o=new URL(t.src),a=o.searchParams.get("retry");if(!a)o.searchParams.set("retry","1");else if(parseInt(a)<2)o.searchParams.set("retry",(parseInt(a)+1).toString());else return;t.src=o.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),rt={class:"left"},ct={class:"main"},ut={class:"bot"},pt={class:"datetime"},dt={class:"info"},mt={key:0,class:"prompt mt-2"},_t={key:0},ht={key:1},ft={key:0,class:L({content:!0,failed:!0})},gt={class:"image-wrapper"},$t={key:0,class:L({operations:!0,"mt-2":!0})},vt={class:"description"},yt={key:1,class:L({content:!0})},kt={class:"description"},wt={class:"description"},bt={class:"description"},It={key:2,class:L({content:!0})},St={class:"description"};function Vt(e,t,o,a,f,$){const p=n("el-image"),d=n("VideoPlayer"),r=n("el-button"),g=n("el-tooltip"),_=n("font-awesome-icon"),k=n("copy-to-clipboard"),b=n("el-alert");return l(!0),m(N,null,G(e.videos,(i,U)=>{var T,C,P,R,q,B,H,j,F,K,W;return l(),m("div",{key:U,class:"preview"},[u("div",rt,[s(p,{src:"https://cdn.acedata.cloud/4tfwwz.png",class:"avatar"})]),u("div",ct,[u("div",ut,[y(c(e.$t("hailuo.name.hailuoBot"))+" ",1),u("span",pt,c(e.$dayjs.format(""+new Date(parseFloat(((T=e.modelValue)==null?void 0:T.created_at)||"")*1e3))),1)]),u("div",dt,[(P=(C=e.modelValue)==null?void 0:C.request)!=null&&P.prompt?(l(),m("p",mt,[y(c((q=(R=e.modelValue)==null?void 0:R.request)==null?void 0:q.prompt)+" ",1),(B=e.modelValue)!=null&&B.response?v("v-if",!0):(l(),m("span",_t," - ("+c(e.$t("hailuo.status.pending"))+") ",1)),(i==null?void 0:i.state)==="processing"||(i==null?void 0:i.state)==="pending"||(i==null?void 0:i.state)==="running"?(l(),m("span",ht," - ("+c(e.$t("hailuo.status.processing"))+") ",1)):v("v-if",!0)])):v("v-if",!0)]),v(" Display success message "),((j=(H=e.modelValue)==null?void 0:H.response)==null?void 0:j.success)===!0?(l(),m("div",ft,[u("div",gt,[s(d,{"model-value":i},null,8,["model-value"])]),i?(l(),m("div",$t,[s(g,{class:"box-item",effect:"dark",content:e.$t("hailuo.message.downloadVideo"),placement:"top-start"},{default:h(()=>[s(r,{type:"info",size:"small",class:"btn-action",onClick:w=>e.onDownload(w,i==null?void 0:i.video_url)},{default:h(()=>[y(c(e.$t("hailuo.button.download")),1)]),_:2},1032,["onClick"])]),_:2},1032,["content"])])):v("v-if",!0),s(b,{closable:!1,class:"mt-2 success"},{default:h(()=>{var w,A;return[u("p",vt,[s(_,{icon:"fa-solid fa-magic",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.taskId"))+": "+c((w=e.modelValue)==null?void 0:w.id)+" ",1),s(k,{content:(A=e.modelValue)==null?void 0:A.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0),v(" Display error message "),((K=(F=e.modelValue)==null?void 0:F.response)==null?void 0:K.success)===!1?(l(),m("div",yt,[s(b,{closable:!1,class:"failure"},{template:h(()=>[s(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.failure")),1)]),default:h(()=>{var w,A,Y,J,X,Q,Z,x,ee,te,oe,se;return[u("p",kt,[s(_,{icon:"fa-solid fa-magic",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.taskId"))+": "+c((w=e.modelValue)==null?void 0:w.id)+" ",1),s(k,{content:(A=e.modelValue)==null?void 0:A.id,class:"btn-copy"},null,8,["content"])]),u("p",wt,[s(_,{icon:"fa-solid fa-circle-info",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.failureReason"))+": "+c((X=(J=(Y=e.modelValue)==null?void 0:Y.response)==null?void 0:J.error)==null?void 0:X.message)+" ",1),s(k,{content:(x=(Z=(Q=e.modelValue)==null?void 0:Q.response)==null?void 0:Z.error)==null?void 0:x.message,class:"btn-copy"},null,8,["content"])]),u("p",bt,[s(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.traceId"))+": "+c((te=(ee=e.modelValue)==null?void 0:ee.response)==null?void 0:te.trace_id)+" ",1),s(k,{content:(se=(oe=e.modelValue)==null?void 0:oe.response)==null?void 0:se.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0),v(" Display error message "),!((W=e.modelValue)!=null&&W.response)||(i==null?void 0:i.state)==="processing"||(i==null?void 0:i.state)==="pending"||(i==null?void 0:i.state)==="running"?(l(),m("div",It,[s(b,{closable:!1,class:"info"},{template:h(()=>[s(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.failure")),1)]),default:h(()=>{var w,A;return[u("p",St,[s(_,{icon:"fa-solid fa-magic",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.taskId"))+": "+c((w=e.modelValue)==null?void 0:w.id)+" ",1),s(k,{content:(A=e.modelValue)==null?void 0:A.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0)])])}),128)}var Pt=S(lt,[["render",Vt],["__scopeId","data-v-3f5aedb7"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/task/Preview.vue"]]);const At=V({name:"RecentPanel",components:{TaskPreview:Pt,ElSkeleton:ke,ElSkeletonItem:we},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,t,o,a;return{...(e=this.$store.state.hailuo)==null?void 0:e.tasks,items:(a=(o=(t=this.$store.state.hailuo)==null?void 0:t.tasks)==null?void 0:o.items)==null?void 0:a.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),Et={key:0,class:"tasks"},Tt={class:"left"},Ct={class:"main"},Ut={key:1,class:"tasks"},Rt={key:2,class:"description"};function Nt(e,t,o,a,f,$){var g,_,k,b,i,U,T,C;const p=n("el-skeleton-item"),d=n("el-skeleton"),r=n("task-preview");return l(),m("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...P)=>e.onHandleScroll&&e.onHandleScroll(...P))},[((g=e.tasks)==null?void 0:g.items)===void 0?(l(),m("div",Et,[(l(),m(N,null,G(3,P=>u("div",{key:P,class:"task placeholder"},[u("div",Tt,[s(d,{animated:""},{template:h(()=>[s(p,{variant:"image",class:"avatar"})]),_:1})]),u("div",Ct,[s(d,{animated:""},{template:h(()=>[s(p,{variant:"p",class:"title"}),s(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):((k=(_=e.tasks)==null?void 0:_.items)==null?void 0:k.length)&&((i=(b=e.tasks)==null?void 0:b.items)==null?void 0:i.length)>0?(l(),m("div",Ut,[(l(!0),m(N,null,G((U=e.tasks)==null?void 0:U.items,(P,R)=>(l(),E(r,{key:R,"model-value":P,class:"preview"},null,8,["model-value"]))),128))])):v("v-if",!0),((C=(T=e.tasks)==null?void 0:T.items)==null?void 0:C.length)===0?(l(),m("p",Rt,c(e.$t("hailuo.message.noTasks")),1)):v("v-if",!0)],544)}var Gt=S(At,[["render",Nt],["__scopeId","data-v-7bff9d40"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/RecentPanel.vue"]]);const Dt="https://webhook.acedata.cloud/hailuo",Lt=V({name:"HailuoIndex",components:{ConfigPanel:tt,Layout:Te,ApplicationStatus:be,RecentPanel:Gt},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,t;return((t=(e=this.$store.state.hailuo)==null?void 0:e.status)==null?void 0:t.getApplications)===O.Request},service(){return this.$store.state.hailuo.service},credential(){return this.$store.state.hailuo.credential},config(){return this.$store.state.hailuo.config},initializing(){return this.$store.state.hailuo.status.getApplications===O.Request},needApply(){return this.$store.state.hailuo.status.getApplications===O.Success&&!this.application},application(){return this.$store.state.hailuo.application},applications(){return this.$store.state.hailuo.applications},tasks(){return this.$store.state.hailuo.tasks}},watch:{tasks:{handler(e,t){var o,a;((o=e==null?void 0:e.items)==null?void 0:o.length)>((a=t==null?void 0:t.items)==null?void 0:a.length)&&console.debug("new tasks detected")},deep:!0}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onScrollDown(),await this.onGetTasks(),await this.onScrollDown(),this.job=setInterval(()=>{this.onGetTasks()},5e3)},async unmounted(){clearInterval(this.job),clearInterval(this.timer)},methods:{async onReachTop(){var e,t,o;console.debug("reached top"),await this.onGetTasks({createdAtMax:(o=(t=(e=this.tasks)==null?void 0:e.items)==null?void 0:t[0])==null?void 0:o.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("hailuo/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("hailuo/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){ce.create({application:this.application}).then(({data:e})=>{this.application=e,I.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var t,o;((o=(t=e==null?void 0:e.response)==null?void 0:t.data)==null?void 0:o.code)===ue&&I.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},500)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:o,createdAtMax:a}=e||{};console.debug("limit",t,"createdAtMin",o,"createdAtMax",a),await this.$store.dispatch("hailuo/getTasks",{limit:t,createdAtMin:o,createdAtMax:a})},async onGenerateVideo(){var o;const e={...this.config,callback_url:Dt},t=(o=this.credential)==null?void 0:o.token;if(!t){console.error("no token specified");return}I.info(this.$t("hailuo.message.startingTask")),pe.generate(e,{token:t}).then(()=>{I.success(this.$t("hailuo.message.startTaskSuccess")),this.$store.commit("hailuo/setConfig",{config:void 0})}).catch(a=>{var $,p;const f=($=a==null?void 0:a.response)==null?void 0:$.data;((p=f==null?void 0:f.error)==null?void 0:p.code)===de?I.error(this.$t("hailuo.message.usedUp")):I.error(this.$t("hailuo.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Ot(e,t,o,a,f,$){const p=n("config-panel"),d=n("application-status"),r=n("recent-panel"),g=n("layout");return l(),E(g,null,{config:h(()=>[s(p,{onGenerate:e.onGenerateVideo},null,8,["onGenerate"])]),result:h(()=>[s(d,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication,onSelect:t[0]||(t[0]=_=>e.$store.dispatch("hailuo/setApplication",_))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),s(r,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"]),v(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var Xt=S(Lt,[["render",Ot],["__scopeId","data-v-1f8aa246"],["__file","/home/runner/work/Nexior/Nexior/src/pages/hailuo/Index.vue"]]);export{Xt as default};
|
|
1
|
+
import{ae as ne}from"./vendor-others.2105a885.js";import{ar as z}from"./vendor-fortawesome.fe21f86d.js";import{V as ie}from"./VideoNavigator.c157aa03.js";import{_ as S,aW as le,Y as re,a2 as O,F as ce,af as ue,aX as pe,W as de}from"./index.e160e9a8.js";import{S as me,l as D,K as _e,L as he,O as fe,J as I,N as ge,s as $e,B as ve,t as ye,y as ke,Y as we}from"./vendor-element-plus.6158e0fe.js";import{H as V,al as n,o as l,e as m,f as u,V as s,I as M,M as h,T as c,U as N,ai as G,L as E,S as y,R as v,P as L}from"./vendor-@vue.66ea933c.js";import{I as ae}from"./InfoIcon.329799b2.js";import{A as be}from"./Status.546232e5.js";import{C as Ie}from"./CopyToClipboard.d2c28170.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.46bc4fb1.js";const Se=V({name:"LayoutHailuo",components:{ElDrawer:me,ElButton:D,FontAwesomeIcon:z,VideoNavigator:ie},data(){return{drawer:!1}}}),Ve={class:"main"},Pe={class:"config"},Ae={class:"result"};function Ee(e,t,o,a,f,$){const p=n("video-navigator"),d=n("font-awesome-icon"),r=n("el-button"),g=n("el-drawer");return l(),m("div",Ve,[u("div",Pe,[s(p),M(e.$slots,"config",{},void 0,!0)]),u("div",Ae,[M(e.$slots,"result",{},void 0,!0)]),s(r,{round:"",class:"menu",onClick:t[0]||(t[0]=_=>e.drawer=!0)},{default:h(()=>[s(d,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),s(g,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=_=>e.drawer=_),"with-header":!1,size:"340px",class:"drawer"},{default:h(()=>[M(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Te=S(Se,[["render",Ee],["__scopeId","data-v-3c8363f5"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Hailuo.vue"]]);const Ce=V({name:"ModelSelector",components:{ElSelect:_e,ElOption:he},data(){return{}},computed:{options(){return[{value:"minimax-t2v",label:this.$t("hailuo.button.model1")},{value:"minimax-i2v",label:this.$t("hailuo.button.model2")}]},value:{get(){var e,t;return(t=(e=this.$store.state.hailuo)==null?void 0:e.config)==null?void 0:t.model},set(e){var t;this.$store.commit("hailuo/setConfig",{...(t=this.$store.state.hailuo)==null?void 0:t.config,model:e})}}},mounted(){this.value||(this.value=le)}}),Ue={class:"field"},Re={class:"title font-bold"},Ne={class:"float-left"};function Ge(e,t,o,a,f,$){const p=n("el-option"),d=n("el-select");return l(),m("div",Ue,[u("h2",Re,c(e.$t("hailuo.name.model")),1),s(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),class:"value",placeholder:e.$t("hailuo.placeholder.select"),clearable:""},{default:h(()=>[(l(!0),m(N,null,G(e.options,r=>(l(),E(p,{key:r.value,label:r.label,value:r.value},{default:h(()=>[u("span",Ne,c(r.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var De=S(Ce,[["render",Ge],["__scopeId","data-v-62190314"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/ModelSelector.vue"]]);const Le=V({name:"StartImageUrlInput",components:{ElUpload:fe,ElButton:D,InfoIcon:ae},data(){return{fileList:[],uploadUrl:re()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>{var t;return(t=e==null?void 0:e.response)==null?void 0:t.file_url})},value:{get(){var e,t;return(t=(e=this.$store.state.hailuo)==null?void 0:e.config)==null?void 0:t.first_image_url},set(e){var o,a;const t=(o=this.urls)==null?void 0:o[0];this.$store.commit("hailuo/setConfig",{...(a=this.$store.state.hailuo)==null?void 0:a.config,first_image_url:t})}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){I.warning(this.$t("hailuo.message.uploadStartImageExceed"))},onError(){I.error(this.$t("hailuo.message.uploadStartImageError"))},async onRemove(){I.error(this.$t("hailuo.message.uploadStartImageError"))},onSetStartImageUrl(){var t,o;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("hailuo/setConfig",{...(o=this.$store.state.hailuo)==null?void 0:o.config,first_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),Oe={class:"field"},Me={class:"title font-bold"},ze={class:"upload-wrapper"};function qe(e,t,o,a,f,$){const p=n("el-button"),d=n("el-upload"),r=n("info-icon");return l(),m("div",Oe,[u("h2",Me,c(e.$t("hailuo.name.startImageUrl")),1),u("div",ze,[s(d,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=g=>e.fileList=g),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-remove":e.onRemove,"on-success":e.onSuccess,headers:e.headers},{default:h(()=>[s(p,{size:"small",type:"primary",round:""},{default:h(()=>[y(c(e.$t("hailuo.button.uploadStartImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-remove","on-success","headers"])]),s(r,{content:e.$t("hailuo.description.startImageUrl"),class:"info"},null,8,["content"])])}var Be=S(Le,[["render",qe],["__scopeId","data-v-6c6b80d0"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/StartImageUrlInput.vue"]]);const He="",je=V({name:"PromptInput",components:{ElInput:ge,InfoIcon:ae},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.hailuo)==null?void 0:e.config)==null?void 0:t.prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("hailuo/setConfig",{...(t=this.$store.state.hailuo)==null?void 0:t.config,prompt:e})}}},mounted(){this.value||(this.value=He)}}),Fe={class:"field"},Ke={class:"box"},We={class:"title font-bold"};function Ye(e,t,o,a,f,$){const p=n("info-icon"),d=n("el-input");return l(),m("div",Fe,[u("div",Ke,[u("h2",We,c(e.$t("hailuo.name.prompt")),1),s(p,{content:e.$t("hailuo.description.prompt"),class:"info"},null,8,["content"])]),s(d,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("hailuo.placeholder.prompt"),maxlength:300,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var Je=S(je,[["render",Ye],["__scopeId","data-v-d785889c"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/PromptInput.vue"]]);const Xe=V({name:"PresetPanel",components:{ElButton:D,FontAwesomeIcon:z,PromptInput:Je,StartImageUrlInput:Be,ModelSelector:De},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.hailuo)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Qe={class:"panel"},Ze={class:"config"},xe={class:"actions"};function et(e,t,o,a,f,$){var k,b,i;const p=n("prompt-input"),d=n("model-selector"),r=n("start-image-url-input"),g=n("font-awesome-icon"),_=n("el-button");return l(),m("div",Qe,[u("div",Ze,[s(p,{class:"mb-4"}),s(d,{class:"mb-4"}),((k=e.config)==null?void 0:k.model)==="minimax-i2v"?(l(),E(r,{key:0,class:"mb-4"})):v("v-if",!0),u("div",xe,[((b=e.config)==null?void 0:b.video_url)!==void 0||((i=e.config)==null?void 0:i.custom)?(l(),E(_,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[s(g,{icon:"fa-solid fa-magic",class:"mr-2"}),y(" "+c(e.$t("hailuo.button.extend")),1)]),_:1},8,["onClick"])):(l(),E(_,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[s(g,{icon:"fa-solid fa-magic",class:"mr-2"}),y(" "+c(e.$t("hailuo.button.generate")),1)]),_:1},8,["onClick"]))])])])}var tt=S(Xe,[["render",et],["__scopeId","data-v-01eef439"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/ConfigPanel.vue"]]);const ot=V({name:"VideoPlayer",components:{VuePlyr:ne},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),st=["data-poster"],at=["src"];function nt(e,t,o,a,f,$){const p=n("vue-plyr");return l(),m("div",null,[s(p,{options:e.options,class:"video"},{default:h(()=>{var d,r;return[u("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(d=e.modelValue)==null?void 0:d.image_url},[u("source",{size:"1080",src:(r=e.modelValue)==null?void 0:r.video_url,type:"video/mp4"},null,8,at)],8,st)]}),_:1},8,["options"])])}var it=S(ot,[["render",nt],["__scopeId","data-v-11ad7a93"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/VideoPlayer.vue"]]);const lt=V({name:"TaskPreview",components:{ElImage:$e,CopyToClipboard:Ie,FontAwesomeIcon:z,ElAlert:ve,VideoPlayer:it,ElTooltip:ye,ElButton:D},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.hailuo)==null?void 0:e.application},config(){var e;return(e=this.$store.state.hailuo)==null?void 0:e.config},videos(){var o,a,f,$,p,d,r;let e=[];const t=(a=(o=this.modelValue)==null?void 0:o.request)==null?void 0:a.action;return Array.isArray(($=(f=this.modelValue)==null?void 0:f.response)==null?void 0:$.data)&&((r=(d=(p=this.modelValue)==null?void 0:p.response)==null?void 0:d.data)==null||r.forEach(g=>{let _=g;t&&(_.action=t),e.push(_)})),e}},methods:{onExtend(e,t){var o;e.stopPropagation(),console.debug("set config",t),this.$store.commit("hailuo/setConfig",{...(o=this.$store.state.hailuo)==null?void 0:o.config,video_id:t.video_id,prompt:t.prompt,action:"extend",thumbnail_url:t.thumbnail_url,video_url:t.video_url})},onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onReload(e){const t=e.target,o=new URL(t.src),a=o.searchParams.get("retry");if(!a)o.searchParams.set("retry","1");else if(parseInt(a)<2)o.searchParams.set("retry",(parseInt(a)+1).toString());else return;t.src=o.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),rt={class:"left"},ct={class:"main"},ut={class:"bot"},pt={class:"datetime"},dt={class:"info"},mt={key:0,class:"prompt mt-2"},_t={key:0},ht={key:1},ft={key:0,class:L({content:!0,failed:!0})},gt={class:"image-wrapper"},$t={key:0,class:L({operations:!0,"mt-2":!0})},vt={class:"description"},yt={key:1,class:L({content:!0})},kt={class:"description"},wt={class:"description"},bt={class:"description"},It={key:2,class:L({content:!0})},St={class:"description"};function Vt(e,t,o,a,f,$){const p=n("el-image"),d=n("VideoPlayer"),r=n("el-button"),g=n("el-tooltip"),_=n("font-awesome-icon"),k=n("copy-to-clipboard"),b=n("el-alert");return l(!0),m(N,null,G(e.videos,(i,U)=>{var T,C,P,R,q,B,H,j,F,K,W;return l(),m("div",{key:U,class:"preview"},[u("div",rt,[s(p,{src:"https://cdn.acedata.cloud/4tfwwz.png",class:"avatar"})]),u("div",ct,[u("div",ut,[y(c(e.$t("hailuo.name.hailuoBot"))+" ",1),u("span",pt,c(e.$dayjs.format(""+new Date(parseFloat(((T=e.modelValue)==null?void 0:T.created_at)||"")*1e3))),1)]),u("div",dt,[(P=(C=e.modelValue)==null?void 0:C.request)!=null&&P.prompt?(l(),m("p",mt,[y(c((q=(R=e.modelValue)==null?void 0:R.request)==null?void 0:q.prompt)+" ",1),(B=e.modelValue)!=null&&B.response?v("v-if",!0):(l(),m("span",_t," - ("+c(e.$t("hailuo.status.pending"))+") ",1)),(i==null?void 0:i.state)==="processing"||(i==null?void 0:i.state)==="pending"||(i==null?void 0:i.state)==="running"?(l(),m("span",ht," - ("+c(e.$t("hailuo.status.processing"))+") ",1)):v("v-if",!0)])):v("v-if",!0)]),v(" Display success message "),((j=(H=e.modelValue)==null?void 0:H.response)==null?void 0:j.success)===!0?(l(),m("div",ft,[u("div",gt,[s(d,{"model-value":i},null,8,["model-value"])]),i?(l(),m("div",$t,[s(g,{class:"box-item",effect:"dark",content:e.$t("hailuo.message.downloadVideo"),placement:"top-start"},{default:h(()=>[s(r,{type:"info",size:"small",class:"btn-action",onClick:w=>e.onDownload(w,i==null?void 0:i.video_url)},{default:h(()=>[y(c(e.$t("hailuo.button.download")),1)]),_:2},1032,["onClick"])]),_:2},1032,["content"])])):v("v-if",!0),s(b,{closable:!1,class:"mt-2 success"},{default:h(()=>{var w,A;return[u("p",vt,[s(_,{icon:"fa-solid fa-magic",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.taskId"))+": "+c((w=e.modelValue)==null?void 0:w.id)+" ",1),s(k,{content:(A=e.modelValue)==null?void 0:A.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0),v(" Display error message "),((K=(F=e.modelValue)==null?void 0:F.response)==null?void 0:K.success)===!1?(l(),m("div",yt,[s(b,{closable:!1,class:"failure"},{template:h(()=>[s(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.failure")),1)]),default:h(()=>{var w,A,Y,J,X,Q,Z,x,ee,te,oe,se;return[u("p",kt,[s(_,{icon:"fa-solid fa-magic",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.taskId"))+": "+c((w=e.modelValue)==null?void 0:w.id)+" ",1),s(k,{content:(A=e.modelValue)==null?void 0:A.id,class:"btn-copy"},null,8,["content"])]),u("p",wt,[s(_,{icon:"fa-solid fa-circle-info",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.failureReason"))+": "+c((X=(J=(Y=e.modelValue)==null?void 0:Y.response)==null?void 0:J.error)==null?void 0:X.message)+" ",1),s(k,{content:(x=(Z=(Q=e.modelValue)==null?void 0:Q.response)==null?void 0:Z.error)==null?void 0:x.message,class:"btn-copy"},null,8,["content"])]),u("p",bt,[s(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.traceId"))+": "+c((te=(ee=e.modelValue)==null?void 0:ee.response)==null?void 0:te.trace_id)+" ",1),s(k,{content:(se=(oe=e.modelValue)==null?void 0:oe.response)==null?void 0:se.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0),v(" Display error message "),!((W=e.modelValue)!=null&&W.response)||(i==null?void 0:i.state)==="processing"||(i==null?void 0:i.state)==="pending"||(i==null?void 0:i.state)==="running"?(l(),m("div",It,[s(b,{closable:!1,class:"info"},{template:h(()=>[s(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.failure")),1)]),default:h(()=>{var w,A;return[u("p",St,[s(_,{icon:"fa-solid fa-magic",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.taskId"))+": "+c((w=e.modelValue)==null?void 0:w.id)+" ",1),s(k,{content:(A=e.modelValue)==null?void 0:A.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0)])])}),128)}var Pt=S(lt,[["render",Vt],["__scopeId","data-v-3f5aedb7"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/task/Preview.vue"]]);const At=V({name:"RecentPanel",components:{TaskPreview:Pt,ElSkeleton:ke,ElSkeletonItem:we},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,t,o,a;return{...(e=this.$store.state.hailuo)==null?void 0:e.tasks,items:(a=(o=(t=this.$store.state.hailuo)==null?void 0:t.tasks)==null?void 0:o.items)==null?void 0:a.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),Et={key:0,class:"tasks"},Tt={class:"left"},Ct={class:"main"},Ut={key:1,class:"tasks"},Rt={key:2,class:"description"};function Nt(e,t,o,a,f,$){var g,_,k,b,i,U,T,C;const p=n("el-skeleton-item"),d=n("el-skeleton"),r=n("task-preview");return l(),m("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...P)=>e.onHandleScroll&&e.onHandleScroll(...P))},[((g=e.tasks)==null?void 0:g.items)===void 0?(l(),m("div",Et,[(l(),m(N,null,G(3,P=>u("div",{key:P,class:"task placeholder"},[u("div",Tt,[s(d,{animated:""},{template:h(()=>[s(p,{variant:"image",class:"avatar"})]),_:1})]),u("div",Ct,[s(d,{animated:""},{template:h(()=>[s(p,{variant:"p",class:"title"}),s(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):((k=(_=e.tasks)==null?void 0:_.items)==null?void 0:k.length)&&((i=(b=e.tasks)==null?void 0:b.items)==null?void 0:i.length)>0?(l(),m("div",Ut,[(l(!0),m(N,null,G((U=e.tasks)==null?void 0:U.items,(P,R)=>(l(),E(r,{key:R,"model-value":P,class:"preview"},null,8,["model-value"]))),128))])):v("v-if",!0),((C=(T=e.tasks)==null?void 0:T.items)==null?void 0:C.length)===0?(l(),m("p",Rt,c(e.$t("hailuo.message.noTasks")),1)):v("v-if",!0)],544)}var Gt=S(At,[["render",Nt],["__scopeId","data-v-7bff9d40"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/RecentPanel.vue"]]);const Dt="https://webhook.acedata.cloud/hailuo",Lt=V({name:"HailuoIndex",components:{ConfigPanel:tt,Layout:Te,ApplicationStatus:be,RecentPanel:Gt},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,t;return((t=(e=this.$store.state.hailuo)==null?void 0:e.status)==null?void 0:t.getApplications)===O.Request},service(){return this.$store.state.hailuo.service},credential(){return this.$store.state.hailuo.credential},config(){return this.$store.state.hailuo.config},initializing(){return this.$store.state.hailuo.status.getApplications===O.Request},needApply(){return this.$store.state.hailuo.status.getApplications===O.Success&&!this.application},application(){return this.$store.state.hailuo.application},applications(){return this.$store.state.hailuo.applications},tasks(){return this.$store.state.hailuo.tasks}},watch:{tasks:{handler(e,t){var o,a;((o=e==null?void 0:e.items)==null?void 0:o.length)>((a=t==null?void 0:t.items)==null?void 0:a.length)&&console.debug("new tasks detected")},deep:!0}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onScrollDown(),await this.onGetTasks(),await this.onScrollDown(),this.job=setInterval(()=>{this.onGetTasks()},5e3)},async unmounted(){clearInterval(this.job),clearInterval(this.timer)},methods:{async onReachTop(){var e,t,o;console.debug("reached top"),await this.onGetTasks({createdAtMax:(o=(t=(e=this.tasks)==null?void 0:e.items)==null?void 0:t[0])==null?void 0:o.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("hailuo/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("hailuo/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){ce.create({application:this.application}).then(({data:e})=>{this.application=e,I.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var t,o;((o=(t=e==null?void 0:e.response)==null?void 0:t.data)==null?void 0:o.code)===ue&&I.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},500)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:o,createdAtMax:a}=e||{};console.debug("limit",t,"createdAtMin",o,"createdAtMax",a),await this.$store.dispatch("hailuo/getTasks",{limit:t,createdAtMin:o,createdAtMax:a})},async onGenerateVideo(){var o;const e={...this.config,callback_url:Dt},t=(o=this.credential)==null?void 0:o.token;if(!t){console.error("no token specified");return}I.info(this.$t("hailuo.message.startingTask")),pe.generate(e,{token:t}).then(()=>{I.success(this.$t("hailuo.message.startTaskSuccess")),this.$store.commit("hailuo/setConfig",{config:void 0})}).catch(a=>{var $,p;const f=($=a==null?void 0:a.response)==null?void 0:$.data;((p=f==null?void 0:f.error)==null?void 0:p.code)===de?I.error(this.$t("hailuo.message.usedUp")):I.error(this.$t("hailuo.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Ot(e,t,o,a,f,$){const p=n("config-panel"),d=n("application-status"),r=n("recent-panel"),g=n("layout");return l(),E(g,null,{config:h(()=>[s(p,{onGenerate:e.onGenerateVideo},null,8,["onGenerate"])]),result:h(()=>[s(d,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication,onSelect:t[0]||(t[0]=_=>e.$store.dispatch("hailuo/setApplication",_))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),s(r,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"]),v(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var Xt=S(Lt,[["render",Ot],["__scopeId","data-v-1f8aa246"],["__file","/home/runner/work/Nexior/Nexior/src/pages/hailuo/Index.vue"]]);export{Xt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-others.2105a885.js";import{ar as H}from"./vendor-fortawesome.fe21f86d.js";import{_ as M}from"./index.
|
|
1
|
+
import"./vendor-others.2105a885.js";import{ar as H}from"./vendor-fortawesome.fe21f86d.js";import{_ as M}from"./index.e160e9a8.js";import{l as U,i as G,h as J,r as K,s as O}from"./vendor-element-plus.6158e0fe.js";import{H as P,al as p,e as c,f as s,V as e,M as i,R as m,o as u,T as n,S as h,U as Q,ai as W,L as X}from"./vendor-@vue.66ea933c.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.46bc4fb1.js";const Y=P({name:"Index",components:{ElButton:U,ElRow:G,ElCol:J,ElCard:K,ElImage:O,FontAwesomeIcon:H},data(){return{comments:[{avatar:"https://cdn.acedata.cloud/avatar1.png",name:this.$t("index.customers.name1"),job:this.$t("index.customers.job1"),content:this.$t("index.customers.comment1")},{avatar:"https://cdn.acedata.cloud/avatar2.png",name:this.$t("index.customers.name2"),job:this.$t("index.customers.job2"),content:this.$t("index.customers.comment2")},{avatar:"https://cdn.acedata.cloud/avatar3.png",name:this.$t("index.customers.name3"),job:this.$t("index.customers.job3"),content:this.$t("index.customers.comment3")}]}},computed:{site(){return this.$store.state.site},capabilities(){var t,a,C,w,j,q,r,o,y,d,k,x,_,f,b,$,v,g;return[...(C=(a=(t=this.site)==null?void 0:t.features)==null?void 0:a.chat)!=null&&C.enabled?[{title:this.$t("index.title.chat"),subtitle:this.$t("index.subtitle.chat"),icon:"fa-regular fa-comment",path:"/chat"}]:[],...(q=(j=(w=this.site)==null?void 0:w.features)==null?void 0:j.midjourney)!=null&&q.enabled?[{title:this.$t("index.title.midjourney"),subtitle:this.$t("index.subtitle.midjourney"),icon:"fa-solid fa-palette",path:"/midjourney"}]:[],...(y=(o=(r=this.site)==null?void 0:r.features)==null?void 0:o.qrart)!=null&&y.enabled?[{title:this.$t("index.title.qrart"),subtitle:this.$t("index.subtitle.qrart"),icon:"fa-solid fa-qrcode",path:"/qrart"}]:[],...(x=(k=(d=this.site)==null?void 0:d.features)==null?void 0:k.suno)!=null&&x.enabled?[{title:this.$t("index.title.suno"),subtitle:this.$t("index.subtitle.suno"),icon:"fa-solid fa-music",path:"/suno"}]:[],...(b=(f=(_=this.site)==null?void 0:_.features)==null?void 0:f.luma)!=null&&b.enabled?[{title:this.$t("index.title.luma"),subtitle:this.$t("index.subtitle.luma"),icon:"fa-solid fa-film",path:"/luma"}]:[],...(g=(v=($=this.site)==null?void 0:$.features)==null?void 0:v.headshots)!=null&&g.enabled?[{title:this.$t("index.title.headshots"),subtitle:this.$t("index.subtitle.headshots"),icon:"fa-solid fa-id-card",path:"/headshots"}]:[]]}},mounted(){},methods:{onClickCapability(t){this.$router.push(t.path)}}}),Z={class:"wrapper"},tt={id:"banner"},st={class:"container"},et={class:"info"},it={class:"title"},at={class:"subtitle"},nt={class:"operations"},ot={id:"introduction"},lt={class:"container"},dt={class:"title"},rt={class:"subtitle"},ut={class:"icon-wrapper"},ct={class:"title"},mt={class:"subtitle"},ht={key:0,id:"chat",class:"block"},pt={class:"container"},_t={class:"title"},ft={class:"subtitle"},bt={key:1,id:"midjourney",class:"block"},$t={class:"container"},vt={class:"title"},gt={class:"subtitle"},yt={key:2,id:"qrart",class:"block"},kt={class:"container"},xt={class:"title"},Ct={class:"subtitle"},wt={key:3,id:"suno",class:"block"},jt={class:"container"},qt={class:"title"},It={class:"subtitle"},Et={key:4,id:"luma",class:"block"},Nt={class:"container"},Bt={class:"title"},Vt={class:"subtitle"},Ft={key:5,id:"headshots",class:"block"},zt={class:"container"},Lt={class:"title"},Rt={class:"subtitle"};function St(t,a,C,w,j,q){var _,f,b,$,v,g,I,E,N,B,V,F,z,L,R,S,T,A;const r=p("el-button"),o=p("el-col"),y=p("el-image"),d=p("el-row"),k=p("font-awesome-icon"),x=p("el-card");return u(),c("div",Z,[s("div",tt,[s("div",st,[e(d,null,{default:i(()=>[e(o,{md:12,xs:24,class:"left"},{default:i(()=>{var l;return[s("div",et,[s("h1",it,n((l=t.site)==null?void 0:l.title),1),s("h3",at,n(t.$t("index.subtitle.banner")),1),s("div",nt,[e(r,{type:"primary",round:"",class:"btn-apply",onClick:a[0]||(a[0]=D=>t.$router.push({path:"/chat"}))},{default:i(()=>[h(n(t.$t("common.button.startForFree")),1)]),_:1})])])]}),_:1}),e(o,{md:12,xs:24,class:"right"},{default:i(()=>[e(y,{src:"https://cdn.acedata.cloud/illustration1.png",class:"brand"})]),_:1})]),_:1})])]),s("div",ot,[s("div",lt,[e(d,{class:"mb-6"},{default:i(()=>[e(o,{span:24},{default:i(()=>[s("h2",dt,n(t.$t("index.title.introduction")),1),s("h5",rt,n(t.$t("index.subtitle.introduction")),1)]),_:1})]),_:1}),e(d,{gutter:15},{default:i(()=>[(u(!0),c(Q,null,W(t.capabilities,(l,D)=>(u(),X(o,{key:D,md:6,xs:24,class:"mb-4"},{default:i(()=>[e(x,{class:"info text-center",shadow:"hover",onClick:Tt=>t.onClickCapability(l)},{default:i(()=>[s("div",ut,[e(k,{icon:l.icon,class:"icon"},null,8,["icon"])]),s("h2",ct,n(l.title),1),s("p",mt,n(l.subtitle),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1})])]),(b=(f=(_=t.site)==null?void 0:_.features)==null?void 0:f.chat)!=null&&b.enabled?(u(),c("div",ht,[s("div",pt,[e(d,null,{default:i(()=>[e(o,{md:16,xs:24,class:"preview"},{default:i(()=>a[7]||(a[7]=[s("img",{src:"https://cdn.acedata.cloud/axynds.png",class:"image desktop"},null,-1),s("img",{src:"https://cdn.acedata.cloud/vds4i3.png",class:"image mobile"},null,-1)])),_:1,__:[7]}),e(o,{md:8,xs:24,class:"info"},{default:i(()=>[s("h2",_t,n(t.$t("index.title.chat")),1),s("p",ft,n(t.$t("index.subtitle.chat")),1),e(r,{type:"primary",round:"",class:"btn-try",onClick:a[1]||(a[1]=l=>t.$router.push({path:"/chat"}))},{default:i(()=>[h(n(t.$t("index.button.try")),1)]),_:1})]),_:1})]),_:1})])])):m("v-if",!0),(g=(v=($=t.site)==null?void 0:$.features)==null?void 0:v.midjourney)!=null&&g.enabled?(u(),c("div",bt,[s("div",$t,[e(d,null,{default:i(()=>[e(o,{md:8,xs:24,class:"info"},{default:i(()=>[s("h2",vt,n(t.$t("index.title.midjourney")),1),s("p",gt,n(t.$t("index.subtitle.midjourney")),1),e(r,{type:"primary",round:"",class:"btn-try",onClick:a[2]||(a[2]=l=>t.$router.push({path:"/midjourney"}))},{default:i(()=>[h(n(t.$t("index.button.try")),1)]),_:1})]),_:1}),e(o,{md:16,xs:24,class:"preview"},{default:i(()=>a[8]||(a[8]=[s("img",{src:"https://cdn.acedata.cloud/uk86mz.png",class:"image desktop"},null,-1),s("img",{src:"https://cdn.acedata.cloud/rvelwm.png",class:"image mobile"},null,-1)])),_:1,__:[8]})]),_:1})])])):m("v-if",!0),(N=(E=(I=t.site)==null?void 0:I.features)==null?void 0:E.qrart)!=null&&N.enabled?(u(),c("div",yt,[s("div",kt,[e(d,null,{default:i(()=>[e(o,{md:16,xs:24,class:"preview"},{default:i(()=>a[9]||(a[9]=[s("img",{src:"https://cdn.acedata.cloud/gyogar.png",class:"image desktop"},null,-1),s("img",{src:"https://cdn.acedata.cloud/5kunm0.png",class:"image mobile"},null,-1)])),_:1,__:[9]}),e(o,{md:8,xs:24,class:"info"},{default:i(()=>[s("h2",xt,n(t.$t("index.title.qrart")),1),s("p",Ct,n(t.$t("index.subtitle.qrart")),1),e(r,{type:"primary",round:"",class:"btn-try",onClick:a[3]||(a[3]=l=>t.$router.push({path:"/qrart"}))},{default:i(()=>[h(n(t.$t("index.button.try")),1)]),_:1})]),_:1})]),_:1})])])):m("v-if",!0),(F=(V=(B=t.site)==null?void 0:B.features)==null?void 0:V.suno)!=null&&F.enabled?(u(),c("div",wt,[s("div",jt,[e(d,null,{default:i(()=>[e(o,{md:8,xs:24,class:"info"},{default:i(()=>[s("h2",qt,n(t.$t("index.title.suno")),1),s("p",It,n(t.$t("index.subtitle.suno")),1),e(r,{type:"primary",round:"",class:"btn-try",onClick:a[4]||(a[4]=l=>t.$router.push({path:"/suno"}))},{default:i(()=>[h(n(t.$t("index.button.try")),1)]),_:1})]),_:1}),e(o,{md:16,xs:24,class:"preview"},{default:i(()=>a[10]||(a[10]=[s("img",{src:"https://cdn.acedata.cloud/2m8fn.png",class:"image desktop"},null,-1),s("img",{src:"https://cdn.acedata.cloud/23knvs.png",class:"image mobile"},null,-1)])),_:1,__:[10]})]),_:1})])])):m("v-if",!0),(R=(L=(z=t.site)==null?void 0:z.features)==null?void 0:L.luma)!=null&&R.enabled?(u(),c("div",Et,[s("div",Nt,[e(d,null,{default:i(()=>[e(o,{md:16,xs:24,class:"preview"},{default:i(()=>a[11]||(a[11]=[s("img",{src:"https://cdn.acedata.cloud/6kop1g.png",class:"image desktop"},null,-1),s("img",{src:"https://cdn.acedata.cloud/3kcjny.png",class:"image mobile"},null,-1)])),_:1,__:[11]}),e(o,{md:8,xs:24,class:"info"},{default:i(()=>[s("h2",Bt,n(t.$t("index.title.luma")),1),s("p",Vt,n(t.$t("index.subtitle.luma")),1),e(r,{type:"primary",round:"",class:"btn-try",onClick:a[5]||(a[5]=l=>t.$router.push({path:"/luma"}))},{default:i(()=>[h(n(t.$t("index.button.try")),1)]),_:1})]),_:1})]),_:1})])])):m("v-if",!0),(A=(T=(S=t.site)==null?void 0:S.features)==null?void 0:T.headshots)!=null&&A.enabled?(u(),c("div",Ft,[s("div",zt,[e(d,null,{default:i(()=>[e(o,{md:8,xs:24,class:"info"},{default:i(()=>[s("h2",Lt,n(t.$t("index.title.headshots")),1),s("p",Rt,n(t.$t("index.subtitle.headshots")),1),e(r,{type:"primary",round:"",class:"btn-try",onClick:a[6]||(a[6]=l=>t.$router.push({path:"/headshots"}))},{default:i(()=>[h(n(t.$t("index.button.try")),1)]),_:1})]),_:1}),e(o,{md:16,xs:24,class:"preview"},{default:i(()=>a[12]||(a[12]=[s("img",{src:"https://cdn.acedata.cloud/zlyshj.png",class:"image desktop"},null,-1),s("img",{src:"https://cdn.acedata.cloud/8as0cx.png",class:"image mobile"},null,-1)])),_:1,__:[12]})]),_:1})])])):m("v-if",!0),m("v-if",!0)])}var Kt=M(Y,[["render",St],["__scopeId","data-v-d9c0303e"],["__file","/home/runner/work/Nexior/Nexior/src/pages/index/Index.vue"]]);export{Kt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-others.2105a885.js";import{ar as O}from"./vendor-fortawesome.fe21f86d.js";import{_ as w,Y as ne,a2 as L,F as ie,af as le,aY as re,W as ce}from"./index.a3bc0f28.js";import{S as de,l as j,O as pe,J as T,I as me,H as ue,W as he,X as _e,s as oe,B as ge,y as fe,Y as ve}from"./vendor-element-plus.6158e0fe.js";import{H as I,al as r,o as n,e as c,f as d,I as M,V as t,M as u,T as l,S as v,U as E,ai as P,L as D,R as $,P as N,m as $e}from"./vendor-@vue.66ea933c.js";import{I as ye}from"./InfoIcon.0718f348.js";import{A as be}from"./Status.dd04dd16.js";import{C as ke}from"./CopyToClipboard.6e4cac07.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.46bc4fb1.js";const we=I({name:"LayoutHeadshots",components:{ElDrawer:de,ElButton:j,FontAwesomeIcon:O},data(){return{drawer:!1}}}),Ie={class:"main"},Se={class:"config"},Te={class:"result"};function Ve(e,s,a,o,_,g){const p=r("font-awesome-icon"),h=r("el-button"),i=r("el-drawer");return n(),c("div",Ie,[d("div",Se,[M(e.$slots,"config",{},void 0,!0)]),d("div",Te,[M(e.$slots,"result",{},void 0,!0)]),t(h,{round:"",class:"menu",onClick:s[0]||(s[0]=m=>e.drawer=!0)},{default:u(()=>[t(p,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),t(i,{modelValue:e.drawer,"onUpdate:modelValue":s[1]||(s[1]=m=>e.drawer=m),"with-header":!1,size:"340px",class:"drawer"},{default:u(()=>[M(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Ce=w(we,[["render",Ve],["__scopeId","data-v-3e896eaa"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Headshots.vue"]]);const Ee=I({name:"ImageUrlsInput",components:{ElUpload:pe,ElButton:j,InfoIcon:ye},data(){return{fileList:[],uploadUrl:ne()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>{var s;return(s=e==null?void 0:e.response)==null?void 0:s.file_url})},value:{get(){var e,s;return(s=(e=this.$store.state.headshots)==null?void 0:e.config)==null?void 0:s.image_urls},set(e){var a;const s=this.urls;this.$store.commit("headshots/setConfig",{...(a=this.$store.state.headshots)==null?void 0:a.config,image_urls:s})}}},mounted(){this.value||(this.value=void 0),this.onSetImageUrls()},methods:{onExceed(){T.warning(this.$t("headshots.message.uploadImageExceed"))},onError(){T.error(this.$t("headshots.message.uploadImageError"))},onSetImageUrls(){var s;const e=this.urls;this.$store.commit("headshots/setConfig",{...(s=this.$store.state.headshots)==null?void 0:s.config,image_urls:e})},async onSuccess(){this.onSetImageUrls()}}}),Pe={class:"field"},Ae={class:"title font-bold"},Ge={class:"upload-wrapper"};function Ue(e,s,a,o,_,g){const p=r("el-button"),h=r("el-upload"),i=r("info-icon");return n(),c("div",Pe,[d("h2",Ae,l(e.$t("headshots.name.endImageUrls")),1),d("div",Ge,[t(h,{"file-list":e.fileList,"onUpdate:fileList":s[0]||(s[0]=m=>e.fileList=m),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:2,multiple:!0,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:u(()=>[t(p,{size:"small",type:"primary",round:""},{default:u(()=>[v(l(e.$t("headshots.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),t(i,{content:e.$t("headshots.description.endImageUrls"),class:"info"},null,8,["content"])])}var Ne=w(Ee,[["render",Ue],["__scopeId","data-v-69ae8722"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ImageUrlsInput.vue"]]);const Re="fast",De=I({name:"ModeSelector",components:{ElRadioButton:me,ElRadioGroup:ue},data(){return{options:[{label:this.$t("headshots.button.fast"),value:"fast"},{label:this.$t("headshots.button.relax"),value:"relax"}]}},computed:{value:{get(){var e;return(e=this.$store.state.headshots.config)==null?void 0:e.mode},set(e){console.debug("set mode",e),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots.config,mode:e})}}},mounted(){this.value||(this.value=Re)}}),Le={class:"field"},Me={class:"title font-bold"};function Oe(e,s,a,o,_,g){const p=r("el-radio-button"),h=r("el-radio-group");return n(),c("div",Le,[d("h2",Me,l(e.$t("headshots.name.mode")),1),t(h,{modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=i=>e.value=i),size:"small",class:"mode"},{default:u(()=>[(n(!0),c(E,null,P(e.options,i=>(n(),D(p,{key:i.value,label:i.value},{default:u(()=>[v(l(i.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}var je=w(De,[["render",Oe],["__scopeId","data-v-5ec8e3d9"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ModeSelector.vue"]]);const Be=I({name:"StylizeSelector",components:{ElTabs:he,ElTabPane:_e,ElImage:oe},data(){return{tab:"styles",value:"",elements:{styles:{displayName:this.$t("headshots.styleCategory.styles"),items:[{image:"https://static.aipedias.com/aicamera/common/20241008/20241008202314260779439.png",label:this.$t("headshots.styleTag.malePportrait"),value:"male_portrait"},{image:"https://static.aipedias.com/aicamera/common/20241008/202410082022241e9755548.png",label:this.$t("headshots.styleTag.malePportrait2"),value:"male_portrait2"},{image:"https://static.aipedias.com/aicamera/common/20241101/20241101170130d78f66521.png",label:this.$t("headshots.styleTag.kindergarten"),value:"kindergarten"},{image:"https://static.aipedias.com/aicamera/common/20240923/20240923123233accf60398.webp",label:this.$t("headshots.styleTag.logoTshirt"),value:"logo_tshirt"},{image:"https://static.aipedias.com/aicamera/common/20241025/202410252012329472d0656.jpg",label:this.$t("headshots.styleTag.wedding"),value:"wedding"},{image:"https://static.aipedias.com/aicamera/common/20240915/20240915145045254931400.webp",label:this.$t("headshots.styleTag.businessPphoto"),value:"business_photo"},{image:"https://static.aipedias.com/aicamera/common/20240810/20240810194526040341795.jpg",label:this.$t("headshots.styleTag.bobSuit"),value:"bob_suit"},{image:"https://static.aipedias.com/aicamera/common/20240717/20240717152654e0b348173.webp",label:this.$t("headshots.styleTag.femalePortrait"),value:"female_portrait"}]}}}},watch:{value(e){var s;console.debug("set template",e),this.$store.commit("headshots/setConfig",{...(s=this.$store.state.headshots)==null?void 0:s.config,template:e})}},mounted(){var e;this.value||(this.value=""),console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...(e=this.$store.state.headshots)==null?void 0:e.config,template:this.value})},methods:{onToggle(e){var s;this.value===e?this.value="":this.value=e,console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...(s=this.$store.state.headshots)==null?void 0:s.config,template:this.value})}}}),ze={class:"field"},He=["onClick"],qe={class:"name"};function Fe(e,s,a,o,_,g){const p=r("el-image"),h=r("el-tab-pane"),i=r("el-tabs");return n(),c("div",ze,[$(` <h2 class="title">{{ $t('headshots.field.elements') }}</h2> `),t(i,{modelValue:e.tab,"onUpdate:modelValue":s[0]||(s[0]=m=>e.tab=m)},{default:u(()=>[(n(!0),c(E,null,P(e.elements,(m,f)=>(n(),D(h,{key:f,label:m.displayName,name:f,class:"pane"},{default:u(()=>[(n(!0),c(E,null,P(m.items,(k,V)=>(n(),c("div",{key:V,class:N({item:!0,active:e.value===k.value}),onClick:C=>e.onToggle(k.value)},[t(p,{src:k.image,fit:"fill",class:"preview"},null,8,["src"]),d("span",qe,l(k.label),1)],10,He))),128))]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])])}var Ye=w(Be,[["render",Fe],["__scopeId","data-v-7e0125ad"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ElementsSelector.vue"]]);const We=I({name:"PresetPanel",components:{ModeSelector:je,ImageUrlsInput:Ne,ElButton:j,FontAwesomeIcon:O,ElementsSelector:Ye},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.headshots)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Je={class:"panel"},Xe={class:"config"},Ke={class:"actions"};function Qe(e,s,a,o,_,g){const p=r("elements-selector"),h=r("mode-selector"),i=r("image-urls-input"),m=r("font-awesome-icon"),f=r("el-button");return n(),c("div",Je,[d("div",Xe,[t(p,{class:"mb-4"}),t(h,{class:"mb-4"}),t(i,{class:"mb-4"}),d("div",Ke,[t(f,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(m,{icon:"fa-solid fa-magic",class:"mr-2"}),v(" "+l(e.$t("headshots.button.generate")),1)]),_:1},8,["onClick"])])])])}var Ze=w(We,[["render",Qe],["__scopeId","data-v-6a264fac"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/ConfigPanel.vue"]]);const xe=I({name:"ImageGallery",props:{modelValue:{type:Object,required:!0}},setup(e){return{images:$e(()=>{var o,_,g;return((g=(_=(o=e.modelValue)==null?void 0:o.response)==null?void 0:_.data)==null?void 0:g.slice(0,2))||[]}),viewImage:o=>{window.open(o,"_blank")}}}}),es={class:"image-gallery"},ss=["src"],ts=["onClick"];function as(e,s,a,o,_,g){return n(),c("div",es,[(n(!0),c(E,null,P(e.images,(p,h)=>(n(),c("div",{key:h,class:"image-container"},[d("img",{src:p.image_url,alt:"Image"},null,8,ss),d("button",{class:"view-button",onClick:i=>e.viewImage(p.image_url)},l(e.$t("headshots.button.viewImage")),9,ts)]))),128))])}var os=w(xe,[["render",as],["__scopeId","data-v-0187109d"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/ImageGallery.vue"]]);const ns=I({name:"TaskPreview",components:{ElImage:oe,CopyToClipboard:ke,FontAwesomeIcon:O,ElAlert:ge,ImageGallery:os},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.headshots)==null?void 0:e.application},config(){var e;return(e=this.$store.state.headshots)==null?void 0:e.config}},methods:{onDownload(e,s){e.stopPropagation(),console.log("on download"),window.open(s,"_blank")},onReload(e){const s=e.target,a=new URL(s.src),o=a.searchParams.get("retry");if(!o)a.searchParams.set("retry","1");else if(parseInt(o)<2)a.searchParams.set("retry",(parseInt(o)+1).toString());else return;s.src=a.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),is={class:"preview"},ls={class:"left"},rs={class:"main"},cs={class:"bot"},ds={class:"datetime"},ps={class:"info"},ms={key:0,class:"prompt mt-2"},us={key:0},hs={key:1},_s={key:0,class:N({content:!0,failed:!0})},gs={class:"image-wrapper"},fs={class:"description"},vs={key:1,class:N({content:!0})},$s={class:"description"},ys={class:"description"},bs={class:"description"},ks={key:2,class:N({content:!0})},ws={class:"description"},Is={key:3,class:N({content:!0})},Ss={class:"description"};function Ts(e,s,a,o,_,g){var k,V,C,A,G,U,S,R,B,z,H,q,F,Y,W;const p=r("el-image"),h=r("image-gallery"),i=r("font-awesome-icon"),m=r("copy-to-clipboard"),f=r("el-alert");return n(),c("div",is,[d("div",ls,[t(p,{src:"https://cdn.acedata.cloud/isxyfw.png",class:"avatar"})]),d("div",rs,[d("div",cs,[v(l(e.$t("headshots.name.headshotsBot"))+" ",1),d("span",ds,l(e.$dayjs.format(""+new Date(parseFloat(((k=e.modelValue)==null?void 0:k.created_at)||"")*1e3))),1)]),d("div",ps,[(C=(V=e.modelValue)==null?void 0:V.request)!=null&&C.template?(n(),c("p",ms,[v(l((G=(A=e.modelValue)==null?void 0:A.request)==null?void 0:G.template)+" ",1),(U=e.modelValue)!=null&&U.response?$("v-if",!0):(n(),c("span",us," - ("+l(e.$t("headshots.status.pending"))+") ",1)),((R=(S=e.modelValue)==null?void 0:S.response)==null?void 0:R.status)==="unknown"?(n(),c("span",hs," - ("+l(e.$t("headshots.status.processing"))+") ",1)):$("v-if",!0)])):$("v-if",!0)]),$(" Display success message "),((z=(B=e.modelValue)==null?void 0:B.response)==null?void 0:z.success)===!0?(n(),c("div",_s,[d("div",gs,[t(h,{"model-value":e.modelValue},null,8,["model-value"])]),t(f,{closable:!1,class:"mt-2 success"},{default:u(()=>{var y,b;return[d("p",fs,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),t(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):$("v-if",!0),$(" Display error message "),((q=(H=e.modelValue)==null?void 0:H.response)==null?void 0:q.success)===!1?(n(),c("div",vs,[t(f,{closable:!1,class:"failure"},{template:u(()=>[t(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),v(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b,J,X,K,Q,Z,x,ee,se,te,ae;return[d("p",$s,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),t(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])]),d("p",ys,[t(i,{icon:"fa-solid fa-circle-info",class:"mr-1"}),v(" "+l(e.$t("headshots.name.failureReason"))+": "+l((K=(X=(J=e.modelValue)==null?void 0:J.response)==null?void 0:X.error)==null?void 0:K.message)+" ",1),t(m,{content:(x=(Z=(Q=e.modelValue)==null?void 0:Q.response)==null?void 0:Z.error)==null?void 0:x.message,class:"btn-copy"},null,8,["content"])]),d("p",bs,[t(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),v(" "+l(e.$t("headshots.name.traceId"))+": "+l((se=(ee=e.modelValue)==null?void 0:ee.response)==null?void 0:se.trace_id)+" ",1),t(m,{content:(ae=(te=e.modelValue)==null?void 0:te.response)==null?void 0:ae.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):$("v-if",!0),$(" Display error message "),(F=e.modelValue)!=null&&F.response?$("v-if",!0):(n(),c("div",ks,[t(f,{closable:!1,class:"info"},{template:u(()=>[t(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),v(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b;return[d("p",ws,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),t(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])),((W=(Y=e.modelValue)==null?void 0:Y.response)==null?void 0:W.status)==="unknown"?(n(),c("div",Is,[t(f,{closable:!1,class:"info"},{template:u(()=>[t(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),v(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b;return[d("p",Ss,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),t(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):$("v-if",!0)])])}var Vs=w(ns,[["render",Ts],["__scopeId","data-v-43e1feb8"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/task/Preview.vue"]]);const Cs=I({name:"RecentPanel",components:{TaskPreview:Vs,ElSkeleton:fe,ElSkeletonItem:ve},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,s,a,o;return{...(e=this.$store.state.headshots)==null?void 0:e.tasks,items:(o=(a=(s=this.$store.state.headshots)==null?void 0:s.tasks)==null?void 0:a.items)==null?void 0:o.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),Es={key:0,class:"tasks"},Ps={class:"left"},As={class:"main"},Gs={key:1,class:"tasks"},Us={key:2,class:"description"};function Ns(e,s,a,o,_,g){var m,f,k,V,C,A,G,U;const p=r("el-skeleton-item"),h=r("el-skeleton"),i=r("task-preview");return n(),c("div",{ref:"panel",class:"panel recent",onScroll:s[0]||(s[0]=(...S)=>e.onHandleScroll&&e.onHandleScroll(...S))},[((m=e.tasks)==null?void 0:m.items)===void 0?(n(),c("div",Es,[(n(),c(E,null,P(3,S=>d("div",{key:S,class:"task placeholder"},[d("div",Ps,[t(h,{animated:""},{template:u(()=>[t(p,{variant:"image",class:"avatar"})]),_:1})]),d("div",As,[t(h,{animated:""},{template:u(()=>[t(p,{variant:"p",class:"title"}),t(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):((k=(f=e.tasks)==null?void 0:f.items)==null?void 0:k.length)&&((C=(V=e.tasks)==null?void 0:V.items)==null?void 0:C.length)>0?(n(),c("div",Gs,[(n(!0),c(E,null,P((A=e.tasks)==null?void 0:A.items,(S,R)=>(n(),D(i,{key:R,"model-value":S,class:"preview"},null,8,["model-value"]))),128))])):$("v-if",!0),((U=(G=e.tasks)==null?void 0:G.items)==null?void 0:U.length)===0?(n(),c("p",Us,l(e.$t("headshots.message.noTasks")),1)):$("v-if",!0)],544)}var Rs=w(Cs,[["render",Ns],["__scopeId","data-v-37920e9a"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/RecentPanel.vue"]]);const Ds="https://webhook.acedata.cloud/headshots",Ls=I({name:"HeadshotsIndex",components:{ConfigPanel:Ze,Layout:Ce,ApplicationStatus:be,RecentPanel:Rs},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,s;return((s=(e=this.$store.state.headshots)==null?void 0:e.status)==null?void 0:s.getApplications)===L.Request},service(){return this.$store.state.headshots.service},credential(){return this.$store.state.headshots.credential},config(){return this.$store.state.headshots.config},initializing(){return this.$store.state.headshots.status.getApplications===L.Request},needApply(){return this.$store.state.headshots.status.getApplications===L.Success&&!this.application},application(){return this.$store.state.headshots.application},applications(){return this.$store.state.headshots.applications},tasks(){return this.$store.state.headshots.tasks}},watch:{tasks:{handler(e,s){var a,o;((a=e==null?void 0:e.items)==null?void 0:a.length)>((o=s==null?void 0:s.items)==null?void 0:o.length)&&console.debug("new tasks detected")},deep:!0}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onScrollDown(),await this.onGetTasks(),this.job=setInterval(()=>{this.onGetTasks()},5e3)},async unmounted(){clearInterval(this.job),clearInterval(this.timer)},methods:{async onReachTop(){var e,s,a;console.debug("reached top"),await this.onGetTasks({createdAtMax:(a=(s=(e=this.tasks)==null?void 0:e.items)==null?void 0:s[0])==null?void 0:a.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("headshots/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("headshots/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){ie.create({application:this.application}).then(({data:e})=>{this.application=e,T.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var s,a;((a=(s=e==null?void 0:e.response)==null?void 0:s.data)==null?void 0:a.code)===le&&T.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},500)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:s=5,createdAtMin:a,createdAtMax:o}=e||{};console.debug("limit",s,"createdAtMin",a,"createdAtMax",o),await this.$store.dispatch("headshots/getTasks",{limit:s,createdAtMin:a,createdAtMax:o})},async onGeneratePicture(){var a;const e={...this.config,callback_url:Ds},s=(a=this.credential)==null?void 0:a.token;if(!s){console.error("no token specified");return}T.info(this.$t("headshots.message.startingTask")),re.generate(e,{token:s}).then(()=>{T.success(this.$t("headshots.message.startTaskSuccess")),this.$store.commit("headshots/setConfig",{config:void 0})}).catch(o=>{var g,p;const _=(g=o==null?void 0:o.response)==null?void 0:g.data;((p=_==null?void 0:_.error)==null?void 0:p.code)===ce?T.error(this.$t("headshots.message.usedUp")):T.error(this.$t("headshots.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Ms(e,s,a,o,_,g){const p=r("config-panel"),h=r("application-status"),i=r("recent-panel"),m=r("layout");return n(),D(m,null,{config:u(()=>[t(p,{onGenerate:e.onGeneratePicture},null,8,["onGenerate"])]),result:u(()=>[t(h,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication,onSelect:s[0]||(s[0]=f=>e.$store.dispatch("headshots/setApplication",f))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),t(i,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"]),$(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var Xs=w(Ls,[["render",Ms],["__scopeId","data-v-62da1b28"],["__file","/home/runner/work/Nexior/Nexior/src/pages/headshots/Index.vue"]]);export{Xs as default};
|
|
1
|
+
import"./vendor-others.2105a885.js";import{ar as O}from"./vendor-fortawesome.fe21f86d.js";import{_ as w,Y as ne,a2 as L,F as ie,af as le,aY as re,W as ce}from"./index.e160e9a8.js";import{S as de,l as j,O as pe,J as T,I as me,H as ue,W as he,X as _e,s as oe,B as ge,y as fe,Y as ve}from"./vendor-element-plus.6158e0fe.js";import{H as I,al as r,o as n,e as c,f as d,I as M,V as t,M as u,T as l,S as v,U as E,ai as P,L as D,R as $,P as N,m as $e}from"./vendor-@vue.66ea933c.js";import{I as ye}from"./InfoIcon.329799b2.js";import{A as be}from"./Status.546232e5.js";import{C as ke}from"./CopyToClipboard.d2c28170.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.46bc4fb1.js";const we=I({name:"LayoutHeadshots",components:{ElDrawer:de,ElButton:j,FontAwesomeIcon:O},data(){return{drawer:!1}}}),Ie={class:"main"},Se={class:"config"},Te={class:"result"};function Ve(e,s,a,o,_,g){const p=r("font-awesome-icon"),h=r("el-button"),i=r("el-drawer");return n(),c("div",Ie,[d("div",Se,[M(e.$slots,"config",{},void 0,!0)]),d("div",Te,[M(e.$slots,"result",{},void 0,!0)]),t(h,{round:"",class:"menu",onClick:s[0]||(s[0]=m=>e.drawer=!0)},{default:u(()=>[t(p,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),t(i,{modelValue:e.drawer,"onUpdate:modelValue":s[1]||(s[1]=m=>e.drawer=m),"with-header":!1,size:"340px",class:"drawer"},{default:u(()=>[M(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Ce=w(we,[["render",Ve],["__scopeId","data-v-3e896eaa"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Headshots.vue"]]);const Ee=I({name:"ImageUrlsInput",components:{ElUpload:pe,ElButton:j,InfoIcon:ye},data(){return{fileList:[],uploadUrl:ne()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>{var s;return(s=e==null?void 0:e.response)==null?void 0:s.file_url})},value:{get(){var e,s;return(s=(e=this.$store.state.headshots)==null?void 0:e.config)==null?void 0:s.image_urls},set(e){var a;const s=this.urls;this.$store.commit("headshots/setConfig",{...(a=this.$store.state.headshots)==null?void 0:a.config,image_urls:s})}}},mounted(){this.value||(this.value=void 0),this.onSetImageUrls()},methods:{onExceed(){T.warning(this.$t("headshots.message.uploadImageExceed"))},onError(){T.error(this.$t("headshots.message.uploadImageError"))},onSetImageUrls(){var s;const e=this.urls;this.$store.commit("headshots/setConfig",{...(s=this.$store.state.headshots)==null?void 0:s.config,image_urls:e})},async onSuccess(){this.onSetImageUrls()}}}),Pe={class:"field"},Ae={class:"title font-bold"},Ge={class:"upload-wrapper"};function Ue(e,s,a,o,_,g){const p=r("el-button"),h=r("el-upload"),i=r("info-icon");return n(),c("div",Pe,[d("h2",Ae,l(e.$t("headshots.name.endImageUrls")),1),d("div",Ge,[t(h,{"file-list":e.fileList,"onUpdate:fileList":s[0]||(s[0]=m=>e.fileList=m),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:2,multiple:!0,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:u(()=>[t(p,{size:"small",type:"primary",round:""},{default:u(()=>[v(l(e.$t("headshots.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),t(i,{content:e.$t("headshots.description.endImageUrls"),class:"info"},null,8,["content"])])}var Ne=w(Ee,[["render",Ue],["__scopeId","data-v-69ae8722"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ImageUrlsInput.vue"]]);const Re="fast",De=I({name:"ModeSelector",components:{ElRadioButton:me,ElRadioGroup:ue},data(){return{options:[{label:this.$t("headshots.button.fast"),value:"fast"},{label:this.$t("headshots.button.relax"),value:"relax"}]}},computed:{value:{get(){var e;return(e=this.$store.state.headshots.config)==null?void 0:e.mode},set(e){console.debug("set mode",e),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots.config,mode:e})}}},mounted(){this.value||(this.value=Re)}}),Le={class:"field"},Me={class:"title font-bold"};function Oe(e,s,a,o,_,g){const p=r("el-radio-button"),h=r("el-radio-group");return n(),c("div",Le,[d("h2",Me,l(e.$t("headshots.name.mode")),1),t(h,{modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=i=>e.value=i),size:"small",class:"mode"},{default:u(()=>[(n(!0),c(E,null,P(e.options,i=>(n(),D(p,{key:i.value,label:i.value},{default:u(()=>[v(l(i.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}var je=w(De,[["render",Oe],["__scopeId","data-v-5ec8e3d9"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ModeSelector.vue"]]);const Be=I({name:"StylizeSelector",components:{ElTabs:he,ElTabPane:_e,ElImage:oe},data(){return{tab:"styles",value:"",elements:{styles:{displayName:this.$t("headshots.styleCategory.styles"),items:[{image:"https://static.aipedias.com/aicamera/common/20241008/20241008202314260779439.png",label:this.$t("headshots.styleTag.malePportrait"),value:"male_portrait"},{image:"https://static.aipedias.com/aicamera/common/20241008/202410082022241e9755548.png",label:this.$t("headshots.styleTag.malePportrait2"),value:"male_portrait2"},{image:"https://static.aipedias.com/aicamera/common/20241101/20241101170130d78f66521.png",label:this.$t("headshots.styleTag.kindergarten"),value:"kindergarten"},{image:"https://static.aipedias.com/aicamera/common/20240923/20240923123233accf60398.webp",label:this.$t("headshots.styleTag.logoTshirt"),value:"logo_tshirt"},{image:"https://static.aipedias.com/aicamera/common/20241025/202410252012329472d0656.jpg",label:this.$t("headshots.styleTag.wedding"),value:"wedding"},{image:"https://static.aipedias.com/aicamera/common/20240915/20240915145045254931400.webp",label:this.$t("headshots.styleTag.businessPphoto"),value:"business_photo"},{image:"https://static.aipedias.com/aicamera/common/20240810/20240810194526040341795.jpg",label:this.$t("headshots.styleTag.bobSuit"),value:"bob_suit"},{image:"https://static.aipedias.com/aicamera/common/20240717/20240717152654e0b348173.webp",label:this.$t("headshots.styleTag.femalePortrait"),value:"female_portrait"}]}}}},watch:{value(e){var s;console.debug("set template",e),this.$store.commit("headshots/setConfig",{...(s=this.$store.state.headshots)==null?void 0:s.config,template:e})}},mounted(){var e;this.value||(this.value=""),console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...(e=this.$store.state.headshots)==null?void 0:e.config,template:this.value})},methods:{onToggle(e){var s;this.value===e?this.value="":this.value=e,console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...(s=this.$store.state.headshots)==null?void 0:s.config,template:this.value})}}}),ze={class:"field"},He=["onClick"],qe={class:"name"};function Fe(e,s,a,o,_,g){const p=r("el-image"),h=r("el-tab-pane"),i=r("el-tabs");return n(),c("div",ze,[$(` <h2 class="title">{{ $t('headshots.field.elements') }}</h2> `),t(i,{modelValue:e.tab,"onUpdate:modelValue":s[0]||(s[0]=m=>e.tab=m)},{default:u(()=>[(n(!0),c(E,null,P(e.elements,(m,f)=>(n(),D(h,{key:f,label:m.displayName,name:f,class:"pane"},{default:u(()=>[(n(!0),c(E,null,P(m.items,(k,V)=>(n(),c("div",{key:V,class:N({item:!0,active:e.value===k.value}),onClick:C=>e.onToggle(k.value)},[t(p,{src:k.image,fit:"fill",class:"preview"},null,8,["src"]),d("span",qe,l(k.label),1)],10,He))),128))]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])])}var Ye=w(Be,[["render",Fe],["__scopeId","data-v-7e0125ad"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ElementsSelector.vue"]]);const We=I({name:"PresetPanel",components:{ModeSelector:je,ImageUrlsInput:Ne,ElButton:j,FontAwesomeIcon:O,ElementsSelector:Ye},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.headshots)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Je={class:"panel"},Xe={class:"config"},Ke={class:"actions"};function Qe(e,s,a,o,_,g){const p=r("elements-selector"),h=r("mode-selector"),i=r("image-urls-input"),m=r("font-awesome-icon"),f=r("el-button");return n(),c("div",Je,[d("div",Xe,[t(p,{class:"mb-4"}),t(h,{class:"mb-4"}),t(i,{class:"mb-4"}),d("div",Ke,[t(f,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(m,{icon:"fa-solid fa-magic",class:"mr-2"}),v(" "+l(e.$t("headshots.button.generate")),1)]),_:1},8,["onClick"])])])])}var Ze=w(We,[["render",Qe],["__scopeId","data-v-6a264fac"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/ConfigPanel.vue"]]);const xe=I({name:"ImageGallery",props:{modelValue:{type:Object,required:!0}},setup(e){return{images:$e(()=>{var o,_,g;return((g=(_=(o=e.modelValue)==null?void 0:o.response)==null?void 0:_.data)==null?void 0:g.slice(0,2))||[]}),viewImage:o=>{window.open(o,"_blank")}}}}),es={class:"image-gallery"},ss=["src"],ts=["onClick"];function as(e,s,a,o,_,g){return n(),c("div",es,[(n(!0),c(E,null,P(e.images,(p,h)=>(n(),c("div",{key:h,class:"image-container"},[d("img",{src:p.image_url,alt:"Image"},null,8,ss),d("button",{class:"view-button",onClick:i=>e.viewImage(p.image_url)},l(e.$t("headshots.button.viewImage")),9,ts)]))),128))])}var os=w(xe,[["render",as],["__scopeId","data-v-0187109d"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/ImageGallery.vue"]]);const ns=I({name:"TaskPreview",components:{ElImage:oe,CopyToClipboard:ke,FontAwesomeIcon:O,ElAlert:ge,ImageGallery:os},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.headshots)==null?void 0:e.application},config(){var e;return(e=this.$store.state.headshots)==null?void 0:e.config}},methods:{onDownload(e,s){e.stopPropagation(),console.log("on download"),window.open(s,"_blank")},onReload(e){const s=e.target,a=new URL(s.src),o=a.searchParams.get("retry");if(!o)a.searchParams.set("retry","1");else if(parseInt(o)<2)a.searchParams.set("retry",(parseInt(o)+1).toString());else return;s.src=a.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),is={class:"preview"},ls={class:"left"},rs={class:"main"},cs={class:"bot"},ds={class:"datetime"},ps={class:"info"},ms={key:0,class:"prompt mt-2"},us={key:0},hs={key:1},_s={key:0,class:N({content:!0,failed:!0})},gs={class:"image-wrapper"},fs={class:"description"},vs={key:1,class:N({content:!0})},$s={class:"description"},ys={class:"description"},bs={class:"description"},ks={key:2,class:N({content:!0})},ws={class:"description"},Is={key:3,class:N({content:!0})},Ss={class:"description"};function Ts(e,s,a,o,_,g){var k,V,C,A,G,U,S,R,B,z,H,q,F,Y,W;const p=r("el-image"),h=r("image-gallery"),i=r("font-awesome-icon"),m=r("copy-to-clipboard"),f=r("el-alert");return n(),c("div",is,[d("div",ls,[t(p,{src:"https://cdn.acedata.cloud/isxyfw.png",class:"avatar"})]),d("div",rs,[d("div",cs,[v(l(e.$t("headshots.name.headshotsBot"))+" ",1),d("span",ds,l(e.$dayjs.format(""+new Date(parseFloat(((k=e.modelValue)==null?void 0:k.created_at)||"")*1e3))),1)]),d("div",ps,[(C=(V=e.modelValue)==null?void 0:V.request)!=null&&C.template?(n(),c("p",ms,[v(l((G=(A=e.modelValue)==null?void 0:A.request)==null?void 0:G.template)+" ",1),(U=e.modelValue)!=null&&U.response?$("v-if",!0):(n(),c("span",us," - ("+l(e.$t("headshots.status.pending"))+") ",1)),((R=(S=e.modelValue)==null?void 0:S.response)==null?void 0:R.status)==="unknown"?(n(),c("span",hs," - ("+l(e.$t("headshots.status.processing"))+") ",1)):$("v-if",!0)])):$("v-if",!0)]),$(" Display success message "),((z=(B=e.modelValue)==null?void 0:B.response)==null?void 0:z.success)===!0?(n(),c("div",_s,[d("div",gs,[t(h,{"model-value":e.modelValue},null,8,["model-value"])]),t(f,{closable:!1,class:"mt-2 success"},{default:u(()=>{var y,b;return[d("p",fs,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),t(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):$("v-if",!0),$(" Display error message "),((q=(H=e.modelValue)==null?void 0:H.response)==null?void 0:q.success)===!1?(n(),c("div",vs,[t(f,{closable:!1,class:"failure"},{template:u(()=>[t(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),v(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b,J,X,K,Q,Z,x,ee,se,te,ae;return[d("p",$s,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),t(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])]),d("p",ys,[t(i,{icon:"fa-solid fa-circle-info",class:"mr-1"}),v(" "+l(e.$t("headshots.name.failureReason"))+": "+l((K=(X=(J=e.modelValue)==null?void 0:J.response)==null?void 0:X.error)==null?void 0:K.message)+" ",1),t(m,{content:(x=(Z=(Q=e.modelValue)==null?void 0:Q.response)==null?void 0:Z.error)==null?void 0:x.message,class:"btn-copy"},null,8,["content"])]),d("p",bs,[t(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),v(" "+l(e.$t("headshots.name.traceId"))+": "+l((se=(ee=e.modelValue)==null?void 0:ee.response)==null?void 0:se.trace_id)+" ",1),t(m,{content:(ae=(te=e.modelValue)==null?void 0:te.response)==null?void 0:ae.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):$("v-if",!0),$(" Display error message "),(F=e.modelValue)!=null&&F.response?$("v-if",!0):(n(),c("div",ks,[t(f,{closable:!1,class:"info"},{template:u(()=>[t(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),v(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b;return[d("p",ws,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),t(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])),((W=(Y=e.modelValue)==null?void 0:Y.response)==null?void 0:W.status)==="unknown"?(n(),c("div",Is,[t(f,{closable:!1,class:"info"},{template:u(()=>[t(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),v(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b;return[d("p",Ss,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),t(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):$("v-if",!0)])])}var Vs=w(ns,[["render",Ts],["__scopeId","data-v-43e1feb8"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/task/Preview.vue"]]);const Cs=I({name:"RecentPanel",components:{TaskPreview:Vs,ElSkeleton:fe,ElSkeletonItem:ve},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,s,a,o;return{...(e=this.$store.state.headshots)==null?void 0:e.tasks,items:(o=(a=(s=this.$store.state.headshots)==null?void 0:s.tasks)==null?void 0:a.items)==null?void 0:o.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),Es={key:0,class:"tasks"},Ps={class:"left"},As={class:"main"},Gs={key:1,class:"tasks"},Us={key:2,class:"description"};function Ns(e,s,a,o,_,g){var m,f,k,V,C,A,G,U;const p=r("el-skeleton-item"),h=r("el-skeleton"),i=r("task-preview");return n(),c("div",{ref:"panel",class:"panel recent",onScroll:s[0]||(s[0]=(...S)=>e.onHandleScroll&&e.onHandleScroll(...S))},[((m=e.tasks)==null?void 0:m.items)===void 0?(n(),c("div",Es,[(n(),c(E,null,P(3,S=>d("div",{key:S,class:"task placeholder"},[d("div",Ps,[t(h,{animated:""},{template:u(()=>[t(p,{variant:"image",class:"avatar"})]),_:1})]),d("div",As,[t(h,{animated:""},{template:u(()=>[t(p,{variant:"p",class:"title"}),t(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):((k=(f=e.tasks)==null?void 0:f.items)==null?void 0:k.length)&&((C=(V=e.tasks)==null?void 0:V.items)==null?void 0:C.length)>0?(n(),c("div",Gs,[(n(!0),c(E,null,P((A=e.tasks)==null?void 0:A.items,(S,R)=>(n(),D(i,{key:R,"model-value":S,class:"preview"},null,8,["model-value"]))),128))])):$("v-if",!0),((U=(G=e.tasks)==null?void 0:G.items)==null?void 0:U.length)===0?(n(),c("p",Us,l(e.$t("headshots.message.noTasks")),1)):$("v-if",!0)],544)}var Rs=w(Cs,[["render",Ns],["__scopeId","data-v-37920e9a"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/RecentPanel.vue"]]);const Ds="https://webhook.acedata.cloud/headshots",Ls=I({name:"HeadshotsIndex",components:{ConfigPanel:Ze,Layout:Ce,ApplicationStatus:be,RecentPanel:Rs},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,s;return((s=(e=this.$store.state.headshots)==null?void 0:e.status)==null?void 0:s.getApplications)===L.Request},service(){return this.$store.state.headshots.service},credential(){return this.$store.state.headshots.credential},config(){return this.$store.state.headshots.config},initializing(){return this.$store.state.headshots.status.getApplications===L.Request},needApply(){return this.$store.state.headshots.status.getApplications===L.Success&&!this.application},application(){return this.$store.state.headshots.application},applications(){return this.$store.state.headshots.applications},tasks(){return this.$store.state.headshots.tasks}},watch:{tasks:{handler(e,s){var a,o;((a=e==null?void 0:e.items)==null?void 0:a.length)>((o=s==null?void 0:s.items)==null?void 0:o.length)&&console.debug("new tasks detected")},deep:!0}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onScrollDown(),await this.onGetTasks(),this.job=setInterval(()=>{this.onGetTasks()},5e3)},async unmounted(){clearInterval(this.job),clearInterval(this.timer)},methods:{async onReachTop(){var e,s,a;console.debug("reached top"),await this.onGetTasks({createdAtMax:(a=(s=(e=this.tasks)==null?void 0:e.items)==null?void 0:s[0])==null?void 0:a.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("headshots/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("headshots/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){ie.create({application:this.application}).then(({data:e})=>{this.application=e,T.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var s,a;((a=(s=e==null?void 0:e.response)==null?void 0:s.data)==null?void 0:a.code)===le&&T.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},500)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:s=5,createdAtMin:a,createdAtMax:o}=e||{};console.debug("limit",s,"createdAtMin",a,"createdAtMax",o),await this.$store.dispatch("headshots/getTasks",{limit:s,createdAtMin:a,createdAtMax:o})},async onGeneratePicture(){var a;const e={...this.config,callback_url:Ds},s=(a=this.credential)==null?void 0:a.token;if(!s){console.error("no token specified");return}T.info(this.$t("headshots.message.startingTask")),re.generate(e,{token:s}).then(()=>{T.success(this.$t("headshots.message.startTaskSuccess")),this.$store.commit("headshots/setConfig",{config:void 0})}).catch(o=>{var g,p;const _=(g=o==null?void 0:o.response)==null?void 0:g.data;((p=_==null?void 0:_.error)==null?void 0:p.code)===ce?T.error(this.$t("headshots.message.usedUp")):T.error(this.$t("headshots.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Ms(e,s,a,o,_,g){const p=r("config-panel"),h=r("application-status"),i=r("recent-panel"),m=r("layout");return n(),D(m,null,{config:u(()=>[t(p,{onGenerate:e.onGeneratePicture},null,8,["onGenerate"])]),result:u(()=>[t(h,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication,onSelect:s[0]||(s[0]=f=>e.$store.dispatch("headshots/setApplication",f))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),t(i,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"]),$(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var Xs=w(Ls,[["render",Ms],["__scopeId","data-v-62da1b28"],["__file","/home/runner/work/Nexior/Nexior/src/pages/headshots/Index.vue"]]);export{Xs as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-others.2105a885.js";import{ar as c}from"./vendor-fortawesome.fe21f86d.js";import{_ as r}from"./index.
|
|
1
|
+
import"./vendor-others.2105a885.js";import{ar as c}from"./vendor-fortawesome.fe21f86d.js";import{_ as r}from"./index.e160e9a8.js";import{t as a}from"./vendor-element-plus.6158e0fe.js";import{H as s,al as o,o as p,L as _,M as i,V as m}from"./vendor-@vue.66ea933c.js";const f=s({name:"InfoIcon",components:{FontAwesomeIcon:c,ElTooltip:a},props:{content:{type:String,required:!0}}});function l(e,d,u,I,v,x){const n=o("font-awesome-icon"),t=o("el-tooltip");return p(),_(t,{effect:"dark",content:e.content,placement:"top"},{default:i(()=>[m(n,{icon:"fa-solid fa-info",class:"icon icon-rotate"})]),_:1},8,["content"])}var C=r(f,[["render",l],["__scopeId","data-v-43d426ab"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/InfoIcon.vue"]]);export{C as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-others.2105a885.js";import{P as b}from"./Pagination.
|
|
1
|
+
import"./vendor-others.2105a885.js";import{P as b}from"./Pagination.ef8fafe0.js";import{C as w}from"./CopyToClipboard.d2c28170.js";import{_ as $,al as y}from"./index.e160e9a8.js";import{i as C,h as I,u as D,w as k,r as E}from"./vendor-element-plus.6158e0fe.js";import{H as F,al as s,av as P,L as _,M as t,o as u,V as a,f as n,T as i,O as N}from"./vendor-@vue.66ea933c.js";import"./vendor-fortawesome.fe21f86d.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.46bc4fb1.js";const T=F({name:"ConsoleDistributionInvitees",components:{Pagination:b,CopyToClipboard:w,ElRow:C,ElCol:I,ElTable:D,ElTableColumn:k,ElCard:E},data(){return{invitees:[],loading:!1,total:void 0,limit:10}},computed:{redirect(){return this.$route.query.redirect},page(){var e;return parseInt(((e=this.$route.query.page)==null?void 0:e.toString())||"1")}},watch:{page:{handler(){this.onFetchData()}}},mounted(){this.onFetchData()},methods:{onPageChange(e){var p;this.$router.push({name:(p=this.$route.name)==null?void 0:p.toString(),query:{page:e}})},onFetchData(){this.loading=!0,Promise.all([this.onFetchInvitees()]).finally(()=>{this.loading=!1})},async onFetchInvitees(){const{data:e}=await y.getInvitees({limit:this.limit,offset:(this.page-1)*this.limit,ordering:"-created_at"});this.invitees=e.items,this.total=e.count}}}),q={class:"title"},B={class:"key"},S={class:"copy"},V={class:"description"},j={class:"description"},z={class:"description"},O={class:"created-at"},H={class:"pagination m-v-lg"};function J(e,p,L,M,R,A){const d=s("el-col"),c=s("el-row"),m=s("copy-to-clipboard"),l=s("el-table-column"),h=s("el-table"),f=s("el-card"),g=s("pagination"),v=P("loading");return u(),_(c,{class:"panel"},{default:t(()=>[a(d,{span:24},{default:t(()=>[a(c,null,{default:t(()=>[a(d,{span:24},{default:t(()=>[n("h2",q,i(e.$t("common.title.invitee")),1)]),_:1})]),_:1}),a(c,null,{default:t(()=>[a(d,{span:24},{default:t(()=>[a(f,{shadow:"hover"},{default:t(()=>[N((u(),_(h,{data:e.invitees,stripe:""},{default:t(()=>[a(l,{prop:"id",label:e.$t("user.field.id"),"class-name":"text-center",width:"350px"},{default:t(o=>[n("span",B,i(o.row.id),1),n("span",S,[a(m,{content:o.row.id},null,8,["content"])])]),_:1},8,["label"]),a(l,{label:e.$t("user.field.username"),width:"300px"},{default:t(o=>{var r;return[n("span",V,i((r=o.row)==null?void 0:r.username),1)]}),_:1},8,["label"]),a(l,{label:e.$t("user.field.email"),width:"300px"},{default:t(o=>{var r;return[n("span",j,i((r=o.row)==null?void 0:r.email),1)]}),_:1},8,["label"]),a(l,{label:e.$t("user.field.nickname"),width:"200px"},{default:t(o=>[n("span",z,i(o.row.nickname),1)]),_:1},8,["label"]),a(l,{label:e.$t("user.field.dateJoined")},{default:t(o=>[n("span",O,i(e.$dayjs.format(o.row.date_joined)),1)]),_:1},8,["label"])]),_:1},8,["data"])),[[v,e.loading]])]),_:1})]),_:1})]),_:1}),a(c,null,{default:t(()=>[a(d,{span:10,offset:14},{default:t(()=>[n("div",H,[a(g,{"current-page":e.page,"page-size":e.limit,total:e.total,onChange:e.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}var ee=$(T,[["render",J],["__scopeId","data-v-7cfed024"],["__file","/home/runner/work/Nexior/Nexior/src/pages/distribution/Invitees.vue"]]);export{ee as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-others.2105a885.js";import{o as D}from"./order.
|
|
1
|
+
import"./vendor-others.2105a885.js";import{o as D}from"./order.250bb40b.js";import{P as O}from"./Pagination.ef8fafe0.js";import{C as I}from"./CopyToClipboard.d2c28170.js";import{O as P}from"./order.aa35b6fb.js";import{_ as N}from"./index.e160e9a8.js";import{g as F}from"./price.5338eefd.js";import{i as L,h as T,u as A,w as B,l as V,b as z,r as H}from"./vendor-element-plus.6158e0fe.js";import{H as R,al as s,av as q,L as m,M as t,o as l,V as a,f as n,T as r,O as M,e as u,S as d,R as X}from"./vendor-@vue.66ea933c.js";import"./vendor-fortawesome.fe21f86d.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.46bc4fb1.js";const j=R({name:"ConsoleOrderList",components:{Pagination:O,CopyToClipboard:I,ElRow:L,ElCol:T,ElTable:A,ElTableColumn:B,ElButton:V,ElTag:z,ElCard:H},data(){return{OrderState:P,orders:[],loading:!1,total:void 0,limit:Math.floor((window.innerHeight-300)/50)}},computed:{redirect(){return this.$route.query.redirect},page(){var e;return parseInt(((e=this.$route.query.page)==null?void 0:e.toString())||"1")}},watch:{page:{handler(){this.onFetchData()}}},mounted(){this.onFetchData()},methods:{getPriceString:F,onPageChange(e){var h;this.$router.push({name:(h=this.$route.name)==null?void 0:h.toString(),query:{page:e}})},onFetchData(){this.loading=!0,D.getAll({ordering:"-created_at",limit:this.limit,offset:(this.page-1)*this.limit,user_id:this.$store.getters.user.id}).then(({data:e})=>{this.orders=e.items,this.loading=!1,this.total=e.count}).catch(()=>{this.loading=!1})}}}),G={class:"title"},J={class:"key"},K={class:"copy"},Q={class:"price"},U={key:0},W={key:1,class:"state state-paid"},Y={key:2,class:"state state-finished"},Z={key:3,class:"state state-expired"},x={key:4,class:"state state-failed"},ee={class:"description"},te={class:"created-at"},ae={class:"float-right"},oe={class:"pagination"};function re(e,h,se,le,ne,ie){const _=s("el-col"),f=s("el-row"),k=s("copy-to-clipboard"),p=s("el-table-column"),c=s("el-tag"),g=s("el-button"),v=s("el-table"),C=s("el-card"),S=s("pagination"),E=q("loading");return l(),m(f,{class:"panel"},{default:t(()=>[a(_,{span:24},{default:t(()=>[a(f,null,{default:t(()=>[a(_,{span:24},{default:t(()=>[n("h2",G,r(e.$t("common.title.allOrders")),1)]),_:1})]),_:1}),a(f,null,{default:t(()=>[a(_,{span:24},{default:t(()=>[a(C,{shadow:"hover"},{default:t(()=>[M((l(),m(v,{data:e.orders,stripe:""},{default:t(()=>[a(p,{prop:"id",label:e.$t("order.field.id"),"class-name":"text-center",width:"350px"},{default:t(o=>[n("span",J,r(o.row.id),1),n("span",K,[a(k,{content:o.row.id},null,8,["content"])])]),_:1},8,["label"]),a(p,{label:e.$t("order.field.price"),width:"100px"},{default:t(o=>{var i;return[n("span",Q,r(e.getPriceString({value:(i=o.row)==null?void 0:i.price})),1)]}),_:1},8,["label"]),a(p,{prop:"state",label:e.$t("order.field.state"),"class-name":"text-center",width:"150px"},{default:t(o=>{var i,w,y,$,b;return[o.row.state===((i=e.OrderState)==null?void 0:i.PENDING)?(l(),u("span",U,[a(c,{type:"info",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.pending")),1)]),_:1})])):o.row.state===((w=e.OrderState)==null?void 0:w.PAID)?(l(),u("span",W,[a(c,{type:"success",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.paid")),1)]),_:1})])):o.row.state===((y=e.OrderState)==null?void 0:y.FINISHED)?(l(),u("span",Y,[a(c,{type:"success",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.finished")),1)]),_:1})])):o.row.state===(($=e.OrderState)==null?void 0:$.EXPIRED)?(l(),u("span",Z,[a(c,{type:"danger",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.expired")),1)]),_:1})])):o.row.state===((b=e.OrderState)==null?void 0:b.FAILED)?(l(),u("span",x,[a(c,{type:"danger",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.failed")),1)]),_:1})])):X("v-if",!0)]}),_:1},8,["label"]),a(p,{label:e.$t("order.field.description"),width:"300px"},{default:t(o=>[n("span",ee,r(o.row.description),1)]),_:1},8,["label"]),a(p,{label:e.$t("order.field.createdAt"),width:"180px"},{default:t(o=>[n("span",te,r(e.$dayjs.format(o.row.created_at)),1)]),_:1},8,["label"]),a(p,{fixed:"right","min-width":"120px"},{default:t(o=>[n("div",ae,[o.row.state!==e.OrderState.PAID&&o.row.state!==e.OrderState.FINISHED&&o.row.state!==e.OrderState.EXPIRED?(l(),m(g,{key:0,type:"primary",size:"small",round:"",onClick:i=>e.$router.push({name:"console-order-detail",params:{id:o.row.id}})},{default:t(()=>[d(r(e.$t("order.button.continuePay")),1)]),_:2},1032,["onClick"])):(l(),m(g,{key:1,size:"small",round:"",onClick:i=>e.$router.push({name:"console-order-detail",params:{id:o.row.id}})},{default:t(()=>[d(r(e.$t("order.button.checkDetail")),1)]),_:2},1032,["onClick"]))])]),_:1})]),_:1},8,["data"])),[[E,e.loading]])]),_:1})]),_:1})]),_:1}),a(f,null,{default:t(()=>[a(_,null,{default:t(()=>[n("div",oe,[a(S,{"current-page":e.page,"page-size":e.limit,total:e.total,onChange:e.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}var be=N(j,[["render",re],["__scopeId","data-v-388af89b"],["__file","/home/runner/work/Nexior/Nexior/src/pages/console/order/List.vue"]]);export{be as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var S=Object.defineProperty;var T=(e,t,o)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var w=(e,t,o)=>(T(e,typeof t!="symbol"?t+"":t,o),o);import"./vendor-others.2105a885.js";import{I as L}from"./credential.26787c24.js";import{B as C,_ as D,F as N}from"./index.
|
|
1
|
+
var S=Object.defineProperty;var T=(e,t,o)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var w=(e,t,o)=>(T(e,typeof t!="symbol"?t+"":t,o),o);import"./vendor-others.2105a885.js";import{I as L}from"./credential.26787c24.js";import{B as C,_ as D,F as N}from"./index.e160e9a8.js";import{P as B}from"./Pagination.ef8fafe0.js";import{C as O}from"./CopyToClipboard.d2c28170.js";import{b as P,u as R,K as z,L as j,i as H,h as K,w as M,r as G}from"./vendor-element-plus.6158e0fe.js";import{H as J,al as i,av as Q,L as g,M as n,o as u,V as l,f as r,T as s,e as f,ai as $,U as b,O as W,S as X,R as Y}from"./vendor-@vue.66ea933c.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.46bc4fb1.js";import"./vendor-fortawesome.fe21f86d.js";class Z{constructor(){w(this,"key","usage/apis")}async getAll(t){return await C.get(`/${this.key}/`,{params:t})}async get(t){return await C.get(`/${this.key}/${t}`)}}const x=new Z;const U=J({name:"ConsoleUsageList",components:{Pagination:B,ElTag:P,ElTable:R,ElSelect:z,ElOption:j,CopyToClipboard:O,ElRow:H,ElCol:K,ElTableColumn:M,ElCard:G},data(){var e,t;return{applicationId:(e=this.$route.query.application_id)==null?void 0:e.toString(),apiId:(t=this.$route.query.api_id)==null?void 0:t.toString(),applications:[],credentialType:L,apiUsages:[],loading:!1,total:void 0,limit:15}},computed:{redirect(){var e;return(e=this.$route.query)==null?void 0:e.redirect},page(){var e;return parseInt(((e=this.$route.query.page)==null?void 0:e.toString())||"1")},apis(){return this.applications.filter(e=>this.applicationId?e.id===this.applicationId:!0).map(e=>{var t;return(t=e.service)==null?void 0:t.apis}).flat()}},watch:{page:{handler(){this.onFetchApiUsages()}},type:{handler(){this.onFetchApiUsages()}}},mounted(){this.onFetchApplications(),this.onFetchApiUsages()},methods:{async onApiChange(e){var t;await this.$router.push({name:(t=this.$route.name)==null?void 0:t.toString(),query:{...this.$route.query,api_id:e}}),this.onFetchApiUsages()},async onApplicationChange(e){var t;await this.$router.push({name:(t=this.$route.name)==null?void 0:t.toString(),query:{...this.$route.query,application_id:e}}),this.onFetchApiUsages()},onPageChange(e){var t;this.$router.push({name:(t=this.$route.name)==null?void 0:t.toString(),query:{...this.$route.query,page:e}})},getRemainingAmount(e){var o,d;if(e.remaining_amount===void 0||e.remaining_amount===null)return"";const t=this.$t(`service.unit.${(o=e==null?void 0:e.service)==null?void 0:o.unit}s`);return`${(d=e.remaining_amount)==null?void 0:d.toFixed(6)} ${t}`},getUsedAmount(e){var o,d;if(e.used_amount===void 0||e.used_amount===null)return"";const t=this.$t(`service.unit.${(o=e==null?void 0:e.service)==null?void 0:o.unit}s`);return`${(d=e.used_amount)==null?void 0:d.toFixed(6)} ${t}`},getDeductedAmount(e){var o,d;if((e==null?void 0:e.deducted_amount)===void 0||(e==null?void 0:e.deducted_amount)===null)return"";const t=this.$t(`service.unit.${(o=e==null?void 0:e.service)==null?void 0:o.unit}s`);return`${(d=e.deducted_amount)==null?void 0:d.toFixed(6)} ${t}`},onFetchApplications(){N.getAll({limit:100,offset:0,user_id:this.$store.getters.user.id,ordering:"-created_at"}).then(({data:e})=>{this.applications=e.items,this.total=e.count}).catch(()=>{})},onFetchApiUsages(){this.loading=!0,x.getAll({limit:this.limit,offset:(this.page-1)*this.limit,user_id:this.$store.getters.user.id,ordering:"-created_at",...this.applicationId?{application_id:this.applicationId}:{},...this.apiId?{api_id:this.apiId}:{}}).then(({data:e})=>{this.apiUsages=e.items,this.loading=!1,this.total=e.count}).catch(()=>{this.loading=!1})}}}),ee={class:"title"},te={class:"inline-block mr-3"},ae={class:"inline-block mr-3"},ne={class:"key"},le={key:0,class:"copy"},oe={class:"created-at"},ie={class:"pagination"};function se(e,t,o,d,re,de){const A=i("help-entry"),h=i("el-col"),m=i("el-row"),y=i("el-option"),v=i("el-select"),p=i("el-table-column"),I=i("el-tag"),k=i("copy-to-clipboard"),F=i("el-table"),V=i("el-card"),q=i("pagination"),E=Q("loading");return u(),g(m,{class:"panel"},{default:n(()=>[l(A,{class:"help"}),l(h,{span:24},{default:n(()=>[l(m,null,{default:n(()=>[l(h,{span:24},{default:n(()=>[r("h2",ee,s(e.$t("common.title.allUsages")),1)]),_:1})]),_:1}),l(m,null,{default:n(()=>[l(h,{md:8,sm:12,class:"mb-4"},{default:n(()=>[r("span",te,s(e.$t("usage.field.application")),1),l(v,{modelValue:e.applicationId,"onUpdate:modelValue":t[0]||(t[0]=a=>e.applicationId=a),placeholder:e.$t("usage.field.application"),clearable:"",onChange:e.onApplicationChange},{default:n(()=>[(u(!0),f(b,null,$(e.applications,a=>{var c;return u(),g(y,{key:a.id,label:(c=a.service)==null?void 0:c.title,value:a==null?void 0:a.id},null,8,["label","value"])}),128))]),_:1},8,["modelValue","placeholder","onChange"])]),_:1}),l(h,{md:8,sm:12,class:"mb-4"},{default:n(()=>[r("span",ae,s(e.$t("usage.field.api")),1),l(v,{modelValue:e.apiId,"onUpdate:modelValue":t[1]||(t[1]=a=>e.apiId=a),placeholder:e.$t("usage.field.api"),clearable:"",onChange:e.onApiChange},{default:n(()=>[(u(!0),f(b,null,$(e.apis,a=>(u(),g(y,{key:a==null?void 0:a.id,label:a==null?void 0:a.title,value:a==null?void 0:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","onChange"])]),_:1})]),_:1}),l(m,null,{default:n(()=>[l(h,{span:24},{default:n(()=>[l(V,{shadow:"hover"},{default:n(()=>[W((u(),g(F,{data:e.apiUsages,stripe:"","table-layout":"fixed","empty-text":e.$t("common.message.noData")},{default:n(()=>[l(p,{label:e.$t("application.field.name"),width:"160px"},{default:n(a=>{var c,_;return[r("span",null,s((_=(c=a.row)==null?void 0:c.api)==null?void 0:_.title),1)]}),_:1},8,["label"]),l(p,{label:e.$t("usage.field.statusCode"),width:"120px"},{default:n(a=>[r("span",null,s(a.row.status_code),1)]),_:1},8,["label"]),l(p,{prop:"remaining_amount",label:e.$t("usage.field.remainingAmount"),width:"160px","class-name":"text-center"},{default:n(a=>[r("span",null,s(e.getRemainingAmount(a.row)),1)]),_:1},8,["label"]),l(p,{prop:"deducted_amount",label:e.$t("usage.field.deductedAmount"),width:"150px","class-name":"text-center"},{default:n(a=>[r("span",null,s(e.getDeductedAmount(a.row)),1)]),_:1},8,["label"]),l(p,{prop:"metadata",label:e.$t("usage.field.metadata"),width:"200px","class-name":"text-center"},{default:n(a=>[(u(!0),f(b,null,$(a.row.metadata,(c,_)=>(u(),g(I,{key:_,class:"mb-2"},{default:n(()=>[X(s(_)+": "+s(c),1)]),_:2},1024))),128))]),_:1},8,["label"]),l(p,{prop:"trace_id",label:e.$t("application.field.traceId"),width:"200px","class-name":"text-center"},{default:n(a=>[r("span",ne,s(a.row.trace_id),1),a.row.trace_id?(u(),f("span",le,[l(k,{content:a.row.trace_id,class:"inline-block"},null,8,["content"])])):Y("v-if",!0)]),_:1},8,["label"]),l(p,{label:e.$t("usage.field.createdAt"),width:"200px"},{default:n(a=>[r("span",oe,s(e.$dayjs.format(a.row.created_at)),1)]),_:1},8,["label"])]),_:1},8,["data","empty-text"])),[[E,e.loading]])]),_:1})]),_:1})]),_:1}),l(m,null,{default:n(()=>[l(h,null,{default:n(()=>[r("div",ie,[l(q,{"current-page":e.page,"page-size":e.limit,total:e.total,onChange:e.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}var ve=D(U,[["render",se],["__scopeId","data-v-1d3a6fa8"],["__file","/home/runner/work/Nexior/Nexior/src/pages/console/usage/List.vue"]]);export{ve as default};
|