mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-03 14:10:57 +08:00
tag and installer&updater use english
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
|||||||
var q=Object.defineProperty,U=Object.defineProperties;var B=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var y=(a,e,n)=>e in a?q(a,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[e]=n,D=(a,e)=>{for(var n in e||(e={}))C.call(e,n)&&y(a,n,e[n]);if(g)for(var n of g(e))R.call(e,n)&&y(a,n,e[n]);return a},A=(a,e)=>U(a,B(e));import{G as F,B as $,d as N,u as j,r as G,o as E,H,t as I,e as s,f as c,g as V,k as o,w as r,F as L,A as M,l as P,q as S}from"./vendor.51c5b88d.js";import{_ as T,b as z,a as i}from"./index.76424d23.js";const J={name:"AgentAllowForm",setup(){const{proxy:a}=F();console.log("proxy",a);const e=$(null),n=N(),f=j(),{id:u}=n.query,m=G({token:z("token")||"",id:u,agentAllows:[],formData:{family_id:"",name:"",peer_id:"",agent:"",comment:""},rules:{family_id:[{required:"true"}],name:[{required:"true"}],peer_id:[{required:"true"}],agent:[{required:"true"}]}});E(async()=>{await _(),u&&i.getAgentDeny(u).then(l=>{m.formData.family_id=l.data.family_id,m.formData.name=l.data.name,m.formData.peer_id=l.data.peer_id,m.formData.agent=l.data.agent,m.formData.comment=l.data.comment})}),H(()=>{});const p=()=>{e.value.validate(async l=>{if(l){let d=m.formData;console.log(d),u?await i.updateAgentDeny(u,d):await i.storeAgentDeny(d),await f.push({name:"agent-deny"})}})},_=async()=>{let l=await i.listAllAgentAllow();m.agentAllows=l.data};return A(D({},I(m)),{formRef:e,submitAdd:p})}},K=P("Submit");function O(a,e,n,f,u,m){const p=s("el-option"),_=s("el-select"),l=s("el-form-item"),d=s("el-input"),b=s("el-button"),w=s("el-form"),v=s("el-col"),k=s("el-row");return c(),V("div",null,[o(k,null,{default:r(()=>[o(v,{span:12},{default:r(()=>[o(w,{model:a.formData,rules:a.rules,ref:"formRef","label-width":"200px",class:"formData"},{default:r(()=>[o(l,{label:"Family",prop:"family_id"},{default:r(()=>[o(_,{modelValue:a.formData.family_id,"onUpdate:modelValue":e[0]||(e[0]=t=>a.formData.family_id=t),filterable:""},{default:r(()=>[(c(!0),V(L,null,M(a.agentAllows,t=>(c(),S(p,{key:t.id,label:t.family,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(l,{label:"Name",prop:"name"},{default:r(()=>[o(d,{modelValue:a.formData.name,"onUpdate:modelValue":e[1]||(e[1]=t=>a.formData.name=t),placeholder:""},null,8,["modelValue"])]),_:1}),o(l,{label:"Peer id",prop:"peer_id"},{default:r(()=>[o(d,{modelValue:a.formData.peer_id,"onUpdate:modelValue":e[2]||(e[2]=t=>a.formData.peer_id=t),placeholder:""},null,8,["modelValue"])]),_:1}),o(l,{label:"Agent",prop:"agent"},{default:r(()=>[o(d,{modelValue:a.formData.agent,"onUpdate:modelValue":e[3]||(e[3]=t=>a.formData.agent=t),placeholder:""},null,8,["modelValue"])]),_:1}),o(l,{label:"Comment",prop:"comment"},{default:r(()=>[o(d,{type:"textarea",modelValue:a.formData.comment,"onUpdate:modelValue":e[4]||(e[4]=t=>a.formData.comment=t),placeholder:""},null,8,["modelValue"])]),_:1}),o(l,null,{default:r(()=>[o(b,{type:"primary",onClick:e[5]||(e[5]=t=>f.submitAdd())},{default:r(()=>[K]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1})]),_:1})])}var Y=T(J,[["render",O]]);export{Y as default};
|
var q=Object.defineProperty,U=Object.defineProperties;var B=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var y=(a,e,n)=>e in a?q(a,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[e]=n,D=(a,e)=>{for(var n in e||(e={}))C.call(e,n)&&y(a,n,e[n]);if(g)for(var n of g(e))R.call(e,n)&&y(a,n,e[n]);return a},b=(a,e)=>U(a,B(e));import{G as F,B as $,d as N,u as j,r as G,o as E,H,t as I,e as s,f as c,g as A,k as o,w as r,F as L,A as M,l as P,q as S}from"./vendor.51c5b88d.js";import{_ as T,b as z,a as i}from"./index.82f228b9.js";const J={name:"AgentAllowForm",setup(){const{proxy:a}=F();console.log("proxy",a);const e=$(null),n=N(),f=j(),{id:u}=n.query,m=G({token:z("token")||"",id:u,agentAllows:[],formData:{family_id:"",name:"",peer_id:"",agent:"",comment:""},rules:{family_id:[{required:"true"}],name:[{required:"true"}],peer_id:[{required:"true"}],agent:[{required:"true"}]}});E(async()=>{await _(),u&&i.getAgentDeny(u).then(l=>{m.formData.family_id=l.data.family_id,m.formData.name=l.data.name,m.formData.peer_id=l.data.peer_id,m.formData.agent=l.data.agent,m.formData.comment=l.data.comment})}),H(()=>{});const p=()=>{e.value.validate(async l=>{if(l){let d=m.formData;console.log(d),u?await i.updateAgentDeny(u,d):await i.storeAgentDeny(d),await f.push({name:"agent-deny"})}})},_=async()=>{let l=await i.listAllAgentAllow();m.agentAllows=l.data};return b(D({},I(m)),{formRef:e,submitAdd:p})}},K=P("Submit");function O(a,e,n,f,u,m){const p=s("el-option"),_=s("el-select"),l=s("el-form-item"),d=s("el-input"),V=s("el-button"),w=s("el-form"),v=s("el-col"),k=s("el-row");return c(),A("div",null,[o(k,null,{default:r(()=>[o(v,{span:12},{default:r(()=>[o(w,{model:a.formData,rules:a.rules,ref:"formRef","label-width":"200px",class:"formData"},{default:r(()=>[o(l,{label:"Family",prop:"family_id"},{default:r(()=>[o(_,{modelValue:a.formData.family_id,"onUpdate:modelValue":e[0]||(e[0]=t=>a.formData.family_id=t),filterable:""},{default:r(()=>[(c(!0),A(L,null,M(a.agentAllows,t=>(c(),S(p,{key:t.id,label:t.family,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(l,{label:"Name",prop:"name"},{default:r(()=>[o(d,{modelValue:a.formData.name,"onUpdate:modelValue":e[1]||(e[1]=t=>a.formData.name=t),placeholder:""},null,8,["modelValue"])]),_:1}),o(l,{label:"Peer id",prop:"peer_id"},{default:r(()=>[o(d,{modelValue:a.formData.peer_id,"onUpdate:modelValue":e[2]||(e[2]=t=>a.formData.peer_id=t),placeholder:""},null,8,["modelValue"])]),_:1}),o(l,{label:"Agent",prop:"agent"},{default:r(()=>[o(d,{modelValue:a.formData.agent,"onUpdate:modelValue":e[3]||(e[3]=t=>a.formData.agent=t),placeholder:""},null,8,["modelValue"])]),_:1}),o(l,{label:"Comment",prop:"comment"},{default:r(()=>[o(d,{type:"textarea",modelValue:a.formData.comment,"onUpdate:modelValue":e[4]||(e[4]=t=>a.formData.comment=t),placeholder:""},null,8,["modelValue"])]),_:1}),o(l,null,{default:r(()=>[o(V,{type:"primary",onClick:e[5]||(e[5]=t=>f.submitAdd())},{default:r(()=>[K]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1})]),_:1})])}var Y=T(J,[["render",O]]);export{Y as default};
|
||||||
1
admin/dist/assets/form.5028610f.js
vendored
Normal file
1
admin/dist/assets/form.5028610f.js
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
var h=Object.defineProperty,v=Object.defineProperties;var w=Object.getOwnPropertyDescriptors;var c=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var _=(o,e,a)=>e in o?h(o,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):o[e]=a,y=(o,e)=>{for(var a in e||(e={}))k.call(e,a)&&_(o,a,e[a]);if(c)for(var a of c(e))T.call(e,a)&&_(o,a,e[a]);return o},g=(o,e)=>v(o,w(e));import{G as C,B as R,d as B,u as U,r as $,o as q,H as N,t as j,e as u,f as A,g as G,k as t,w as r,l as x}from"./vendor.51c5b88d.js";import{_ as E,b as F,a as p}from"./index.82f228b9.js";const H={name:"TagForm",setup(){const{proxy:o}=C();console.log("proxy",o);const e=R(null),a=B(),f=U(),{id:n}=a.query,s=$({token:F("token")||"",id:n,list:[],formData:{color:"",name:"",priority:""},rules:{color:[{required:"true"}],name:[{required:"true"}]}});q(async()=>{n&&p.getTag(n).then(l=>{s.formData.name=l.data.name,s.formData.color=l.data.color,s.formData.priority=l.data.priority})}),N(()=>{});const d=()=>{e.value.validate(async l=>{if(l){let i=s.formData;console.log(i),n?await p.updateTag(n,i):await p.storeTag(i),await f.push({name:"tag"})}})};return g(y({},j(s)),{formRef:e,submitAdd:d})}},I=x("Submit");function M(o,e,a,f,n,s){const d=u("el-input"),l=u("el-form-item"),i=u("el-button"),D=u("el-form"),b=u("el-col"),V=u("el-row");return A(),G("div",null,[t(V,null,{default:r(()=>[t(b,{span:12},{default:r(()=>[t(D,{model:o.formData,rules:o.rules,ref:"formRef","label-width":"200px",class:"formData"},{default:r(()=>[t(l,{label:"Name",prop:"name"},{default:r(()=>[t(d,{modelValue:o.formData.name,"onUpdate:modelValue":e[0]||(e[0]=m=>o.formData.name=m),placeholder:""},null,8,["modelValue"])]),_:1}),t(l,{label:"Color",prop:"color"},{default:r(()=>[t(d,{modelValue:o.formData.color,"onUpdate:modelValue":e[1]||(e[1]=m=>o.formData.color=m),placeholder:""},null,8,["modelValue"])]),_:1}),t(l,{label:"Priority",prop:"priority"},{default:r(()=>[t(d,{modelValue:o.formData.priority,"onUpdate:modelValue":e[2]||(e[2]=m=>o.formData.priority=m),placeholder:"The higher the value, the higher the ranking"},null,8,["modelValue"])]),_:1}),t(l,null,{default:r(()=>[t(i,{type:"primary",onClick:e[3]||(e[3]=m=>f.submitAdd())},{default:r(()=>[I]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1})]),_:1})])}var J=E(H,[["render",M]]);export{J as default};
|
||||||
@@ -1 +1 @@
|
|||||||
var C=Object.defineProperty,q=Object.defineProperties;var j=Object.getOwnPropertyDescriptors;var V=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var y=(a,e,n)=>e in a?C(a,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[e]=n,b=(a,e)=>{for(var n in e||(e={}))k.call(e,n)&&y(a,n,e[n]);if(V)for(var n of V(e))M.call(e,n)&&y(a,n,e[n]);return a},v=(a,e)=>q(a,j(e));import{G as B,B as I,d as R,u as E,r as G,o as $,H as h,t as N,e as s,f as S,g as A,k as o,w as t,E as F,l as c}from"./vendor.51c5b88d.js";import{_ as H,b as P,a as D}from"./index.76424d23.js";const T={name:"MedalForm",setup(){const{proxy:a}=B();console.log("proxy",a);const e=I(null),n=R(),g=E(),{id:p}=n.query,d=G({token:P("token")||"",id:p,allClasses:[],formData:{name:"",description:"",image_large:"",image_small:"",duration:"",price:"",get_type:""},rules:{name:[{required:"true"}],price:[{required:"true"}],image_large:[{required:"true"}],image_small:[{required:"true"}],description:[{required:"true"}],get_type:[{required:"true"}]}});$(async()=>{p&&D.getMedal(p).then(l=>{d.formData.name=l.data.name,d.formData.image_large=l.data.image_large,d.formData.image_small=l.data.image_small,d.formData.description=l.data.description,d.formData.price=l.data.price,d.formData.duration=l.data.duration,d.formData.get_type=l.data.get_type})}),h(()=>{});const u=()=>{e.value.validate(async l=>{if(l){let i=d.formData;console.log(i),p?await D.updateMedal(p,i):await D.storeMedal(i),await g.push({name:"medal"})}})},m=l=>{const i=l.name.split(".")[1]||"";if(!["jpg","jpeg","png"].includes(i))return F.error("\u8BF7\u4E0A\u4F20 jpg\u3001jpeg\u3001png \u683C\u5F0F\u7684\u56FE\u7247"),!1},f=l=>{d.formData.goodsCoverImg=l.data||""},_=l=>{d.categoryId=l[2]||0};return v(b({},N(d)),{formRef:e,submitAdd:u,handleBeforeUpload:m,handleUrlSuccess:f,handleChangeCate:_})}},z=c("Exchange"),J=c("Grant"),K=c("Submit");function L(a,e,n,g,p,d){const u=s("el-input"),m=s("el-form-item"),f=s("el-radio"),_=s("el-radio-group"),l=s("el-button"),i=s("el-form"),U=s("el-col"),w=s("el-row");return S(),A("div",null,[o(w,null,{default:t(()=>[o(U,{span:12},{default:t(()=>[o(i,{model:a.formData,rules:a.rules,ref:"formRef","label-width":"200px",class:"formData"},{default:t(()=>[o(m,{label:"Name",prop:"name"},{default:t(()=>[o(u,{modelValue:a.formData.name,"onUpdate:modelValue":e[0]||(e[0]=r=>a.formData.name=r),placeholder:""},null,8,["modelValue"])]),_:1}),o(m,{label:"Price",prop:"price"},{default:t(()=>[o(u,{modelValue:a.formData.price,"onUpdate:modelValue":e[1]||(e[1]=r=>a.formData.price=r),placeholder:"Seed bonus"},null,8,["modelValue"])]),_:1}),o(m,{label:"Get type",prop:"get_type"},{default:t(()=>[o(_,{modelValue:a.formData.get_type,"onUpdate:modelValue":e[2]||(e[2]=r=>a.formData.get_type=r)},{default:t(()=>[o(f,{label:1},{default:t(()=>[z]),_:1}),o(f,{label:2},{default:t(()=>[J]),_:1})]),_:1},8,["modelValue"])]),_:1}),o(m,{label:"Image large",prop:"image_large"},{default:t(()=>[o(u,{modelValue:a.formData.image_large,"onUpdate:modelValue":e[3]||(e[3]=r=>a.formData.image_large=r),placeholder:""},null,8,["modelValue"])]),_:1}),o(m,{label:"Image small",prop:"image_small"},{default:t(()=>[o(u,{modelValue:a.formData.image_small,"onUpdate:modelValue":e[4]||(e[4]=r=>a.formData.image_small=r),placeholder:""},null,8,["modelValue"])]),_:1}),o(m,{label:"Duration",prop:"duration"},{default:t(()=>[o(u,{modelValue:a.formData.duration,"onUpdate:modelValue":e[5]||(e[5]=r=>a.formData.duration=r),placeholder:"Unit: day, if empty, it's valid forever"},null,8,["modelValue"])]),_:1}),o(m,{label:"Description",prop:"description"},{default:t(()=>[o(u,{type:"textarea",modelValue:a.formData.description,"onUpdate:modelValue":e[6]||(e[6]=r=>a.formData.description=r),placeholder:""},null,8,["modelValue"])]),_:1}),o(m,null,{default:t(()=>[o(l,{type:"primary",onClick:e[7]||(e[7]=r=>g.submitAdd())},{default:t(()=>[K]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1})]),_:1})])}var X=H(T,[["render",L]]);export{X as default};
|
var C=Object.defineProperty,q=Object.defineProperties;var j=Object.getOwnPropertyDescriptors;var V=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var b=(a,e,n)=>e in a?C(a,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[e]=n,y=(a,e)=>{for(var n in e||(e={}))k.call(e,n)&&b(a,n,e[n]);if(V)for(var n of V(e))M.call(e,n)&&b(a,n,e[n]);return a},v=(a,e)=>q(a,j(e));import{G as B,B as I,d as R,u as E,r as G,o as $,H as h,t as N,e as s,f as S,g as A,k as o,w as t,E as F,l as c}from"./vendor.51c5b88d.js";import{_ as H,b as P,a as D}from"./index.82f228b9.js";const T={name:"MedalForm",setup(){const{proxy:a}=B();console.log("proxy",a);const e=I(null),n=R(),g=E(),{id:p}=n.query,d=G({token:P("token")||"",id:p,allClasses:[],formData:{name:"",description:"",image_large:"",image_small:"",duration:"",price:"",get_type:""},rules:{name:[{required:"true"}],price:[{required:"true"}],image_large:[{required:"true"}],image_small:[{required:"true"}],description:[{required:"true"}],get_type:[{required:"true"}]}});$(async()=>{p&&D.getMedal(p).then(l=>{d.formData.name=l.data.name,d.formData.image_large=l.data.image_large,d.formData.image_small=l.data.image_small,d.formData.description=l.data.description,d.formData.price=l.data.price,d.formData.duration=l.data.duration,d.formData.get_type=l.data.get_type})}),h(()=>{});const u=()=>{e.value.validate(async l=>{if(l){let i=d.formData;console.log(i),p?await D.updateMedal(p,i):await D.storeMedal(i),await g.push({name:"medal"})}})},m=l=>{const i=l.name.split(".")[1]||"";if(!["jpg","jpeg","png"].includes(i))return F.error("\u8BF7\u4E0A\u4F20 jpg\u3001jpeg\u3001png \u683C\u5F0F\u7684\u56FE\u7247"),!1},f=l=>{d.formData.goodsCoverImg=l.data||""},_=l=>{d.categoryId=l[2]||0};return v(y({},N(d)),{formRef:e,submitAdd:u,handleBeforeUpload:m,handleUrlSuccess:f,handleChangeCate:_})}},z=c("Exchange"),J=c("Grant"),K=c("Submit");function L(a,e,n,g,p,d){const u=s("el-input"),m=s("el-form-item"),f=s("el-radio"),_=s("el-radio-group"),l=s("el-button"),i=s("el-form"),U=s("el-col"),w=s("el-row");return S(),A("div",null,[o(w,null,{default:t(()=>[o(U,{span:12},{default:t(()=>[o(i,{model:a.formData,rules:a.rules,ref:"formRef","label-width":"200px",class:"formData"},{default:t(()=>[o(m,{label:"Name",prop:"name"},{default:t(()=>[o(u,{modelValue:a.formData.name,"onUpdate:modelValue":e[0]||(e[0]=r=>a.formData.name=r),placeholder:""},null,8,["modelValue"])]),_:1}),o(m,{label:"Price",prop:"price"},{default:t(()=>[o(u,{modelValue:a.formData.price,"onUpdate:modelValue":e[1]||(e[1]=r=>a.formData.price=r),placeholder:"Seed bonus"},null,8,["modelValue"])]),_:1}),o(m,{label:"Get type",prop:"get_type"},{default:t(()=>[o(_,{modelValue:a.formData.get_type,"onUpdate:modelValue":e[2]||(e[2]=r=>a.formData.get_type=r)},{default:t(()=>[o(f,{label:1},{default:t(()=>[z]),_:1}),o(f,{label:2},{default:t(()=>[J]),_:1})]),_:1},8,["modelValue"])]),_:1}),o(m,{label:"Image large",prop:"image_large"},{default:t(()=>[o(u,{modelValue:a.formData.image_large,"onUpdate:modelValue":e[3]||(e[3]=r=>a.formData.image_large=r),placeholder:""},null,8,["modelValue"])]),_:1}),o(m,{label:"Image small",prop:"image_small"},{default:t(()=>[o(u,{modelValue:a.formData.image_small,"onUpdate:modelValue":e[4]||(e[4]=r=>a.formData.image_small=r),placeholder:""},null,8,["modelValue"])]),_:1}),o(m,{label:"Duration",prop:"duration"},{default:t(()=>[o(u,{modelValue:a.formData.duration,"onUpdate:modelValue":e[5]||(e[5]=r=>a.formData.duration=r),placeholder:"Unit: day, if empty, it's valid forever"},null,8,["modelValue"])]),_:1}),o(m,{label:"Description",prop:"description"},{default:t(()=>[o(u,{type:"textarea",modelValue:a.formData.description,"onUpdate:modelValue":e[6]||(e[6]=r=>a.formData.description=r),placeholder:""},null,8,["modelValue"])]),_:1}),o(m,null,{default:t(()=>[o(l,{type:"primary",onClick:e[7]||(e[7]=r=>g.submitAdd())},{default:t(()=>[K]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1})]),_:1})])}var X=H(T,[["render",L]]);export{X as default};
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
|||||||
var y=Object.defineProperty,v=Object.defineProperties;var U=Object.getOwnPropertyDescriptors;var f=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var _=(o,e,a)=>e in o?y(o,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):o[e]=a,c=(o,e)=>{for(var a in e||(e={}))q.call(e,a)&&_(o,a,e[a]);if(f)for(var a of f(e))C.call(e,a)&&_(o,a,e[a]);return o},w=(o,e)=>v(o,U(e));import{G as R,B as k,d as B,u as $,r as g,o as j,H as A,t as E,e as m,f as N,g as P,k as r,w as l,l as x}from"./vendor.51c5b88d.js";import{_ as F,a as G}from"./index.76424d23.js";const H={name:"UserForm",setup(){const{proxy:o}=R();console.log("proxy",o);const e=k(null),a=B(),u=$(),{id:i}=a.query,d=g({id:i,formData:{username:"",email:"",password:"",password_confirmation:""},rules:{username:[{required:"true"}],email:[{required:"true",type:"email"}],password:[{required:"true",min:6,max:40}],password_confirmation:[{required:"true",min:6,max:40}]}});j(()=>{}),A(()=>{});const n=()=>{e.value.validate(async s=>{if(s){let p=d.formData;await G.storeUser(p),await u.push({name:"user"})}})};return w(c({},E(d)),{formRef:e,submitAdd:n})}},I=x("Submit");function M(o,e,a,u,i,d){const n=m("el-input"),s=m("el-form-item"),p=m("el-button"),V=m("el-form"),D=m("el-col"),b=m("el-row");return N(),P("div",null,[r(b,null,{default:l(()=>[r(D,{span:12},{default:l(()=>[r(V,{model:o.formData,rules:o.rules,ref:"formRef","label-width":"200px",class:"formData"},{default:l(()=>[r(s,{label:"Username",prop:"username"},{default:l(()=>[r(n,{modelValue:o.formData.username,"onUpdate:modelValue":e[0]||(e[0]=t=>o.formData.username=t),placeholder:""},null,8,["modelValue"])]),_:1}),r(s,{label:"Email",prop:"email"},{default:l(()=>[r(n,{modelValue:o.formData.email,"onUpdate:modelValue":e[1]||(e[1]=t=>o.formData.email=t),placeholder:""},null,8,["modelValue"])]),_:1}),r(s,{label:"Password",prop:"password"},{default:l(()=>[r(n,{type:"password",modelValue:o.formData.password,"onUpdate:modelValue":e[2]||(e[2]=t=>o.formData.password=t),placeholder:""},null,8,["modelValue"])]),_:1}),r(s,{label:"Password Confirmation",prop:"password_confirmation"},{default:l(()=>[r(n,{type:"password",modelValue:o.formData.password_confirmation,"onUpdate:modelValue":e[3]||(e[3]=t=>o.formData.password_confirmation=t),placeholder:""},null,8,["modelValue"])]),_:1}),r(s,null,{default:l(()=>[r(p,{type:"primary",onClick:e[4]||(e[4]=t=>u.submitAdd())},{default:l(()=>[I]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1})]),_:1})])}var J=F(H,[["render",M]]);export{J as default};
|
var y=Object.defineProperty,v=Object.defineProperties;var U=Object.getOwnPropertyDescriptors;var f=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var _=(o,e,a)=>e in o?y(o,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):o[e]=a,c=(o,e)=>{for(var a in e||(e={}))q.call(e,a)&&_(o,a,e[a]);if(f)for(var a of f(e))C.call(e,a)&&_(o,a,e[a]);return o},w=(o,e)=>v(o,U(e));import{G as R,B as k,d as B,u as $,r as g,o as j,H as A,t as E,e as m,f as N,g as P,k as r,w as l,l as x}from"./vendor.51c5b88d.js";import{_ as F,a as G}from"./index.82f228b9.js";const H={name:"UserForm",setup(){const{proxy:o}=R();console.log("proxy",o);const e=k(null),a=B(),u=$(),{id:i}=a.query,d=g({id:i,formData:{username:"",email:"",password:"",password_confirmation:""},rules:{username:[{required:"true"}],email:[{required:"true",type:"email"}],password:[{required:"true",min:6,max:40}],password_confirmation:[{required:"true",min:6,max:40}]}});j(()=>{}),A(()=>{});const n=()=>{e.value.validate(async s=>{if(s){let p=d.formData;await G.storeUser(p),await u.push({name:"user"})}})};return w(c({},E(d)),{formRef:e,submitAdd:n})}},I=x("Submit");function M(o,e,a,u,i,d){const n=m("el-input"),s=m("el-form-item"),p=m("el-button"),V=m("el-form"),b=m("el-col"),D=m("el-row");return N(),P("div",null,[r(D,null,{default:l(()=>[r(b,{span:12},{default:l(()=>[r(V,{model:o.formData,rules:o.rules,ref:"formRef","label-width":"200px",class:"formData"},{default:l(()=>[r(s,{label:"Username",prop:"username"},{default:l(()=>[r(n,{modelValue:o.formData.username,"onUpdate:modelValue":e[0]||(e[0]=t=>o.formData.username=t),placeholder:""},null,8,["modelValue"])]),_:1}),r(s,{label:"Email",prop:"email"},{default:l(()=>[r(n,{modelValue:o.formData.email,"onUpdate:modelValue":e[1]||(e[1]=t=>o.formData.email=t),placeholder:""},null,8,["modelValue"])]),_:1}),r(s,{label:"Password",prop:"password"},{default:l(()=>[r(n,{type:"password",modelValue:o.formData.password,"onUpdate:modelValue":e[2]||(e[2]=t=>o.formData.password=t),placeholder:""},null,8,["modelValue"])]),_:1}),r(s,{label:"Password Confirmation",prop:"password_confirmation"},{default:l(()=>[r(n,{type:"password",modelValue:o.formData.password_confirmation,"onUpdate:modelValue":e[3]||(e[3]=t=>o.formData.password_confirmation=t),placeholder:""},null,8,["modelValue"])]),_:1}),r(s,null,{default:l(()=>[r(p,{type:"primary",onClick:e[4]||(e[4]=t=>u.submitAdd())},{default:l(()=>[I]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1})]),_:1})])}var J=F(H,[["render",M]]);export{J as default};
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
|||||||
var S=Object.defineProperty;var y=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var T=(t,l,s)=>l in t?S(t,l,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[l]=s,k=(t,l)=>{for(var s in l||(l={}))V.call(l,s)&&T(t,s,l[s]);if(y)for(var s of y(l))$.call(l,s)&&T(t,s,l[s]);return t};import{u as j,r as A,o as B,t as L,e as i,y as N,f as n,g as _,k as a,w as e,z as w,F as f,l as p,j as c,q as m,A as D}from"./vendor.51c5b88d.js";import{_ as C,a as z}from"./index.76424d23.js";const E={name:"Dashboard",emits:["updateVersion"],setup(t,l){j();const s=A({statData:{loading:!0,user:{},torrent:{},user_class:{},system_info:{}},latestUser:{loading:!0,data:[]},latestTorrent:{loading:!0,data:[]}});return B(()=>{z.listStatData().then(d=>{s.statData=d.data,s.statData.loading=!1,l.emit("updateVersion",d.data.system_info.data)}),z.listLatestUser().then(d=>{s.latestUser.data=d.data,s.latestUser.loading=!1}),z.listLatestTorrent().then(d=>{s.latestTorrent.data=d.data,s.latestTorrent.loading=!1})}),k({},L(s))}};function F(t,l,s,d,R,q){const o=i("el-table-column"),U=i("el-table"),x=i("el-card"),u=i("el-col"),v=i("el-row"),b=i("el-descriptions-item"),g=i("el-descriptions"),h=N("loading");return n(),_(f,null,[a(v,null,{default:e(()=>[a(u,{span:12,class:"stat-box"},{default:e(()=>[a(x,null,{header:e(()=>[p(c(t.latestUser.data.page_title),1)]),default:e(()=>[w((n(),m(U,{data:t.latestUser.data.data,size:"mini"},{default:e(()=>[a(o,{prop:"username",label:"Username"}),a(o,{prop:"email",label:"Email"}),a(o,{prop:"status",label:"Status"}),a(o,{prop:"added",label:"Added",width:"180"})]),_:1},8,["data"])),[[h,t.latestUser.loading]])]),_:1})]),_:1}),a(u,{span:12,class:"stat-box"},{default:e(()=>[a(x,null,{header:e(()=>[p(c(t.latestTorrent.data.page_title),1)]),default:e(()=>[w((n(),m(U,{data:t.latestTorrent.data.data,size:"mini"},{default:e(()=>[a(o,{prop:"name",label:"Name"}),a(o,{prop:"user.username",label:"User",width:"150"}),a(o,{prop:"size_human",label:"Size",width:"100"}),a(o,{prop:"added",label:"Added",width:"180"})]),_:1},8,["data"])),[[h,t.latestTorrent.loading]])]),_:1})]),_:1})]),_:1}),w((n(),_("div",null,[a(v,{class:"row"},{default:e(()=>[a(u,{span:12,class:"stat-box"},{default:e(()=>[a(g,{title:t.statData.user.text,column:2,size:"mini",border:""},{default:e(()=>[(n(!0),_(f,null,D(t.statData.user.data,r=>(n(),m(b,{label:r.text},{default:e(()=>[p(c(r.value),1)]),_:2},1032,["label"]))),256))]),_:1},8,["title"])]),_:1}),a(u,{span:12,class:"stat-box"},{default:e(()=>[a(g,{title:t.statData.user_class.text,column:2,size:"mini",border:""},{default:e(()=>[(n(!0),_(f,null,D(t.statData.user_class.data,r=>(n(),m(b,{label:r.class_text},{default:e(()=>[p(c(r.counts),1)]),_:2},1032,["label"]))),256))]),_:1},8,["title"])]),_:1})]),_:1}),a(v,{class:"row"},{default:e(()=>[a(u,{span:12,class:"stat-box"},{default:e(()=>[a(g,{title:t.statData.torrent.text,column:2,size:"mini",border:""},{default:e(()=>[(n(!0),_(f,null,D(t.statData.torrent.data,r=>(n(),m(b,{label:r.text},{default:e(()=>[p(c(r.value),1)]),_:2},1032,["label"]))),256))]),_:1},8,["title"])]),_:1}),a(u,{span:12,class:"stat-box"},{default:e(()=>[a(g,{title:t.statData.system_info.text,column:2,size:"mini",border:""},{default:e(()=>[(n(!0),_(f,null,D(t.statData.system_info.data,r=>(n(),m(b,{label:r.text},{default:e(()=>[p(c(r.value),1)]),_:2},1032,["label"]))),256))]),_:1},8,["title"])]),_:1})]),_:1})])),[[h,t.statData.loading]])],64)}var H=C(E,[["render",F],["__scopeId","data-v-64158476"]]);export{H as default};
|
var S=Object.defineProperty;var y=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var T=(t,l,s)=>l in t?S(t,l,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[l]=s,k=(t,l)=>{for(var s in l||(l={}))V.call(l,s)&&T(t,s,l[s]);if(y)for(var s of y(l))$.call(l,s)&&T(t,s,l[s]);return t};import{u as j,r as A,o as B,t as L,e as i,y as N,f as n,g as _,k as a,w as e,z as w,F as f,l as p,j as c,q as m,A as D}from"./vendor.51c5b88d.js";import{_ as C,a as z}from"./index.82f228b9.js";const E={name:"Dashboard",emits:["updateVersion"],setup(t,l){j();const s=A({statData:{loading:!0,user:{},torrent:{},user_class:{},system_info:{}},latestUser:{loading:!0,data:[]},latestTorrent:{loading:!0,data:[]}});return B(()=>{z.listStatData().then(d=>{s.statData=d.data,s.statData.loading=!1,l.emit("updateVersion",d.data.system_info.data)}),z.listLatestUser().then(d=>{s.latestUser.data=d.data,s.latestUser.loading=!1}),z.listLatestTorrent().then(d=>{s.latestTorrent.data=d.data,s.latestTorrent.loading=!1})}),k({},L(s))}};function F(t,l,s,d,R,q){const o=i("el-table-column"),U=i("el-table"),x=i("el-card"),u=i("el-col"),v=i("el-row"),b=i("el-descriptions-item"),g=i("el-descriptions"),h=N("loading");return n(),_(f,null,[a(v,null,{default:e(()=>[a(u,{span:12,class:"stat-box"},{default:e(()=>[a(x,null,{header:e(()=>[p(c(t.latestUser.data.page_title),1)]),default:e(()=>[w((n(),m(U,{data:t.latestUser.data.data,size:"mini"},{default:e(()=>[a(o,{prop:"username",label:"Username"}),a(o,{prop:"email",label:"Email"}),a(o,{prop:"status",label:"Status"}),a(o,{prop:"added",label:"Added",width:"180"})]),_:1},8,["data"])),[[h,t.latestUser.loading]])]),_:1})]),_:1}),a(u,{span:12,class:"stat-box"},{default:e(()=>[a(x,null,{header:e(()=>[p(c(t.latestTorrent.data.page_title),1)]),default:e(()=>[w((n(),m(U,{data:t.latestTorrent.data.data,size:"mini"},{default:e(()=>[a(o,{prop:"name",label:"Name"}),a(o,{prop:"user.username",label:"User",width:"150"}),a(o,{prop:"size_human",label:"Size",width:"100"}),a(o,{prop:"added",label:"Added",width:"180"})]),_:1},8,["data"])),[[h,t.latestTorrent.loading]])]),_:1})]),_:1})]),_:1}),w((n(),_("div",null,[a(v,{class:"row"},{default:e(()=>[a(u,{span:12,class:"stat-box"},{default:e(()=>[a(g,{title:t.statData.user.text,column:2,size:"mini",border:""},{default:e(()=>[(n(!0),_(f,null,D(t.statData.user.data,r=>(n(),m(b,{label:r.text},{default:e(()=>[p(c(r.value),1)]),_:2},1032,["label"]))),256))]),_:1},8,["title"])]),_:1}),a(u,{span:12,class:"stat-box"},{default:e(()=>[a(g,{title:t.statData.user_class.text,column:2,size:"mini",border:""},{default:e(()=>[(n(!0),_(f,null,D(t.statData.user_class.data,r=>(n(),m(b,{label:r.class_text},{default:e(()=>[p(c(r.counts),1)]),_:2},1032,["label"]))),256))]),_:1},8,["title"])]),_:1})]),_:1}),a(v,{class:"row"},{default:e(()=>[a(u,{span:12,class:"stat-box"},{default:e(()=>[a(g,{title:t.statData.torrent.text,column:2,size:"mini",border:""},{default:e(()=>[(n(!0),_(f,null,D(t.statData.torrent.data,r=>(n(),m(b,{label:r.text},{default:e(()=>[p(c(r.value),1)]),_:2},1032,["label"]))),256))]),_:1},8,["title"])]),_:1}),a(u,{span:12,class:"stat-box"},{default:e(()=>[a(g,{title:t.statData.system_info.text,column:2,size:"mini",border:""},{default:e(()=>[(n(!0),_(f,null,D(t.statData.system_info.data,r=>(n(),m(b,{label:r.text},{default:e(()=>[p(c(r.value),1)]),_:2},1032,["label"]))),256))]),_:1},8,["title"])]),_:1})]),_:1})])),[[h,t.statData.loading]])],64)}var H=C(E,[["render",F],["__scopeId","data-v-64158476"]]);export{H as default};
|
||||||
1
admin/dist/assets/index.58869ca0.css
vendored
Normal file
1
admin/dist/assets/index.58869ca0.css
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.swiper-container[data-v-63382e05]{min-height:100%}.el-card.is-always-shadow[data-v-63382e05]{min-height:100%!important}
|
||||||
File diff suppressed because one or more lines are too long
1
admin/dist/assets/index.5ab5ad3d.js
vendored
Normal file
1
admin/dist/assets/index.5ab5ad3d.js
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
var k=Object.defineProperty,S=Object.defineProperties;var M=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var f=(e,a,t)=>a in e?k(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,b=(e,a)=>{for(var t in a||(a={}))I.call(a,t)&&f(e,t,a[t]);if(g)for(var t of g(a))q.call(a,t)&&f(e,t,a[t]);return e},v=(e,a)=>S(e,M(a));import{B,u as P,o as A,t as H,e as c,y as L,f as w,q as x,w as r,E as N,h as i,k as n,z as j,p as z,m as V,l as R}from"./vendor.51c5b88d.js";import{_ as $,a as y}from"./index.82f228b9.js";import{u as F,r as G}from"./table.37673c89.js";const J={name:"ExamTable",setup(){const e=B(null),a=P(),t=F();A(()=>{console.log("ExamTable onMounted"),s()});const s=async()=>{t.loading=!0;let l=await y.listExam(t.query);G(l,t),t.loading=!1},h=()=>{a.push({name:"exam-form"})},m=l=>{a.push({path:"/exam-form",query:{id:l}})},p=async l=>{let u=await y.deleteExam(l);N.success(u.msg),t.query.page=1,await s()},o=l=>{t.multipleSelection=l},_=l=>{t.query.page=l,s()};return v(b({},H(t)),{multipleTable:e,handleSelectionChange:o,handleAdd:h,handleEdit:m,handleDelete:p,fetchTableData:s,changePage:_})}},C=e=>(z("data-v-12252344"),e=e(),V(),e),K={class:"nexus-table-header"},O=C(()=>i("div",{class:"left"},null,-1)),Q={class:"right"},U=R("Add"),W=["innerHTML"],X=["innerHTML"],Y=["onClick"],Z=C(()=>i("a",{style:{cursor:"pointer"}},"Delete",-1));function ee(e,a,t,s,h,m){const p=c("el-button"),o=c("el-table-column"),_=c("el-popconfirm"),l=c("el-table"),u=c("el-pagination"),T=c("el-card"),D=L("loading");return w(),x(T,{class:""},{header:r(()=>[i("div",K,[O,i("div",Q,[n(p,{type:"primary",icon:"Plus",onClick:s.handleAdd},{default:r(()=>[U]),_:1},8,["onClick"])])])]),default:r(()=>[j((w(),x(l,{ref:"multipleTable",data:e.tableData,"tooltip-effect":"dark",onSelectionChange:s.handleSelectionChange},{default:r(()=>[n(o,{type:"selection",width:"55"}),n(o,{prop:"id",label:"Id",width:"50"}),n(o,{prop:"name",label:"Name"}),n(o,{label:"Indexes",width:"250px"},{default:r(d=>[i("p",{style:{"white-space":"pre-line"},innerHTML:d.row.indexes_formatted},null,8,W)]),_:1}),n(o,{prop:"begin",label:"Begin",width:"160"}),n(o,{prop:"end",label:"End",width:"160"}),n(o,{prop:"duration_text",label:"Duration"}),n(o,{label:"Target users",width:"350px"},{default:r(d=>[i("p",{style:{"white-space":"pre-line"},innerHTML:d.row.filters_formatted},null,8,X)]),_:1}),n(o,{prop:"is_discovered_text",label:"Discovered"}),n(o,{prop:"status_text",label:"Status"}),n(o,{label:"Action",width:"100"},{default:r(d=>[i("a",{style:{cursor:"pointer","margin-right":"10px"},onClick:E=>s.handleEdit(d.row.id)},"Edit",8,Y),n(_,{title:"Confirm Delete ?",onConfirm:E=>s.handleDelete(d.row.id)},{reference:r(()=>[Z]),_:2},1032,["onConfirm"])]),_:1})]),_:1},8,["data","onSelectionChange"])),[[D,e.loading]]),n(u,{background:"",layout:"prev, pager, next",total:e.total,"page-size":e.perPage,"current-page":e.currentPage,onCurrentChange:s.changePage},null,8,["total","page-size","current-page","onCurrentChange"])]),_:1})}var le=$(J,[["render",ee],["__scopeId","data-v-12252344"]]);export{le as default};
|
||||||
1
admin/dist/assets/index.6213754b.css
vendored
1
admin/dist/assets/index.6213754b.css
vendored
@@ -1 +0,0 @@
|
|||||||
.swiper-container[data-v-70815ba2]{min-height:100%}.el-card.is-always-shadow[data-v-70815ba2]{min-height:100%!important}
|
|
||||||
1
admin/dist/assets/index.6f7f7f2e.css
vendored
Normal file
1
admin/dist/assets/index.6f7f7f2e.css
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.swiper-container[data-v-12252344]{min-height:100%}.el-card.is-always-shadow[data-v-12252344]{min-height:100%!important}
|
||||||
@@ -1 +1 @@
|
|||||||
var E=Object.defineProperty,F=Object.defineProperties;var P=Object.getOwnPropertyDescriptors;var k=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var D=(e,a,t)=>a in e?E(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,q=(e,a)=>{for(var t in a||(a={}))V.call(a,t)&&D(e,t,a[t]);if(k)for(var t of k(a))B.call(a,t)&&D(e,t,a[t]);return e},T=(e,a)=>F(e,P(a));import{B as R,u as M,r as N,o as j,t as z,e as s,y as L,f,q as C,w as r,E as Q,h as p,k as l,g as U,A as G,F as H,z as J,l as v,p as K,m as O}from"./vendor.51c5b88d.js";import{_ as W,a as w}from"./index.76424d23.js";import{u as X,r as Y}from"./table.37673c89.js";const Z={name:"ClientTable",setup(){const e=R(null),a=M(),t=X();let n=N({agentAllows:[]});j(()=>{console.log("MedalTable onMounted"),c()});const c=async()=>{t.loading=!0,await y();let o=await w.listAgentDeny(t.query);Y(o,t),t.loading=!1},A=()=>{a.push({name:"agent-deny-form"})},g=o=>{a.push({path:"/agent-deny-form",query:{id:o}})},h=async o=>{let u=await w.deleteAgentDeny(o);Q.success(u.msg),t.query.page=1,await c()},m=o=>{t.multipleSelection=o},_=o=>{t.query.page=o,c()},y=async()=>{let o=await w.listAllAgentAllow();n.agentAllows=o.data},i=()=>{t.query.family_id=""},b=(o,u)=>o.family.family;return T(q({},z(t)),{extraData:n,multipleTable:e,handleSelectionChange:m,handleAdd:A,handleEdit:g,handleDelete:h,fetchTableData:c,changePage:_,handleReset:i,formatColumnFamilyId:b})}},$=e=>(K("data-v-1119bb88"),e=e(),O(),e),ee={class:"nexus-table-header"},te={class:"left"},ae=v("Query"),le=v("Reset"),oe={class:"right"},ne=v("Add"),re=["onClick"],se=$(()=>p("a",{style:{cursor:"pointer"}},"Delete",-1));function ie(e,a,t,n,c,A){const g=s("el-option"),h=s("el-select"),m=s("el-form-item"),_=s("el-button"),y=s("el-form"),i=s("el-table-column"),b=s("el-popconfirm"),o=s("el-table"),u=s("el-pagination"),S=s("el-card"),I=L("loading");return f(),C(S,{class:""},{header:r(()=>[p("div",ee,[p("div",te,[l(y,{inline:!0,model:e.query},{default:r(()=>[l(m,{label:""},{default:r(()=>[l(h,{modelValue:e.query.family_id,"onUpdate:modelValue":a[0]||(a[0]=d=>e.query.family_id=d),filterable:"",placeholder:"Family"},{default:r(()=>[(f(!0),U(H,null,G(n.extraData.agentAllows,d=>(f(),C(g,{key:d.id,label:d.family,value:d.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(m,null,{default:r(()=>[l(_,{type:"primary",onClick:n.fetchTableData},{default:r(()=>[ae]),_:1},8,["onClick"]),l(_,{type:"primary",onClick:n.handleReset},{default:r(()=>[le]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),p("div",oe,[l(_,{type:"primary",icon:"Plus",onClick:n.handleAdd},{default:r(()=>[ne]),_:1},8,["onClick"])])])]),default:r(()=>[J((f(),C(o,{ref:"multipleTable",data:e.tableData,"tooltip-effect":"dark",onSelectionChange:n.handleSelectionChange},{default:r(()=>[l(i,{type:"selection",width:"55"}),l(i,{prop:"id",label:"Id",width:"50"}),l(i,{prop:"family_id",label:"Family",formatter:n.formatColumnFamilyId},null,8,["formatter"]),l(i,{prop:"name",label:"Name"}),l(i,{prop:"peer_id",label:"Peer id"}),l(i,{prop:"agent",label:"Agent"}),l(i,{label:"Action",width:"120"},{default:r(d=>[p("a",{style:{cursor:"pointer","margin-right":"10px"},onClick:x=>n.handleEdit(d.row.id)},"Edit",8,re),l(b,{title:"Confirm Delete ?",onConfirm:x=>n.handleDelete(d.row.id)},{reference:r(()=>[se]),_:2},1032,["onConfirm"])]),_:1})]),_:1},8,["data","onSelectionChange"])),[[I,e.loading]]),l(u,{background:"",layout:"prev, pager, next",total:e.total,"page-size":e.perPage,"current-page":e.currentPage,onCurrentChange:n.changePage},null,8,["total","page-size","current-page","onCurrentChange"])]),_:1})}var me=W(Z,[["render",ie],["__scopeId","data-v-1119bb88"]]);export{me as default};
|
var E=Object.defineProperty,F=Object.defineProperties;var P=Object.getOwnPropertyDescriptors;var k=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var D=(e,a,t)=>a in e?E(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,q=(e,a)=>{for(var t in a||(a={}))V.call(a,t)&&D(e,t,a[t]);if(k)for(var t of k(a))B.call(a,t)&&D(e,t,a[t]);return e},T=(e,a)=>F(e,P(a));import{B as R,u as M,r as N,o as j,t as z,e as s,y as L,f,q as C,w as r,E as Q,h as p,k as l,g as U,A as G,F as H,z as J,l as v,p as K,m as O}from"./vendor.51c5b88d.js";import{_ as W,a as w}from"./index.82f228b9.js";import{u as X,r as Y}from"./table.37673c89.js";const Z={name:"ClientTable",setup(){const e=R(null),a=M(),t=X();let n=N({agentAllows:[]});j(()=>{console.log("MedalTable onMounted"),c()});const c=async()=>{t.loading=!0,await y();let o=await w.listAgentDeny(t.query);Y(o,t),t.loading=!1},A=()=>{a.push({name:"agent-deny-form"})},g=o=>{a.push({path:"/agent-deny-form",query:{id:o}})},h=async o=>{let u=await w.deleteAgentDeny(o);Q.success(u.msg),t.query.page=1,await c()},m=o=>{t.multipleSelection=o},_=o=>{t.query.page=o,c()},y=async()=>{let o=await w.listAllAgentAllow();n.agentAllows=o.data},i=()=>{t.query.family_id=""},b=(o,u)=>o.family.family;return T(q({},z(t)),{extraData:n,multipleTable:e,handleSelectionChange:m,handleAdd:A,handleEdit:g,handleDelete:h,fetchTableData:c,changePage:_,handleReset:i,formatColumnFamilyId:b})}},$=e=>(K("data-v-1119bb88"),e=e(),O(),e),ee={class:"nexus-table-header"},te={class:"left"},ae=v("Query"),le=v("Reset"),oe={class:"right"},ne=v("Add"),re=["onClick"],se=$(()=>p("a",{style:{cursor:"pointer"}},"Delete",-1));function ie(e,a,t,n,c,A){const g=s("el-option"),h=s("el-select"),m=s("el-form-item"),_=s("el-button"),y=s("el-form"),i=s("el-table-column"),b=s("el-popconfirm"),o=s("el-table"),u=s("el-pagination"),S=s("el-card"),I=L("loading");return f(),C(S,{class:""},{header:r(()=>[p("div",ee,[p("div",te,[l(y,{inline:!0,model:e.query},{default:r(()=>[l(m,{label:""},{default:r(()=>[l(h,{modelValue:e.query.family_id,"onUpdate:modelValue":a[0]||(a[0]=d=>e.query.family_id=d),filterable:"",placeholder:"Family"},{default:r(()=>[(f(!0),U(H,null,G(n.extraData.agentAllows,d=>(f(),C(g,{key:d.id,label:d.family,value:d.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(m,null,{default:r(()=>[l(_,{type:"primary",onClick:n.fetchTableData},{default:r(()=>[ae]),_:1},8,["onClick"]),l(_,{type:"primary",onClick:n.handleReset},{default:r(()=>[le]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),p("div",oe,[l(_,{type:"primary",icon:"Plus",onClick:n.handleAdd},{default:r(()=>[ne]),_:1},8,["onClick"])])])]),default:r(()=>[J((f(),C(o,{ref:"multipleTable",data:e.tableData,"tooltip-effect":"dark",onSelectionChange:n.handleSelectionChange},{default:r(()=>[l(i,{type:"selection",width:"55"}),l(i,{prop:"id",label:"Id",width:"50"}),l(i,{prop:"family_id",label:"Family",formatter:n.formatColumnFamilyId},null,8,["formatter"]),l(i,{prop:"name",label:"Name"}),l(i,{prop:"peer_id",label:"Peer id"}),l(i,{prop:"agent",label:"Agent"}),l(i,{label:"Action",width:"120"},{default:r(d=>[p("a",{style:{cursor:"pointer","margin-right":"10px"},onClick:x=>n.handleEdit(d.row.id)},"Edit",8,re),l(b,{title:"Confirm Delete ?",onConfirm:x=>n.handleDelete(d.row.id)},{reference:r(()=>[se]),_:2},1032,["onConfirm"])]),_:1})]),_:1},8,["data","onSelectionChange"])),[[I,e.loading]]),l(u,{background:"",layout:"prev, pager, next",total:e.total,"page-size":e.perPage,"current-page":e.currentPage,onCurrentChange:n.changePage},null,8,["total","page-size","current-page","onCurrentChange"])]),_:1})}var me=W(Z,[["render",ie],["__scopeId","data-v-1119bb88"]]);export{me as default};
|
||||||
1
admin/dist/assets/index.76424d23.js
vendored
1
admin/dist/assets/index.76424d23.js
vendored
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
|||||||
var A=Object.defineProperty,B=Object.defineProperties;var P=Object.getOwnPropertyDescriptors;var S=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var U=(a,t,e)=>t in a?A(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,T=(a,t)=>{for(var e in t||(t={}))R.call(t,e)&&U(a,e,t[e]);if(S)for(var e of S(t))j.call(t,e)&&U(a,e,t[e]);return a},E=(a,t)=>B(a,P(t));import{B as z,u as N,r as F,o as I,t as L,e as u,y as M,f as _,q as D,w as d,E as x,h as f,k as l,g as Q,A as G,F as H,z as J,l as k}from"./vendor.51c5b88d.js";import{_ as K,a as v}from"./index.76424d23.js";import{u as O,r as W,a as X}from"./table.37673c89.js";const Y={name:"UserTable",setup(){const a=z(null),t=N(),e=O();let s=F({classes:[]});I(()=>{v.listClass().then(function(o){s.classes=o.data}),c()});const c=async()=>{e.loading=!0;let o=await v.listUser(e.query);W(o,e),e.loading=!1},V=()=>{t.push({name:"user-form"})},m=o=>{t.push({name:"user-form",query:{id:o}})},i=async o=>{let n=await v.deleteExam(o);x.success(n.msg),e.query.page=1,await c()},h=o=>{e.multipleSelection=o},b=o=>{e.query.page=o,c()},p=o=>{X(o,e),c()},g=()=>{e.query.id="",e.query.username="",e.query.email="",e.query.class="",e.query.sort_field="",e.query.sort_type=""},r=o=>{t.push({name:"user-detail",query:{id:o}})},y=(o,n)=>o.class_text,C=(o,n)=>o.uploaded_text,q=(o,n)=>o.downloaded_text;return E(T({},L(e)),{multipleTable:a,extraData:s,handleSelectionChange:h,handleAdd:V,handleEdit:m,handleDelete:i,handleDetail:r,fetchTableData:c,changePage:b,handleSortChange:p,formatColumnClass:y,formatColumnUploaded:C,formatColumnDownloaded:q,handleReset:g})}},Z={class:"nexus-table-header"},$={class:"left"},ee=k("Query"),le=k("Reset"),ae={class:"right"},te=k("Add"),oe=["onClick"];function ne(a,t,e,s,c,V){const m=u("el-input"),i=u("el-form-item"),h=u("el-option"),b=u("el-select"),p=u("el-button"),g=u("el-form"),r=u("el-table-column"),y=u("el-table"),C=u("el-pagination"),q=u("el-card"),o=M("loading");return _(),D(q,null,{header:d(()=>[f("div",Z,[f("div",$,[l(g,{inline:!0,model:a.query},{default:d(()=>[l(i,{label:""},{default:d(()=>[l(m,{placeholder:"ID",modelValue:a.query.id,"onUpdate:modelValue":t[0]||(t[0]=n=>a.query.id=n)},null,8,["modelValue"])]),_:1}),l(i,{label:""},{default:d(()=>[l(m,{placeholder:"Username",modelValue:a.query.username,"onUpdate:modelValue":t[1]||(t[1]=n=>a.query.username=n)},null,8,["modelValue"])]),_:1}),l(i,{label:""},{default:d(()=>[l(m,{placeholder:"Email",modelValue:a.query.email,"onUpdate:modelValue":t[2]||(t[2]=n=>a.query.email=n)},null,8,["modelValue"])]),_:1}),l(i,{label:""},{default:d(()=>[l(b,{modelValue:a.query.class,"onUpdate:modelValue":t[3]||(t[3]=n=>a.query.class=n),filterable:"",placeholder:"Class"},{default:d(()=>[(_(!0),Q(H,null,G(s.extraData.classes,(n,w)=>(_(),D(h,{key:w,label:n,value:w},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(i,null,{default:d(()=>[l(p,{type:"primary",onClick:s.fetchTableData},{default:d(()=>[ee]),_:1},8,["onClick"]),l(p,{type:"primary",onClick:s.handleReset},{default:d(()=>[le]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),f("div",ae,[l(p,{type:"primary",icon:"Plus",onClick:s.handleAdd},{default:d(()=>[te]),_:1},8,["onClick"])])])]),default:d(()=>[J((_(),D(y,{ref:"multipleTable",data:a.tableData,"tooltip-effect":"dark",onSortChange:s.handleSortChange,onSelectionChange:s.handleSelectionChange},{default:d(()=>[l(r,{type:"selection",width:"55"}),l(r,{prop:"id",label:"Id",width:"80",sortable:"custom"}),l(r,{prop:"username",label:"Username",sortable:"custom"}),l(r,{prop:"email",label:"Email",width:"200"}),l(r,{prop:"class",label:"Class",sortable:"custom",width:"120",formatter:s.formatColumnClass},null,8,["formatter"]),l(r,{prop:"uploaded",label:"Uploaded",sortable:"custom",formatter:s.formatColumnUploaded},null,8,["formatter"]),l(r,{prop:"downloaded",label:"Downloaded",sortable:"custom",formatter:s.formatColumnDownloaded},null,8,["formatter"]),l(r,{prop:"bonus",label:"Bonus"}),l(r,{prop:"status",label:"Status",width:"100"}),l(r,{prop:"enabled",label:"Enabled",width:"100"}),l(r,{prop:"last_access",label:"Last access",width:"150"}),l(r,{prop:"added",label:"Added",width:"150"}),l(r,{label:"Action",width:"100"},{default:d(n=>[f("a",{style:{cursor:"pointer","margin-right":"10px"},onClick:w=>s.handleDetail(n.row.id)},"Detail",8,oe)]),_:1})]),_:1},8,["data","onSortChange","onSelectionChange"])),[[o,a.loading]]),l(C,{background:"",layout:"prev, pager, next",total:a.total,"page-size":a.perPage,"current-page":a.currentPage,onCurrentChange:s.changePage},null,8,["total","page-size","current-page","onCurrentChange"])]),_:1})}var ie=K(Y,[["render",ne]]);export{ie as default};
|
var A=Object.defineProperty,B=Object.defineProperties;var P=Object.getOwnPropertyDescriptors;var S=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var U=(a,t,e)=>t in a?A(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,T=(a,t)=>{for(var e in t||(t={}))R.call(t,e)&&U(a,e,t[e]);if(S)for(var e of S(t))j.call(t,e)&&U(a,e,t[e]);return a},E=(a,t)=>B(a,P(t));import{B as z,u as N,r as F,o as I,t as L,e as u,y as M,f as _,q as D,w as d,E as x,h as f,k as l,g as Q,A as G,F as H,z as J,l as k}from"./vendor.51c5b88d.js";import{_ as K,a as v}from"./index.82f228b9.js";import{u as O,r as W,a as X}from"./table.37673c89.js";const Y={name:"UserTable",setup(){const a=z(null),t=N(),e=O();let s=F({classes:[]});I(()=>{v.listClass().then(function(o){s.classes=o.data}),c()});const c=async()=>{e.loading=!0;let o=await v.listUser(e.query);W(o,e),e.loading=!1},V=()=>{t.push({name:"user-form"})},m=o=>{t.push({name:"user-form",query:{id:o}})},i=async o=>{let n=await v.deleteExam(o);x.success(n.msg),e.query.page=1,await c()},h=o=>{e.multipleSelection=o},b=o=>{e.query.page=o,c()},p=o=>{X(o,e),c()},g=()=>{e.query.id="",e.query.username="",e.query.email="",e.query.class="",e.query.sort_field="",e.query.sort_type=""},r=o=>{t.push({name:"user-detail",query:{id:o}})},y=(o,n)=>o.class_text,C=(o,n)=>o.uploaded_text,q=(o,n)=>o.downloaded_text;return E(T({},L(e)),{multipleTable:a,extraData:s,handleSelectionChange:h,handleAdd:V,handleEdit:m,handleDelete:i,handleDetail:r,fetchTableData:c,changePage:b,handleSortChange:p,formatColumnClass:y,formatColumnUploaded:C,formatColumnDownloaded:q,handleReset:g})}},Z={class:"nexus-table-header"},$={class:"left"},ee=k("Query"),le=k("Reset"),ae={class:"right"},te=k("Add"),oe=["onClick"];function ne(a,t,e,s,c,V){const m=u("el-input"),i=u("el-form-item"),h=u("el-option"),b=u("el-select"),p=u("el-button"),g=u("el-form"),r=u("el-table-column"),y=u("el-table"),C=u("el-pagination"),q=u("el-card"),o=M("loading");return _(),D(q,null,{header:d(()=>[f("div",Z,[f("div",$,[l(g,{inline:!0,model:a.query},{default:d(()=>[l(i,{label:""},{default:d(()=>[l(m,{placeholder:"ID",modelValue:a.query.id,"onUpdate:modelValue":t[0]||(t[0]=n=>a.query.id=n)},null,8,["modelValue"])]),_:1}),l(i,{label:""},{default:d(()=>[l(m,{placeholder:"Username",modelValue:a.query.username,"onUpdate:modelValue":t[1]||(t[1]=n=>a.query.username=n)},null,8,["modelValue"])]),_:1}),l(i,{label:""},{default:d(()=>[l(m,{placeholder:"Email",modelValue:a.query.email,"onUpdate:modelValue":t[2]||(t[2]=n=>a.query.email=n)},null,8,["modelValue"])]),_:1}),l(i,{label:""},{default:d(()=>[l(b,{modelValue:a.query.class,"onUpdate:modelValue":t[3]||(t[3]=n=>a.query.class=n),filterable:"",placeholder:"Class"},{default:d(()=>[(_(!0),Q(H,null,G(s.extraData.classes,(n,w)=>(_(),D(h,{key:w,label:n,value:w},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(i,null,{default:d(()=>[l(p,{type:"primary",onClick:s.fetchTableData},{default:d(()=>[ee]),_:1},8,["onClick"]),l(p,{type:"primary",onClick:s.handleReset},{default:d(()=>[le]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),f("div",ae,[l(p,{type:"primary",icon:"Plus",onClick:s.handleAdd},{default:d(()=>[te]),_:1},8,["onClick"])])])]),default:d(()=>[J((_(),D(y,{ref:"multipleTable",data:a.tableData,"tooltip-effect":"dark",onSortChange:s.handleSortChange,onSelectionChange:s.handleSelectionChange},{default:d(()=>[l(r,{type:"selection",width:"55"}),l(r,{prop:"id",label:"Id",width:"80",sortable:"custom"}),l(r,{prop:"username",label:"Username",sortable:"custom"}),l(r,{prop:"email",label:"Email",width:"200"}),l(r,{prop:"class",label:"Class",sortable:"custom",width:"120",formatter:s.formatColumnClass},null,8,["formatter"]),l(r,{prop:"uploaded",label:"Uploaded",sortable:"custom",formatter:s.formatColumnUploaded},null,8,["formatter"]),l(r,{prop:"downloaded",label:"Downloaded",sortable:"custom",formatter:s.formatColumnDownloaded},null,8,["formatter"]),l(r,{prop:"bonus",label:"Bonus"}),l(r,{prop:"status",label:"Status",width:"100"}),l(r,{prop:"enabled",label:"Enabled",width:"100"}),l(r,{prop:"last_access",label:"Last access",width:"150"}),l(r,{prop:"added",label:"Added",width:"150"}),l(r,{label:"Action",width:"100"},{default:d(n=>[f("a",{style:{cursor:"pointer","margin-right":"10px"},onClick:w=>s.handleDetail(n.row.id)},"Detail",8,oe)]),_:1})]),_:1},8,["data","onSortChange","onSelectionChange"])),[[o,a.loading]]),l(C,{background:"",layout:"prev, pager, next",total:a.total,"page-size":a.perPage,"current-page":a.currentPage,onCurrentChange:s.changePage},null,8,["total","page-size","current-page","onCurrentChange"])]),_:1})}var ie=K(Y,[["render",ne]]);export{ie as default};
|
||||||
1
admin/dist/assets/index.82f228b9.js
vendored
Normal file
1
admin/dist/assets/index.82f228b9.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
admin/dist/assets/index.927b5fc8.css
vendored
Normal file
1
admin/dist/assets/index.927b5fc8.css
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.swiper-container[data-v-17cb21d2]{min-height:100%}.el-card.is-always-shadow[data-v-17cb21d2]{min-height:100%!important}
|
||||||
1
admin/dist/assets/index.a288625d.js
vendored
Normal file
1
admin/dist/assets/index.a288625d.js
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
var M=Object.defineProperty,P=Object.defineProperties;var q=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var f=(e,t,a)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,b=(e,t)=>{for(var a in t||(t={}))E.call(t,a)&&f(e,a,t[a]);if(h)for(var a of h(t))I.call(t,a)&&f(e,a,t[a]);return e},y=(e,t)=>P(e,q(t));import{B as A,u as B,o as N,t as j,e as i,y as z,f as v,q as C,w as r,E as V,h as d,k as o,z as R,p as G,m as L,l as $}from"./vendor.51c5b88d.js";import{_ as F,a as w}from"./index.82f228b9.js";import{u as H,r as J}from"./table.37673c89.js";const K={name:"MedalTable",setup(){const e=A(null),t=B(),a=H();N(()=>{console.log("MedalTable onMounted"),s()});const s=async()=>{a.loading=!0;let n=await w.listMedal(a.query);J(n,a),a.loading=!1},m=()=>{t.push({name:"medal-form"})},g=n=>{t.push({path:"/medal-form",query:{id:n}})},_=async n=>{let u=await w.deleteMedal(n);V.success(u.msg),a.query.page=1,await s()},l=n=>{a.multipleSelection=n},p=n=>{a.query.page=n,s()};return y(b({},j(a)),{multipleTable:e,handleSelectionChange:l,handleAdd:m,handleEdit:g,handleDelete:_,fetchTableData:s,changePage:p})}},x=e=>(G("data-v-63382e05"),e=e(),L(),e),O={class:"nexus-table-header"},Q=x(()=>d("div",{class:"left"},null,-1)),U={class:"right"},W=$("Add"),X=["onClick"],Y=x(()=>d("a",{style:{cursor:"pointer"}},"Delete",-1));function Z(e,t,a,s,m,g){const _=i("el-button"),l=i("el-table-column"),p=i("el-image"),n=i("el-popconfirm"),u=i("el-table"),D=i("el-pagination"),k=i("el-card"),S=z("loading");return v(),C(k,{class:""},{header:r(()=>[d("div",O,[Q,d("div",U,[o(_,{type:"primary",icon:"Plus",onClick:s.handleAdd},{default:r(()=>[W]),_:1},8,["onClick"])])])]),default:r(()=>[R((v(),C(u,{ref:"multipleTable",data:e.tableData,"tooltip-effect":"dark",onSelectionChange:s.handleSelectionChange},{default:r(()=>[o(l,{type:"selection",width:"55"}),o(l,{prop:"id",label:"Id",width:"50"}),o(l,{prop:"name",label:"Name"}),o(l,{prop:"image_large",label:"Large image"},{default:r(c=>[o(p,{src:c.row.image_large,style:{"max-height":"200px"}},null,8,["src"])]),_:1}),o(l,{prop:"image_small",label:"Small image"},{default:r(c=>[o(p,{src:c.row.image_small,style:{"max-height":"200px"}},null,8,["src"])]),_:1}),o(l,{prop:"get_type_text",label:"Get type"}),o(l,{prop:"price",label:"Price(bonus)"}),o(l,{prop:"duration",label:"Duration(day)"}),o(l,{label:"Action",width:""},{default:r(c=>[d("a",{style:{cursor:"pointer","margin-right":"10px"},onClick:T=>s.handleEdit(c.row.id)},"Edit",8,X),o(n,{title:"Confirm Delete ?",onConfirm:T=>s.handleDelete(c.row.id)},{reference:r(()=>[Y]),_:2},1032,["onConfirm"])]),_:1})]),_:1},8,["data","onSelectionChange"])),[[S,e.loading]]),o(D,{background:"",layout:"prev, pager, next",total:e.total,"page-size":e.perPage,"current-page":e.currentPage,onCurrentChange:s.changePage},null,8,["total","page-size","current-page","onCurrentChange"])]),_:1})}var le=F(K,[["render",Z],["__scopeId","data-v-63382e05"]]);export{le as default};
|
||||||
1
admin/dist/assets/index.a6d9d4dd.js
vendored
1
admin/dist/assets/index.a6d9d4dd.js
vendored
@@ -1 +0,0 @@
|
|||||||
var k=Object.defineProperty,S=Object.defineProperties;var M=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var f=(e,a,t)=>a in e?k(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,b=(e,a)=>{for(var t in a||(a={}))I.call(a,t)&&f(e,t,a[t]);if(g)for(var t of g(a))q.call(a,t)&&f(e,t,a[t]);return e},v=(e,a)=>S(e,M(a));import{B,u as P,o as z,t as A,e as c,y as H,f as w,q as x,w as r,E as L,h as i,k as n,z as N,p as j,m as V,l as R}from"./vendor.51c5b88d.js";import{_ as $,a as y}from"./index.76424d23.js";import{u as F,r as G}from"./table.37673c89.js";const J={name:"ExamTable",setup(){const e=B(null),a=P(),t=F();z(()=>{console.log("ExamTable onMounted"),s()});const s=async()=>{t.loading=!0;let l=await y.listExam(t.query);G(l,t),t.loading=!1},h=()=>{a.push({name:"exam-form"})},m=l=>{a.push({path:"/exam-form",query:{id:l}})},p=async l=>{let u=await y.deleteExam(l);L.success(u.msg),t.query.page=1,await s()},o=l=>{t.multipleSelection=l},_=l=>{t.query.page=l,s()};return v(b({},A(t)),{multipleTable:e,handleSelectionChange:o,handleAdd:h,handleEdit:m,handleDelete:p,fetchTableData:s,changePage:_})}},C=e=>(j("data-v-e59598ee"),e=e(),V(),e),K={class:"nexus-table-header"},O=C(()=>i("div",{class:"left"},null,-1)),Q={class:"right"},U=R("Add"),W=["innerHTML"],X=["innerHTML"],Y=["onClick"],Z=C(()=>i("a",{style:{cursor:"pointer"}},"Delete",-1));function ee(e,a,t,s,h,m){const p=c("el-button"),o=c("el-table-column"),_=c("el-popconfirm"),l=c("el-table"),u=c("el-pagination"),T=c("el-card"),D=H("loading");return w(),x(T,{class:""},{header:r(()=>[i("div",K,[O,i("div",Q,[n(p,{type:"primary",size:"small",icon:"Plus",onClick:s.handleAdd},{default:r(()=>[U]),_:1},8,["onClick"])])])]),default:r(()=>[N((w(),x(l,{ref:"multipleTable",data:e.tableData,"tooltip-effect":"dark",onSelectionChange:s.handleSelectionChange},{default:r(()=>[n(o,{type:"selection",width:"55"}),n(o,{prop:"id",label:"Id",width:"50"}),n(o,{prop:"name",label:"Name"}),n(o,{label:"Indexes",width:"250px"},{default:r(d=>[i("p",{style:{"white-space":"pre-line"},innerHTML:d.row.indexes_formatted},null,8,W)]),_:1}),n(o,{prop:"begin",label:"Begin",width:"160"}),n(o,{prop:"end",label:"End",width:"160"}),n(o,{prop:"duration_text",label:"Duration"}),n(o,{label:"Target users",width:"350px"},{default:r(d=>[i("p",{style:{"white-space":"pre-line"},innerHTML:d.row.filters_formatted},null,8,X)]),_:1}),n(o,{prop:"is_discovered_text",label:"Discovered"}),n(o,{prop:"status_text",label:"Status"}),n(o,{label:"Action",width:"100"},{default:r(d=>[i("a",{style:{cursor:"pointer","margin-right":"10px"},onClick:E=>s.handleEdit(d.row.id)},"Edit",8,Y),n(_,{title:"Confirm Delete ?",onConfirm:E=>s.handleDelete(d.row.id)},{reference:r(()=>[Z]),_:2},1032,["onConfirm"])]),_:1})]),_:1},8,["data","onSelectionChange"])),[[D,e.loading]]),n(u,{background:"",layout:"prev, pager, next",total:e.total,"page-size":e.perPage,"current-page":e.currentPage,onCurrentChange:s.changePage},null,8,["total","page-size","current-page","onCurrentChange"])]),_:1})}var le=$(J,[["render",ee],["__scopeId","data-v-e59598ee"]]);export{le as default};
|
|
||||||
1
admin/dist/assets/index.a6dda25b.css
vendored
1
admin/dist/assets/index.a6dda25b.css
vendored
@@ -1 +0,0 @@
|
|||||||
.swiper-container[data-v-e59598ee]{min-height:100%}.el-card.is-always-shadow[data-v-e59598ee]{min-height:100%!important}
|
|
||||||
1
admin/dist/assets/index.d1de91f7.js
vendored
1
admin/dist/assets/index.d1de91f7.js
vendored
@@ -1 +0,0 @@
|
|||||||
var M=Object.defineProperty,P=Object.defineProperties;var q=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var f=(e,t,a)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,b=(e,t)=>{for(var a in t||(t={}))E.call(t,a)&&f(e,a,t[a]);if(h)for(var a of h(t))I.call(t,a)&&f(e,a,t[a]);return e},y=(e,t)=>P(e,q(t));import{B as z,u as A,o as B,t as N,e as i,y as j,f as v,q as C,w as r,E as V,h as d,k as o,z as R,p as G,m as L,l as $}from"./vendor.51c5b88d.js";import{_ as F,a as w}from"./index.76424d23.js";import{u as H,r as J}from"./table.37673c89.js";const K={name:"MedalTable",setup(){const e=z(null),t=A(),a=H();B(()=>{console.log("MedalTable onMounted"),s()});const s=async()=>{a.loading=!0;let n=await w.listMedal(a.query);J(n,a),a.loading=!1},m=()=>{t.push({name:"medal-form"})},g=n=>{t.push({path:"/medal-form",query:{id:n}})},_=async n=>{let u=await w.deleteMedal(n);V.success(u.msg),a.query.page=1,await s()},l=n=>{a.multipleSelection=n},p=n=>{a.query.page=n,s()};return y(b({},N(a)),{multipleTable:e,handleSelectionChange:l,handleAdd:m,handleEdit:g,handleDelete:_,fetchTableData:s,changePage:p})}},x=e=>(G("data-v-70815ba2"),e=e(),L(),e),O={class:"nexus-table-header"},Q=x(()=>d("div",{class:"left"},null,-1)),U={class:"right"},W=$("Add"),X=["onClick"],Y=x(()=>d("a",{style:{cursor:"pointer"}},"Delete",-1));function Z(e,t,a,s,m,g){const _=i("el-button"),l=i("el-table-column"),p=i("el-image"),n=i("el-popconfirm"),u=i("el-table"),D=i("el-pagination"),k=i("el-card"),S=j("loading");return v(),C(k,{class:""},{header:r(()=>[d("div",O,[Q,d("div",U,[o(_,{type:"primary",size:"small",icon:"Plus",onClick:s.handleAdd},{default:r(()=>[W]),_:1},8,["onClick"])])])]),default:r(()=>[R((v(),C(u,{ref:"multipleTable",data:e.tableData,"tooltip-effect":"dark",onSelectionChange:s.handleSelectionChange},{default:r(()=>[o(l,{type:"selection",width:"55"}),o(l,{prop:"id",label:"Id",width:"50"}),o(l,{prop:"name",label:"Name"}),o(l,{prop:"image_large",label:"Large image"},{default:r(c=>[o(p,{src:c.row.image_large,style:{"max-height":"200px"}},null,8,["src"])]),_:1}),o(l,{prop:"image_small",label:"Small image"},{default:r(c=>[o(p,{src:c.row.image_small,style:{"max-height":"200px"}},null,8,["src"])]),_:1}),o(l,{prop:"get_type_text",label:"Get type"}),o(l,{prop:"price",label:"Price(bonus)"}),o(l,{prop:"duration",label:"Duration(day)"}),o(l,{label:"Action",width:""},{default:r(c=>[d("a",{style:{cursor:"pointer","margin-right":"10px"},onClick:T=>s.handleEdit(c.row.id)},"Edit",8,X),o(n,{title:"Confirm Delete ?",onConfirm:T=>s.handleDelete(c.row.id)},{reference:r(()=>[Y]),_:2},1032,["onConfirm"])]),_:1})]),_:1},8,["data","onSelectionChange"])),[[S,e.loading]]),o(D,{background:"",layout:"prev, pager, next",total:e.total,"page-size":e.perPage,"current-page":e.currentPage,onCurrentChange:s.changePage},null,8,["total","page-size","current-page","onCurrentChange"])]),_:1})}var le=F(K,[["render",Z],["__scopeId","data-v-70815ba2"]]);export{le as default};
|
|
||||||
1
admin/dist/assets/index.e3917cda.js
vendored
Normal file
1
admin/dist/assets/index.e3917cda.js
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
var S=Object.defineProperty,q=Object.defineProperties;var P=Object.getOwnPropertyDescriptors;var b=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var v=(e,t,a)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,y=(e,t)=>{for(var a in t||(t={}))A.call(t,a)&&v(e,a,t[a]);if(b)for(var a of b(t))E.call(t,a)&&v(e,a,t[a]);return e},C=(e,t)=>q(e,P(t));import{B as I,u as B,r as N,o as j,t as z,e as s,y as R,f as w,q as D,w as c,E as V,h as d,k as n,z as M,p as U,m as $,l as F}from"./vendor.51c5b88d.js";import{_ as G,a as T}from"./index.82f228b9.js";import{u as H,r as J}from"./table.37673c89.js";const K={name:"TagTable",setup(){const e=I(null),t=B(),a=H();let r=N({agentAllows:[]});j(()=>{i()});const i=async()=>{a.loading=!0;let o=await T.listTag(a.query);J(o,a),a.loading=!1},m=()=>{t.push({name:"tag-form"})},p=o=>{t.push({path:"/tag-form",query:{id:o}})},l=async o=>{let g=await T.deleteTag(o);V.success(g.msg),a.query.page=1,await i()},_=o=>{a.multipleSelection=o},u=o=>{a.query.page=o,i()},h=()=>{a.query.family_id=""};return C(y({},z(a)),{extraData:r,multipleTable:e,handleSelectionChange:_,handleAdd:m,handleEdit:p,handleDelete:l,fetchTableData:i,changePage:u,handleReset:h})}},k=e=>(U("data-v-17cb21d2"),e=e(),$(),e),L={class:"nexus-table-header"},O=k(()=>d("div",{class:"left"},null,-1)),Q={class:"right"},W=F("Add"),X=["onClick"],Y=k(()=>d("a",{style:{cursor:"pointer"}},"Delete",-1));function Z(e,t,a,r,i,m){const p=s("el-button"),l=s("el-table-column"),_=s("el-popconfirm"),u=s("el-table"),h=s("el-pagination"),o=s("el-card"),g=R("loading");return w(),D(o,{class:""},{header:c(()=>[d("div",L,[O,d("div",Q,[n(p,{type:"primary",icon:"Plus",onClick:r.handleAdd},{default:c(()=>[W]),_:1},8,["onClick"])])])]),default:c(()=>[M((w(),D(u,{ref:"multipleTable",data:e.tableData,"tooltip-effect":"dark",onSelectionChange:r.handleSelectionChange},{default:c(()=>[n(l,{type:"selection",width:"55"}),n(l,{prop:"id",label:"Id",width:"50"}),n(l,{prop:"name",label:"Name"}),n(l,{prop:"color",label:"Color"}),n(l,{prop:"priority",label:"Priority"}),n(l,{prop:"updated_at",label:"Updated at"}),n(l,{prop:"created_at",label:"Created at"}),n(l,{label:"Action",width:"120"},{default:c(f=>[d("a",{style:{cursor:"pointer","margin-right":"10px"},onClick:x=>r.handleEdit(f.row.id)},"Edit",8,X),n(_,{title:"Confirm Delete ?",onConfirm:x=>r.handleDelete(f.row.id)},{reference:c(()=>[Y]),_:2},1032,["onConfirm"])]),_:1})]),_:1},8,["data","onSelectionChange"])),[[g,e.loading]]),n(h,{background:"",layout:"prev, pager, next",total:e.total,"page-size":e.perPage,"current-page":e.currentPage,onCurrentChange:r.changePage},null,8,["total","page-size","current-page","onCurrentChange"])]),_:1})}var ne=G(K,[["render",Z],["__scopeId","data-v-17cb21d2"]]);export{ne as default};
|
||||||
@@ -1 +1 @@
|
|||||||
var y=Object.defineProperty,_=Object.defineProperties;var b=Object.getOwnPropertyDescriptors;var m=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var A=(e,o,r)=>o in e?y(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r,p=(e,o)=>{for(var r in o||(o={}))C.call(o,r)&&A(e,r,o[r]);if(m)for(var r of m(o))F.call(o,r)&&A(e,r,o[r]);return e},f=(e,o)=>_(e,b(o));import{_ as R,a as w,l as v}from"./index.76424d23.js";import{B as k,u as J,r as V,t as j,e as n,f as Y,g as z,h as E,k as s,w as l,C as S,D as h,l as B}from"./vendor.51c5b88d.js";var I="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAVMSURBVFhHxVYJb1VFFO4vUZBoSEiIJEZBhURFrFERxRCVILTspVRUqAqV1FCBAMFEllba2pYKbWW1tJQWrMUaWiBQu0EXu72W17f17Wu3zzP33rn3zr2vJUrUL/ny3pw5M/PNmTPnTgL+Z/wrAsKjk+h2jqG+N4Z+97hijY9HFjA2AVh9E2joj+HUnQj2/hLAtp99WHfOiw3nfUj+yYvSprDibcbfFuAOT6DFOoYLLREcvh5EeoUfa896sZ4W23TRh5RyP1LJllYpk/1PIhE9rviRmFYAC+WfznHUdEaR0xDCrio/NrJdnfUJC26hRdhCU3Ed+Za3RZRZRQgCWChv9MVwzzaGATq7LjrH+44xdBA76X8nianoiGJzuS8uiyjUXbRTI9nYIe80EZgk5twIYWWJBx9RuGq6o7BMMYBhT10QG+icjSy8G8agzzxOiiQJYesYkWAPTOBSexQflniRTKFae0HjgfqQ4iaigyKh9zMyszYoLcrAftOvBLC6zCtF2IgElr37acDKUg9WUzIZycGOQo/c2+G4/pzcn/2y9vunPbhlGZVseiR0kkNeYxgrTnmwklQayZH1axDOkLaDEO2MJWK8MYz3FAHn2qJSm81/kkQbkRCMTaK2K4ZlhW7JyUiOzGsBiXpUUkLGG8PYbpcFnKHrytrLiz34im6REVISWijjl+aPYPlJt4kcu6v9UtsYRm43sp1uEkNZc0Rqv1vkRhIdQ0TJDQ5JQHRsEsnU+fYPI1hWIJIjg9Sz9oYzHoQoahx9I+OmMYxtw7IAVgW57fXvXVSQZDuHWgd2VfjwZq6LIiGSY+dln2rLawwqVhmsrR/D2DosR6qEria3MQFV98SCpAoovhlCYrYTb5wQyfHFJa9g79XthOXRikKX0N9qlQWcuhNSbYk5ThypE/NIFdBIFXDxEQcSj4vkSL/oEeysrcfVjojQ3/JAFvDjbdqYYnvtmAMpdN31UAXYqIIlHnXg1SN2gRzbz3tMfTX3xXDqfZqHZAEnbwZV22LiWxTlEd11VgUwrCly4aXDNrz8rUaOT864BTvj0uN2BKNaQrJN8L4/BmOSraghKIxZdMiGFkUcgyBgT6UPCw8Ok5NGjrSyEcHOua9KK1YMBTcCkr1JEcDbnC/S/KV0LByCgDLqWLDPihf2a+RIPe0S7Ho2WeTFGAIUkfey7aot//eA4Ps8zZ+hyx9BQCuF5tk9VszPeqCSI6XYJdj1XJWrJSvD9c4I7g7IAvJ+8wu+zxE/oBsxoZycIMBLr50ldEbPZA6p5NhY6BTsRpY0itcrEJUT7USd3+S7IMsKq/K5FwQwJOU5MS9jUCXH+nyHYDdyEe3M6jG/BXJqfSbfpzOGUKvcIJOAA1Tx5u4cxNwvLRI5knPtqm0qbivWChdH9jWaz+hL8xfUyxEzCbjcHMacdAvm7BjA/N1aBNbk2CXbw3i7J6qMkHGsxmv2+9yC6lb502wS0GUblQTM/rQfey9qX8Oj1V7J9jC+kqXlDYM67jPGAczebsGO0hFMxktChhh9Gc/dCuJmt/kVe38oJtmfTOublt9VadeMCVj49RCSchw4WOlFHZ396LhWvEwCGLqUL9lUeGJLr8bUXsxK7cOsrcS0fsyj8L5zeBhepdzaqTqGdNXSiLgCWOLM3NKHGZt6RG7uwczNvZiZQqT+pz7ux5JvHiCVrmhurR+N9Jp2+Kd+TcdDXAFsksU08eO02GO0MPudQbudn2HBqmM2HKrw4EpzCAP03teH858grgAGGxWK41fpiX3WjdKGANqptgci5mf1o2JKAf8NgL8AnzfNbLNwcf4AAAAASUVORK5CYII=";const L={name:"Login",setup(){const e=k(null),o=J(),r=V({ruleForm:{username:"",password:""},checked:!0,rules:{username:[{required:"true"}],password:[{required:"true"}]}}),t=async()=>{e.value.validate(c=>{if(c)w.login(r.ruleForm).then(a=>{console.log(a),v("token",a.data.token),v("userInfo",a.data),o.push({name:"dashboard"})});else return console.log("error submit!!"),!1})},u=()=>{e.value.resetFields()};return f(p({},j(r)),{loginForm:e,submitForm:t,resetForm:u})}},N={class:"login-body"},q={class:"login-container"},x=S('<div class="head" data-v-68d0c3e2><img class="logo" src="'+I+'" data-v-68d0c3e2><div class="name" data-v-68d0c3e2><div class="title" data-v-68d0c3e2>NexusPHP</div><div class="tips" data-v-68d0c3e2>Management system</div></div></div>',1),G=B("Submit");function M(e,o,r,t,u,c){const a=n("el-input"),d=n("el-form-item"),g=n("el-button"),U=n("el-form");return Y(),z("div",N,[E("div",q,[x,s(U,{"label-position":"top",rules:e.rules,model:e.ruleForm,ref:"loginForm",class:"login-form"},{default:l(()=>[s(d,{label:"Username",prop:"username"},{default:l(()=>[s(a,{type:"text",modelValue:e.ruleForm.username,"onUpdate:modelValue":o[0]||(o[0]=i=>e.ruleForm.username=i),modelModifiers:{trim:!0},autocomplete:"off",onKeyup:h(t.submitForm,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),s(d,{label:"Password",prop:"password"},{default:l(()=>[s(a,{type:"password",modelValue:e.ruleForm.password,"onUpdate:modelValue":o[1]||(o[1]=i=>e.ruleForm.password=i),modelModifiers:{trim:!0},autocomplete:"off",onKeyup:h(t.submitForm,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),s(d,{style:{"margin-top":"50px"}},{default:l(()=>[s(g,{style:{width:"100%"},type:"primary",onClick:t.submitForm},{default:l(()=>[G]),_:1},8,["onClick"])]),_:1})]),_:1},8,["rules","model"])])])}var T=R(L,[["render",M],["__scopeId","data-v-68d0c3e2"]]);export{T as default};
|
var y=Object.defineProperty,_=Object.defineProperties;var b=Object.getOwnPropertyDescriptors;var m=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var A=(e,o,r)=>o in e?y(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r,p=(e,o)=>{for(var r in o||(o={}))C.call(o,r)&&A(e,r,o[r]);if(m)for(var r of m(o))F.call(o,r)&&A(e,r,o[r]);return e},f=(e,o)=>_(e,b(o));import{_ as R,a as w,l as v}from"./index.82f228b9.js";import{B as k,u as J,r as V,t as j,e as n,f as Y,g as z,h as E,k as s,w as l,C as S,D as h,l as B}from"./vendor.51c5b88d.js";var I="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAVMSURBVFhHxVYJb1VFFO4vUZBoSEiIJEZBhURFrFERxRCVILTspVRUqAqV1FCBAMFEllba2pYKbWW1tJQWrMUaWiBQu0EXu72W17f17Wu3zzP33rn3zr2vJUrUL/ny3pw5M/PNmTPnTgL+Z/wrAsKjk+h2jqG+N4Z+97hijY9HFjA2AVh9E2joj+HUnQj2/hLAtp99WHfOiw3nfUj+yYvSprDibcbfFuAOT6DFOoYLLREcvh5EeoUfa896sZ4W23TRh5RyP1LJllYpk/1PIhE9rviRmFYAC+WfznHUdEaR0xDCrio/NrJdnfUJC26hRdhCU3Ed+Za3RZRZRQgCWChv9MVwzzaGATq7LjrH+44xdBA76X8nianoiGJzuS8uiyjUXbRTI9nYIe80EZgk5twIYWWJBx9RuGq6o7BMMYBhT10QG+icjSy8G8agzzxOiiQJYesYkWAPTOBSexQflniRTKFae0HjgfqQ4iaigyKh9zMyszYoLcrAftOvBLC6zCtF2IgElr37acDKUg9WUzIZycGOQo/c2+G4/pzcn/2y9vunPbhlGZVseiR0kkNeYxgrTnmwklQayZH1axDOkLaDEO2MJWK8MYz3FAHn2qJSm81/kkQbkRCMTaK2K4ZlhW7JyUiOzGsBiXpUUkLGG8PYbpcFnKHrytrLiz34im6REVISWijjl+aPYPlJt4kcu6v9UtsYRm43sp1uEkNZc0Rqv1vkRhIdQ0TJDQ5JQHRsEsnU+fYPI1hWIJIjg9Sz9oYzHoQoahx9I+OmMYxtw7IAVgW57fXvXVSQZDuHWgd2VfjwZq6LIiGSY+dln2rLawwqVhmsrR/D2DosR6qEria3MQFV98SCpAoovhlCYrYTb5wQyfHFJa9g79XthOXRikKX0N9qlQWcuhNSbYk5ThypE/NIFdBIFXDxEQcSj4vkSL/oEeysrcfVjojQ3/JAFvDjbdqYYnvtmAMpdN31UAXYqIIlHnXg1SN2gRzbz3tMfTX3xXDqfZqHZAEnbwZV22LiWxTlEd11VgUwrCly4aXDNrz8rUaOT864BTvj0uN2BKNaQrJN8L4/BmOSraghKIxZdMiGFkUcgyBgT6UPCw8Ok5NGjrSyEcHOua9KK1YMBTcCkr1JEcDbnC/S/KV0LByCgDLqWLDPihf2a+RIPe0S7Ho2WeTFGAIUkfey7aot//eA4Ps8zZ+hyx9BQCuF5tk9VszPeqCSI6XYJdj1XJWrJSvD9c4I7g7IAvJ+8wu+zxE/oBsxoZycIMBLr50ldEbPZA6p5NhY6BTsRpY0itcrEJUT7USd3+S7IMsKq/K5FwQwJOU5MS9jUCXH+nyHYDdyEe3M6jG/BXJqfSbfpzOGUKvcIJOAA1Tx5u4cxNwvLRI5knPtqm0qbivWChdH9jWaz+hL8xfUyxEzCbjcHMacdAvm7BjA/N1aBNbk2CXbw3i7J6qMkHGsxmv2+9yC6lb502wS0GUblQTM/rQfey9qX8Oj1V7J9jC+kqXlDYM67jPGAczebsGO0hFMxktChhh9Gc/dCuJmt/kVe38oJtmfTOublt9VadeMCVj49RCSchw4WOlFHZ396LhWvEwCGLqUL9lUeGJLr8bUXsxK7cOsrcS0fsyj8L5zeBhepdzaqTqGdNXSiLgCWOLM3NKHGZt6RG7uwczNvZiZQqT+pz7ux5JvHiCVrmhurR+N9Jp2+Kd+TcdDXAFsksU08eO02GO0MPudQbudn2HBqmM2HKrw4EpzCAP03teH858grgAGGxWK41fpiX3WjdKGANqptgci5mf1o2JKAf8NgL8AnzfNbLNwcf4AAAAASUVORK5CYII=";const L={name:"Login",setup(){const e=k(null),o=J(),r=V({ruleForm:{username:"",password:""},checked:!0,rules:{username:[{required:"true"}],password:[{required:"true"}]}}),t=async()=>{e.value.validate(c=>{if(c)w.login(r.ruleForm).then(a=>{console.log(a),v("token",a.data.token),v("userInfo",a.data),o.push({name:"dashboard"})});else return console.log("error submit!!"),!1})},u=()=>{e.value.resetFields()};return f(p({},j(r)),{loginForm:e,submitForm:t,resetForm:u})}},N={class:"login-body"},q={class:"login-container"},x=S('<div class="head" data-v-68d0c3e2><img class="logo" src="'+I+'" data-v-68d0c3e2><div class="name" data-v-68d0c3e2><div class="title" data-v-68d0c3e2>NexusPHP</div><div class="tips" data-v-68d0c3e2>Management system</div></div></div>',1),G=B("Submit");function M(e,o,r,t,u,c){const a=n("el-input"),d=n("el-form-item"),g=n("el-button"),U=n("el-form");return Y(),z("div",N,[E("div",q,[x,s(U,{"label-position":"top",rules:e.rules,model:e.ruleForm,ref:"loginForm",class:"login-form"},{default:l(()=>[s(d,{label:"Username",prop:"username"},{default:l(()=>[s(a,{type:"text",modelValue:e.ruleForm.username,"onUpdate:modelValue":o[0]||(o[0]=i=>e.ruleForm.username=i),modelModifiers:{trim:!0},autocomplete:"off",onKeyup:h(t.submitForm,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),s(d,{label:"Password",prop:"password"},{default:l(()=>[s(a,{type:"password",modelValue:e.ruleForm.password,"onUpdate:modelValue":o[1]||(o[1]=i=>e.ruleForm.password=i),modelModifiers:{trim:!0},autocomplete:"off",onKeyup:h(t.submitForm,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),s(d,{style:{"margin-top":"50px"}},{default:l(()=>[s(g,{style:{width:"100%"},type:"primary",onClick:t.submitForm},{default:l(()=>[G]),_:1},8,["onClick"])]),_:1})]),_:1},8,["rules","model"])])])}var T=R(L,[["render",M],["__scopeId","data-v-68d0c3e2"]]);export{T as default};
|
||||||
@@ -1 +1 @@
|
|||||||
var T=Object.defineProperty,U=Object.defineProperties;var I=Object.getOwnPropertyDescriptors;var D=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var k=(a,o,l)=>o in a?T(a,o,{enumerable:!0,configurable:!0,writable:!0,value:l}):a[o]=l,w=(a,o)=>{for(var l in o||(o={}))A.call(o,l)&&k(a,l,o[l]);if(D)for(var l of D(o))B.call(o,l)&&k(a,l,o[l]);return a},E=(a,o)=>U(a,I(o));import{B as N,u as R,r as P,o as j,t as z,e as d,y as F,f,q as x,w as n,E as M,h,k as t,g as L,A as Q,F as Y,z as G,l as V,p as H,m as J}from"./vendor.51c5b88d.js";import{_ as K,a as q}from"./index.76424d23.js";import{u as O,r as W,a as X}from"./table.37673c89.js";const Z={name:"ExamUserTable",setup(){const a=N(null),o=R(),l=O();let r=P({exams:[]});j(()=>{q.listExamAll().then(e=>{r.exams=e.data}),i()});const i=async()=>{l.loading=!0;let e=await q.listExamUser(l.query);W(e,l),l.loading=!1},S=()=>{o.push({name:"user-form"})},u=e=>{o.push({name:"user-form",query:{id:e}})},m=async e=>{let _=await q.deleteExam(e);M.success(_.msg),l.query.page=1,await i()},c=e=>{l.multipleSelection=e},p=e=>{l.query.page=e,i()},b=e=>{X(e,l),i()},s=e=>{o.push({name:"user-detail",query:{id:e}})},g=(e,_)=>e.user.username,y=(e,_)=>e.exam.name,v=(e,_)=>e.downloaded_text,C=()=>{l.query.is_done="",l.query.status="",l.query.exam_id=""};return E(w({},z(l)),{multipleTable:a,extraData:r,handleSelectionChange:c,handleAdd:S,handleEdit:u,handleDelete:m,handleDetail:s,fetchTableData:i,changePage:p,handleSortChange:b,formatColumnUser:g,formatColumnExam:y,formatColumnDownloaded:v,handleReset:C})}},$=a=>(H("data-v-0556c6df"),a=a(),J(),a),ee={class:"nexus-table-header"},ae={class:"left"},le=V("Query"),te=V("Reset"),oe=$(()=>h("div",{class:"right"},null,-1)),ne=["onClick"];function re(a,o,l,r,i,S){const u=d("el-option"),m=d("el-select"),c=d("el-form-item"),p=d("el-button"),b=d("el-form"),s=d("el-table-column"),g=d("el-table"),y=d("el-pagination"),v=d("el-card"),C=F("loading");return f(),x(v,null,{header:n(()=>[h("div",ee,[h("div",ae,[t(b,{inline:!0,model:a.query},{default:n(()=>[t(c,{label:""},{default:n(()=>[t(m,{modelValue:a.query.exam_id,"onUpdate:modelValue":o[0]||(o[0]=e=>a.query.exam_id=e),filterable:"",placeholder:"Exam",clearable:""},{default:n(()=>[(f(!0),L(Y,null,Q(r.extraData.exams,e=>(f(),x(u,{key:e.id,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(c,{label:""},{default:n(()=>[t(m,{modelValue:a.query.is_done,"onUpdate:modelValue":o[1]||(o[1]=e=>a.query.is_done=e),filterable:"",placeholder:"IsDone",clearable:""},{default:n(()=>[t(u,{label:"Yes",value:"1"}),t(u,{label:"No",value:"0"})]),_:1},8,["modelValue"])]),_:1}),t(c,{label:""},{default:n(()=>[t(m,{modelValue:a.query.status,"onUpdate:modelValue":o[2]||(o[2]=e=>a.query.status=e),filterable:"",placeholder:"Status",clearable:""},{default:n(()=>[t(u,{label:"Avoided",value:"-1"}),t(u,{label:"Normal",value:"0"}),t(u,{label:"Finished",value:"1"})]),_:1},8,["modelValue"])]),_:1}),t(c,null,{default:n(()=>[t(p,{type:"primary",onClick:r.fetchTableData},{default:n(()=>[le]),_:1},8,["onClick"]),t(p,{type:"primary",onClick:r.handleReset},{default:n(()=>[te]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),oe])]),default:n(()=>[G((f(),x(g,{ref:"multipleTable",data:a.tableData,"tooltip-effect":"dark",onSortChange:r.handleSortChange,onSelectionChange:r.handleSelectionChange},{default:n(()=>[t(s,{type:"selection",width:"55"}),t(s,{prop:"id",label:"Id",width:"100",sortable:"custom"}),t(s,{prop:"exam_id",label:"Exam",formatter:r.formatColumnExam},null,8,["formatter"]),t(s,{prop:"uid",label:"User",formatter:r.formatColumnUser},null,8,["formatter"]),t(s,{prop:"is_done_text",label:"Is done"}),t(s,{prop:"status_text",label:"Status"}),t(s,{prop:"created_at",label:"Created At"}),t(s,{label:"Action",width:"100"},{default:n(e=>[h("a",{style:{cursor:"pointer","margin-right":"10px"},onClick:_=>r.handleDetail(e.row.uid)},"Detail",8,ne)]),_:1})]),_:1},8,["data","onSortChange","onSelectionChange"])),[[C,a.loading]]),t(y,{background:"",layout:"prev, pager, next",total:a.total,"page-size":a.perPage,"current-page":a.currentPage,onCurrentChange:r.changePage},null,8,["total","page-size","current-page","onCurrentChange"])]),_:1})}var ce=K(Z,[["render",re],["__scopeId","data-v-0556c6df"]]);export{ce as default};
|
var T=Object.defineProperty,U=Object.defineProperties;var I=Object.getOwnPropertyDescriptors;var D=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var k=(a,o,l)=>o in a?T(a,o,{enumerable:!0,configurable:!0,writable:!0,value:l}):a[o]=l,w=(a,o)=>{for(var l in o||(o={}))A.call(o,l)&&k(a,l,o[l]);if(D)for(var l of D(o))B.call(o,l)&&k(a,l,o[l]);return a},E=(a,o)=>U(a,I(o));import{B as N,u as R,r as P,o as j,t as z,e as d,y as F,f,q as x,w as n,E as M,h,k as t,g as L,A as Q,F as Y,z as G,l as V,p as H,m as J}from"./vendor.51c5b88d.js";import{_ as K,a as q}from"./index.82f228b9.js";import{u as O,r as W,a as X}from"./table.37673c89.js";const Z={name:"ExamUserTable",setup(){const a=N(null),o=R(),l=O();let r=P({exams:[]});j(()=>{q.listExamAll().then(e=>{r.exams=e.data}),i()});const i=async()=>{l.loading=!0;let e=await q.listExamUser(l.query);W(e,l),l.loading=!1},S=()=>{o.push({name:"user-form"})},u=e=>{o.push({name:"user-form",query:{id:e}})},m=async e=>{let _=await q.deleteExam(e);M.success(_.msg),l.query.page=1,await i()},c=e=>{l.multipleSelection=e},p=e=>{l.query.page=e,i()},b=e=>{X(e,l),i()},s=e=>{o.push({name:"user-detail",query:{id:e}})},g=(e,_)=>e.user.username,y=(e,_)=>e.exam.name,v=(e,_)=>e.downloaded_text,C=()=>{l.query.is_done="",l.query.status="",l.query.exam_id=""};return E(w({},z(l)),{multipleTable:a,extraData:r,handleSelectionChange:c,handleAdd:S,handleEdit:u,handleDelete:m,handleDetail:s,fetchTableData:i,changePage:p,handleSortChange:b,formatColumnUser:g,formatColumnExam:y,formatColumnDownloaded:v,handleReset:C})}},$=a=>(H("data-v-0556c6df"),a=a(),J(),a),ee={class:"nexus-table-header"},ae={class:"left"},le=V("Query"),te=V("Reset"),oe=$(()=>h("div",{class:"right"},null,-1)),ne=["onClick"];function re(a,o,l,r,i,S){const u=d("el-option"),m=d("el-select"),c=d("el-form-item"),p=d("el-button"),b=d("el-form"),s=d("el-table-column"),g=d("el-table"),y=d("el-pagination"),v=d("el-card"),C=F("loading");return f(),x(v,null,{header:n(()=>[h("div",ee,[h("div",ae,[t(b,{inline:!0,model:a.query},{default:n(()=>[t(c,{label:""},{default:n(()=>[t(m,{modelValue:a.query.exam_id,"onUpdate:modelValue":o[0]||(o[0]=e=>a.query.exam_id=e),filterable:"",placeholder:"Exam",clearable:""},{default:n(()=>[(f(!0),L(Y,null,Q(r.extraData.exams,e=>(f(),x(u,{key:e.id,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(c,{label:""},{default:n(()=>[t(m,{modelValue:a.query.is_done,"onUpdate:modelValue":o[1]||(o[1]=e=>a.query.is_done=e),filterable:"",placeholder:"IsDone",clearable:""},{default:n(()=>[t(u,{label:"Yes",value:"1"}),t(u,{label:"No",value:"0"})]),_:1},8,["modelValue"])]),_:1}),t(c,{label:""},{default:n(()=>[t(m,{modelValue:a.query.status,"onUpdate:modelValue":o[2]||(o[2]=e=>a.query.status=e),filterable:"",placeholder:"Status",clearable:""},{default:n(()=>[t(u,{label:"Avoided",value:"-1"}),t(u,{label:"Normal",value:"0"}),t(u,{label:"Finished",value:"1"})]),_:1},8,["modelValue"])]),_:1}),t(c,null,{default:n(()=>[t(p,{type:"primary",onClick:r.fetchTableData},{default:n(()=>[le]),_:1},8,["onClick"]),t(p,{type:"primary",onClick:r.handleReset},{default:n(()=>[te]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),oe])]),default:n(()=>[G((f(),x(g,{ref:"multipleTable",data:a.tableData,"tooltip-effect":"dark",onSortChange:r.handleSortChange,onSelectionChange:r.handleSelectionChange},{default:n(()=>[t(s,{type:"selection",width:"55"}),t(s,{prop:"id",label:"Id",width:"100",sortable:"custom"}),t(s,{prop:"exam_id",label:"Exam",formatter:r.formatColumnExam},null,8,["formatter"]),t(s,{prop:"uid",label:"User",formatter:r.formatColumnUser},null,8,["formatter"]),t(s,{prop:"is_done_text",label:"Is done"}),t(s,{prop:"status_text",label:"Status"}),t(s,{prop:"created_at",label:"Created At"}),t(s,{label:"Action",width:"100"},{default:n(e=>[h("a",{style:{cursor:"pointer","margin-right":"10px"},onClick:_=>r.handleDetail(e.row.uid)},"Detail",8,ne)]),_:1})]),_:1},8,["data","onSortChange","onSelectionChange"])),[[C,a.loading]]),t(y,{background:"",layout:"prev, pager, next",total:a.total,"page-size":a.perPage,"current-page":a.currentPage,onCurrentChange:r.changePage},null,8,["total","page-size","current-page","onCurrentChange"])]),_:1})}var ce=K(Z,[["render",re],["__scopeId","data-v-0556c6df"]]);export{ce as default};
|
||||||
4
admin/dist/index.html
vendored
4
admin/dist/index.html
vendored
@@ -5,9 +5,9 @@
|
|||||||
<link rel="icon" href="/admin/favicon.ico" />
|
<link rel="icon" href="/admin/favicon.ico" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>NexusPHP</title>
|
<title>NexusPHP</title>
|
||||||
<script type="module" crossorigin src="/admin/assets/index.76424d23.js"></script>
|
<script type="module" crossorigin src="/admin/assets/index.82f228b9.js"></script>
|
||||||
<link rel="modulepreload" href="/admin/assets/vendor.51c5b88d.js">
|
<link rel="modulepreload" href="/admin/assets/vendor.51c5b88d.js">
|
||||||
<link rel="stylesheet" href="/admin/assets/index.0cc196ef.css">
|
<link rel="stylesheet" href="/admin/assets/index.5a7f427d.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|||||||
@@ -49,6 +49,9 @@
|
|||||||
<el-menu-item-group>
|
<el-menu-item-group>
|
||||||
<el-menu-item index="/medal"><i class="el-icon-menu" />Medal</el-menu-item>
|
<el-menu-item index="/medal"><i class="el-icon-menu" />Medal</el-menu-item>
|
||||||
</el-menu-item-group>
|
</el-menu-item-group>
|
||||||
|
<el-menu-item-group>
|
||||||
|
<el-menu-item index="/tag"><i class="el-icon-menu" />Tag</el-menu-item>
|
||||||
|
</el-menu-item-group>
|
||||||
<el-menu-item-group>
|
<el-menu-item-group>
|
||||||
<el-menu-item index="/setting"><i class="el-icon-menu" />Setting</el-menu-item>
|
<el-menu-item index="/setting"><i class="el-icon-menu" />Setting</el-menu-item>
|
||||||
</el-menu-item-group>
|
</el-menu-item-group>
|
||||||
|
|||||||
10
admin/src/router/index.js
vendored
10
admin/src/router/index.js
vendored
@@ -89,6 +89,16 @@ const router = createRouter({
|
|||||||
name: 'setting',
|
name: 'setting',
|
||||||
component: () => import('../views/setting/index.vue')
|
component: () => import('../views/setting/index.vue')
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/tag',
|
||||||
|
name: 'tag',
|
||||||
|
component: () => import('../views/tag/index.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/tag-form',
|
||||||
|
name: 'tag-form',
|
||||||
|
component: () => import('../views/tag/form.vue')
|
||||||
|
},
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
15
admin/src/utils/api.js
vendored
15
admin/src/utils/api.js
vendored
@@ -157,6 +157,21 @@ const api = {
|
|||||||
storeUserMedal: (params) => {
|
storeUserMedal: (params) => {
|
||||||
return axios.post('user-medals', params);
|
return axios.post('user-medals', params);
|
||||||
},
|
},
|
||||||
|
listTag: (params = {}) => {
|
||||||
|
return axios.get('tags', {params: params});
|
||||||
|
},
|
||||||
|
storeTag: (params = {}) => {
|
||||||
|
return axios.post('tags', params);
|
||||||
|
},
|
||||||
|
updateTag: (id, params = {}) => {
|
||||||
|
return axios.put('tags/' + id, params);
|
||||||
|
},
|
||||||
|
getTag: (id) => {
|
||||||
|
return axios.get('tags/' + id);
|
||||||
|
},
|
||||||
|
deleteTag: (id) => {
|
||||||
|
return axios.delete('tags/' + id);
|
||||||
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
admin/src/utils/index.js
vendored
2
admin/src/utils/index.js
vendored
@@ -51,4 +51,6 @@ export const pathMap = {
|
|||||||
'setting': "Setting",
|
'setting': "Setting",
|
||||||
'medal': 'Medal',
|
'medal': 'Medal',
|
||||||
'medal-form': 'Medal form',
|
'medal-form': 'Medal form',
|
||||||
|
'tag': 'Tag',
|
||||||
|
'tag-form': 'Tag form'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<el-button type="primary" size="small" icon="Plus" @click="handleAdd">Add</el-button>
|
<el-button type="primary" icon="Plus" @click="handleAdd">Add</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<el-button type="primary" size="small" icon="Plus" @click="handleAdd">Add</el-button>
|
<el-button type="primary" icon="Plus" @click="handleAdd">Add</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
109
admin/src/views/tag/form.vue
Normal file
109
admin/src/views/tag/form.vue
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form :model="formData" :rules="rules" ref="formRef" label-width="200px" class="formData">
|
||||||
|
<el-form-item label="Name" prop="name">
|
||||||
|
<el-input v-model="formData.name" placeholder=""></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="Color" prop="color">
|
||||||
|
<el-input v-model="formData.color" placeholder=""></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="Priority" prop="priority">
|
||||||
|
<el-input v-model="formData.priority" placeholder="The higher the value, the higher the ranking"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="submitAdd()">Submit</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { reactive, ref, toRefs, onMounted, onBeforeUnmount, getCurrentInstance } from 'vue'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
|
import { localGet } from '../../utils'
|
||||||
|
import api from "../../utils/api";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'TagForm',
|
||||||
|
setup() {
|
||||||
|
const { proxy } = getCurrentInstance()
|
||||||
|
console.log('proxy', proxy)
|
||||||
|
const formRef = ref(null)
|
||||||
|
const route = useRoute()
|
||||||
|
const router = useRouter()
|
||||||
|
const { id } = route.query
|
||||||
|
const state = reactive({
|
||||||
|
token: localGet('token') || '',
|
||||||
|
id: id,
|
||||||
|
list: [],
|
||||||
|
formData: {
|
||||||
|
color: '',
|
||||||
|
name: '',
|
||||||
|
priority: ''
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
color: [
|
||||||
|
{ required: 'true', }
|
||||||
|
],
|
||||||
|
name: [
|
||||||
|
{ required: 'true', }
|
||||||
|
],
|
||||||
|
},
|
||||||
|
})
|
||||||
|
onMounted( async () => {
|
||||||
|
if (id) {
|
||||||
|
api.getTag(id).then(res => {
|
||||||
|
state.formData.name = res.data.name
|
||||||
|
state.formData.color = res.data.color
|
||||||
|
state.formData.priority = res.data.priority
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
|
||||||
|
})
|
||||||
|
const submitAdd = () => {
|
||||||
|
formRef.value.validate(async (vaild) => {
|
||||||
|
if (vaild) {
|
||||||
|
let params = state.formData;
|
||||||
|
console.log(params)
|
||||||
|
if (id) {
|
||||||
|
await api.updateTag(id, params)
|
||||||
|
} else {
|
||||||
|
await api.storeTag(params)
|
||||||
|
}
|
||||||
|
await router.push({name: 'tag'})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const listTag = async () => {
|
||||||
|
let res = await api.listTag()
|
||||||
|
state.list = res.data
|
||||||
|
}
|
||||||
|
|
||||||
|
const getTag = async (id) => {
|
||||||
|
let res = await api.getTag(id)
|
||||||
|
console.log(res)
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
...toRefs(state),
|
||||||
|
formRef,
|
||||||
|
submitAdd,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
160
admin/src/views/tag/index.vue
Normal file
160
admin/src/views/tag/index.vue
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
<template>
|
||||||
|
<el-card class="">
|
||||||
|
<template #header>
|
||||||
|
<div class="nexus-table-header">
|
||||||
|
<div class="left">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="right">
|
||||||
|
<el-button type="primary" icon="Plus" @click="handleAdd">Add</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
ref="multipleTable"
|
||||||
|
:data="tableData"
|
||||||
|
tooltip-effect="dark"
|
||||||
|
@selection-change="handleSelectionChange">
|
||||||
|
<el-table-column
|
||||||
|
type="selection"
|
||||||
|
width="55">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="id"
|
||||||
|
label="Id"
|
||||||
|
width="50"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="name"
|
||||||
|
label="Name"
|
||||||
|
></el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
prop="color"
|
||||||
|
label="Color"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
prop="priority"
|
||||||
|
label="Priority"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
prop="updated_at"
|
||||||
|
label="Updated at"
|
||||||
|
></el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
prop="created_at"
|
||||||
|
label="Created at"
|
||||||
|
></el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="Action"
|
||||||
|
width="120"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<a style="cursor: pointer; margin-right: 10px" @click="handleEdit(scope.row.id)">Edit</a>
|
||||||
|
<el-popconfirm
|
||||||
|
title="Confirm Delete ?"
|
||||||
|
@confirm="handleDelete(scope.row.id)"
|
||||||
|
>
|
||||||
|
<template #reference>
|
||||||
|
<a style="cursor: pointer">Delete</a>
|
||||||
|
</template>
|
||||||
|
</el-popconfirm>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!--总数超过一页,再展示分页器-->
|
||||||
|
<el-pagination
|
||||||
|
background
|
||||||
|
layout="prev, pager, next"
|
||||||
|
:total="total"
|
||||||
|
:page-size="perPage"
|
||||||
|
:current-page="currentPage"
|
||||||
|
@current-change="changePage"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { onMounted, reactive, ref, toRefs } from 'vue'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
|
import api from '../../utils/api'
|
||||||
|
import { useTable, renderTableData } from '../../utils/table'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'TagTable',
|
||||||
|
setup() {
|
||||||
|
const multipleTable = ref(null)
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
|
const state = useTable()
|
||||||
|
let extraData = reactive({
|
||||||
|
agentAllows: []
|
||||||
|
});
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
fetchTableData()
|
||||||
|
})
|
||||||
|
const fetchTableData = async () => {
|
||||||
|
state.loading = true
|
||||||
|
let res = await api.listTag(state.query)
|
||||||
|
renderTableData(res, state)
|
||||||
|
state.loading = false
|
||||||
|
}
|
||||||
|
const handleAdd = () => {
|
||||||
|
router.push({ name: 'tag-form' })
|
||||||
|
}
|
||||||
|
const handleEdit = (id) => {
|
||||||
|
router.push({ path: '/tag-form', query: { id } })
|
||||||
|
}
|
||||||
|
const handleDelete = async (id) => {
|
||||||
|
let res = await api.deleteTag(id)
|
||||||
|
ElMessage.success(res.msg)
|
||||||
|
state.query.page = 1;
|
||||||
|
await fetchTableData()
|
||||||
|
}
|
||||||
|
const handleSelectionChange = (val) => {
|
||||||
|
state.multipleSelection = val
|
||||||
|
}
|
||||||
|
const changePage = (val) => {
|
||||||
|
state.query.page = val
|
||||||
|
fetchTableData()
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleReset = () => {
|
||||||
|
state.query.family_id = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
...toRefs(state),
|
||||||
|
extraData,
|
||||||
|
multipleTable,
|
||||||
|
handleSelectionChange,
|
||||||
|
handleAdd,
|
||||||
|
handleEdit,
|
||||||
|
handleDelete,
|
||||||
|
fetchTableData,
|
||||||
|
changePage,
|
||||||
|
handleReset,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.swiper-container {
|
||||||
|
min-height: 100%;
|
||||||
|
}
|
||||||
|
.el-card.is-always-shadow {
|
||||||
|
min-height: 100%!important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
51
app/Console/Commands/MigrateTorrentTag.php
Normal file
51
app/Console/Commands/MigrateTorrentTag.php
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Models\User;
|
||||||
|
use App\Repositories\TagRepository;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
use Laravel\Sanctum\PersonalAccessToken;
|
||||||
|
|
||||||
|
class MigrateTorrentTag extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'torrent:migrate_tags';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Migrate exits torrent tags to new structure';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new command instance.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$rep = new TagRepository();
|
||||||
|
$result = $rep->migrateTorrentTag();
|
||||||
|
$log = sprintf('[%s], %s, result: %s, query: %s', REQUEST_ID, __METHOD__, var_export($result, true), last_query());
|
||||||
|
$this->info($log);
|
||||||
|
do_log($log);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Http\Resources\TagResource;
|
||||||
use App\Models\Attendance;
|
use App\Models\Attendance;
|
||||||
use App\Models\Exam;
|
use App\Models\Exam;
|
||||||
use App\Models\ExamProgress;
|
use App\Models\ExamProgress;
|
||||||
@@ -10,6 +11,7 @@ use App\Models\HitAndRun;
|
|||||||
use App\Models\Medal;
|
use App\Models\Medal;
|
||||||
use App\Models\SearchBox;
|
use App\Models\SearchBox;
|
||||||
use App\Models\Snatch;
|
use App\Models\Snatch;
|
||||||
|
use App\Models\Tag;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Repositories\AgentAllowRepository;
|
use App\Repositories\AgentAllowRepository;
|
||||||
use App\Repositories\AttendanceRepository;
|
use App\Repositories\AttendanceRepository;
|
||||||
@@ -60,10 +62,10 @@ class Test extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$peerId = '-TR3000-uff7q3z5126z';
|
$r = Tag::query()->paginate();
|
||||||
$agent = 'Transmission/3.00';
|
$resource = TagResource::collection($r);
|
||||||
$rep = new AgentAllowRepository();
|
dd($resource->response()->getData(true));
|
||||||
$r = $rep->checkClient($peerId, $agent, true);
|
echo $r->updated_at;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
101
app/Http/Controllers/TagController.php
Normal file
101
app/Http/Controllers/TagController.php
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Http\Resources\TagResource;
|
||||||
|
use App\Models\Tag;
|
||||||
|
use App\Repositories\TagRepository;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Validation\Rule;
|
||||||
|
|
||||||
|
class TagController extends Controller
|
||||||
|
{
|
||||||
|
private $repository;
|
||||||
|
|
||||||
|
public function __construct(TagRepository $repository)
|
||||||
|
{
|
||||||
|
$this->repository = $repository;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getRules($id = null): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'name' => ['required', 'string', Rule::unique('tags', 'name')->ignore($id)],
|
||||||
|
'color' => 'required|string',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function index(Request $request)
|
||||||
|
{
|
||||||
|
$result = $this->repository->getList($request->all());
|
||||||
|
$resource = TagResource::collection($result);
|
||||||
|
|
||||||
|
return $this->success($resource);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a newly created resource in storage.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$request->validate($this->getRules());
|
||||||
|
$data = $request->all();
|
||||||
|
if (isset($data['priority'])) {
|
||||||
|
$data['priority'] = intval($data['priority']);
|
||||||
|
}
|
||||||
|
$result = $this->repository->store($data);
|
||||||
|
$resource = new TagResource($result);
|
||||||
|
return $this->success($resource);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the specified resource.
|
||||||
|
*
|
||||||
|
* @param int $id
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$result = Tag::query()->findOrFail($id);
|
||||||
|
$resource = new TagResource($result);
|
||||||
|
return $this->success($resource);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in storage.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @param int $id
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function update(Request $request, $id)
|
||||||
|
{
|
||||||
|
$request->validate($this->getRules($id));
|
||||||
|
$data = $request->all();
|
||||||
|
if (isset($data['priority'])) {
|
||||||
|
$data['priority'] = intval($data['priority']);
|
||||||
|
}
|
||||||
|
$result = $this->repository->update($data, $id);
|
||||||
|
$resource = new TagResource($result);
|
||||||
|
return $this->success($resource);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specified resource from storage.
|
||||||
|
*
|
||||||
|
* @param int $id
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
$result = $this->repository->delete($id);
|
||||||
|
return $this->success($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
26
app/Http/Resources/TagResource.php
Normal file
26
app/Http/Resources/TagResource.php
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Resources;
|
||||||
|
|
||||||
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
|
|
||||||
|
class TagResource extends JsonResource
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Transform the resource into an array.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function toArray($request)
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'id' => $this->id,
|
||||||
|
'name' => $this->name,
|
||||||
|
'color' => $this->color,
|
||||||
|
'priority' => $this->priority,
|
||||||
|
'created_at' => format_datetime($this->created_at),
|
||||||
|
'updated_at' => format_datetime($this->updated_at),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
58
app/Models/Tag.php
Normal file
58
app/Models/Tag.php
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
class Tag extends NexusModel
|
||||||
|
{
|
||||||
|
public $timestamps = true;
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'id', 'name', 'color', 'priority', 'created_at', 'updated_at'
|
||||||
|
];
|
||||||
|
|
||||||
|
const DEFAULTS = [
|
||||||
|
[
|
||||||
|
'id' => 1,
|
||||||
|
'name' => '禁转',
|
||||||
|
'color' => '#ff0000',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'id' => 2,
|
||||||
|
'name' => '首发',
|
||||||
|
'color' => '#8F77B5',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'id' => 3,
|
||||||
|
'name' => '官方',
|
||||||
|
'color' => '#0000ff',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'id' => 4,
|
||||||
|
'name' => 'DIY',
|
||||||
|
'color' => '#46d5ff',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'id' => 5,
|
||||||
|
'name' => '国语',
|
||||||
|
'color' => '#6a3906',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'id' => 6,
|
||||||
|
'name' => '中字',
|
||||||
|
'color' => '#006400',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'id' => 7,
|
||||||
|
'name' => 'HDR',
|
||||||
|
'color' => '#38b03f',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
public function torrents(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||||
|
{
|
||||||
|
return $this->belongsToMany(Torrent::class, 'torrent_tags', 'tag_id', 'torrent_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -205,4 +205,9 @@ class Torrent extends NexusModel
|
|||||||
{
|
{
|
||||||
$query->where('visible', $visible);
|
$query->where('visible', $visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function tags(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||||
|
{
|
||||||
|
return $this->belongsToMany(Tag::class, 'torrent_tags', 'torrent_id', 'tag_id');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
14
app/Models/TorrentTag.php
Normal file
14
app/Models/TorrentTag.php
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
class TorrentTag extends NexusModel
|
||||||
|
{
|
||||||
|
public $timestamps = true;
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'torrent_id', 'tag_id', 'priority'
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
131
app/Repositories/TagRepository.php
Normal file
131
app/Repositories/TagRepository.php
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Repositories;
|
||||||
|
|
||||||
|
use App\Models\Tag;
|
||||||
|
use App\Models\Torrent;
|
||||||
|
use App\Models\TorrentTag;
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
|
use Nexus\Database\NexusDB;
|
||||||
|
|
||||||
|
class TagRepository extends BaseRepository
|
||||||
|
{
|
||||||
|
public function getList(array $params)
|
||||||
|
{
|
||||||
|
$query = $this->createBasicQuery();
|
||||||
|
return $query->paginate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(array $params)
|
||||||
|
{
|
||||||
|
$model = Tag::query()->create($params);
|
||||||
|
return $model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update(array $params, $id)
|
||||||
|
{
|
||||||
|
$model = Tag::query()->findOrFail($id);
|
||||||
|
$model->update($params);
|
||||||
|
return $model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDetail($id)
|
||||||
|
{
|
||||||
|
$model = Tag::query()->findOrFail($id);
|
||||||
|
return $model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function delete($id)
|
||||||
|
{
|
||||||
|
$model = Tag::query()->findOrFail($id);
|
||||||
|
$result = $model->delete();
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function createBasicQuery()
|
||||||
|
{
|
||||||
|
return Tag::query()->orderBy('priority', 'desc')->orderBy('id', 'desc');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function renderCheckbox(array $checked = []): string
|
||||||
|
{
|
||||||
|
$html = '';
|
||||||
|
$results = $this->createBasicQuery()->get();
|
||||||
|
foreach ($results as $value) {
|
||||||
|
$html .= sprintf(
|
||||||
|
'<label><input type="checkbox" name="tags[]" value="%s"%s />%s</label>',
|
||||||
|
$value->id, in_array($value->id, $checked) ? ' checked' : '', $value->name
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function renderSpan(Collection $tagKeyById, array $renderIdArr = [], $withFilterLink = false): string
|
||||||
|
{
|
||||||
|
$html = '';
|
||||||
|
foreach ($renderIdArr as $tagId) {
|
||||||
|
$value = $tagKeyById->get($tagId);
|
||||||
|
if ($value) {
|
||||||
|
$item = "<span style=\"background-color:{$value->color};color:white;border-radius:15%\">{$value->name}</span> ";
|
||||||
|
if ($withFilterLink) {
|
||||||
|
$html .= sprintf('<a href="torrents.php?tag_id=%s">%s</a>', $tagId, $item);
|
||||||
|
} else {
|
||||||
|
$html .= $item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function migrateTorrentTag()
|
||||||
|
{
|
||||||
|
$page = 1;
|
||||||
|
$size = 1000;
|
||||||
|
$baseQuery = Torrent::query()->where('tags', '>', 0);
|
||||||
|
do_log("torrent to migrate hr counts: " . (clone $baseQuery)->count());
|
||||||
|
$dateTimeStringNow = date('Y-m-d H:i:s');
|
||||||
|
$tags = [];
|
||||||
|
$priority = count(Tag::DEFAULTS);
|
||||||
|
foreach (Tag::DEFAULTS as $value) {
|
||||||
|
$attributes = [
|
||||||
|
'name' => $value['name'],
|
||||||
|
];
|
||||||
|
$values = [
|
||||||
|
'priority' => $priority,
|
||||||
|
'color' => $value['color'],
|
||||||
|
'created_at' => $dateTimeStringNow,
|
||||||
|
'updated_at' => $dateTimeStringNow,
|
||||||
|
];
|
||||||
|
$tags[] = Tag::query()->firstOrCreate($attributes, $values);
|
||||||
|
$priority--;
|
||||||
|
}
|
||||||
|
do_log("insert default tags done!");
|
||||||
|
|
||||||
|
$sql = "insert into torrent_tags (torrent_id, tag_id, created_at, updated_at) values ";
|
||||||
|
$values = [];
|
||||||
|
while (true) {
|
||||||
|
$logPrefix = "page: $page, size: $size";
|
||||||
|
$results = (clone $baseQuery)->forPage($page, $size)->get();
|
||||||
|
if ($results->isEmpty()) {
|
||||||
|
do_log("$logPrefix, no more data...");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
foreach ($results as $torrent) {
|
||||||
|
foreach ($tags as $key => $tag) {
|
||||||
|
$currentValue = pow(2, $key);
|
||||||
|
if ($currentValue & $torrent->tags) {
|
||||||
|
//this torrent has this tag
|
||||||
|
$values[] = sprintf("(%d, %d, '%s', '%s')", $torrent->id, $tag->id, $dateTimeStringNow, $dateTimeStringNow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$page++;
|
||||||
|
}
|
||||||
|
$sql .= sprintf("%s on duplicate key update updated_at = values(updated_at)", implode(', ', $values));
|
||||||
|
do_log("migrate sql: $sql");
|
||||||
|
NexusDB::statement($sql);
|
||||||
|
do_log("[MIGRATE_TORRENT_TAG] done!");
|
||||||
|
return count($values);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -14,7 +14,9 @@ class AddTotalDaysToAttendanceTable extends Migration
|
|||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('attendance', function (Blueprint $table) {
|
Schema::table('attendance', function (Blueprint $table) {
|
||||||
$table->integer('total_days')->default(0);
|
if (!Schema::hasColumn('attendance', 'total_days')) {
|
||||||
|
$table->integer('total_days')->default(0);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,9 @@ class AddHrToTorrentsTable extends Migration
|
|||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('torrents', function (Blueprint $table) {
|
Schema::table('torrents', function (Blueprint $table) {
|
||||||
$table->tinyInteger('hr')->default(0);
|
if (!Schema::hasColumn('torrents', 'hr')) {
|
||||||
|
$table->tinyInteger('hr')->default(0);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,9 @@ class AddSeedPointsToUsersTable extends Migration
|
|||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('users', function (Blueprint $table) {
|
Schema::table('users', function (Blueprint $table) {
|
||||||
$table->decimal('seed_points', 20, 1)->default(0);
|
if (!Schema::hasColumn('users', 'seed_points')) {
|
||||||
|
$table->decimal('seed_points', 20, 1)->default(0);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,9 @@ class AddIdToAgentAllowedExceptionTable extends Migration
|
|||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('agent_allowed_exception', function (Blueprint $table) {
|
Schema::table('agent_allowed_exception', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
if (!Schema::hasColumn('agent_allowed_exception', 'id')) {
|
||||||
|
$table->increments('id');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
34
database/migrations/2022_03_07_012545_create_tags_table.php
Normal file
34
database/migrations/2022_03_07_012545_create_tags_table.php
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class CreateTagsTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::create('tags', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('name')->unique();
|
||||||
|
$table->string('color');
|
||||||
|
$table->integer('priority')->default(0);
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('tags');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class CreateTorrentTagsTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::create('torrent_tags', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->integer('torrent_id');
|
||||||
|
$table->integer('tag_id')->index();
|
||||||
|
$table->timestamps();
|
||||||
|
$table->unique(['torrent_id', 'tag_id']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('torrent_tags');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddIconIdToCategoriesTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('categories', function (Blueprint $table) {
|
||||||
|
if (!Schema::hasColumn('categories', 'icon_id')) {
|
||||||
|
$table->integer('icon_id')->default(0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('categories', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('icon_id');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddInviteeFieldsToInvitesTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
if (Schema::hasColumn('invites', 'valid')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Schema::table('invites', function (Blueprint $table) {
|
||||||
|
$table->tinyInteger('valid')->default(1);
|
||||||
|
$table->integer('invitee_register_uid')->nullable();
|
||||||
|
$table->string('invitee_register_email')->nullable();
|
||||||
|
$table->string('invitee_register_username')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('invites', function (Blueprint $table) {
|
||||||
|
$table->dropColumn(['valid', 'invitee_register_uid', 'invitee_register_email', 'invitee_register_username']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddCustomFieldsToSearchboxTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
if (Schema::hasColumn('searchbox', 'custom_fields')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Schema::table('searchbox', function (Blueprint $table) {
|
||||||
|
$table->text('custom_fields')->nullable();
|
||||||
|
$table->string('custom_fields_display_name')->nullable();
|
||||||
|
$table->text('custom_fields_display')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('searchbox', function (Blueprint $table) {
|
||||||
|
$table->dropColumn(['custom_fields', 'custom_fields_display_name', 'custom_fields_display']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddPtGenTagsTechnicalInfoToTorrentsTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('torrents', function (Blueprint $table) {
|
||||||
|
if (!Schema::hasColumn('torrents', 'pt_gen')) {
|
||||||
|
$table->mediumText('pt_gen')->nullable();
|
||||||
|
}
|
||||||
|
if (!Schema::hasColumn('torrents', 'tags')) {
|
||||||
|
$table->integer('tags')->default(0);
|
||||||
|
}
|
||||||
|
if (!Schema::hasColumn('torrents', 'technical_info')) {
|
||||||
|
$table->text('technical_info')->nullable();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('torrents', function (Blueprint $table) {
|
||||||
|
$table->dropColumn(['pt_gen', 'tags', 'technical_info']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddPageToUsersTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('users', function (Blueprint $table) {
|
||||||
|
if (!Schema::hasColumn('users', 'page')) {
|
||||||
|
$table->string('page')->nullable();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('users', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('page');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3084,7 +3084,15 @@ function torrenttable($rows, $variant = "torrent") {
|
|||||||
$ptGen = new Nexus\PTGen\PTGen();
|
$ptGen = new Nexus\PTGen\PTGen();
|
||||||
$imdb = new Nexus\Imdb\Imdb();
|
$imdb = new Nexus\Imdb\Imdb();
|
||||||
$torrent = new Nexus\Torrent\Torrent();
|
$torrent = new Nexus\Torrent\Torrent();
|
||||||
$torrentSeedingLeechingStatus = $torrent->listLeechingSeedingStatus($CURUSER['id'], array_column($rows, 'id'));
|
$torrentIdArr = array_column($rows, 'id');
|
||||||
|
$torrentSeedingLeechingStatus = $torrent->listLeechingSeedingStatus($CURUSER['id'], $torrentIdArr);
|
||||||
|
$tagRep = new \App\Repositories\TagRepository();
|
||||||
|
$tagCollection = $tagRep->createBasicQuery()->get();
|
||||||
|
$tagIdStr = $tagCollection->implode('id', ',');
|
||||||
|
$torrentTagCollection = \App\Models\TorrentTag::query()->whereIn('torrent_id', $torrentIdArr)->orderByRaw("field(tag_id,$tagIdStr)")->get();
|
||||||
|
$tagKeyById = $tagCollection->keyBy('id');
|
||||||
|
$torrentTagResult = $torrentTagCollection->groupBy('torrent_id');
|
||||||
|
|
||||||
$last_browse = $CURUSER['last_browse'];
|
$last_browse = $CURUSER['last_browse'];
|
||||||
// if ($variant == "torrent"){
|
// if ($variant == "torrent"){
|
||||||
// $last_browse = $CURUSER['last_browse'];
|
// $last_browse = $CURUSER['last_browse'];
|
||||||
@@ -3275,7 +3283,12 @@ foreach ($rows as $row)
|
|||||||
$banned_torrent = ($row["banned"] == 'yes' ? " <b>(<font class=\"striking\">".$lang_functions['text_banned']."</font>)</b>" : "");
|
$banned_torrent = ($row["banned"] == 'yes' ? " <b>(<font class=\"striking\">".$lang_functions['text_banned']."</font>)</b>" : "");
|
||||||
$sp_torrent_sub = get_torrent_promotion_append_sub($row['sp_state'],"",true,$row['added'], $row['promotion_time_type'], $row['promotion_until']);
|
$sp_torrent_sub = get_torrent_promotion_append_sub($row['sp_state'],"",true,$row['added'], $row['promotion_time_type'], $row['promotion_until']);
|
||||||
print($banned_torrent.$picked_torrent.$sp_torrent.$sp_torrent_sub. $hrImg);
|
print($banned_torrent.$picked_torrent.$sp_torrent.$sp_torrent_sub. $hrImg);
|
||||||
$tags = torrentTags($row['tags'], 'span');
|
//$tags = torrentTags($row['tags'], 'span');
|
||||||
|
/**
|
||||||
|
* render tags
|
||||||
|
*/
|
||||||
|
$tagIdArr = $torrentTagResult->get($id)->pluck('tag_id')->toArray();
|
||||||
|
$tags = $tagRep->renderSpan($tagKeyById, $tagIdArr);
|
||||||
if ($displaysmalldescr){
|
if ($displaysmalldescr){
|
||||||
//small descr
|
//small descr
|
||||||
$dissmall_descr = trim($row["small_descr"]);
|
$dissmall_descr = trim($row["small_descr"]);
|
||||||
@@ -5287,4 +5300,20 @@ function build_medal_image(\Illuminate\Support\Collection $medals, $maxHeight =
|
|||||||
return implode('', $medalImages);
|
return implode('', $medalImages);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function insert_torrent_tags($torrentId, $tagIdArr, $sync = false)
|
||||||
|
{
|
||||||
|
$dateTimeStringNow = date('Y-m-d H:i:s');
|
||||||
|
if ($sync) {
|
||||||
|
sql_query("delete from torrent_tags where torrent_id = $torrentId");
|
||||||
|
}
|
||||||
|
$insertTagsSql = 'insert into torrent_tags (`torrent_id`, `tag_id`, `created_at`, `updated_at`) values ';
|
||||||
|
$values = [];
|
||||||
|
foreach ($tagIdArr as $tagId) {
|
||||||
|
$values[] = sprintf("(%s, %s, '%s', '%s')", $torrentId, $tagId, $dateTimeStringNow, $dateTimeStringNow);
|
||||||
|
}
|
||||||
|
$insertTagsSql .= implode(', ', $values);
|
||||||
|
do_log("[INSERT_TAGS], torrent: $torrentId with tags: " . nexus_json_encode($tagIdArr));
|
||||||
|
sql_query($insertTagsSql);
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -251,6 +251,14 @@ class NexusDB
|
|||||||
return DB::raw($value);
|
return DB::raw($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function statement($value)
|
||||||
|
{
|
||||||
|
if (IN_NEXUS) {
|
||||||
|
return sql_query($value);
|
||||||
|
}
|
||||||
|
return DB::statement($value);
|
||||||
|
}
|
||||||
|
|
||||||
public static function transaction(\Closure $callback, $attempts = 1)
|
public static function transaction(\Closure $callback, $attempts = 1)
|
||||||
{
|
{
|
||||||
if (IN_NEXUS) {
|
if (IN_NEXUS) {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class Install
|
|||||||
|
|
||||||
protected $progressKeyPrefix = '__step';
|
protected $progressKeyPrefix = '__step';
|
||||||
|
|
||||||
protected $steps = ['环境检测', '添加 .env 文件', '创建数据表', '导入数据', '创建管理员账号'];
|
protected $steps = ['Env check', 'Create .env', 'Create tables', 'Import data', 'Create administrator'];
|
||||||
|
|
||||||
protected $initializeTables = [
|
protected $initializeTables = [
|
||||||
'adminpanel', 'agent_allowed_exception', 'agent_allowed_family', 'allowedemails', 'audiocodecs', 'bannedemails', 'categories',
|
'adminpanel', 'agent_allowed_exception', 'agent_allowed_family', 'allowedemails', 'audiocodecs', 'bannedemails', 'categories',
|
||||||
@@ -326,7 +326,7 @@ class Install
|
|||||||
$currentStep = $this->currentStep();
|
$currentStep = $this->currentStep();
|
||||||
foreach ($this->steps as $key => $value) {
|
foreach ($this->steps as $key => $value) {
|
||||||
$steps .= sprintf('<div class="flex-1 %s">', $currentStep > $key + 1 ? 'text-green-500' : ($currentStep < $key + 1 ? 'text-gray-500' : ''));
|
$steps .= sprintf('<div class="flex-1 %s">', $currentStep > $key + 1 ? 'text-green-500' : ($currentStep < $key + 1 ? 'text-gray-500' : ''));
|
||||||
$steps .= sprintf('<div>第%s步</div>', $key + 1);
|
$steps .= sprintf('<div>step %s</div>', $key + 1);
|
||||||
$steps .= sprintf('<div>%s</div>', $value);
|
$steps .= sprintf('<div>%s</div>', $value);
|
||||||
$steps .= '</div>';
|
$steps .= '</div>';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,9 +10,13 @@ use App\Models\ExamUser;
|
|||||||
use App\Models\HitAndRun;
|
use App\Models\HitAndRun;
|
||||||
use App\Models\Icon;
|
use App\Models\Icon;
|
||||||
use App\Models\Setting;
|
use App\Models\Setting;
|
||||||
|
use App\Models\Tag;
|
||||||
|
use App\Models\Torrent;
|
||||||
|
use App\Models\TorrentTag;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Repositories\BonusRepository;
|
use App\Repositories\BonusRepository;
|
||||||
use App\Repositories\ExamRepository;
|
use App\Repositories\ExamRepository;
|
||||||
|
use App\Repositories\TagRepository;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
@@ -22,7 +26,7 @@ use Nexus\Database\NexusDB;
|
|||||||
class Update extends Install
|
class Update extends Install
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $steps = ['环境检测', '获取更新', '更新 .env 文件', '执行更新'];
|
protected $steps = ['Env check', 'Get files', 'Update .env', 'Perform updates'];
|
||||||
|
|
||||||
|
|
||||||
public function getLogFile()
|
public function getLogFile()
|
||||||
@@ -92,8 +96,9 @@ class Update extends Install
|
|||||||
$this->doLog("[ADD CUSTOM FIELD MENU] insert: " . json_encode($insert) . " to table: $table, id: $id");
|
$this->doLog("[ADD CUSTOM FIELD MENU] insert: " . json_encode($insert) . " to table: $table, id: $id");
|
||||||
}
|
}
|
||||||
//since beta8
|
//since beta8
|
||||||
if (WITH_LARAVEL && NexusDB::schema()->hasColumn('categories', 'icon_id')) {
|
if (WITH_LARAVEL && !NexusDB::schema()->hasColumn('categories', 'icon_id')) {
|
||||||
$this->doLog('[INIT CATEGORY ICON_ID]');
|
$this->doLog('[INIT CATEGORY ICON_ID]');
|
||||||
|
$this->runMigrate('database/migrations/2022_03_08_040415_add_icon_id_to_categories_table.php');
|
||||||
$icon = Icon::query()->orderBy('id', 'asc')->first();
|
$icon = Icon::query()->orderBy('id', 'asc')->first();
|
||||||
if ($icon) {
|
if ($icon) {
|
||||||
Category::query()->where('icon_id', 0)->update(['icon_id' => $icon->id]);
|
Category::query()->where('icon_id', 0)->update(['icon_id' => $icon->id]);
|
||||||
@@ -158,6 +163,26 @@ class Update extends Install
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function runExtraMigrate()
|
||||||
|
{
|
||||||
|
if (!WITH_LARAVEL) {
|
||||||
|
$this->doLog(__METHOD__ . ", laravel is not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
NexusDB::schema()->hasColumn('torrents', 'tags')
|
||||||
|
&& Torrent::query()->where('tags', '>', 0)->count() > 0
|
||||||
|
&& TorrentTag::query()->count() == 0
|
||||||
|
) {
|
||||||
|
$this->doLog("[MIGRATE_TORRENT_TAG]...");
|
||||||
|
$tagRep = new TagRepository();
|
||||||
|
$tagRep->migrateTorrentTag();
|
||||||
|
$this->doLog("[MIGRATE_TORRENT_TAG] done!");
|
||||||
|
} else {
|
||||||
|
$this->doLog("no need to run [MIGRATE_TORRENT_TAG]");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function migrateAttendance()
|
private function migrateAttendance()
|
||||||
@@ -301,4 +326,6 @@ class Update extends Install
|
|||||||
$this->doLog("[COMPOSER INSTALL] SUCCESS");
|
$this->doLog("[COMPOSER INSTALL] SUCCESS");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ if ($currentStep == 1) {
|
|||||||
|
|
||||||
if ($currentStep == 2) {
|
if ($currentStep == 2) {
|
||||||
$envExampleFile = $rootpath . ".env.example";
|
$envExampleFile = $rootpath . ".env.example";
|
||||||
// $dbstructureFile = $rootpath . "_db/dbstructure_v1.6.sql";
|
|
||||||
$envExampleData = readEnvFile($envExampleFile);
|
$envExampleData = readEnvFile($envExampleFile);
|
||||||
$envFormControls = $install->listEnvFormControls();
|
$envFormControls = $install->listEnvFormControls();
|
||||||
$newData = array_column($envFormControls, 'value', 'name');
|
$newData = array_column($envFormControls, 'value', 'name');
|
||||||
@@ -45,12 +44,6 @@ if ($currentStep == 2) {
|
|||||||
'current' => $envExampleFile,
|
'current' => $envExampleFile,
|
||||||
'result' => $install->yesOrNo(file_exists($envExampleFile) && is_readable($envExampleFile)),
|
'result' => $install->yesOrNo(file_exists($envExampleFile) && is_readable($envExampleFile)),
|
||||||
],
|
],
|
||||||
// [
|
|
||||||
// 'label' => basename($dbstructureFile),
|
|
||||||
// 'required' => 'exists && readable',
|
|
||||||
// 'current' => $dbstructureFile,
|
|
||||||
// 'result' => $install->yesOrNo(file_exists($dbstructureFile) && is_readable($dbstructureFile)),
|
|
||||||
// ],
|
|
||||||
];
|
];
|
||||||
$fails = array_filter($tableRows, function ($value) {return $value['result'] == 'NO';});
|
$fails = array_filter($tableRows, function ($value) {return $value['result'] == 'NO';});
|
||||||
$pass = empty($fails);
|
$pass = empty($fails);
|
||||||
@@ -134,10 +127,10 @@ if ($currentStep == 5) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$userFormControls = [
|
$userFormControls = [
|
||||||
['label' => '用户名', 'name' => 'username', 'value' => $_POST['username'] ?? ''],
|
['label' => 'Username', 'name' => 'username', 'value' => $_POST['username'] ?? ''],
|
||||||
['label' => '邮箱', 'name' => 'email', 'value' => $_POST['email'] ?? ''],
|
['label' => 'Email', 'name' => 'email', 'value' => $_POST['email'] ?? ''],
|
||||||
['label' => '密码', 'name' => 'password', 'value' => $_POST['password'] ?? ''],
|
['label' => 'Password', 'name' => 'password', 'value' => $_POST['password'] ?? ''],
|
||||||
['label' => '确认密码', 'name' => 'confirm_password', 'value' => $_POST['confirm_password'] ?? ''],
|
['label' => 'Re-password', 'name' => 'confirm_password', 'value' => $_POST['confirm_password'] ?? ''],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,10 +157,10 @@ if (!empty($error)) {
|
|||||||
<?php
|
<?php
|
||||||
echo'<div class="step-' . $currentStep . ' text-center">';
|
echo'<div class="step-' . $currentStep . ' text-center">';
|
||||||
$header = [
|
$header = [
|
||||||
'label' => '项目',
|
'label' => 'Item',
|
||||||
'required' => '要求',
|
'required' => 'Require',
|
||||||
'current' => '当前',
|
'current' => 'Current',
|
||||||
'result' => '结果'
|
'result' => 'Result'
|
||||||
];
|
];
|
||||||
if ($currentStep == 1) {
|
if ($currentStep == 1) {
|
||||||
echo $install->renderTable($header, $requirements['table_rows']);
|
echo $install->renderTable($header, $requirements['table_rows']);
|
||||||
@@ -176,23 +169,23 @@ if (!empty($error)) {
|
|||||||
echo $install->renderForm($envFormControls);
|
echo $install->renderForm($envFormControls);
|
||||||
|
|
||||||
} elseif ($currentStep == 3) {
|
} elseif ($currentStep == 3) {
|
||||||
echo '<h1 class="mb-4 text-lg font-bold">需要新建以下数据表</h1>';
|
echo '<h1 class="mb-4 text-lg font-bold">The following new table will be created</h1>';
|
||||||
if (empty($shouldCreateTable)) {
|
if (empty($shouldCreateTable)) {
|
||||||
echo '<div class="text-green-600 text-center">恭喜,需要的表均已创建!</div>';
|
echo '<div class="text-green-600 text-center">Congratulations, all the required tables have been created!</div>';
|
||||||
} else {
|
} else {
|
||||||
echo sprintf('<div class="h-64 text-left inline-block w-2/3"><code class="bolck w-px-100">%s</code></div>', implode(', ', array_keys($shouldCreateTable)));
|
echo sprintf('<div class="h-64 text-left inline-block w-2/3"><code class="bolck w-px-100">%s</code></div>', implode(', ', array_keys($shouldCreateTable)));
|
||||||
}
|
}
|
||||||
} elseif ($currentStep == 4) {
|
} elseif ($currentStep == 4) {
|
||||||
echo $install->renderTable($header, $tableRows);
|
echo $install->renderTable($header, $tableRows);
|
||||||
echo '<div class="text-blue-500 pt-10">';
|
echo '<div class="text-blue-500 pt-10">';
|
||||||
echo sprintf('这一步会把 <code>%s</code> 的数据合并到 <code>%s</code>, 然后插入数据库中。', $tableRows[1]['label'], $tableRows[0]['label']);
|
echo sprintf('This step will merge <code>%s</code> to <code>%s</code>, then insert into database', $tableRows[1]['label'], $tableRows[0]['label']);
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
} elseif ($currentStep == 5) {
|
} elseif ($currentStep == 5) {
|
||||||
echo $install->renderForm($userFormControls, '1/3', '1/4', '3/4');
|
echo $install->renderForm($userFormControls, '1/3', '1/4', '3/4');
|
||||||
} elseif ($currentStep > $maxStep) {
|
} elseif ($currentStep > $maxStep) {
|
||||||
echo '<div class="text-green-900 text-6xl p-10">恭喜,一切就绪!</div>';
|
echo '<div class="text-green-900 text-6xl p-10">Congratulations, everything is ready!</div>';
|
||||||
echo '<div class="mb-6">有问题可查阅安装日志:<code>' . $install->getLogFile() . '</code></div>';
|
echo '<div class="mb-6">For questions, consult the installation log at: <code>' . $install->getLogFile() . '</code></div>';
|
||||||
echo '<div class="text-red-500">为安全起见,请删除以下目录</div>';
|
echo '<div class="text-red-500">For security reasons, please delete the following directories</div>';
|
||||||
echo '<div class="text-red-500"><code>' . $install->getInsallDirectory() . '</code></div>';
|
echo '<div class="text-red-500"><code>' . $install->getInsallDirectory() . '</code></div>';
|
||||||
}
|
}
|
||||||
echo'</div>';
|
echo'</div>';
|
||||||
@@ -207,18 +200,18 @@ if (!empty($error)) {
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<div class="mt-10 text-center">
|
<div class="mt-10 text-center">
|
||||||
<button class="bg-blue-500 p-2 m-4 text-white rounded" type="button" onclick="goBack()">上一步</button>
|
<button class="bg-blue-500 p-2 m-4 text-white rounded" type="button" onclick="goBack()">Prev</button>
|
||||||
<?php if ($currentStep <= $maxStep) {?>
|
<?php if ($currentStep <= $maxStep) {?>
|
||||||
<button class="bg-blue-<?php echo $pass ? 500 : 200;?> p-2 m-4 text-white rounded" type="submit" <?php echo $pass ? '' : 'disabled';?>>下一步</button>
|
<button class="bg-blue-<?php echo $pass ? 500 : 200;?> p-2 m-4 text-white rounded" type="submit" <?php echo $pass ? '' : 'disabled';?>>Next</button>
|
||||||
<?php } else {?>
|
<?php } else {?>
|
||||||
<a class="bg-blue-500 p-2 m-4 text-white rounded" href="<?php echo getSchemeAndHttpHost()?>">回首页</a>
|
<a class="bg-blue-500 p-2 m-4 text-white rounded" href="<?php echo getSchemeAndHttpHost()?>">Go to homepage</a>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="m-10 text-center">
|
<div class="m-10 text-center">
|
||||||
欢迎使用 NexusPHP 安装程序,如有疑问,点击<a href="https://nexusphp.org/" target="_blank" class="text-blue-500 p-1">这里</a>获取帮助。
|
Welcome to the NexusPHP installer, if you have any questions, click<a href="https://nexusphp.org/" target="_blank" class="text-blue-500 p-1">here</a>for help.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -39,15 +39,15 @@ if ($currentStep == 2) {
|
|||||||
}
|
}
|
||||||
if (!$isPost) {
|
if (!$isPost) {
|
||||||
$versionHeader = [
|
$versionHeader = [
|
||||||
'checkbox' => '选择',
|
'checkbox' => 'Check',
|
||||||
'tag_name' => '版本(标签)',
|
'tag_name' => 'Version(tag)',
|
||||||
'name' => '名称',
|
'name' => 'Description',
|
||||||
'published_at' => '发布时间',
|
'published_at' => 'Release at',
|
||||||
];
|
];
|
||||||
$tableRows[] = [
|
$tableRows[] = [
|
||||||
'checkbox' => sprintf('<input type="radio" name="version_url" value="manual"/>'),
|
'checkbox' => sprintf('<input type="radio" name="version_url" value="manual"/>'),
|
||||||
'tag_name' => '手动更新',
|
'tag_name' => 'Manual',
|
||||||
'name' => '如若有改动不宜全量覆盖,请勾选此选项并确保已经手动更新了代码',
|
'name' => 'If there are changes that are not suitable for full coverage, please check this box and make sure you have updated the code manually',
|
||||||
'published_at' => '---',
|
'published_at' => '---',
|
||||||
];
|
];
|
||||||
$latestCommit = $update->getLatestCommit();
|
$latestCommit = $update->getLatestCommit();
|
||||||
@@ -55,8 +55,8 @@ if ($currentStep == 2) {
|
|||||||
$time->tz = nexus_env('TIMEZONE');
|
$time->tz = nexus_env('TIMEZONE');
|
||||||
$tableRows[] = [
|
$tableRows[] = [
|
||||||
'checkbox' => sprintf('<input type="radio" name="version_url" value="development|%s"/>', $latestCommit['sha']),
|
'checkbox' => sprintf('<input type="radio" name="version_url" value="development|%s"/>', $latestCommit['sha']),
|
||||||
'tag_name' => '最新开发代码',
|
'tag_name' => 'Latest development code',
|
||||||
'name' => "仅限开发测试!最新提交:" . $latestCommit['commit']['message'],
|
'name' => "Development testing only! Latest commit:" . $latestCommit['commit']['message'],
|
||||||
'published_at' => $time->format('Y-m-d H:i:s'),
|
'published_at' => $time->format('Y-m-d H:i:s'),
|
||||||
];
|
];
|
||||||
foreach ($versions as $version) {
|
foreach ($versions as $version) {
|
||||||
@@ -80,7 +80,7 @@ if ($currentStep == 2) {
|
|||||||
while ($isPost) {
|
while ($isPost) {
|
||||||
try {
|
try {
|
||||||
if (empty($_REQUEST['version_url'])) {
|
if (empty($_REQUEST['version_url'])) {
|
||||||
throw new \RuntimeException("没有选择版本");
|
throw new \RuntimeException("No version selected yet");
|
||||||
}
|
}
|
||||||
$downloadUrl = '';
|
$downloadUrl = '';
|
||||||
if ($_REQUEST['version_url'] == 'manual') {
|
if ($_REQUEST['version_url'] == 'manual') {
|
||||||
@@ -97,7 +97,7 @@ if ($currentStep == 2) {
|
|||||||
}
|
}
|
||||||
$update->doLog("version: $version, downloadUrl: $downloadUrl, currentVersion: " . VERSION_NUMBER);
|
$update->doLog("version: $version, downloadUrl: $downloadUrl, currentVersion: " . VERSION_NUMBER);
|
||||||
if (version_compare($version, VERSION_NUMBER, '<=')) {
|
if (version_compare($version, VERSION_NUMBER, '<=')) {
|
||||||
throw new \RuntimeException("必须选择一个高于当前版本(" . VERSION_NUMBER . ")的");
|
throw new \RuntimeException("Must select a version higher than the current one(" . VERSION_NUMBER . ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$update->downAndExtractCode($downloadUrl);
|
$update->downAndExtractCode($downloadUrl);
|
||||||
@@ -113,7 +113,6 @@ if ($currentStep == 2) {
|
|||||||
|
|
||||||
if ($currentStep == 3) {
|
if ($currentStep == 3) {
|
||||||
$envExampleFile = $rootpath . ".env.example";
|
$envExampleFile = $rootpath . ".env.example";
|
||||||
// $dbstructureFile = $rootpath . "_db/dbstructure_v1.6.sql";
|
|
||||||
$envExampleData = readEnvFile($envExampleFile);
|
$envExampleData = readEnvFile($envExampleFile);
|
||||||
$envFormControls = $update->listEnvFormControls();
|
$envFormControls = $update->listEnvFormControls();
|
||||||
$newData = array_column($envFormControls, 'value', 'name');
|
$newData = array_column($envFormControls, 'value', 'name');
|
||||||
@@ -134,12 +133,6 @@ if ($currentStep == 3) {
|
|||||||
'current' => $envExampleFile,
|
'current' => $envExampleFile,
|
||||||
'result' => $update->yesOrNo(file_exists($envExampleFile) && is_readable($envExampleFile)),
|
'result' => $update->yesOrNo(file_exists($envExampleFile) && is_readable($envExampleFile)),
|
||||||
],
|
],
|
||||||
// [
|
|
||||||
// 'label' => basename($dbstructureFile),
|
|
||||||
// 'required' => 'exists && readable',
|
|
||||||
// 'current' => $dbstructureFile,
|
|
||||||
// 'result' => $update->yesOrNo(file_exists($dbstructureFile) && is_readable($dbstructureFile)),
|
|
||||||
// ],
|
|
||||||
];
|
];
|
||||||
$fails = array_filter($tableRows, function ($value) {return $value['result'] == 'NO';});
|
$fails = array_filter($tableRows, function ($value) {return $value['result'] == 'NO';});
|
||||||
$pass = empty($fails);
|
$pass = empty($fails);
|
||||||
@@ -159,6 +152,7 @@ if ($currentStep == 4) {
|
|||||||
$update->saveSettings($settings);
|
$update->saveSettings($settings);
|
||||||
$update->runExtraQueries();
|
$update->runExtraQueries();
|
||||||
$update->runMigrate();
|
$update->runMigrate();
|
||||||
|
$update->runExtraMigrate();
|
||||||
$update->nextStep();
|
$update->nextStep();
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$error = $e->getMessage();
|
$error = $e->getMessage();
|
||||||
@@ -191,33 +185,33 @@ if (!empty($error)) {
|
|||||||
<?php
|
<?php
|
||||||
echo'<div class="step-' . $currentStep . ' text-center">';
|
echo'<div class="step-' . $currentStep . ' text-center">';
|
||||||
$header = [
|
$header = [
|
||||||
'label' => '项目',
|
'label' => 'Item',
|
||||||
'required' => '要求',
|
'required' => 'Require',
|
||||||
'current'=> '当前',
|
'current'=> 'Current',
|
||||||
'result'=> '结果'
|
'result'=> 'Result'
|
||||||
];
|
];
|
||||||
if ($currentStep == 1) {
|
if ($currentStep == 1) {
|
||||||
echo $update->renderTable($header, $requirements['table_rows']);
|
echo $update->renderTable($header, $requirements['table_rows']);
|
||||||
} elseif ($currentStep == 3) {
|
} elseif ($currentStep == 3) {
|
||||||
echo $update->renderTable($header, $tableRows);
|
echo $update->renderTable($header, $tableRows);
|
||||||
echo '<div class="text-gray-700 p-4 text-red-400">下一步之前,请确保在根目录执行了 composer install 更新了依赖。</div>';
|
echo '<div class="text-gray-700 p-4 text-red-400">Before the next step, make sure that you have executed <code>composer install</code> in the root directory to update the dependencies.</div>';
|
||||||
echo $update->renderForm($envFormControls);
|
echo $update->renderForm($envFormControls);
|
||||||
|
|
||||||
} elseif ($currentStep == 2) {
|
} elseif ($currentStep == 2) {
|
||||||
if (empty($tableRows)) {
|
if (empty($tableRows)) {
|
||||||
echo '<div class="text-green-600 text-center">抱歉,暂无任何版可以选择!</div>';
|
echo '<div class="text-green-600 text-center">Sorry, there is no version to choose from at this time!</div>';
|
||||||
} else {
|
} else {
|
||||||
echo $update->renderTable($versionHeader, $tableRows);
|
echo $update->renderTable($versionHeader, $tableRows);
|
||||||
}
|
}
|
||||||
} elseif ($currentStep == 4) {
|
} elseif ($currentStep == 4) {
|
||||||
echo $update->renderTable($header, $tableRows);
|
echo $update->renderTable($header, $tableRows);
|
||||||
echo '<div class="text-blue-500 pt-10">';
|
echo '<div class="text-blue-500 pt-10">';
|
||||||
echo sprintf('这一步会把 <code>%s</code> 的数据合并到 <code>%s</code>, 然后插入数据库中。', $tableRows[1]['label'], $tableRows[0]['label']);
|
echo sprintf('This step will merge <code>%s</code> to <code>%s</code>, then insert into database.', $tableRows[1]['label'], $tableRows[0]['label']);
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
} elseif ($currentStep > $maxStep) {
|
} elseif ($currentStep > $maxStep) {
|
||||||
echo '<div class="text-green-900 text-6xl p-10">恭喜,一切就绪!</div>';
|
echo '<div class="text-green-900 text-6xl p-10">Congratulations, everything is ready!</div>';
|
||||||
echo '<div class="mb-6">有问题可查阅升级日志:<code>' . $update->getLogFile() . '</code></div>';
|
echo '<div class="mb-6">For questions, consult the upgrade log at: <code>' . $update->getLogFile() . '</code></div>';
|
||||||
echo '<div class="text-red-500">为安全起见,请删除以下目录</div>';
|
echo '<div class="text-red-500">For security reasons, please delete the following directories</div>';
|
||||||
echo '<div class="text-red-500"><code>' . $update->getUpdateDirectory() . '</code></div>';
|
echo '<div class="text-red-500"><code>' . $update->getUpdateDirectory() . '</code></div>';
|
||||||
}
|
}
|
||||||
echo'</div>';
|
echo'</div>';
|
||||||
@@ -232,18 +226,18 @@ if (!empty($error)) {
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<div class="mt-10 text-center">
|
<div class="mt-10 text-center">
|
||||||
<button class="bg-blue-500 p-2 m-4 text-white rounded" type="button" onclick="goBack()">上一步</button>
|
<button class="bg-blue-500 p-2 m-4 text-white rounded" type="button" onclick="goBack()">Prev</button>
|
||||||
<?php if ($currentStep <= $maxStep) {?>
|
<?php if ($currentStep <= $maxStep) {?>
|
||||||
<button class="bg-blue-<?php echo $pass ? 500 : 200;?> p-2 m-4 text-white rounded" type="submit" <?php echo $pass ? '' : 'disabled';?>>下一步</button>
|
<button class="bg-blue-<?php echo $pass ? 500 : 200;?> p-2 m-4 text-white rounded" type="submit" <?php echo $pass ? '' : 'disabled';?>>Next</button>
|
||||||
<?php } else {?>
|
<?php } else {?>
|
||||||
<a class="bg-blue-500 p-2 m-4 text-white rounded" href="<?php echo getSchemeAndHttpHost()?>">回首页</a>
|
<a class="bg-blue-500 p-2 m-4 text-white rounded" href="<?php echo getSchemeAndHttpHost()?>">Go to homepage</a>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="m-10 text-center">
|
<div class="m-10 text-center">
|
||||||
欢迎使用 NexusPHP 升级程序,如有疑问,点击<a href="https://nexusphp.org/" target="_blank" class="text-blue-500 p-1">这里</a>获取帮助。
|
Welcome to the NexusPHP updater, if you have any questions, click<a href="https://nexusphp.org/" target="_blank" class="text-blue-500 p-1">here</a>for help.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ if (!$row) die();
|
|||||||
*/
|
*/
|
||||||
$customField = new \Nexus\Field\Field();
|
$customField = new \Nexus\Field\Field();
|
||||||
|
|
||||||
|
$tagIdArr = \App\Models\TorrentTag::query()->where('torrent_id', $id)->get()->pluck('tag_id')->toArray();
|
||||||
|
|
||||||
if ($enablespecial == 'yes' && get_user_class() >= $movetorrent_class)
|
if ($enablespecial == 'yes' && get_user_class() >= $movetorrent_class)
|
||||||
$allowmove = true; //enable moving torrent to other section
|
$allowmove = true; //enable moving torrent to other section
|
||||||
else $allowmove = false;
|
else $allowmove = false;
|
||||||
@@ -145,7 +147,8 @@ else {
|
|||||||
|
|
||||||
tr($lang_edit['row_content'],$team_select,1);
|
tr($lang_edit['row_content'],$team_select,1);
|
||||||
}
|
}
|
||||||
tr($lang_functions['text_tags'], torrentTags($row['tags'], 'checkbox'), 1);
|
// tr($lang_functions['text_tags'], torrentTags($row['tags'], 'checkbox'), 1);
|
||||||
|
tr($lang_functions['text_tags'], (new \App\Repositories\TagRepository())->renderCheckbox($tagIdArr), 1);
|
||||||
tr($lang_edit['row_check'], "<input type=\"checkbox\" name=\"visible\"" . ($row["visible"] == "yes" ? " checked=\"checked\"" : "" ) . " value=\"1\" /> ".$lang_edit['checkbox_visible']." ".(get_user_class() >= $beanonymous_class || get_user_class() >= $torrentmanage_class ? "<input type=\"checkbox\" name=\"anonymous\"" . ($row["anonymous"] == "yes" ? " checked=\"checked\"" : "" ) . " value=\"1\" />".$lang_edit['checkbox_anonymous_note']." " : "").(get_user_class() >= $torrentmanage_class ? "<input type=\"checkbox\" name=\"banned\"" . (($row["banned"] == "yes") ? " checked=\"checked\"" : "" ) . " value=\"yes\" /> ".$lang_edit['checkbox_banned'] : ""), 1);
|
tr($lang_edit['row_check'], "<input type=\"checkbox\" name=\"visible\"" . ($row["visible"] == "yes" ? " checked=\"checked\"" : "" ) . " value=\"1\" /> ".$lang_edit['checkbox_visible']." ".(get_user_class() >= $beanonymous_class || get_user_class() >= $torrentmanage_class ? "<input type=\"checkbox\" name=\"anonymous\"" . ($row["anonymous"] == "yes" ? " checked=\"checked\"" : "" ) . " value=\"1\" />".$lang_edit['checkbox_anonymous_note']." " : "").(get_user_class() >= $torrentmanage_class ? "<input type=\"checkbox\" name=\"banned\"" . (($row["banned"] == "yes") ? " checked=\"checked\"" : "" ) . " value=\"yes\" /> ".$lang_edit['checkbox_banned'] : ""), 1);
|
||||||
if (get_user_class()>= $torrentsticky_class || (get_user_class() >= $torrentmanage_class && $CURUSER["picker"] == 'yes')){
|
if (get_user_class()>= $torrentsticky_class || (get_user_class() >= $torrentmanage_class && $CURUSER["picker"] == 'yes')){
|
||||||
$pickcontent = $pickcontentPrefix = "";
|
$pickcontent = $pickcontentPrefix = "";
|
||||||
|
|||||||
@@ -196,27 +196,39 @@ if(get_user_class()>=$torrentmanage_class && $CURUSER['picker'] == 'yes')
|
|||||||
|
|
||||||
|
|
||||||
sql_query("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $id") or sqlerr(__FILE__, __LINE__);
|
sql_query("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $id") or sqlerr(__FILE__, __LINE__);
|
||||||
|
|
||||||
|
$dateTimeStringNow = date("Y-m-d H:i:s");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* add custom fields
|
* add custom fields
|
||||||
* @since v1.6
|
* @since v1.6
|
||||||
*/
|
*/
|
||||||
if (!empty($_POST['custom_fields'])) {
|
if (!empty($_POST['custom_fields'])) {
|
||||||
\Nexus\Database\NexusDB::delete('torrents_custom_field_values', "torrent_id = $id");
|
\Nexus\Database\NexusDB::delete('torrents_custom_field_values', "torrent_id = $id");
|
||||||
$now = date('Y-m-d H:i:s');
|
|
||||||
foreach ($_POST['custom_fields'] as $customField => $customValue) {
|
foreach ($_POST['custom_fields'] as $customField => $customValue) {
|
||||||
foreach ((array)$customValue as $value) {
|
foreach ((array)$customValue as $value) {
|
||||||
$customData = [
|
$customData = [
|
||||||
'torrent_id' => $id,
|
'torrent_id' => $id,
|
||||||
'custom_field_id' => $customField,
|
'custom_field_id' => $customField,
|
||||||
'custom_field_value' => $value,
|
'custom_field_value' => $value,
|
||||||
'created_at' => $now,
|
'created_at' => $dateTimeStringNow,
|
||||||
'updated_at' => $now,
|
'updated_at' => $dateTimeStringNow,
|
||||||
];
|
];
|
||||||
\Nexus\Database\NexusDB::insert('torrents_custom_field_values', $customData);
|
\Nexus\Database\NexusDB::insert('torrents_custom_field_values', $customData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* handle tags
|
||||||
|
*
|
||||||
|
* @since v1.6
|
||||||
|
*/
|
||||||
|
$tagIdArr = array_filter($_POST['tags']);
|
||||||
|
if (!empty($tagIdArr)) {
|
||||||
|
insert_torrent_tags($id, $tagIdArr, true);
|
||||||
|
}
|
||||||
|
|
||||||
if($CURUSER["id"] == $row["owner"])
|
if($CURUSER["id"] == $row["owner"])
|
||||||
{
|
{
|
||||||
if ($row["anonymous"]=='yes')
|
if ($row["anonymous"]=='yes')
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ foreach ($promotionrules_torrent as $rule)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$dateTimeStringNow = \Carbon\Carbon::now()->toDateTimeString();
|
||||||
/**
|
/**
|
||||||
* add PT-Gen
|
* add PT-Gen
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
@@ -336,6 +336,16 @@ if (!empty($_POST['custom_fields'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* handle tags
|
||||||
|
*
|
||||||
|
* @since v1.6
|
||||||
|
*/
|
||||||
|
$tagIdArr = array_filter($_POST['tags']);
|
||||||
|
if (!empty($tagIdArr)) {
|
||||||
|
insert_torrent_tags($id, $tagIdArr);
|
||||||
|
}
|
||||||
|
|
||||||
@sql_query("DELETE FROM files WHERE torrent = $id");
|
@sql_query("DELETE FROM files WHERE torrent = $id");
|
||||||
foreach ($filelist as $file) {
|
foreach ($filelist as $file) {
|
||||||
@sql_query("INSERT INTO files (torrent, filename, size) VALUES ($id, ".sqlesc($file[0]).",".$file[1].")");
|
@sql_query("INSERT INTO files (torrent, filename, size) VALUES ($id, ".sqlesc($file[0]).",".$file[1].")");
|
||||||
|
|||||||
@@ -6,6 +6,13 @@ require_once(get_langfile_path('speical.php'));
|
|||||||
loggedinorreturn();
|
loggedinorreturn();
|
||||||
parked();
|
parked();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* tags
|
||||||
|
*/
|
||||||
|
$tagRep = new \App\Repositories\TagRepository();
|
||||||
|
$tagKeyById = $tagRep->createBasicQuery()->get()->keyBy('id');
|
||||||
|
$renderKeyArr = $tagKeyById->keys()->toArray();
|
||||||
|
|
||||||
//check searchbox
|
//check searchbox
|
||||||
switch (CURRENT_SCRIPT) {
|
switch (CURRENT_SCRIPT) {
|
||||||
case 'torrents':
|
case 'torrents':
|
||||||
@@ -819,20 +826,24 @@ if ($whereaudiocodecin)
|
|||||||
$where .= ($where ? " AND " : "") . "audiocodec IN(" . $whereaudiocodecin . ")";
|
$where .= ($where ? " AND " : "") . "audiocodec IN(" . $whereaudiocodecin . ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tagFilter = "";
|
||||||
|
$tagId = intval($_REQUEST['tag_id'] ?? 0);
|
||||||
|
if ($tagId > 0) {
|
||||||
|
$tagFilter = " inner join torrent_tags on torrents.id = torrent_tags.torrent_id and torrent_tags.tag_id = $tagId ";
|
||||||
|
}
|
||||||
if ($allsec == 1 || $enablespecial != 'yes')
|
if ($allsec == 1 || $enablespecial != 'yes')
|
||||||
{
|
{
|
||||||
if ($where != "")
|
if ($where != "")
|
||||||
$where = "WHERE $where ";
|
$where = "WHERE $where ";
|
||||||
else $where = "";
|
else $where = "";
|
||||||
$sql = "SELECT COUNT(*) FROM torrents " . ($search_area == 3 || $column == "owner" ? "LEFT JOIN users ON torrents.owner = users.id " : "") . $where;
|
$sql = "SELECT COUNT(*) FROM torrents " . ($search_area == 3 || $column == "owner" ? "LEFT JOIN users ON torrents.owner = users.id " : "") . $tagFilter . $where;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($where != "")
|
if ($where != "")
|
||||||
$where = "WHERE $where AND categories.mode = '$sectiontype'";
|
$where = "WHERE $where AND categories.mode = '$sectiontype'";
|
||||||
else $where = "WHERE categories.mode = '$sectiontype'";
|
else $where = "WHERE categories.mode = '$sectiontype'";
|
||||||
$sql = "SELECT COUNT(*), categories.mode FROM torrents LEFT JOIN categories ON category = categories.id " . ($search_area == 3 || $column == "owner" ? "LEFT JOIN users ON torrents.owner = users.id " : "") . $where." GROUP BY categories.mode";
|
$sql = "SELECT COUNT(*), categories.mode FROM torrents LEFT JOIN categories ON category = categories.id " . ($search_area == 3 || $column == "owner" ? "LEFT JOIN users ON torrents.owner = users.id " : "") . $tagFilter . $where . " GROUP BY categories.mode";
|
||||||
}
|
}
|
||||||
|
|
||||||
$res = sql_query($sql);
|
$res = sql_query($sql);
|
||||||
@@ -872,10 +883,10 @@ if ($count)
|
|||||||
|
|
||||||
list($pagertop, $pagerbottom, $limit) = pager($torrentsperpage, $count, "?" . $addparam);
|
list($pagertop, $pagerbottom, $limit) = pager($torrentsperpage, $count, "?" . $addparam);
|
||||||
if ($allsec == 1 || $enablespecial != 'yes'){
|
if ($allsec == 1 || $enablespecial != 'yes'){
|
||||||
$query = "SELECT torrents.id, torrents.sp_state, torrents.promotion_time_type, torrents.promotion_until, torrents.banned, torrents.picktype, torrents.pos_state, torrents.category, torrents.source, torrents.medium, torrents.codec, torrents.standard, torrents.processing, torrents.team, torrents.audiocodec, torrents.leechers, torrents.seeders, torrents.name, torrents.small_descr, torrents.times_completed, torrents.size, torrents.added, torrents.comments,torrents.anonymous,torrents.owner,torrents.url,torrents.cache_stamp,torrents.pt_gen,torrents.tags,torrents.hr FROM torrents ".($search_area == 3 || $column == "owner" ? "LEFT JOIN users ON torrents.owner = users.id " : "")." $where $orderby $limit";
|
$query = "SELECT torrents.id, torrents.sp_state, torrents.promotion_time_type, torrents.promotion_until, torrents.banned, torrents.picktype, torrents.pos_state, torrents.category, torrents.source, torrents.medium, torrents.codec, torrents.standard, torrents.processing, torrents.team, torrents.audiocodec, torrents.leechers, torrents.seeders, torrents.name, torrents.small_descr, torrents.times_completed, torrents.size, torrents.added, torrents.comments,torrents.anonymous,torrents.owner,torrents.url,torrents.cache_stamp,torrents.pt_gen,torrents.tags,torrents.hr FROM torrents ".($search_area == 3 || $column == "owner" ? "LEFT JOIN users ON torrents.owner = users.id " : "")." $tagFilter $where $orderby $limit";
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$query = "SELECT torrents.id, torrents.sp_state, torrents.promotion_time_type, torrents.promotion_until, torrents.banned, torrents.picktype, torrents.pos_state, torrents.category, torrents.source, torrents.medium, torrents.codec, torrents.standard, torrents.processing, torrents.team, torrents.audiocodec, torrents.leechers, torrents.seeders, torrents.name, torrents.small_descr, torrents.times_completed, torrents.size, torrents.added, torrents.comments,torrents.anonymous,torrents.owner,torrents.url,torrents.cache_stamp,torrents.pt_gen,torrents.tags,torrents.hr FROM torrents ".($search_area == 3 || $column == "owner" ? "LEFT JOIN users ON torrents.owner = users.id " : "")." LEFT JOIN categories ON torrents.category=categories.id $where $orderby $limit";
|
$query = "SELECT torrents.id, torrents.sp_state, torrents.promotion_time_type, torrents.promotion_until, torrents.banned, torrents.picktype, torrents.pos_state, torrents.category, torrents.source, torrents.medium, torrents.codec, torrents.standard, torrents.processing, torrents.team, torrents.audiocodec, torrents.leechers, torrents.seeders, torrents.name, torrents.small_descr, torrents.times_completed, torrents.size, torrents.added, torrents.comments,torrents.anonymous,torrents.owner,torrents.url,torrents.cache_stamp,torrents.pt_gen,torrents.tags,torrents.hr FROM torrents ".($search_area == 3 || $column == "owner" ? "LEFT JOIN users ON torrents.owner = users.id " : "")." LEFT JOIN categories ON torrents.category=categories.id $tagFilter $where $orderby $limit";
|
||||||
}
|
}
|
||||||
|
|
||||||
$res = sql_query($query);
|
$res = sql_query($query);
|
||||||
@@ -1073,7 +1084,13 @@ if (!$Cache->get_page()){
|
|||||||
$Cache->cache_page();
|
$Cache->cache_page();
|
||||||
}
|
}
|
||||||
echo $Cache->next_row();
|
echo $Cache->next_row();
|
||||||
|
|
||||||
|
if ($tagKeyById->isNotEmpty()) {
|
||||||
|
echo '<tr><td rowspan="3" class="embedded" style="padding-top: 4px">' . $tagRep->renderSpan($tagKeyById, $renderKeyArr, true) . '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
<td class="rowfollow" align="center">
|
<td class="rowfollow" align="center">
|
||||||
|
|||||||
@@ -156,7 +156,8 @@ stdhead($lang_upload['head_upload']);
|
|||||||
{
|
{
|
||||||
tr($lang_upload['row_show_uploader'], "<input type=\"checkbox\" name=\"uplver\" value=\"yes\" />".$lang_upload['checkbox_hide_uploader_note'], 1);
|
tr($lang_upload['row_show_uploader'], "<input type=\"checkbox\" name=\"uplver\" value=\"yes\" />".$lang_upload['checkbox_hide_uploader_note'], 1);
|
||||||
}
|
}
|
||||||
tr($lang_functions['text_tags'], torrentTags(0, 'checkbox'), 1);
|
// tr($lang_functions['text_tags'], torrentTags(0, 'checkbox'), 1);
|
||||||
|
tr($lang_functions['text_tags'], (new \App\Repositories\TagRepository())->renderCheckbox(), 1);
|
||||||
?>
|
?>
|
||||||
<tr><td class="toolbox" align="center" colspan="2"><b><?php echo $lang_upload['text_read_rules']?></b> <input id="qr" type="submit" class="btn" value="<?php echo $lang_upload['submit_upload']?>" /></td></tr>
|
<tr><td class="toolbox" align="center" colspan="2"><b><?php echo $lang_upload['text_read_rules']?></b> <input id="qr" type="submit" class="btn" value="<?php echo $lang_upload['submit_upload']?>" /></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ Route::group(['middleware' => ['auth:sanctum', 'locale']], function () {
|
|||||||
Route::resource('settings', \App\Http\Controllers\SettingController::class);
|
Route::resource('settings', \App\Http\Controllers\SettingController::class);
|
||||||
Route::resource('medals', \App\Http\Controllers\MedalController::class);
|
Route::resource('medals', \App\Http\Controllers\MedalController::class);
|
||||||
Route::resource('user-medals', \App\Http\Controllers\UserMedalController::class);
|
Route::resource('user-medals', \App\Http\Controllers\UserMedalController::class);
|
||||||
|
Route::resource('tags', \App\Http\Controllers\TagController::class);
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user