@acedatacloud/nexior 1.10.1 → 1.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -16
- package/dist/assets/{Auth.a3080d43.js → Auth.3b1ae5ec.js} +1 -1
- package/dist/assets/{Buy.1ae7bd2d.js → Buy.74683d00.js} +1 -1
- package/dist/assets/{Callback.30e36ae4.js → Callback.2089666e.js} +1 -1
- package/dist/assets/{Chatdoc.b051942b.js → Chatdoc.085ef653.js} +1 -1
- package/dist/assets/{Console.61846bc2.js → Console.9d6c6b1f.js} +1 -1
- package/dist/assets/{Conversation.af5b2448.js → Conversation.35508107.js} +1 -1
- package/dist/assets/{Conversation.474d36f0.js → Conversation.97e23fc4.js} +1 -1
- package/dist/assets/{CopyToClipboard.de4a0d29.js → CopyToClipboard.a77675ce.js} +1 -1
- package/dist/assets/{DarkSelector.5cdf004e.js → DarkSelector.ce80ee4d.js} +1 -1
- package/dist/assets/{Detail.6e91dcab.js → Detail.ea687d42.js} +1 -1
- package/dist/assets/{HelpEntry.0bbde634.js → HelpEntry.0ed9a9d0.js} +1 -1
- package/dist/assets/{History.96eddc48.js → History.65d71b56.js} +1 -1
- package/dist/assets/{Index.4096d133.js → Index.1146d749.js} +1 -1
- package/dist/assets/{Index.6df44b6e.js → Index.2350b367.js} +1 -1
- package/dist/assets/{Index.f9603014.js → Index.57fb866f.js} +1 -1
- package/dist/assets/{Index.2a0825c4.js → Index.5b80d5b2.js} +1 -1
- package/dist/assets/{Index.a2253d61.js → Index.a6897b45.js} +1 -1
- package/dist/assets/{Index.b1c78dd7.js → Index.cf91edfd.js} +1 -1
- package/dist/assets/{InfoIcon.2a7ed9be.js → InfoIcon.fa95c6dc.js} +1 -1
- package/dist/assets/{Invitees.25f81f40.js → Invitees.81717642.js} +1 -1
- package/dist/assets/{List.0048978c.js → List.4df88772.js} +1 -1
- package/dist/assets/{List.e68bc610.js → List.721d9455.js} +1 -1
- package/dist/assets/{List.28fe8370.js → List.bd9dc2d7.js} +1 -1
- package/dist/assets/{Login.e5a69f1f.js → Login.3bafac90.js} +1 -1
- package/dist/assets/{Main.b8bfb5a5.js → Main.56e938bb.js} +1 -1
- package/dist/assets/{Manage.b24ee467.js → Manage.742d155b.js} +1 -1
- package/dist/assets/{Navigator.10599156.js → Navigator.f27b2c18.js} +1 -1
- package/dist/assets/{Pagination.b258bbd5.js → Pagination.d33da3c9.js} +1 -1
- package/dist/assets/{Setting.7637df52.js → Setting.e70d52a8.js} +1 -1
- package/dist/assets/{Status.46c21bb1.js → Status.46275dcf.js} +1 -1
- package/dist/assets/{distribution.071e01d0.js → distribution.9879f380.js} +1 -1
- package/dist/assets/{index.5834f7b9.js → index.3ae4a354.js} +3 -3
- package/dist/assets/{order.258a211f.js → order.9333ea65.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,19 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
<h1 align="center">Nexior</h1>
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Deploy your own AI application site in minutes, including applications such as AIChat, Midjourney, ChatDoc, QRArt, etc. No development experience required, no need to purchase AI accounts, no need to worry about API support, and no need to configure payment systems. Zero startup costs, zero risk, earn revenue through AI.
|
|
6
6
|
|
|
7
|
-
一键部署属于你的 AI 应用站点,包括
|
|
7
|
+
一键部署属于你的 AI 应用站点,包括 AI 问答、Midjourney 绘画、知识库问答、艺术二维码等应用,无需任何开发经验、无需采购 AI 账号、无需关心 API 支持、无需配置支付系统。零启动成本,零风险通过 AI 赚取收益。
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
One click to deploy to Vercel:
|
|
12
12
|
|
|
13
|
-
[](https://
|
|
14
|
-
|
|
15
|
-
One click to deploy to Netlify:
|
|
16
|
-
|
|
17
|
-
[](https://app.netlify.com/start/deploy?repository=https://github.com/AceDataCloud/Nexior)
|
|
13
|
+
[](https://platform.acedata.cloud/documents/5b942c64-5612-4aab-ab3c-9e58b64cb069)
|
|
18
14
|
|
|
19
15
|
</div>
|
|
20
16
|
|
|
@@ -42,24 +38,30 @@ One click to deploy to Netlify:
|
|
|
42
38
|
- 开箱支持用户系统,支持邮箱登录和注册,无需额外配置。
|
|
43
39
|
- 完全开源免费,采用 MIT 协议,配置简单,可直接部署为您自己的系统。
|
|
44
40
|
|
|
45
|
-
Powered by [AceDataCloud](https://platform.acedata.cloud/).
|
|
41
|
+
Demo URL: [https://hub.acedata.cloud/](https://hub.acedata.cloud/), Powered by [AceDataCloud](https://platform.acedata.cloud/).
|
|
42
|
+
|
|
43
|
+
## Principle of Making Money
|
|
44
|
+
|
|
45
|
+
This system supports a customer binding mechanism, where registered users of each website can be permanently bound as sub-customers of the website owner or sharer. The customer's consumption orders on this platform will be refunded to the superior account according to the distributor's distribution ratio, and can contact customer service to withdraw funds at any time.
|
|
46
|
+
|
|
47
|
+
本系统支持客源绑定机制,每个网站的注册用户可永久绑定为站长或分享者的下级客户,客户在本平台的所有消费订单将根据站长的分销比例返还到上级账户,并可联系客服随时提现。
|
|
46
48
|
|
|
47
49
|
## Preview
|
|
48
50
|
|
|
49
51
|
Midjourney:
|
|
50
52
|
|
|
51
|
-

|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
<img src="https://cdn.acedata.cloud/bw11q9.png" style="width: 300px">
|
|
54
56
|
|
|
55
|
-
|
|
57
|
+
GPT Chat:
|
|
56
58
|
|
|
57
|
-
|
|
59
|
+

|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
<img src="https://cdn.acedata.cloud/k4dxw0.png" style="width: 300px">
|
|
60
62
|
|
|
61
|
-
|
|
63
|
+
Artistic QR Code:
|
|
62
64
|
|
|
63
|
-

|
|
64
66
|
|
|
65
|
-
|
|
67
|
+
<img src="https://cdn.acedata.cloud/l11ebv.png" style="width: 300px">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-others.6e08baf0.js";import{_}from"./index.
|
|
1
|
+
import"./vendor-others.6e08baf0.js";import{_}from"./index.3ae4a354.js";import{a as s,b as c}from"./vendor-element-plus.97860c23.js";import{H as i,al as e,L as p,M as o,o as l,V as t}from"./vendor-@vue.8e552cf2.js";import"./vendor-axios.168e6950.js";import"./vendor-fortawesome.46d238d8.js";const u=i({name:"LayoutAuth",components:{ElContainer:s,ElMain:c}});function m(d,f,v,h,x,w){const n=e("router-view"),r=e("el-main"),a=e("el-container");return l(),p(a,null,{default:o(()=>[t(r,null,{default:o(()=>[t(n)]),_:1})]),_:1})}var B=_(u,[["render",m],["__scopeId","data-v-8e16c232"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Auth.vue"]]);export{B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var M=Object.defineProperty,U=Object.defineProperties;var z=Object.getOwnPropertyDescriptors;var B=Object.getOwnPropertySymbols;var G=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var I=(e,a,t)=>a in e?M(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,w=(e,a)=>{for(var t in a||(a={}))G.call(a,t)&&I(e,t,a[t]);if(B)for(var t of B(a))j.call(a,t)&&I(e,t,a[t]);return e},N=(e,a)=>U(e,z(a));import"./vendor-others.6e08baf0.js";import{_ as F,v as H,w as Q}from"./index.
|
|
1
|
+
var M=Object.defineProperty,U=Object.defineProperties;var z=Object.getOwnPropertyDescriptors;var B=Object.getOwnPropertySymbols;var G=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var I=(e,a,t)=>a in e?M(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,w=(e,a)=>{for(var t in a||(a={}))G.call(a,t)&&I(e,t,a[t]);if(B)for(var t of B(a))j.call(a,t)&&I(e,t,a[t]);return e},N=(e,a)=>U(e,z(a));import"./vendor-others.6e08baf0.js";import{_ as F,v as H,w as Q}from"./index.3ae4a354.js";import{H as P,o as n,e as h,U as p,al as s,L as k,M as i,V as o,f as W,T as b,ai as J,W as K,S as O,Q as V}from"./vendor-@vue.8e552cf2.js";import{o as X}from"./order.9333ea65.js";import{u as Y,j as Z,k as x,o as ee,B as ae,C as te,d as ie,w as oe,D as re,F as se,G as ne}from"./vendor-element-plus.97860c23.js";import"./vendor-axios.168e6950.js";import"./vendor-fortawesome.46d238d8.js";const le=P({name:"ApiPrice",props:{price:{type:Number,required:!1,default:0},unit:{type:String,required:!1,default:void 0},start:{type:Boolean,required:!1,default:!1}}}),pe={class:"price-text"},ce={key:0,class:"unfree"},de={key:1,class:"free"};function ue(e,a,t,l,c,v){return n(),h("div",pe,[e.price>0?(n(),h("span",ce,"$"+p(e.price)+" "+p(e.unit?` / ${e.unit}`:"")+p(e.start?e.$t("common.message.startPrice"):""),1)):(n(),h("span",de,p(e.$t("common.message.free")),1))])}var me=F(le,[["render",ue],["__scopeId","data-v-d195ccd6"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/Price.vue"]]);const fe=P({name:"ConsoleApplicationBuy",components:{ElSkeleton:Y,ElRow:Z,ElCol:x,ElCard:ee,ElForm:ae,ElFormItem:te,ElButton:ie,ElDivider:oe,ElRadioGroup:re,ElRadioButton:se,Price:me},data(){return{application:void 0,loading:!1,form:{packageId:void 0},creating:!1}},computed:{id(){var e,a;return(a=(e=this.$route.params)==null?void 0:e.id)==null?void 0:a.toString()},price(){var e,a,t;return((a=(e=this.application)==null?void 0:e.service)==null?void 0:a.price)&&this.form.amount?this.form.amount*((t=this.application.service)==null?void 0:t.price):0},package(){var e,a,t;if(((a=(e=this.application)==null?void 0:e.service)==null?void 0:a.packages)&&this.form.packageId){const l=(t=this.application.service)==null?void 0:t.packages.filter(c=>c.id===this.form.packageId);if(l.length>0)return l[0]}}},mounted(){this.onFetchApplication()},methods:{onFetchApplication(){this.loading=!0,H.get(this.id).then(({data:e})=>{var a,t,l,c;this.application=e,this.loading=!1,this.form.packageId=(c=(l=(t=(a=this.application)==null?void 0:a.service)==null?void 0:t.packages)==null?void 0:l[0])==null?void 0:c.id}).catch(()=>{this.loading=!1})},onCreateOrder(){var a,t,l,c,v,u,m,$;if(!((a=this.application)!=null&&a.id))return;this.creating=!0;const e=this.$t(`service.unit.${(l=(t=this.application)==null?void 0:t.service)==null?void 0:l.unit}s`);X.create(N(w({application_id:(c=this.application)==null?void 0:c.id,amount:(v=this.package)==null?void 0:v.amount},this.form.packageId!=="custom"&&this.package?{package_id:this.package.id}:{}),{description:`${(m=(u=this.application)==null?void 0:u.service)==null?void 0:m.title} x ${($=this.package)==null?void 0:$.amount} ${e}`})).then(({data:f})=>{this.creating=!1;const y=f;this.$router.push({name:Q,params:{id:y.id}})}).catch(()=>{ne.error(this.$t("order.message.createFailed")),this.creating=!1})}}}),_e={class:"title"},he={key:1,class:V({price:!0,free:!0})};function ge(e,a,t,l,c,v){const u=s("el-col"),m=s("el-row"),$=s("el-skeleton"),f=s("el-form-item"),y=s("el-radio-button"),R=s("el-radio-group"),S=s("price"),A=s("el-divider"),D=s("el-button"),L=s("el-form"),T=s("el-card");return n(),k(m,{class:"panel"},{default:i(()=>[o(u,{span:24},{default:i(()=>[o(m,null,{default:i(()=>[o(u,{span:24},{default:i(()=>[W("h2",_e,p(e.$t("common.title.buyMore")),1)]),_:1})]),_:1}),o(m,null,{default:i(()=>[o(u,{span:24},{default:i(()=>[o(T,{shadow:"hover"},{default:i(()=>[o(m,null,{default:i(()=>[o(u,{span:12,offset:6},{default:i(()=>[e.loading?(n(),k($,{key:0})):e.application?(n(),k(L,{key:1,"label-width":"100px"},{default:i(()=>[o(f,{label:e.$t("application.field.service")},{default:i(()=>{var r,d;return[b(p((d=(r=e.application)==null?void 0:r.service)==null?void 0:d.title),1)]}),_:1},8,["label"]),o(f,{label:e.$t("application.field.package")},{default:i(()=>{var r,d;return[(d=(r=e.application)==null?void 0:r.service)!=null&&d.packages?(n(),k(R,{key:0,modelValue:e.form.packageId,"onUpdate:modelValue":a[0]||(a[0]=_=>e.form.packageId=_)},{default:i(()=>{var _;return[(n(!0),h(K,null,J((_=e.application)==null?void 0:_.service.packages,(g,q)=>(n(),k(y,{key:q,label:g.id},{default:i(()=>{var E,C;return[b(p(g.amount)+" "+p(e.$t(`service.unit.${(C=(E=e.application)==null?void 0:E.service)==null?void 0:C.unit}s`)),1)]}),_:2},1032,["label"]))),128))]}),_:1},8,["modelValue"])):O("v-if",!0)]}),_:1},8,["label"]),o(f,{label:e.$t("service.field.price")},{default:i(()=>{var r;return[o(S,{price:(r=e.package)==null?void 0:r.price},null,8,["price"])]}),_:1},8,["label"]),o(A,{"border-style":"dashed"}),o(f,{label:e.$t("application.field.shouldPayPrice")},{default:i(()=>{var r,d,_,g;return[e.package?(n(),h("span",{key:0,class:V({price:!0,unfree:((r=e.package)==null?void 0:r.price)>0,free:((d=e.package)==null?void 0:d.price)===0})}," $"+p((g=(_=e.package)==null?void 0:_.price)==null?void 0:g.toFixed(2)),3)):(n(),h("span",he," $ 0 "))]}),_:1},8,["label"]),o(f,null,{default:i(()=>[o(D,{type:"primary",size:"large",class:"btn-create",loading:e.creating,round:"",onClick:e.onCreateOrder},{default:i(()=>[b(p(e.$t("application.button.createOrder")),1)]),_:1},8,["loading","onClick"])]),_:1})]),_:1})):O("v-if",!0)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var Ie=F(fe,[["render",ge],["__scopeId","data-v-5881dfca"],["__file","/home/runner/work/Nexior/Nexior/src/pages/console/application/Buy.vue"]]);export{Ie as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-others.6e08baf0.js";import{_ as r}from"./index.
|
|
1
|
+
import"./vendor-others.6e08baf0.js";import{_ as r}from"./index.3ae4a354.js";import{H as t}from"./vendor-@vue.8e552cf2.js";import"./vendor-element-plus.97860c23.js";import"./vendor-axios.168e6950.js";import"./vendor-fortawesome.46d238d8.js";const a=t({name:"AuthCallback",data(){var e;return{redirect:(e=this.$route.query.redirect)==null?void 0:e.toString()}},async mounted(){this.redirect&&await this.$router.push(this.redirect)}});var p=r(a,[["__scopeId","data-v-4aa7f9d0"],["__file","/home/runner/work/Nexior/Nexior/src/pages/auth/Callback.vue"]]);export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var w=Object.defineProperty,g=Object.defineProperties;var k=Object.getOwnPropertyDescriptors;var d=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var l=(e,t,o)=>t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,p=(e,t)=>{for(var o in t||(t={}))N.call(t,o)&&l(e,o,t[o]);if(d)for(var o of d(t))x.call(t,o)&&l(e,o,t[o]);return e},u=(e,t)=>g(e,k(t));import"./vendor-others.6e08baf0.js";import{X as A,i as I,_ as M}from"./index.
|
|
1
|
+
var w=Object.defineProperty,g=Object.defineProperties;var k=Object.getOwnPropertyDescriptors;var d=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var l=(e,t,o)=>t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,p=(e,t)=>{for(var o in t||(t={}))N.call(t,o)&&l(e,o,t[o]);if(d)for(var o of d(t))x.call(t,o)&&l(e,o,t[o]);return e},u=(e,t)=>g(e,k(t));import"./vendor-others.6e08baf0.js";import{X as A,i as I,_ as M}from"./index.3ae4a354.js";import{af as E}from"./vendor-fortawesome.46d238d8.js";import{s as S,t as R}from"./vendor-element-plus.97860c23.js";import{H as T,al as n,o as s,e as m,L as h,M as _,f as r,V as O,U as f,W as V,ai as G,T as L,S as B,I as D}from"./vendor-@vue.8e552cf2.js";const H=T({name:"LayoutChatdoc",components:{ElMenu:S,ElMenuItem:R,FontAwesomeIcon:E},data(){var e,t;return{repositoryId:(t=(e=this.$route.params)==null?void 0:e.repositoryId)==null?void 0:t.toString(),drawer:!1,menuItems:[{index:"chat",title:this.$t("chatdoc.nav.chat"),route:{name:A}},{index:"manage",title:this.$t("chatdoc.nav.manage"),route:{name:I}}]}},computed:{activeMenu(){var t;const e=this.menuItems.filter(o=>{var a;return((a=o.route)==null?void 0:a.name)===this.$route.name});if(e)return(t=e[0])==null?void 0:t.index},repository(){var e,t,o;return(o=(t=(e=this.$store.state)==null?void 0:e.chatdoc)==null?void 0:t.repositories)==null?void 0:o.find(a=>a.id===this.repositoryId)}},async mounted(){await this.getService(),await this.onGetApplications(),await this.onGetRepositories()},methods:{async getService(){await this.$store.dispatch("chatdoc/getService")},async onGetApplications(){await this.$store.dispatch("chatdoc/getApplication")},async onGetRepositories(){await this.$store.dispatch("chatdoc/getRepositories")},async onClickMenu(e){this.activeMenu=e.index,e.route&&await this.$router.push(u(p({},e.route),{params:{id:this.repositoryId}}))}}}),U={class:"main"},F={class:"repository"},W={class:"chatdoc"};function b(e,t,o,a,z,X){const v=n("font-awesome-icon"),y=n("el-menu-item"),C=n("el-menu");return s(),m("div",U,[e.repositoryId?(s(),h(C,{key:0,"default-active":e.activeMenu,mode:"horizontal",ellipsis:!1,class:"menu"},{default:_(()=>{var c;return[r("div",F,[O(v,{class:"mr-2",icon:["fas","book"]}),r("span",null,f((c=e.repository)==null?void 0:c.name),1)]),(s(!0),m(V,null,G(e.menuItems,(i,$)=>(s(),h(y,{key:$,index:i.index,onClick:j=>e.onClickMenu(i)},{default:_(()=>[L(f(i.title),1)]),_:2},1032,["index","onClick"]))),128))]}),_:1},8,["default-active"])):B("v-if",!0),r("div",W,[D(e.$slots,"chatdoc",{},void 0,!0)])])}var Z=M(H,[["render",b],["__scopeId","data-v-35d9dd71"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Chatdoc.vue"]]);export{Z as L};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-others.6e08baf0.js";import{N as h}from"./Navigator.
|
|
1
|
+
import"./vendor-others.6e08baf0.js";import{N as h}from"./Navigator.f27b2c18.js";import{B as v,R as $,a as w,b as N,c as g,_}from"./index.3ae4a354.js";import{af as L}from"./vendor-fortawesome.46d238d8.js";import{H as l,al as a,o as t,e as i,f as s,W as S,ai as x,Q as C,V as r,U as E,L as O,S as y,aK as I,aL as k}from"./vendor-@vue.8e552cf2.js";import"./vendor-element-plus.97860c23.js";import"./DarkSelector.ce80ee4d.js";import"./vendor-vue-dark-switch.38123453.js";import"./vendor-axios.168e6950.js";const b=l({name:"Navigator",components:{FontAwesomeIcon:L},computed:{isOfficial(){return window.location.origin===v},active(){return this.$route.matched[0].path},user(){return this.$store.getters.user},links(){return[{key:"application-list",text:this.$t("console.menu.applicationList"),name:$,icon:"fa-solid fa-cube"},{key:"order-list",text:this.$t("console.menu.orderList"),name:w,icon:"fa-solid fa-store"},{key:"usage-list",text:this.$t("console.menu.usageList"),name:N,icon:"fa-solid fa-rotate-left"}]}},mounted(){},methods:{onHome(){this.$router.push({name:g})},onNavigate(e){e.name?this.$router.push({name:e.name}):e.href&&window.open(e.href,"_blank")}}}),R=e=>(I("data-v-3859f1b5"),e=e(),k(),e),T={class:"side-panel"},U={class:"links"},B=["onClick"],A={class:"icon"},P={class:"text"},V={class:"outer"},D=R(()=>s("span",{class:"suffix"},null,-1));function H(e,d,m,p,u,f){const n=a("font-awesome-icon");return t(),i("div",T,[s("div",U,[(t(!0),i(S,null,x(e.links,(o,c)=>(t(),i("a",{key:c,class:C({link:!0,active:e.$route.name===o.name}),onClick:K=>e.onNavigate(o)},[s("span",A,[r(n,{icon:o.icon,class:"text-sm"},null,8,["icon"])]),s("span",P,E(o.text),1),s("span",V,[!o.name&&o.href?(t(),O(n,{key:0,icon:"fa-solid fa-up-right-from-square",class:"text-sm ml-2"})):y("v-if",!0)]),D],10,B))),128))])])}var W=_(b,[["render",H],["__scopeId","data-v-3859f1b5"],["__file","/home/runner/work/Nexior/Nexior/src/components/console/SidePanel.vue"]]);const z=l({name:"LayoutConsole",components:{SidePanel:W,Navigator:h},data(){return{mobile:window.innerWidth<768}},mounted(){window.addEventListener("resize",()=>{this.mobile=window.innerWidth<768})}}),F={class:"wrapper"},q={class:"main"};function G(e,d,m,p,u,f){const n=a("side-panel"),o=a("router-view"),c=a("navigator");return t(),i("div",F,[s("div",q,[r(n,{class:"side"}),r(o,{class:"panel"})]),r(c,{class:"navigator",direction:e.mobile?"row":"column"},null,8,["direction"])])}var se=_(z,[["render",G],["__scopeId","data-v-44569c68"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Console.vue"]]);export{se as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var se=Object.defineProperty;var B=Object.getOwnPropertySymbols;var oe=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable;var H=(e,t,a)=>t in e?se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,A=(e,t)=>{for(var a in t||(t={}))oe.call(t,a)&&H(e,a,t[a]);if(B)for(var a of B(t))ne.call(t,a)&&H(e,a,t[a]);return e};import{a as ae}from"./vendor-axios.168e6950.js";import{H as ie}from"./vendor-others.6e08baf0.js";import{_ as E,I as N,x as T,u as re,y as le,C as U,z as P,A as W,D as z,E as F,F as G,d as Q,G as L,e as Y,H as j}from"./index.5834f7b9.js";import{H as S,o as n,e as p,al as i,f as l,L as g,S as k,W as I,ai as D,M as C,T as de,U as b,Q as q,V as f,O as ce,aw as ue,a0 as V,as as X,$ as O,I as x}from"./vendor-@vue.8e552cf2.js";import{M as pe,E as Z,a as ee,b as he,c as me,d as _e,e as fe,f as ge,g as K,A as $e,h as ye}from"./Status.46c21bb1.js";import{C as we}from"./CopyToClipboard.de4a0d29.js";import{x as ke,d as te,q as ve,e as Ce,H as be,G as J,I as Ee,J as Se,K as Ie,j as Ne,k as De,L as Ae,u as Oe,M as Re}from"./vendor-element-plus.97860c23.js";import{af as R}from"./vendor-fortawesome.46d238d8.js";import{i as Te}from"./is.dd611415.js";import"./application.ea1e2a72.js";import"./vendor-markdown.8e590d23.js";import"./vendor-highlight.js.19da0c9f.js";const qe=S({name:"AnsweringMark",data(){return{}},computed:{conversationId(){var e,t;return(t=(e=this.$route.params)==null?void 0:e.id)==null?void 0:t.toString()}}}),Me={class:"box"};function Ue(e,t,a,m,w,o){return n(),p("div",Me)}var Ge=E(qe,[["render",Ue],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/AnsweringMark.vue"]]);const Le=S({name:"Message",components:{CopyToClipboard:we,AnsweringMark:Ge,MarkdownRenderer:pe,ElAlert:ke,ElButton:te,ElImage:ve},props:{message:{type:Object,required:!0},application:{type:Object,required:!0}},emits:["stop"],data(){return{copied:!1,messageState:N}},computed:{errorText(){var e,t;if(!(!this.message.error||!((e=this.message.error)!=null&&e.code)))switch((t=this.message.error)==null?void 0:t.code){case K:return this.$t("chat.message.errorUsedUp");case ge:return this.$t("chat.message.errorApiError");case fe:return this.$t("chat.message.errorBadRequest");case _e:return this.$t("chat.message.errorTimeout");case me:return this.$t("chat.message.errorTooManyRequests");case he:return this.$t("chat.message.errorContentTooLarge");case ee:return this.$t("chat.message.errorNotApplied");case Z:default:return this.$t("chat.message.errorUnknown")}},showBuyMore(){var e;return this.message.role===T&&((e=this.message.error)==null?void 0:e.code)===K}},methods:{onCopy(){ie(this.message.content.toString(),{debug:!0}),this.copied=!0,setTimeout(()=>{this.copied=!1},3e3)},onBuyMore(){var e;this.$router.push({name:re,params:{id:(e=this.application)==null?void 0:e.id}})}}}),Ve=["role"],Be={class:"author"},He={class:"main"},Pe={class:"content"},We={key:1},ze=["src"],Fe={class:"operations"};function je(e,t,a,m,w,o){var y;const d=i("el-image"),c=i("markdown-renderer"),_=i("answering-mark"),r=i("copy-to-clipboard"),h=i("el-alert"),s=i("el-button");return n(),p("div",{class:q({message:!0,[e.message.role]:!0,hidden:e.errorText&&e.message.role==="assistant"}),role:e.message.role},[l("div",Be,[e.message.role==="assistant"?(n(),g(d,{key:0,src:"https://cdn.acedata.cloud/7dljuv.png",fit:"cover",class:"avatar"})):k("v-if",!0)]),l("div",He,[l("div",Pe,[Array.isArray(e.message.content)?(n(),p("div",We,[(n(!0),p(I,null,D(e.message.content,(v,u)=>{var $;return n(),p("div",{key:u},[v.type==="image_url"?(n(),p("img",{key:0,src:($=v.image_url)==null?void 0:$.url,fit:"cover",class:"image"},null,8,ze)):k("v-if",!0),v.type==="text"?(n(),g(c,{key:u,content:v.text},null,8,["content"])):k("v-if",!0)])}),128))])):(n(),g(c,{key:0,content:(y=e.message)==null?void 0:y.content},null,8,["content"])),e.message.state===e.messageState.PENDING?(n(),g(_,{key:2})):k("v-if",!0)]),l("div",Fe,[Array.isArray(e.message.content)?k("v-if",!0):(n(),g(r,{key:0,content:e.message.content,class:"btn-copy"},null,8,["content"]))])]),e.errorText?(n(),g(h,{key:0,class:"error",title:e.errorText,type:"error",closable:!1},null,8,["title"])):k("v-if",!0),e.showBuyMore?(n(),g(s,{key:1,round:"",type:"primary",class:"btn btn-buy",size:"small",onClick:e.onBuyMore},{default:C(()=>[de(b(e.$t("common.button.buyMore")),1)]),_:1},8,["onClick"])):k("v-if",!0)],10,Ve)}var xe=E(Le,[["render",je],["__scopeId","data-v-f0476f80"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/Message.vue"]]);const Ke=S({name:"InputBox",components:{ElTooltip:Ce,FontAwesomeIcon:R,ElUpload:be},props:{disabled:{type:Boolean,required:!1,default:!1},references:{type:Array,required:!1,default:()=>[]},question:{type:String,required:!0}},emits:["update:question","update:references","submit"],data(){return{inputHeight:"35px",questionValue:this.question,fileList:[],uploadUrl:le()+"/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})},canUpload(){return[U.name].includes(this.model.name)},model(){return this.$store.state.chat.model}},watch:{urls(e){this.$emit("update:references",e)},questionValue(e){this.$emit("update:question",e)},question(e){e!==this.questionValue&&(this.questionValue=e)},references(e){e.length===0&&(this.fileList=[])}},methods:{adjustTextareaHeight(){this.$nextTick(()=>{const e=this.$refs.textarea;e&&(e.style.height="35px",e.style.height=e.scrollHeight+"px")})},onSubmit(){!this.question||this.$emit("submit")},onExceed(){J.warning(this.$t("chat.message.uploadReferencesExceed"))},onError(){J.error(this.$t("chat.message.uploadReferencesError"))}}}),Je={class:"input-box"},Qe={class:"btn btn-upload"},Ye=["disabled","placeholder"],Xe={class:"info"};function Ze(e,t,a,m,w,o){const d=i("font-awesome-icon"),c=i("el-tooltip"),_=i("el-upload");return n(),p(I,null,[l("div",Je,[f(_,{"file-list":e.fileList,"onUpdate:file-list":t[0]||(t[0]=r=>e.fileList=r),class:q({upload:!0,disabled:!e.canUpload}),disabled:!e.canUpload,name:"file","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,headers:e.headers},{default:C(()=>[f(c,{class:"box-item",effect:"dark",content:e.$t("chat.message.uploadFile"),placement:"top"},{default:C(()=>[l("span",Qe,[f(d,{icon:"fa-solid fa-paperclip",class:"icon icon-attachment"})])]),_:1},8,["content"])]),_:1},8,["file-list","class","disabled","action","on-exceed","on-error","headers"]),l("span",{class:q({btn:!0,"btn-send":!0,disabled:!e.questionValue}),onClick:t[1]||(t[1]=(...r)=>e.onSubmit&&e.onSubmit(...r))},[f(d,{icon:"fa-solid fa-location-arrow",class:"icon icon-send"})],2),k(" add this textarea "),ce(l("textarea",{ref:"textarea","onUpdate:modelValue":t[2]||(t[2]=r=>e.questionValue=r),disabled:e.disabled,class:"input",placeholder:e.$t("chat.message.newMessagePlaceholder"),style:V({height:e.inputHeight}),onKeydown:t[3]||(t[3]=X(O((...r)=>e.onSubmit&&e.onSubmit(...r),["exact","prevent"]),["enter"])),onInput:t[4]||(t[4]=(...r)=>e.adjustTextareaHeight&&e.adjustTextareaHeight(...r))},null,44,Ye),[[ue,e.questionValue]])]),l("p",Xe,b(e.$t("chat.message.howToUse")),1)],64)}var et=E(Ke,[["render",Ze],["__scopeId","data-v-020f4eb8"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/InputBox.vue"]]);const tt=S({name:"ModelSelector",components:{ElDropdown:Ee,ElDropdownMenu:Se,ElDropdownItem:Ie,FontAwesomeIcon:R},emits:["update:modelValue","select"],data(){return{options:[{icon:"fa-solid fa-bolt",color:"#ff9900",model:P},{icon:"fa-solid fa-bolt",color:"#ff9900",model:W},{icon:"fa-solid fa-wand-magic-sparkles",color:"#ce65e6",model:z},{icon:"fa-solid fa-wand-magic-sparkles",color:"#ce65e6",model:F},{icon:"fa-solid fa-wand-magic-sparkles",color:"#ce65e6",model:U}]}},computed:{model(){const e=this.$store.state.chat.model.name;return[P,W,z,F,U].find(a=>a.name===e)}},methods:{onCommandChange(e){this.$emit("select",e),this.$store.dispatch("chat/setModel",e)}}}),st={class:"selector"},ot={class:"name"},nt={class:"angle"},at={class:"item"},it={class:"info"},rt={class:"name"},lt={class:"description"};function dt(e,t,a,m,w,o){const d=i("font-awesome-icon"),c=i("el-dropdown-item"),_=i("el-dropdown-menu"),r=i("el-dropdown");return n(),p("div",st,[f(r,{trigger:"click","popper-class":"popper"},{dropdown:C(()=>[f(_,null,{default:C(()=>[(n(!0),p(I,null,D(e.options,(h,s)=>(n(),g(c,{key:s,onClick:y=>e.onCommandChange(h.model)},{default:C(()=>[l("div",at,[l("div",{class:"icon",style:V({color:h.color})},[f(d,{icon:h.icon},null,8,["icon"])],4),l("div",it,[l("p",rt,b(h.model.getDisplayName()),1),l("p",lt,b(h.model.getDescription()),1)])])]),_:2},1032,["onClick"]))),128))]),_:1})]),default:C(()=>{var h;return[l("div",null,[l("span",ot,b((h=e.model)==null?void 0:h.getDisplayName()),1),l("span",nt,[f(d,{icon:"fa-solid fa-angle-down"})])])]}),_:1})])}var ct=E(tt,[["render",dt],["__scopeId","data-v-7befff3e"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/ModelSelector2.vue"]]);const ut=S({name:"ConversationIntroductionItem",components:{FontAwesomeIcon:R},props:{content:{type:String,required:!0},icon:{type:String,required:!0},color:{type:String,default:"rgb(0, 0, 0)"}},data(){return{}},computed:{}}),pt={class:"item"},ht={class:"icon"},mt={class:"content"};function _t(e,t,a,m,w,o){const d=i("font-awesome-icon");return n(),p("div",pt,[l("div",ht,[f(d,{icon:e.icon,style:V({color:e.color})},null,8,["icon","style"])]),l("div",mt,b(e.content),1)])}var ft=E(ut,[["render",_t],["__scopeId","data-v-bc919b38"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/IntroductionItem.vue"]]);const gt=S({name:"ConversationIntroduction",components:{IntroductionItem:ft,ElRow:Ne,ElCol:De},emits:["draft"],data(){return{items:[{icon:"fa-solid fa-pen-nib",content:this.$t("chat.message.question1"),color:"rgb(226, 197, 65)"},{icon:"fa-solid fa-laptop-code",content:this.$t("chat.message.question2"),color:"rgb(203, 139, 208)"},{icon:"fa-solid fa-fan",content:this.$t("chat.message.question3"),color:"rgb(118, 208, 235)"},{icon:"fa-solid fa-plane-departure",content:this.$t("chat.message.question4"),color:"rgb(237, 98, 98)"}].sort(()=>Math.random()-.5)}},computed:{}}),$t={class:"introduction"};function yt(e,t,a,m,w,o){const d=i("introduction-item"),c=i("el-col"),_=i("el-row");return n(),p("div",$t,[f(_,{class:"items",justify:"center",gutter:15},{default:C(()=>[(n(!0),p(I,null,D(e.items,(r,h)=>(n(),g(c,{key:h,md:6,sm:12,xs:12},{default:C(()=>[f(d,{content:r.content,icon:r.icon,color:r.color,class:"cursor-pointer",onClick:s=>e.$emit("draft",r.content)},null,8,["content","icon","color","onClick"])]),_:2},1024))),128))]),_:1})])}var wt=E(gt,[["render",yt],["__scopeId","data-v-52040931"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/Introduction.vue"]]);const kt=S({name:"SidePanel",components:{ElInput:Ae,FontAwesomeIcon:R,ElSkeleton:Oe},props:{},emits:["click"],computed:{conversationId(){var e,t;return(t=(e=this.$route.params)==null?void 0:e.id)==null?void 0:t.toString()},conversationGroups(){var d,c,_,r,h,s,y,v;const e=this.$store.state.chat.conversations,t=new Date;t.setHours(0,0,0,0);const a=new Date(t);a.setDate(a.getDate()-1);const m=new Date(t);m.setDate(m.getDate()-t.getDay());const w=new Date(m);w.setDate(w.getDate()-7);const o=e==null?void 0:e.reduce((u,$)=>{const M=new Date($.updated_at*1e3);return M>=t?u.today.push($):M>=a?u.yesterday.push($):M>=m?u.thisWeek.push($):u.earlier.push($),u},{today:[],yesterday:[],thisWeek:[],earlier:[]});return A(A(A(A({},((d=o==null?void 0:o.today)==null?void 0:d.length)>0?{today:(c=o==null?void 0:o.today)==null?void 0:c.sort((u,$)=>$.updated_at-u.updated_at)}:{}),((_=o==null?void 0:o.yesterday)==null?void 0:_.length)>0?{yesterday:(r=o==null?void 0:o.yesterday)==null?void 0:r.sort((u,$)=>$.updated_at-u.updated_at)}:{}),((h=o==null?void 0:o.thisWeek)==null?void 0:h.length)>0?{thisWeek:(s=o==null?void 0:o.thisWeek)==null?void 0:s.sort((u,$)=>$.updated_at-u.updated_at)}:{}),((y=o==null?void 0:o.earlier)==null?void 0:y.length)>0?{earlier:(v=o==null?void 0:o.earlier)==null?void 0:v.sort((u,$)=>$.updated_at-u.updated_at)}:{})},application(){return this.$store.state.chat.application},loading(){return this.$store.state.chat.status.getConversations===G.Request},token(){var e,t;return(t=(e=this.$store.state.chat)==null?void 0:e.credential)==null?void 0:t.token}},methods:{async onNewConversation(){this.$router.push({name:Q})},async onConfirm(e){const t=this.token;if(!t){console.error("Token is not found");return}e!=null&&e.deleting?(await L.deleteConversation(e.id,{token:t}),await this.$store.dispatch("chat/getConversations")):e!=null&&e.editing?(await L.updateConversation(e,{token:t}),await this.$store.dispatch("chat/getConversations")):e.editing=!0},onClick(e){!e||(this.$router.push({name:Y,params:{id:e}}),this.$emit("click",e))}}}),vt={class:"panel"},Ct={key:1,class:"conversations"},bt={class:"icons"},Et={class:"title"},St={class:"key"},It=["onClick"],Nt={class:"title"},Dt={key:0},At={key:1},Ot={key:2},Rt={class:"operations"};function Tt(e,t,a,m,w,o){const d=i("el-skeleton"),c=i("font-awesome-icon"),_=i("el-input");return n(),p("div",vt,[e.loading&&e.conversationGroups===void 0?(n(),g(d,{key:0})):(n(),p("div",Ct,[l("div",{class:"conversation",onClick:t[0]||(t[0]=(...r)=>e.onNewConversation&&e.onNewConversation(...r))},[l("div",bt,[f(c,{icon:"fa-solid fa-plus",class:"icon"})]),l("div",Et,b(e.$t("chat.message.startNewChat")),1)]),(n(!0),p(I,null,D(e.conversationGroups,(r,h)=>(n(),p("div",{key:h,class:"group"},[l("div",St,b(e.$t(`chat.group.${h}`)),1),(n(!0),p(I,null,D(r,(s,y)=>{var v;return n(),p("div",{key:y,class:q({conversation:!0,active:s.id===e.conversationId}),onClick:u=>e.onClick(s.id)},[l("div",Nt,[s!=null&&s.deleting?(n(),p("span",Dt,b(`${e.$t("chat.message.confirmDelete")}?`),1)):s!=null&&s.editing?(n(),p("span",At,[f(_,{modelValue:s.title,"onUpdate:modelValue":u=>s.title=u,onKeydown:X(u=>e.onConfirm(s),["enter"])},null,8,["modelValue","onUpdate:modelValue","onKeydown"])])):(s==null?void 0:s.title)||(s==null?void 0:s.messages)?(n(),p("span",Ot,b((s==null?void 0:s.title)||((v=s==null?void 0:s.messages[(s==null?void 0:s.messages.length)-1])==null?void 0:v.content)),1)):k("v-if",!0)]),l("div",Rt,[!(s!=null&&s.editing)&&!s.deleting?(n(),g(c,{key:0,icon:"fa-solid fa-edit",class:"icon icon-edit",onClick:O(u=>s.editing=!0,["stop"])},null,8,["onClick"])):k("v-if",!0),!(s!=null&&s.editing)&&!s.deleting?(n(),g(c,{key:1,icon:"fa-solid fa-trash",class:"icon icon-delete",onClick:O(u=>s.deleting=!0,["stop"])},null,8,["onClick"])):k("v-if",!0),(s==null?void 0:s.editing)||s.deleting?(n(),g(c,{key:2,icon:"fa-solid fa-check",class:"icon icon-confirm",onClick:O(u=>e.onConfirm(s),["stop"])},null,8,["onClick"])):k("v-if",!0),(s==null?void 0:s.editing)||s.deleting?(n(),g(c,{key:3,icon:"fa-solid fa-xmark",class:"icon icon-cancel",onClick:O(u=>{s.editing=!1,s.deleting=!1},["stop"])},null,8,["onClick"])):k("v-if",!0)])],10,It)}),128))]))),128))]))])}var qt=E(kt,[["render",Tt],["__scopeId","data-v-d866c834"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/SidePanel.vue"]]);const Mt=S({name:"LayoutChat",components:{SidePanel:qt,ElDrawer:Re,ElButton:te,FontAwesomeIcon:R},data(){return{drawer:!1}}}),Ut={class:"main"},Gt={class:"side"},Lt={class:"chat"};function Vt(e,t,a,m,w,o){const d=i("side-panel"),c=i("font-awesome-icon"),_=i("el-button"),r=i("el-drawer");return n(),p("div",Ut,[l("div",Gt,[x(e.$slots,"side",{},()=>[f(d)],!0)]),l("div",Lt,[x(e.$slots,"chat",{},void 0,!0)]),f(_,{round:"",class:"menu",onClick:t[0]||(t[0]=h=>e.drawer=!0)},{default:C(()=>[f(c,{icon:"fa-solid fa-bars",class:"icon-menu"})]),_:1}),f(r,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=h=>e.drawer=h),"with-header":!1,size:"290px",class:"drawer"},{default:C(()=>[f(d)]),_:1},8,["modelValue"])])}var Bt=E(Mt,[["render",Vt],["__scopeId","data-v-8d7a06d2"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Chat.vue"]]);const Ht=S({name:"ChatConversation",components:{InputBox:et,Introduction:wt,ModelSelector2:ct,Message:xe,ApplicationStatus:$e,Layout:Bt},data(){var e,t;return{question:"",references:[],answering:!1,messages:((t=(e=this.$store.state.chat.conversations)==null?void 0:e.find(a=>{var m;return a.id===((m=this.$route.params.id)==null?void 0:m.toString())}))==null?void 0:t.messages)||[]}},computed:{model(){return this.$store.state.chat.model},conversationId(){var e;return(e=this.$route.params.id)==null?void 0:e.toString()},conversation(){var e;return(e=this.$store.state.chat.conversations)==null?void 0:e.find(t=>t.id===this.conversationId)},service(){return this.$store.state.chat.service},application(){return this.$store.state.chat.application},credential(){var e;return(e=this.$store.state.chat)==null?void 0:e.credential},needApply(){return this.$store.state.chat.status.getApplication===G.Success&&!this.application},conversations(){return this.$store.state.chat.conversations},initializing(){return this.$store.state.chat.status.getApplication===G.Request}},watch:{model(e){e&&this.onModelChanged()},conversationId(e){var t,a;e?(this.messages=((a=(t=this.conversations)==null?void 0:t.find(m=>m.id===e))==null?void 0:a.messages)||[],this.onScrollDown()):this.messages=[]}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onGetConversations(),await this.onScrollDown()},methods:{async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("chat/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("chat/getApplication"),console.debug("end onGetApplication")},async onGetConversations(){console.debug("start onGetConversations"),await this.$store.dispatch("chat/getConversations"),console.debug("end onGetConversations")},async onDraft(e){this.question=e,this.onSubmit()},async onCreateNewConversation(){await this.$router.push({name:Q})},async onModelChanged(){await this.onCreateNewConversation(),await this.$store.dispatch("chat/getApplication")},async onSubmit(){if(this.references.length>0){let e=[];e.push({type:"text",text:this.question});for(let t=0;t<this.references.length;t++)e.push({type:"image_url",image_url:this.references[t]});this.messages.push({content:e,role:j})}else this.messages.push({content:this.question,role:j});console.debug("onSubmit",this.question,this.references),await this.onFetchAnswer()},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".dialogue");!e||!this.messages||this.messages.length===0||(e.scrollTop=e==null?void 0:e.scrollHeight)},0)},async onFetchAnswer(){var w;const e=(w=this.credential)==null?void 0:w.token,t=this.question,a=this.references;if(console.debug("validated",t,a),this.question="",this.references=[],!e||!t){console.error("no token or endpoint or question"),this.messages.push({error:{code:ee},role:T,state:N.FAILED});return}let m=this.conversationId;this.messages.push({content:"",role:T,state:N.PENDING}),console.debug("start to get answer",this.messages),this.onScrollDown(),this.answering=!0,L.chatConversation({question:t,model:this.model.name,references:a,id:this.conversationId,stateful:!0},{token:e,stream:o=>{console.debug("stream response",o),this.messages[this.messages.length-1]={role:T,content:o.answer,state:N.ANSWERING},m=o==null?void 0:o.id,this.onScrollDown()}}).then(async()=>{console.debug("finished fetch answer",this.messages),this.messages[this.messages.length-1].state=N.FINISHED,await this.$store.dispatch("chat/setConversation",{id:m,messages:this.messages}),this.answering=!1,this.conversationId||await this.$router.push({name:Y,params:{id:m}}),this.onScrollDown(),await this.$store.dispatch("chat/getConversations"),await this.$store.dispatch("chat/getApplication")}).catch(o=>{var d,c;if(this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].state=N.FAILED),console.error(o),ae.isCancel(o))this.messages[this.messages.length-1].error={code:ye};else if((d=o==null?void 0:o.response)!=null&&d.data){let _=(c=o==null?void 0:o.response)==null?void 0:c.data;Te(_)&&(_=JSON.parse(_)),this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].error=_.error)}else this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].error={code:Z});this.answering=!1})}}}),Pt={class:"dialogue"},Wt={key:1,class:"messages"},zt={class:"bottom"};function Ft(e,t,a,m,w,o){const d=i("model-selector2"),c=i("application-status"),_=i("introduction"),r=i("message"),h=i("input-box"),s=i("layout");return n(),g(s,null,{chat:C(()=>[f(d,{class:"selector"}),f(c,{initializing:e.initializing,application:e.application,"need-apply":e.needApply,service:e.service,onRefresh:t[0]||(t[0]=y=>e.$store.dispatch("chat/getApplication"))},null,8,["initializing","application","need-apply","service"]),l("div",Pt,[e.messages.length===0?(n(),g(_,{key:0,onDraft:e.onDraft},null,8,["onDraft"])):(n(),p("div",Wt,[(n(!0),p(I,null,D(e.messages,(y,v)=>(n(),g(r,{key:v,message:y,application:e.application,class:"message"},null,8,["message","application"]))),128))]))]),l("div",zt,[f(h,{disabled:e.answering,question:e.question,references:e.references,"onUpdate:question":t[1]||(t[1]=y=>e.question=y),"onUpdate:references":t[2]||(t[2]=y=>e.references=y),onSubmit:e.onSubmit},null,8,["disabled","question","references","onSubmit"])])]),_:1})}var as=E(Ht,[["render",Ft],["__scopeId","data-v-3ab2fb26"],["__file","/home/runner/work/Nexior/Nexior/src/pages/chat/Conversation.vue"]]);export{as as default};
|
|
1
|
+
var se=Object.defineProperty;var B=Object.getOwnPropertySymbols;var oe=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable;var H=(e,t,a)=>t in e?se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,A=(e,t)=>{for(var a in t||(t={}))oe.call(t,a)&&H(e,a,t[a]);if(B)for(var a of B(t))ne.call(t,a)&&H(e,a,t[a]);return e};import{a as ae}from"./vendor-axios.168e6950.js";import{H as ie}from"./vendor-others.6e08baf0.js";import{_ as E,I as N,x as T,u as re,y as le,C as U,z as P,A as W,D as z,E as F,F as G,d as Q,G as L,e as Y,H as j}from"./index.3ae4a354.js";import{H as S,o as n,e as p,al as i,f as l,L as g,S as k,W as I,ai as D,M as C,T as de,U as b,Q as q,V as f,O as ce,aw as ue,a0 as V,as as X,$ as O,I as x}from"./vendor-@vue.8e552cf2.js";import{M as pe,E as Z,a as ee,b as he,c as me,d as _e,e as fe,f as ge,g as K,A as $e,h as ye}from"./Status.46275dcf.js";import{C as we}from"./CopyToClipboard.a77675ce.js";import{x as ke,d as te,q as ve,e as Ce,H as be,G as J,I as Ee,J as Se,K as Ie,j as Ne,k as De,L as Ae,u as Oe,M as Re}from"./vendor-element-plus.97860c23.js";import{af as R}from"./vendor-fortawesome.46d238d8.js";import{i as Te}from"./is.dd611415.js";import"./application.ea1e2a72.js";import"./vendor-markdown.8e590d23.js";import"./vendor-highlight.js.19da0c9f.js";const qe=S({name:"AnsweringMark",data(){return{}},computed:{conversationId(){var e,t;return(t=(e=this.$route.params)==null?void 0:e.id)==null?void 0:t.toString()}}}),Me={class:"box"};function Ue(e,t,a,m,w,o){return n(),p("div",Me)}var Ge=E(qe,[["render",Ue],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/AnsweringMark.vue"]]);const Le=S({name:"Message",components:{CopyToClipboard:we,AnsweringMark:Ge,MarkdownRenderer:pe,ElAlert:ke,ElButton:te,ElImage:ve},props:{message:{type:Object,required:!0},application:{type:Object,required:!0}},emits:["stop"],data(){return{copied:!1,messageState:N}},computed:{errorText(){var e,t;if(!(!this.message.error||!((e=this.message.error)!=null&&e.code)))switch((t=this.message.error)==null?void 0:t.code){case K:return this.$t("chat.message.errorUsedUp");case ge:return this.$t("chat.message.errorApiError");case fe:return this.$t("chat.message.errorBadRequest");case _e:return this.$t("chat.message.errorTimeout");case me:return this.$t("chat.message.errorTooManyRequests");case he:return this.$t("chat.message.errorContentTooLarge");case ee:return this.$t("chat.message.errorNotApplied");case Z:default:return this.$t("chat.message.errorUnknown")}},showBuyMore(){var e;return this.message.role===T&&((e=this.message.error)==null?void 0:e.code)===K}},methods:{onCopy(){ie(this.message.content.toString(),{debug:!0}),this.copied=!0,setTimeout(()=>{this.copied=!1},3e3)},onBuyMore(){var e;this.$router.push({name:re,params:{id:(e=this.application)==null?void 0:e.id}})}}}),Ve=["role"],Be={class:"author"},He={class:"main"},Pe={class:"content"},We={key:1},ze=["src"],Fe={class:"operations"};function je(e,t,a,m,w,o){var y;const d=i("el-image"),c=i("markdown-renderer"),_=i("answering-mark"),r=i("copy-to-clipboard"),h=i("el-alert"),s=i("el-button");return n(),p("div",{class:q({message:!0,[e.message.role]:!0,hidden:e.errorText&&e.message.role==="assistant"}),role:e.message.role},[l("div",Be,[e.message.role==="assistant"?(n(),g(d,{key:0,src:"https://cdn.acedata.cloud/7dljuv.png",fit:"cover",class:"avatar"})):k("v-if",!0)]),l("div",He,[l("div",Pe,[Array.isArray(e.message.content)?(n(),p("div",We,[(n(!0),p(I,null,D(e.message.content,(v,u)=>{var $;return n(),p("div",{key:u},[v.type==="image_url"?(n(),p("img",{key:0,src:($=v.image_url)==null?void 0:$.url,fit:"cover",class:"image"},null,8,ze)):k("v-if",!0),v.type==="text"?(n(),g(c,{key:u,content:v.text},null,8,["content"])):k("v-if",!0)])}),128))])):(n(),g(c,{key:0,content:(y=e.message)==null?void 0:y.content},null,8,["content"])),e.message.state===e.messageState.PENDING?(n(),g(_,{key:2})):k("v-if",!0)]),l("div",Fe,[Array.isArray(e.message.content)?k("v-if",!0):(n(),g(r,{key:0,content:e.message.content,class:"btn-copy"},null,8,["content"]))])]),e.errorText?(n(),g(h,{key:0,class:"error",title:e.errorText,type:"error",closable:!1},null,8,["title"])):k("v-if",!0),e.showBuyMore?(n(),g(s,{key:1,round:"",type:"primary",class:"btn btn-buy",size:"small",onClick:e.onBuyMore},{default:C(()=>[de(b(e.$t("common.button.buyMore")),1)]),_:1},8,["onClick"])):k("v-if",!0)],10,Ve)}var xe=E(Le,[["render",je],["__scopeId","data-v-f0476f80"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/Message.vue"]]);const Ke=S({name:"InputBox",components:{ElTooltip:Ce,FontAwesomeIcon:R,ElUpload:be},props:{disabled:{type:Boolean,required:!1,default:!1},references:{type:Array,required:!1,default:()=>[]},question:{type:String,required:!0}},emits:["update:question","update:references","submit"],data(){return{inputHeight:"35px",questionValue:this.question,fileList:[],uploadUrl:le()+"/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})},canUpload(){return[U.name].includes(this.model.name)},model(){return this.$store.state.chat.model}},watch:{urls(e){this.$emit("update:references",e)},questionValue(e){this.$emit("update:question",e)},question(e){e!==this.questionValue&&(this.questionValue=e)},references(e){e.length===0&&(this.fileList=[])}},methods:{adjustTextareaHeight(){this.$nextTick(()=>{const e=this.$refs.textarea;e&&(e.style.height="35px",e.style.height=e.scrollHeight+"px")})},onSubmit(){!this.question||this.$emit("submit")},onExceed(){J.warning(this.$t("chat.message.uploadReferencesExceed"))},onError(){J.error(this.$t("chat.message.uploadReferencesError"))}}}),Je={class:"input-box"},Qe={class:"btn btn-upload"},Ye=["disabled","placeholder"],Xe={class:"info"};function Ze(e,t,a,m,w,o){const d=i("font-awesome-icon"),c=i("el-tooltip"),_=i("el-upload");return n(),p(I,null,[l("div",Je,[f(_,{"file-list":e.fileList,"onUpdate:file-list":t[0]||(t[0]=r=>e.fileList=r),class:q({upload:!0,disabled:!e.canUpload}),disabled:!e.canUpload,name:"file","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,headers:e.headers},{default:C(()=>[f(c,{class:"box-item",effect:"dark",content:e.$t("chat.message.uploadFile"),placement:"top"},{default:C(()=>[l("span",Qe,[f(d,{icon:"fa-solid fa-paperclip",class:"icon icon-attachment"})])]),_:1},8,["content"])]),_:1},8,["file-list","class","disabled","action","on-exceed","on-error","headers"]),l("span",{class:q({btn:!0,"btn-send":!0,disabled:!e.questionValue}),onClick:t[1]||(t[1]=(...r)=>e.onSubmit&&e.onSubmit(...r))},[f(d,{icon:"fa-solid fa-location-arrow",class:"icon icon-send"})],2),k(" add this textarea "),ce(l("textarea",{ref:"textarea","onUpdate:modelValue":t[2]||(t[2]=r=>e.questionValue=r),disabled:e.disabled,class:"input",placeholder:e.$t("chat.message.newMessagePlaceholder"),style:V({height:e.inputHeight}),onKeydown:t[3]||(t[3]=X(O((...r)=>e.onSubmit&&e.onSubmit(...r),["exact","prevent"]),["enter"])),onInput:t[4]||(t[4]=(...r)=>e.adjustTextareaHeight&&e.adjustTextareaHeight(...r))},null,44,Ye),[[ue,e.questionValue]])]),l("p",Xe,b(e.$t("chat.message.howToUse")),1)],64)}var et=E(Ke,[["render",Ze],["__scopeId","data-v-020f4eb8"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/InputBox.vue"]]);const tt=S({name:"ModelSelector",components:{ElDropdown:Ee,ElDropdownMenu:Se,ElDropdownItem:Ie,FontAwesomeIcon:R},emits:["update:modelValue","select"],data(){return{options:[{icon:"fa-solid fa-bolt",color:"#ff9900",model:P},{icon:"fa-solid fa-bolt",color:"#ff9900",model:W},{icon:"fa-solid fa-wand-magic-sparkles",color:"#ce65e6",model:z},{icon:"fa-solid fa-wand-magic-sparkles",color:"#ce65e6",model:F},{icon:"fa-solid fa-wand-magic-sparkles",color:"#ce65e6",model:U}]}},computed:{model(){const e=this.$store.state.chat.model.name;return[P,W,z,F,U].find(a=>a.name===e)}},methods:{onCommandChange(e){this.$emit("select",e),this.$store.dispatch("chat/setModel",e)}}}),st={class:"selector"},ot={class:"name"},nt={class:"angle"},at={class:"item"},it={class:"info"},rt={class:"name"},lt={class:"description"};function dt(e,t,a,m,w,o){const d=i("font-awesome-icon"),c=i("el-dropdown-item"),_=i("el-dropdown-menu"),r=i("el-dropdown");return n(),p("div",st,[f(r,{trigger:"click","popper-class":"popper"},{dropdown:C(()=>[f(_,null,{default:C(()=>[(n(!0),p(I,null,D(e.options,(h,s)=>(n(),g(c,{key:s,onClick:y=>e.onCommandChange(h.model)},{default:C(()=>[l("div",at,[l("div",{class:"icon",style:V({color:h.color})},[f(d,{icon:h.icon},null,8,["icon"])],4),l("div",it,[l("p",rt,b(h.model.getDisplayName()),1),l("p",lt,b(h.model.getDescription()),1)])])]),_:2},1032,["onClick"]))),128))]),_:1})]),default:C(()=>{var h;return[l("div",null,[l("span",ot,b((h=e.model)==null?void 0:h.getDisplayName()),1),l("span",nt,[f(d,{icon:"fa-solid fa-angle-down"})])])]}),_:1})])}var ct=E(tt,[["render",dt],["__scopeId","data-v-7befff3e"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/ModelSelector2.vue"]]);const ut=S({name:"ConversationIntroductionItem",components:{FontAwesomeIcon:R},props:{content:{type:String,required:!0},icon:{type:String,required:!0},color:{type:String,default:"rgb(0, 0, 0)"}},data(){return{}},computed:{}}),pt={class:"item"},ht={class:"icon"},mt={class:"content"};function _t(e,t,a,m,w,o){const d=i("font-awesome-icon");return n(),p("div",pt,[l("div",ht,[f(d,{icon:e.icon,style:V({color:e.color})},null,8,["icon","style"])]),l("div",mt,b(e.content),1)])}var ft=E(ut,[["render",_t],["__scopeId","data-v-bc919b38"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/IntroductionItem.vue"]]);const gt=S({name:"ConversationIntroduction",components:{IntroductionItem:ft,ElRow:Ne,ElCol:De},emits:["draft"],data(){return{items:[{icon:"fa-solid fa-pen-nib",content:this.$t("chat.message.question1"),color:"rgb(226, 197, 65)"},{icon:"fa-solid fa-laptop-code",content:this.$t("chat.message.question2"),color:"rgb(203, 139, 208)"},{icon:"fa-solid fa-fan",content:this.$t("chat.message.question3"),color:"rgb(118, 208, 235)"},{icon:"fa-solid fa-plane-departure",content:this.$t("chat.message.question4"),color:"rgb(237, 98, 98)"}].sort(()=>Math.random()-.5)}},computed:{}}),$t={class:"introduction"};function yt(e,t,a,m,w,o){const d=i("introduction-item"),c=i("el-col"),_=i("el-row");return n(),p("div",$t,[f(_,{class:"items",justify:"center",gutter:15},{default:C(()=>[(n(!0),p(I,null,D(e.items,(r,h)=>(n(),g(c,{key:h,md:6,sm:12,xs:12},{default:C(()=>[f(d,{content:r.content,icon:r.icon,color:r.color,class:"cursor-pointer",onClick:s=>e.$emit("draft",r.content)},null,8,["content","icon","color","onClick"])]),_:2},1024))),128))]),_:1})])}var wt=E(gt,[["render",yt],["__scopeId","data-v-52040931"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/Introduction.vue"]]);const kt=S({name:"SidePanel",components:{ElInput:Ae,FontAwesomeIcon:R,ElSkeleton:Oe},props:{},emits:["click"],computed:{conversationId(){var e,t;return(t=(e=this.$route.params)==null?void 0:e.id)==null?void 0:t.toString()},conversationGroups(){var d,c,_,r,h,s,y,v;const e=this.$store.state.chat.conversations,t=new Date;t.setHours(0,0,0,0);const a=new Date(t);a.setDate(a.getDate()-1);const m=new Date(t);m.setDate(m.getDate()-t.getDay());const w=new Date(m);w.setDate(w.getDate()-7);const o=e==null?void 0:e.reduce((u,$)=>{const M=new Date($.updated_at*1e3);return M>=t?u.today.push($):M>=a?u.yesterday.push($):M>=m?u.thisWeek.push($):u.earlier.push($),u},{today:[],yesterday:[],thisWeek:[],earlier:[]});return A(A(A(A({},((d=o==null?void 0:o.today)==null?void 0:d.length)>0?{today:(c=o==null?void 0:o.today)==null?void 0:c.sort((u,$)=>$.updated_at-u.updated_at)}:{}),((_=o==null?void 0:o.yesterday)==null?void 0:_.length)>0?{yesterday:(r=o==null?void 0:o.yesterday)==null?void 0:r.sort((u,$)=>$.updated_at-u.updated_at)}:{}),((h=o==null?void 0:o.thisWeek)==null?void 0:h.length)>0?{thisWeek:(s=o==null?void 0:o.thisWeek)==null?void 0:s.sort((u,$)=>$.updated_at-u.updated_at)}:{}),((y=o==null?void 0:o.earlier)==null?void 0:y.length)>0?{earlier:(v=o==null?void 0:o.earlier)==null?void 0:v.sort((u,$)=>$.updated_at-u.updated_at)}:{})},application(){return this.$store.state.chat.application},loading(){return this.$store.state.chat.status.getConversations===G.Request},token(){var e,t;return(t=(e=this.$store.state.chat)==null?void 0:e.credential)==null?void 0:t.token}},methods:{async onNewConversation(){this.$router.push({name:Q})},async onConfirm(e){const t=this.token;if(!t){console.error("Token is not found");return}e!=null&&e.deleting?(await L.deleteConversation(e.id,{token:t}),await this.$store.dispatch("chat/getConversations")):e!=null&&e.editing?(await L.updateConversation(e,{token:t}),await this.$store.dispatch("chat/getConversations")):e.editing=!0},onClick(e){!e||(this.$router.push({name:Y,params:{id:e}}),this.$emit("click",e))}}}),vt={class:"panel"},Ct={key:1,class:"conversations"},bt={class:"icons"},Et={class:"title"},St={class:"key"},It=["onClick"],Nt={class:"title"},Dt={key:0},At={key:1},Ot={key:2},Rt={class:"operations"};function Tt(e,t,a,m,w,o){const d=i("el-skeleton"),c=i("font-awesome-icon"),_=i("el-input");return n(),p("div",vt,[e.loading&&e.conversationGroups===void 0?(n(),g(d,{key:0})):(n(),p("div",Ct,[l("div",{class:"conversation",onClick:t[0]||(t[0]=(...r)=>e.onNewConversation&&e.onNewConversation(...r))},[l("div",bt,[f(c,{icon:"fa-solid fa-plus",class:"icon"})]),l("div",Et,b(e.$t("chat.message.startNewChat")),1)]),(n(!0),p(I,null,D(e.conversationGroups,(r,h)=>(n(),p("div",{key:h,class:"group"},[l("div",St,b(e.$t(`chat.group.${h}`)),1),(n(!0),p(I,null,D(r,(s,y)=>{var v;return n(),p("div",{key:y,class:q({conversation:!0,active:s.id===e.conversationId}),onClick:u=>e.onClick(s.id)},[l("div",Nt,[s!=null&&s.deleting?(n(),p("span",Dt,b(`${e.$t("chat.message.confirmDelete")}?`),1)):s!=null&&s.editing?(n(),p("span",At,[f(_,{modelValue:s.title,"onUpdate:modelValue":u=>s.title=u,onKeydown:X(u=>e.onConfirm(s),["enter"])},null,8,["modelValue","onUpdate:modelValue","onKeydown"])])):(s==null?void 0:s.title)||(s==null?void 0:s.messages)?(n(),p("span",Ot,b((s==null?void 0:s.title)||((v=s==null?void 0:s.messages[(s==null?void 0:s.messages.length)-1])==null?void 0:v.content)),1)):k("v-if",!0)]),l("div",Rt,[!(s!=null&&s.editing)&&!s.deleting?(n(),g(c,{key:0,icon:"fa-solid fa-edit",class:"icon icon-edit",onClick:O(u=>s.editing=!0,["stop"])},null,8,["onClick"])):k("v-if",!0),!(s!=null&&s.editing)&&!s.deleting?(n(),g(c,{key:1,icon:"fa-solid fa-trash",class:"icon icon-delete",onClick:O(u=>s.deleting=!0,["stop"])},null,8,["onClick"])):k("v-if",!0),(s==null?void 0:s.editing)||s.deleting?(n(),g(c,{key:2,icon:"fa-solid fa-check",class:"icon icon-confirm",onClick:O(u=>e.onConfirm(s),["stop"])},null,8,["onClick"])):k("v-if",!0),(s==null?void 0:s.editing)||s.deleting?(n(),g(c,{key:3,icon:"fa-solid fa-xmark",class:"icon icon-cancel",onClick:O(u=>{s.editing=!1,s.deleting=!1},["stop"])},null,8,["onClick"])):k("v-if",!0)])],10,It)}),128))]))),128))]))])}var qt=E(kt,[["render",Tt],["__scopeId","data-v-d866c834"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/SidePanel.vue"]]);const Mt=S({name:"LayoutChat",components:{SidePanel:qt,ElDrawer:Re,ElButton:te,FontAwesomeIcon:R},data(){return{drawer:!1}}}),Ut={class:"main"},Gt={class:"side"},Lt={class:"chat"};function Vt(e,t,a,m,w,o){const d=i("side-panel"),c=i("font-awesome-icon"),_=i("el-button"),r=i("el-drawer");return n(),p("div",Ut,[l("div",Gt,[x(e.$slots,"side",{},()=>[f(d)],!0)]),l("div",Lt,[x(e.$slots,"chat",{},void 0,!0)]),f(_,{round:"",class:"menu",onClick:t[0]||(t[0]=h=>e.drawer=!0)},{default:C(()=>[f(c,{icon:"fa-solid fa-bars",class:"icon-menu"})]),_:1}),f(r,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=h=>e.drawer=h),"with-header":!1,size:"290px",class:"drawer"},{default:C(()=>[f(d)]),_:1},8,["modelValue"])])}var Bt=E(Mt,[["render",Vt],["__scopeId","data-v-8d7a06d2"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Chat.vue"]]);const Ht=S({name:"ChatConversation",components:{InputBox:et,Introduction:wt,ModelSelector2:ct,Message:xe,ApplicationStatus:$e,Layout:Bt},data(){var e,t;return{question:"",references:[],answering:!1,messages:((t=(e=this.$store.state.chat.conversations)==null?void 0:e.find(a=>{var m;return a.id===((m=this.$route.params.id)==null?void 0:m.toString())}))==null?void 0:t.messages)||[]}},computed:{model(){return this.$store.state.chat.model},conversationId(){var e;return(e=this.$route.params.id)==null?void 0:e.toString()},conversation(){var e;return(e=this.$store.state.chat.conversations)==null?void 0:e.find(t=>t.id===this.conversationId)},service(){return this.$store.state.chat.service},application(){return this.$store.state.chat.application},credential(){var e;return(e=this.$store.state.chat)==null?void 0:e.credential},needApply(){return this.$store.state.chat.status.getApplication===G.Success&&!this.application},conversations(){return this.$store.state.chat.conversations},initializing(){return this.$store.state.chat.status.getApplication===G.Request}},watch:{model(e){e&&this.onModelChanged()},conversationId(e){var t,a;e?(this.messages=((a=(t=this.conversations)==null?void 0:t.find(m=>m.id===e))==null?void 0:a.messages)||[],this.onScrollDown()):this.messages=[]}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onGetConversations(),await this.onScrollDown()},methods:{async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("chat/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("chat/getApplication"),console.debug("end onGetApplication")},async onGetConversations(){console.debug("start onGetConversations"),await this.$store.dispatch("chat/getConversations"),console.debug("end onGetConversations")},async onDraft(e){this.question=e,this.onSubmit()},async onCreateNewConversation(){await this.$router.push({name:Q})},async onModelChanged(){await this.onCreateNewConversation(),await this.$store.dispatch("chat/getApplication")},async onSubmit(){if(this.references.length>0){let e=[];e.push({type:"text",text:this.question});for(let t=0;t<this.references.length;t++)e.push({type:"image_url",image_url:this.references[t]});this.messages.push({content:e,role:j})}else this.messages.push({content:this.question,role:j});console.debug("onSubmit",this.question,this.references),await this.onFetchAnswer()},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".dialogue");!e||!this.messages||this.messages.length===0||(e.scrollTop=e==null?void 0:e.scrollHeight)},0)},async onFetchAnswer(){var w;const e=(w=this.credential)==null?void 0:w.token,t=this.question,a=this.references;if(console.debug("validated",t,a),this.question="",this.references=[],!e||!t){console.error("no token or endpoint or question"),this.messages.push({error:{code:ee},role:T,state:N.FAILED});return}let m=this.conversationId;this.messages.push({content:"",role:T,state:N.PENDING}),console.debug("start to get answer",this.messages),this.onScrollDown(),this.answering=!0,L.chatConversation({question:t,model:this.model.name,references:a,id:this.conversationId,stateful:!0},{token:e,stream:o=>{console.debug("stream response",o),this.messages[this.messages.length-1]={role:T,content:o.answer,state:N.ANSWERING},m=o==null?void 0:o.id,this.onScrollDown()}}).then(async()=>{console.debug("finished fetch answer",this.messages),this.messages[this.messages.length-1].state=N.FINISHED,await this.$store.dispatch("chat/setConversation",{id:m,messages:this.messages}),this.answering=!1,this.conversationId||await this.$router.push({name:Y,params:{id:m}}),this.onScrollDown(),await this.$store.dispatch("chat/getConversations"),await this.$store.dispatch("chat/getApplication")}).catch(o=>{var d,c;if(this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].state=N.FAILED),console.error(o),ae.isCancel(o))this.messages[this.messages.length-1].error={code:ye};else if((d=o==null?void 0:o.response)!=null&&d.data){let _=(c=o==null?void 0:o.response)==null?void 0:c.data;Te(_)&&(_=JSON.parse(_)),this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].error=_.error)}else this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].error={code:Z});this.answering=!1})}}}),Pt={class:"dialogue"},Wt={key:1,class:"messages"},zt={class:"bottom"};function Ft(e,t,a,m,w,o){const d=i("model-selector2"),c=i("application-status"),_=i("introduction"),r=i("message"),h=i("input-box"),s=i("layout");return n(),g(s,null,{chat:C(()=>[f(d,{class:"selector"}),f(c,{initializing:e.initializing,application:e.application,"need-apply":e.needApply,service:e.service,onRefresh:t[0]||(t[0]=y=>e.$store.dispatch("chat/getApplication"))},null,8,["initializing","application","need-apply","service"]),l("div",Pt,[e.messages.length===0?(n(),g(_,{key:0,onDraft:e.onDraft},null,8,["onDraft"])):(n(),p("div",Wt,[(n(!0),p(I,null,D(e.messages,(y,v)=>(n(),g(r,{key:v,message:y,application:e.application,class:"message"},null,8,["message","application"]))),128))]))]),l("div",zt,[f(h,{disabled:e.answering,question:e.question,references:e.references,"onUpdate:question":t[1]||(t[1]=y=>e.question=y),"onUpdate:references":t[2]||(t[2]=y=>e.references=y),onSubmit:e.onSubmit},null,8,["disabled","question","references","onSubmit"])])]),_:1})}var as=E(Ht,[["render",Ft],["__scopeId","data-v-3ab2fb26"],["__file","/home/runner/work/Nexior/Nexior/src/pages/chat/Conversation.vue"]]);export{as as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{H as F}from"./vendor-others.6e08baf0.js";import{L as P}from"./Chatdoc.b051942b.js";import{X as H,Y as b,h as T,_ as k,x as N,F as O,H as z,Z as S}from"./index.5834f7b9.js";import{a as G}from"./vendor-axios.168e6950.js";import{M as K,E as q,a as D,b as W,c as Q,d as x,e as J,f as Y,g as A,A as j,h as X}from"./Status.46c21bb1.js";import{i as Z}from"./is.dd611415.js";import{af as V}from"./vendor-fortawesome.46d238d8.js";import{L as M,u as ee,x as se,d as te}from"./vendor-element-plus.97860c23.js";import{H as E,al as l,o,e as c,L as h,f as i,V as m,U as I,W as R,ai as U,Q as v,as as B,S as f,$ as C,M as L,T as oe}from"./vendor-@vue.8e552cf2.js";import{C as ie}from"./CopyToClipboard.de4a0d29.js";import"./application.ea1e2a72.js";import"./vendor-markdown.8e590d23.js";import"./vendor-highlight.js.19da0c9f.js";var $=(e=>(e.PENDING="pending",e.ANSWERING="answering",e.FINISHED="finished",e.FAILED="failed",e))($||{});const ne=E({name:"SidePanel",components:{ElInput:M,FontAwesomeIcon:V,ElSkeleton:ee},props:{},emits:["click"],computed:{repositoryId(){var e,t;return(t=(e=this.$route.params)==null?void 0:e.repositoryId)==null?void 0:t.toString()},conversationId(){var e,t;return(t=(e=this.$route.params)==null?void 0:e.conversationId)==null?void 0:t.toString()},repository(){var e,t,n;return(n=(t=(e=this.$store.state)==null?void 0:e.chatdoc)==null?void 0:t.repositories)==null?void 0:n.find(d=>d.id===this.repositoryId)},conversations(){var e;return(e=this.repository)==null?void 0:e.conversations},application(){return this.$store.state.chatdoc.application}},methods:{async onNewConversation(){this.$router.push({name:H,params:{repositoryId:this.repositoryId}})},async onConfirm(e){e!=null&&e.deleting?(await b.deleteConversation(e.id),await this.$store.dispatch("chat/getConversations")):e!=null&&e.editing?(await b.updateConversation(e),await this.$store.dispatch("chat/getConversations")):e.editing=!0},onClick(e){!e||(this.$router.push({name:T,params:{repositoryId:this.repositoryId,conversationId:e}}),this.$emit("click",e))}}}),ae={class:"panel"},re={key:1,class:"conversations"},le={class:"icons"},de={class:"title"},ce=["onClick"],ue={class:"icons"},pe={class:"title"},he={key:0},me={key:1},_e={key:2},ge={class:"operations"};function fe(e,t,n,d,r,y){const u=l("el-skeleton"),a=l("font-awesome-icon"),_=l("el-input");return o(),c("div",ae,[e.conversations===void 0?(o(),h(u,{key:0})):(o(),c("div",re,[i("div",{class:"conversation",onClick:t[0]||(t[0]=(...s)=>e.onNewConversation&&e.onNewConversation(...s))},[i("div",le,[m(a,{icon:"fa-solid fa-plus",class:"icon"})]),i("div",de,I(e.$t("chatdoc.message.startNewChat")),1)]),(o(!0),c(R,null,U(e.conversations,(s,w)=>{var p;return o(),c("div",{key:w,class:v({conversation:!0,active:s.id===e.conversationId}),onClick:g=>e.onClick(s.id)},[i("div",ue,[m(a,{icon:"fa-regular fa-comment",class:"icon"})]),i("div",pe,[s!=null&&s.deleting?(o(),c("span",he,I(`${e.$t("chatdoc.message.confirmDelete")}?`),1)):s!=null&&s.editing?(o(),c("span",me,[m(_,{modelValue:s.title,"onUpdate:modelValue":g=>s.title=g,onKeydown:B(g=>e.onConfirm(s),["enter"])},null,8,["modelValue","onUpdate:modelValue","onKeydown"])])):(s==null?void 0:s.title)||(s==null?void 0:s.messages)?(o(),c("span",_e,I((s==null?void 0:s.title)||((p=s==null?void 0:s.messages[(s==null?void 0:s.messages.length)-1])==null?void 0:p.content)),1)):f("v-if",!0)]),i("div",ge,[!(s!=null&&s.editing)&&!s.deleting?(o(),h(a,{key:0,icon:"fa-solid fa-edit",class:"icon icon-edit",onClick:C(g=>s.editing=!0,["stop"])},null,8,["onClick"])):f("v-if",!0),!(s!=null&&s.editing)&&!s.deleting?(o(),h(a,{key:1,icon:"fa-solid fa-trash",class:"icon icon-delete",onClick:C(g=>s.deleting=!0,["stop"])},null,8,["onClick"])):f("v-if",!0),(s==null?void 0:s.editing)||s.deleting?(o(),h(a,{key:2,icon:"fa-solid fa-check",class:"icon icon-confirm",onClick:C(g=>e.onConfirm(s),["stop"])},null,8,["onClick"])):f("v-if",!0),(s==null?void 0:s.editing)||s.deleting?(o(),h(a,{key:3,icon:"fa-solid fa-xmark",class:"icon icon-cancel",onClick:C(g=>{s.editing=!1,s.deleting=!1},["stop"])},null,8,["onClick"])):f("v-if",!0)])],10,ce)}),128))]))])}var ye=k(ne,[["render",fe],["__scopeId","data-v-2282a6e1"],["__file","/home/runner/work/Nexior/Nexior/src/components/chatdoc/Conversations.vue"]]);const $e=E({name:"AnsweringMark",data(){return{}},computed:{conversationId(){var e,t;return(t=(e=this.$route.params)==null?void 0:e.conversationId)==null?void 0:t.toString()}}}),we={class:"box"};function Ce(e,t,n,d,r,y){return o(),c("div",we)}var Ie=k($e,[["render",Ce],["__file","/home/runner/work/Nexior/Nexior/src/components/chatdoc/AnsweringMark.vue"]]);const ke=E({name:"Message",components:{CopyToClipboard:ie,AnsweringMark:Ie,MarkdownRenderer:K,ElAlert:se,ElButton:te},props:{message:{type:Object,required:!0}},emits:["stop"],data(){return{copied:!1,messageState:$}},computed:{errorText(){var e,t;if(!(!this.message.error||!((e=this.message.error)!=null&&e.code)))switch((t=this.message.error)==null?void 0:t.code){case A:return this.$t("chatdoc.message.errorUsedUp");case Y:return this.$t("chatdoc.message.errorApiError");case J:return this.$t("chatdoc.message.errorBadRequest");case x:return this.$t("chatdoc.message.errorTimeout");case Q:return this.$t("chatdoc.message.errorTooManyRequests");case W:return this.$t("chatdoc.message.errorContentTooLarge");case D:return this.$t("chatdoc.message.errorNotApplied");case q:default:return this.$t("chatdoc.message.errorUnknown")}},showBuyMore(){var e;return this.message.role===N&&((e=this.message.error)==null?void 0:e.code)===A}},methods:{onCopy(){F(this.message.content.toString(),{debug:!0}),this.copied=!0,setTimeout(()=>{this.copied=!1},3e3)},onBuyMore(){}}}),Ee=["role"],Ne={class:"content"},Re={class:"operations"};function Se(e,t,n,d,r,y){var p;const u=l("markdown-renderer"),a=l("answering-mark"),_=l("copy-to-clipboard"),s=l("el-alert"),w=l("el-button");return o(),c(R,null,[i("div",{class:v({message:!0,[e.message.role]:!0,hidden:e.errorText&&e.message.role==="assistant"}),role:e.message.role},[i("div",Ne,[m(u,{content:(p=e.message)==null?void 0:p.content},null,8,["content"]),e.message.state===e.messageState.PENDING?(o(),h(a,{key:0})):f("v-if",!0)]),i("div",Re,[m(_,{content:e.message.content,class:"btn-copy"},null,8,["content"])])],10,Ee),e.errorText?(o(),h(s,{key:0,class:"error",title:e.errorText,type:"error",closable:!1},null,8,["title"])):f("v-if",!0),e.showBuyMore?(o(),h(w,{key:1,round:"",type:"primary",class:"btn btn-buy",size:"small",onClick:e.onBuyMore},{default:L(()=>[oe(I(e.$t("common.button.buyMore")),1)]),_:1},8,["onClick"])):f("v-if",!0)],64)}var be=k(ke,[["render",Se],["__scopeId","data-v-95a62450"],["__file","/home/runner/work/Nexior/Nexior/src/components/chatdoc/Message.vue"]]);const ve=E({name:"InputBox",components:{ElInput:M,FontAwesomeIcon:V},props:{disabled:{type:Boolean,required:!1,default:!1},question:{type:String,required:!0}},emits:["update:question","submit"],data(){return{questionValue:this.question,fileList:[]}},computed:{model(){return this.$store.state.chat.model}},watch:{questionValue(e){this.$emit("update:question",e)},question(e){e!==this.questionValue&&(this.questionValue=e)},references(e){e.length===0&&(this.fileList=[])}},methods:{onSubmit(){!this.question||this.$emit("submit")}}}),Oe={class:"input-box"},Ae={class:"info"};function Te(e,t,n,d,r,y){const u=l("font-awesome-icon"),a=l("el-input");return o(),c(R,null,[i("div",Oe,[i("span",{class:v({btn:!0,"btn-send":!0,disabled:!e.question}),onClick:t[0]||(t[0]=(..._)=>e.onSubmit&&e.onSubmit(..._))},[m(u,{icon:"fa-solid fa-location-arrow",class:"icon icon-send"})],2),m(a,{modelValue:e.questionValue,"onUpdate:modelValue":t[1]||(t[1]=_=>e.questionValue=_),disabled:e.disabled,class:"input",type:"textarea",placeholder:e.$t("chat.message.newMessagePlaceholder"),onKeydown:B(C(e.onSubmit,["exact","prevent"]),["enter"])},null,8,["modelValue","disabled","placeholder","onKeydown"])]),i("p",Ae,I(e.$t("chat.message.howToUse")),1)],64)}var qe=k(ve,[["render",Te],["__scopeId","data-v-7ed35c20"],["__file","/home/runner/work/Nexior/Nexior/src/components/chatdoc/InputBox.vue"]]);const De=E({name:"ChatdocConversation",components:{Layout:P,Conversations:ye,Message:be,InputBox:qe,ApplicationStatus:j},data(){return{loading:!1,repositoryId:this.$route.params.repositoryId.toString(),answering:!1,question:""}},computed:{messages:{get(){var e,t;return((t=(e=this.conversations)==null?void 0:e.find(n=>{var d;return n.id===((d=this.$route.params.conversationId)==null?void 0:d.toString())}))==null?void 0:t.messages)||[]},set(e){console.debug("set messages",e)}},repository(){var e,t,n;return(n=(t=(e=this.$store.state)==null?void 0:e.chatdoc)==null?void 0:t.repositories)==null?void 0:n.find(d=>d.id===this.repositoryId)},conversations(){var e;return(e=this.repository)==null?void 0:e.conversations},conversationId(){var e;return(e=this.$route.params.conversationId)==null?void 0:e.toString()},application(){return this.$store.state.chatdoc.application},credential(){return this.$store.state.chatdoc.credential},needApply(){return this.$store.state.chatdoc.status.getApplication===O.Success&&!this.application},initializing(){return this.$store.state.chatdoc.status.getApplication===O.Request},service(){return this.$store.state.chatdoc.service}},async mounted(){console.debug("start get conversations"),this.loading=!0,this.$store.dispatch("chatdoc/getConversations",{repositoryId:this.repositoryId}).finally(()=>{this.loading=!1})},methods:{async onSubmit(){this.messages.push({content:this.question,role:z}),await this.onFetchAnswer()},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".dialogue");!e||!this.messages||this.messages.length===0||(e.scrollTop=e==null?void 0:e.scrollHeight)},0)},async onFetchAnswer(){var d;const e=(d=this.credential)==null?void 0:d.token,t=this.question;if(S(this.onFetchAnswer,"validated",t),this.question="",!e||!t){console.error("no token or endpoint or question"),this.messages.push({error:{code:D},role:N,state:$.FAILED});return}let n=this.conversationId;this.messages.push({content:"",role:N,state:$.PENDING}),S(this.onFetchAnswer,"start to get answer",this.messages),this.onScrollDown(),this.answering=!0,b.chatConversation({repositoryId:this.repositoryId,question:t,id:this.conversationId},{token:e,stream:r=>{this.messages[this.messages.length-1]={role:N,content:r.answer,state:$.ANSWERING},n=r.id,this.onScrollDown()}}).then(async()=>{S(this.onFetchAnswer,"finished fetch answer"),this.messages[this.messages.length-1].state=$.FINISHED,await this.$store.dispatch("chatdoc/setConversation",{id:n,messages:this.messages,repositoryId:this.repositoryId}),this.answering=!1,this.conversationId||(console.debug("push to conversation",n),await this.$router.push({name:T,params:{conversationId:n,repositoryId:this.repositoryId}})),this.onScrollDown(),await this.$store.dispatch("chatdoc/getConversations",{repositoryId:this.repositoryId})}).catch(r=>{var y,u;if(this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].state=$.FAILED),console.error(r),G.isCancel(r))this.messages[this.messages.length-1].error={code:X};else if((y=r==null?void 0:r.response)!=null&&y.data){let a=(u=r==null?void 0:r.response)==null?void 0:u.data;Z(a)&&(a=JSON.parse(a)),this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].error=a.error)}else this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].error={code:q});this.answering=!1})}}}),Ve={class:"wrapper"},Me={class:"chat"},Ue={class:"status"},Be={class:"dialogue"},Le={class:"messages"},Fe={class:"bottom"};function Pe(e,t,n,d,r,y){const u=l("conversations"),a=l("application-status"),_=l("message"),s=l("input-box"),w=l("layout");return o(),h(w,null,{chatdoc:L(()=>[i("div",Ve,[m(u,{class:"side"}),i("div",Me,[i("div",Ue,[m(a,{"show-price":!1,initializing:e.initializing,application:e.application,"need-apply":e.needApply,service:e.service,onRefresh:t[0]||(t[0]=p=>e.$store.dispatch("chatdoc/getApplication"))},null,8,["initializing","application","need-apply","service"])]),i("div",Be,[i("div",Le,[(o(!0),c(R,null,U(e.messages,(p,g)=>(o(),h(_,{key:g,message:p,class:"message"},null,8,["message"]))),128))])]),i("div",Fe,[m(s,{disabled:e.answering,question:e.question,"onUpdate:question":t[1]||(t[1]=p=>e.question=p),onSubmit:e.onSubmit},null,8,["disabled","question","onSubmit"])])])])]),_:1})}var ss=k(De,[["render",Pe],["__scopeId","data-v-24089614"],["__file","/home/runner/work/Nexior/Nexior/src/pages/chatdoc/Conversation.vue"]]);export{ss as default};
|
|
1
|
+
import{H as F}from"./vendor-others.6e08baf0.js";import{L as P}from"./Chatdoc.085ef653.js";import{X as H,Y as b,h as T,_ as k,x as N,F as O,H as z,Z as S}from"./index.3ae4a354.js";import{a as G}from"./vendor-axios.168e6950.js";import{M as K,E as q,a as D,b as W,c as Q,d as x,e as J,f as Y,g as A,A as j,h as X}from"./Status.46275dcf.js";import{i as Z}from"./is.dd611415.js";import{af as V}from"./vendor-fortawesome.46d238d8.js";import{L as M,u as ee,x as se,d as te}from"./vendor-element-plus.97860c23.js";import{H as E,al as l,o,e as c,L as h,f as i,V as m,U as I,W as R,ai as U,Q as v,as as B,S as f,$ as C,M as L,T as oe}from"./vendor-@vue.8e552cf2.js";import{C as ie}from"./CopyToClipboard.a77675ce.js";import"./application.ea1e2a72.js";import"./vendor-markdown.8e590d23.js";import"./vendor-highlight.js.19da0c9f.js";var $=(e=>(e.PENDING="pending",e.ANSWERING="answering",e.FINISHED="finished",e.FAILED="failed",e))($||{});const ne=E({name:"SidePanel",components:{ElInput:M,FontAwesomeIcon:V,ElSkeleton:ee},props:{},emits:["click"],computed:{repositoryId(){var e,t;return(t=(e=this.$route.params)==null?void 0:e.repositoryId)==null?void 0:t.toString()},conversationId(){var e,t;return(t=(e=this.$route.params)==null?void 0:e.conversationId)==null?void 0:t.toString()},repository(){var e,t,n;return(n=(t=(e=this.$store.state)==null?void 0:e.chatdoc)==null?void 0:t.repositories)==null?void 0:n.find(d=>d.id===this.repositoryId)},conversations(){var e;return(e=this.repository)==null?void 0:e.conversations},application(){return this.$store.state.chatdoc.application}},methods:{async onNewConversation(){this.$router.push({name:H,params:{repositoryId:this.repositoryId}})},async onConfirm(e){e!=null&&e.deleting?(await b.deleteConversation(e.id),await this.$store.dispatch("chat/getConversations")):e!=null&&e.editing?(await b.updateConversation(e),await this.$store.dispatch("chat/getConversations")):e.editing=!0},onClick(e){!e||(this.$router.push({name:T,params:{repositoryId:this.repositoryId,conversationId:e}}),this.$emit("click",e))}}}),ae={class:"panel"},re={key:1,class:"conversations"},le={class:"icons"},de={class:"title"},ce=["onClick"],ue={class:"icons"},pe={class:"title"},he={key:0},me={key:1},_e={key:2},ge={class:"operations"};function fe(e,t,n,d,r,y){const u=l("el-skeleton"),a=l("font-awesome-icon"),_=l("el-input");return o(),c("div",ae,[e.conversations===void 0?(o(),h(u,{key:0})):(o(),c("div",re,[i("div",{class:"conversation",onClick:t[0]||(t[0]=(...s)=>e.onNewConversation&&e.onNewConversation(...s))},[i("div",le,[m(a,{icon:"fa-solid fa-plus",class:"icon"})]),i("div",de,I(e.$t("chatdoc.message.startNewChat")),1)]),(o(!0),c(R,null,U(e.conversations,(s,w)=>{var p;return o(),c("div",{key:w,class:v({conversation:!0,active:s.id===e.conversationId}),onClick:g=>e.onClick(s.id)},[i("div",ue,[m(a,{icon:"fa-regular fa-comment",class:"icon"})]),i("div",pe,[s!=null&&s.deleting?(o(),c("span",he,I(`${e.$t("chatdoc.message.confirmDelete")}?`),1)):s!=null&&s.editing?(o(),c("span",me,[m(_,{modelValue:s.title,"onUpdate:modelValue":g=>s.title=g,onKeydown:B(g=>e.onConfirm(s),["enter"])},null,8,["modelValue","onUpdate:modelValue","onKeydown"])])):(s==null?void 0:s.title)||(s==null?void 0:s.messages)?(o(),c("span",_e,I((s==null?void 0:s.title)||((p=s==null?void 0:s.messages[(s==null?void 0:s.messages.length)-1])==null?void 0:p.content)),1)):f("v-if",!0)]),i("div",ge,[!(s!=null&&s.editing)&&!s.deleting?(o(),h(a,{key:0,icon:"fa-solid fa-edit",class:"icon icon-edit",onClick:C(g=>s.editing=!0,["stop"])},null,8,["onClick"])):f("v-if",!0),!(s!=null&&s.editing)&&!s.deleting?(o(),h(a,{key:1,icon:"fa-solid fa-trash",class:"icon icon-delete",onClick:C(g=>s.deleting=!0,["stop"])},null,8,["onClick"])):f("v-if",!0),(s==null?void 0:s.editing)||s.deleting?(o(),h(a,{key:2,icon:"fa-solid fa-check",class:"icon icon-confirm",onClick:C(g=>e.onConfirm(s),["stop"])},null,8,["onClick"])):f("v-if",!0),(s==null?void 0:s.editing)||s.deleting?(o(),h(a,{key:3,icon:"fa-solid fa-xmark",class:"icon icon-cancel",onClick:C(g=>{s.editing=!1,s.deleting=!1},["stop"])},null,8,["onClick"])):f("v-if",!0)])],10,ce)}),128))]))])}var ye=k(ne,[["render",fe],["__scopeId","data-v-2282a6e1"],["__file","/home/runner/work/Nexior/Nexior/src/components/chatdoc/Conversations.vue"]]);const $e=E({name:"AnsweringMark",data(){return{}},computed:{conversationId(){var e,t;return(t=(e=this.$route.params)==null?void 0:e.conversationId)==null?void 0:t.toString()}}}),we={class:"box"};function Ce(e,t,n,d,r,y){return o(),c("div",we)}var Ie=k($e,[["render",Ce],["__file","/home/runner/work/Nexior/Nexior/src/components/chatdoc/AnsweringMark.vue"]]);const ke=E({name:"Message",components:{CopyToClipboard:ie,AnsweringMark:Ie,MarkdownRenderer:K,ElAlert:se,ElButton:te},props:{message:{type:Object,required:!0}},emits:["stop"],data(){return{copied:!1,messageState:$}},computed:{errorText(){var e,t;if(!(!this.message.error||!((e=this.message.error)!=null&&e.code)))switch((t=this.message.error)==null?void 0:t.code){case A:return this.$t("chatdoc.message.errorUsedUp");case Y:return this.$t("chatdoc.message.errorApiError");case J:return this.$t("chatdoc.message.errorBadRequest");case x:return this.$t("chatdoc.message.errorTimeout");case Q:return this.$t("chatdoc.message.errorTooManyRequests");case W:return this.$t("chatdoc.message.errorContentTooLarge");case D:return this.$t("chatdoc.message.errorNotApplied");case q:default:return this.$t("chatdoc.message.errorUnknown")}},showBuyMore(){var e;return this.message.role===N&&((e=this.message.error)==null?void 0:e.code)===A}},methods:{onCopy(){F(this.message.content.toString(),{debug:!0}),this.copied=!0,setTimeout(()=>{this.copied=!1},3e3)},onBuyMore(){}}}),Ee=["role"],Ne={class:"content"},Re={class:"operations"};function Se(e,t,n,d,r,y){var p;const u=l("markdown-renderer"),a=l("answering-mark"),_=l("copy-to-clipboard"),s=l("el-alert"),w=l("el-button");return o(),c(R,null,[i("div",{class:v({message:!0,[e.message.role]:!0,hidden:e.errorText&&e.message.role==="assistant"}),role:e.message.role},[i("div",Ne,[m(u,{content:(p=e.message)==null?void 0:p.content},null,8,["content"]),e.message.state===e.messageState.PENDING?(o(),h(a,{key:0})):f("v-if",!0)]),i("div",Re,[m(_,{content:e.message.content,class:"btn-copy"},null,8,["content"])])],10,Ee),e.errorText?(o(),h(s,{key:0,class:"error",title:e.errorText,type:"error",closable:!1},null,8,["title"])):f("v-if",!0),e.showBuyMore?(o(),h(w,{key:1,round:"",type:"primary",class:"btn btn-buy",size:"small",onClick:e.onBuyMore},{default:L(()=>[oe(I(e.$t("common.button.buyMore")),1)]),_:1},8,["onClick"])):f("v-if",!0)],64)}var be=k(ke,[["render",Se],["__scopeId","data-v-95a62450"],["__file","/home/runner/work/Nexior/Nexior/src/components/chatdoc/Message.vue"]]);const ve=E({name:"InputBox",components:{ElInput:M,FontAwesomeIcon:V},props:{disabled:{type:Boolean,required:!1,default:!1},question:{type:String,required:!0}},emits:["update:question","submit"],data(){return{questionValue:this.question,fileList:[]}},computed:{model(){return this.$store.state.chat.model}},watch:{questionValue(e){this.$emit("update:question",e)},question(e){e!==this.questionValue&&(this.questionValue=e)},references(e){e.length===0&&(this.fileList=[])}},methods:{onSubmit(){!this.question||this.$emit("submit")}}}),Oe={class:"input-box"},Ae={class:"info"};function Te(e,t,n,d,r,y){const u=l("font-awesome-icon"),a=l("el-input");return o(),c(R,null,[i("div",Oe,[i("span",{class:v({btn:!0,"btn-send":!0,disabled:!e.question}),onClick:t[0]||(t[0]=(..._)=>e.onSubmit&&e.onSubmit(..._))},[m(u,{icon:"fa-solid fa-location-arrow",class:"icon icon-send"})],2),m(a,{modelValue:e.questionValue,"onUpdate:modelValue":t[1]||(t[1]=_=>e.questionValue=_),disabled:e.disabled,class:"input",type:"textarea",placeholder:e.$t("chat.message.newMessagePlaceholder"),onKeydown:B(C(e.onSubmit,["exact","prevent"]),["enter"])},null,8,["modelValue","disabled","placeholder","onKeydown"])]),i("p",Ae,I(e.$t("chat.message.howToUse")),1)],64)}var qe=k(ve,[["render",Te],["__scopeId","data-v-7ed35c20"],["__file","/home/runner/work/Nexior/Nexior/src/components/chatdoc/InputBox.vue"]]);const De=E({name:"ChatdocConversation",components:{Layout:P,Conversations:ye,Message:be,InputBox:qe,ApplicationStatus:j},data(){return{loading:!1,repositoryId:this.$route.params.repositoryId.toString(),answering:!1,question:""}},computed:{messages:{get(){var e,t;return((t=(e=this.conversations)==null?void 0:e.find(n=>{var d;return n.id===((d=this.$route.params.conversationId)==null?void 0:d.toString())}))==null?void 0:t.messages)||[]},set(e){console.debug("set messages",e)}},repository(){var e,t,n;return(n=(t=(e=this.$store.state)==null?void 0:e.chatdoc)==null?void 0:t.repositories)==null?void 0:n.find(d=>d.id===this.repositoryId)},conversations(){var e;return(e=this.repository)==null?void 0:e.conversations},conversationId(){var e;return(e=this.$route.params.conversationId)==null?void 0:e.toString()},application(){return this.$store.state.chatdoc.application},credential(){return this.$store.state.chatdoc.credential},needApply(){return this.$store.state.chatdoc.status.getApplication===O.Success&&!this.application},initializing(){return this.$store.state.chatdoc.status.getApplication===O.Request},service(){return this.$store.state.chatdoc.service}},async mounted(){console.debug("start get conversations"),this.loading=!0,this.$store.dispatch("chatdoc/getConversations",{repositoryId:this.repositoryId}).finally(()=>{this.loading=!1})},methods:{async onSubmit(){this.messages.push({content:this.question,role:z}),await this.onFetchAnswer()},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".dialogue");!e||!this.messages||this.messages.length===0||(e.scrollTop=e==null?void 0:e.scrollHeight)},0)},async onFetchAnswer(){var d;const e=(d=this.credential)==null?void 0:d.token,t=this.question;if(S(this.onFetchAnswer,"validated",t),this.question="",!e||!t){console.error("no token or endpoint or question"),this.messages.push({error:{code:D},role:N,state:$.FAILED});return}let n=this.conversationId;this.messages.push({content:"",role:N,state:$.PENDING}),S(this.onFetchAnswer,"start to get answer",this.messages),this.onScrollDown(),this.answering=!0,b.chatConversation({repositoryId:this.repositoryId,question:t,id:this.conversationId},{token:e,stream:r=>{this.messages[this.messages.length-1]={role:N,content:r.answer,state:$.ANSWERING},n=r.id,this.onScrollDown()}}).then(async()=>{S(this.onFetchAnswer,"finished fetch answer"),this.messages[this.messages.length-1].state=$.FINISHED,await this.$store.dispatch("chatdoc/setConversation",{id:n,messages:this.messages,repositoryId:this.repositoryId}),this.answering=!1,this.conversationId||(console.debug("push to conversation",n),await this.$router.push({name:T,params:{conversationId:n,repositoryId:this.repositoryId}})),this.onScrollDown(),await this.$store.dispatch("chatdoc/getConversations",{repositoryId:this.repositoryId})}).catch(r=>{var y,u;if(this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].state=$.FAILED),console.error(r),G.isCancel(r))this.messages[this.messages.length-1].error={code:X};else if((y=r==null?void 0:r.response)!=null&&y.data){let a=(u=r==null?void 0:r.response)==null?void 0:u.data;Z(a)&&(a=JSON.parse(a)),this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].error=a.error)}else this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].error={code:q});this.answering=!1})}}}),Ve={class:"wrapper"},Me={class:"chat"},Ue={class:"status"},Be={class:"dialogue"},Le={class:"messages"},Fe={class:"bottom"};function Pe(e,t,n,d,r,y){const u=l("conversations"),a=l("application-status"),_=l("message"),s=l("input-box"),w=l("layout");return o(),h(w,null,{chatdoc:L(()=>[i("div",Ve,[m(u,{class:"side"}),i("div",Me,[i("div",Ue,[m(a,{"show-price":!1,initializing:e.initializing,application:e.application,"need-apply":e.needApply,service:e.service,onRefresh:t[0]||(t[0]=p=>e.$store.dispatch("chatdoc/getApplication"))},null,8,["initializing","application","need-apply","service"])]),i("div",Be,[i("div",Le,[(o(!0),c(R,null,U(e.messages,(p,g)=>(o(),h(_,{key:g,message:p,class:"message"},null,8,["message"]))),128))])]),i("div",Fe,[m(s,{disabled:e.answering,question:e.question,"onUpdate:question":t[1]||(t[1]=p=>e.question=p),onSubmit:e.onSubmit},null,8,["disabled","question","onSubmit"])])])])]),_:1})}var ss=k(De,[["render",Pe],["__scopeId","data-v-24089614"],["__file","/home/runner/work/Nexior/Nexior/src/pages/chatdoc/Conversation.vue"]]);export{ss as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{H as p}from"./vendor-others.6e08baf0.js";import{af as r}from"./vendor-fortawesome.46d238d8.js";import{_ as s}from"./index.
|
|
1
|
+
import{H as p}from"./vendor-others.6e08baf0.js";import{af as r}from"./vendor-fortawesome.46d238d8.js";import{_ as s}from"./index.3ae4a354.js";import{e as i}from"./vendor-element-plus.97860c23.js";import{H as l,al as t,o as n,L as a,M as m,V as d}from"./vendor-@vue.8e552cf2.js";const _=l({name:"CopyToClipboard",components:{FontAwesomeIcon:r,ElTooltip:i},props:{content:{type:String,required:!0}},data(){return{copied:!1}},methods:{onCopy(){p(this.content,{debug:!0}),this.copied=!0,setTimeout(()=>{this.copied=!1},3e3)}}});function f(o,u,C,y,k,b){const e=t("font-awesome-icon"),c=t("el-tooltip");return o.copied?(n(),a(c,{key:1,visible:o.copied,effect:"dark",content:o.$t("common.message.copied"),placement:"top-start"},{default:m(()=>[d(e,{icon:"fa-solid fa-check",class:"icon-check"})]),_:1},8,["visible","content"])):(n(),a(e,{key:0,icon:"fa-regular fa-copy",class:"icon-copy",onClick:o.onCopy},null,8,["onClick"]))}var $=s(_,[["render",f],["__scopeId","data-v-1ba27772"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/CopyToClipboard.vue"]]);export{$ as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var b=Object.defineProperty,y=Object.defineProperties;var D=Object.getOwnPropertyDescriptors;var u=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var m=(e,o,t)=>o in e?b(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,p=(e,o)=>{for(var t in o||(o={}))V.call(o,t)&&m(e,t,o[t]);if(u)for(var t of u(o))x.call(o,t)&&m(e,t,o[t]);return e},_=(e,o)=>y(e,D(o));import{A as v,z as B}from"./vendor-others.6e08baf0.js";import{S as N,s as O,r as h,_ as f}from"./index.
|
|
1
|
+
var b=Object.defineProperty,y=Object.defineProperties;var D=Object.getOwnPropertyDescriptors;var u=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var m=(e,o,t)=>o in e?b(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,p=(e,o)=>{for(var t in o||(o={}))V.call(o,t)&&m(e,t,o[t]);if(u)for(var t of u(o))x.call(o,t)&&m(e,t,o[t]);return e},_=(e,o)=>y(e,D(o));import{A as v,z as B}from"./vendor-others.6e08baf0.js";import{S as N,s as O,r as h,_ as f}from"./index.3ae4a354.js";import{f as g,h as A,i as H}from"./vendor-element-plus.97860c23.js";import{H as C,al as l,o as s,L as i,M as c,V as L,e as M,ai as T,W as q}from"./vendor-@vue.8e552cf2.js";import{h as I,C as P,a as k}from"./vendor-vue-dark-switch.38123453.js";const U=C({name:"LocaleSelector",components:{ElDialog:g,ElSelect:A,ElOption:H},props:{visible:{type:Boolean,default:!1}},emits:["close"],data(){return{value:this.$i18n.locale,locales:N}},methods:{async onSelectLocale(e){this.$router.push({query:_(p({},this.$route.query),{locale:void 0})}),await O(e),this.setCookie(e),window.location.reload()},setCookie(e){v("LOCALE",e,{path:"/",domain:h()})}}});function z(e,o,t,$,w,E){const n=l("el-option"),r=l("el-select"),d=l("el-dialog");return s(),i(d,{"model-value":e.visible,width:300,class:"text-center",onClose:o[1]||(o[1]=a=>e.$emit("close"))},{default:c(()=>[L(r,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=a=>e.value=a),onChange:e.onSelectLocale},{default:c(()=>[(s(!0),M(q,null,T(e.locales,(a,S)=>(s(),i(n,{key:S,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["model-value"])}var X=f(U,[["render",z],["__scopeId","data-v-32a102bd"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/LocaleSelector.vue"]]);const F=C({components:{DarkSwitch:I,ElDialog:g},props:{visible:{type:Boolean,default:!0}},emits:["update:dark","close"],computed:{dark(){return B("THEME")==="dark"},switchValue(){return P.value}},watch:{switchValue(e){this.setCookie(e)},dark(e){document.documentElement.classList.toggle("dark",e),this.setCookie(this.dark)}},mounted(){this.dark?(k(!0),document.documentElement.classList.add("dark")):(k(!1),document.documentElement.classList.remove("dark"))},methods:{setCookie(e){v("THEME",e?"dark":"light",{path:"/",domain:h()})}}});function R(e,o,t,$,w,E){const n=l("dark-switch"),r=l("el-dialog");return s(),i(r,{"model-value":e.visible,width:200,class:"text-center",onClose:o[0]||(o[0]=d=>e.$emit("close"))},{default:c(()=>[L(n,{class:"switch","dark-background":"#333","light-background":"#fff"})]),_:1},8,["model-value"])}var Y=f(F,[["render",R],["__file","/home/runner/work/Nexior/Nexior/src/components/common/DarkSelector.vue"]]);export{Y as D,X as L};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-others.6e08baf0.js";import{o as k}from"./order.
|
|
1
|
+
import"./vendor-others.6e08baf0.js";import{o as k}from"./order.9333ea65.js";import{_ as D}from"./index.3ae4a354.js";import{O as P}from"./order.1bf5c3a2.js";import{Q as Y}from"./vendor-qrcode.08878953.js";import{f as z,j as H,k as U,d as Z,o as x,u as ee,w as ae,x as te,y as re,A as oe}from"./vendor-element-plus.97860c23.js";import{H as I,al as l,o as r,L as c,M as a,V as t,f as m,S as n,U as i,aK as L,aL as Q,e as p,W as se,T as v,Q as F}from"./vendor-@vue.8e552cf2.js";import{I as ie}from"./application.ea1e2a72.js";import"./vendor-axios.168e6950.js";import"./vendor-fortawesome.46d238d8.js";const le=I({name:"PayOrderDialog",components:{ElDialog:z,QrCode:Y,ElRow:H,ElCol:U},props:{modelValue:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:["hide","update:modelValue"],data(){return{refreshTimer:void 0}},mounted(){this.onRefresh()},unmounted(){this.refreshTimer&&clearTimeout(this.refreshTimer)},methods:{onRefresh(){if(!this.modelValue.id){console.error("id does not exist");return}k.refresh(this.modelValue.id).then(({data:e})=>{e.state!==P.PAID?setTimeout(()=>{this.onRefresh()},2e3):this.$emit("hide"),this.$emit("update:modelValue",e)}).catch(()=>{setTimeout(()=>{this.onRefresh()},2e3)})}}}),de=e=>(L("data-v-875060be"),e=e(),Q(),e),ne={class:"paycode wechat"},pe={class:"help-text"},ue=de(()=>m("div",{class:"help-img"},[m("img",{src:"https://midas.gtimg.cn/enterprise/images/ep_sys_wx_tip.jpg"})],-1));function ye(e,o,E,T,C,O){const u=l("qr-code"),f=l("el-col"),W=l("el-row"),S=l("el-dialog");return r(),c(S,{"model-value":e.visible,title:e.$t("application.title.buyService"),width:"500px",center:""},{default:a(()=>[t(W,{class:"paycodes"},{default:a(()=>[t(f,{span:12},{default:a(()=>{var h,g;return[m("div",ne,[(h=e.modelValue)!=null&&h.pay_url?(r(),c(u,{key:0,value:(g=e.modelValue)==null?void 0:g.pay_url,size:200,class:"qrcode m-auto"},null,8,["value"])):n("v-if",!0),m("p",pe,i(e.$t("order.message.wechatPayHelp")),1)])]}),_:1}),t(f,{span:12},{default:a(()=>[ue]),_:1})]),_:1})]),_:1},8,["model-value","title"])}var ce=D(le,[["render",ye],["__scopeId","data-v-875060be"],["__file","/home/runner/work/Nexior/Nexior/src/components/order/WechatPay.vue"]]);const me=I({name:"PayOrderDialog",components:{ElDialog:z},props:{modelValue:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:["hide","update:modelValue"],data(){return{refreshTimer:void 0}},watch:{visible:{handler(e){e&&this.modelValue.pay_url&&window.open(this.modelValue.pay_url,"_blank")}}},mounted(){this.onRefresh()},unmounted(){this.refreshTimer&&clearTimeout(this.refreshTimer)},methods:{onRefresh(){if(!this.modelValue.id){console.error("id does not exist");return}k.refresh(this.modelValue.id).then(({data:e})=>{e.state!==P.PAID?setTimeout(()=>{this.onRefresh()},2e3):this.$emit("hide"),this.$emit("update:modelValue",e)}).catch(()=>{setTimeout(()=>{this.onRefresh()},5e3)})}}}),fe={class:"text-center"};function he(e,o,E,T,C,O){const u=l("el-dialog");return r(),c(u,{"model-value":e.visible,title:e.$t("application.title.buyService"),width:"500px",center:""},{default:a(()=>[m("p",fe,i(e.$t("order.message.buyInExternalUrl")),1)]),_:1},8,["model-value","title"])}var _e=D(me,[["render",he],["__scopeId","data-v-85959ecc"],["__file","/home/runner/work/Nexior/Nexior/src/components/order/StripePay.vue"]]);var G=(e=>(e.WechatPay="WechatPay",e.Stripe="Stripe",e.AliPay="AliPay",e))(G||{});const ve=I({name:"ConsoleOrderDetail",components:{ElButton:Z,ElRow:H,ElCard:x,ElCol:U,ElSkeleton:ee,ElDivider:ae,ElAlert:te,ElDescriptions:re,ElDescriptionsItem:oe,WechatPayOrder:ce,StripePayOrder:_e},data(){return{PayWay:G,payWay:"Stripe",OrderState:P,order:void 0,showPayWays:!1,loading:!1,paying:!1,prepaying:!1,applicationType:ie}},computed:{id(){var e,o;return(o=(e=this.$route.params)==null?void 0:e.id)==null?void 0:o.toString()},redirect(){var e;return(e=this.$route.query)==null?void 0:e.redirect}},watch:{order:{handler(e){if((e==null?void 0:e.state)===P.PAID){setTimeout(()=>{var o;this.redirect&&window.location.replace((o=this.redirect)==null?void 0:o.toString())},2e3);return}},deep:!0}},mounted(){this.onFetchData()},methods:{onFetchData(){this.loading=!0,k.refresh(this.id).then(({data:e})=>{this.order=e,e.pay_way&&(this.payWay=e.pay_way),this.loading=!1}).catch(()=>{this.loading=!1})},onRepay(){this.paying=!0},onPay(){this.prepaying=!0,k.pay(this.id,{pay_way:this.payWay}).then(({data:e})=>{this.prepaying=!1,this.order=e,this.order.price&&this.order.price>0&&(this.paying=!0)}).catch(()=>{this.prepaying=!1})}}}),K=e=>(L("data-v-2d1dc98e"),e=e(),Q(),e),$e={class:"title"},be={key:0,class:"pt-5"},ge={key:1,class:"order"},we={key:0},ke={key:1},Pe={key:0,class:"price unfree"},We={key:1,class:"price free"},Se={key:0,class:"payways mb-6"},Ve=K(()=>m("span",{class:"payicon wechatpay"},null,-1)),De={class:"payname"},Ie=K(()=>m("span",{class:"payicon stripe"},null,-1)),Ee={class:"payname"},Te={key:1},Ce={key:2};function Oe(e,o,E,T,C,O){const u=l("el-col"),f=l("el-row"),W=l("el-skeleton"),S=l("copy-to-clipboard"),h=l("el-descriptions-item"),g=l("el-descriptions"),V=l("el-divider"),N=l("el-alert"),R=l("el-button"),M=l("el-card"),X=l("wechat-pay-order"),J=l("stripe-pay-order");return r(),p(se,null,[t(f,{class:"panel"},{default:a(()=>[t(u,{span:24},{default:a(()=>[t(f,null,{default:a(()=>[t(u,{span:24},{default:a(()=>[m("h2",$e,i(e.$t("order.title.info")),1)]),_:1})]),_:1}),t(f,null,{default:a(()=>[t(u,{span:24},{default:a(()=>[t(M,{shadow:"hover"},{default:a(()=>{var _,A,q,B;return[t(f,null,{default:a(()=>[t(u,{span:14,offset:5},{default:a(()=>[e.loading?(r(),p("div",be,[t(W,{animated:""})])):(r(),p("div",ge,[t(g,{column:1},{default:a(()=>{var $,w,j;return[t(h,{label:e.$t("order.field.id")},{default:a(()=>{var s,d,y;return[m("span",null,i((s=e.order)==null?void 0:s.id),1),(d=e.order)!=null&&d.id?(r(),c(S,{key:0,content:(y=e.order)==null?void 0:y.id,class:"inline-block"},null,8,["content"])):n("v-if",!0)]}),_:1},8,["label"]),t(h,{label:e.$t("order.field.description")},{default:a(()=>{var s;return[v(i((s=e.order)==null?void 0:s.description),1)]}),_:1},8,["label"]),(w=($=e.order)==null?void 0:$.application)!=null&&w.service?(r(),c(h,{key:0,label:e.$t("order.field.api")},{default:a(()=>{var s,d,y;return[v(i((y=(d=(s=e.order)==null?void 0:s.application)==null?void 0:d.service)==null?void 0:y.title),1)]}),_:1},8,["label"])):n("v-if",!0),(j=e.order)!=null&&j.pay_way?(r(),c(h,{key:1,label:e.$t("order.field.payWay")},{default:a(()=>{var s,d;return[((s=e.order)==null?void 0:s.pay_way)===e.PayWay.WechatPay?(r(),p("span",we,i(e.$t("order.title.wechatPay")),1)):n("v-if",!0),((d=e.order)==null?void 0:d.pay_way)===e.PayWay.Stripe?(r(),p("span",ke,i(e.$t("order.title.stripe")),1)):n("v-if",!0)]}),_:1},8,["label"])):n("v-if",!0),t(h,{label:e.$t("order.field.amount")},{default:a(()=>{var s,d,y,b;return[v(i((s=e.order)==null?void 0:s.amount)+" "+i(e.$t(`service.unit.${(b=(y=(d=e.order)==null?void 0:d.application)==null?void 0:y.service)==null?void 0:b.unit}`)),1)]}),_:1},8,["label"]),t(h,{label:e.$t("order.field.createdAt")},{default:a(()=>{var s;return[v(i(e.$dayjs.format((s=e.order)==null?void 0:s.created_at)),1)]}),_:1},8,["label"]),t(h,{label:e.$t("order.field.price")},{default:a(()=>{var s,d,y,b;return[((s=e.order)==null?void 0:s.price)&&((d=e.order)==null?void 0:d.price)>0?(r(),p("span",Pe," $"+i((b=(y=e.order)==null?void 0:y.price)==null?void 0:b.toFixed(2)),1)):(r(),p("span",We,i(e.$t("order.message.free")),1))]}),_:1},8,["label"])]}),_:1})]))]),_:1})]),_:1}),((_=e.order)==null?void 0:_.state)===e.OrderState.PAID?(r(),c(f,{key:0,class:"mb-5"},{default:a(()=>[t(u,{span:14,offset:5},{default:a(()=>[t(V,{"border-style":"dashed"}),t(N,{title:e.$t("order.message.paidSuccessfully"),type:"success","show-icon":"",closable:!1},null,8,["title"])]),_:1})]),_:1})):n("v-if",!0),((A=e.order)==null?void 0:A.state)===e.OrderState.EXPIRED?(r(),c(f,{key:1,class:"mb-5"},{default:a(()=>[t(u,{span:14,offset:5},{default:a(()=>[t(V,{"border-style":"dashed"}),t(N,{title:e.$t("order.message.orderExpired"),type:"error","show-icon":"",closable:!1},null,8,["title"])]),_:1})]),_:1})):n("v-if",!0),((q=e.order)==null?void 0:q.state)===e.OrderState.PENDING||((B=e.order)==null?void 0:B.state)===e.OrderState.FAILED?(r(),c(f,{key:2},{default:a(()=>[t(u,{span:14,offset:5},{default:a(()=>{var $;return[t(V,{"border-style":"dashed"}),e.showPayWays&&e.order.price&&e.order.price>0&&!e.order.pay_way?(r(),p("div",Se,[(r(),p("div",{key:0,class:F({payway:!0,wechatpay:!0,active:e.payWay===e.PayWay.WechatPay}),onClick:o[0]||(o[0]=w=>e.payWay=e.PayWay.WechatPay)},[Ve,m("span",De,i(e.$t("order.title.wechatPay")),1)],2)),n("v-if",!0),(r(),p("div",{key:2,class:F({payway:!0,stripe:!0,active:e.payWay===e.PayWay.Stripe}),onClick:o[2]||(o[2]=w=>e.payWay=e.PayWay.Stripe)},[Ie,m("span",Ee,i(e.$t("order.title.stripe")),1)],2))])):n("v-if",!0),($=e.order)!=null&&$.pay_way?(r(),p("div",Ce,[t(R,{type:"primary",round:"",size:"large",class:"btn-repay",onClick:e.onRepay},{default:a(()=>[v(i(e.$t("common.button.repay")),1)]),_:1},8,["onClick"])])):(r(),p("div",Te,[t(R,{loading:e.prepaying,round:"",type:"primary",size:"large",class:"btn-pay",onClick:e.onPay},{default:a(()=>[v(i(e.$t("common.button.pay")),1)]),_:1},8,["loading","onClick"])]))]}),_:1})]),_:1})):n("v-if",!0)]}),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),e.order&&e.payWay===e.PayWay.WechatPay?(r(),c(X,{key:0,modelValue:e.order,"onUpdate:modelValue":o[3]||(o[3]=_=>e.order=_),visible:e.paying,onHide:o[4]||(o[4]=_=>e.paying=!1)},null,8,["modelValue","visible"])):n("v-if",!0),e.order&&e.payWay===e.PayWay.Stripe?(r(),c(J,{key:1,modelValue:e.order,"onUpdate:modelValue":o[5]||(o[5]=_=>e.order=_),visible:e.paying,onHide:o[6]||(o[6]=_=>e.paying=!1)},null,8,["modelValue","visible"])):n("v-if",!0)],64)}var Le=D(ve,[["render",Oe],["__scopeId","data-v-2d1dc98e"],["__file","/home/runner/work/Nexior/Nexior/src/pages/console/order/Detail.vue"]]);export{Le as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-others.6e08baf0.js";import{af as d}from"./vendor-fortawesome.46d238d8.js";import{p as f,_ as u}from"./index.
|
|
1
|
+
import"./vendor-others.6e08baf0.js";import{af as d}from"./vendor-fortawesome.46d238d8.js";import{p as f,_ as u}from"./index.3ae4a354.js";import{q as g,d as h,r as v,s as x,t as E}from"./vendor-element-plus.97860c23.js";import{H as w,al as n,o as y,e as $,V as e,M as o,T as m,U as a,f as s}from"./vendor-@vue.8e552cf2.js";const b=w({name:"HelpEntry",components:{ElImage:g,ElButton:h,ElPopover:v,ElMenu:x,ElMenuItem:E,FontAwesomeIcon:d},methods:{onJoin(){window.open("https://discord.gg/73F3MYj3vp","_blank")},onProfit(){this.$router.push({name:f})}}}),I={class:"flex"},C={class:"flex-1 text-center"},N={class:"flex-1 text-center"};function k(t,H,T,B,D,M){const r=n("font-awesome-icon"),p=n("el-button"),c=n("el-menu-item"),l=n("el-image"),i=n("el-popover"),_=n("el-menu");return y(),$("div",null,[e(i,{placement:"bottom",width:200,trigger:"hover","popper-style":{padding:"10px"}},{reference:o(()=>[e(p,{type:"primary",circle:"",size:"large",class:"entry"},{default:o(()=>[e(r,{icon:"fa-solid fa-question"})]),_:1})]),default:o(()=>[e(_,{collapse:!1,class:"menu"},{default:o(()=>[e(c,{index:"1",onClick:t.onJoin},{title:o(()=>[m(a(t.$t("common.message.joinDiscord")),1)]),default:o(()=>[e(r,{icon:"fa-brands fa-discord",class:"mr-2"})]),_:1},8,["onClick"]),e(i,{width:350,trigger:"hover"},{reference:o(()=>[e(c,{index:"2"},{title:o(()=>[m(a(t.$t("common.message.addWeChat")),1)]),default:o(()=>[e(r,{icon:"fa-brands fa-weixin",class:"mr-2"})]),_:1})]),default:o(()=>[s("div",I,[s("div",C,[e(l,{src:"https://cdn.acedata.cloud/wechat.png"}),s("span",null,a(t.$t("common.message.serviceTech")),1)]),s("div",N,[e(l,{src:"https://cdn.acedata.cloud/ue99mv.png"}),s("span",null,a(t.$t("common.message.businessCooperation")),1)])])]),_:1})]),_:1})]),_:1})])}var J=u(b,[["render",k],["__scopeId","data-v-a4fb3806"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/HelpEntry.vue"]]);export{J as H};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-others.6e08baf0.js";import{P as y}from"./Pagination.
|
|
1
|
+
import"./vendor-others.6e08baf0.js";import{P as y}from"./Pagination.d33da3c9.js";import{C as v}from"./CopyToClipboard.a77675ce.js";import{b as $}from"./distribution.9879f380.js";import{_ as C}from"./index.3ae4a354.js";import{j as H,k as D,l as F,m as k,o as E}from"./vendor-element-plus.97860c23.js";import{H as P,al as s,av as x,L as h,M as o,o as m,V as e,f as a,U as n,O as N}from"./vendor-@vue.8e552cf2.js";import"./vendor-fortawesome.46d238d8.js";import"./vendor-axios.168e6950.js";const S=P({name:"ConsoleDistributionList",components:{Pagination:y,CopyToClipboard:v,ElRow:H,ElCol:D,ElTable:F,ElTableColumn:k,ElCard:E},data(){return{distributionHistories:[],distributionStatus:void 0,loading:!1,total:void 0,limit:10}},computed:{redirect(){return this.$route.query.redirect},page(){var t;return parseInt(((t=this.$route.query.page)==null?void 0:t.toString())||"1")}},watch:{page:{handler(){this.onFetchData()}}},mounted(){this.onFetchData()},methods:{onPageChange(t){var u;this.$router.push({name:(u=this.$route.name)==null?void 0:u.toString(),query:{page:t}})},onFetchData(){this.loading=!0,Promise.all([this.onFetchDistributionHistory()]).finally(()=>{this.loading=!1})},async onFetchDistributionHistory(){const{data:t}=await $.getAll({user_id:this.$store.getters.user.id,ordering:"-created_at",limit:this.limit,offset:(this.page-1)*this.limit});this.distributionHistories=t.items,this.total=t.count}}}),q={class:"title"},A={class:"key"},B={class:"copy"},I={class:"key"},T={class:"copy"},V={class:"price"},j={class:"description"},z={class:"description"},L={class:"created-at"},O={class:"pagination m-v-lg"};function M(t,u,R,U,G,J){const c=s("el-col"),p=s("el-row"),_=s("copy-to-clipboard"),r=s("el-table-column"),f=s("el-table"),b=s("el-card"),g=s("pagination"),w=x("loading");return m(),h(p,{class:"panel"},{default:o(()=>[e(c,{span:24},{default:o(()=>[e(p,null,{default:o(()=>[e(c,{span:24},{default:o(()=>[a("h2",q,n(t.$t("common.title.distributionHistory")),1)]),_:1})]),_:1}),e(p,null,{default:o(()=>[e(c,{span:24},{default:o(()=>[e(b,{shadow:"hover"},{default:o(()=>[N((m(),h(f,{data:t.distributionHistories,stripe:""},{default:o(()=>[e(r,{prop:"id",label:t.$t("distribution.field.id"),"class-name":"text-center",width:"350px"},{default:o(i=>[a("span",A,n(i.row.id),1),a("span",B,[e(_,{content:i.row.id},null,8,["content"])])]),_:1},8,["label"]),e(r,{prop:"id",label:t.$t("distribution.field.userId"),"class-name":"text-center",width:"350px"},{default:o(i=>[a("span",I,n(i.row.user_id),1),a("span",T,[e(_,{content:i.row.user_id},null,8,["content"])])]),_:1},8,["label"]),e(r,{label:t.$t("distribution.field.price"),width:"100px"},{default:o(i=>{var l,d;return[a("span",V,"\xA5"+n((d=(l=i.row)==null?void 0:l.price)==null?void 0:d.toFixed(2)),1)]}),_:1},8,["label"]),e(r,{label:t.$t("distribution.field.reward"),width:"100px"},{default:o(i=>{var l,d;return[a("span",j,"\uFFE5"+n((d=(l=i.row)==null?void 0:l.reward)==null?void 0:d.toFixed(2)),1)]}),_:1},8,["label"]),e(r,{label:t.$t("distribution.field.percentage"),width:"100px"},{default:o(i=>[a("span",z,n(i.row.percentage)+"%",1)]),_:1},8,["label"]),e(r,{label:t.$t("distribution.field.createdAt"),width:"200px"},{default:o(i=>[a("span",L,n(t.$dayjs.format(i.row.created_at)),1)]),_:1},8,["label"])]),_:1},8,["data"])),[[w,t.loading]])]),_:1})]),_:1})]),_:1}),e(p,null,{default:o(()=>[e(c,{span:10,offset:14},{default:o(()=>[a("div",O,[e(g,{"current-page":t.page,"page-size":t.limit,total:t.total,onChange:t.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}var it=C(S,[["render",M],["__scopeId","data-v-63f0e9ed"],["__file","/home/runner/work/Nexior/Nexior/src/pages/distribution/History.vue"]]);export{it as default};
|