@acedatacloud/nexior 3.2.0 → 3.2.1
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.dc0f8198.js → Auth.eb29fecd.js} +1 -1
- package/dist/assets/{Callback.c84fb6fc.js → Callback.bce756e7.js} +1 -1
- package/dist/assets/{Chatdoc.881bdb8d.js → Chatdoc.2bb8cda8.js} +1 -1
- package/dist/assets/{Console.a63ee771.js → Console.6f0786f8.js} +1 -1
- package/dist/assets/{Conversation.430407d2.js → Conversation.25d261b6.js} +1 -1
- package/dist/assets/{Conversation.0eb95938.js → Conversation.759ee12a.js} +1 -1
- package/dist/assets/{CopyToClipboard.aee8f89c.js → CopyToClipboard.8ebe33f6.js} +1 -1
- package/dist/assets/{Detail.e40da8b9.js → Detail.818f0f0f.js} +1 -1
- package/dist/assets/{EditArray.f4e1d8d3.js → EditArray.d15327ac.js} +1 -1
- package/dist/assets/{Extra.13d1c29e.js → Extra.0d9481ce.js} +1 -1
- package/dist/assets/{History.0908b85e.js → History.6dca5230.js} +1 -1
- package/dist/assets/{ImagePreview.54c0d919.js → ImagePreview.ea09ed5a.js} +1 -1
- package/dist/assets/{Index.1328d83c.js → Index.2cd1e2e3.js} +1 -1
- package/dist/assets/{Index.620d6fa4.js → Index.3c3f4fc1.js} +1 -1
- package/dist/assets/{Index.aa0c72cd.js → Index.42e8374d.js} +1 -1
- package/dist/assets/{Index.133c8f72.js → Index.69a9fb96.js} +1 -1
- package/dist/assets/{Index.490f668c.js → Index.6d6821d7.js} +1 -1
- package/dist/assets/{Index.b7f01e56.js → Index.7ee208d3.js} +1 -1
- package/dist/assets/{Index.ab801808.js → Index.81276373.js} +1 -1
- package/dist/assets/{Index.68b099af.js → Index.8a860c6b.js} +1 -1
- package/dist/assets/{Index.87260201.js → Index.a1a6a08f.js} +1 -1
- package/dist/assets/{Index.95af3227.js → Index.c7a00d2d.js} +1 -1
- package/dist/assets/{Index.208ada82.js → Index.ccacec38.js} +1 -1
- package/dist/assets/{Index.21d09fc4.js → Index.d8f1673b.js} +1 -1
- package/dist/assets/{Index.52de416f.js → Index.e988e706.js} +1 -1
- package/dist/assets/{InfoIcon.14b5afde.js → InfoIcon.1ef9ef71.js} +1 -1
- package/dist/assets/{Invitees.410a019d.js → Invitees.263d89e3.js} +1 -1
- package/dist/assets/{List.b24921db.js → List.11b23cd7.js} +1 -1
- package/dist/assets/{List.fa9a32f3.js → List.c31ec3d1.js} +1 -1
- package/dist/assets/{List.c488a4c6.js → List.f3eb857a.js} +1 -1
- package/dist/assets/{Login.3c14fed5.js → Login.9ed2b526.js} +1 -1
- package/dist/assets/{Main.f96fd729.js → Main.0008686f.js} +1 -1
- package/dist/assets/{Manage.68c3411c.js → Manage.780d1470.js} +1 -1
- package/dist/assets/{MarkdownRenderer.c3398df9.js → MarkdownRenderer.257f3d63.js} +1 -1
- package/dist/assets/{Navigator.e1dcc3e1.js → Navigator.87c585b8.js} +1 -1
- package/dist/assets/{Pagination.d881f818.js → Pagination.3b90ea43.js} +1 -1
- package/dist/assets/{Setting.50591e0a.js → Setting.541358e7.js} +1 -1
- package/dist/assets/{Status.eedcb19a.js → Status.d10547c8.js} +1 -1
- package/dist/assets/{Subscribe.8f0b1021.js → Subscribe.f1acca46.js} +1 -1
- package/dist/assets/{distribution.e3b109ee.js → distribution.bb1d0ed8.js} +1 -1
- package/dist/assets/{index.531671ec.js → index.d28a66ae.js} +3 -3
- package/dist/assets/{order.9dbff1b5.js → order.6d451728.js} +1 -1
- package/dist/assets/{price.37afa6c7.js → price.e1faf3aa.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ae as ve}from"./vendor-others.e28a6fa7.js";import{ar as K}from"./vendor-fortawesome.0d8f27df.js";import{_ as k,aE as ge,aF as $e,aG as ye,A as Q,a0 as B,F as be,ad as ke,aH as we,W as Ie}from"./index.531671ec.js";import{Q as Ve,u as R,p as W,x as J,y,t as Se,m as Ee,I as Ue,s as Ce,H as Le,V as Pe}from"./vendor-element-plus.7eade167.js";import{H as w,al as n,o as r,e as p,f as l,I as H,V as s,M as m,T as i,S as v,L as P,R as g,P as q,U as fe,ai as he}from"./vendor-@vue.8cef8b94.js";import{I as A}from"./InfoIcon.14b5afde.js";import{C as Ne}from"./CopyToClipboard.aee8f89c.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const Te=w({name:"LayoutLuma",components:{ElDrawer:Ve,ElButton:R,FontAwesomeIcon:K},data(){return{drawer:!1}}}),Ae={class:"main"},Re={class:"config"},Ge={class:"result"};function De(e,t,o,a,f,h){const c=n("font-awesome-icon"),u=n("el-button"),d=n("el-drawer");return r(),p("div",Ae,[l("div",Re,[H(e.$slots,"config",{},void 0,!0)]),l("div",Ge,[H(e.$slots,"result",{},void 0,!0)]),s(u,{round:"",class:"menu",onClick:t[0]||(t[0]=_=>e.drawer=!0)},{default:m(()=>[s(c,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),s(d,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=_=>e.drawer=_),"with-header":!1,size:"340px",class:"drawer"},{default:m(()=>[H(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var ze=k(Te,[["render",De],["__scopeId","data-v-234cfb9c"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Luma.vue"]]);const Fe=w({name:"EnhancementSelector",components:{ElSwitch:W,InfoIcon:A},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=ge)}}),Me={class:"field"},Oe={class:"title font-bold"};function je(e,t,o,a,f,h){const c=n("el-switch"),u=n("info-icon");return r(),p("div",Me,[l("h2",Oe,i(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 qe=k(Fe,[["render",je],["__scopeId","data-v-175365a0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/EnhancementSelector.vue"]]);const Be=w({name:"CustomSelector",components:{ElSwitch:W,InfoIcon:A},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=$e)}}),He={class:"field"},Ke={class:"title font-bold"};function Qe(e,t,o,a,f,h){const c=n("el-switch"),u=n("info-icon");return r(),p("div",He,[l("h2",Ke,i(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 We=k(Be,[["render",Qe],["__scopeId","data-v-5ac2addb"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/CustomSelector.vue"]]);const Je=w({name:"LoopSelector",components:{ElSwitch:W,InfoIcon:A},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=ye)}}),Xe={class:"field"},Ye={class:"title font-bold"};function Ze(e,t,o,a,f,h){const c=n("el-switch"),u=n("info-icon");return r(),p("div",Xe,[l("h2",Ye,i(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 xe=k(Je,[["render",Ze],["__scopeId","data-v-69cccd4e"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/LoopSelector.vue"]]);const et=w({name:"ContentInput",components:{ElUpload:J,ElButton:R,InfoIcon:A},data(){return{fileList:[],uploadUrl:Q()+"/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()}}}),tt={class:"field"},ot={class:"title font-bold"},st={class:"upload-wrapper"};function nt(e,t,o,a,f,h){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",tt,[l("h2",ot,i(e.$t("luma.name.endImageUrl")),1),l("div",st,[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(()=>[v(i(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 at=k(et,[["render",nt],["__scopeId","data-v-97900bb4"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/EndImageUrlInput.vue"]]);const lt=w({name:"StartImageUrlInput",components:{ElUpload:J,ElButton:R,InfoIcon:A},data(){return{fileList:[],uploadUrl:Q()+"/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()}}}),it={class:"field"},rt={class:"title font-bold"},ct={class:"upload-wrapper"};function ut(e,t,o,a,f,h){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",it,[l("h2",rt,i(e.$t("luma.name.startImageUrl")),1),l("div",ct,[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(()=>[v(i(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 dt=k(lt,[["render",ut],["__scopeId","data-v-5440a4bf"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/StartImageUrlInput.vue"]]);const mt=w({name:"UploadVideo",components:{ElUpload:J,ElButton:R,InfoIcon:A},data(){return{fileList:[],uploadUrl:Q()+"/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()}}}),pt={class:"field"},_t={class:"title font-bold"},ft={class:"upload-wrapper"};function ht(e,t,o,a,f,h){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",pt,[l("h2",_t,i(e.$t("luma.name.videoUrl")),1),l("div",ft,[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(()=>[v(i(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 vt=k(mt,[["render",ht],["__scopeId","data-v-46c66c9f"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/UploadVideo.vue"]]);const gt="",$t=w({name:"PromptInput",components:{ElInput:Se,InfoIcon:A},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=gt)}}),yt={class:"field"},bt={class:"box"},kt={class:"title font-bold"};function wt(e,t,o,a,f,h){const c=n("info-icon"),u=n("el-input");return r(),p("div",yt,[l("div",bt,[l("h2",kt,i(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 It=k($t,[["render",wt],["__scopeId","data-v-19a7446b"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/PromptInput.vue"]]);const Vt=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}}}),St={class:"field"},Et={class:"box"},Ut={class:"title font-bold"},Ct={class:"task"},Lt=["data-poster"],Pt=["src"];function Nt(e,t,o,a,f,h){const c=n("vue-plyr");return r(),p("div",St,[l("div",Et,[l("h2",Ut,i(e.$t("luma.name.extend")),1)]),l("div",Ct,[l("div",null,[s(c,{options:e.options,class:"video"},{default:m(()=>{var u,d;return[l("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(u=e.config)==null?void 0:u.thumbnail_url},[l("source",{size:"1080",src:(d=e.config)==null?void 0:d.video_url,type:"video/mp4"},null,8,Pt)],8,Lt)]}),_:1},8,["options"])])])])}var Tt=k(Vt,[["render",Nt],["__scopeId","data-v-1cefb16b"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/ExtendFromInput.vue"]]);const At=w({name:"PresetPanel",components:{LoopSelector:xe,StartImageUrlInput:dt,EndImageUrlInput:at,EnhancementSelector:qe,ElButton:R,FontAwesomeIcon:K,PromptInput:It,ExtendFromInput:Tt,CustomSelector:We,UploadVideo:vt},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.luma)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Rt={class:"panel"},Gt={class:"config"},Dt={class:"actions"};function zt(e,t,o,a,f,h){var L,V,T,G,D,z,F,M,O;const c=n("extend-from-input"),u=n("prompt-input"),d=n("custom-selector"),_=n("upload-video"),$=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",Rt,[l("div",Gt,[((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"})):g("v-if",!0),s(u,{class:"mb-4"}),(T=e.config)!=null&&T.video_id?g("v-if",!0):(r(),P(d,{key:1,class:"mb-4"})),(G=e.config)!=null&&G.custom?(r(),P(_,{key:2,class:"mb-4"})):g("v-if",!0),!(((D=e.config)==null?void 0:D.video_id)||((z=e.config)==null?void 0:z.video_url))&&!((F=e.config)!=null&&F.custom)?(r(),P($,{key:3,class:"mb-4"})):g("v-if",!0),s(S,{class:"mb-4"}),s(E,{class:"mb-4"}),s(N,{class:"mb-4"}),l("div",Dt,[((M=e.config)==null?void 0:M.video_url)!==void 0||((O=e.config)==null?void 0:O.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"}),v(" "+i(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"}),v(" "+i(e.$t("luma.button.generate")),1)]),_:1},8,["onClick"]))])])])}var Ft=k(At,[["render",zt],["__scopeId","data-v-951b4cc0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/ConfigPanel.vue"]]);const Mt=w({name:"VideoPlayer",components:{VuePlyr:ve},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),Ot=["data-poster"],jt=["src"];function qt(e,t,o,a,f,h){const c=n("vue-plyr");return r(),p("div",null,[s(c,{options:e.options,class:"video"},{default:m(()=>{var u,d,_,$;return[l("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(d=(u=e.modelValue)==null?void 0:u.response)==null?void 0:d.thumbnail_url},[l("source",{size:"1080",src:($=(_=e.modelValue)==null?void 0:_.response)==null?void 0:$.video_url,type:"video/mp4"},null,8,jt)],8,Ot)]}),_:1},8,["options"])])}var Bt=k(Mt,[["render",qt],["__scopeId","data-v-759e400c"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/VideoPlayer.vue"]]);const Ht=w({name:"TaskPreview",components:{ElImage:Ee,CopyToClipboard:Ne,FontAwesomeIcon:K,ElAlert:Ue,VideoPlayer:Bt,ElTooltip:Ce,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"},Qt={class:"left"},Wt={class:"main"},Jt={class:"bot"},Xt={class:"datetime"},Yt={class:"info"},Zt={key:0,class:"prompt mt-2"},xt={key:0},eo={key:1},to={key:0,class:q({content:!0,failed:!0})},oo={class:"image-wrapper"},so={key:0,class:q({operations:!0,"mt-2":!0})},no={class:"description"},ao={key:1,class:q({content:!0})},lo={class:"description"},io={class:"description"},ro={class:"description"},co={key:2,class:q({content:!0})},uo={class:"description"};function mo(e,t,o,a,f,h){var N,U,C,L,V,T,G,D,z,F,M,O,X,Y,Z,x,ee,te,oe,se,ne,ae,le;const c=n("el-image"),u=n("VideoPlayer"),d=n("el-button"),_=n("el-tooltip"),$=n("font-awesome-icon"),S=n("copy-to-clipboard"),E=n("el-alert");return r(),p("div",Kt,[l("div",Qt,[s(c,{src:"https://cdn.acedata.cloud/ahjfwi.png",class:"avatar"})]),l("div",Wt,[l("div",Jt,[v(i(e.$t("luma.name.lumaBot"))+" ",1),l("span",Xt,i(e.$dayjs.format(""+new Date(parseFloat(((N=e.modelValue)==null?void 0:N.created_at)||"")*1e3))),1)]),l("div",Yt,[(C=(U=e.modelValue)==null?void 0:U.request)!=null&&C.prompt?(r(),p("p",Zt,[v(i((V=(L=e.modelValue)==null?void 0:L.request)==null?void 0:V.prompt)+" ",1),(T=e.modelValue)!=null&&T.response?g("v-if",!0):(r(),p("span",xt," - ("+i(e.$t("luma.status.pending"))+") ",1)),((D=(G=e.modelValue)==null?void 0:G.response)==null?void 0:D.state)==="processing"||((F=(z=e.modelValue)==null?void 0:z.response)==null?void 0:F.state)==="pending"?(r(),p("span",eo," - ("+i(e.$t("luma.status.processing"))+") ",1)):g("v-if",!0)])):g("v-if",!0)]),g(" Display success message "),((O=(M=e.modelValue)==null?void 0:M.response)==null?void 0:O.success)===!0?(r(),p("div",to,[l("div",oo,[s(u,{"model-value":e.modelValue},null,8,["model-value"])]),((X=e.modelValue)==null?void 0:X.response)&&!((Y=e.config)!=null&&Y.custom)?(r(),p("div",so,[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(()=>[v(i(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(()=>[v(i(e.$t("luma.button.download")),1)]),_:1})]),_:1},8,["content"])])):g("v-if",!0),s(E,{closable:!1,class:"mt-2 success"},{default:m(()=>{var I,b;return[l("p",no,[s($,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+i(e.$t("luma.name.taskId"))+": "+i((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})])):g("v-if",!0),g(" 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",ao,[s(E,{closable:!1,class:"failure"},{template:m(()=>[s($,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),v(" "+i(e.$t("luma.name.failure")),1)]),default:m(()=>{var I,b,j,ie,re,ce,ue,de,me,pe,_e;return[l("p",lo,[s($,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+i(e.$t("luma.name.taskId"))+": "+i((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"])]),l("p",io,[s($,{icon:"fa-solid fa-circle-info",class:"mr-1"}),v(" "+i(e.$t("luma.name.failureReason"))+": "+i((re=(ie=(j=e.modelValue)==null?void 0:j.response)==null?void 0:ie.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"])]),l("p",ro,[s($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),v(" "+i(e.$t("luma.name.traceId"))+": "+i((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})])):g("v-if",!0),g(" Display error message "),!((oe=e.modelValue)!=null&&oe.response)||((ne=(se=e.modelValue)==null?void 0:se.response)==null?void 0:ne.state)==="processing"||((le=(ae=e.modelValue)==null?void 0:ae.response)==null?void 0:le.state)==="pending"?(r(),p("div",co,[s(E,{closable:!1,class:"info"},{template:m(()=>[s($,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),v(" "+i(e.$t("luma.name.failure")),1)]),default:m(()=>{var I,b;return[l("p",uo,[s($,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+i(e.$t("luma.name.taskId"))+": "+i((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})])):g("v-if",!0)])])}var po=k(Ht,[["render",mo],["__scopeId","data-v-077795a0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/task/Preview.vue"]]);const _o=w({name:"RecentPanel",components:{TaskPreview:po,ElSkeleton:Le,ElSkeletonItem:Pe},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")}}}),fo={key:0,class:"tasks"},ho={class:"left"},vo={class:"main"},go={key:1,class:"tasks"},$o={key:2,class:"description"};function yo(e,t,o,a,f,h){var _,$,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",fo,[(r(),p(fe,null,he(3,V=>l("div",{key:V,class:"task placeholder"},[l("div",ho,[s(u,{animated:""},{template:m(()=>[s(c,{variant:"image",class:"avatar"})]),_:1})]),l("div",vo,[s(u,{animated:""},{template:m(()=>[s(c,{variant:"p",class:"title"}),s(c,{variant:"image",class:"icon"})]),_:1})])])),64))])):((S=($=e.tasks)==null?void 0:$.items)==null?void 0:S.length)&&((N=(E=e.tasks)==null?void 0:E.items)==null?void 0:N.length)>0?(r(),p("div",go,[(r(!0),p(fe,null,he((U=e.tasks)==null?void 0:U.items,(V,T)=>(r(),P(d,{key:T,"model-value":V,class:"preview"},null,8,["model-value"]))),128))])):g("v-if",!0),((L=(C=e.tasks)==null?void 0:C.items)==null?void 0:L.length)===0?(r(),p("p",$o,i(e.$t("luma.message.noTasks")),1)):g("v-if",!0)],544)}var bo=k(_o,[["render",yo],["__scopeId","data-v-2f8302a7"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/RecentPanel.vue"]]);const ko="https://webhook.acedata.cloud/luma",wo=w({name:"LumaIndex",components:{ConfigPanel:Ft,Layout:ze,RecentPanel:bo},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)===B.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===B.Request},needApply(){return this.$store.state.luma.status.getApplications===B.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(){be.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)===ke&&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 onGenerate(){var o;const e={...this.config,callback_url:ko},t=(o=this.credential)==null?void 0:o.token;if(!t){console.error("no token specified");return}y.info(this.$t("luma.message.startingTask")),we.generate(e,{token:t}).then(()=>{y.success(this.$t("luma.message.startTaskSuccess")),this.$store.commit("luma/setConfig",{config:void 0})}).catch(a=>{var h,c;const f=(h=a==null?void 0:a.response)==null?void 0:h.data;((c=f==null?void 0:f.error)==null?void 0:c.code)===Ie?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 Io(e,t,o,a,f,h){const c=n("config-panel"),u=n("recent-panel"),d=n("layout");return r(),P(d,null,{config:m(()=>[s(c,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:m(()=>[s(u,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"])]),_:1})}var Ao=k(wo,[["render",Io],["__scopeId","data-v-c45e0af8"],["__file","/home/runner/work/Nexior/Nexior/src/pages/luma/Index.vue"]]);export{Ao as default};
|
|
1
|
+
import{ae as ve}from"./vendor-others.e28a6fa7.js";import{ar as K}from"./vendor-fortawesome.0d8f27df.js";import{_ as k,aE as ge,aF as $e,aG as ye,A as Q,a0 as B,F as be,ad as ke,aH as we,W as Ie}from"./index.d28a66ae.js";import{Q as Ve,u as R,p as W,x as J,y,t as Se,m as Ee,I as Ue,s as Ce,H as Le,V as Pe}from"./vendor-element-plus.7eade167.js";import{H as w,al as n,o as r,e as p,f as l,I as H,V as s,M as m,T as i,S as v,L as P,R as g,P as q,U as fe,ai as he}from"./vendor-@vue.8cef8b94.js";import{I as A}from"./InfoIcon.1ef9ef71.js";import{C as Ne}from"./CopyToClipboard.8ebe33f6.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const Te=w({name:"LayoutLuma",components:{ElDrawer:Ve,ElButton:R,FontAwesomeIcon:K},data(){return{drawer:!1}}}),Ae={class:"main"},Re={class:"config"},Ge={class:"result"};function De(e,t,o,a,f,h){const c=n("font-awesome-icon"),u=n("el-button"),d=n("el-drawer");return r(),p("div",Ae,[l("div",Re,[H(e.$slots,"config",{},void 0,!0)]),l("div",Ge,[H(e.$slots,"result",{},void 0,!0)]),s(u,{round:"",class:"menu",onClick:t[0]||(t[0]=_=>e.drawer=!0)},{default:m(()=>[s(c,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),s(d,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=_=>e.drawer=_),"with-header":!1,size:"340px",class:"drawer"},{default:m(()=>[H(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var ze=k(Te,[["render",De],["__scopeId","data-v-234cfb9c"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Luma.vue"]]);const Fe=w({name:"EnhancementSelector",components:{ElSwitch:W,InfoIcon:A},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=ge)}}),Me={class:"field"},Oe={class:"title font-bold"};function je(e,t,o,a,f,h){const c=n("el-switch"),u=n("info-icon");return r(),p("div",Me,[l("h2",Oe,i(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 qe=k(Fe,[["render",je],["__scopeId","data-v-175365a0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/EnhancementSelector.vue"]]);const Be=w({name:"CustomSelector",components:{ElSwitch:W,InfoIcon:A},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=$e)}}),He={class:"field"},Ke={class:"title font-bold"};function Qe(e,t,o,a,f,h){const c=n("el-switch"),u=n("info-icon");return r(),p("div",He,[l("h2",Ke,i(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 We=k(Be,[["render",Qe],["__scopeId","data-v-5ac2addb"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/CustomSelector.vue"]]);const Je=w({name:"LoopSelector",components:{ElSwitch:W,InfoIcon:A},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=ye)}}),Xe={class:"field"},Ye={class:"title font-bold"};function Ze(e,t,o,a,f,h){const c=n("el-switch"),u=n("info-icon");return r(),p("div",Xe,[l("h2",Ye,i(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 xe=k(Je,[["render",Ze],["__scopeId","data-v-69cccd4e"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/LoopSelector.vue"]]);const et=w({name:"ContentInput",components:{ElUpload:J,ElButton:R,InfoIcon:A},data(){return{fileList:[],uploadUrl:Q()+"/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()}}}),tt={class:"field"},ot={class:"title font-bold"},st={class:"upload-wrapper"};function nt(e,t,o,a,f,h){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",tt,[l("h2",ot,i(e.$t("luma.name.endImageUrl")),1),l("div",st,[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(()=>[v(i(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 at=k(et,[["render",nt],["__scopeId","data-v-97900bb4"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/EndImageUrlInput.vue"]]);const lt=w({name:"StartImageUrlInput",components:{ElUpload:J,ElButton:R,InfoIcon:A},data(){return{fileList:[],uploadUrl:Q()+"/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()}}}),it={class:"field"},rt={class:"title font-bold"},ct={class:"upload-wrapper"};function ut(e,t,o,a,f,h){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",it,[l("h2",rt,i(e.$t("luma.name.startImageUrl")),1),l("div",ct,[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(()=>[v(i(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 dt=k(lt,[["render",ut],["__scopeId","data-v-5440a4bf"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/StartImageUrlInput.vue"]]);const mt=w({name:"UploadVideo",components:{ElUpload:J,ElButton:R,InfoIcon:A},data(){return{fileList:[],uploadUrl:Q()+"/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()}}}),pt={class:"field"},_t={class:"title font-bold"},ft={class:"upload-wrapper"};function ht(e,t,o,a,f,h){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",pt,[l("h2",_t,i(e.$t("luma.name.videoUrl")),1),l("div",ft,[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(()=>[v(i(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 vt=k(mt,[["render",ht],["__scopeId","data-v-46c66c9f"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/UploadVideo.vue"]]);const gt="",$t=w({name:"PromptInput",components:{ElInput:Se,InfoIcon:A},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=gt)}}),yt={class:"field"},bt={class:"box"},kt={class:"title font-bold"};function wt(e,t,o,a,f,h){const c=n("info-icon"),u=n("el-input");return r(),p("div",yt,[l("div",bt,[l("h2",kt,i(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 It=k($t,[["render",wt],["__scopeId","data-v-19a7446b"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/PromptInput.vue"]]);const Vt=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}}}),St={class:"field"},Et={class:"box"},Ut={class:"title font-bold"},Ct={class:"task"},Lt=["data-poster"],Pt=["src"];function Nt(e,t,o,a,f,h){const c=n("vue-plyr");return r(),p("div",St,[l("div",Et,[l("h2",Ut,i(e.$t("luma.name.extend")),1)]),l("div",Ct,[l("div",null,[s(c,{options:e.options,class:"video"},{default:m(()=>{var u,d;return[l("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(u=e.config)==null?void 0:u.thumbnail_url},[l("source",{size:"1080",src:(d=e.config)==null?void 0:d.video_url,type:"video/mp4"},null,8,Pt)],8,Lt)]}),_:1},8,["options"])])])])}var Tt=k(Vt,[["render",Nt],["__scopeId","data-v-1cefb16b"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/ExtendFromInput.vue"]]);const At=w({name:"PresetPanel",components:{LoopSelector:xe,StartImageUrlInput:dt,EndImageUrlInput:at,EnhancementSelector:qe,ElButton:R,FontAwesomeIcon:K,PromptInput:It,ExtendFromInput:Tt,CustomSelector:We,UploadVideo:vt},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.luma)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Rt={class:"panel"},Gt={class:"config"},Dt={class:"actions"};function zt(e,t,o,a,f,h){var L,V,T,G,D,z,F,M,O;const c=n("extend-from-input"),u=n("prompt-input"),d=n("custom-selector"),_=n("upload-video"),$=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",Rt,[l("div",Gt,[((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"})):g("v-if",!0),s(u,{class:"mb-4"}),(T=e.config)!=null&&T.video_id?g("v-if",!0):(r(),P(d,{key:1,class:"mb-4"})),(G=e.config)!=null&&G.custom?(r(),P(_,{key:2,class:"mb-4"})):g("v-if",!0),!(((D=e.config)==null?void 0:D.video_id)||((z=e.config)==null?void 0:z.video_url))&&!((F=e.config)!=null&&F.custom)?(r(),P($,{key:3,class:"mb-4"})):g("v-if",!0),s(S,{class:"mb-4"}),s(E,{class:"mb-4"}),s(N,{class:"mb-4"}),l("div",Dt,[((M=e.config)==null?void 0:M.video_url)!==void 0||((O=e.config)==null?void 0:O.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"}),v(" "+i(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"}),v(" "+i(e.$t("luma.button.generate")),1)]),_:1},8,["onClick"]))])])])}var Ft=k(At,[["render",zt],["__scopeId","data-v-951b4cc0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/ConfigPanel.vue"]]);const Mt=w({name:"VideoPlayer",components:{VuePlyr:ve},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),Ot=["data-poster"],jt=["src"];function qt(e,t,o,a,f,h){const c=n("vue-plyr");return r(),p("div",null,[s(c,{options:e.options,class:"video"},{default:m(()=>{var u,d,_,$;return[l("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(d=(u=e.modelValue)==null?void 0:u.response)==null?void 0:d.thumbnail_url},[l("source",{size:"1080",src:($=(_=e.modelValue)==null?void 0:_.response)==null?void 0:$.video_url,type:"video/mp4"},null,8,jt)],8,Ot)]}),_:1},8,["options"])])}var Bt=k(Mt,[["render",qt],["__scopeId","data-v-759e400c"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/VideoPlayer.vue"]]);const Ht=w({name:"TaskPreview",components:{ElImage:Ee,CopyToClipboard:Ne,FontAwesomeIcon:K,ElAlert:Ue,VideoPlayer:Bt,ElTooltip:Ce,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"},Qt={class:"left"},Wt={class:"main"},Jt={class:"bot"},Xt={class:"datetime"},Yt={class:"info"},Zt={key:0,class:"prompt mt-2"},xt={key:0},eo={key:1},to={key:0,class:q({content:!0,failed:!0})},oo={class:"image-wrapper"},so={key:0,class:q({operations:!0,"mt-2":!0})},no={class:"description"},ao={key:1,class:q({content:!0})},lo={class:"description"},io={class:"description"},ro={class:"description"},co={key:2,class:q({content:!0})},uo={class:"description"};function mo(e,t,o,a,f,h){var N,U,C,L,V,T,G,D,z,F,M,O,X,Y,Z,x,ee,te,oe,se,ne,ae,le;const c=n("el-image"),u=n("VideoPlayer"),d=n("el-button"),_=n("el-tooltip"),$=n("font-awesome-icon"),S=n("copy-to-clipboard"),E=n("el-alert");return r(),p("div",Kt,[l("div",Qt,[s(c,{src:"https://cdn.acedata.cloud/ahjfwi.png",class:"avatar"})]),l("div",Wt,[l("div",Jt,[v(i(e.$t("luma.name.lumaBot"))+" ",1),l("span",Xt,i(e.$dayjs.format(""+new Date(parseFloat(((N=e.modelValue)==null?void 0:N.created_at)||"")*1e3))),1)]),l("div",Yt,[(C=(U=e.modelValue)==null?void 0:U.request)!=null&&C.prompt?(r(),p("p",Zt,[v(i((V=(L=e.modelValue)==null?void 0:L.request)==null?void 0:V.prompt)+" ",1),(T=e.modelValue)!=null&&T.response?g("v-if",!0):(r(),p("span",xt," - ("+i(e.$t("luma.status.pending"))+") ",1)),((D=(G=e.modelValue)==null?void 0:G.response)==null?void 0:D.state)==="processing"||((F=(z=e.modelValue)==null?void 0:z.response)==null?void 0:F.state)==="pending"?(r(),p("span",eo," - ("+i(e.$t("luma.status.processing"))+") ",1)):g("v-if",!0)])):g("v-if",!0)]),g(" Display success message "),((O=(M=e.modelValue)==null?void 0:M.response)==null?void 0:O.success)===!0?(r(),p("div",to,[l("div",oo,[s(u,{"model-value":e.modelValue},null,8,["model-value"])]),((X=e.modelValue)==null?void 0:X.response)&&!((Y=e.config)!=null&&Y.custom)?(r(),p("div",so,[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(()=>[v(i(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(()=>[v(i(e.$t("luma.button.download")),1)]),_:1})]),_:1},8,["content"])])):g("v-if",!0),s(E,{closable:!1,class:"mt-2 success"},{default:m(()=>{var I,b;return[l("p",no,[s($,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+i(e.$t("luma.name.taskId"))+": "+i((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})])):g("v-if",!0),g(" 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",ao,[s(E,{closable:!1,class:"failure"},{template:m(()=>[s($,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),v(" "+i(e.$t("luma.name.failure")),1)]),default:m(()=>{var I,b,j,ie,re,ce,ue,de,me,pe,_e;return[l("p",lo,[s($,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+i(e.$t("luma.name.taskId"))+": "+i((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"])]),l("p",io,[s($,{icon:"fa-solid fa-circle-info",class:"mr-1"}),v(" "+i(e.$t("luma.name.failureReason"))+": "+i((re=(ie=(j=e.modelValue)==null?void 0:j.response)==null?void 0:ie.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"])]),l("p",ro,[s($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),v(" "+i(e.$t("luma.name.traceId"))+": "+i((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})])):g("v-if",!0),g(" Display error message "),!((oe=e.modelValue)!=null&&oe.response)||((ne=(se=e.modelValue)==null?void 0:se.response)==null?void 0:ne.state)==="processing"||((le=(ae=e.modelValue)==null?void 0:ae.response)==null?void 0:le.state)==="pending"?(r(),p("div",co,[s(E,{closable:!1,class:"info"},{template:m(()=>[s($,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),v(" "+i(e.$t("luma.name.failure")),1)]),default:m(()=>{var I,b;return[l("p",uo,[s($,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+i(e.$t("luma.name.taskId"))+": "+i((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})])):g("v-if",!0)])])}var po=k(Ht,[["render",mo],["__scopeId","data-v-077795a0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/task/Preview.vue"]]);const _o=w({name:"RecentPanel",components:{TaskPreview:po,ElSkeleton:Le,ElSkeletonItem:Pe},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")}}}),fo={key:0,class:"tasks"},ho={class:"left"},vo={class:"main"},go={key:1,class:"tasks"},$o={key:2,class:"description"};function yo(e,t,o,a,f,h){var _,$,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",fo,[(r(),p(fe,null,he(3,V=>l("div",{key:V,class:"task placeholder"},[l("div",ho,[s(u,{animated:""},{template:m(()=>[s(c,{variant:"image",class:"avatar"})]),_:1})]),l("div",vo,[s(u,{animated:""},{template:m(()=>[s(c,{variant:"p",class:"title"}),s(c,{variant:"image",class:"icon"})]),_:1})])])),64))])):((S=($=e.tasks)==null?void 0:$.items)==null?void 0:S.length)&&((N=(E=e.tasks)==null?void 0:E.items)==null?void 0:N.length)>0?(r(),p("div",go,[(r(!0),p(fe,null,he((U=e.tasks)==null?void 0:U.items,(V,T)=>(r(),P(d,{key:T,"model-value":V,class:"preview"},null,8,["model-value"]))),128))])):g("v-if",!0),((L=(C=e.tasks)==null?void 0:C.items)==null?void 0:L.length)===0?(r(),p("p",$o,i(e.$t("luma.message.noTasks")),1)):g("v-if",!0)],544)}var bo=k(_o,[["render",yo],["__scopeId","data-v-2f8302a7"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/RecentPanel.vue"]]);const ko="https://webhook.acedata.cloud/luma",wo=w({name:"LumaIndex",components:{ConfigPanel:Ft,Layout:ze,RecentPanel:bo},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)===B.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===B.Request},needApply(){return this.$store.state.luma.status.getApplications===B.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(){be.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)===ke&&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 onGenerate(){var o;const e={...this.config,callback_url:ko},t=(o=this.credential)==null?void 0:o.token;if(!t){console.error("no token specified");return}y.info(this.$t("luma.message.startingTask")),we.generate(e,{token:t}).then(()=>{y.success(this.$t("luma.message.startTaskSuccess")),this.$store.commit("luma/setConfig",{config:void 0})}).catch(a=>{var h,c;const f=(h=a==null?void 0:a.response)==null?void 0:h.data;((c=f==null?void 0:f.error)==null?void 0:c.code)===Ie?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 Io(e,t,o,a,f,h){const c=n("config-panel"),u=n("recent-panel"),d=n("layout");return r(),P(d,null,{config:m(()=>[s(c,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:m(()=>[s(u,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"])]),_:1})}var Ao=k(wo,[["render",Io],["__scopeId","data-v-c45e0af8"],["__file","/home/runner/work/Nexior/Nexior/src/pages/luma/Index.vue"]]);export{Ao as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-others.e28a6fa7.js";import{L as B}from"./Chatdoc.
|
|
1
|
+
import"./vendor-others.e28a6fa7.js";import{L as B}from"./Chatdoc.2bb8cda8.js";import{_ as w,a0 as $,aj as F}from"./index.d28a66ae.js";import{ar as y}from"./vendor-fortawesome.0d8f27df.js";import{u as T,E as U,n as z,o as L,t as M,y as _,F as x,A as j,B as q,h as H,j as O,i as G}from"./vendor-element-plus.7eade167.js";import{H as v,al as o,o as u,e as C,V as t,M as s,S as V,T as r,f as a,U as k,L as g,ai as K,R as J}from"./vendor-@vue.8cef8b94.js";import{A as P}from"./Status.d10547c8.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const Q=v({name:"CreateRepository",components:{ElButton:T,ElDialog:U,ElForm:z,ElFormItem:L,ElInput:M,FontAwesomeIcon:y},data(){return{dialogVisible:!1,creating:!1,form:{name:"",description:""}}},computed:{},methods:{async onSubmit(){if(!this.form.name){_.error(this.$t("chatdoc.message.nameRequired"));return}this.creating=!0,this.$store.dispatch("chatdoc/createRepository",{name:this.form.name,description:this.form.description}).then(()=>{this.creating=!1,_.success(this.$t("chatdoc.message.createRepositorySuccess")),this.dialogVisible=!1,this.$store.dispatch("chatdoc/getRepositories")}).catch(()=>{this.creating=!1,_.error(this.$t("chatdoc.message.createRepositoryFailed"))})}}});function W(e,n,b,R,E,N){const d=o("el-input"),l=o("el-form-item"),p=o("el-button"),m=o("el-form"),h=o("el-dialog"),f=o("font-awesome-icon");return u(),C(k,null,[t(h,{modelValue:e.dialogVisible,"onUpdate:modelValue":n[2]||(n[2]=i=>e.dialogVisible=i),width:"400px"},{default:s(()=>[t(m,{ref:"form","label-width":"60px"},{default:s(()=>[t(l,{label:e.$t("chatdoc.field.name"),prop:e.form.name},{default:s(()=>[t(d,{modelValue:e.form.name,"onUpdate:modelValue":n[0]||(n[0]=i=>e.form.name=i),placeholder:e.$t("chatdoc.message.inputRepositoryName")},null,8,["modelValue","placeholder"])]),_:1},8,["label","prop"]),t(l,{label:e.$t("chatdoc.field.description"),prop:e.form.description},{default:s(()=>[t(d,{modelValue:e.form.description,"onUpdate:modelValue":n[1]||(n[1]=i=>e.form.description=i),placeholder:e.$t("chatdoc.message.inputRepositoryDescription")},null,8,["modelValue","placeholder"])]),_:1},8,["label","prop"]),t(l,null,{default:s(()=>[t(p,{type:"primary",round:"",onClick:e.onSubmit},{default:s(()=>[V(r(e.$t("common.button.create")),1)]),_:1},8,["onClick"])]),_:1})]),_:1},512)]),_:1},8,["modelValue"]),a("button",{class:"btn btn-create",onClick:n[3]||(n[3]=i=>e.dialogVisible=!0)},[t(f,{icon:["fas","plus"]})])],64)}var X=w(Q,[["render",W],["__scopeId","data-v-41eec665"],["__file","/home/runner/work/Nexior/Nexior/src/components/chatdoc/CreateRepository.vue"]]);const Y=v({name:"ChatdocKnowledge",components:{Layout:B,ElCard:x,ElRow:j,ElCol:q,CreateRepository:X,FontAwesomeIcon:y,ElDropdown:H,ElDropdownItem:O,ElDropdownMenu:G,ApplicationStatus:P},data(){return{}},computed:{repositories(){return this.$store.state.chatdoc.repositories},needApply(){return this.$store.state.chatdoc.status.getApplications===$.Success&&!this.application},application(){return this.$store.state.chatdoc.application},service(){return this.$store.state.chatdoc.service},initializing(){return this.$store.state.chatdoc.status.getApplications===$.Request}},async mounted(){},methods:{onClick(e){this.$router.push({name:F,params:{repositoryId:e.id}})},onDelete(e){this.$store.dispatch("chatdoc/deleteRepository",{id:e}).then(()=>{_.success(this.$t("chatdoc.message.deleteRepositorySuccess")),this.$store.dispatch("chatdoc/getRepositories")})}}}),Z={class:"wrapper"},ee={class:"title"},oe={class:"introduction"},te={class:"status"},se={class:"operation"},ne={class:"name"},ae={class:"id"},ie={class:"description"};function re(e,n,b,R,E,N){const d=o("application-status"),l=o("create-repository"),p=o("el-card"),m=o("el-col"),h=o("font-awesome-icon"),f=o("el-dropdown-item"),i=o("el-dropdown-menu"),le=o("el-dropdown"),A=o("el-row"),D=o("layout");return u(),g(D,null,{chatdoc:s(()=>[a("div",Z,[a("div",ee,r(e.$t("chatdoc.title.repositories")),1),a("div",oe,r(e.$t("chatdoc.message.introductionForRepository")),1),a("div",te,[t(d,{"show-price":!1,initializing:e.initializing,application:e.application,"need-apply":e.needApply,service:e.service,onRefresh:n[0]||(n[0]=c=>e.$store.dispatch("chatdoc/getApplications"))},null,8,["initializing","application","need-apply","service"])]),t(A,{class:"repositories",gutter:15},{default:s(()=>[t(m,{xl:4,md:6,sm:12,xs:24},{default:s(()=>[t(p,{class:"repository text-center",shadow:"hover",onClick:e.onCreate},{default:s(()=>[t(l),a("p",se,r(e.$t("chatdoc.title.createRepository")),1)]),_:1},8,["onClick"])]),_:1}),(u(!0),C(k,null,K(e.repositories,(c,I)=>(u(),g(m,{key:I,xl:4,md:6,sm:12,xs:24},{default:s(()=>[t(p,{class:"repository",shadow:"hover",onClick:S=>e.onClick(c)},{default:s(()=>[J("v-if",!0),a("h2",ne,r(c.name),1),a("p",ae,[t(h,{icon:["fas","book"]}),V(" ID: "+r(c.id),1)]),a("p",ie,r(c.description),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1})])]),_:1})}var ge=w(Y,[["render",re],["__scopeId","data-v-52a67922"],["__file","/home/runner/work/Nexior/Nexior/src/pages/chatdoc/Index.vue"]]);export{ge as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ae as ne}from"./vendor-others.e28a6fa7.js";import{ar as q}from"./vendor-fortawesome.0d8f27df.js";import{_ as S,aU as le,A as ie,a0 as O,F as re,ad as ce,aV as ue,W as pe}from"./index.531671ec.js";import{Q as de,u as D,N as me,O as _e,x as he,y as I,t as fe,m as ge,I as $e,s as ve,H as ye,V as ke}from"./vendor-element-plus.7eade167.js";import{H as V,al as l,o as i,e as m,f as u,I as M,V as s,M as _,T as c,U as R,ai as G,L as T,S as v,R as y,P as L}from"./vendor-@vue.8cef8b94.js";import{I as ae}from"./InfoIcon.14b5afde.js";import{C as we}from"./CopyToClipboard.aee8f89c.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const be=V({name:"LayoutHailuo",components:{ElDrawer:de,ElButton:D,FontAwesomeIcon:q},data(){return{drawer:!1}}}),Ie={class:"main"},Se={class:"config"},Ve={class:"result"};function Pe(e,t,o,a,f,g){const p=l("font-awesome-icon"),d=l("el-button"),r=l("el-drawer");return i(),m("div",Ie,[u("div",Se,[M(e.$slots,"config",{},void 0,!0)]),u("div",Ve,[M(e.$slots,"result",{},void 0,!0)]),s(d,{round:"",class:"menu",onClick:t[0]||(t[0]=$=>e.drawer=!0)},{default:_(()=>[s(p,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),s(r,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=$=>e.drawer=$),"with-header":!1,size:"340px",class:"drawer"},{default:_(()=>[M(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Ee=S(be,[["render",Pe],["__scopeId","data-v-3c8363f5"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Hailuo.vue"]]);const Te=V({name:"ModelSelector",components:{ElSelect:me,ElOption:_e},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)}}),Ce={class:"field"},Ue={class:"title font-bold"},Ae={class:"float-left"};function Ne(e,t,o,a,f,g){const p=l("el-option"),d=l("el-select");return i(),m("div",Ce,[u("h2",Ue,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:_(()=>[(i(!0),m(R,null,G(e.options,r=>(i(),T(p,{key:r.value,label:r.label,value:r.value},{default:_(()=>[u("span",Ae,c(r.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var Re=S(Te,[["render",Ne],["__scopeId","data-v-62190314"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/ModelSelector.vue"]]);const Ge=V({name:"StartImageUrlInput",components:{ElUpload:he,ElButton:D,InfoIcon:ae},data(){return{fileList:[],uploadUrl:ie()+"/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()}}}),De={class:"field"},Le={class:"title font-bold"},Oe={class:"upload-wrapper"};function Me(e,t,o,a,f,g){const p=l("el-button"),d=l("el-upload"),r=l("info-icon");return i(),m("div",De,[u("h2",Le,c(e.$t("hailuo.name.startImageUrl")),1),u("div",Oe,[s(d,{"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:_(()=>[s(p,{size:"small",type:"primary",round:""},{default:_(()=>[v(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 qe=S(Ge,[["render",Me],["__scopeId","data-v-6c6b80d0"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/StartImageUrlInput.vue"]]);const He="",je=V({name:"PromptInput",components:{ElInput:fe,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)}}),Be={class:"field"},ze={class:"box"},Fe={class:"title font-bold"};function Ke(e,t,o,a,f,g){const p=l("info-icon"),d=l("el-input");return i(),m("div",Be,[u("div",ze,[u("h2",Fe,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 Qe=S(je,[["render",Ke],["__scopeId","data-v-d785889c"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/PromptInput.vue"]]);const We=V({name:"PresetPanel",components:{ElButton:D,FontAwesomeIcon:q,PromptInput:Qe,StartImageUrlInput:qe,ModelSelector:Re},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.hailuo)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Je={class:"panel"},Xe={class:"config"},Ye={class:"actions"};function Ze(e,t,o,a,f,g){var k,b,n;const p=l("prompt-input"),d=l("model-selector"),r=l("start-image-url-input"),$=l("font-awesome-icon"),h=l("el-button");return i(),m("div",Je,[u("div",Xe,[s(p,{class:"mb-4"}),s(d,{class:"mb-4"}),((k=e.config)==null?void 0:k.model)==="minimax-i2v"?(i(),T(r,{key:0,class:"mb-4"})):y("v-if",!0),u("div",Ye,[((b=e.config)==null?void 0:b.video_url)!==void 0||((n=e.config)==null?void 0:n.custom)?(i(),T(h,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:_(()=>[s($,{icon:"fa-solid fa-magic",class:"mr-2"}),v(" "+c(e.$t("hailuo.button.extend")),1)]),_:1},8,["onClick"])):(i(),T(h,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:_(()=>[s($,{icon:"fa-solid fa-magic",class:"mr-2"}),v(" "+c(e.$t("hailuo.button.generate")),1)]),_:1},8,["onClick"]))])])])}var xe=S(We,[["render",Ze],["__scopeId","data-v-01eef439"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/ConfigPanel.vue"]]);const et=V({name:"VideoPlayer",components:{VuePlyr:ne},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),tt=["data-poster"],ot=["src"];function st(e,t,o,a,f,g){const p=l("vue-plyr");return i(),m("div",null,[s(p,{options:e.options,class:"video"},{default:_(()=>{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,ot)],8,tt)]}),_:1},8,["options"])])}var at=S(et,[["render",st],["__scopeId","data-v-11ad7a93"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/VideoPlayer.vue"]]);const nt=V({name:"TaskPreview",components:{ElImage:ge,CopyToClipboard:we,FontAwesomeIcon:q,ElAlert:$e,VideoPlayer:at,ElTooltip:ve,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,g,p,d,r;let e=[];const t=(a=(o=this.modelValue)==null?void 0:o.request)==null?void 0:a.action;return Array.isArray((g=(f=this.modelValue)==null?void 0:f.response)==null?void 0:g.data)&&((r=(d=(p=this.modelValue)==null?void 0:p.response)==null?void 0:d.data)==null||r.forEach($=>{let h=$;t&&(h.action=t),e.push(h)})),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")}}}),lt={class:"left"},it={class:"main"},rt={class:"bot"},ct={class:"datetime"},ut={class:"info"},pt={key:0,class:"prompt mt-2"},dt={key:0},mt={key:1},_t={key:0,class:L({content:!0,failed:!0})},ht={class:"image-wrapper"},ft={key:0,class:L({operations:!0,"mt-2":!0})},gt={class:"description"},$t={key:1,class:L({content:!0})},vt={class:"description"},yt={class:"description"},kt={class:"description"},wt={key:2,class:L({content:!0})},bt={class:"description"};function It(e,t,o,a,f,g){const p=l("el-image"),d=l("VideoPlayer"),r=l("el-button"),$=l("el-tooltip"),h=l("font-awesome-icon"),k=l("copy-to-clipboard"),b=l("el-alert");return i(!0),m(R,null,G(e.videos,(n,A)=>{var C,U,P,N,H,j,B,z,F,K,Q;return i(),m("div",{key:A,class:"preview"},[u("div",lt,[s(p,{src:"https://cdn.acedata.cloud/0qg4gp.png",class:"avatar"})]),u("div",it,[u("div",rt,[v(c(e.$t("hailuo.name.hailuoBot"))+" ",1),u("span",ct,c(e.$dayjs.format(""+new Date(parseFloat(((C=e.modelValue)==null?void 0:C.created_at)||"")*1e3))),1)]),u("div",ut,[(P=(U=e.modelValue)==null?void 0:U.request)!=null&&P.prompt?(i(),m("p",pt,[v(c((H=(N=e.modelValue)==null?void 0:N.request)==null?void 0:H.prompt)+" ",1),(j=e.modelValue)!=null&&j.response?y("v-if",!0):(i(),m("span",dt," - ("+c(e.$t("hailuo.status.pending"))+") ",1)),(n==null?void 0:n.state)==="processing"||(n==null?void 0:n.state)==="pending"||(n==null?void 0:n.state)==="running"?(i(),m("span",mt," - ("+c(e.$t("hailuo.status.processing"))+") ",1)):y("v-if",!0)])):y("v-if",!0)]),y(" Display success message "),((z=(B=e.modelValue)==null?void 0:B.response)==null?void 0:z.success)===!0?(i(),m("div",_t,[u("div",ht,[s(d,{"model-value":n},null,8,["model-value"])]),n?(i(),m("div",ft,[s($,{class:"box-item",effect:"dark",content:e.$t("hailuo.message.downloadVideo"),placement:"top-start"},{default:_(()=>[s(r,{type:"info",size:"small",class:"btn-action",onClick:w=>e.onDownload(w,n==null?void 0:n.video_url)},{default:_(()=>[v(c(e.$t("hailuo.button.download")),1)]),_:2},1032,["onClick"])]),_:2},1032,["content"])])):y("v-if",!0),s(b,{closable:!1,class:"mt-2 success"},{default:_(()=>{var w,E;return[u("p",gt,[s(h,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+c(e.$t("hailuo.name.taskId"))+": "+c((w=e.modelValue)==null?void 0:w.id)+" ",1),s(k,{content:(E=e.modelValue)==null?void 0:E.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):y("v-if",!0),y(" Display error message "),((K=(F=e.modelValue)==null?void 0:F.response)==null?void 0:K.success)===!1?(i(),m("div",$t,[s(b,{closable:!1,class:"failure"},{template:_(()=>[s(h,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),v(" "+c(e.$t("hailuo.name.failure")),1)]),default:_(()=>{var w,E,W,J,X,Y,Z,x,ee,te,oe,se;return[u("p",vt,[s(h,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+c(e.$t("hailuo.name.taskId"))+": "+c((w=e.modelValue)==null?void 0:w.id)+" ",1),s(k,{content:(E=e.modelValue)==null?void 0:E.id,class:"btn-copy"},null,8,["content"])]),u("p",yt,[s(h,{icon:"fa-solid fa-circle-info",class:"mr-1"}),v(" "+c(e.$t("hailuo.name.failureReason"))+": "+c((X=(J=(W=e.modelValue)==null?void 0:W.response)==null?void 0:J.error)==null?void 0:X.message)+" ",1),s(k,{content:(x=(Z=(Y=e.modelValue)==null?void 0:Y.response)==null?void 0:Z.error)==null?void 0:x.message,class:"btn-copy"},null,8,["content"])]),u("p",kt,[s(h,{icon:"fa-solid fa-hashtag",class:"mr-1"}),v(" "+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})])):y("v-if",!0),y(" Display error message "),!((Q=e.modelValue)!=null&&Q.response)||(n==null?void 0:n.state)==="processing"||(n==null?void 0:n.state)==="pending"||(n==null?void 0:n.state)==="running"?(i(),m("div",wt,[s(b,{closable:!1,class:"info"},{template:_(()=>[s(h,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),v(" "+c(e.$t("hailuo.name.failure")),1)]),default:_(()=>{var w,E;return[u("p",bt,[s(h,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+c(e.$t("hailuo.name.taskId"))+": "+c((w=e.modelValue)==null?void 0:w.id)+" ",1),s(k,{content:(E=e.modelValue)==null?void 0:E.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):y("v-if",!0)])])}),128)}var St=S(nt,[["render",It],["__scopeId","data-v-3f5aedb7"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/task/Preview.vue"]]);const Vt=V({name:"RecentPanel",components:{TaskPreview:St,ElSkeleton:ye,ElSkeletonItem:ke},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")}}}),Pt={key:0,class:"tasks"},Et={class:"left"},Tt={class:"main"},Ct={key:1,class:"tasks"},Ut={key:2,class:"description"};function At(e,t,o,a,f,g){var $,h,k,b,n,A,C,U;const p=l("el-skeleton-item"),d=l("el-skeleton"),r=l("task-preview");return i(),m("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...P)=>e.onHandleScroll&&e.onHandleScroll(...P))},[(($=e.tasks)==null?void 0:$.items)===void 0?(i(),m("div",Pt,[(i(),m(R,null,G(3,P=>u("div",{key:P,class:"task placeholder"},[u("div",Et,[s(d,{animated:""},{template:_(()=>[s(p,{variant:"image",class:"avatar"})]),_:1})]),u("div",Tt,[s(d,{animated:""},{template:_(()=>[s(p,{variant:"p",class:"title"}),s(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):((k=(h=e.tasks)==null?void 0:h.items)==null?void 0:k.length)&&((n=(b=e.tasks)==null?void 0:b.items)==null?void 0:n.length)>0?(i(),m("div",Ct,[(i(!0),m(R,null,G((A=e.tasks)==null?void 0:A.items,(P,N)=>(i(),T(r,{key:N,"model-value":P,class:"preview"},null,8,["model-value"]))),128))])):y("v-if",!0),((U=(C=e.tasks)==null?void 0:C.items)==null?void 0:U.length)===0?(i(),m("p",Ut,c(e.$t("hailuo.message.noTasks")),1)):y("v-if",!0)],544)}var Nt=S(Vt,[["render",At],["__scopeId","data-v-7bff9d40"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/RecentPanel.vue"]]);const Rt="https://webhook.acedata.cloud/hailuo",Gt=V({name:"HailuoIndex",components:{ConfigPanel:xe,Layout:Ee,RecentPanel:Nt},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(){re.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)===ce&&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 onGenerate(){var o;const e={...this.config,callback_url:Rt},t=(o=this.credential)==null?void 0:o.token;if(!t){console.error("no token specified");return}I.info(this.$t("hailuo.message.startingTask")),ue.generate(e,{token:t}).then(()=>{I.success(this.$t("hailuo.message.startTaskSuccess")),this.$store.commit("hailuo/setConfig",{config:void 0})}).catch(a=>{var g,p;const f=(g=a==null?void 0:a.response)==null?void 0:g.data;((p=f==null?void 0:f.error)==null?void 0:p.code)===pe?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 Dt(e,t,o,a,f,g){const p=l("config-panel"),d=l("recent-panel"),r=l("layout");return i(),T(r,null,{config:_(()=>[s(p,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:_(()=>[s(d,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"])]),_:1})}var Kt=S(Gt,[["render",Dt],["__scopeId","data-v-1f8aa246"],["__file","/home/runner/work/Nexior/Nexior/src/pages/hailuo/Index.vue"]]);export{Kt as default};
|
|
1
|
+
import{ae as ne}from"./vendor-others.e28a6fa7.js";import{ar as q}from"./vendor-fortawesome.0d8f27df.js";import{_ as S,aU as le,A as ie,a0 as O,F as re,ad as ce,aV as ue,W as pe}from"./index.d28a66ae.js";import{Q as de,u as D,N as me,O as _e,x as he,y as I,t as fe,m as ge,I as $e,s as ve,H as ye,V as ke}from"./vendor-element-plus.7eade167.js";import{H as V,al as l,o as i,e as m,f as u,I as M,V as s,M as _,T as c,U as R,ai as G,L as T,S as v,R as y,P as L}from"./vendor-@vue.8cef8b94.js";import{I as ae}from"./InfoIcon.1ef9ef71.js";import{C as we}from"./CopyToClipboard.8ebe33f6.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const be=V({name:"LayoutHailuo",components:{ElDrawer:de,ElButton:D,FontAwesomeIcon:q},data(){return{drawer:!1}}}),Ie={class:"main"},Se={class:"config"},Ve={class:"result"};function Pe(e,t,o,a,f,g){const p=l("font-awesome-icon"),d=l("el-button"),r=l("el-drawer");return i(),m("div",Ie,[u("div",Se,[M(e.$slots,"config",{},void 0,!0)]),u("div",Ve,[M(e.$slots,"result",{},void 0,!0)]),s(d,{round:"",class:"menu",onClick:t[0]||(t[0]=$=>e.drawer=!0)},{default:_(()=>[s(p,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),s(r,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=$=>e.drawer=$),"with-header":!1,size:"340px",class:"drawer"},{default:_(()=>[M(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Ee=S(be,[["render",Pe],["__scopeId","data-v-3c8363f5"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Hailuo.vue"]]);const Te=V({name:"ModelSelector",components:{ElSelect:me,ElOption:_e},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)}}),Ce={class:"field"},Ue={class:"title font-bold"},Ae={class:"float-left"};function Ne(e,t,o,a,f,g){const p=l("el-option"),d=l("el-select");return i(),m("div",Ce,[u("h2",Ue,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:_(()=>[(i(!0),m(R,null,G(e.options,r=>(i(),T(p,{key:r.value,label:r.label,value:r.value},{default:_(()=>[u("span",Ae,c(r.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var Re=S(Te,[["render",Ne],["__scopeId","data-v-62190314"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/ModelSelector.vue"]]);const Ge=V({name:"StartImageUrlInput",components:{ElUpload:he,ElButton:D,InfoIcon:ae},data(){return{fileList:[],uploadUrl:ie()+"/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()}}}),De={class:"field"},Le={class:"title font-bold"},Oe={class:"upload-wrapper"};function Me(e,t,o,a,f,g){const p=l("el-button"),d=l("el-upload"),r=l("info-icon");return i(),m("div",De,[u("h2",Le,c(e.$t("hailuo.name.startImageUrl")),1),u("div",Oe,[s(d,{"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:_(()=>[s(p,{size:"small",type:"primary",round:""},{default:_(()=>[v(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 qe=S(Ge,[["render",Me],["__scopeId","data-v-6c6b80d0"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/StartImageUrlInput.vue"]]);const He="",je=V({name:"PromptInput",components:{ElInput:fe,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)}}),Be={class:"field"},ze={class:"box"},Fe={class:"title font-bold"};function Ke(e,t,o,a,f,g){const p=l("info-icon"),d=l("el-input");return i(),m("div",Be,[u("div",ze,[u("h2",Fe,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 Qe=S(je,[["render",Ke],["__scopeId","data-v-d785889c"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/PromptInput.vue"]]);const We=V({name:"PresetPanel",components:{ElButton:D,FontAwesomeIcon:q,PromptInput:Qe,StartImageUrlInput:qe,ModelSelector:Re},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.hailuo)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Je={class:"panel"},Xe={class:"config"},Ye={class:"actions"};function Ze(e,t,o,a,f,g){var k,b,n;const p=l("prompt-input"),d=l("model-selector"),r=l("start-image-url-input"),$=l("font-awesome-icon"),h=l("el-button");return i(),m("div",Je,[u("div",Xe,[s(p,{class:"mb-4"}),s(d,{class:"mb-4"}),((k=e.config)==null?void 0:k.model)==="minimax-i2v"?(i(),T(r,{key:0,class:"mb-4"})):y("v-if",!0),u("div",Ye,[((b=e.config)==null?void 0:b.video_url)!==void 0||((n=e.config)==null?void 0:n.custom)?(i(),T(h,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:_(()=>[s($,{icon:"fa-solid fa-magic",class:"mr-2"}),v(" "+c(e.$t("hailuo.button.extend")),1)]),_:1},8,["onClick"])):(i(),T(h,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:_(()=>[s($,{icon:"fa-solid fa-magic",class:"mr-2"}),v(" "+c(e.$t("hailuo.button.generate")),1)]),_:1},8,["onClick"]))])])])}var xe=S(We,[["render",Ze],["__scopeId","data-v-01eef439"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/ConfigPanel.vue"]]);const et=V({name:"VideoPlayer",components:{VuePlyr:ne},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),tt=["data-poster"],ot=["src"];function st(e,t,o,a,f,g){const p=l("vue-plyr");return i(),m("div",null,[s(p,{options:e.options,class:"video"},{default:_(()=>{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,ot)],8,tt)]}),_:1},8,["options"])])}var at=S(et,[["render",st],["__scopeId","data-v-11ad7a93"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/VideoPlayer.vue"]]);const nt=V({name:"TaskPreview",components:{ElImage:ge,CopyToClipboard:we,FontAwesomeIcon:q,ElAlert:$e,VideoPlayer:at,ElTooltip:ve,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,g,p,d,r;let e=[];const t=(a=(o=this.modelValue)==null?void 0:o.request)==null?void 0:a.action;return Array.isArray((g=(f=this.modelValue)==null?void 0:f.response)==null?void 0:g.data)&&((r=(d=(p=this.modelValue)==null?void 0:p.response)==null?void 0:d.data)==null||r.forEach($=>{let h=$;t&&(h.action=t),e.push(h)})),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")}}}),lt={class:"left"},it={class:"main"},rt={class:"bot"},ct={class:"datetime"},ut={class:"info"},pt={key:0,class:"prompt mt-2"},dt={key:0},mt={key:1},_t={key:0,class:L({content:!0,failed:!0})},ht={class:"image-wrapper"},ft={key:0,class:L({operations:!0,"mt-2":!0})},gt={class:"description"},$t={key:1,class:L({content:!0})},vt={class:"description"},yt={class:"description"},kt={class:"description"},wt={key:2,class:L({content:!0})},bt={class:"description"};function It(e,t,o,a,f,g){const p=l("el-image"),d=l("VideoPlayer"),r=l("el-button"),$=l("el-tooltip"),h=l("font-awesome-icon"),k=l("copy-to-clipboard"),b=l("el-alert");return i(!0),m(R,null,G(e.videos,(n,A)=>{var C,U,P,N,H,j,B,z,F,K,Q;return i(),m("div",{key:A,class:"preview"},[u("div",lt,[s(p,{src:"https://cdn.acedata.cloud/0qg4gp.png",class:"avatar"})]),u("div",it,[u("div",rt,[v(c(e.$t("hailuo.name.hailuoBot"))+" ",1),u("span",ct,c(e.$dayjs.format(""+new Date(parseFloat(((C=e.modelValue)==null?void 0:C.created_at)||"")*1e3))),1)]),u("div",ut,[(P=(U=e.modelValue)==null?void 0:U.request)!=null&&P.prompt?(i(),m("p",pt,[v(c((H=(N=e.modelValue)==null?void 0:N.request)==null?void 0:H.prompt)+" ",1),(j=e.modelValue)!=null&&j.response?y("v-if",!0):(i(),m("span",dt," - ("+c(e.$t("hailuo.status.pending"))+") ",1)),(n==null?void 0:n.state)==="processing"||(n==null?void 0:n.state)==="pending"||(n==null?void 0:n.state)==="running"?(i(),m("span",mt," - ("+c(e.$t("hailuo.status.processing"))+") ",1)):y("v-if",!0)])):y("v-if",!0)]),y(" Display success message "),((z=(B=e.modelValue)==null?void 0:B.response)==null?void 0:z.success)===!0?(i(),m("div",_t,[u("div",ht,[s(d,{"model-value":n},null,8,["model-value"])]),n?(i(),m("div",ft,[s($,{class:"box-item",effect:"dark",content:e.$t("hailuo.message.downloadVideo"),placement:"top-start"},{default:_(()=>[s(r,{type:"info",size:"small",class:"btn-action",onClick:w=>e.onDownload(w,n==null?void 0:n.video_url)},{default:_(()=>[v(c(e.$t("hailuo.button.download")),1)]),_:2},1032,["onClick"])]),_:2},1032,["content"])])):y("v-if",!0),s(b,{closable:!1,class:"mt-2 success"},{default:_(()=>{var w,E;return[u("p",gt,[s(h,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+c(e.$t("hailuo.name.taskId"))+": "+c((w=e.modelValue)==null?void 0:w.id)+" ",1),s(k,{content:(E=e.modelValue)==null?void 0:E.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):y("v-if",!0),y(" Display error message "),((K=(F=e.modelValue)==null?void 0:F.response)==null?void 0:K.success)===!1?(i(),m("div",$t,[s(b,{closable:!1,class:"failure"},{template:_(()=>[s(h,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),v(" "+c(e.$t("hailuo.name.failure")),1)]),default:_(()=>{var w,E,W,J,X,Y,Z,x,ee,te,oe,se;return[u("p",vt,[s(h,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+c(e.$t("hailuo.name.taskId"))+": "+c((w=e.modelValue)==null?void 0:w.id)+" ",1),s(k,{content:(E=e.modelValue)==null?void 0:E.id,class:"btn-copy"},null,8,["content"])]),u("p",yt,[s(h,{icon:"fa-solid fa-circle-info",class:"mr-1"}),v(" "+c(e.$t("hailuo.name.failureReason"))+": "+c((X=(J=(W=e.modelValue)==null?void 0:W.response)==null?void 0:J.error)==null?void 0:X.message)+" ",1),s(k,{content:(x=(Z=(Y=e.modelValue)==null?void 0:Y.response)==null?void 0:Z.error)==null?void 0:x.message,class:"btn-copy"},null,8,["content"])]),u("p",kt,[s(h,{icon:"fa-solid fa-hashtag",class:"mr-1"}),v(" "+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})])):y("v-if",!0),y(" Display error message "),!((Q=e.modelValue)!=null&&Q.response)||(n==null?void 0:n.state)==="processing"||(n==null?void 0:n.state)==="pending"||(n==null?void 0:n.state)==="running"?(i(),m("div",wt,[s(b,{closable:!1,class:"info"},{template:_(()=>[s(h,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),v(" "+c(e.$t("hailuo.name.failure")),1)]),default:_(()=>{var w,E;return[u("p",bt,[s(h,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+c(e.$t("hailuo.name.taskId"))+": "+c((w=e.modelValue)==null?void 0:w.id)+" ",1),s(k,{content:(E=e.modelValue)==null?void 0:E.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):y("v-if",!0)])])}),128)}var St=S(nt,[["render",It],["__scopeId","data-v-3f5aedb7"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/task/Preview.vue"]]);const Vt=V({name:"RecentPanel",components:{TaskPreview:St,ElSkeleton:ye,ElSkeletonItem:ke},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")}}}),Pt={key:0,class:"tasks"},Et={class:"left"},Tt={class:"main"},Ct={key:1,class:"tasks"},Ut={key:2,class:"description"};function At(e,t,o,a,f,g){var $,h,k,b,n,A,C,U;const p=l("el-skeleton-item"),d=l("el-skeleton"),r=l("task-preview");return i(),m("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...P)=>e.onHandleScroll&&e.onHandleScroll(...P))},[(($=e.tasks)==null?void 0:$.items)===void 0?(i(),m("div",Pt,[(i(),m(R,null,G(3,P=>u("div",{key:P,class:"task placeholder"},[u("div",Et,[s(d,{animated:""},{template:_(()=>[s(p,{variant:"image",class:"avatar"})]),_:1})]),u("div",Tt,[s(d,{animated:""},{template:_(()=>[s(p,{variant:"p",class:"title"}),s(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):((k=(h=e.tasks)==null?void 0:h.items)==null?void 0:k.length)&&((n=(b=e.tasks)==null?void 0:b.items)==null?void 0:n.length)>0?(i(),m("div",Ct,[(i(!0),m(R,null,G((A=e.tasks)==null?void 0:A.items,(P,N)=>(i(),T(r,{key:N,"model-value":P,class:"preview"},null,8,["model-value"]))),128))])):y("v-if",!0),((U=(C=e.tasks)==null?void 0:C.items)==null?void 0:U.length)===0?(i(),m("p",Ut,c(e.$t("hailuo.message.noTasks")),1)):y("v-if",!0)],544)}var Nt=S(Vt,[["render",At],["__scopeId","data-v-7bff9d40"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/RecentPanel.vue"]]);const Rt="https://webhook.acedata.cloud/hailuo",Gt=V({name:"HailuoIndex",components:{ConfigPanel:xe,Layout:Ee,RecentPanel:Nt},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(){re.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)===ce&&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 onGenerate(){var o;const e={...this.config,callback_url:Rt},t=(o=this.credential)==null?void 0:o.token;if(!t){console.error("no token specified");return}I.info(this.$t("hailuo.message.startingTask")),ue.generate(e,{token:t}).then(()=>{I.success(this.$t("hailuo.message.startTaskSuccess")),this.$store.commit("hailuo/setConfig",{config:void 0})}).catch(a=>{var g,p;const f=(g=a==null?void 0:a.response)==null?void 0:g.data;((p=f==null?void 0:f.error)==null?void 0:p.code)===pe?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 Dt(e,t,o,a,f,g){const p=l("config-panel"),d=l("recent-panel"),r=l("layout");return i(),T(r,null,{config:_(()=>[s(p,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:_(()=>[s(d,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"])]),_:1})}var Kt=S(Gt,[["render",Dt],["__scopeId","data-v-1f8aa246"],["__file","/home/runner/work/Nexior/Nexior/src/pages/hailuo/Index.vue"]]);export{Kt as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{af as ke,ag as J,ah as we,ai as $e,aj as be,ak as Ce}from"./vendor-others.e28a6fa7.js";import{ar as ie}from"./vendor-fortawesome.0d8f27df.js";import{_ as k,aX as ve,A as Pe,aY as pe,a0 as se,F as Ae,ad as Se}from"./index.
|
|
1
|
+
import{af as ke,ag as J,ah as we,ai as $e,aj as be,ak as Ce}from"./vendor-others.e28a6fa7.js";import{ar as ie}from"./vendor-fortawesome.0d8f27df.js";import{_ as k,aX as ve,A as Pe,aY as pe,a0 as se,F as Ae,ad as Se}from"./index.d28a66ae.js";import{Q as Ie,u as ae,N as Ne,O as Te,p as ge,x as Ee,y as F,t as le,m as re,k as ce,S as Ve,Y as _e,Z as me,s as Ue,h as je,i as Fe,j as Le,R as ye,_ as De,H as Ge,V as Re,$ as Me,a0 as qe,a1 as Oe}from"./vendor-element-plus.7eade167.js";import{H as w,al as u,o as r,e as _,R as $,f as a,I as oe,V as l,M as h,T as f,U as X,ai as ne,L as g,S as G,av as he,O as ue,m as K,u as L,s as ze,Q as Be,W as xe}from"./vendor-@vue.8cef8b94.js";import{I as ee}from"./InfoIcon.1ef9ef71.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const He=w({name:"LayoutSuno",components:{ElDrawer:Ie,ElButton:ae,FontAwesomeIcon:ie},data(){return{drawer:!1,preview:!1}},computed:{isPlaying(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.player)==null?void 0:t.isPlaying}}}),We={class:"main"},Ye={class:"config"},Ke={class:"result"},Qe={class:"preview"};function Xe(e,t,n,s,c,d){const i=u("font-awesome-icon"),p=u("el-button"),m=u("el-drawer");return r(),_("div",We,[$(" \u6700\u5DE6\u4FA7\u914D\u7F6E\u680F "),a("div",Ye,[oe(e.$slots,"config",{},void 0,!0)]),$(" \u4E2D\u95F4\u6B4C\u66F2\u5217\u8868\u680F "),a("div",Ke,[oe(e.$slots,"result",{},void 0,!0)]),$(" \u6700\u53F3\u8FB9\u6B4C\u66F2\u9884\u89C8\u680F "),a("div",Qe,[oe(e.$slots,"preview",{},void 0,!0)]),l(p,{round:"",class:"menu",onClick:t[0]||(t[0]=v=>e.drawer=!0)},{default:h(()=>[l(i,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),l(m,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=v=>e.drawer=v),"with-header":!1,size:"340px",class:"drawer"},{default:h(()=>[oe(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"]),$(` <el-drawer v-model="isPlaying" :with-header="false" size="340px" class="preview_drawer">
|
|
2
2
|
<slot name="preview" />
|
|
3
3
|
</el-drawer> `)])}var Ze=k(He,[["render",Xe],["__scopeId","data-v-0621513c"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Suno.vue"]]);const Je=w({name:"VersionSelector",components:{ElSelect:Ne,ElOption:Te,ElSwitch:ge},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{label:this.$t("suno.model.model1"),value:"chirp-v2-xxl-alpha"},{label:this.$t("suno.model.model2"),value:"chirp-v3-0"},{label:this.$t("suno.model.model3"),value:"chirp-v3-5"},{label:this.$t("suno.model.model4"),value:"chirp-v4"}]}},computed:{custom:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.custom},set(e){var t;console.debug("set custom",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,custom:e})}},model:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.model},set(e){var t;console.debug("set model",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,model:e})}}},mounted(){this.model||(console.debug("set default type",ve),this.model=ve)}}),et={class:"field"},tt={class:"title font-bold"};function ot(e,t,n,s,c,d){const i=u("el-switch"),p=u("el-option"),m=u("el-select");return r(),_("div",et,[a("h2",tt,f(e.$t("suno.name.type")),1),l(i,{modelValue:e.custom,"onUpdate:modelValue":t[0]||(t[0]=v=>e.custom=v),class:"value"},null,8,["modelValue"]),l(m,{modelValue:e.model,"onUpdate:modelValue":t[1]||(t[1]=v=>e.model=v),class:"value",placeholder:e.$t("suno.placeholder.select")},{default:h(()=>[(r(!0),_(X,null,ne(e.options,v=>(r(),g(p,{key:v.value,label:v.label,value:v.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var st=k(Je,[["render",ot],["__scopeId","data-v-6d5f21aa"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/TypeSelector.vue"]]);const nt=w({name:"UploadAudio",components:{ElUpload:Ee,ElButton:ae,InfoIcon:ee,FontAwesomeIcon:ie},emits:["change"],data(){return{fileList:[],uploadUrl:Pe()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},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.suno)==null?void 0:e.config)==null?void 0:t.audio_id},set(e){}}},watch:{urls:{handler(e){this.$emit("change",e)}}},mounted(){this.value||(this.value=void 0),this.onSetAudio()},methods:{onExceed(){F.warning(this.$t("suno.message.uploadReferencesExceed"))},onError(){F.error(this.$t("suno.message.uploadReferencesError"))},async onSuccess(){var t;const e=(t=this.urls)==null?void 0:t[0];await this.onGenerateAudioId(e)},async onGenerateAudioId(e){var s;const t={audio_url:e},n=(s=this.credential)==null?void 0:s.token;if(!n){console.error("no token specified");return}F.info(this.$t("suno.message.startingUploadAudio")),pe.upload(t,{token:n}).then(c=>{var i,p;console.debug("get upload music success",c.data);const d=(i=c.data)==null?void 0:i.data.audio_id;this.$store.commit("suno/setConfig",{...(p=this.$store.state.suno)==null?void 0:p.config,audio_id:d,action:"upload_extend"}),F.success(this.$t("suno.message.startUploadAudioSuccess"))}).catch(c=>{var d,i,p;F.error(((p=(i=(d=c==null?void 0:c.response)==null?void 0:d.data)==null?void 0:i.error)==null?void 0:p.message)||this.$t("suno.message.startUploadAudioFailed"))})},onSetAudio(){}}}),it={class:"relative"},at={class:"flex justify-between"},lt={class:"flex justify-start items-center"},rt={class:"text-sm font-bold"};function ct(e,t,n,s,c,d){const i=u("info-icon"),p=u("font-awesome-icon"),m=u("el-button"),v=u("el-upload");return r(),_("div",it,[a("div",at,[a("div",lt,[a("span",rt,f(e.$t("suno.name.referenceAudios")),1),l(i,{content:e.$t("suno.description.uploadAudios")},null,8,["content"])])]),l(v,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=C=>e.fileList=C),name:"file",limit:1,class:"upload-wrapper",action:e.uploadUrl,accept:".mp3","show-file-list":!0,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:h(()=>[l(m,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[l(p,{icon:"fa-solid fa-upload",class:"icon mr-1"}),G(" "+f(e.$t("suno.button.uploadAudios")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}var ut=k(nt,[["render",ct],["__scopeId","data-v-3fef3e18"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/UploadAudio.vue"]]);const dt="",pt=w({name:"PromptInput",components:{ElInput:le,ElSwitch:ge,InfoIcon:ee},data(){return{}},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,prompt:e})}},instrumental:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.instrumental},set(e){var t;console.debug("set instrumental",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,instrumental:e})}}},mounted(){this.value||(this.value=dt)}}),_t={class:"field"},mt={class:"box"},ht={class:"title-info"},ft={class:"title font-bold"},vt={class:"instrumental"},$t={class:"title inline-block"};function gt(e,t,n,s,c,d){const i=u("info-icon"),p=u("el-switch"),m=u("el-input");return r(),_("div",_t,[a("div",mt,[a("div",ht,[a("h2",ft,f(e.$t("suno.name.prompt")),1),l(i,{content:e.$t("suno.description.prompt"),class:"info"},null,8,["content"])]),a("div",vt,[l(p,{modelValue:e.instrumental,"onUpdate:modelValue":t[0]||(t[0]=v=>e.instrumental=v),class:"value mr-2"},null,8,["modelValue"]),a("h2",$t,f(e.$t("suno.name.instrumental")),1)])]),l(m,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=v=>e.prompt=v),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("suno.placeholder.prompt"),maxlength:200,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var yt=k(pt,[["render",gt],["__scopeId","data-v-11b65236"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/PromptInput.vue"]]);const kt="",wt=w({name:"LyricInput",components:{ElInput:le,InfoIcon:ee},data(){return{}},computed:{lyric:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.lyric},set(e){var t;console.debug("set lyric",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,lyric:e})}},config(){var e;return(e=this.$store.state.suno)==null?void 0:e.config}},mounted(){this.value||(this.value=kt)}}),bt={class:"field"},Ct={class:"box"},Pt={class:"title font-bold"};function At(e,t,n,s,c,d){var m;const i=u("info-icon"),p=u("el-input");return r(),_("div",bt,[a("div",Ct,[a("h2",Pt,f(e.$t("suno.name.lyrics")),1),l(i,{content:e.$t("suno.description.lyrics"),class:"info"},null,8,["content"])]),((m=e.config)==null?void 0:m.action)!=="extend"?(r(),g(p,{key:0,modelValue:e.lyric,"onUpdate:modelValue":t[0]||(t[0]=v=>e.lyric=v),rows:3,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.lyrics"),maxlength:3e3,"show-word-limit":""},null,8,["modelValue","placeholder"])):(r(),g(p,{key:1,modelValue:e.lyric,"onUpdate:modelValue":t[1]||(t[1]=v=>e.lyric=v),rows:3,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.extend.lyrics"),maxlength:3e3,"show-word-limit":""},null,8,["modelValue","placeholder"]))])}var St=k(wt,[["render",At],["__scopeId","data-v-b47f1748"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/LyricInput.vue"]]);const It=w({name:"StyleInput",components:{ElInput:le,InfoIcon:ee},data(){return{}},computed:{style:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.style},set(e){var t;console.debug("set style",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,style:e})}},config(){var e;return(e=this.$store.state.suno)==null?void 0:e.config}}}),Nt={class:"field"},Tt={class:"title-container"},Et={class:"titlefont-bold"};function Vt(e,t,n,s,c,d){const i=u("info-icon"),p=u("el-input");return r(),_("div",Nt,[a("div",Tt,[a("h2",Et,f(e.$t("suno.name.style")),1),l(i,{content:e.$t("suno.description.style"),class:"info"},null,8,["content"])]),l(p,{modelValue:e.style,"onUpdate:modelValue":t[0]||(t[0]=m=>e.style=m),rows:3,type:"textarea",class:"style",placeholder:e.$t("suno.placeholder.style"),maxlength:200,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var Ut=k(It,[["render",Vt],["__scopeId","data-v-075e574a"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/StyleInput.vue"]]);const jt="",Ft=w({name:"TitleInput",components:{ElInput:le,InfoIcon:ee},data(){return{}},computed:{title:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.title},set(e){var t;console.debug("set title",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,title:e})}},instrumental:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.instrumental},set(e){var t;console.debug("set instrumental",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,instrumental:e})}}},mounted(){this.value||(this.value=jt)}}),Lt={class:"field"},Dt={class:"title-container"},Gt={class:"title font-bold"};function Rt(e,t,n,s,c,d){const i=u("info-icon"),p=u("el-input");return r(),_("div",Lt,[a("div",Dt,[a("h2",Gt,f(e.$t("suno.name.title")),1),l(i,{content:e.$t("suno.description.title"),class:"info"},null,8,["content"])]),l(p,{modelValue:e.title,"onUpdate:modelValue":t[0]||(t[0]=m=>e.title=m),rows:3,type:"textarea",class:"title",placeholder:e.$t("suno.placeholder.title"),maxlength:80,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var Mt=k(Ft,[["render",Rt],["__scopeId","data-v-f9bac2fa"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/TitleInput.vue"]]);function Z(e){const t=Math.floor(e)%60;e=Math.floor(e/60);const n=e%60,s=n<10?`0${n}`:n,c=t<10?`0${t}`:t;return s+":"+c}const qt=w({name:"ExtendFromInput",components:{ElImage:re,ElIcon:ce,ElInputNumber:Ve,VideoPlay:_e,VideoPause:me},data(){return{}},computed:{audio(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.audio},value:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.continue_at},set(e){var t;console.debug("set continue_at",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||(this.value=void 0)},methods:{handleChange(e){var t,n;e<0?this.value=0:e>((t=this.audio)==null?void 0:t.duration)?this.value=(n=this.audio)==null?void 0:n.duration:this.value=e},useFormatDuring:Z,onPlay(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){var t,n,s;((s=(n=(t=this.$store.state)==null?void 0:t.suno)==null?void 0:n.audio)==null?void 0:s.id)!==e.id&&this.onPlay({...e,progress:0})}}}),Ot={class:"field"},zt={class:"box"},Bt={class:"title font-bold"},xt={class:"input-wrapper"},Ht={class:"task"},Wt={class:"left"},Yt={key:2,class:"duration"},Kt={class:"info"},Qt={class:"title"},Xt={class:"style"};function Zt(e,t,n,s,c,d){var P,b,A,S,T,o,j,E,V,U,I,D,R,M,q,O,z,B,x,H,W,Y,y,Q,fe;const i=u("el-input-number"),p=u("el-image"),m=u("video-pause"),v=u("el-icon"),C=u("video-play"),N=he("loading");return r(),_("div",Ot,[a("div",zt,[a("h2",Bt,f(e.$t("suno.name.extend")),1),a("div",xt,[l(i,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=te=>e.value=te),class:"value",min:0,max:(P=e.audio)==null?void 0:P.duration,controls:!1,placeholder:e.$t("suno.placeholder.extend.continue_at"),onChange:e.handleChange},null,8,["modelValue","max","placeholder","onChange"])])]),a("div",Ht,[a("div",{class:"audio",onClick:t[3]||(t[3]=te=>e.onClick(e.audio))},[ue((r(),_("div",Wt,[l(p,{src:(b=e.audio)==null?void 0:b.image_url,class:"cover",fit:"cover"},null,8,["src"]),((A=e.audio)==null?void 0:A.audio_url)&&((o=(T=(S=e.$store.state)==null?void 0:S.suno)==null?void 0:T.audio)==null?void 0:o.id)===e.audio.id&&((V=(E=(j=e.$store.state)==null?void 0:j.suno)==null?void 0:E.audio)==null?void 0:V.state)==="playing"?(r(),_("div",{key:0,class:"overlay",onClick:t[1]||(t[1]=te=>e.onPause(e.audio))},[l(v,null,{default:h(()=>[l(m)]),_:1})])):$("v-if",!0),((U=e.audio)==null?void 0:U.audio_url)&&(((R=(D=(I=e.$store.state)==null?void 0:I.suno)==null?void 0:D.audio)==null?void 0:R.id)!==e.audio.id||((O=(q=(M=e.$store.state)==null?void 0:M.suno)==null?void 0:q.audio)==null?void 0:O.id)===e.audio.id&&((x=(B=(z=e.$store.state)==null?void 0:z.suno)==null?void 0:B.audio)==null?void 0:x.state)==="paused")?(r(),_("div",{key:1,class:"overlay",onClick:t[2]||(t[2]=te=>e.onPlay(e.audio))},[l(v,null,{default:h(()=>[l(C)]),_:1})])):$("v-if",!0),(H=e.audio)!=null&&H.duration?(r(),_("div",Yt,f(e.useFormatDuring((W=e.audio)==null?void 0:W.duration)),1)):$("v-if",!0)])),[[N,!((Y=e.audio)!=null&&Y.audio_url)||!((y=e.audio)!=null&&y.video_url)]]),a("div",Kt,[a("h2",Qt,f((Q=e.audio)==null?void 0:Q.title),1),a("p",Xt,f((fe=e.audio)==null?void 0:fe.style),1)])])])])}var Jt=k(qt,[["render",Zt],["__scopeId","data-v-040b76e5"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/ExtendFromInput.vue"]]);const eo=w({name:"CoverFromInput",components:{ElImage:re,ElIcon:ce,VideoPlay:_e,VideoPause:me},data(){return{}},computed:{audio(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.audio},value:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.continue_at},set(e){var t;console.debug("set continue_at",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||(this.value=void 0)},methods:{handleChange(e){var t,n;e<0?this.value=0:e>((t=this.audio)==null?void 0:t.duration)?this.value=(n=this.audio)==null?void 0:n.duration:this.value=e},useFormatDuring:Z,onPlay(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){var t,n,s;((s=(n=(t=this.$store.state)==null?void 0:t.suno)==null?void 0:n.audio)==null?void 0:s.id)!==e.id&&this.onPlay({...e,progress:0})}}}),to={class:"field"},oo={class:"box"},so={class:"title font-bold"},no={class:"task"},io={class:"left"},ao={key:2,class:"duration"},lo={class:"info"},ro={class:"title"},co={class:"style"};function uo(e,t,n,s,c,d){var N,P,b,A,S,T,o,j,E,V,U,I,D,R,M,q,O,z,B,x,H,W,Y,y;const i=u("el-image"),p=u("video-pause"),m=u("el-icon"),v=u("video-play"),C=he("loading");return r(),_("div",to,[a("div",oo,[a("h2",so,f(e.$t("suno.name.cover")),1)]),a("div",no,[e.audio?(r(),_("div",{key:0,class:"audio",onClick:t[2]||(t[2]=Q=>e.onClick(e.audio))},[ue((r(),_("div",io,[l(i,{src:(N=e.audio)==null?void 0:N.image_url,class:"cover",fit:"cover"},null,8,["src"]),((P=e.audio)==null?void 0:P.audio_url)&&((S=(A=(b=e.$store.state)==null?void 0:b.suno)==null?void 0:A.audio)==null?void 0:S.id)===e.audio.id&&((j=(o=(T=e.$store.state)==null?void 0:T.suno)==null?void 0:o.audio)==null?void 0:j.state)==="playing"?(r(),_("div",{key:0,class:"overlay",onClick:t[0]||(t[0]=Q=>e.onPause(e.audio))},[l(m,null,{default:h(()=>[l(p)]),_:1})])):$("v-if",!0),((E=e.audio)==null?void 0:E.audio_url)&&(((I=(U=(V=e.$store.state)==null?void 0:V.suno)==null?void 0:U.audio)==null?void 0:I.id)!==e.audio.id||((M=(R=(D=e.$store.state)==null?void 0:D.suno)==null?void 0:R.audio)==null?void 0:M.id)===e.audio.id&&((z=(O=(q=e.$store.state)==null?void 0:q.suno)==null?void 0:O.audio)==null?void 0:z.state)==="paused")?(r(),_("div",{key:1,class:"overlay",onClick:t[1]||(t[1]=Q=>e.onPlay(e.audio))},[l(m,null,{default:h(()=>[l(v)]),_:1})])):$("v-if",!0),(B=e.audio)!=null&&B.duration?(r(),_("div",ao,f(e.useFormatDuring((x=e.audio)==null?void 0:x.duration)),1)):$("v-if",!0)])),[[C,!((H=e.audio)!=null&&H.audio_url)||!((W=e.audio)!=null&&W.video_url)]]),a("div",lo,[a("h2",ro,f((Y=e.audio)==null?void 0:Y.title),1),a("p",co,f((y=e.audio)==null?void 0:y.style),1)])])):$("v-if",!0)])])}var po=k(eo,[["render",uo],["__scopeId","data-v-68ea6e7a"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/CoverFromInput.vue"]]);const _o=w({name:"PresetPanel",components:{TypeSelector:st,PromptInput:yt,LyricInput:St,StyleInput:Ut,TitleInput:Mt,ExtendFromInput:Jt,CoverFromInput:po,UploadAudio:ut,FontAwesomeIcon:ie,ElButton:ae},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.suno)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),mo={class:"panel"},ho={class:"config"},fo={class:"actions"};function vo(e,t,n,s,c,d){var T,o,j,E,V,U,I;const i=u("type-selector"),p=u("upload-audio"),m=u("prompt-input"),v=u("lyric-input"),C=u("style-input"),N=u("title-input"),P=u("extend-from-input"),b=u("cover-from-input"),A=u("font-awesome-icon"),S=u("el-button");return r(),_("div",mo,[a("div",ho,[l(i,{class:"mb-4"}),l(p,{class:"mb-4"}),(T=e.config)!=null&&T.custom?$("v-if",!0):(r(),g(m,{key:0,class:"mb-4"})),((o=e.config)==null?void 0:o.custom)&&!e.config.instrumental?(r(),g(v,{key:1,class:"mb-4"})):$("v-if",!0),(j=e.config)!=null&&j.custom?(r(),g(C,{key:2,class:"mb-4"})):$("v-if",!0),(E=e.config)!=null&&E.custom?(r(),g(N,{key:3,class:"mb-4"})):$("v-if",!0),((V=e.config)==null?void 0:V.action)==="extend"?(r(),g(P,{key:4,class:"mb-4"})):$("v-if",!0),((U=e.config)==null?void 0:U.action)==="cover"?(r(),g(b,{key:5,class:"mb-4"})):$("v-if",!0),a("div",fo,[((I=e.config)==null?void 0:I.action)!=="extend"?(r(),g(S,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[l(A,{icon:"fa-solid fa-magic",class:"mr-2"}),G(" "+f(e.$t("suno.button.generate")),1)]),_:1},8,["onClick"])):(r(),g(S,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[l(A,{icon:"fa-solid fa-magic",class:"mr-2"}),G(" "+f(e.$t("suno.button.extend")),1)]),_:1},8,["onClick"]))])])])}var $o=k(_o,[["render",vo],["__scopeId","data-v-38bb3c66"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/ConfigPanel.vue"]]);const go="https://webhook.acedata.cloud/suno",yo=w({name:"TaskPreview",components:{ElImage:re,ElIcon:ce,ElTooltip:Ue,ElButton:ae,FontAwesomeIcon:ie,VideoPlay:_e,VideoPause:me,ElDropdown:je,ElDropdownMenu:Fe,ElDropdownItem:Le},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{loading(){var e,t;return((t=(e=this.$store.state.suno)==null?void 0:e.status)==null?void 0:t.getApplications)===se.Request},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},task(){var e;return(e=this.$store.state.suno)==null?void 0:e.tasks},audios(){var n,s,c,d,i,p,m;let e=[];const t=(s=(n=this.modelValue)==null?void 0:n.request)==null?void 0:s.action;return Array.isArray((d=(c=this.modelValue)==null?void 0:c.response)==null?void 0:d.data)&&((m=(p=(i=this.modelValue)==null?void 0:i.response)==null?void 0:p.data)==null||m.forEach(v=>{let C=v;t&&(C.action=t),e.push(C)})),e},application(){var e;return(e=this.$store.state.suno)==null?void 0:e.application},active(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.tasks)==null?void 0:t.active}},methods:{useFormatDuring:Z,onPlay(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){var t,n,s;((s=(n=(t=this.$store.state)==null?void 0:t.suno)==null?void 0:n.audio)==null?void 0:s.id)!==e.id&&this.onPlay({...e,progress:0})},onExtend(e,t){var n;e.stopPropagation(),console.log("on extend"),console.debug("set config",t),this.$store.commit("suno/setConfig",{...(n=this.$store.state.suno)==null?void 0:n.config,model:t.model,custom:!0,instrumental:!1,style:t.style,action:"extend",audio:t,audio_id:t.id,continue_at:t.duration})},onDownload(e,t){e.stopPropagation(),console.log("on download",t);const s=new URL(t).pathname,c=s.substring(s.lastIndexOf("/")+1);console.log("on preview",c),fetch(t).then(d=>d.blob()).then(d=>{ke.exports.saveAs(d,c)})},onPreview(e,t){e.stopPropagation(),console.log("on preview",t),window.open(t,"_blank")},async onGetStems(e,t){e.stopPropagation(),console.log("on get stems",t),await this.onGenerateAudioUrl("stems",t)},onCover(e,t){var n;e.stopPropagation(),console.log("on cover"),console.debug("set config",t),this.$store.commit("suno/setConfig",{...(n=this.$store.state.suno)==null?void 0:n.config,model:t.model,custom:!0,instrumental:!1,style:t.style,action:"cover",audio:t,audio_id:t.id})},async onConcatMusic(e,t){e.stopPropagation(),console.log("on get concat",t),await this.onGenerateAudioUrl("concat",t)},async onGenerateAudioUrl(e,t){var c;const n={action:e,audio_id:t,callback_url:go},s=(c=this.credential)==null?void 0:c.token;if(!s){console.error("no token specified");return}F.info(this.$t("suno.message.startingTask")),pe.audio(n,{token:s}).then(()=>{F.success(this.$t("suno.message.startTaskSuccess"))}).catch(d=>{var i,p,m;F.error(((m=(p=(i=d==null?void 0:d.response)==null?void 0:i.data)==null?void 0:p.error)==null?void 0:m.message)||this.$t("suno.message.startTaskFailed"))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},1e3)},async onGetTasks(){if(this.loading){console.debug("loading");return}await this.$store.dispatch("suno/getTasks",{limit:30,offset:0})}}}),ko={class:"task"},wo=["onClick"],bo={class:"left"},Co=["onClick"],Po=["onClick"],Ao={key:2,class:"duration"},So={class:"info"},Io={class:"title"},No={class:"style"},To={class:"right"},Eo={class:"el-dropdown-link"},Vo={class:"el-dropdown-link"};function Uo(e,t,n,s,c,d){const i=u("el-image"),p=u("video-pause"),m=u("el-icon"),v=u("video-play"),C=u("el-button"),N=u("font-awesome-icon"),P=u("el-tooltip"),b=u("el-dropdown-item"),A=u("el-dropdown-menu"),S=u("el-dropdown"),T=he("loading");return r(),_("div",ko,[(r(!0),_(X,null,ne(e.audios,(o,j)=>{var E,V,U,I,D,R,M,q,O,z,B,x,H,W,Y;return r(),_("div",{key:j,class:"audio",onClick:y=>e.onClick(o)},[ue((r(),_("div",bo,[l(i,{src:o==null?void 0:o.image_url,class:"cover",fit:"cover"},null,8,["src"]),(o==null?void 0:o.audio_url)&&((U=(V=(E=e.$store.state)==null?void 0:E.suno)==null?void 0:V.audio)==null?void 0:U.id)===o.id&&((R=(D=(I=e.$store.state)==null?void 0:I.suno)==null?void 0:D.audio)==null?void 0:R.state)==="playing"?(r(),_("div",{key:0,class:"overlay",onClick:y=>e.onPause(o)},[l(m,null,{default:h(()=>[l(p)]),_:1})],8,Co)):$("v-if",!0),(o==null?void 0:o.audio_url)&&(((O=(q=(M=e.$store.state)==null?void 0:M.suno)==null?void 0:q.audio)==null?void 0:O.id)!==o.id||((x=(B=(z=e.$store.state)==null?void 0:z.suno)==null?void 0:B.audio)==null?void 0:x.id)===o.id&&((Y=(W=(H=e.$store.state)==null?void 0:H.suno)==null?void 0:W.audio)==null?void 0:Y.state)==="paused")?(r(),_("div",{key:1,class:"overlay",onClick:y=>e.onPlay(o)},[l(m,null,{default:h(()=>[l(v)]),_:1})],8,Po)):$("v-if",!0),o!=null&&o.duration?(r(),_("div",Ao,f(e.useFormatDuring(o==null?void 0:o.duration)),1)):$("v-if",!0)])),[[T,!(o!=null&&o.audio_url)||!(o!=null&&o.video_url)]]),a("div",So,[a("h2",Io,f(o==null?void 0:o.title),1),a("p",No,f(o==null?void 0:o.style),1)]),a("div",To,[(o==null?void 0:o.audio_url)&&(o==null?void 0:o.video_url)?(r(),g(C,{key:0,size:"small",round:"",onClick:y=>e.onExtend(y,o)},{default:h(()=>[G(f(e.$t("suno.button.extend")),1)]),_:2},1032,["onClick"])):$("v-if",!0),l(P,{effect:"dark",content:e.$t("suno.button.video"),placement:"top"},{default:h(()=>[o!=null&&o.video_url?(r(),g(N,{key:0,icon:"fa-solid fa-clapperboard",class:"icon icon-preview",onClick:y=>e.onPreview(y,o==null?void 0:o.video_url)},null,8,["onClick"])):$("v-if",!0)]),_:2},1032,["content"]),l(S,null,{dropdown:h(()=>[l(A,null,{default:h(()=>[o!=null&&o.video_url?(r(),g(b,{key:0,onClick:y=>e.onDownload(y,o==null?void 0:o.video_url)},{default:h(()=>[G(f(e.$t("suno.button.download_video")),1)]),_:2},1032,["onClick"])):$("v-if",!0),o!=null&&o.audio_url?(r(),g(b,{key:1,onClick:y=>e.onDownload(y,o==null?void 0:o.audio_url)},{default:h(()=>[G(f(e.$t("suno.button.download_audio")),1)]),_:2},1032,["onClick"])):$("v-if",!0)]),_:2},1024)]),default:h(()=>[a("span",Eo,[l(P,{effect:"dark",content:e.$t("suno.button.download"),placement:"top"},{default:h(()=>[(o==null?void 0:o.audio_url)||(o==null?void 0:o.video_url)?(r(),g(N,{key:0,icon:"fa-solid fa-download",class:"icon icon-download"})):$("v-if",!0)]),_:2},1032,["content"])])]),_:2},1024),l(S,null,{dropdown:h(()=>[l(A,null,{default:h(()=>[o!=null&&o.video_url?(r(),g(b,{key:0,onClick:y=>e.onGetStems(y,o==null?void 0:o.id)},{default:h(()=>[G(f(e.$t("suno.button.get_stems")),1)]),_:2},1032,["onClick"])):$("v-if",!0),(o==null?void 0:o.action)==="extend"?(r(),g(b,{key:1,onClick:y=>e.onCover(y,o)},{default:h(()=>[G(f(e.$t("suno.button.cover_music")),1)]),_:2},1032,["onClick"])):$("v-if",!0),(o==null?void 0:o.action)==="extend"?(r(),g(b,{key:2,onClick:y=>e.onConcatMusic(y,o==null?void 0:o.id)},{default:h(()=>[G(f(e.$t("suno.button.concat_music")),1)]),_:2},1032,["onClick"])):$("v-if",!0)]),_:2},1024)]),default:h(()=>[a("span",Vo,[l(P,{effect:"dark",content:e.$t("suno.button.more"),placement:"top"},{default:h(()=>[(o==null?void 0:o.audio_url)||(o==null?void 0:o.video_url)?(r(),g(N,{key:0,icon:"fa-solid fa-ellipsis",class:"icon icon-ellipsis"})):$("v-if",!0)]),_:2},1032,["content"])])]),_:2},1024)])],8,wo)}),128))])}var jo=k(yo,[["render",Uo],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/task/Preview.vue"]]);const Fo={class:"player-slider"},Lo=w({__name:"PlayerSlider",setup(e){const t=J(),n=K({get:()=>{var i,p;return(p=(i=t.state.suno)==null?void 0:i.audio)==null?void 0:p.progress},set:i=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:i})}),s=K({get:()=>{var i,p;return(p=(i=t.state.suno)==null?void 0:i.audio)==null?void 0:p.duration},set:i=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:i})}),c=()=>{},d=i=>t.dispatch("suno/setAudio",{...t.state.suno.audio,progress:i});return(i,p)=>(r(),_("div",Fo,[l(L(ye),{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=m=>n.value=m),"show-tooltip":!1,min:0,max:s.value,onChange:d,onInput:c},null,8,["modelValue","max"])]))}});var Do=k(Lo,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerSlider.vue"]]),Go="/assets/disk.4907c891.png";const Ro={class:"flex player-song"},Mo=["src"],qo={class:"ml-2 text-xs flex flex-col justify-between"},Oo={class:"w-52 2xl:w-96 cursor-pointer truncate"},zo={class:"flex"},Bo={class:"ml-2 text-dc"},xo=w({__name:"PlayerSong",setup(e){const t=J(),n=K({get:()=>t.state.suno.audio,set:s=>t.commit("suno/setAudio",s)});return ze(n,(s,c)=>{if((s==null?void 0:s.audio_url)!==(c==null?void 0:c.audio_url)){console.log("audio changed",s),s.object&&(console.log("111",s.object),s.object.pause(),delete s.object);const d=new Audio(s.audio_url);s.state==="playing"?d.play():d.pause(),d.addEventListener("loadedmetadata",()=>{d.currentTime=0,d.addEventListener("timeupdate",()=>{t.commit("suno/setAudio",{...t.state.suno.audio,progress:d.currentTime})})}),t.commit("suno/setAudio",{...t.state.suno.audio,object:d})}else if((s==null?void 0:s.progress)!==(c==null?void 0:c.progress)&&Math.abs(s.progress-s.object.currentTime)>2){console.log("progress changed",s.progress);const d=t.state.suno.audio;d.object&&(d.object.currentTime=d.progress)}else(s==null?void 0:s.state)!==(c==null?void 0:c.state)&&(console.log("state changed",s.state),s.object&&(s.state==="playing"?s.object.play():s.object.pause()));(s==null?void 0:s.volume)!==(c==null?void 0:c.volume)&&(console.log("volume changed",s.volume),s.object&&(s.object.volume=s.volume/100))}),(s,c)=>{var d,i,p;return r(),_("div",Ro,[a("img",{alt:"",class:"w-11 h-11 rounded",src:((d=n.value)==null?void 0:d.image_url)||L(Go)},null,8,Mo),a("div",qo,[a("div",Oo,[a("div",zo,[a("span",null,f(((i=n.value)==null?void 0:i.title)||"Music"),1),a("span",Bo,"- "+f(((p=n.value)==null?void 0:p.style)||"SmallRuralDog"),1)])])])])}}});var Ho=k(xo,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerSong.vue"]]);const Wo={class:"flex justify-end items-center gap-x-2.5"},Yo={class:"text-xs"},Ko=w({__name:"PlayerAction",setup(e){const t=J(),n=K({get:()=>{var c,d;return(d=(c=t.state.suno)==null?void 0:c.audio)==null?void 0:d.progress},set:c=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:c})}),s=K({get:()=>{var c,d;return(d=(c=t.state.suno)==null?void 0:c.audio)==null?void 0:d.duration},set:c=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:c})});return(c,d)=>(r(),_("div",Wo,[a("span",Yo,f(L(Z)(n.value))+" / "+f(L(Z)(s.value)),1)]))}});var Qo=k(Ko,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerAction.vue"]]);const Xo=w({__name:"IconPark",props:{icon:{type:null,required:!0},theme:{type:String,required:!1},size:{type:[Number,String],required:!1},spin:{type:Boolean,required:!1},fill:{type:[String,Array],required:!1},strokeLinecap:{type:String,required:!1},strokeLinejoin:{type:String,required:!1},strokeWidth:{type:Number,required:!1}},setup(e){return(t,n)=>(r(),g(Be(t.icon),{theme:t.theme,size:t.size,spin:t.spin,fill:t.fill,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin,"stroke-width":t.strokeWidth},null,8,["theme","size","spin","fill","stroke-linecap","stroke-linejoin","stroke-width"]))}});var de=k(Xo,[["__file","/home/runner/work/Nexior/Nexior/src/components/common/IconPark.vue"]]);const Zo={class:"player-volume flex flex-col items-center pt-2"},Jo={class:"text-sm mt-3"},es={class:"mt-2"},ts=w({__name:"PlayerVolumeSlider",setup(e){const t=J(),n=K({get:()=>{var i;return(i=t.state.suno.audio)==null?void 0:i.volume},set:i=>t.commit("suno/setAudio",{...t.state.suno.audio,volume:i})}),s=K({get:()=>{var i;return(i=t.state.suno.audio)==null?void 0:i.muted},set:i=>t.commit("suno/setAudio",{...t.state.suno.audio,muted:i})}),c=()=>t.dispatch("suno/toggleMuted"),d=i=>t.dispatch("suno/setVolume",i);return(i,p)=>(r(),_("div",Zo,[a("div",null,[l(L(ye),{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=m=>n.value=m),vertical:"",height:"100px","show-tooltip":!1,max:100,min:0,size:"small",disabled:s.value,onInput:d},null,8,["modelValue","disabled"])]),a("div",Jo,f(n.value),1),a("div",es,[l(de,{icon:s.value?L(we):L($e),size:"16",theme:"filled",class:"hover-text",onClick:c},null,8,["icon"])])]))}});var os=k(ts,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerVolumeSlider.vue"]]);const ss={class:"flex items-center justify-center gap-x-3"},ns=w({__name:"PlayerController",setup(e){const t=J(),n=()=>t.dispatch("suno/setAudio",{...t.state.suno.audio,state:t.state.suno.audio.state==="playing"?"paused":"playing"}),s=K(()=>t.state.suno.audio);return(c,d)=>{var i;return r(),_("div",ss,[l(de,{icon:((i=s.value)==null?void 0:i.state)==="playing"?L(be):L(Ce),size:"45",theme:"filled",class:"control",onClick:n},null,8,["icon"]),l(L(De),{placement:"top",width:"50px"},{reference:h(()=>[l(de,{icon:L($e),size:"20","stroke-width":3,class:"hover-text"},null,8,["icon"])]),default:h(()=>[l(os)]),_:1})])}}});var is=k(ns,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerController.vue"]]);const as={class:"flex flex-col items-stretch h-20"},ls={class:"flex grow px-5 items-center"},rs={class:"flex-1"},cs={class:"flex-1"},us={class:"flex-1"},ds=w({__name:"Player",setup(e){return(t,n)=>(r(),_("div",as,[l(Do),a("div",ls,[a("div",rs,[l(Ho)]),a("div",cs,[l(is)]),a("div",us,[l(Qo)])])]))}});var ps=k(ds,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/Player.vue"]]);const _s=w({name:"RecentPanel",components:{TaskPreview:jo,ElSkeleton:Ge,ElSkeletonItem:Re,Player:ps},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,t,n,s;return{...(e=this.$store.state.suno)==null?void 0:e.tasks,items:(s=(n=(t=this.$store.state.suno)==null?void 0:t.tasks)==null?void 0:n.items)==null?void 0:s.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),ms={key:0,class:"tasks"},hs={class:"left"},fs={class:"main"},vs={key:1,class:"tasks"},$s={key:2,class:"description"},gs={class:"flex-1 flex flex-col"},ys={class:"h-20"};function ks(e,t,n,s,c,d){var C,N,P,b,A,S,T,o,j,E,V,U;const i=u("el-skeleton-item"),p=u("el-skeleton"),m=u("task-preview"),v=u("player");return r(),_(X,null,[a("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...I)=>e.onHandleScroll&&e.onHandleScroll(...I))},[((C=e.tasks)==null?void 0:C.items)===void 0?(r(),_("div",ms,[(r(),_(X,null,ne(3,I=>a("div",{key:I,class:"task placeholder"},[a("div",hs,[l(p,{animated:""},{template:h(()=>[l(i,{variant:"image",class:"avatar"})]),_:1})]),a("div",fs,[l(p,{animated:""},{template:h(()=>[l(i,{variant:"p",class:"title"}),l(i,{variant:"text",style:{"margin-right":"16px"}}),l(i,{variant:"text",style:{width:"80%"}})]),_:1})])])),64))])):((P=(N=e.tasks)==null?void 0:N.items)==null?void 0:P.length)&&((A=(b=e.tasks)==null?void 0:b.items)==null?void 0:A.length)>0?(r(),_("div",vs,[(r(!0),_(X,null,ne((S=e.tasks)==null?void 0:S.items,(I,D)=>(r(),g(m,{key:D,"model-value":I,class:"preview"},null,8,["model-value"]))),128))])):$("v-if",!0),((o=(T=e.tasks)==null?void 0:T.items)==null?void 0:o.length)===0?(r(),_("p",$s,f(e.$t("suno.message.noTasks")),1)):$("v-if",!0)],544),ue(a("div",gs,[a("div",ys,[l(v)])],512),[[xe,!!((U=(V=(E=(j=e.$store)==null?void 0:j.state)==null?void 0:E.suno)==null?void 0:V.audio)!=null&&U.object)]])],64)}var ws=k(_s,[["render",ks],["__scopeId","data-v-9a683526"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/RecentPanel.vue"]]);const bs=w({name:"TaskPreview",components:{ElScrollbar:Me,IconPicture:qe,ElImage:re,ElAvatar:Oe,ElIcon:ce},data(){return{showCloseIcon:!0}},computed:{audio(){var e;return(e=this.$store.state.suno)==null?void 0:e.audio}},methods:{closeCard(){this.showCloseIcon=!this.showCloseIcon}}}),Cs={key:0,class:"card"},Ps={class:"image-container"},As={class:"image-slot"},Ss={class:"title"},Is={class:"content"},Ns={class:"artist"},Ts={class:"style"},Es={class:"time"},Vs={class:"lyrics"},Us={key:1,class:"gradient-background"};function js(e,t,n,s,c,d){const i=u("icon-picture"),p=u("el-icon"),m=u("el-image"),v=u("el-avatar"),C=u("el-scrollbar");return r(),g(C,{class:"right-panel"},{default:h(()=>{var N,P,b,A,S,T,o;return[(N=e.audio)!=null&&N.object?(r(),_("div",Cs,[a("div",Ps,[l(m,{src:e.audio.image_url,fit:"cover"},{error:h(()=>[a("div",As,[l(p,null,{default:h(()=>[l(i)]),_:1})])]),_:1},8,["src"]),a("h2",Ss,f((P=e.audio)==null?void 0:P.title),1)]),a("div",Is,[a("div",Ns,[l(v,{size:30,src:(b=e.audio)==null?void 0:b.image_url},null,8,["src"]),a("span",null,f((A=e.audio)==null?void 0:A.prompt),1)]),a("p",Ts,f((S=e.audio)==null?void 0:S.style),1),a("p",Es,f(e.$dayjs.format((T=e.audio)==null?void 0:T.created_at)),1),a("div",Vs,[a("p",null,f((o=e.audio)==null?void 0:o.lyric),1)])])])):(r(),_("div",Us))]}),_:1})}var Fs=k(bs,[["render",js],["__scopeId","data-v-19e67a48"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/PreviewPanel.vue"]]);const Ls="https://webhook.acedata.cloud/suno",Ds=w({name:"SunoIndex",components:{Layout:Ze,ConfigPanel:$o,RecentPanel:ws,PreviewPanel:Fs},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,t;return((t=(e=this.$store.state.suno)==null?void 0:e.status)==null?void 0:t.getApplications)===se.Request},service(){return this.$store.state.suno.service},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},initializing(){return this.$store.state.suno.status.getApplications===se.Request},needApply(){return this.$store.state.suno.status.getApplications===se.Success&&!this.application},application(){return this.$store.state.suno.application},tasks(){return this.$store.state.suno.tasks},applications(){return this.$store.state.suno.applications}},watch:{tasks:{handler(e,t){var n,s;((n=e==null?void 0:e.items)==null?void 0:n.length)>((s=t==null?void 0:t.items)==null?void 0:s.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,n;console.debug("reached top"),await this.onGetTasks({createdAtMax:(n=(t=(e=this.tasks)==null?void 0:e.items)==null?void 0:t[0])==null?void 0:n.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("suno/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplications"),await this.$store.dispatch("suno/getApplications"),console.debug("end onGetApplications"),await this.onGetTasks()},onApply(){Ae.create({application:this.application}).then(({data:e})=>{this.application=e,F.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var t,n;((n=(t=e==null?void 0:e.response)==null?void 0:t.data)==null?void 0:n.code)===Se&&F.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},1e3)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:n,createdAtMax:s}=e||{};console.debug("limit",t,"createdAtMin",n,"createdAtMax",s),await this.$store.dispatch("suno/getTasks",{limit:t,createdAtMin:n,createdAtMax:s})},async onGenerateAudio(){var n;const e={...this.config,callback_url:Ls},t=(n=this.credential)==null?void 0:n.token;if(!t){console.error("no token specified");return}F.info(this.$t("suno.message.startingTask")),pe.audio(e,{token:t}).then(()=>{F.success(this.$t("suno.message.startTaskSuccess"))}).catch(s=>{var c,d,i;F.error(((i=(d=(c=s==null?void 0:s.response)==null?void 0:c.data)==null?void 0:d.error)==null?void 0:i.message)||this.$t("suno.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Gs(e,t,n,s,c,d){const i=u("config-panel"),p=u("recent-panel"),m=u("preview-panel"),v=u("layout");return r(),g(v,null,{config:h(()=>[l(i,{onGenerate:e.onGenerateAudio},null,8,["onGenerate"])]),result:h(()=>[l(p,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"])]),preview:h(()=>[l(m)]),_:1})}var Ws=k(Ds,[["render",Gs],["__scopeId","data-v-11d62c6c"],["__file","/home/runner/work/Nexior/Nexior/src/pages/suno/Index.vue"]]);export{Ws as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-others.e28a6fa7.js";import{ar as c}from"./vendor-fortawesome.0d8f27df.js";import{_ as r}from"./index.
|
|
1
|
+
import"./vendor-others.e28a6fa7.js";import{ar as c}from"./vendor-fortawesome.0d8f27df.js";import{_ as r}from"./index.d28a66ae.js";import{s as a}from"./vendor-element-plus.7eade167.js";import{H as s,al as o,o as p,L as _,M as i,V as m}from"./vendor-@vue.8cef8b94.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.e28a6fa7.js";import{P as b}from"./Pagination.
|
|
1
|
+
import"./vendor-others.e28a6fa7.js";import{P as b}from"./Pagination.3b90ea43.js";import{C as w}from"./CopyToClipboard.8ebe33f6.js";import{_ as C,ai as $}from"./index.d28a66ae.js";import{A as y,B as I,C as D,D as k,F}from"./vendor-element-plus.7eade167.js";import{H as E,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 B}from"./vendor-@vue.8cef8b94.js";import"./vendor-fortawesome.0d8f27df.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const N=E({name:"ConsoleDistributionInvitees",components:{Pagination:b,CopyToClipboard:w,ElRow:y,ElCol:I,ElTable:D,ElTableColumn:k,ElCard:F},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 $.getInvitees({limit:this.limit,offset:(this.page-1)*this.limit,ordering:"-created_at"});this.invitees=e.items,this.total=e.count}}}),T={class:"title"},q={class:"key"},S={class:"copy"},V={class:"description"},j={class:"description"},z={class:"description"},O={class:"created-at"},A={class:"pagination m-v-lg"};function H(e,p,J,L,M,R){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",T,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(()=>[B((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",q,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",A,[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=C(N,[["render",H],["__scopeId","data-v-7cfed024"],["__file","/home/runner/work/Nexior/Nexior/src/pages/distribution/Invitees.vue"]]);export{ee 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.e28a6fa7.js";import{I as D}from"./credential.26787c24.js";import{B as C,_ as N,F as B}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.e28a6fa7.js";import{I as D}from"./credential.26787c24.js";import{B as C,_ as N,F as B}from"./index.d28a66ae.js";import{P as L}from"./Pagination.3b90ea43.js";import{C as O}from"./CopyToClipboard.8ebe33f6.js";import{b as P,C as R,N as z,O as j,A as H,B as M,D as G,F as J}from"./vendor-element-plus.7eade167.js";import{H as K,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.8cef8b94.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";import"./vendor-fortawesome.0d8f27df.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=K({name:"ConsoleUsageList",components:{Pagination:L,ElTag:P,ElTable:R,ElSelect:z,ElOption:j,CopyToClipboard:O,ElRow:H,ElCol:M,ElTableColumn:G,ElCard:J},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:D,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(){B.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"),F=i("copy-to-clipboard"),k=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(k,{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(F,{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=N(U,[["render",se],["__scopeId","data-v-1d3a6fa8"],["__file","/home/runner/work/Nexior/Nexior/src/pages/console/usage/List.vue"]]);export{ve as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-others.e28a6fa7.js";import{o as E}from"./order.
|
|
1
|
+
import"./vendor-others.e28a6fa7.js";import{o as E}from"./order.6d451728.js";import{P as O}from"./Pagination.3b90ea43.js";import{C as I}from"./CopyToClipboard.8ebe33f6.js";import{O as P}from"./order.aa35b6fb.js";import{_ as N}from"./index.d28a66ae.js";import{g as F}from"./price.e1faf3aa.js";import{A,B,C as L,D as T,u as V,b as z,F as H}from"./vendor-element-plus.7eade167.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.8cef8b94.js";import"./vendor-fortawesome.0d8f27df.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const j=R({name:"ConsoleOrderList",components:{Pagination:O,CopyToClipboard:I,ElRow:A,ElCol:B,ElTable:L,ElTableColumn:T,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,E.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"),D=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"])),[[D,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
|
-
import"./vendor-others.e28a6fa7.js";import{_ as E,E as B,F as T}from"./index.
|
|
1
|
+
import"./vendor-others.e28a6fa7.js";import{_ as E,E as B,F as T}from"./index.d28a66ae.js";import{I as D}from"./credential.26787c24.js";import{P as F}from"./Pagination.3b90ea43.js";import{C as N}from"./CopyToClipboard.8ebe33f6.js";import{C as P,A as x,u as I,B as L,b as S,D as O,F as R}from"./vendor-element-plus.7eade167.js";import{H as U,al as i,av as V,L as c,M as a,o as _,V as n,f as s,T as l,O as q,S as y,R as g,e as M}from"./vendor-@vue.8cef8b94.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";import"./vendor-fortawesome.0d8f27df.js";const z=U({name:"ConsoleApplicationList",components:{Pagination:F,CopyToClipboard:N,ElTable:P,ElRow:x,ElButton:I,ElCol:L,ElTag:S,ElTableColumn:O,ElCard:R},data(){return{credentialType:D,applications:[],loading:!1,total:void 0,buying:!1,limit:10,form:{amount:1},active:{service:void 0,application:void 0}}},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")}},watch:{page:{handler(){this.onFetchData()}},type:{handler(){this.onFetchData()}}},mounted(){this.onFetchData()},methods:{onBuyMore(e){this.$router.push({name:B,params:{id:e.id}})},onPageChange(e){var d;this.$router.push({name:(d=this.$route.name)==null?void 0:d.toString(),query:{...this.$route.query,page:e}})},onFetchData(){this.loading=!0,T.getAll({limit:this.limit,offset:(this.page-1)*this.limit,user_id:this.$store.getters.user.id,ordering:"-created_at"}).then(({data:e})=>{this.applications=e.items,this.loading=!1,this.total=e.count}).catch(()=>{this.loading=!1})},getRemainingAmount(e){var p,m;if(e.remaining_amount===void 0||e.remaining_amount===null)return"";const d=this.$t(`service.unit.${(p=e==null?void 0:e.service)==null?void 0:p.unit}s`);return`${(m=e.remaining_amount)==null?void 0:m.toFixed(6)} ${d}`},getUsedAmount(e){var p,m;if(e.used_amount===void 0||e.used_amount===null)return"";const d=this.$t(`service.unit.${(p=e==null?void 0:e.service)==null?void 0:p.unit}s`);return`${(m=e.used_amount)==null?void 0:m.toFixed(6)} ${d}`}}}),j={class:"title"},H={class:"copy"},G={key:0,class:"expired-at"},J={class:"float-right"},K={class:"pagination"};function Q(e,d,p,m,W,X){const f=i("el-col"),h=i("el-row"),$=i("copy-to-clipboard"),u=i("el-table-column"),v=i("el-tag"),b=i("el-button"),w=i("el-table"),C=i("el-card"),k=i("pagination"),A=V("loading");return _(),c(h,{class:"panel"},{default:a(()=>[n(f,{span:24},{default:a(()=>[n(h,null,{default:a(()=>[n(f,{span:24},{default:a(()=>[s("h2",j,l(e.$t("common.title.allApplications")),1)]),_:1})]),_:1}),n(h,null,{default:a(()=>[n(f,{span:24},{default:a(()=>[n(C,{shadow:"hover"},{default:a(()=>[q((_(),c(w,{data:e.applications,stripe:"","table-layout":"fixed","empty-text":e.$t("common.message.noData")},{default:a(()=>[n(u,{prop:"id",label:e.$t("application.field.id"),width:"280px","class-name":"text-center"},{default:a(t=>{var o;return[s("span",null,l(t.row.id),1),s("span",H,[n($,{content:(o=t==null?void 0:t.row)==null?void 0:o.id,class:"inline-block"},null,8,["content"])])]}),_:1},8,["label"]),n(u,{label:e.$t("application.field.type"),width:"80px"},{default:a(t=>{var o,r;return[((o=t.row)==null?void 0:o.type)==="Period"?(_(),c(v,{key:0,type:"success",effect:"dark"},{default:a(()=>[y(l(e.$t("application.type.period")),1)]),_:1})):g("v-if",!0),((r=t.row)==null?void 0:r.type)==="Usage"?(_(),c(v,{key:1,effect:"dark"},{default:a(()=>[y(l(e.$t("application.type.usage")),1)]),_:1})):g("v-if",!0)]}),_:1},8,["label"]),n(u,{label:e.$t("application.field.name"),width:"180px"},{default:a(t=>{var o,r;return[s("span",null,l((r=(o=t.row)==null?void 0:o.service)==null?void 0:r.title),1)]}),_:1},8,["label"]),n(u,{prop:"remaining_amount",label:e.$t("application.field.remainingAmount"),width:"160px","class-name":"text-center"},{default:a(t=>[s("span",null,l(e.getRemainingAmount(t.row)),1)]),_:1},8,["label"]),n(u,{prop:"used_amount",label:e.$t("application.field.usedAmount"),width:"160px","class-name":"text-center"},{default:a(t=>[s("span",null,l(e.getUsedAmount(t.row)),1)]),_:1},8,["label"]),n(u,{label:e.$t("application.field.expiredAt"),width:"200px"},{default:a(t=>[t.row.expired_at?(_(),M("span",G,l(e.$dayjs.format(t.row.expired_at)),1)):g("v-if",!0)]),_:1},8,["label"]),n(u,{fixed:"right",width:"120px"},{default:a(t=>{var o,r;return[s("div",J,[((o=t==null?void 0:t.row)==null?void 0:o.type)==="Period"||((r=t==null?void 0:t.row)==null?void 0:r.type)==="Usage"?(_(),c(b,{key:0,type:"primary",round:"",size:"small",onClick:Y=>e.onBuyMore(t==null?void 0:t.row)},{default:a(()=>[y(l(e.$t("application.button.buyMore")),1)]),_:2},1032,["onClick"])):g("v-if",!0)])]}),_:1})]),_:1},8,["data","empty-text"])),[[A,e.loading]])]),_:1})]),_:1})]),_:1}),n(h,null,{default:a(()=>[n(f,null,{default:a(()=>[s("div",K,[n(k,{"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 de=E(z,[["render",Q],["__scopeId","data-v-31a091d9"],["__file","/home/runner/work/Nexior/Nexior/src/pages/console/application/List.vue"]]);export{de as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-others.e28a6fa7.js";import{_ as r}from"./index.
|
|
1
|
+
import"./vendor-others.e28a6fa7.js";import{_ as r}from"./index.d28a66ae.js";import{H as e}from"./vendor-@vue.8cef8b94.js";import"./vendor-element-plus.7eade167.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";import"./vendor-fortawesome.0d8f27df.js";const o=e({name:"AuthLogin",data(){var t;return{redirect:(t=this.$route.query.redirect)==null?void 0:t.toString()}},async mounted(){this.$store.state.token.access?this.$router.push(this.redirect||"/"):this.$store.dispatch("login")}});var u=r(o,[["__file","/home/runner/work/Nexior/Nexior/src/pages/auth/Login.vue"]]);export{u as default};
|