@acedatacloud/nexior 3.2.2 → 3.4.0
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.12cc7be5.js +1 -0
- package/dist/assets/Callback.734b5a11.js +1 -0
- package/dist/assets/{Chatdoc.e3a25d38.js → Chatdoc.f7ad2e25.js} +1 -1
- package/dist/assets/Console.5279ab94.js +1 -0
- package/dist/assets/{Conversation.7a1052e9.js → Conversation.bdf70cd4.js} +1 -1
- package/dist/assets/{Conversation.d0fea332.js → Conversation.ca582900.js} +1 -1
- package/dist/assets/{CopyToClipboard.ff135372.js → CopyToClipboard.d8ea70c0.js} +1 -1
- package/dist/assets/Detail.dbd67b08.js +1 -0
- package/dist/assets/{EditArray.fe3be781.js → EditArray.d2770a6b.js} +1 -1
- package/dist/assets/Extra.ab32060e.js +1 -0
- package/dist/assets/History.9915a651.js +1 -0
- package/dist/assets/{ImagePreview.ed465056.js → ImagePreview.c5dbea05.js} +1 -1
- package/dist/assets/Index.16d36149.js +1 -0
- package/dist/assets/Index.24e5c4af.js +1 -0
- package/dist/assets/Index.30107071.js +1 -0
- package/dist/assets/Index.3909ada8.js +1 -0
- package/dist/assets/Index.41586f5d.js +1 -0
- package/dist/assets/Index.4a370bae.js +1 -0
- package/dist/assets/Index.66cf2e75.js +1 -0
- package/dist/assets/Index.6dca1a46.js +1 -0
- package/dist/assets/Index.792a52b5.js +1 -0
- package/dist/assets/{Index.736050cd.js → Index.b5fdded1.js} +2 -2
- package/dist/assets/Index.b6d67e56.js +1 -0
- package/dist/assets/Index.c0d15e5c.js +1 -0
- package/dist/assets/Index.ff12eb5c.js +1 -0
- package/dist/assets/{InfoIcon.172685bc.js → InfoIcon.a5ac0a75.js} +1 -1
- package/dist/assets/Invitees.05887d5b.js +1 -0
- package/dist/assets/KaTeX_AMS-Regular.0cdd387c.woff2 +0 -0
- package/dist/assets/KaTeX_AMS-Regular.30da91e8.woff +0 -0
- package/dist/assets/KaTeX_AMS-Regular.68534840.ttf +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold.07d8e303.ttf +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold.1ae6bd74.woff +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold.de7701e4.woff2 +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular.3398dd02.woff +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular.5d53e70a.woff2 +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular.ed0b7437.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold.74444efd.woff2 +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold.9163df9c.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold.9be7ceb8.woff +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular.1e6f9579.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular.51814d27.woff2 +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular.5e28753b.woff +0 -0
- package/dist/assets/KaTeX_Main-Bold.0f60d1b8.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Bold.138ac28d.ttf +0 -0
- package/dist/assets/KaTeX_Main-Bold.c76c5d69.woff +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic.70ee1f64.ttf +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic.99cd42a3.woff2 +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic.a6f7ec0d.woff +0 -0
- package/dist/assets/KaTeX_Main-Italic.0d85ae7c.ttf +0 -0
- package/dist/assets/KaTeX_Main-Italic.97479ca6.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Italic.f1d6ef86.woff +0 -0
- package/dist/assets/KaTeX_Main-Regular.c2342cd8.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Regular.c6368d87.woff +0 -0
- package/dist/assets/KaTeX_Main-Regular.d0332f52.ttf +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic.850c0af5.woff +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic.dc47344d.woff2 +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic.f9377ab0.ttf +0 -0
- package/dist/assets/KaTeX_Math-Italic.08ce98e5.ttf +0 -0
- package/dist/assets/KaTeX_Math-Italic.7af58c5e.woff2 +0 -0
- package/dist/assets/KaTeX_Math-Italic.8a8d2445.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold.1ece03f7.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold.e99ae511.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold.ece03cfd.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic.00b26ac8.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic.3931dd81.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic.91ee6750.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular.11e4dc8a.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular.68e8c73e.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular.f36ea897.ttf +0 -0
- package/dist/assets/KaTeX_Script-Regular.036d4e95.woff2 +0 -0
- package/dist/assets/KaTeX_Script-Regular.1c67f068.ttf +0 -0
- package/dist/assets/KaTeX_Script-Regular.d96cdf2b.woff +0 -0
- package/dist/assets/KaTeX_Size1-Regular.6b47c401.woff2 +0 -0
- package/dist/assets/KaTeX_Size1-Regular.95b6d2f1.ttf +0 -0
- package/dist/assets/KaTeX_Size1-Regular.c943cc98.woff +0 -0
- package/dist/assets/KaTeX_Size2-Regular.2014c523.woff +0 -0
- package/dist/assets/KaTeX_Size2-Regular.a6b2099f.ttf +0 -0
- package/dist/assets/KaTeX_Size2-Regular.d04c5421.woff2 +0 -0
- package/dist/assets/KaTeX_Size3-Regular.500e04d5.ttf +0 -0
- package/dist/assets/KaTeX_Size3-Regular.6ab6b62e.woff +0 -0
- package/dist/assets/KaTeX_Size4-Regular.99f9c675.woff +0 -0
- package/dist/assets/KaTeX_Size4-Regular.a4af7d41.woff2 +0 -0
- package/dist/assets/KaTeX_Size4-Regular.c647367d.ttf +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular.71d517d6.woff2 +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular.e14fed02.woff +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular.f01f3e87.ttf +0 -0
- package/dist/assets/List.243253b5.js +1 -0
- package/dist/assets/List.51dc0131.js +1 -0
- package/dist/assets/List.db09cfa2.js +1 -0
- package/dist/assets/Login.1c60ad3a.js +1 -0
- package/dist/assets/Main.0297906b.js +1 -0
- package/dist/assets/Manage.85cea796.js +1 -0
- package/dist/assets/MarkdownRenderer.8973deb6.js +1 -0
- package/dist/assets/{Navigator.afc902fd.js → Navigator.fe99f65f.js} +1 -1
- package/dist/assets/{Pagination.8b289687.js → Pagination.0ba2e8a8.js} +1 -1
- package/dist/assets/Setting.5c64a79d.js +1 -0
- package/dist/assets/{Status.262204eb.js → Status.b99d05d8.js} +1 -1
- package/dist/assets/Subscribe.50e8102e.js +1 -0
- package/dist/assets/{distribution.b731316d.js → distribution.4ec51377.js} +1 -1
- package/dist/assets/index.184d52f7.js +3 -0
- package/dist/assets/index.9d20d705.css +1 -0
- package/dist/assets/{order.87c1d91b.js → order.458da799.js} +1 -1
- package/dist/assets/{price.4ab7e0ad.js → price.f93b8cf3.js} +1 -1
- package/dist/assets/{vendor-@vue.8cef8b94.js → vendor-@vue.30126b18.js} +1 -1
- package/dist/assets/{vendor-element-plus.7eade167.js → vendor-element-plus.b61d898b.js} +1 -1
- package/dist/assets/{vendor-fortawesome.0d8f27df.js → vendor-fortawesome.a228a0e7.js} +1 -1
- package/dist/assets/vendor-markdown.64d20655.js +15 -0
- package/dist/assets/vendor-others.32a9cc65.js +376 -0
- package/dist/assets/vendor-others.7742907f.css +1 -0
- package/dist/assets/{vendor-qrcode.ef88fffc.js → vendor-qrcode.38ad4424.js} +1 -1
- package/dist/assets/{vendor-vue-dark-switch.869ebb1e.js → vendor-vue-dark-switch.bf0d8693.js} +1 -1
- package/dist/index.html +9 -8
- package/package.json +5 -3
- package/dist/assets/Auth.61f24ff8.js +0 -1
- package/dist/assets/Callback.0f3d8c09.js +0 -1
- package/dist/assets/Console.153b0c1e.js +0 -1
- package/dist/assets/Detail.82a87828.js +0 -1
- package/dist/assets/Extra.19da7140.js +0 -1
- package/dist/assets/History.2b971672.js +0 -1
- package/dist/assets/Index.03691b6d.js +0 -1
- package/dist/assets/Index.4d821bfb.js +0 -1
- package/dist/assets/Index.5907ea1f.js +0 -1
- package/dist/assets/Index.635f6d80.js +0 -1
- package/dist/assets/Index.85bdd5ac.js +0 -1
- package/dist/assets/Index.88dff53d.js +0 -1
- package/dist/assets/Index.8c9ae33c.js +0 -1
- package/dist/assets/Index.a56f5f7e.js +0 -1
- package/dist/assets/Index.cc3dec50.js +0 -1
- package/dist/assets/Index.d18d4500.js +0 -1
- package/dist/assets/Index.df31918d.js +0 -1
- package/dist/assets/Index.fec053d3.js +0 -1
- package/dist/assets/Invitees.36f0ec98.js +0 -1
- package/dist/assets/List.303bb7ef.js +0 -1
- package/dist/assets/List.756698f8.js +0 -1
- package/dist/assets/List.d580198f.js +0 -1
- package/dist/assets/Login.d85ce254.js +0 -1
- package/dist/assets/Main.e9324ada.js +0 -1
- package/dist/assets/Manage.c1a074b7.js +0 -1
- package/dist/assets/MarkdownRenderer.f3bc9b58.js +0 -1
- package/dist/assets/Setting.b0b24d3c.js +0 -1
- package/dist/assets/Subscribe.c3b26945.js +0 -1
- package/dist/assets/index.56bf2312.css +0 -1
- package/dist/assets/index.af944887.js +0 -3
- package/dist/assets/vendor-markdown.4f590479.js +0 -16
- package/dist/assets/vendor-others.e28a6fa7.js +0 -110
- package/dist/assets/vendor-others.fbff9a31.css +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./vendor-others.e28a6fa7.js";import{ar as j}from"./vendor-fortawesome.0d8f27df.js";import{_ as w,A as ne,a0 as L,F as ie,ad as le,aW as re,W as ce}from"./index.af944887.js";import{Q as de,u as O,x as pe,y as T,M as me,L as ue,T as he,U as _e,m as oe,I as ge,H as fe,V as ve}from"./vendor-element-plus.7eade167.js";import{H as I,al as r,o as n,e as c,f as d,I as M,V as t,M as u,T as l,S as v,U as A,ai as E,L as D,R as $,P as N,m as $e}from"./vendor-@vue.8cef8b94.js";import{I as ye}from"./InfoIcon.172685bc.js";import{A as be}from"./Status.262204eb.js";import{C as ke}from"./CopyToClipboard.ff135372.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const we=I({name:"LayoutHeadshots",components:{ElDrawer:de,ElButton:O,FontAwesomeIcon:j},data(){return{drawer:!1}}}),Ie={class:"main"},Se={class:"config"},Te={class:"result"};function Ve(e,s,a,o,_,g){const p=r("font-awesome-icon"),h=r("el-button"),i=r("el-drawer");return n(),c("div",Ie,[d("div",Se,[M(e.$slots,"config",{},void 0,!0)]),d("div",Te,[M(e.$slots,"result",{},void 0,!0)]),t(h,{round:"",class:"menu",onClick:s[0]||(s[0]=m=>e.drawer=!0)},{default:u(()=>[t(p,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),t(i,{modelValue:e.drawer,"onUpdate:modelValue":s[1]||(s[1]=m=>e.drawer=m),"with-header":!1,size:"340px",class:"drawer"},{default:u(()=>[M(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Ce=w(we,[["render",Ve],["__scopeId","data-v-3e896eaa"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Headshots.vue"]]);const Ae=I({name:"ImageUrlsInput",components:{ElUpload:pe,ElButton:O,InfoIcon:ye},data(){return{fileList:[],uploadUrl:ne()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>{var s;return(s=e==null?void 0:e.response)==null?void 0:s.file_url})},value:{get(){var e,s;return(s=(e=this.$store.state.headshots)==null?void 0:e.config)==null?void 0:s.image_urls},set(e){var a;const s=this.urls;this.$store.commit("headshots/setConfig",{...(a=this.$store.state.headshots)==null?void 0:a.config,image_urls:s})}}},mounted(){this.value||(this.value=void 0),this.onSetImageUrls()},methods:{onExceed(){T.warning(this.$t("headshots.message.uploadImageExceed"))},onError(){T.error(this.$t("headshots.message.uploadImageError"))},onSetImageUrls(){var s;const e=this.urls;this.$store.commit("headshots/setConfig",{...(s=this.$store.state.headshots)==null?void 0:s.config,image_urls:e})},async onSuccess(){this.onSetImageUrls()}}}),Ee={class:"field"},Pe={class:"title font-bold"},Ge={class:"upload-wrapper"};function Ue(e,s,a,o,_,g){const p=r("el-button"),h=r("el-upload"),i=r("info-icon");return n(),c("div",Ee,[d("h2",Pe,l(e.$t("headshots.name.endImageUrls")),1),d("div",Ge,[t(h,{"file-list":e.fileList,"onUpdate:fileList":s[0]||(s[0]=m=>e.fileList=m),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:2,multiple:!0,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:u(()=>[t(p,{size:"small",type:"primary",round:""},{default:u(()=>[v(l(e.$t("headshots.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),t(i,{content:e.$t("headshots.description.endImageUrls"),class:"info"},null,8,["content"])])}var Ne=w(Ae,[["render",Ue],["__scopeId","data-v-69ae8722"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ImageUrlsInput.vue"]]);const Re="fast",De=I({name:"ModeSelector",components:{ElRadioButton:me,ElRadioGroup:ue},data(){return{options:[{label:this.$t("headshots.button.fast"),value:"fast"},{label:this.$t("headshots.button.relax"),value:"relax"}]}},computed:{value:{get(){var e;return(e=this.$store.state.headshots.config)==null?void 0:e.mode},set(e){console.debug("set mode",e),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots.config,mode:e})}}},mounted(){this.value||(this.value=Re)}}),Le={class:"field"},Me={class:"title font-bold"};function je(e,s,a,o,_,g){const p=r("el-radio-button"),h=r("el-radio-group");return n(),c("div",Le,[d("h2",Me,l(e.$t("headshots.name.mode")),1),t(h,{modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=i=>e.value=i),size:"small",class:"mode"},{default:u(()=>[(n(!0),c(A,null,E(e.options,i=>(n(),D(p,{key:i.value,label:i.value},{default:u(()=>[v(l(i.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}var Oe=w(De,[["render",je],["__scopeId","data-v-5ec8e3d9"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ModeSelector.vue"]]);const ze=I({name:"StylizeSelector",components:{ElTabs:he,ElTabPane:_e,ElImage:oe},data(){return{tab:"styles",value:"",elements:{styles:{displayName:this.$t("headshots.styleCategory.styles"),items:[{image:"https://static.aipedias.com/aicamera/common/20241008/20241008202314260779439.png",label:this.$t("headshots.styleTag.malePportrait"),value:"male_portrait"},{image:"https://static.aipedias.com/aicamera/common/20241008/202410082022241e9755548.png",label:this.$t("headshots.styleTag.malePportrait2"),value:"male_portrait2"},{image:"https://static.aipedias.com/aicamera/common/20241101/20241101170130d78f66521.png",label:this.$t("headshots.styleTag.kindergarten"),value:"kindergarten"},{image:"https://static.aipedias.com/aicamera/common/20240923/20240923123233accf60398.webp",label:this.$t("headshots.styleTag.logoTshirt"),value:"logo_tshirt"},{image:"https://static.aipedias.com/aicamera/common/20241025/202410252012329472d0656.jpg",label:this.$t("headshots.styleTag.wedding"),value:"wedding"},{image:"https://static.aipedias.com/aicamera/common/20240915/20240915145045254931400.webp",label:this.$t("headshots.styleTag.businessPphoto"),value:"business_photo"},{image:"https://static.aipedias.com/aicamera/common/20240810/20240810194526040341795.jpg",label:this.$t("headshots.styleTag.bobSuit"),value:"bob_suit"},{image:"https://static.aipedias.com/aicamera/common/20240717/20240717152654e0b348173.webp",label:this.$t("headshots.styleTag.femalePortrait"),value:"female_portrait"}]}}}},watch:{value(e){var s;console.debug("set template",e),this.$store.commit("headshots/setConfig",{...(s=this.$store.state.headshots)==null?void 0:s.config,template:e})}},mounted(){var e;this.value||(this.value=""),console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...(e=this.$store.state.headshots)==null?void 0:e.config,template:this.value})},methods:{onToggle(e){var s;this.value===e?this.value="":this.value=e,console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...(s=this.$store.state.headshots)==null?void 0:s.config,template:this.value})}}}),Be={class:"field"},He=["onClick"],qe={class:"name"};function Fe(e,s,a,o,_,g){const p=r("el-image"),h=r("el-tab-pane"),i=r("el-tabs");return n(),c("div",Be,[$(` <h2 class="title">{{ $t('headshots.field.elements') }}</h2> `),t(i,{modelValue:e.tab,"onUpdate:modelValue":s[0]||(s[0]=m=>e.tab=m)},{default:u(()=>[(n(!0),c(A,null,E(e.elements,(m,f)=>(n(),D(h,{key:f,label:m.displayName,name:f,class:"pane"},{default:u(()=>[(n(!0),c(A,null,E(m.items,(k,V)=>(n(),c("div",{key:V,class:N({item:!0,active:e.value===k.value}),onClick:C=>e.onToggle(k.value)},[t(p,{src:k.image,fit:"fill",class:"preview"},null,8,["src"]),d("span",qe,l(k.label),1)],10,He))),128))]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])])}var We=w(ze,[["render",Fe],["__scopeId","data-v-7e0125ad"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ElementsSelector.vue"]]);const Qe=I({name:"PresetPanel",components:{ModeSelector:Oe,ImageUrlsInput:Ne,ElButton:O,FontAwesomeIcon:j,ElementsSelector:We},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.headshots)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Je={class:"panel"},Ke={class:"config"},Xe={class:"actions"};function Ye(e,s,a,o,_,g){const p=r("elements-selector"),h=r("mode-selector"),i=r("image-urls-input"),m=r("font-awesome-icon"),f=r("el-button");return n(),c("div",Je,[d("div",Ke,[t(p,{class:"mb-4"}),t(h,{class:"mb-4"}),t(i,{class:"mb-4"}),d("div",Xe,[t(f,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(m,{icon:"fa-solid fa-magic",class:"mr-2"}),v(" "+l(e.$t("headshots.button.generate")),1)]),_:1},8,["onClick"])])])])}var Ze=w(Qe,[["render",Ye],["__scopeId","data-v-6a264fac"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/ConfigPanel.vue"]]);const xe=I({name:"ImageGallery",props:{modelValue:{type:Object,required:!0}},setup(e){return{images:$e(()=>{var o,_,g;return((g=(_=(o=e.modelValue)==null?void 0:o.response)==null?void 0:_.data)==null?void 0:g.slice(0,2))||[]}),viewImage:o=>{window.open(o,"_blank")}}}}),es={class:"image-gallery"},ss=["src"],ts=["onClick"];function as(e,s,a,o,_,g){return n(),c("div",es,[(n(!0),c(A,null,E(e.images,(p,h)=>(n(),c("div",{key:h,class:"image-container"},[d("img",{src:p.image_url,alt:"Image"},null,8,ss),d("button",{class:"view-button",onClick:i=>e.viewImage(p.image_url)},l(e.$t("headshots.button.viewImage")),9,ts)]))),128))])}var os=w(xe,[["render",as],["__scopeId","data-v-0187109d"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/ImageGallery.vue"]]);const ns=I({name:"TaskPreview",components:{ElImage:oe,CopyToClipboard:ke,FontAwesomeIcon:j,ElAlert:ge,ImageGallery:os},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.headshots)==null?void 0:e.application},config(){var e;return(e=this.$store.state.headshots)==null?void 0:e.config}},methods:{onDownload(e,s){e.stopPropagation(),console.log("on download"),window.open(s,"_blank")},onReload(e){const s=e.target,a=new URL(s.src),o=a.searchParams.get("retry");if(!o)a.searchParams.set("retry","1");else if(parseInt(o)<2)a.searchParams.set("retry",(parseInt(o)+1).toString());else return;s.src=a.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),is={class:"preview"},ls={class:"left"},rs={class:"main"},cs={class:"bot"},ds={class:"datetime"},ps={class:"info"},ms={key:0,class:"prompt mt-2"},us={key:0},hs={key:1},_s={key:0,class:N({content:!0,failed:!0})},gs={class:"image-wrapper"},fs={class:"description"},vs={key:1,class:N({content:!0})},$s={class:"description"},ys={class:"description"},bs={class:"description"},ks={key:2,class:N({content:!0})},ws={class:"description"},Is={key:3,class:N({content:!0})},Ss={class:"description"};function Ts(e,s,a,o,_,g){var k,V,C,P,G,U,S,R,z,B,H,q,F,W,Q;const p=r("el-image"),h=r("image-gallery"),i=r("font-awesome-icon"),m=r("copy-to-clipboard"),f=r("el-alert");return n(),c("div",is,[d("div",ls,[t(p,{src:"https://cdn.acedata.cloud/isxyfw.png",class:"avatar"})]),d("div",rs,[d("div",cs,[v(l(e.$t("headshots.name.headshotsBot"))+" ",1),d("span",ds,l(e.$dayjs.format(""+new Date(parseFloat(((k=e.modelValue)==null?void 0:k.created_at)||"")*1e3))),1)]),d("div",ps,[(C=(V=e.modelValue)==null?void 0:V.request)!=null&&C.template?(n(),c("p",ms,[v(l((G=(P=e.modelValue)==null?void 0:P.request)==null?void 0:G.template)+" ",1),(U=e.modelValue)!=null&&U.response?$("v-if",!0):(n(),c("span",us," - ("+l(e.$t("headshots.status.pending"))+") ",1)),((R=(S=e.modelValue)==null?void 0:S.response)==null?void 0:R.status)==="unknown"?(n(),c("span",hs," - ("+l(e.$t("headshots.status.processing"))+") ",1)):$("v-if",!0)])):$("v-if",!0)]),$(" Display success message "),((B=(z=e.modelValue)==null?void 0:z.response)==null?void 0:B.success)===!0?(n(),c("div",_s,[d("div",gs,[t(h,{"model-value":e.modelValue},null,8,["model-value"])]),t(f,{closable:!1,class:"mt-2 success"},{default:u(()=>{var y,b;return[d("p",fs,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),t(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):$("v-if",!0),$(" Display error message "),((q=(H=e.modelValue)==null?void 0:H.response)==null?void 0:q.success)===!1?(n(),c("div",vs,[t(f,{closable:!1,class:"failure"},{template:u(()=>[t(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),v(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b,J,K,X,Y,Z,x,ee,se,te,ae;return[d("p",$s,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),t(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])]),d("p",ys,[t(i,{icon:"fa-solid fa-circle-info",class:"mr-1"}),v(" "+l(e.$t("headshots.name.failureReason"))+": "+l((X=(K=(J=e.modelValue)==null?void 0:J.response)==null?void 0:K.error)==null?void 0:X.message)+" ",1),t(m,{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"])]),d("p",bs,[t(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),v(" "+l(e.$t("headshots.name.traceId"))+": "+l((se=(ee=e.modelValue)==null?void 0:ee.response)==null?void 0:se.trace_id)+" ",1),t(m,{content:(ae=(te=e.modelValue)==null?void 0:te.response)==null?void 0:ae.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):$("v-if",!0),$(" Display error message "),(F=e.modelValue)!=null&&F.response?$("v-if",!0):(n(),c("div",ks,[t(f,{closable:!1,class:"info"},{template:u(()=>[t(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),v(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b;return[d("p",ws,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),t(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])),((Q=(W=e.modelValue)==null?void 0:W.response)==null?void 0:Q.status)==="unknown"?(n(),c("div",Is,[t(f,{closable:!1,class:"info"},{template:u(()=>[t(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),v(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b;return[d("p",Ss,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),t(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):$("v-if",!0)])])}var Vs=w(ns,[["render",Ts],["__scopeId","data-v-43e1feb8"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/task/Preview.vue"]]);const Cs=I({name:"RecentPanel",components:{TaskPreview:Vs,ElSkeleton:fe,ElSkeletonItem:ve},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,s,a,o;return{...(e=this.$store.state.headshots)==null?void 0:e.tasks,items:(o=(a=(s=this.$store.state.headshots)==null?void 0:s.tasks)==null?void 0:a.items)==null?void 0:o.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),As={key:0,class:"tasks"},Es={class:"left"},Ps={class:"main"},Gs={key:1,class:"tasks"},Us={key:2,class:"description"};function Ns(e,s,a,o,_,g){var m,f,k,V,C,P,G,U;const p=r("el-skeleton-item"),h=r("el-skeleton"),i=r("task-preview");return n(),c("div",{ref:"panel",class:"panel recent",onScroll:s[0]||(s[0]=(...S)=>e.onHandleScroll&&e.onHandleScroll(...S))},[((m=e.tasks)==null?void 0:m.items)===void 0?(n(),c("div",As,[(n(),c(A,null,E(3,S=>d("div",{key:S,class:"task placeholder"},[d("div",Es,[t(h,{animated:""},{template:u(()=>[t(p,{variant:"image",class:"avatar"})]),_:1})]),d("div",Ps,[t(h,{animated:""},{template:u(()=>[t(p,{variant:"p",class:"title"}),t(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):((k=(f=e.tasks)==null?void 0:f.items)==null?void 0:k.length)&&((C=(V=e.tasks)==null?void 0:V.items)==null?void 0:C.length)>0?(n(),c("div",Gs,[(n(!0),c(A,null,E((P=e.tasks)==null?void 0:P.items,(S,R)=>(n(),D(i,{key:R,"model-value":S,class:"preview"},null,8,["model-value"]))),128))])):$("v-if",!0),((U=(G=e.tasks)==null?void 0:G.items)==null?void 0:U.length)===0?(n(),c("p",Us,l(e.$t("headshots.message.noTasks")),1)):$("v-if",!0)],544)}var Rs=w(Cs,[["render",Ns],["__scopeId","data-v-37920e9a"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/RecentPanel.vue"]]);const Ds="https://webhook.acedata.cloud/headshots",Ls=I({name:"HeadshotsIndex",components:{ConfigPanel:Ze,Layout:Ce,ApplicationStatus:be,RecentPanel:Rs},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,s;return((s=(e=this.$store.state.headshots)==null?void 0:e.status)==null?void 0:s.getApplications)===L.Request},service(){return this.$store.state.headshots.service},credential(){return this.$store.state.headshots.credential},config(){return this.$store.state.headshots.config},initializing(){return this.$store.state.headshots.status.getApplications===L.Request},needApply(){return this.$store.state.headshots.status.getApplications===L.Success&&!this.application},application(){return this.$store.state.headshots.application},applications(){return this.$store.state.headshots.applications},tasks(){return this.$store.state.headshots.tasks}},watch:{tasks:{handler(e,s){var a,o;((a=e==null?void 0:e.items)==null?void 0:a.length)>((o=s==null?void 0:s.items)==null?void 0:o.length)&&console.debug("new tasks detected")},deep:!0}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onScrollDown(),await this.onGetTasks(),this.job=setInterval(()=>{this.onGetTasks()},5e3)},async unmounted(){clearInterval(this.job),clearInterval(this.timer)},methods:{async onReachTop(){var e,s,a;console.debug("reached top"),await this.onGetTasks({createdAtMax:(a=(s=(e=this.tasks)==null?void 0:e.items)==null?void 0:s[0])==null?void 0:a.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("headshots/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("headshots/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){ie.create({application:this.application}).then(({data:e})=>{this.application=e,T.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var s,a;((a=(s=e==null?void 0:e.response)==null?void 0:s.data)==null?void 0:a.code)===le&&T.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},500)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:s=5,createdAtMin:a,createdAtMax:o}=e||{};console.debug("limit",s,"createdAtMin",a,"createdAtMax",o),await this.$store.dispatch("headshots/getTasks",{limit:s,createdAtMin:a,createdAtMax:o})},async onGeneratePicture(){var a;const e={...this.config,callback_url:Ds},s=(a=this.credential)==null?void 0:a.token;if(!s){console.error("no token specified");return}T.info(this.$t("headshots.message.startingTask")),re.generate(e,{token:s}).then(()=>{T.success(this.$t("headshots.message.startTaskSuccess")),this.$store.commit("headshots/setConfig",{config:void 0})}).catch(o=>{var g,p;const _=(g=o==null?void 0:o.response)==null?void 0:g.data;((p=_==null?void 0:_.error)==null?void 0:p.code)===ce?T.error(this.$t("headshots.message.usedUp")):T.error(this.$t("headshots.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Ms(e,s,a,o,_,g){const p=r("config-panel"),h=r("application-status"),i=r("recent-panel"),m=r("layout");return n(),D(m,null,{config:u(()=>[t(p,{onGenerate:e.onGeneratePicture},null,8,["onGenerate"])]),result:u(()=>[t(h,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication,onSelect:s[0]||(s[0]=f=>e.$store.dispatch("headshots/setApplication",f))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),t(i,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"]),$(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var Ks=w(Ls,[["render",Ms],["__scopeId","data-v-62da1b28"],["__file","/home/runner/work/Nexior/Nexior/src/pages/headshots/Index.vue"]]);export{Ks as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./vendor-others.e28a6fa7.js";import{ar as F}from"./vendor-fortawesome.0d8f27df.js";import{_ as I,aS as ne,a0 as O,F as ae,ad as le,aT as re,W as ie}from"./index.af944887.js";import{Q as ce,u as L,N as ue,O as de,t as pe,m as _e,I as me,s as fe,H as he,V as ve,y as T}from"./vendor-element-plus.7eade167.js";import{H as V,al as r,o as n,e as p,f as l,I as M,V as s,M as f,T as a,U as E,ai as R,L as A,S as g,R as k,P as D}from"./vendor-@vue.8cef8b94.js";import{I as $e}from"./InfoIcon.172685bc.js";import{C as ge}from"./CopyToClipboard.ff135372.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const ke=V({name:"LayoutFlux",components:{ElDrawer:ce,ElButton:L,FontAwesomeIcon:F},data(){return{drawer:!1}}}),ye={class:"main"},we={class:"config"},be={class:"result"};function xe(e,t,o,i,h,v){const u=r("font-awesome-icon"),_=r("el-button"),d=r("el-drawer");return n(),p("div",ye,[l("div",we,[M(e.$slots,"config",{},void 0,!0)]),l("div",be,[M(e.$slots,"result",{},void 0,!0)]),s(_,{round:"",class:"menu",onClick:t[0]||(t[0]=$=>e.drawer=!0)},{default:f(()=>[s(u,{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:f(()=>[M(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Ie=I(ke,[["render",xe],["__scopeId","data-v-324e8ab0"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Flux.vue"]]);const Ve=V({name:"ModelSelector",components:{ElSelect:ue,ElOption:de},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:"flux",label:"flux"},{value:"flux-schnell",label:"flux-schnell"},{value:"flux-dev",label:"flux-dev"},{value:"flux-pro",label:"flux-pro"}]}},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.flux)==null?void 0:e.config)==null?void 0:t.model},set(e){this.$store.commit("flux/setConfig",{...this.$store.state.flux.config,model:e})}}},mounted(){this.value||(this.value=ne)}}),Se={class:"field"},Te={class:"title font-bold"};function Ce(e,t,o,i,h,v){const u=r("el-option"),_=r("el-select");return n(),p("div",Se,[l("h2",Te,a(e.$t("flux.name.model")),1),s(_,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value",placeholder:e.$t("flux.placeholder.select")},{default:f(()=>[(n(!0),p(E,null,R(e.options,d=>(n(),A(u,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var Ge=I(Ve,[["render",Ce],["__scopeId","data-v-8a0bbbfe"],["__file","/home/runner/work/Nexior/Nexior/src/components/flux/config/ModelSelector.vue"]]);const Ae="",Pe=V({name:"PromptInput",components:{ElInput:pe,InfoIcon:$e},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.flux)==null?void 0:e.config)==null?void 0:t.prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("flux/setConfig",{...(t=this.$store.state.flux)==null?void 0:t.config,prompt:e})}}},mounted(){this.value||(this.value=Ae)}}),Ne={class:"field"},Ee={class:"box"},Re={class:"title font-bold"};function De(e,t,o,i,h,v){const u=r("info-icon"),_=r("el-input");return n(),p("div",Ne,[l("div",Ee,[l("h2",Re,a(e.$t("flux.name.prompt")),1),s(u,{content:e.$t("flux.description.prompt"),class:"info"},null,8,["content"])]),s(_,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=d=>e.prompt=d),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("flux.placeholder.prompt"),maxlength:300,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var Oe=I(Pe,[["render",De],["__scopeId","data-v-76c331df"],["__file","/home/runner/work/Nexior/Nexior/src/components/flux/config/PromptInput.vue"]]);const Me=V({name:"PresetPanel",components:{ElButton:L,FontAwesomeIcon:F,PromptInput:Oe,ModelSelector:Ge},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.flux)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Fe={class:"panel"},Le={class:"config"},Ue={class:"actions"};function qe(e,t,o,i,h,v){var m,y;const u=r("prompt-input"),_=r("model-selector"),d=r("font-awesome-icon"),$=r("el-button");return n(),p("div",Fe,[l("div",Le,[s(u,{class:"mb-4"}),s(_,{class:"mb-4"}),l("div",Ue,[((m=e.config)==null?void 0:m.video_url)!==void 0||((y=e.config)==null?void 0:y.custom)?(n(),A($,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:f(()=>[s(d,{icon:"fa-solid fa-magic",class:"mr-2"}),g(" "+a(e.$t("flux.button.extend")),1)]),_:1},8,["onClick"])):(n(),A($,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:f(()=>[s(d,{icon:"fa-solid fa-magic",class:"mr-2"}),g(" "+a(e.$t("flux.button.generate")),1)]),_:1},8,["onClick"]))])])])}var je=I(Me,[["render",qe],["__scopeId","data-v-707be6ac"],["__file","/home/runner/work/Nexior/Nexior/src/components/flux/ConfigPanel.vue"]]);const Be=V({name:"ImageGallery",props:{modelValue:{type:Object,required:!0}},setup(e){return{viewImage:o=>{window.open(o,"_blank")}}}}),He={class:"image-gallery"},ze={class:"image-container"},Ke=["src"];function Qe(e,t,o,i,h,v){return n(),p("div",He,[l("div",ze,[l("img",{src:e.modelValue.image_url,alt:"Image"},null,8,Ke),l("button",{class:"view-button",onClick:t[0]||(t[0]=u=>e.viewImage(e.modelValue.image_url))},a(e.$t("flux.button.viewImage")),1)])])}var We=I(Be,[["render",Qe],["__scopeId","data-v-74374cc6"],["__file","/home/runner/work/Nexior/Nexior/src/components/flux/ImageGallery.vue"]]);const Xe=V({name:"TaskPreview",components:{ElImage:_e,CopyToClipboard:ge,FontAwesomeIcon:F,ElAlert:me,ElTooltip:fe,ElButton:L,ImageGallery:We},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.flux)==null?void 0:e.application},config(){var e;return(e=this.$store.state.flux)==null?void 0:e.config},images(){var o,i,h,v,u,_,d;let e=[];const t=(i=(o=this.modelValue)==null?void 0:o.request)==null?void 0:i.action;return Array.isArray((v=(h=this.modelValue)==null?void 0:h.response)==null?void 0:v.data)&&((d=(_=(u=this.modelValue)==null?void 0:u.response)==null?void 0:_.data)==null||d.forEach($=>{let m=$;t&&(m.action=t),e.push(m)})),e}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onOpenImage(e){window.open(e,"_blank")}}}),Je={class:"left"},Ye={class:"main"},Ze={class:"bot"},et={class:"datetime"},tt={class:"info"},st={key:0,class:"prompt mt-2"},ot={key:0},nt={key:1},at={key:0,class:D({content:!0,failed:!0})},lt={class:"image-wrapper"},rt={key:0,class:D({operations:!0,"mt-2":!0})},it={class:"description"},ct={key:1,class:D({content:!0})},ut={class:"description"},dt={class:"description"},pt={class:"description"},_t={key:2,class:D({content:!0})},mt={class:"description"};function ft(e,t,o,i,h,v){const u=r("el-image"),_=r("image-gallery"),d=r("el-button"),$=r("el-tooltip"),m=r("font-awesome-icon"),y=r("copy-to-clipboard"),S=r("el-alert");return n(!0),p(E,null,R(e.images,(c,P)=>{var C,G,b,N,U,q,j,B,H,z,K;return n(),p("div",{key:P,class:"preview"},[l("div",Je,[s(u,{src:"https://cdn.acedata.cloud/ogm2oa.png",class:"avatar"})]),l("div",Ye,[l("div",Ze,[g(a(e.$t("flux.name.fluxBot"))+" ",1),l("span",et,a(e.$dayjs.format(""+new Date(parseFloat(((C=e.modelValue)==null?void 0:C.created_at)||"")*1e3))),1)]),l("div",tt,[(b=(G=e.modelValue)==null?void 0:G.request)!=null&&b.prompt?(n(),p("p",st,[g(a((U=(N=e.modelValue)==null?void 0:N.request)==null?void 0:U.prompt)+" ",1),(q=e.modelValue)!=null&&q.response?k("v-if",!0):(n(),p("span",ot," - ("+a(e.$t("flux.status.pending"))+") ",1)),(c==null?void 0:c.state)==="processing"||(c==null?void 0:c.state)==="pending"||(c==null?void 0:c.state)==="completed"?(n(),p("span",nt," - ("+a(e.$t("flux.status.processing"))+") ",1)):k("v-if",!0)])):k("v-if",!0)]),k(" Display success message "),((B=(j=e.modelValue)==null?void 0:j.response)==null?void 0:B.success)===!0?(n(),p("div",at,[l("div",lt,[s(_,{"model-value":c},null,8,["model-value"])]),c?(n(),p("div",rt,[s($,{class:"box-item",effect:"dark",content:e.$t("flux.message.downloadImage"),placement:"top-start"},{default:f(()=>[s(d,{type:"info",size:"small",class:"btn-action",onClick:w=>e.onDownload(w,c==null?void 0:c.image_url)},{default:f(()=>[g(a(e.$t("flux.button.download")),1)]),_:2},1032,["onClick"])]),_:2},1032,["content"])])):k("v-if",!0),s(S,{closable:!1,class:"mt-2 success"},{default:f(()=>{var w,x;return[l("p",it,[s(m,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("flux.name.taskId"))+": "+a((w=e.modelValue)==null?void 0:w.id)+" ",1),s(y,{content:(x=e.modelValue)==null?void 0:x.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):k("v-if",!0),k(" Display error message "),((z=(H=e.modelValue)==null?void 0:H.response)==null?void 0:z.success)===!1?(n(),p("div",ct,[s(S,{closable:!1,class:"failure"},{template:f(()=>[s(m,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+a(e.$t("flux.name.failure")),1)]),default:f(()=>{var w,x,Q,W,X,J,Y,Z,ee,te,se,oe;return[l("p",ut,[s(m,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("flux.name.taskId"))+": "+a((w=e.modelValue)==null?void 0:w.id)+" ",1),s(y,{content:(x=e.modelValue)==null?void 0:x.id,class:"btn-copy"},null,8,["content"])]),l("p",dt,[s(m,{icon:"fa-solid fa-circle-info",class:"mr-1"}),g(" "+a(e.$t("flux.name.failureReason"))+": "+a((X=(W=(Q=e.modelValue)==null?void 0:Q.response)==null?void 0:W.error)==null?void 0:X.message)+" ",1),s(y,{content:(Z=(Y=(J=e.modelValue)==null?void 0:J.response)==null?void 0:Y.error)==null?void 0:Z.message,class:"btn-copy"},null,8,["content"])]),l("p",pt,[s(m,{icon:"fa-solid fa-hashtag",class:"mr-1"}),g(" "+a(e.$t("flux.name.traceId"))+": "+a((te=(ee=e.modelValue)==null?void 0:ee.response)==null?void 0:te.trace_id)+" ",1),s(y,{content:(oe=(se=e.modelValue)==null?void 0:se.response)==null?void 0:oe.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):k("v-if",!0),k(" Display error message "),!((K=e.modelValue)!=null&&K.response)||(c==null?void 0:c.state)==="processing"||(c==null?void 0:c.state)==="pending"?(n(),p("div",_t,[s(S,{closable:!1,class:"info"},{template:f(()=>[s(m,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+a(e.$t("flux.name.failure")),1)]),default:f(()=>{var w,x;return[l("p",mt,[s(m,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("flux.name.taskId"))+": "+a((w=e.modelValue)==null?void 0:w.id)+" ",1),s(y,{content:(x=e.modelValue)==null?void 0:x.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):k("v-if",!0)])])}),128)}var ht=I(Xe,[["render",ft],["__scopeId","data-v-bb276cb8"],["__file","/home/runner/work/Nexior/Nexior/src/components/flux/task/Preview.vue"]]);const vt=V({name:"RecentPanel",components:{TaskPreview:ht,ElSkeleton:he,ElSkeletonItem:ve},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,t,o,i;return{...(e=this.$store.state.flux)==null?void 0:e.tasks,items:(i=(o=(t=this.$store.state.flux)==null?void 0:t.tasks)==null?void 0:o.items)==null?void 0:i.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),$t={key:0,class:"tasks"},gt={class:"left"},kt={class:"main"},yt={key:1,class:"tasks"},wt={key:2,class:"description"};function bt(e,t,o,i,h,v){var $,m,y,S,c,P,C,G;const u=r("el-skeleton-item"),_=r("el-skeleton"),d=r("task-preview");return n(),p("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...b)=>e.onHandleScroll&&e.onHandleScroll(...b))},[(($=e.tasks)==null?void 0:$.items)===void 0?(n(),p("div",$t,[(n(),p(E,null,R(3,b=>l("div",{key:b,class:"task placeholder"},[l("div",gt,[s(_,{animated:""},{template:f(()=>[s(u,{variant:"image",class:"avatar"})]),_:1})]),l("div",kt,[s(_,{animated:""},{template:f(()=>[s(u,{variant:"p",class:"title"}),s(u,{variant:"image",class:"icon"})]),_:1})])])),64))])):((y=(m=e.tasks)==null?void 0:m.items)==null?void 0:y.length)&&((c=(S=e.tasks)==null?void 0:S.items)==null?void 0:c.length)>0?(n(),p("div",yt,[(n(!0),p(E,null,R((P=e.tasks)==null?void 0:P.items,(b,N)=>(n(),A(d,{key:N,"model-value":b,class:"preview"},null,8,["model-value"]))),128))])):k("v-if",!0),((G=(C=e.tasks)==null?void 0:C.items)==null?void 0:G.length)===0?(n(),p("p",wt,a(e.$t("flux.message.noTasks")),1)):k("v-if",!0)],544)}var xt=I(vt,[["render",bt],["__scopeId","data-v-2ae6e09a"],["__file","/home/runner/work/Nexior/Nexior/src/components/flux/RecentPanel.vue"]]);const It="https://webhook.acedata.cloud/flux",Vt=V({name:"FluxIndex",components:{ConfigPanel:je,Layout:Ie,RecentPanel:xt},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,t;return((t=(e=this.$store.state.flux)==null?void 0:e.status)==null?void 0:t.getApplications)===O.Request},service(){var e;return(e=this.$store.state.flux)==null?void 0:e.service},credential(){var e;return(e=this.$store.state.flux)==null?void 0:e.credential},config(){var e;return(e=this.$store.state.flux)==null?void 0:e.config},initializing(){var e,t;return((t=(e=this.$store.state.flux)==null?void 0:e.status)==null?void 0:t.getApplications)===O.Request},needApply(){var e,t;return((t=(e=this.$store.state.flux)==null?void 0:e.status)==null?void 0:t.getApplications)===O.Success&&!this.application},application(){var e;return(e=this.$store.state.flux)==null?void 0:e.application},applications(){var e;return(e=this.$store.state.flux)==null?void 0:e.applications},tasks(){var e;return(e=this.$store.state.flux)==null?void 0:e.tasks}},watch:{tasks:{handler(e,t){var o,i;((o=e==null?void 0:e.items)==null?void 0:o.length)>((i=t==null?void 0:t.items)==null?void 0:i.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("flux/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("flux/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){ae.create({application:this.application}).then(({data:e})=>{this.application=e,T.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)===le&&T.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},500)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:o,createdAtMax:i}=e||{};console.debug("limit",t,"createdAtMin",o,"createdAtMax",i),await this.$store.dispatch("flux/getTasks",{limit:t,createdAtMin:o,createdAtMax:i})},async onGenerate(){var o;const e={...this.config,callback_url:It},t=(o=this.credential)==null?void 0:o.token;if(!t){console.error("no token specified");return}T.info(this.$t("flux.message.startingTask")),re.generate(e,{token:t}).then(()=>{T.success(this.$t("flux.message.startTaskSuccess")),this.$store.commit("flux/setConfig",{config:void 0})}).catch(i=>{var v,u;const h=(v=i==null?void 0:i.response)==null?void 0:v.data;((u=h==null?void 0:h.error)==null?void 0:u.code)===ie?T.error(this.$t("flux.message.usedUp")):T.error(this.$t("flux.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function St(e,t,o,i,h,v){const u=r("config-panel"),_=r("recent-panel"),d=r("layout");return n(),A(d,null,{config:f(()=>[s(u,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:f(()=>[s(_,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"])]),_:1})}var Ot=I(Vt,[["render",St],["__scopeId","data-v-e3c77ee0"],["__file","/home/runner/work/Nexior/Nexior/src/pages/flux/Index.vue"]]);export{Ot as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./vendor-others.e28a6fa7.js";import{E as j,a as O,b as Q}from"./EditArray.fe3be781.js";import{_ as W,d as H}from"./index.af944887.js";import{l as K,A as M,m as z,B as G,F as J,n as P,p as X,o as Y}from"./vendor-element-plus.7eade167.js";import{H as Z,al as p,L as x,M as s,o as E,V as i,f as l,T as o,S as v,e as R,ai as ee,O as U,W as V,R as te,U as ie}from"./vendor-@vue.8cef8b94.js";import"./vendor-fortawesome.0d8f27df.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const se=Z({name:"SiteIndex",components:{EditText:j,EditImage:O,EditArray:Q,ElDivider:K,ElRow:M,ElImage:z,ElCol:G,ElCard:J,ElForm:P,ElSwitch:X,ElFormItem:Y},data(){return{editing:{title:!1}}},computed:{site(){return this.$store.getters.site}},methods:{onSave(e){var C;const a={...this.site,...e};H.update((C=this.site)==null?void 0:C.id,a).then(()=>{var I;console.debug("getSite for id",(I=this.site)==null?void 0:I.id),this.$store.dispatch("getSite")})}}}),le={class:"title"},oe={class:"title"},ae={class:"block w-full"},de={class:"block tip"},ne={class:"block w-full"},re={class:"block tip"},ue={class:"block w-full"},me={class:"block tip"},pe={class:"block w-full"},fe={class:"block tip"},be={class:"block w-full"},ve={class:"block tip"},he={class:"title"},ce={class:"block w-full"},$e={class:"block tip"},ge={class:"block w-full"},we={class:"block tip"},ke={class:"title"},Ce={class:"block tip"},Ie={class:"block tip"},ye={class:"title"},Se={class:"w-full"},Te={class:"block tip w-full"},_e={key:0},De={class:"block w-full"},Ee={class:"block w-full"};function Ue(e,a,C,I,Ve,Fe){const g=p("el-col"),y=p("el-row"),h=p("el-divider"),d=p("el-form-item"),c=p("edit-text"),S=p("el-image"),T=p("edit-image"),F=p("edit-array"),w=p("el-form"),k=p("el-card"),_=p("el-switch");return E(),x(y,{class:"panel"},{default:s(()=>[i(g,{span:24},{default:s(()=>[i(y,null,{default:s(()=>[i(g,{span:24},{default:s(()=>[l("h2",le,o(e.$t("common.title.site")),1)]),_:1})]),_:1}),i(y,{gutter:15},{default:s(()=>[i(g,{md:12,xs:24},{default:s(()=>[i(k,{shadow:"hover",class:"mb-4"},{default:s(()=>[l("h4",oe,o(e.$t("site.title.basicConfig")),1),i(h),i(w,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:s(()=>[i(d,{label:e.$t("site.field.origin")},{default:s(()=>[l("span",ae,o(e.site.origin),1),l("span",de,o(e.$t("site.message.originTip")),1)]),_:1},8,["label"]),i(d,{label:e.$t("site.field.title")},{default:s(()=>[l("span",ne,[v(o(e.site.title)+" ",1),i(c,{"model-value":e.site.title,title:e.$t("site.title.editTitle"),placeholder:e.$t("site.placeholder.title"),onConfirm:a[0]||(a[0]=t=>e.onSave({title:t}))},null,8,["model-value","title","placeholder"])]),l("span",re,o(e.$t("site.message.titleTip")),1)]),_:1},8,["label"]),i(d,{label:e.$t("site.field.logo")},{default:s(()=>[l("span",ue,[i(S,{src:e.site.logo,class:"logo"},null,8,["src"]),i(T,{"model-value":e.site.logo,title:e.$t("site.title.editLogo"),tip:e.$t("site.message.editLogoTip"),onConfirm:a[1]||(a[1]=t=>e.onSave({logo:t}))},null,8,["model-value","title","tip"])]),l("span",me,o(e.$t("site.message.logoTip")),1)]),_:1},8,["label"]),i(d,{label:e.$t("site.field.favicon")},{default:s(()=>[l("span",pe,[i(S,{src:e.site.favicon,class:"favicon"},null,8,["src"]),i(T,{"model-value":e.site.favicon,title:e.$t("site.title.editFavicon"),tip:e.$t("site.message.editFaviconTip"),onConfirm:a[2]||(a[2]=t=>e.onSave({favicon:t}))},null,8,["model-value","title","tip"])]),l("span",fe,o(e.$t("site.message.faviconTip")),1)]),_:1},8,["label"]),i(h,{"border-style":"dashed"}),i(d,{label:e.$t("site.field.admins")},{default:s(()=>{var t,n;return[l("span",be,[v(o((t=e.site.admins)==null?void 0:t.join(", "))+" ",1),i(F,{"model-value":((n=e.site)==null?void 0:n.admins)||[],title:e.$t("site.title.editAdmins"),placeholder:e.$t("site.placeholder.admins"),tip:e.$t("site.message.adminsTip2"),min:1,"min-error-message":e.$t("site.message.atLeastOneAdmin"),onConfirm:a[3]||(a[3]=f=>e.onSave({admins:f}))},null,8,["model-value","title","placeholder","tip","min-error-message"])]),l("span",ve,o(e.$t("site.message.adminsTip")),1)]}),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),i(k,{shadow:"hover"},{default:s(()=>[l("h4",he,o(e.$t("site.title.seoConfig")),1),i(h),i(w,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:s(()=>[i(d,{label:e.$t("site.field.description")},{default:s(()=>[l("span",ce,[v(o(e.site.description)+" ",1),i(c,{"model-value":e.site.description,title:e.$t("site.title.editDescription"),placeholder:e.$t("site.placeholder.description"),onConfirm:a[4]||(a[4]=t=>e.onSave({description:t}))},null,8,["model-value","title","placeholder"])]),l("span",$e,o(e.$t("site.message.descriptionTip")),1)]),_:1},8,["label"]),i(d,{label:e.$t("site.field.keywords")},{default:s(()=>{var t,n;return[l("span",ge,[v(o((t=e.site.keywords)==null?void 0:t.join(", "))+" ",1),i(F,{"model-value":((n=e.site)==null?void 0:n.keywords)||[],title:e.$t("site.title.editKeywords"),placeholder:e.$t("site.placeholder.keywords"),tip:e.$t("site.message.keywordsTip2"),onConfirm:a[5]||(a[5]=f=>e.onSave({keywords:f}))},null,8,["model-value","title","placeholder","tip"])]),l("span",we,o(e.$t("site.message.keywordsTip")),1)]}),_:1},8,["label"])]),_:1},8,["model"])]),_:1})]),_:1}),i(g,{md:12,xs:24},{default:s(()=>[i(k,{shadow:"hover",class:"mb-4"},{default:s(()=>[l("h4",ke,o(e.$t("site.title.distributionConfig")),1),i(h),i(w,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:s(()=>[i(d,{label:e.$t("site.field.distributionDefaultInviterId")},{default:s(()=>{var t,n;return[v(o((t=e.site.distribution)==null?void 0:t.default_inviter_id)+" ",1),i(c,{"model-value":(n=e.site.distribution)==null?void 0:n.default_inviter_id,title:e.$t("site.title.editDistributionDefaultInviterId"),placeholder:e.$t("site.placeholder.editDistributionDefaultInviterId"),onConfirm:a[6]||(a[6]=f=>e.onSave({distribution:{...e.site.distribution,default_inviter_id:f}}))},null,8,["model-value","title","placeholder"]),l("span",Ce,o(e.$t("site.message.distributionDefaultInviterIdTip")),1)]}),_:1},8,["label"]),i(d,{label:e.$t("site.field.distributionForceInviterId")},{default:s(()=>{var t,n;return[v(o((t=e.site.distribution)==null?void 0:t.force_inviter_id)+" ",1),i(c,{"model-value":(n=e.site.distribution)==null?void 0:n.force_inviter_id,title:e.$t("site.title.editDistributionForceInviterId"),placeholder:e.$t("site.placeholder.editDistributionForceInviterId"),onConfirm:a[7]||(a[7]=f=>e.onSave({distribution:{...e.site.distribution,force_inviter_id:f}}))},null,8,["model-value","title","placeholder"]),l("span",Ie,o(e.$t("site.message.distributionForceInviterIdTip")),1)]}),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),i(k,{shadow:"hover"},{default:s(()=>[l("h4",ye,o(e.$t("site.title.featuresConfig")),1),i(h),i(w,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:s(()=>[(E(),R(ie,null,ee(["chat","midjourney","qrart","suno","luma","pika","kling","flux","hailuo","headshots","support"],(t,n)=>i(d,{key:n,label:e.$t("site.field.features"+t.charAt(0).toUpperCase()+t.slice(1))},{default:s(()=>{var f,A,N,q,B,L;return[l("div",Se,[i(_,{"model-value":((f=e.site.features[t])==null?void 0:f.enabled)||!1,"inline-prompt":"","active-text":e.$t("site.button.enabled"),"inactive-text":e.$t("site.button.disabled"),"onUpdate:modelValue":r=>e.onSave({features:{...e.site.features,[t]:{...e.site.features[t],enabled:r}}})},null,8,["model-value","active-text","inactive-text","onUpdate:modelValue"])]),l("span",Te,o(e.$t("site.message.features"+t.charAt(0).toUpperCase()+t.slice(1))),1),t==="support"?U((E(),R("div",_e,[i(d,{label:"WeChat"},{default:s(()=>{var r,u;return[i(_,{"model-value":((u=(r=e.site.features[t])==null?void 0:r.wechat)==null?void 0:u.enabled)||!1,"inline-prompt":"","active-text":e.$t("site.button.enabled"),"inactive-text":e.$t("site.button.disabled"),"onUpdate:modelValue":b=>{var m;return e.onSave({features:{...e.site.features,[t]:{...e.site.features[t],wechat:{...(m=e.site.features[t])==null?void 0:m.wechat,enabled:b}}}})}},null,8,["model-value","active-text","inactive-text","onUpdate:modelValue"])]}),_:2},1024),U(i(d,{label:e.$t("site.field.qr")},{default:s(()=>{var r,u,b,m;return[l("span",De,[i(S,{src:(u=(r=e.site.features[t])==null?void 0:r.wechat)==null?void 0:u.qr},null,8,["src"]),i(T,{"model-value":(m=(b=e.site.features[t])==null?void 0:b.wechat)==null?void 0:m.qr,title:e.$t("site.title.editQR"),tip:e.$t("site.message.editQRTip"),onConfirm:D=>{var $;return e.onSave({features:{...e.site.features,[t]:{...e.site.features[t],wechat:{...($=e.site.features[t])==null?void 0:$.wechat,qr:D}}}})}},null,8,["model-value","title","tip","onConfirm"])])]}),_:2},1032,["label"]),[[V,(N=(A=e.site.features[t])==null?void 0:A.wechat)==null?void 0:N.enabled]]),i(d,{label:"Discord"},{default:s(()=>{var r,u;return[i(_,{"model-value":((u=(r=e.site.features[t])==null?void 0:r.discord)==null?void 0:u.enabled)||!1,"inline-prompt":"","active-text":e.$t("site.button.enabled"),"inactive-text":e.$t("site.button.disabled"),"onUpdate:modelValue":b=>{var m;return e.onSave({features:{...e.site.features,[t]:{...e.site.features[t],discord:{...(m=e.site.features[t])==null?void 0:m.discord,enabled:b}}}})}},null,8,["model-value","active-text","inactive-text","onUpdate:modelValue"])]}),_:2},1024),U(i(d,{label:e.$t("site.field.url")},{default:s(()=>{var r,u,b,m;return[l("span",Ee,[v(o((u=(r=e.site.features[t])==null?void 0:r.discord)==null?void 0:u.url)+" ",1),i(c,{"model-value":(m=(b=e.site.features[t])==null?void 0:b.discord)==null?void 0:m.url,title:e.$t("site.title.editUrl"),placeholder:e.$t("site.placeholder.editUrl"),onConfirm:D=>{var $;return e.onSave({features:{...e.site.features,[t]:{...e.site.features[t],discord:{...($=e.site.features[t])==null?void 0:$.discord,url:D}}}})}},null,8,["model-value","title","placeholder","onConfirm"])])]}),_:2},1032,["label"]),[[V,(B=(q=e.site.features[t])==null?void 0:q.discord)==null?void 0:B.enabled]])],512)),[[V,(L=e.site.features[t])==null?void 0:L.enabled]]):te("v-if",!0)]}),_:2},1032,["label"])),64))]),_:1},8,["model"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var Qe=W(se,[["render",Ue],["__scopeId","data-v-262b806e"],["__file","/home/runner/work/Nexior/Nexior/src/pages/site/Index.vue"]]);export{Qe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ae as Ve}from"./vendor-others.e28a6fa7.js";import{ar as z}from"./vendor-fortawesome.0d8f27df.js";import{_ as y,aM as Se,aN as Ee,aO as Ne,aP as Pe,A as ye,aQ as Re,a0 as H,F as Ce,ad as Te,aR as Le,W as Ue}from"./index.af944887.js";import{Q as Ae,u as B,N as W,O as J,x as be,y as E,R as De,S as Ge,t as we,m as Oe,I as Me,s as je,H as Fe,V as qe}from"./vendor-element-plus.7eade167.js";import{H as b,al as n,o as l,e as p,f as a,I as Q,V as o,M as _,T as c,U,ai as A,L,P as D,a0 as ze,S as k,R as $}from"./vendor-@vue.8cef8b94.js";import{I as K}from"./InfoIcon.172685bc.js";import{I as Ie}from"./ImagePreview.ed465056.js";import{C as Be}from"./CopyToClipboard.ff135372.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const Ke=b({name:"LayoutKling",components:{ElDrawer:Ae,ElButton:B,FontAwesomeIcon:z},data(){return{drawer:!1}}}),He={class:"main"},Qe={class:"config"},We={class:"result"};function Je(e,t,s,d,g,f){const i=n("font-awesome-icon"),u=n("el-button"),r=n("el-drawer");return l(),p("div",He,[a("div",Qe,[Q(e.$slots,"config",{},void 0,!0)]),a("div",We,[Q(e.$slots,"result",{},void 0,!0)]),o(u,{round:"",class:"menu",onClick:t[0]||(t[0]=v=>e.drawer=!0)},{default:_(()=>[o(i,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),o(r,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=v=>e.drawer=v),"with-header":!1,size:"340px",class:"drawer"},{default:_(()=>[Q(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Xe=y(Ke,[["render",Je],["__scopeId","data-v-50bc0f32"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Kling.vue"]]);const Ye=b({name:"ModelSelector",components:{ElSelect:W,ElOption:J},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:"kling-v1",label:"V1"},{value:"kling-v1-5",label:"V1.5"},{value:"kling-v1-6",label:"V1.6"}]}},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.kling)==null?void 0:e.config)==null?void 0:t.model},set(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,model:e})}}},mounted(){this.value||(this.value=Se)}}),Ze={class:"field"},xe={class:"title font-bold"};function et(e,t,s,d,g,f){const i=n("el-option"),u=n("el-select");return l(),p("div",Ze,[a("h2",xe,c(e.$t("pika.name.model")),1),o(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),class:"value",placeholder:e.$t("pika.placeholder.select")},{default:_(()=>[(l(!0),p(U,null,A(e.options,r=>(l(),L(i,{key:r.value,label:r.label,value:r.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var tt=y(Ye,[["render",et],["__scopeId","data-v-13cacdf9"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/ModelSelector.vue"]]);const ot=b({name:"ModeSelector",components:{ElSelect:W,ElOption:J},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:"std",label:"\u6807\u51C6"},{value:"pro",label:"\u9AD8\u901F"}]}},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.kling)==null?void 0:e.config)==null?void 0:t.mode},set(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,mode:e})}}},mounted(){this.value||(this.value=Ee)}}),st={class:"field"},nt={class:"title font-bold"};function at(e,t,s,d,g,f){const i=n("el-option"),u=n("el-select");return l(),p("div",st,[a("h2",nt,c(e.$t("kling.name.mode")),1),o(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:_(()=>[(l(!0),p(U,null,A(e.options,r=>(l(),L(i,{key:r.value,label:r.label,value:r.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var lt=y(ot,[["render",at],["__scopeId","data-v-3af5203e"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/ModeSelector.vue"]]);const it=b({name:"DurationSelector",components:{ElSelect:W,ElOption:J},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:5,label:"5\u79D2"},{value:10,label:"10\u79D2"}]}},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.kling)==null?void 0:e.config)==null?void 0:t.duration},set(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}},mounted(){this.value||(this.value=Ne)}}),rt={class:"field"},ct={class:"title font-bold"};function dt(e,t,s,d,g,f){const i=n("el-option"),u=n("el-select");return l(),p("div",rt,[a("h2",ct,c(e.$t("kling.name.duration")),1),o(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:_(()=>[(l(!0),p(U,null,A(e.options,r=>(l(),L(i,{key:r.value,label:r.label,value:r.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var pt=y(it,[["render",dt],["__scopeId","data-v-6434f6d2"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/DurationSelector.vue"]]);const ut=b({name:"RatioSelector",data(){return{options:[{value:"1:1",label:"1:1",width:20,height:20},{value:"16:9",label:"16:9",width:25,height:13},{value:"9:16",label:"9:16",width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){var e,t,s;return(s=(t=(e=this.$store.state)==null?void 0:e.kling)==null?void 0:t.config)==null?void 0:s.aspect_ratio},set(e){var t,s;console.debug("set ratio",e),this.$store.commit("kling/setConfig",{...(s=(t=this.$store.state)==null?void 0:t.kling)==null?void 0:s.config,aspect_ratio:e})}}},mounted(){this.value||(this.value=Pe)}}),mt={class:"text-sm font-bold mb-2 block"},_t={class:"items"},gt=["onClick"],ft={class:"name"};function vt(e,t,s,d,g,f){return l(),p("div",null,[a("span",mt,c(e.$t("kling.name.ratio")),1),a("div",_t,[(l(!0),p(U,null,A(e.options,(i,u)=>(l(),p("div",{key:u,class:D({active:e.active===u,item:!0}),onClick:r=>e.value=i.value},[a("div",{class:D(["preview",i.label])},[a("div",{class:"rect",style:ze({width:i.width+"px",height:i.height+"px"})},null,4)],2),a("p",ft,c(i.label),1)],10,gt))),128))])])}var ht=y(ut,[["render",vt],["__scopeId","data-v-41d8dfdb"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/RatioSelector.vue"]]);const $t=b({name:"StartImage",components:{ElUpload:be,ElButton:B,InfoIcon:K,FontAwesomeIcon:z,ImagePreview:Ie},emits:["change"],data(){return{fileList:[],uploadUrl:ye()+"/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,s;return(s=(t=(e=this.$store.state)==null?void 0:e.kling)==null?void 0:t.config)==null?void 0:s.start_image_url},set(e){}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){E.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){E.error(this.$t("kling.message.uploadReferencesError"))},onSetStartImageUrl(){var t,s,d;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("kling/setConfig",{...(d=(s=this.$store.state)==null?void 0:s.kling)==null?void 0:d.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),kt={class:"relative"},yt={class:"flex justify-between"},bt={class:"flex justify-start items-center"},wt={class:"text-sm font-bold"};function It(e,t,s,d,g,f){const i=n("info-icon"),u=n("image-preview"),r=n("font-awesome-icon"),v=n("el-button"),h=n("el-upload");return l(),p("div",kt,[a("div",yt,[a("div",bt,[a("span",wt,c(e.$t("kling.name.startImage")),1),o(i,{content:e.$t("kling.description.uploadStartImage")},null,8,["content"])])]),o(h,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=m=>e.fileList=m),name:"file",limit:5,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:_(({file:m})=>{var w;return[o(u,{url:m.url||((w=m.response)==null?void 0:w.file_url),name:m.name,percentage:m.percentage,onRemove:N=>e.fileList.splice(e.fileList.indexOf(m),1)},null,8,["url","name","percentage","onRemove"])]}),default:_(()=>[o(v,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:_(()=>[o(r,{icon:"fa-solid fa-upload",class:"icon mr-1"}),k(" "+c(e.$t("kling.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}var Vt=y($t,[["render",It],["__scopeId","data-v-6e6084d0"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/StartImage.vue"]]);const St=b({name:"EndImage",components:{ElUpload:be,ElButton:B,ImagePreview:Ie,InfoIcon:K,FontAwesomeIcon:z},data(){return{fileList:[],uploadUrl:ye()+"/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,s;return(s=(t=(e=this.$store.state)==null?void 0:e.kling)==null?void 0:t.config)==null?void 0:s.start_image_url},set(e){}}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onExceed(){E.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){E.error(this.$t("kling.message.uploadReferencesError"))},onSetEndImageUrl(){var t,s;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("kling/setConfig",{...(s=this.$store.state.kling)==null?void 0:s.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Et={class:"relative"},Nt={class:"flex justify-between"},Pt={class:"flex justify-start items-center"},Rt={class:"text-sm font-bold"};function Ct(e,t,s,d,g,f){const i=n("info-icon"),u=n("image-preview"),r=n("font-awesome-icon"),v=n("el-button"),h=n("el-upload");return l(),p("div",Et,[a("div",Nt,[a("div",Pt,[a("span",Rt,c(e.$t("kling.name.endImage")),1),o(i,{content:e.$t("kling.description.uploadEndImage")},null,8,["content"])])]),o(h,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=m=>e.fileList=m),name:"file",limit:5,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:_(({file:m})=>{var w;return[o(u,{url:m.url||((w=m.response)==null?void 0:w.file_url),name:m.name,percentage:m.percentage,onRemove:N=>e.fileList.splice(e.fileList.indexOf(m),1)},null,8,["url","name","percentage","onRemove"])]}),default:_(()=>[o(v,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:_(()=>[o(r,{icon:"fa-solid fa-upload",class:"icon mr-1"}),k(" "+c(e.$t("kling.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}var Tt=y(St,[["render",Ct],["__scopeId","data-v-72a21eff"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/EndImage.vue"]]);const Lt=b({name:"CfgScaleSelector",components:{ElSlider:De,InfoIcon:K,ElInputNumber:Ge},computed:{value:{get(){var e,t,s;return(s=(t=(e=this.$store.state)==null?void 0:e.kling)==null?void 0:t.config)==null?void 0:s.cfg_scale},set(e){var t,s;console.debug("set cfg_scale",e),this.$store.commit("kling/setConfig",{...(s=(t=this.$store.state)==null?void 0:t.kling)==null?void 0:s.config,cfg_scale:e})}}},mounted(){this.value||(this.value=Re)}}),Ut={class:"flex justify-between"},At={class:"flex justify-start items-center"},Dt={class:"text-sm font-bold"},Gt={class:"flex justify-end items-center"},Ot={class:"w-full"};function Mt(e,t,s,d,g,f){const i=n("info-icon"),u=n("el-input-number"),r=n("el-slider");return l(),p("div",null,[a("div",Ut,[a("div",At,[a("span",Dt,c(e.$t("kling.name.cfgScale")),1),o(i,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),a("div",Gt,[o(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=v=>e.value=v),"controls-position":"right"},null,8,["modelValue"])])]),a("div",Ot,[o(r,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=v=>e.value=v),min:0,max:1,step:.1},null,8,["modelValue"])])])}var jt=y(Lt,[["render",Mt],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/CfgScaleSelector.vue"]]);const Ft="",qt=b({name:"PromptInput",components:{ElInput:we,InfoIcon:K},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.kling)==null?void 0:e.config)==null?void 0:t.prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("kling/setConfig",{...(t=this.$store.state.kling)==null?void 0:t.config,prompt:e})}}},mounted(){this.value||(this.value=Ft)}}),zt={class:"field"},Bt={class:"box"},Kt={class:"title font-bold"};function Ht(e,t,s,d,g,f){const i=n("info-icon"),u=n("el-input");return l(),p("div",zt,[a("div",Bt,[a("h2",Kt,c(e.$t("kling.name.prompt")),1),o(i,{content:e.$t("kling.description.prompt"),class:"info"},null,8,["content"])]),o(u,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.prompt"),maxlength:500,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var Qt=y(qt,[["render",Ht],["__scopeId","data-v-fd830852"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/PromptInput.vue"]]);const Wt="",Jt=b({name:"NegativePromptInput",components:{ElInput:we,InfoIcon:K},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.kling)==null?void 0:e.config)==null?void 0:t.negative_prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("kling/setConfig",{...(t=this.$store.state.kling)==null?void 0:t.config,negative_prompt:e})}}},mounted(){this.value||(this.value=Wt)}}),Xt={class:"field"},Yt={class:"box"},Zt={class:"title font-bold"};function xt(e,t,s,d,g,f){const i=n("info-icon"),u=n("el-input");return l(),p("div",Xt,[a("div",Yt,[a("h2",Zt,c(e.$t("kling.name.negativePrompt")),1),o(i,{content:e.$t("kling.description.negativePrompt"),class:"info"},null,8,["content"])]),o(u,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.negativePrompt"),maxlength:200,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var eo=y(Jt,[["render",xt],["__scopeId","data-v-6c3d0de2"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/NegativePromptInput.vue"]]);const to=b({name:"PresetPanel",components:{ElButton:B,FontAwesomeIcon:z,PromptInput:Qt,NegativePromptInput:eo,ModelSelector:tt,ModeSelector:lt,DurationSelector:pt,RatioSelector:ht,StartImage:Vt,CfgScaleSelector:jt,EndImage:Tt},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.kling)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),oo={class:"panel"},so={class:"config"},no={class:"actions"};function ao(e,t,s,d,g,f){var I,T;const i=n("prompt-input"),u=n("model-selector"),r=n("mode-selector"),v=n("ratio-selector"),h=n("start-image"),m=n("end-image"),w=n("cfg-scale-selector"),N=n("duration-selector"),C=n("negative-prompt-input"),P=n("font-awesome-icon"),R=n("el-button");return l(),p("div",oo,[a("div",so,[o(i,{class:"mb-4"}),o(u,{class:"mb-4"}),o(r,{class:"mb-4"}),o(v,{class:"mb-4"}),o(h,{class:"mb-2"}),o(m,{class:"mb-2"}),o(w,{class:"mb-4"}),o(N,{class:"mb-4"}),o(C,{class:"mb-4"}),a("div",no,[((I=e.config)==null?void 0:I.video_url)!==void 0||((T=e.config)==null?void 0:T.custom)?(l(),L(R,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:_(()=>[o(P,{icon:"fa-solid fa-magic",class:"mr-2"}),k(" "+c(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(l(),L(R,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:_(()=>[o(P,{icon:"fa-solid fa-magic",class:"mr-2"}),k(" "+c(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))])])])}var lo=y(to,[["render",ao],["__scopeId","data-v-301363b4"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/ConfigPanel.vue"]]);const io=b({name:"VideoPlayer",components:{VuePlyr:Ve},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),ro={controls:"",crossorigin:"",playsinline:""},co=["src"];function po(e,t,s,d,g,f){const i=n("vue-plyr");return l(),p("div",null,[o(i,{options:e.options,class:"video"},{default:_(()=>{var u;return[a("video",ro,[a("source",{size:"1080",src:(u=e.modelValue)==null?void 0:u.video_url,type:"video/mp4"},null,8,co)])]}),_:1},8,["options"])])}var uo=y(io,[["render",po],["__scopeId","data-v-3fd1ea0e"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/VideoPlayer.vue"]]);const mo=b({name:"TaskPreview",components:{ElImage:Oe,CopyToClipboard:Be,FontAwesomeIcon:z,ElAlert:Me,VideoPlayer:uo,ElTooltip:je,ElButton:B},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.kling)==null?void 0:e.application},config(){var e;return(e=this.$store.state.kling)==null?void 0:e.config}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onReload(e){const t=e.target,s=new URL(t.src),d=s.searchParams.get("retry");if(!d)s.searchParams.set("retry","1");else if(parseInt(d)<2)s.searchParams.set("retry",(parseInt(d)+1).toString());else return;t.src=s.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),_o={class:"preview"},go={class:"left"},fo={class:"main"},vo={class:"bot"},ho={class:"datetime"},$o={class:"info"},ko={key:0,class:"prompt mt-2"},yo={key:0},bo={key:1},wo={key:0,class:D({content:!0,failed:!0})},Io={class:"image-wrapper"},Vo={key:0,class:D({operations:!0,"mt-2":!0})},So={class:"description"},Eo={key:1,class:D({content:!0})},No={class:"description"},Po={class:"description"},Ro={key:0,class:"description"},Co={key:2,class:D({content:!0})},To={class:"description"},Lo={key:0,class:"description"};function Uo(e,t,s,d,g,f){var N,C,P,R,I,T,X,Y,Z,x,ee,te,oe,se,ne,ae,le,ie,re,ce,de,pe,ue,me,_e;const i=n("el-image"),u=n("VideoPlayer"),r=n("el-button"),v=n("el-tooltip"),h=n("font-awesome-icon"),m=n("copy-to-clipboard"),w=n("el-alert");return l(),p("div",_o,[a("div",go,[o(i,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),a("div",fo,[a("div",vo,[k(c(e.$t("kling.name.klingBot"))+" ",1),a("span",ho,c(e.$dayjs.format(""+new Date(parseFloat(((N=e.modelValue)==null?void 0:N.created_at)||"")*1e3))),1)]),a("div",$o,[(P=(C=e.modelValue)==null?void 0:C.request)!=null&&P.prompt?(l(),p("p",ko,[k(c((I=(R=e.modelValue)==null?void 0:R.request)==null?void 0:I.prompt)+" ",1),(T=e.modelValue)!=null&&T.response?$("v-if",!0):(l(),p("span",yo," - ("+c(e.$t("kling.status.pending"))+") ",1)),((Y=(X=e.modelValue)==null?void 0:X.response)==null?void 0:Y.state)==="submitted"||((x=(Z=e.modelValue)==null?void 0:Z.response)==null?void 0:x.state)==="processing"||((te=(ee=e.modelValue)==null?void 0:ee.response)==null?void 0:te.state)==="pending"||((se=(oe=e.modelValue)==null?void 0:oe.response)==null?void 0:se.state)==="completed"?(l(),p("span",bo," - ("+c(e.$t("kling.status.processing"))+") ",1)):$("v-if",!0)])):$("v-if",!0)]),$(" Display success message "),((ae=(ne=e.modelValue)==null?void 0:ne.response)==null?void 0:ae.success)===!0?(l(),p("div",wo,[a("div",Io,[o(u,{"model-value":(le=e.modelValue)==null?void 0:le.response},null,8,["model-value"])]),(ie=e.modelValue)!=null&&ie.response.success?(l(),p("div",Vo,[o(v,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:_(()=>[o(r,{type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=S=>{var V;return e.onDownload(S,(V=e.modelValue)==null?void 0:V.response.video_url)})},{default:_(()=>[k(c(e.$t("kling.button.download")),1)]),_:1})]),_:1},8,["content"])])):$("v-if",!0),o(w,{closable:!1,class:"mt-2 success"},{default:_(()=>{var S,V;return[a("p",So,[o(h,{icon:"fa-solid fa-magic",class:"mr-1"}),k(" "+c(e.$t("kling.name.taskId"))+": "+c((S=e.modelValue)==null?void 0:S.id)+" ",1),o(m,{content:(V=e.modelValue)==null?void 0:V.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):$("v-if",!0),$(" Display error message "),((ce=(re=e.modelValue)==null?void 0:re.response)==null?void 0:ce.success)===!1?(l(),p("div",Eo,[o(w,{closable:!1,class:"failure"},{template:_(()=>[o(h,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),k(" "+c(e.$t("kling.name.failure")),1)]),default:_(()=>{var S,V,G,O,M,j,F,q,ge,fe,ve,he,$e,ke;return[a("p",No,[o(h,{icon:"fa-solid fa-magic",class:"mr-1"}),k(" "+c(e.$t("kling.name.taskId"))+": "+c((S=e.modelValue)==null?void 0:S.id)+" ",1),o(m,{content:(V=e.modelValue)==null?void 0:V.id,class:"btn-copy"},null,8,["content"])]),a("p",Po,[o(h,{icon:"fa-solid fa-circle-info",class:"mr-1"}),k(" "+c(e.$t("kling.name.failureReason"))+": "+c((M=(O=(G=e.modelValue)==null?void 0:G.response)==null?void 0:O.error)==null?void 0:M.message)+" ",1),o(m,{content:(q=(F=(j=e.modelValue)==null?void 0:j.response)==null?void 0:F.error)==null?void 0:q.message,class:"btn-copy"},null,8,["content"])]),(fe=(ge=e.modelValue)==null?void 0:ge.response)!=null&&fe.trace_id?(l(),p("p",Ro,[o(h,{icon:"fa-solid fa-hashtag",class:"mr-1"}),k(" "+c(e.$t("kling.name.traceId"))+": "+c((he=(ve=e.modelValue)==null?void 0:ve.response)==null?void 0:he.trace_id)+" ",1),o(m,{content:(ke=($e=e.modelValue)==null?void 0:$e.response)==null?void 0:ke.trace_id,class:"btn-copy"},null,8,["content"])])):$("v-if",!0)]}),_:1})])):$("v-if",!0),$(" Display error message "),!((de=e.modelValue)!=null&&de.response)||((ue=(pe=e.modelValue)==null?void 0:pe.response)==null?void 0:ue.state)==="processing"||((_e=(me=e.modelValue)==null?void 0:me.response)==null?void 0:_e.state)==="pending"?(l(),p("div",Co,[o(w,{closable:!1,class:"info"},{template:_(()=>[o(h,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),k(" "+c(e.$t("kling.name.failure")),1)]),default:_(()=>{var S,V,G,O,M,j,F,q;return[a("p",To,[o(h,{icon:"fa-solid fa-magic",class:"mr-1"}),k(" "+c(e.$t("kling.name.taskId"))+": "+c((S=e.modelValue)==null?void 0:S.id)+" ",1),o(m,{content:(V=e.modelValue)==null?void 0:V.id,class:"btn-copy"},null,8,["content"])]),(O=(G=e.modelValue)==null?void 0:G.response)!=null&&O.trace_id?(l(),p("p",Lo,[o(h,{icon:"fa-solid fa-hashtag",class:"mr-1"}),k(" "+c(e.$t("kling.name.traceId"))+": "+c((j=(M=e.modelValue)==null?void 0:M.response)==null?void 0:j.trace_id)+" ",1),o(m,{content:(q=(F=e.modelValue)==null?void 0:F.response)==null?void 0:q.trace_id,class:"btn-copy"},null,8,["content"])])):$("v-if",!0)]}),_:1})])):$("v-if",!0)])])}var Ao=y(mo,[["render",Uo],["__scopeId","data-v-547724c8"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/task/Preview.vue"]]);const Do=b({name:"RecentPanel",components:{TaskPreview:Ao,ElSkeleton:Fe,ElSkeletonItem:qe},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,t,s,d;return{...(e=this.$store.state.kling)==null?void 0:e.tasks,items:(d=(s=(t=this.$store.state.kling)==null?void 0:t.tasks)==null?void 0:s.items)==null?void 0:d.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),Go={key:0,class:"tasks"},Oo={class:"left"},Mo={class:"main"},jo={key:1,class:"tasks"},Fo={key:2,class:"description"};function qo(e,t,s,d,g,f){var v,h,m,w,N,C,P,R;const i=n("el-skeleton-item"),u=n("el-skeleton"),r=n("task-preview");return l(),p("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...I)=>e.onHandleScroll&&e.onHandleScroll(...I))},[((v=e.tasks)==null?void 0:v.items)===void 0?(l(),p("div",Go,[(l(),p(U,null,A(3,I=>a("div",{key:I,class:"task placeholder"},[a("div",Oo,[o(u,{animated:""},{template:_(()=>[o(i,{variant:"image",class:"avatar"})]),_:1})]),a("div",Mo,[o(u,{animated:""},{template:_(()=>[o(i,{variant:"p",class:"title"}),o(i,{variant:"image",class:"icon"})]),_:1})])])),64))])):((m=(h=e.tasks)==null?void 0:h.items)==null?void 0:m.length)&&((N=(w=e.tasks)==null?void 0:w.items)==null?void 0:N.length)>0?(l(),p("div",jo,[$(" {{ tasks?.items }} "),(l(!0),p(U,null,A((C=e.tasks)==null?void 0:C.items,(I,T)=>(l(),L(r,{key:T,"model-value":I,class:"preview"},null,8,["model-value"]))),128))])):$("v-if",!0),((R=(P=e.tasks)==null?void 0:P.items)==null?void 0:R.length)===0?(l(),p("p",Fo,c(e.$t("kling.message.noTasks")),1)):$("v-if",!0)],544)}var zo=y(Do,[["render",qo],["__scopeId","data-v-abb7e68a"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/RecentPanel.vue"]]);const Bo="https://webhook.acedata.cloud/kling",Ko=b({name:"KlingIndex",components:{ConfigPanel:lo,Layout:Xe,RecentPanel:zo},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,t;return((t=(e=this.$store.state.kling)==null?void 0:e.status)==null?void 0:t.getApplications)===H.Request},service(){return this.$store.state.kling.service},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},initializing(){return this.$store.state.kling.status.getApplications===H.Request},needApply(){return this.$store.state.kling.status.getApplications===H.Success&&!this.application},application(){return this.$store.state.kling.application},applications(){return this.$store.state.kling.applications},tasks(){return this.$store.state.kling.tasks}},watch:{tasks:{handler(e,t){var s,d;((s=e==null?void 0:e.items)==null?void 0:s.length)>((d=t==null?void 0:t.items)==null?void 0:d.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,s;console.debug("reached top"),await this.onGetTasks({createdAtMax:(s=(t=(e=this.tasks)==null?void 0:e.items)==null?void 0:t[0])==null?void 0:s.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("kling/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("kling/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){Ce.create({application:this.application}).then(({data:e})=>{this.application=e,E.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var t,s;((s=(t=e==null?void 0:e.response)==null?void 0:t.data)==null?void 0:s.code)===Te&&E.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:s,createdAtMax:d}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",d),await this.$store.dispatch("kling/getTasks",{limit:t,createdAtMin:s,createdAtMax:d})},async onGenerate(){var s;const e={...this.config,callback_url:Bo},t=(s=this.credential)==null?void 0:s.token;if(!t){console.error("no token specified");return}E.info(this.$t("kling.message.startingTask")),Le.generate(e,{token:t}).then(()=>{E.success(this.$t("kling.message.startTaskSuccess")),this.$store.commit("kling/setConfig",{config:void 0})}).catch(d=>{var f,i;const g=(f=d==null?void 0:d.response)==null?void 0:f.data;((i=g==null?void 0:g.error)==null?void 0:i.code)===Ue?E.error(this.$t("kling.message.usedUp")):E.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Ho(e,t,s,d,g,f){const i=n("config-panel"),u=n("recent-panel"),r=n("layout");return l(),L(r,null,{config:_(()=>[o(i,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:_(()=>[o(u,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"])]),_:1})}var ss=y(Ko,[["render",Ho],["__scopeId","data-v-e48d89a0"],["__file","/home/runner/work/Nexior/Nexior/src/pages/kling/Index.vue"]]);export{ss as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ae as ne}from"./vendor-others.e28a6fa7.js";import{ar as j}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.af944887.js";import{Q as de,u as L,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 n,o as i,e as _,f as r,I as M,V as s,M as h,T as u,U as N,ai as G,L as T,S as y,R as k,P as D}from"./vendor-@vue.8cef8b94.js";import{I as ae}from"./InfoIcon.172685bc.js";import{I as we}from"./ImagePreview.ed465056.js";import{C as be}from"./CopyToClipboard.ff135372.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const Ie=V({name:"LayoutHailuo",components:{ElDrawer:de,ElButton:L,FontAwesomeIcon:j},data(){return{drawer:!1}}}),Se={class:"main"},Ve={class:"config"},Pe={class:"result"};function Ee(e,t,o,a,f,g){const p=n("font-awesome-icon"),m=n("el-button"),c=n("el-drawer");return i(),_("div",Se,[r("div",Ve,[M(e.$slots,"config",{},void 0,!0)]),r("div",Pe,[M(e.$slots,"result",{},void 0,!0)]),s(m,{round:"",class:"menu",onClick:t[0]||(t[0]=$=>e.drawer=!0)},{default:h(()=>[s(p,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),s(c,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=$=>e.drawer=$),"with-header":!1,size:"340px",class:"drawer"},{default:h(()=>[M(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Te=S(Ie,[["render",Ee],["__scopeId","data-v-3c8363f5"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Hailuo.vue"]]);const Ce=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)}}),Ue={class:"field"},Ae={class:"title font-bold"},Re={class:"float-left"};function Ne(e,t,o,a,f,g){const p=n("el-option"),m=n("el-select");return i(),_("div",Ue,[r("h2",Ae,u(e.$t("hailuo.name.model")),1),s(m,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),class:"value",placeholder:e.$t("hailuo.placeholder.select"),clearable:""},{default:h(()=>[(i(!0),_(N,null,G(e.options,c=>(i(),T(p,{key:c.value,label:c.label,value:c.value},{default:h(()=>[r("span",Re,u(c.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var Ge=S(Ce,[["render",Ne],["__scopeId","data-v-62190314"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/ModelSelector.vue"]]);const Le=V({name:"StartImageUrlInput",components:{ElUpload:he,ElButton:L,InfoIcon:ae,ImagePreview:we},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:"relative"},Oe={class:"flex justify-between"},Me={class:"flex justify-start items-center"},je={class:"text-sm font-bold"};function qe(e,t,o,a,f,g){const p=n("info-icon"),m=n("image-preview"),c=n("el-button"),$=n("el-upload");return i(),_("div",De,[r("div",Oe,[r("div",Me,[r("span",je,u(e.$t("hailuo.name.startImageUrl")),1),s(p,{content:e.$t("hailuo.description.startImageUrl"),class:"info"},null,8,["content"])])]),s($,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=d=>e.fileList=d),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"upload-wrapper","show-file-list":!0,limit:1,multiple:!1,"list-type":"picture",action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-remove":e.onRemove,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:d})=>{var v;return[s(m,{url:d.url||((v=d.response)==null?void 0:v.file_url),name:d.name,percentage:d.percentage,onRemove:w=>e.fileList.splice(e.fileList.indexOf(d),1)},null,8,["url","name","percentage","onRemove"])]}),default:h(()=>[s(c,{size:"small",type:"primary",class:"btn btn-upload",round:""},{default:h(()=>[y(u(e.$t("hailuo.button.uploadStartImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-remove","on-success","headers"])])}var He=S(Le,[["render",qe],["__scopeId","data-v-6c6b80d0"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/StartImageUrlInput.vue"]]);const Be="",ze=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=Be)}}),Fe={class:"field"},Ke={class:"box"},Qe={class:"title font-bold"};function We(e,t,o,a,f,g){const p=n("info-icon"),m=n("el-input");return i(),_("div",Fe,[r("div",Ke,[r("h2",Qe,u(e.$t("hailuo.name.prompt")),1),s(p,{content:e.$t("hailuo.description.prompt"),class:"info"},null,8,["content"])]),s(m,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=c=>e.prompt=c),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("hailuo.placeholder.prompt"),maxlength:300,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var Je=S(ze,[["render",We],["__scopeId","data-v-d785889c"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/PromptInput.vue"]]);const Xe=V({name:"PresetPanel",components:{ElButton:L,FontAwesomeIcon:j,PromptInput:Je,StartImageUrlInput:He,ModelSelector:Ge},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.hailuo)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Ye={class:"panel"},Ze={class:"config"},xe={class:"actions"};function et(e,t,o,a,f,g){var v,w,l;const p=n("prompt-input"),m=n("model-selector"),c=n("start-image-url-input"),$=n("font-awesome-icon"),d=n("el-button");return i(),_("div",Ye,[r("div",Ze,[s(p,{class:"mb-4"}),s(m,{class:"mb-4"}),((v=e.config)==null?void 0:v.model)==="minimax-i2v"?(i(),T(c,{key:0,class:"mb-4"})):k("v-if",!0),r("div",xe,[((w=e.config)==null?void 0:w.video_url)!==void 0||((l=e.config)==null?void 0:l.custom)?(i(),T(d,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[s($,{icon:"fa-solid fa-magic",class:"mr-2"}),y(" "+u(e.$t("hailuo.button.extend")),1)]),_:1},8,["onClick"])):(i(),T(d,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[s($,{icon:"fa-solid fa-magic",class:"mr-2"}),y(" "+u(e.$t("hailuo.button.generate")),1)]),_:1},8,["onClick"]))])])])}var tt=S(Xe,[["render",et],["__scopeId","data-v-01eef439"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/ConfigPanel.vue"]]);const ot=V({name:"VideoPlayer",components:{VuePlyr:ne},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),st=["data-poster"],at=["src"];function nt(e,t,o,a,f,g){const p=n("vue-plyr");return i(),_("div",null,[s(p,{options:e.options,class:"video"},{default:h(()=>{var m,c;return[r("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(m=e.modelValue)==null?void 0:m.image_url},[r("source",{size:"1080",src:(c=e.modelValue)==null?void 0:c.video_url,type:"video/mp4"},null,8,at)],8,st)]}),_:1},8,["options"])])}var lt=S(ot,[["render",nt],["__scopeId","data-v-11ad7a93"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/VideoPlayer.vue"]]);const it=V({name:"TaskPreview",components:{ElImage:ge,CopyToClipboard:be,FontAwesomeIcon:j,ElAlert:$e,VideoPlayer:lt,ElTooltip:ve,ElButton:L},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,m,c;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)&&((c=(m=(p=this.modelValue)==null?void 0:p.response)==null?void 0:m.data)==null||c.forEach($=>{let d=$;t&&(d.action=t),e.push(d)})),e}},methods:{onExtend(e,t){var o;e.stopPropagation(),console.debug("set config",t),this.$store.commit("hailuo/setConfig",{...(o=this.$store.state.hailuo)==null?void 0:o.config,video_id:t.video_id,prompt:t.prompt,action:"extend",thumbnail_url:t.thumbnail_url,video_url:t.video_url})},onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onReload(e){const t=e.target,o=new URL(t.src),a=o.searchParams.get("retry");if(!a)o.searchParams.set("retry","1");else if(parseInt(a)<2)o.searchParams.set("retry",(parseInt(a)+1).toString());else return;t.src=o.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),rt={class:"left"},ct={class:"main"},ut={class:"bot"},pt={class:"datetime"},dt={class:"info"},mt={key:0,class:"prompt mt-2"},_t={key:0},ht={key:1},ft={key:0,class:D({content:!0,failed:!0})},gt={class:"image-wrapper"},$t={key:0,class:D({operations:!0,"mt-2":!0})},vt={class:"description"},yt={key:1,class:D({content:!0})},kt={class:"description"},wt={class:"description"},bt={class:"description"},It={key:2,class:D({content:!0})},St={class:"description"};function Vt(e,t,o,a,f,g){const p=n("el-image"),m=n("VideoPlayer"),c=n("el-button"),$=n("el-tooltip"),d=n("font-awesome-icon"),v=n("copy-to-clipboard"),w=n("el-alert");return i(!0),_(N,null,G(e.videos,(l,A)=>{var C,U,P,R,q,H,B,z,F,K,Q;return i(),_("div",{key:A,class:"preview"},[r("div",rt,[s(p,{src:"https://cdn.acedata.cloud/0qg4gp.png",class:"avatar"})]),r("div",ct,[r("div",ut,[y(u(e.$t("hailuo.name.hailuoBot"))+" ",1),r("span",pt,u(e.$dayjs.format(""+new Date(parseFloat(((C=e.modelValue)==null?void 0:C.created_at)||"")*1e3))),1)]),r("div",dt,[(P=(U=e.modelValue)==null?void 0:U.request)!=null&&P.prompt?(i(),_("p",mt,[y(u((q=(R=e.modelValue)==null?void 0:R.request)==null?void 0:q.prompt)+" ",1),(H=e.modelValue)!=null&&H.response?k("v-if",!0):(i(),_("span",_t," - ("+u(e.$t("hailuo.status.pending"))+") ",1)),(l==null?void 0:l.state)==="processing"||(l==null?void 0:l.state)==="pending"||(l==null?void 0:l.state)==="running"?(i(),_("span",ht," - ("+u(e.$t("hailuo.status.processing"))+") ",1)):k("v-if",!0)])):k("v-if",!0)]),k(" Display success message "),((z=(B=e.modelValue)==null?void 0:B.response)==null?void 0:z.success)===!0?(i(),_("div",ft,[r("div",gt,[s(m,{"model-value":l},null,8,["model-value"])]),l?(i(),_("div",$t,[s($,{class:"box-item",effect:"dark",content:e.$t("hailuo.message.downloadVideo"),placement:"top-start"},{default:h(()=>[s(c,{type:"info",size:"small",class:"btn-action",onClick:b=>e.onDownload(b,l==null?void 0:l.video_url)},{default:h(()=>[y(u(e.$t("hailuo.button.download")),1)]),_:2},1032,["onClick"])]),_:2},1032,["content"])])):k("v-if",!0),s(w,{closable:!1,class:"mt-2 success"},{default:h(()=>{var b,E;return[r("p",vt,[s(d,{icon:"fa-solid fa-magic",class:"mr-1"}),y(" "+u(e.$t("hailuo.name.taskId"))+": "+u((b=e.modelValue)==null?void 0:b.id)+" ",1),s(v,{content:(E=e.modelValue)==null?void 0:E.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):k("v-if",!0),k(" Display error message "),((K=(F=e.modelValue)==null?void 0:F.response)==null?void 0:K.success)===!1?(i(),_("div",yt,[s(w,{closable:!1,class:"failure"},{template:h(()=>[s(d,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),y(" "+u(e.$t("hailuo.name.failure")),1)]),default:h(()=>{var b,E,W,J,X,Y,Z,x,ee,te,oe,se;return[r("p",kt,[s(d,{icon:"fa-solid fa-magic",class:"mr-1"}),y(" "+u(e.$t("hailuo.name.taskId"))+": "+u((b=e.modelValue)==null?void 0:b.id)+" ",1),s(v,{content:(E=e.modelValue)==null?void 0:E.id,class:"btn-copy"},null,8,["content"])]),r("p",wt,[s(d,{icon:"fa-solid fa-circle-info",class:"mr-1"}),y(" "+u(e.$t("hailuo.name.failureReason"))+": "+u((X=(J=(W=e.modelValue)==null?void 0:W.response)==null?void 0:J.error)==null?void 0:X.message)+" ",1),s(v,{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"])]),r("p",bt,[s(d,{icon:"fa-solid fa-hashtag",class:"mr-1"}),y(" "+u(e.$t("hailuo.name.traceId"))+": "+u((te=(ee=e.modelValue)==null?void 0:ee.response)==null?void 0:te.trace_id)+" ",1),s(v,{content:(se=(oe=e.modelValue)==null?void 0:oe.response)==null?void 0:se.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):k("v-if",!0),k(" Display error message "),!((Q=e.modelValue)!=null&&Q.response)||(l==null?void 0:l.state)==="processing"||(l==null?void 0:l.state)==="pending"||(l==null?void 0:l.state)==="running"?(i(),_("div",It,[s(w,{closable:!1,class:"info"},{template:h(()=>[s(d,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),y(" "+u(e.$t("hailuo.name.failure")),1)]),default:h(()=>{var b,E;return[r("p",St,[s(d,{icon:"fa-solid fa-magic",class:"mr-1"}),y(" "+u(e.$t("hailuo.name.taskId"))+": "+u((b=e.modelValue)==null?void 0:b.id)+" ",1),s(v,{content:(E=e.modelValue)==null?void 0:E.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):k("v-if",!0)])])}),128)}var Pt=S(it,[["render",Vt],["__scopeId","data-v-3f5aedb7"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/task/Preview.vue"]]);const Et=V({name:"RecentPanel",components:{TaskPreview:Pt,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")}}}),Tt={key:0,class:"tasks"},Ct={class:"left"},Ut={class:"main"},At={key:1,class:"tasks"},Rt={key:2,class:"description"};function Nt(e,t,o,a,f,g){var $,d,v,w,l,A,C,U;const p=n("el-skeleton-item"),m=n("el-skeleton"),c=n("task-preview");return i(),_("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(),_("div",Tt,[(i(),_(N,null,G(3,P=>r("div",{key:P,class:"task placeholder"},[r("div",Ct,[s(m,{animated:""},{template:h(()=>[s(p,{variant:"image",class:"avatar"})]),_:1})]),r("div",Ut,[s(m,{animated:""},{template:h(()=>[s(p,{variant:"p",class:"title"}),s(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):((v=(d=e.tasks)==null?void 0:d.items)==null?void 0:v.length)&&((l=(w=e.tasks)==null?void 0:w.items)==null?void 0:l.length)>0?(i(),_("div",At,[(i(!0),_(N,null,G((A=e.tasks)==null?void 0:A.items,(P,R)=>(i(),T(c,{key:R,"model-value":P,class:"preview"},null,8,["model-value"]))),128))])):k("v-if",!0),((U=(C=e.tasks)==null?void 0:C.items)==null?void 0:U.length)===0?(i(),_("p",Rt,u(e.$t("hailuo.message.noTasks")),1)):k("v-if",!0)],544)}var Gt=S(Et,[["render",Nt],["__scopeId","data-v-7bff9d40"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/RecentPanel.vue"]]);const Lt="https://webhook.acedata.cloud/hailuo",Dt=V({name:"HailuoIndex",components:{ConfigPanel:tt,Layout:Te,RecentPanel:Gt},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,t;return((t=(e=this.$store.state.hailuo)==null?void 0:e.status)==null?void 0:t.getApplications)===O.Request},service(){return this.$store.state.hailuo.service},credential(){return this.$store.state.hailuo.credential},config(){return this.$store.state.hailuo.config},initializing(){return this.$store.state.hailuo.status.getApplications===O.Request},needApply(){return this.$store.state.hailuo.status.getApplications===O.Success&&!this.application},application(){return this.$store.state.hailuo.application},applications(){return this.$store.state.hailuo.applications},tasks(){return this.$store.state.hailuo.tasks}},watch:{tasks:{handler(e,t){var o,a;((o=e==null?void 0:e.items)==null?void 0:o.length)>((a=t==null?void 0:t.items)==null?void 0:a.length)&&console.debug("new tasks detected")},deep:!0}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onScrollDown(),await this.onGetTasks(),await this.onScrollDown(),this.job=setInterval(()=>{this.onGetTasks()},5e3)},async unmounted(){clearInterval(this.job),clearInterval(this.timer)},methods:{async onReachTop(){var e,t,o;console.debug("reached top"),await this.onGetTasks({createdAtMax:(o=(t=(e=this.tasks)==null?void 0:e.items)==null?void 0:t[0])==null?void 0:o.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("hailuo/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("hailuo/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){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:Lt},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 Ot(e,t,o,a,f,g){const p=n("config-panel"),m=n("recent-panel"),c=n("layout");return i(),T(c,null,{config:h(()=>[s(p,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:h(()=>[s(m,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"])]),_:1})}var Jt=S(Dt,[["render",Ot],["__scopeId","data-v-1f8aa246"],["__file","/home/runner/work/Nexior/Nexior/src/pages/hailuo/Index.vue"]]);export{Jt as default};
|
|
@@ -1 +0,0 @@
|
|
|
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.af944887.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.172685bc.js";import{C as Ne}from"./CopyToClipboard.ff135372.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 +0,0 @@
|
|
|
1
|
-
import{ae as le}from"./vendor-others.e28a6fa7.js";import{ar as q}from"./vendor-fortawesome.0d8f27df.js";import{_ as y,aI as re,aJ as ce,aK as pe,A as de,a0 as M,F as ue,ad as _e,aL as me,W as fe}from"./index.af944887.js";import{Q as he,u as G,p as ge,N as ne,O as ie,M as ke,L as $e,x as ve,y as E,t as ye,m as be,I as we,s as Ie,H as Se,V as Ve}from"./vendor-element-plus.7eade167.js";import{H as b,al as n,o as i,e as u,f as p,I as O,V as s,M as m,T as c,U,ai as R,L as P,R as k,S as $,P as L}from"./vendor-@vue.8cef8b94.js";import{I as B}from"./InfoIcon.172685bc.js";import{C as Ee}from"./CopyToClipboard.ff135372.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const Pe=b({name:"LayoutPika",components:{ElDrawer:he,ElButton:G,FontAwesomeIcon:q},data(){return{drawer:!1}}}),Ce={class:"main"},Te={class:"config"},Ne={class:"result"};function Ae(e,t,o,l,f,h){const r=n("font-awesome-icon"),d=n("el-button"),a=n("el-drawer");return i(),u("div",Ce,[p("div",Te,[O(e.$slots,"config",{},void 0,!0)]),p("div",Ne,[O(e.$slots,"result",{},void 0,!0)]),s(d,{round:"",class:"menu",onClick:t[0]||(t[0]=v=>e.drawer=!0)},{default:m(()=>[s(r,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),s(a,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=v=>e.drawer=v),"with-header":!1,size:"340px",class:"drawer"},{default:m(()=>[O(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Ue=y(Pe,[["render",Ae],["__scopeId","data-v-449d36ce"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Pika.vue"]]);const Re=b({name:"IngredientsSelector",components:{ElSwitch:ge,InfoIcon:B},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.pika)==null?void 0:e.config)==null?void 0:t.ingredients},set(e){var t,o;console.debug("set ingredients",e),e||this.$store.commit("pika/setConfig",{...(t=this.$store.state.pika)==null?void 0:t.config,ingredients:e,ingredients_mode:void 0,image_url:void 0}),this.$store.commit("pika/setConfig",{...(o=this.$store.state.pika)==null?void 0:o.config,ingredients:e,model:"2.0"})}}},mounted(){this.value===void 0&&(this.value=re)}}),De={class:"field"},Ge={class:"title font-bold"};function Le(e,t,o,l,f,h){const r=n("el-switch"),d=n("info-icon");return i(),u("div",De,[p("h2",Ge,c(e.$t("pika.name.ingredients")),1),s(r,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=a=>e.value=a),class:"value"},null,8,["modelValue"]),s(d,{content:e.$t("pika.description.ingredients"),class:"info"},null,8,["content"])])}var Me=y(Re,[["render",Le],["__scopeId","data-v-798cb974"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/IngredientsSelector.vue"]]);const Oe=b({name:"EffectSelector",components:{ElSelect:ne,ElOption:ie},data(){return{}},computed:{options(){return[{value:"Levitate",label:this.$t("pika.style.effect1")},{value:"Decapitate",label:this.$t("pika.style.effect2")},{value:"Eye-pop",label:this.$t("pika.style.effect3")},{value:"Ta-da",label:this.$t("pika.style.effect4")},{value:"Deflate",label:this.$t("pika.style.effect5")},{value:"Crumble",label:this.$t("pika.style.effect6")},{value:"Dissolve",label:this.$t("pika.style.effect7")},{value:"Squish",label:this.$t("pika.style.effect8")},{value:"Inflate",label:this.$t("pika.style.effect9")},{value:"Melt",label:this.$t("pika.style.effect10")},{value:"Cake-ify",label:this.$t("pika.style.effect11")},{value:"Crush",label:this.$t("pika.style.effect12")},{value:"Explode",label:this.$t("pika.style.effect13")}]},value:{get(){var e,t;return(t=(e=this.$store.state.pika)==null?void 0:e.config)==null?void 0:t.effect},set(e){var t;this.$store.commit("pika/setConfig",{...(t=this.$store.state.pika)==null?void 0:t.config,effect:e})}}},watch:{},mounted(){}}),qe={class:"field"},Be={class:"title font-bold"},je={class:"float-left"};function Fe(e,t,o,l,f,h){const r=n("el-option"),d=n("el-select");return i(),u("div",qe,[p("h2",Be,c(e.$t("pika.name.effect")),1),s(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=a=>e.value=a),class:"value",placeholder:e.$t("pika.placeholder.select"),clearable:""},{default:m(()=>[(i(!0),u(U,null,R(e.options,a=>(i(),P(r,{key:a.value,label:a.label,value:a.value},{default:m(()=>[p("span",je,c(a.label),1),k(' <span class="float-right">{{ item.value }}</span> ')]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var ze=y(Oe,[["render",Fe],["__scopeId","data-v-db9ed4a6"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/EffectSelector.vue"]]);const He=b({name:"IngredientsModelSelector",components:{ElRadioButton:ke,ElRadioGroup:$e},data(){return{options:[{label:this.$t("pika.button.precise"),value:"precise"},{label:this.$t("pika.button.creative"),value:"creative"}]}},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.pika)==null?void 0:e.config)==null?void 0:t.ingredients_mode},set(e){var t;this.$store.commit("pika/setConfig",{...(t=this.$store.state.pika)==null?void 0:t.config,ingredients_mode:e})}}},mounted(){this.value||(this.value=ce)}}),Ke={class:"field"},Je={class:"title font-bold"};function Qe(e,t,o,l,f,h){const r=n("el-radio-button"),d=n("el-radio-group");return i(),u("div",Ke,[p("h2",Je,c(e.$t("pika.name.ingredientsModel")),1),s(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=a=>e.value=a),size:"small",class:"quality"},{default:m(()=>[(i(!0),u(U,null,R(e.options,a=>(i(),P(r,{key:a.value,label:a.value},{default:m(()=>[$(c(a.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}var We=y(He,[["render",Qe],["__scopeId","data-v-12df6463"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/IngredientsModelSelector.vue"]]);const Xe=b({name:"ModelSelector",components:{ElSelect:ne,ElOption:ie},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:"2.0",label:"2.0"},{value:"1.5",label:"1.5"}]}},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.pika)==null?void 0:e.config)==null?void 0:t.model},set(e){this.$store.commit("pika/setConfig",{...this.$store.state.pika.config,model:e})}}},mounted(){this.value||(this.value=pe)}}),Ye={class:"field"},Ze={class:"title font-bold"};function xe(e,t,o,l,f,h){const r=n("el-option"),d=n("el-select");return i(),u("div",Ye,[p("h2",Ze,c(e.$t("pika.name.model")),1),s(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=a=>e.value=a),class:"value",placeholder:e.$t("pika.placeholder.select")},{default:m(()=>[(i(!0),u(U,null,R(e.options,a=>(i(),P(r,{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var et=y(Xe,[["render",xe],["__scopeId","data-v-1df4d99b"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/ModelSelector.vue"]]);const tt=b({name:"ImageUrlInput",components:{ElUpload:ve,ElButton:G,InfoIcon:B},data(){return{fileList:[],uploadUrl:de()+"/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.pika)==null?void 0:e.config)==null?void 0:t.image_url},set(e){var t,o;(t=this.urls)==null||t[0],this.$store.commit("pika/setConfig",{...(o=this.$store.state.pika)==null?void 0:o.config,image_url:this.urls})}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){E.warning(this.$t("pika.message.uploadStartImageExceed"))},onError(){E.error(this.$t("pika.message.uploadStartImageError"))},async onRemove(){E.error(this.$t("pika.message.uploadStartImageError"))},onSetStartImageUrl(){var e;this.$store.commit("pika/setConfig",{...(e=this.$store.state.pika)==null?void 0:e.config,image_url:this.urls})},async onSuccess(){this.onSetStartImageUrl()}}}),st={class:"field"},ot={class:"title font-bold"},at={class:"upload-wrapper"};function nt(e,t,o,l,f,h){const r=n("el-button"),d=n("el-upload"),a=n("info-icon");return i(),u("div",st,[p("h2",ot,c(e.$t("pika.name.imageUrl")),1),p("div",at,[s(d,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=v=>e.fileList=v),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:3,multiple:!0,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(r,{size:"small",type:"primary",round:""},{default:m(()=>[$(c(e.$t("pika.button.uploadImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-remove","on-success","headers"])]),s(a,{content:e.$t("pika.description.imageUrl"),class:"info"},null,8,["content"])])}var it=y(tt,[["render",nt],["__scopeId","data-v-5daf4a89"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/ImageUrlInput.vue"]]);const lt="",rt=b({name:"PromptInput",components:{ElInput:ye,InfoIcon:B},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.pika)==null?void 0:e.config)==null?void 0:t.prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("pika/setConfig",{...(t=this.$store.state.pika)==null?void 0:t.config,prompt:e})}}},mounted(){this.value||(this.value=lt)}}),ct={class:"field"},pt={class:"box"},dt={class:"title font-bold"};function ut(e,t,o,l,f,h){const r=n("info-icon"),d=n("el-input");return i(),u("div",ct,[p("div",pt,[p("h2",dt,c(e.$t("pika.name.prompt")),1),s(r,{content:e.$t("pika.description.prompt"),class:"info"},null,8,["content"])]),s(d,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=a=>e.prompt=a),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("pika.placeholder.prompt"),maxlength:300,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var _t=y(rt,[["render",ut],["__scopeId","data-v-3f49f00e"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/PromptInput.vue"]]);const mt=b({name:"PresetPanel",components:{ImageUrlInput:it,ElButton:G,FontAwesomeIcon:q,PromptInput:_t,IngredientsSelector:Me,IngredientsModelSelector:We,ModelSelector:et,EffectSelector:ze},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.pika)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),ft={class:"panel"},ht={class:"config"},gt={class:"actions"};function kt(e,t,o,l,f,h){var A,C,T,w;const r=n("prompt-input"),d=n("model-selector"),a=n("ingredients-selector"),v=n("effect-selector"),g=n("image-url-input"),I=n("ingredients-model-selector"),V=n("font-awesome-icon"),_=n("el-button");return i(),u("div",ft,[p("div",ht,[s(r,{class:"mb-4"}),s(d,{class:"mb-4"}),s(a,{class:"mb-4"}),s(v,{class:"mb-4"}),(A=e.config)!=null&&A.ingredients?(i(),P(g,{key:0,class:"mb-4"})):k("v-if",!0),(C=e.config)!=null&&C.ingredients?(i(),P(I,{key:1,class:"mb-4"})):k("v-if",!0),p("div",gt,[((T=e.config)==null?void 0:T.video_url)!==void 0||((w=e.config)==null?void 0:w.custom)?(i(),P(_,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[s(V,{icon:"fa-solid fa-magic",class:"mr-2"}),$(" "+c(e.$t("pika.button.extend")),1)]),_:1},8,["onClick"])):(i(),P(_,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[s(V,{icon:"fa-solid fa-magic",class:"mr-2"}),$(" "+c(e.$t("pika.button.generate")),1)]),_:1},8,["onClick"]))])])])}var $t=y(mt,[["render",kt],["__scopeId","data-v-26d959d2"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/ConfigPanel.vue"]]);const vt=b({name:"VideoPlayer",components:{VuePlyr:le},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),yt=["data-poster"],bt=["src"];function wt(e,t,o,l,f,h){const r=n("vue-plyr");return i(),u("div",null,[s(r,{options:e.options,class:"video"},{default:m(()=>{var d,a;return[p("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(d=e.modelValue)==null?void 0:d.image_url},[p("source",{size:"1080",src:(a=e.modelValue)==null?void 0:a.video_url,type:"video/mp4"},null,8,bt)],8,yt)]}),_:1},8,["options"])])}var It=y(vt,[["render",wt],["__scopeId","data-v-3697e02c"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/VideoPlayer.vue"]]);const St=b({name:"TaskPreview",components:{ElImage:be,CopyToClipboard:Ee,FontAwesomeIcon:q,ElAlert:we,VideoPlayer:It,ElTooltip:Ie,ElButton:G},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.pika)==null?void 0:e.application},config(){var e;return(e=this.$store.state.pika)==null?void 0:e.config},videos(){var o,l,f,h,r,d,a;let e=[];const t=(l=(o=this.modelValue)==null?void 0:o.request)==null?void 0:l.action;return Array.isArray((h=(f=this.modelValue)==null?void 0:f.response)==null?void 0:h.data)&&((a=(d=(r=this.modelValue)==null?void 0:r.response)==null?void 0:d.data)==null||a.forEach(v=>{let g=v;t&&(g.action=t),e.push(g)})),e}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onReload(e){const t=e.target,o=new URL(t.src),l=o.searchParams.get("retry");if(!l)o.searchParams.set("retry","1");else if(parseInt(l)<2)o.searchParams.set("retry",(parseInt(l)+1).toString());else return;t.src=o.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),Vt={class:"left"},Et={class:"main"},Pt={class:"bot"},Ct={class:"datetime"},Tt={class:"info"},Nt={key:0,class:"prompt mt-2"},At={key:0},Ut={key:1},Rt={key:0,class:L({content:!0,failed:!0})},Dt={class:"image-wrapper"},Gt={key:0,class:L({operations:!0,"mt-2":!0})},Lt={class:"description"},Mt={key:1,class:L({content:!0})},Ot={class:"description"},qt={class:"description"},Bt={class:"description"},jt={key:2,class:L({content:!0})},Ft={class:"description"};function zt(e,t,o,l,f,h){const r=n("el-image"),d=n("VideoPlayer"),a=n("el-button"),v=n("el-tooltip"),g=n("font-awesome-icon"),I=n("copy-to-clipboard"),V=n("el-alert");return i(!0),u(U,null,R(e.videos,(_,A)=>{var C,T,w,D,j,F,z,H,K,J,Q;return i(),u("div",{key:A,class:"preview"},[p("div",Vt,[s(r,{src:"https://cdn.acedata.cloud/i80tgn.png",class:"avatar"})]),p("div",Et,[p("div",Pt,[$(c(e.$t("pika.name.pikaBot"))+" ",1),p("span",Ct,c(e.$dayjs.format(""+new Date(parseFloat(((C=e.modelValue)==null?void 0:C.created_at)||"")*1e3))),1)]),p("div",Tt,[(w=(T=e.modelValue)==null?void 0:T.request)!=null&&w.prompt?(i(),u("p",Nt,[$(c((j=(D=e.modelValue)==null?void 0:D.request)==null?void 0:j.prompt)+" ",1),(F=e.modelValue)!=null&&F.response?k("v-if",!0):(i(),u("span",At," - ("+c(e.$t("pika.status.pending"))+") ",1)),(_==null?void 0:_.state)==="processing"||(_==null?void 0:_.state)==="pending"||(_==null?void 0:_.state)==="completed"?(i(),u("span",Ut," - ("+c(e.$t("pika.status.processing"))+") ",1)):k("v-if",!0)])):k("v-if",!0)]),k(" Display success message "),((H=(z=e.modelValue)==null?void 0:z.response)==null?void 0:H.success)===!0?(i(),u("div",Rt,[p("div",Dt,[s(d,{"model-value":_},null,8,["model-value"])]),_?(i(),u("div",Gt,[s(v,{class:"box-item",effect:"dark",content:e.$t("pika.message.downloadVideo"),placement:"top-start"},{default:m(()=>[s(a,{type:"info",size:"small",class:"btn-action",onClick:S=>e.onDownload(S,_==null?void 0:_.video_url)},{default:m(()=>[$(c(e.$t("pika.button.download")),1)]),_:2},1032,["onClick"])]),_:2},1032,["content"])])):k("v-if",!0),s(V,{closable:!1,class:"mt-2 success"},{default:m(()=>{var S,N;return[p("p",Lt,[s(g,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+c(e.$t("pika.name.taskId"))+": "+c((S=e.modelValue)==null?void 0:S.id)+" ",1),s(I,{content:(N=e.modelValue)==null?void 0:N.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):k("v-if",!0),k(" Display error message "),((J=(K=e.modelValue)==null?void 0:K.response)==null?void 0:J.success)===!1?(i(),u("div",Mt,[s(V,{closable:!1,class:"failure"},{template:m(()=>[s(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),$(" "+c(e.$t("pika.name.failure")),1)]),default:m(()=>{var S,N,W,X,Y,Z,x,ee,te,se,oe,ae;return[p("p",Ot,[s(g,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+c(e.$t("pika.name.taskId"))+": "+c((S=e.modelValue)==null?void 0:S.id)+" ",1),s(I,{content:(N=e.modelValue)==null?void 0:N.id,class:"btn-copy"},null,8,["content"])]),p("p",qt,[s(g,{icon:"fa-solid fa-circle-info",class:"mr-1"}),$(" "+c(e.$t("pika.name.failureReason"))+": "+c((Y=(X=(W=e.modelValue)==null?void 0:W.response)==null?void 0:X.error)==null?void 0:Y.message)+" ",1),s(I,{content:(ee=(x=(Z=e.modelValue)==null?void 0:Z.response)==null?void 0:x.error)==null?void 0:ee.message,class:"btn-copy"},null,8,["content"])]),p("p",Bt,[s(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),$(" "+c(e.$t("pika.name.traceId"))+": "+c((se=(te=e.modelValue)==null?void 0:te.response)==null?void 0:se.trace_id)+" ",1),s(I,{content:(ae=(oe=e.modelValue)==null?void 0:oe.response)==null?void 0:ae.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):k("v-if",!0),k(" Display error message "),!((Q=e.modelValue)!=null&&Q.response)||(_==null?void 0:_.state)==="processing"||(_==null?void 0:_.state)==="pending"?(i(),u("div",jt,[s(V,{closable:!1,class:"info"},{template:m(()=>[s(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),$(" "+c(e.$t("pika.name.failure")),1)]),default:m(()=>{var S,N;return[p("p",Ft,[s(g,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+c(e.$t("pika.name.taskId"))+": "+c((S=e.modelValue)==null?void 0:S.id)+" ",1),s(I,{content:(N=e.modelValue)==null?void 0:N.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):k("v-if",!0)])])}),128)}var Ht=y(St,[["render",zt],["__scopeId","data-v-90858984"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/task/Preview.vue"]]);const Kt=b({name:"RecentPanel",components:{TaskPreview:Ht,ElSkeleton:Se,ElSkeletonItem:Ve},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,t,o,l;return{...(e=this.$store.state.pika)==null?void 0:e.tasks,items:(l=(o=(t=this.$store.state.pika)==null?void 0:t.tasks)==null?void 0:o.items)==null?void 0:l.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),Jt={key:0,class:"tasks"},Qt={class:"left"},Wt={class:"main"},Xt={key:1,class:"tasks"},Yt={key:2,class:"description"};function Zt(e,t,o,l,f,h){var v,g,I,V,_,A,C,T;const r=n("el-skeleton-item"),d=n("el-skeleton"),a=n("task-preview");return i(),u("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...w)=>e.onHandleScroll&&e.onHandleScroll(...w))},[((v=e.tasks)==null?void 0:v.items)===void 0?(i(),u("div",Jt,[(i(),u(U,null,R(3,w=>p("div",{key:w,class:"task placeholder"},[p("div",Qt,[s(d,{animated:""},{template:m(()=>[s(r,{variant:"image",class:"avatar"})]),_:1})]),p("div",Wt,[s(d,{animated:""},{template:m(()=>[s(r,{variant:"p",class:"title"}),s(r,{variant:"image",class:"icon"})]),_:1})])])),64))])):((I=(g=e.tasks)==null?void 0:g.items)==null?void 0:I.length)&&((_=(V=e.tasks)==null?void 0:V.items)==null?void 0:_.length)>0?(i(),u("div",Xt,[(i(!0),u(U,null,R((A=e.tasks)==null?void 0:A.items,(w,D)=>(i(),P(a,{key:D,"model-value":w,class:"preview"},null,8,["model-value"]))),128))])):k("v-if",!0),((T=(C=e.tasks)==null?void 0:C.items)==null?void 0:T.length)===0?(i(),u("p",Yt,c(e.$t("pika.message.noTasks")),1)):k("v-if",!0)],544)}var xt=y(Kt,[["render",Zt],["__scopeId","data-v-be2bfa4e"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/RecentPanel.vue"]]);const es="https://webhook.acedata.cloud/pika",ts=b({name:"PikaIndex",components:{ConfigPanel:$t,Layout:Ue,RecentPanel:xt},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,t;return((t=(e=this.$store.state.pika)==null?void 0:e.status)==null?void 0:t.getApplications)===M.Request},service(){return this.$store.state.pika.service},credential(){return this.$store.state.pika.credential},config(){return this.$store.state.pika.config},initializing(){return this.$store.state.pika.status.getApplications===M.Request},needApply(){return this.$store.state.pika.status.getApplications===M.Success&&!this.application},application(){return this.$store.state.pika.application},applications(){return this.$store.state.pika.applications},tasks(){return this.$store.state.pika.tasks}},watch:{tasks:{handler(e,t){var o,l;((o=e==null?void 0:e.items)==null?void 0:o.length)>((l=t==null?void 0:t.items)==null?void 0:l.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("pika/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("pika/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){ue.create({application:this.application}).then(({data:e})=>{this.application=e,E.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)===_e&&E.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:l}=e||{};console.debug("limit",t,"createdAtMin",o,"createdAtMax",l),await this.$store.dispatch("pika/getTasks",{limit:t,createdAtMin:o,createdAtMax:l})},async onGenerate(){var o;const e={...this.config,callback_url:es},t=(o=this.credential)==null?void 0:o.token;if(!t){console.error("no token specified");return}E.info(this.$t("pika.message.startingTask")),me.generate(e,{token:t}).then(()=>{E.success(this.$t("pika.message.startTaskSuccess")),this.$store.commit("pika/setConfig",{config:void 0})}).catch(l=>{var h,r;const f=(h=l==null?void 0:l.response)==null?void 0:h.data;((r=f==null?void 0:f.error)==null?void 0:r.code)===fe?E.error(this.$t("pika.message.usedUp")):E.error(this.$t("pika.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function ss(e,t,o,l,f,h){const r=n("config-panel"),d=n("recent-panel"),a=n("layout");return i(),P(a,null,{config:m(()=>[s(r,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:m(()=>[s(d,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"])]),_:1})}var us=y(ts,[["render",ss],["__scopeId","data-v-307eef94"],["__file","/home/runner/work/Nexior/Nexior/src/pages/pika/Index.vue"]]);export{us as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./vendor-others.e28a6fa7.js";import{L as B}from"./Chatdoc.e3a25d38.js";import{_ as w,a0 as $,aj as F}from"./index.af944887.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.262204eb.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 +0,0 @@
|
|
|
1
|
-
import"./vendor-others.e28a6fa7.js";import{C as U}from"./CopyToClipboard.ff135372.js";import{_ as A,ag as Q,ah as G,ai as W}from"./index.af944887.js";import{d as R,s as Y,a as j}from"./distribution.b731316d.js";import{g as J}from"./price.4ab7e0ad.js";import{ar as K}from"./vendor-fortawesome.0d8f27df.js";import{Q as X}from"./vendor-qrcode.ef88fffc.js";import{P as Z,A as x,B as tt,u as et,l as it,F as st,s as ot,C as nt,D as at,H as lt}from"./vendor-element-plus.7eade167.js";import{H as rt,al as l,L as _,M as o,o as a,V as i,f as e,T as s,e as g,S as y,R as C}from"./vendor-@vue.8cef8b94.js";import"./vendor-axios.168e6950.js";const dt=rt({name:"ConsoleDistributionList",components:{CopyToClipboard:U,FontAwesomeIcon:K,QrCode:X,ElProgress:Z,ElRow:x,ElCol:tt,ElButton:et,ElDivider:it,ElCard:st,ElTooltip:ot,ElTable:nt,ElTableColumn:at,ElSkeleton:lt},data(){return{invitees:[],inviteesCount:void 0,distributionLevels:[],distributionLink:void 0,distributionStatus:void 0,loading:!1}},computed:{redirect(){return this.$route.query.redirect},page(){var t;return parseInt(((t=this.$route.query.page)==null?void 0:t.toString())||"1")},distributionLevelMap(){let t={};return this.distributionLevels.forEach(n=>{t[n.level]=n}),t}},watch:{page:{handler(){this.onFetchData()}}},async mounted(){this.onFetchData(),this.onGenerateDistributionLink()},methods:{getPriceString:J,goHistory(){this.$router.push({name:Q})},goInvitees(){this.$router.push({name:G})},onPageChange(t){var n;this.$router.push({name:(n=this.$route.name)==null?void 0:n.toString(),query:{page:t}})},getPercentageForNextLevel(){var c,u,p,m,r,b,h;const t=(p=this.distributionLevelMap[(u=(c=this.distributionStatus)==null?void 0:c.level)==null?void 0:u.level])==null?void 0:p.threshold,n=(b=this.distributionLevelMap[((r=(m=this.distributionStatus)==null?void 0:m.level)==null?void 0:r.level)+1])==null?void 0:b.threshold;return Math.floor((((h=this.distributionStatus)==null?void 0:h.price)-t)/(n-t)*100)},getDeltaForNextLevel(){var n,c,u,p;const t=(u=this.distributionLevelMap[((c=(n=this.distributionStatus)==null?void 0:n.level)==null?void 0:c.level)+1])==null?void 0:u.threshold;return Math.floor(t-((p=this.distributionStatus)==null?void 0:p.price))},async onFetchData(){this.loading=!0,await R.initialize(),Promise.all([this.onFetchDistributionStatus(),this.onFetchDistributionLevels(),this.onFetchInvitees()]).finally(()=>{this.loading=!1})},async onGenerateDistributionLink(){var c,u,p;const n=`${window.location.origin}?inviter_id=${this.$store.getters.user.id}`;try{const m=(p=(u=(c=await Y.create(n))==null?void 0:c.data)==null?void 0:u.data)==null?void 0:p.url;this.distributionLink=(m||n).replace("surl.id","share.acedata.cloud")}catch{this.distributionLink=n}},async onFetchDistributionStatus(){const{data:t}=await R.getAll({user_id:this.$store.getters.user.id});t.items&&t.items.length>0&&(this.distributionStatus=t.items[0])},async onFetchDistributionLevels(){const{data:t}=await j.getAll({limit:20,user_id:this.$store.getters.user.id});this.distributionLevels=t.items},async onFetchInvitees(){const{data:t}=await W.getInvitees({});this.invitees=t.items,this.inviteesCount=t.count}}}),ct={class:"title"},ut={key:1},pt={class:"icon-wrapper"},ht={class:"text-left"},_t={class:"description"},vt={class:"value"},bt={key:1},mt={class:"icon-wrapper"},ft={class:"text-left"},gt={class:"description"},kt={class:"value"},wt={key:1},yt={class:"icon-wrapper"},$t={class:"text-left"},Lt={class:"description"},St={class:"value"},Ct={key:1},Dt={class:"icon-wrapper"},It={class:"text-left"},Tt={class:"description"},Et={class:"value"},Ft={key:1},Nt={class:"title"},Pt={class:"clear-both overflow-hidden"},Bt={class:"float-left description"},Mt={class:"float-right description"},Ot={class:"description"},Rt={class:"level"},qt={class:"level"},Vt={class:"level"},zt={key:1},Ht={class:"title"},Ut={class:"link-wrapper text-center"},At=["href"],Qt={class:"qr-wrapper ml-auto mr-auto"},Gt={class:"mt-0"},Wt={class:"description"},Yt={class:"more"};function jt(t,n,c,u,p,m){const r=l("el-col"),b=l("el-row"),h=l("el-skeleton"),$=l("font-awesome-icon"),L=l("el-button"),f=l("el-card"),D=l("el-tooltip"),q=l("el-progress"),I=l("el-divider"),S=l("el-table-column"),V=l("el-table"),z=l("copy-to-clipboard"),H=l("qr-code");return a(),_(b,{class:"panel"},{default:o(()=>[i(r,{span:24},{default:o(()=>[i(b,null,{default:o(()=>[i(r,{span:24},{default:o(()=>[e("h2",ct,s(t.$t("common.title.distribution")),1)]),_:1})]),_:1}),i(b,{gutter:15},{default:o(()=>[i(r,{md:6,xs:24},{default:o(()=>[i(f,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>{var d;return[t.loading?(a(),_(h,{key:0})):(a(),g("div",ut,[e("div",pt,[i($,{icon:"fa-solid fa-wallet",class:"icon"})]),e("div",ht,[e("p",_t,s(t.$t("distribution.title.price")),1),e("p",vt,s(t.getPriceString({value:(d=t.distributionStatus)==null?void 0:d.price})),1)]),i(L,{type:"primary",round:"",size:"small",class:"btn",onClick:t.goHistory},{default:o(()=>[y(s(t.$t("distribution.button.detail")),1)]),_:1},8,["onClick"])]))]}),_:1})]),_:1}),i(r,{md:6,xs:24},{default:o(()=>[i(f,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>{var d;return[t.loading?(a(),_(h,{key:0})):(a(),g("div",bt,[e("div",mt,[i($,{icon:"fa-solid fa-coins",class:"icon"})]),e("div",ft,[e("p",gt,s(t.$t("distribution.title.reward")),1),e("p",kt,s(t.getPriceString({value:(d=t.distributionStatus)==null?void 0:d.reward})),1)]),i(D,{effect:"dark",content:t.$t("distribution.message.developingWithDrawal"),placement:"top"},{default:o(()=>[i(L,{type:"primary",round:"",size:"small",class:"btn"},{default:o(()=>[y(s(t.$t("distribution.button.withdrawal")),1)]),_:1})]),_:1},8,["content"])]))]}),_:1})]),_:1}),i(r,{md:6,xs:24},{default:o(()=>[i(f,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>{var d,k;return[t.loading?(a(),_(h,{key:0})):(a(),g("div",wt,[e("div",yt,[i($,{icon:"fa-solid fa-percent",class:"icon"})]),e("div",$t,[e("p",Lt,s(t.$t("distribution.title.percentage")),1),e("p",St,s((k=(d=t.distributionStatus)==null?void 0:d.level)==null?void 0:k.percentage)+"%",1)])]))]}),_:1})]),_:1}),i(r,{md:6,xs:24},{default:o(()=>[i(f,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>[t.loading?(a(),_(h,{key:0})):(a(),g("div",Ct,[e("div",Dt,[i($,{icon:"fa-regular fa-user",class:"icon"})]),e("div",It,[e("p",Tt,s(t.$t("distribution.title.inviteesCount")),1),e("p",Et,s(t.inviteesCount),1)]),i(L,{type:"primary",round:"",size:"small",class:"btn",onClick:t.goInvitees},{default:o(()=>[y(s(t.$t("distribution.button.detail")),1)]),_:1},8,["onClick"])]))]),_:1})]),_:1})]),_:1}),i(b,{gutter:15},{default:o(()=>[i(r,{md:12,xs:24},{default:o(()=>[i(f,{shadow:"hover",class:"level-info mb-4"},{default:o(()=>{var d,k,T,E,F,N,P,B,M,O;return[t.loading?(a(),_(h,{key:0})):(a(),g("div",Ft,[e("h4",Nt,s(t.$t("distribution.title.levelInfo")),1),e("div",Pt,[e("div",Bt,[e("p",null,s(t.$t("distribution.title.currentLevel"))+": L"+s((k=(d=t.distributionStatus)==null?void 0:d.level)==null?void 0:k.level),1),e("p",null,s(t.$t("distribution.title.currentPercentage"))+": "+s((F=t.distributionLevelMap[(E=(T=t.distributionStatus)==null?void 0:T.level)==null?void 0:E.level])==null?void 0:F.percentage)+"% ",1)]),e("div",Mt,[e("p",null,s(t.$t("distribution.title.nextLevel"))+": L"+s(((P=(N=t.distributionStatus)==null?void 0:N.level)==null?void 0:P.level)+1),1),e("p",null,s(t.$t("distribution.title.nextPercentage"))+": "+s((O=t.distributionLevelMap[((M=(B=t.distributionStatus)==null?void 0:B.level)==null?void 0:M.level)+1])==null?void 0:O.percentage)+"% ",1)])]),i(q,{"text-inside":!0,"stroke-width":20,percentage:t.getPercentageForNextLevel(),class:"mb-2"},null,8,["percentage"]),e("p",Ot,s(t.$t("distribution.message.deltaPriceForNextLevel"))+": $"+s(t.getDeltaForNextLevel()),1),i(I),t.distributionLevels?(a(),_(V,{key:0,data:t.distributionLevels,stripe:""},{default:o(()=>[i(S,{label:t.$t("distribution.field.level")},{default:o(w=>{var v;return[e("span",Rt,"L"+s((v=w.row)==null?void 0:v.level),1)]}),_:1},8,["label"]),i(S,{label:t.$t("distribution.field.threshold")},{default:o(w=>{var v;return[e("span",qt,"$"+s((v=w.row)==null?void 0:v.threshold),1)]}),_:1},8,["label"]),i(S,{label:t.$t("distribution.field.percentage")},{default:o(w=>{var v;return[e("span",Vt,s((v=w.row)==null?void 0:v.percentage)+"%",1)]}),_:1},8,["label"])]),_:1},8,["data"])):C("v-if",!0)]))]}),_:1})]),_:1}),i(r,{md:12,xs:24},{default:o(()=>[i(f,{shadow:"hover",class:"distribution-info mb-4"},{default:o(()=>[t.loading?(a(),_(h,{key:0})):(a(),g("div",zt,[e("h4",Ht,s(t.$t("distribution.title.distributionLink")),1),i(I),e("div",Ut,[C("v-if",!0),e("a",{href:t.distributionLink,class:"link"},s(t.distributionLink),9,At),i(z,{content:t.distributionLink},null,8,["content"])]),e("div",Qt,[t.distributionLink?(a(),_(H,{key:0,value:t.distributionLink,size:180,margin:2,class:"block mb-2 ml-auto mr-auto"},null,8,["value"])):C("v-if",!0),e("p",Gt,s(t.$t("distribution.message.distributionQrDescription")),1)]),e("p",Wt,[y(s(t.$t("distribution.message.distributionLinkDescription"))+" ",1),e("span",Yt,[i(D,{effect:"dark",content:t.$t("distribution.message.distributionLinkDescription2"),placement:"top"},{default:o(()=>[y(s(t.$t("distribution.message.technicalDetail")),1)]),_:1},8,["content"])])])]))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var ne=A(dt,[["render",jt],["__scopeId","data-v-732e1b6b"],["__file","/home/runner/work/Nexior/Nexior/src/pages/distribution/Index.vue"]]);export{ne as default};
|