mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-22 02:47:27 +08:00
admin setting backup + backupCronjob
This commit is contained in:
-1
@@ -1 +0,0 @@
|
||||
.el-card[data-v-62e62229]{margin-bottom:20px}.table-base-info[data-v-62e62229]{width:100%;text-align:left}.table-base-info tr th[data-v-62e62229]{padding-bottom:10px}.table-base-info tr td[data-v-62e62229]{padding:10px 0}
|
||||
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
.el-card[data-v-05f1091e]{margin-bottom:20px}.table-base-info[data-v-05f1091e]{width:100%;text-align:left}.table-base-info tr th[data-v-05f1091e]{padding-bottom:10px}.table-base-info tr td[data-v-05f1091e]{padding:10px 0}
|
||||
@@ -1 +1 @@
|
||||
var e=Object.defineProperty,a=Object.prototype.hasOwnProperty,r=Object.getOwnPropertySymbols,l=Object.prototype.propertyIsEnumerable,o=(a,r,l)=>r in a?e(a,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):a[r]=l,t=(e,t)=>{for(var s in t||(t={}))a.call(t,s)&&o(e,s,t[s]);if(r)for(var s of r(t))l.call(t,s)&&o(e,s,t[s]);return e};import{r as s,a as d,i as m,m as u,t as n,n as p,q as i,u as f,b as c,p as w,d as b,e as y,o as _,c as D,f as V,g as v,h}from"./index.d2823cf5.js";const x={name:"UserForm",setup(){const{proxy:e}=p();console.log("proxy",e);const a=s(null),r=i(),l=f(),{id:o}=r.query,w=d({id:o,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}]}});m((()=>{})),u((()=>{}));return t(t({},n(w)),{formRef:a,submitAdd:()=>{a.value.validate((async e=>{if(e){let e=w.formData;await c.storeUser(e),await l.push({name:"user"})}}))}})}},U=v();w("data-v-21744c02");const q=h("Submit");b();const O=U(((e,a,r,l,o,t)=>{const s=y("el-input"),d=y("el-form-item"),m=y("el-button"),u=y("el-form"),n=y("el-col"),p=y("el-row");return _(),D("div",null,[V(p,null,{default:U((()=>[V(n,{span:12},{default:U((()=>[V(u,{model:e.formData,rules:e.rules,ref:"formRef","label-width":"200px",class:"formData"},{default:U((()=>[V(d,{label:"Username",prop:"username"},{default:U((()=>[V(s,{modelValue:e.formData.username,"onUpdate:modelValue":a[1]||(a[1]=a=>e.formData.username=a),placeholder:""},null,8,["modelValue"])])),_:1}),V(d,{label:"Email",prop:"email"},{default:U((()=>[V(s,{modelValue:e.formData.email,"onUpdate:modelValue":a[2]||(a[2]=a=>e.formData.email=a),placeholder:""},null,8,["modelValue"])])),_:1}),V(d,{label:"Password",prop:"password"},{default:U((()=>[V(s,{type:"password",modelValue:e.formData.password,"onUpdate:modelValue":a[3]||(a[3]=a=>e.formData.password=a),placeholder:""},null,8,["modelValue"])])),_:1}),V(d,{label:"Password Confirmation",prop:"password_confirmation"},{default:U((()=>[V(s,{type:"password",modelValue:e.formData.password_confirmation,"onUpdate:modelValue":a[4]||(a[4]=a=>e.formData.password_confirmation=a),placeholder:""},null,8,["modelValue"])])),_:1}),V(d,null,{default:U((()=>[V(m,{type:"primary",onClick:a[5]||(a[5]=e=>l.submitAdd())},{default:U((()=>[q])),_:1})])),_:1})])),_:1},8,["model","rules"])])),_:1})])),_:1})])}));x.render=O,x.__scopeId="data-v-21744c02";export default x;
|
||||
var e=Object.defineProperty,a=Object.prototype.hasOwnProperty,r=Object.getOwnPropertySymbols,l=Object.prototype.propertyIsEnumerable,o=(a,r,l)=>r in a?e(a,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):a[r]=l,t=(e,t)=>{for(var s in t||(t={}))a.call(t,s)&&o(e,s,t[s]);if(r)for(var s of r(t))l.call(t,s)&&o(e,s,t[s]);return e};import{r as s,a as m,i as d,m as u,t as n,n as p,q as i,u as f,b as c,p as w,d as b,e as y,o as _,c as D,f as V,g as v,h}from"./index.74b68f27.js";const x={name:"UserForm",setup(){const{proxy:e}=p();console.log("proxy",e);const a=s(null),r=i(),l=f(),{id:o}=r.query,w=m({id:o,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}]}});d((()=>{})),u((()=>{}));return t(t({},n(w)),{formRef:a,submitAdd:()=>{a.value.validate((async e=>{if(e){let e=w.formData;await c.storeUser(e),await l.push({name:"user"})}}))}})}},U=v();w("data-v-21744c02");const q=h("Submit");b();const O=U(((e,a,r,l,o,t)=>{const s=y("el-input"),m=y("el-form-item"),d=y("el-button"),u=y("el-form"),n=y("el-col"),p=y("el-row");return _(),D("div",null,[V(p,null,{default:U((()=>[V(n,{span:12},{default:U((()=>[V(u,{model:e.formData,rules:e.rules,ref:"formRef","label-width":"200px",class:"formData"},{default:U((()=>[V(m,{label:"Username",prop:"username"},{default:U((()=>[V(s,{modelValue:e.formData.username,"onUpdate:modelValue":a[1]||(a[1]=a=>e.formData.username=a),placeholder:""},null,8,["modelValue"])])),_:1}),V(m,{label:"Email",prop:"email"},{default:U((()=>[V(s,{modelValue:e.formData.email,"onUpdate:modelValue":a[2]||(a[2]=a=>e.formData.email=a),placeholder:""},null,8,["modelValue"])])),_:1}),V(m,{label:"Password",prop:"password"},{default:U((()=>[V(s,{type:"password",modelValue:e.formData.password,"onUpdate:modelValue":a[3]||(a[3]=a=>e.formData.password=a),placeholder:""},null,8,["modelValue"])])),_:1}),V(m,{label:"Password Confirmation",prop:"password_confirmation"},{default:U((()=>[V(s,{type:"password",modelValue:e.formData.password_confirmation,"onUpdate:modelValue":a[4]||(a[4]=a=>e.formData.password_confirmation=a),placeholder:""},null,8,["modelValue"])])),_:1}),V(m,null,{default:U((()=>[V(d,{type:"primary",onClick:a[5]||(a[5]=e=>l.submitAdd())},{default:U((()=>[q])),_:1})])),_:1})])),_:1},8,["model","rules"])])),_:1})])),_:1})])}));x.render=O,x.__scopeId="data-v-21744c02";export default x;
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{o as n,c as o}from"./index.d2823cf5.js";const r={};r.render=function(r,e){return n(),o("div",null,"Agent Allow Form")};export default r;
|
||||
import{o as n,c as o}from"./index.74b68f27.js";const r={};r.render=function(r,e){return n(),o("div",null,"Agent Allow Form")};export default r;
|
||||
@@ -1 +1 @@
|
||||
import{o as n,c as e}from"./index.d2823cf5.js";const o={};o.render=function(o,r){return n(),e("div",null,"Agent Allow Index")};export default o;
|
||||
import{o as n,c as e}from"./index.74b68f27.js";const o={};o.render=function(o,r){return n(),e("div",null,"Agent Allow Index")};export default o;
|
||||
Vendored
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
-1
@@ -1 +0,0 @@
|
||||
import{o as r,c as n}from"./index.d2823cf5.js";const o={};o.render=function(o,d){return r(),n("div",null,"Dashboard")};export default o;
|
||||
@@ -1 +1 @@
|
||||
var e=Object.defineProperty,a=Object.prototype.hasOwnProperty,t=Object.getOwnPropertySymbols,l=Object.prototype.propertyIsEnumerable,n=(a,t,l)=>t in a?e(a,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):a[t]=l,r=(e,r)=>{for(var o in r||(r={}))a.call(r,o)&&n(e,o,r[o]);if(t)for(var o of t(r))l.call(r,o)&&n(e,o,r[o]);return e};import{r as o,i,b as s,t as d,u as p,v as c,p as u,d as g,e as h,j as f,o as b,c as m,f as y,k as w,g as x,h as C}from"./index.d2823cf5.js";import{u as _,r as v}from"./table.a9889f1f.js";const T={name:"ExamTable",setup(){const e=o(null),a=p(),t=_();i((()=>{console.log("ExamTable onMounted"),l()}));const l=async()=>{t.loading=!0;let e=await s.listExam(t.query);v(e,t),t.loading=!1};return r(r({},d(t)),{multipleTable:e,handleSelectionChange:e=>{t.multipleSelection=e},handleAdd:()=>{a.push({name:"exam-form"})},handleEdit:e=>{a.push({path:"/exam-form",query:{id:e}})},handleDelete:async e=>{let a=await s.deleteExam(e);c.success(a.msg),t.query.page=1,await l()},fetchTableData:l,changePage:e=>{t.query.page=e,l()}})}},E=x();u("data-v-3c87518a");const D={class:"nexus-table-header"},j=y("div",{class:"left"},null,-1),k={class:"right"},P=C("Add"),S=y("a",{style:{cursor:"pointer"}},"Delete",-1);g();const O=E(((e,a,t,l,n,r)=>{const o=h("el-button"),i=h("el-table-column"),s=h("el-popconfirm"),d=h("el-table"),p=h("el-pagination"),c=h("el-card"),u=f("loading");return b(),m(c,{class:""},{header:E((()=>[y("div",D,[j,y("div",k,[y(o,{type:"primary",size:"small",icon:"el-icon-plus",onClick:l.handleAdd},{default:E((()=>[P])),_:1},8,["onClick"])])])])),default:E((()=>[w(y(d,{ref:"multipleTable",data:e.tableData,"tooltip-effect":"dark",onSelectionChange:l.handleSelectionChange},{default:E((()=>[y(i,{type:"selection",width:"55"}),y(i,{prop:"id",label:"Id",width:"50"}),y(i,{prop:"name",label:"Name"}),y(i,{label:"Indexes",width:"250px"},{default:E((e=>[y("p",{style:{"white-space":"pre-line"},innerHTML:e.row.indexes_formatted},null,8,["innerHTML"])])),_:1}),y(i,{prop:"begin",label:"Begin",width:"160"}),y(i,{prop:"end",label:"End",width:"160"}),y(i,{prop:"duration_text",label:"Duration"}),y(i,{label:"Target users",width:"350px"},{default:E((e=>[y("p",{style:{"white-space":"pre-line"},innerHTML:e.row.filters_formatted},null,8,["innerHTML"])])),_:1}),y(i,{prop:"is_discovered_text",label:"Discovered"}),y(i,{prop:"status_text",label:"Status"}),y(i,{label:"Action",width:"100"},{default:E((e=>[y("a",{style:{cursor:"pointer","margin-right":"10px"},onClick:a=>l.handleEdit(e.row.id)},"Edit",8,["onClick"]),y(s,{title:"Confirm Delete ?",onConfirm:a=>l.handleDelete(e.row.id)},{reference:E((()=>[S])),_:2},1032,["onConfirm"])])),_:1})])),_:1},8,["data","onSelectionChange"]),[[u,e.loading]]),y(p,{background:"",layout:"prev, pager, next",total:e.total,"page-size":e.perPage,"current-page":e.currentPage,onCurrentChange:l.changePage},null,8,["total","page-size","current-page","onCurrentChange"])])),_:1})}));T.render=O,T.__scopeId="data-v-3c87518a";export default T;
|
||||
var e=Object.defineProperty,a=Object.prototype.hasOwnProperty,t=Object.getOwnPropertySymbols,l=Object.prototype.propertyIsEnumerable,n=(a,t,l)=>t in a?e(a,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):a[t]=l,r=(e,r)=>{for(var o in r||(r={}))a.call(r,o)&&n(e,o,r[o]);if(t)for(var o of t(r))l.call(r,o)&&n(e,o,r[o]);return e};import{r as o,i,b as s,t as d,u as p,v as c,p as u,d as g,e as h,j as b,o as f,c as m,f as y,k as w,g as x,h as C}from"./index.74b68f27.js";import{u as _,r as v}from"./table.9f49d458.js";const T={name:"ExamTable",setup(){const e=o(null),a=p(),t=_();i((()=>{console.log("ExamTable onMounted"),l()}));const l=async()=>{t.loading=!0;let e=await s.listExam(t.query);v(e,t),t.loading=!1};return r(r({},d(t)),{multipleTable:e,handleSelectionChange:e=>{t.multipleSelection=e},handleAdd:()=>{a.push({name:"exam-form"})},handleEdit:e=>{a.push({path:"/exam-form",query:{id:e}})},handleDelete:async e=>{let a=await s.deleteExam(e);c.success(a.msg),t.query.page=1,await l()},fetchTableData:l,changePage:e=>{t.query.page=e,l()}})}},E=x();u("data-v-3c87518a");const D={class:"nexus-table-header"},j=y("div",{class:"left"},null,-1),k={class:"right"},P=C("Add"),S=y("a",{style:{cursor:"pointer"}},"Delete",-1);g();const O=E(((e,a,t,l,n,r)=>{const o=h("el-button"),i=h("el-table-column"),s=h("el-popconfirm"),d=h("el-table"),p=h("el-pagination"),c=h("el-card"),u=b("loading");return f(),m(c,{class:""},{header:E((()=>[y("div",D,[j,y("div",k,[y(o,{type:"primary",size:"small",icon:"el-icon-plus",onClick:l.handleAdd},{default:E((()=>[P])),_:1},8,["onClick"])])])])),default:E((()=>[w(y(d,{ref:"multipleTable",data:e.tableData,"tooltip-effect":"dark",onSelectionChange:l.handleSelectionChange},{default:E((()=>[y(i,{type:"selection",width:"55"}),y(i,{prop:"id",label:"Id",width:"50"}),y(i,{prop:"name",label:"Name"}),y(i,{label:"Indexes",width:"250px"},{default:E((e=>[y("p",{style:{"white-space":"pre-line"},innerHTML:e.row.indexes_formatted},null,8,["innerHTML"])])),_:1}),y(i,{prop:"begin",label:"Begin",width:"160"}),y(i,{prop:"end",label:"End",width:"160"}),y(i,{prop:"duration_text",label:"Duration"}),y(i,{label:"Target users",width:"350px"},{default:E((e=>[y("p",{style:{"white-space":"pre-line"},innerHTML:e.row.filters_formatted},null,8,["innerHTML"])])),_:1}),y(i,{prop:"is_discovered_text",label:"Discovered"}),y(i,{prop:"status_text",label:"Status"}),y(i,{label:"Action",width:"100"},{default:E((e=>[y("a",{style:{cursor:"pointer","margin-right":"10px"},onClick:a=>l.handleEdit(e.row.id)},"Edit",8,["onClick"]),y(s,{title:"Confirm Delete ?",onConfirm:a=>l.handleDelete(e.row.id)},{reference:E((()=>[S])),_:2},1032,["onConfirm"])])),_:1})])),_:1},8,["data","onSelectionChange"]),[[u,e.loading]]),y(p,{background:"",layout:"prev, pager, next",total:e.total,"page-size":e.perPage,"current-page":e.currentPage,onCurrentChange:l.changePage},null,8,["total","page-size","current-page","onCurrentChange"])])),_:1})}));T.render=O,T.__scopeId="data-v-3c87518a";export default T;
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
import{o as r,c as n}from"./index.74b68f27.js";const o={};o.render=function(o,e){return r(),n("div",null,"Dashboard")};export default o;
|
||||
@@ -1 +1 @@
|
||||
var e=Object.defineProperty,a=Object.prototype.hasOwnProperty,l=Object.getOwnPropertySymbols,t=Object.prototype.propertyIsEnumerable,o=(a,l,t)=>l in a?e(a,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[l]=t,r=(e,r)=>{for(var n in r||(r={}))a.call(r,n)&&o(e,n,r[n]);if(l)for(var n of l(r))t.call(r,n)&&o(e,n,r[n]);return e};import{r as n,i as s,b as d,t as u,u as p,v as i,p as c,d as m,e as b,j as g,o as f,c as h,f as C,k as y,g as w,h as S}from"./index.d2823cf5.js";import{u as v,r as D,a as _}from"./table.a9889f1f.js";const x={name:"UserTable",setup(){const e=n(null),a=p(),l=v();s((()=>{console.log("UserTable onMounted"),t()}));const t=async()=>{l.loading=!0;let e=await d.listUser(l.query);D(e,l),l.loading=!1};return r(r({},u(l)),{multipleTable:e,handleSelectionChange:e=>{l.multipleSelection=e},handleAdd:()=>{a.push({name:"user-form"})},handleEdit:e=>{a.push({name:"user-form",query:{id:e}})},handleDelete:async e=>{let a=await d.deleteExam(e);i.success(a.msg),l.query.page=1,await t()},handleDetail:e=>{a.push({name:"user-detail",query:{id:e}})},fetchTableData:t,changePage:e=>{l.query.page=e,t()},handleSortChange:e=>{_(e,l),t()},formatColumnClass:(e,a)=>e.class_text,formatColumnUploaded:(e,a)=>e.uploaded_text,formatColumnDownloaded:(e,a)=>e.downloaded_text})}},j=w();c("data-v-ae65dbc0");const k={class:"header"},P=S("Add");m();const U=j(((e,a,l,t,o,r)=>{const n=b("el-button"),s=b("el-table-column"),d=b("el-table"),u=b("el-pagination"),p=b("el-card"),i=g("loading");return f(),h(p,null,{header:j((()=>[C("div",k,[C(n,{type:"primary",size:"small",icon:"el-icon-plus",onClick:t.handleAdd},{default:j((()=>[P])),_:1},8,["onClick"])])])),default:j((()=>[y(C(d,{ref:"multipleTable",data:e.tableData,"tooltip-effect":"dark",onSortChange:t.handleSortChange,onSelectionChange:t.handleSelectionChange},{default:j((()=>[C(s,{type:"selection",width:"55"}),C(s,{prop:"id",label:"Id",width:"60",sortable:"custom"}),C(s,{prop:"username",label:"Username",sortable:"custom"}),C(s,{prop:"email",label:"Email"}),C(s,{prop:"class",label:"Class",sortable:"custom",formatter:t.formatColumnClass},null,8,["formatter"]),C(s,{prop:"uploaded",label:"Uploaded",sortable:"custom",formatter:t.formatColumnUploaded},null,8,["formatter"]),C(s,{prop:"downloaded",label:"Downloaded",sortable:"custom",formatter:t.formatColumnDownloaded},null,8,["formatter"]),C(s,{prop:"bonus",label:"Bonus"}),C(s,{prop:"status",label:"Status"}),C(s,{prop:"added",label:"Added"}),C(s,{label:"Action",width:"100"},{default:j((e=>[C("a",{style:{cursor:"pointer","margin-right":"10px"},onClick:a=>t.handleDetail(e.row.id)},"Detail",8,["onClick"])])),_:1})])),_:1},8,["data","onSortChange","onSelectionChange"]),[[i,e.loading]]),C(u,{background:"",layout:"prev, pager, next",total:e.total,"page-size":e.perPage,"current-page":e.currentPage,onCurrentChange:t.changePage},null,8,["total","page-size","current-page","onCurrentChange"])])),_:1})}));x.render=U,x.__scopeId="data-v-ae65dbc0";export default x;
|
||||
var e=Object.defineProperty,a=Object.prototype.hasOwnProperty,l=Object.getOwnPropertySymbols,t=Object.prototype.propertyIsEnumerable,o=(a,l,t)=>l in a?e(a,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[l]=t,r=(e,r)=>{for(var n in r||(r={}))a.call(r,n)&&o(e,n,r[n]);if(l)for(var n of l(r))t.call(r,n)&&o(e,n,r[n]);return e};import{r as n,i as s,b as d,t as u,u as p,v as i,p as c,d as m,e as b,j as g,o as f,c as h,f as C,k as y,g as w,h as S}from"./index.74b68f27.js";import{u as v,r as D,a as _}from"./table.9f49d458.js";const x={name:"UserTable",setup(){const e=n(null),a=p(),l=v();s((()=>{console.log("UserTable onMounted"),t()}));const t=async()=>{l.loading=!0;let e=await d.listUser(l.query);D(e,l),l.loading=!1};return r(r({},u(l)),{multipleTable:e,handleSelectionChange:e=>{l.multipleSelection=e},handleAdd:()=>{a.push({name:"user-form"})},handleEdit:e=>{a.push({name:"user-form",query:{id:e}})},handleDelete:async e=>{let a=await d.deleteExam(e);i.success(a.msg),l.query.page=1,await t()},handleDetail:e=>{a.push({name:"user-detail",query:{id:e}})},fetchTableData:t,changePage:e=>{l.query.page=e,t()},handleSortChange:e=>{_(e,l),t()},formatColumnClass:(e,a)=>e.class_text,formatColumnUploaded:(e,a)=>e.uploaded_text,formatColumnDownloaded:(e,a)=>e.downloaded_text})}},j=w();c("data-v-ae65dbc0");const k={class:"header"},P=S("Add");m();const U=j(((e,a,l,t,o,r)=>{const n=b("el-button"),s=b("el-table-column"),d=b("el-table"),u=b("el-pagination"),p=b("el-card"),i=g("loading");return f(),h(p,null,{header:j((()=>[C("div",k,[C(n,{type:"primary",size:"small",icon:"el-icon-plus",onClick:t.handleAdd},{default:j((()=>[P])),_:1},8,["onClick"])])])),default:j((()=>[y(C(d,{ref:"multipleTable",data:e.tableData,"tooltip-effect":"dark",onSortChange:t.handleSortChange,onSelectionChange:t.handleSelectionChange},{default:j((()=>[C(s,{type:"selection",width:"55"}),C(s,{prop:"id",label:"Id",width:"60",sortable:"custom"}),C(s,{prop:"username",label:"Username",sortable:"custom"}),C(s,{prop:"email",label:"Email"}),C(s,{prop:"class",label:"Class",sortable:"custom",formatter:t.formatColumnClass},null,8,["formatter"]),C(s,{prop:"uploaded",label:"Uploaded",sortable:"custom",formatter:t.formatColumnUploaded},null,8,["formatter"]),C(s,{prop:"downloaded",label:"Downloaded",sortable:"custom",formatter:t.formatColumnDownloaded},null,8,["formatter"]),C(s,{prop:"bonus",label:"Bonus"}),C(s,{prop:"status",label:"Status"}),C(s,{prop:"added",label:"Added"}),C(s,{label:"Action",width:"100"},{default:j((e=>[C("a",{style:{cursor:"pointer","margin-right":"10px"},onClick:a=>t.handleDetail(e.row.id)},"Detail",8,["onClick"])])),_:1})])),_:1},8,["data","onSortChange","onSelectionChange"]),[[i,e.loading]]),C(u,{background:"",layout:"prev, pager, next",total:e.total,"page-size":e.perPage,"current-page":e.currentPage,onCurrentChange:t.changePage},null,8,["total","page-size","current-page","onCurrentChange"])])),_:1})}));x.render=U,x.__scopeId="data-v-ae65dbc0";export default x;
|
||||
@@ -1 +1 @@
|
||||
var e=Object.defineProperty,r=Object.prototype.hasOwnProperty,a=Object.getOwnPropertySymbols,o=Object.prototype.propertyIsEnumerable,s=(r,a,o)=>a in r?e(r,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[a]=o,l=(e,l)=>{for(var t in l||(l={}))r.call(l,t)&&s(e,t,l[t]);if(a)for(var t of a(l))o.call(l,t)&&s(e,t,l[t]);return e};import{r as t,a as n,t as i,u,b as d,l as A,p as m,d as c,e as p,o as f,c as b,f as h,w as y,g,h as U}from"./index.d2823cf5.js";const v={name:"Login",setup(){const e=t(null),r=u(),a=n({ruleForm:{username:"",password:""},checked:!0,rules:{username:[{required:"true"}],password:[{required:"true"}]}});return l(l({},i(a)),{loginForm:e,submitForm:async()=>{e.value.validate((e=>{if(!e)return console.log("error submit!!"),!1;d.login(a.ruleForm).then((e=>{console.log(e),A("token",e.data.token),A("userInfo",e.data),r.push({name:"dashboard"})}))}))},resetForm:()=>{e.value.resetFields()}})}},F=g();m("data-v-68d0c3e2");const j={class:"login-body"},w={class:"login-container"},C=h("div",{class:"head"},[h("img",{class:"logo",src:"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="}),h("div",{class:"name"},[h("div",{class:"title"},"NexusPHP"),h("div",{class:"tips"},"Management system")])],-1),J=U("Submit");c();const R=F(((e,r,a,o,s,l)=>{const t=p("el-input"),n=p("el-form-item"),i=p("el-button"),u=p("el-form");return f(),b("div",j,[h("div",w,[C,h(u,{"label-position":"top",rules:e.rules,model:e.ruleForm,ref:"loginForm",class:"login-form"},{default:F((()=>[h(n,{label:"Username",prop:"username"},{default:F((()=>[h(t,{type:"text",modelValue:e.ruleForm.username,"onUpdate:modelValue":r[1]||(r[1]=r=>e.ruleForm.username=r),modelModifiers:{trim:!0},autocomplete:"off",onKeyup:y(o.submitForm,["enter"])},null,8,["modelValue","onKeyup"])])),_:1}),h(n,{label:"Password",prop:"password"},{default:F((()=>[h(t,{type:"password",modelValue:e.ruleForm.password,"onUpdate:modelValue":r[2]||(r[2]=r=>e.ruleForm.password=r),modelModifiers:{trim:!0},autocomplete:"off",onKeyup:y(o.submitForm,["enter"])},null,8,["modelValue","onKeyup"])])),_:1}),h(n,{style:{"margin-top":"50px"}},{default:F((()=>[h(i,{style:{width:"100%"},type:"primary",onClick:o.submitForm},{default:F((()=>[J])),_:1},8,["onClick"])])),_:1})])),_:1},8,["rules","model"])])])}));v.render=R,v.__scopeId="data-v-68d0c3e2";export default v;
|
||||
var e=Object.defineProperty,r=Object.prototype.hasOwnProperty,a=Object.getOwnPropertySymbols,o=Object.prototype.propertyIsEnumerable,s=(r,a,o)=>a in r?e(r,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[a]=o,l=(e,l)=>{for(var t in l||(l={}))r.call(l,t)&&s(e,t,l[t]);if(a)for(var t of a(l))o.call(l,t)&&s(e,t,l[t]);return e};import{r as t,a as n,t as i,u,b as d,l as A,p as m,d as c,e as p,o as f,c as b,f as h,w as y,g,h as U}from"./index.74b68f27.js";const v={name:"Login",setup(){const e=t(null),r=u(),a=n({ruleForm:{username:"",password:""},checked:!0,rules:{username:[{required:"true"}],password:[{required:"true"}]}});return l(l({},i(a)),{loginForm:e,submitForm:async()=>{e.value.validate((e=>{if(!e)return console.log("error submit!!"),!1;d.login(a.ruleForm).then((e=>{console.log(e),A("token",e.data.token),A("userInfo",e.data),r.push({name:"dashboard"})}))}))},resetForm:()=>{e.value.resetFields()}})}},F=g();m("data-v-68d0c3e2");const j={class:"login-body"},w={class:"login-container"},C=h("div",{class:"head"},[h("img",{class:"logo",src:"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="}),h("div",{class:"name"},[h("div",{class:"title"},"NexusPHP"),h("div",{class:"tips"},"Management system")])],-1),J=U("Submit");c();const R=F(((e,r,a,o,s,l)=>{const t=p("el-input"),n=p("el-form-item"),i=p("el-button"),u=p("el-form");return f(),b("div",j,[h("div",w,[C,h(u,{"label-position":"top",rules:e.rules,model:e.ruleForm,ref:"loginForm",class:"login-form"},{default:F((()=>[h(n,{label:"Username",prop:"username"},{default:F((()=>[h(t,{type:"text",modelValue:e.ruleForm.username,"onUpdate:modelValue":r[1]||(r[1]=r=>e.ruleForm.username=r),modelModifiers:{trim:!0},autocomplete:"off",onKeyup:y(o.submitForm,["enter"])},null,8,["modelValue","onKeyup"])])),_:1}),h(n,{label:"Password",prop:"password"},{default:F((()=>[h(t,{type:"password",modelValue:e.ruleForm.password,"onUpdate:modelValue":r[2]||(r[2]=r=>e.ruleForm.password=r),modelModifiers:{trim:!0},autocomplete:"off",onKeyup:y(o.submitForm,["enter"])},null,8,["modelValue","onKeyup"])])),_:1}),h(n,{style:{"margin-top":"50px"}},{default:F((()=>[h(i,{style:{width:"100%"},type:"primary",onClick:o.submitForm},{default:F((()=>[J])),_:1},8,["onClick"])])),_:1})])),_:1},8,["rules","model"])])])}));v.render=R,v.__scopeId="data-v-68d0c3e2";export default v;
|
||||
@@ -1 +1 @@
|
||||
import{a}from"./index.d2823cf5.js";const e=()=>a({loading:!1,query:{page:1,sort_field:"id",sort_type:"desc"},tableData:[],multipleSelection:[],total:0,currentPage:1,perPage:10}),t=(a,e)=>{e.tableData=a.data.data,e.page=a.data.meta.current_page,e.total=a.data.meta.total,e.currentPage=a.data.meta.current_page,e.perPage=a.data.meta.per_page},r=(a,e)=>{console.log("resetTableSort",a),e.query.page=1,e.query.sort_field=a.prop,e.query.sort_type=a.order};export{r as a,t as r,e as u};
|
||||
import{a}from"./index.74b68f27.js";const e=()=>a({loading:!1,query:{page:1,sort_field:"id",sort_type:"desc"},tableData:[],multipleSelection:[],total:0,currentPage:1,perPage:10}),t=(a,e)=>{e.tableData=a.data.data,e.page=a.data.meta.current_page,e.total=a.data.meta.total,e.currentPage=a.data.meta.current_page,e.perPage=a.data.meta.per_page},r=(a,e)=>{console.log("resetTableSort",a),e.query.page=1,e.query.sort_field=a.prop,e.query.sort_type=a.order};export{r as a,t as r,e as u};
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
var e=Object.defineProperty,a=Object.prototype.hasOwnProperty,t=Object.getOwnPropertySymbols,l=Object.prototype.propertyIsEnumerable,r=(a,t,l)=>t in a?e(a,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):a[t]=l,n=(e,n)=>{for(var o in n||(n={}))a.call(n,o)&&r(e,o,n[o]);if(t)for(var o of t(n))l.call(n,o)&&r(e,o,n[o]);return e};import{r as o,i as s,b as d,t as i,u,v as c,p,d as m,e as g,j as f,o as h,c as b,k as C,f as y,g as x}from"./index.d2823cf5.js";import{u as w,r as v,a as S}from"./table.a9889f1f.js";const _={name:"ExamUserTable",setup(){const e=o(null),a=u(),t=w();s((()=>{l()}));const l=async()=>{t.loading=!0;let e=await d.listExamUser(t.query);v(e,t),t.loading=!1};return n(n({},i(t)),{multipleTable:e,handleSelectionChange:e=>{t.multipleSelection=e},handleAdd:()=>{a.push({name:"user-form"})},handleEdit:e=>{a.push({name:"user-form",query:{id:e}})},handleDelete:async e=>{let a=await d.deleteExam(e);c.success(a.msg),t.query.page=1,await l()},handleDetail:e=>{a.push({name:"user-detail",query:{id:e}})},fetchTableData:l,changePage:e=>{t.query.page=e,l()},handleSortChange:e=>{S(e,t),l()},formatColumnUser:(e,a)=>e.user.username,formatColumnExam:(e,a)=>e.exam.name,formatColumnDownloaded:(e,a)=>e.downloaded_text})}},E=x();p("data-v-50017f64");const j=y("div",{class:"nexus-table-header"},[y("div",{class:"left"}),y("div",{class:"right"})],-1);m();const D=E(((e,a,t,l,r,n)=>{const o=g("el-table-column"),s=g("el-table"),d=g("el-pagination"),i=g("el-card"),u=f("loading");return h(),b(i,null,{header:E((()=>[j])),default:E((()=>[C(y(s,{ref:"multipleTable",data:e.tableData,"tooltip-effect":"dark",onSortChange:l.handleSortChange,onSelectionChange:l.handleSelectionChange},{default:E((()=>[y(o,{type:"selection",width:"55"}),y(o,{prop:"id",label:"Id",width:"60",sortable:"custom"}),y(o,{prop:"exam_id",label:"Exam",formatter:l.formatColumnExam},null,8,["formatter"]),y(o,{prop:"uid",label:"User",formatter:l.formatColumnUser},null,8,["formatter"]),y(o,{prop:"status_text",label:"Status"}),y(o,{prop:"created_at",label:"Created At"}),y(o,{label:"Action",width:"100"},{default:E((e=>[y("a",{style:{cursor:"pointer","margin-right":"10px"},onClick:a=>l.handleDetail(e.row.uid)},"Detail",8,["onClick"])])),_:1})])),_:1},8,["data","onSortChange","onSelectionChange"]),[[u,e.loading]]),y(d,{background:"",layout:"prev, pager, next",total:e.total,"page-size":e.perPage,"current-page":e.currentPage,onCurrentChange:l.changePage},null,8,["total","page-size","current-page","onCurrentChange"])])),_:1})}));_.render=D,_.__scopeId="data-v-50017f64";export default _;
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
var e=Object.defineProperty,a=Object.prototype.hasOwnProperty,t=Object.getOwnPropertySymbols,l=Object.prototype.propertyIsEnumerable,r=(a,t,l)=>t in a?e(a,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):a[t]=l,n=(e,n)=>{for(var o in n||(n={}))a.call(n,o)&&r(e,o,n[o]);if(t)for(var o of t(n))l.call(n,o)&&r(e,o,n[o]);return e};import{r as o,i as s,b as d,t as i,u,v as p,p as c,d as m,e as g,j as f,o as h,c as b,k as C,f as y,g as x}from"./index.74b68f27.js";import{u as w,r as v,a as S}from"./table.9f49d458.js";const _={name:"ExamUserTable",setup(){const e=o(null),a=u(),t=w();s((()=>{l()}));const l=async()=>{t.loading=!0;let e=await d.listExamUser(t.query);v(e,t),t.loading=!1};return n(n({},i(t)),{multipleTable:e,handleSelectionChange:e=>{t.multipleSelection=e},handleAdd:()=>{a.push({name:"user-form"})},handleEdit:e=>{a.push({name:"user-form",query:{id:e}})},handleDelete:async e=>{let a=await d.deleteExam(e);p.success(a.msg),t.query.page=1,await l()},handleDetail:e=>{a.push({name:"user-detail",query:{id:e}})},fetchTableData:l,changePage:e=>{t.query.page=e,l()},handleSortChange:e=>{S(e,t),l()},formatColumnUser:(e,a)=>e.user.username,formatColumnExam:(e,a)=>e.exam.name,formatColumnDownloaded:(e,a)=>e.downloaded_text})}},E=x();c("data-v-50017f64");const j=y("div",{class:"nexus-table-header"},[y("div",{class:"left"}),y("div",{class:"right"})],-1);m();const D=E(((e,a,t,l,r,n)=>{const o=g("el-table-column"),s=g("el-table"),d=g("el-pagination"),i=g("el-card"),u=f("loading");return h(),b(i,null,{header:E((()=>[j])),default:E((()=>[C(y(s,{ref:"multipleTable",data:e.tableData,"tooltip-effect":"dark",onSortChange:l.handleSortChange,onSelectionChange:l.handleSelectionChange},{default:E((()=>[y(o,{type:"selection",width:"55"}),y(o,{prop:"id",label:"Id",width:"60",sortable:"custom"}),y(o,{prop:"exam_id",label:"Exam",formatter:l.formatColumnExam},null,8,["formatter"]),y(o,{prop:"uid",label:"User",formatter:l.formatColumnUser},null,8,["formatter"]),y(o,{prop:"status_text",label:"Status"}),y(o,{prop:"created_at",label:"Created At"}),y(o,{label:"Action",width:"100"},{default:E((e=>[y("a",{style:{cursor:"pointer","margin-right":"10px"},onClick:a=>l.handleDetail(e.row.uid)},"Detail",8,["onClick"])])),_:1})])),_:1},8,["data","onSortChange","onSelectionChange"]),[[u,e.loading]]),y(d,{background:"",layout:"prev, pager, next",total:e.total,"page-size":e.perPage,"current-page":e.currentPage,onCurrentChange:l.changePage},null,8,["total","page-size","current-page","onCurrentChange"])])),_:1})}));_.render=D,_.__scopeId="data-v-50017f64";export default _;
|
||||
Vendored
+2
-2
@@ -5,8 +5,8 @@
|
||||
<link rel="icon" href="/admin/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>NexusPHP</title>
|
||||
<script type="module" crossorigin src="/admin/assets/index.d2823cf5.js"></script>
|
||||
<link rel="stylesheet" href="/admin/assets/index.5c8b04c8.css">
|
||||
<script type="module" crossorigin src="/admin/assets/index.74b68f27.js"></script>
|
||||
<link rel="stylesheet" href="/admin/assets/index.268bf032.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
@@ -126,6 +126,7 @@ export default {
|
||||
console.log(params)
|
||||
let res = await api.storeSetting(params)
|
||||
ElMessage.success(res.msg)
|
||||
await listSetting();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<el-tabs type="border-card" @tab-click="handleTabClick">
|
||||
<el-tab-pane label="Backup"><FormBackup ref="backup" /></el-tab-pane>
|
||||
<el-tab-pane label="Basic"><FormBasic /></el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Repositories\ToolRepository;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class BackupCronjob extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'backup:cronjob';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Backup all data cronjob, and upload to Google drive.';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle(): int
|
||||
{
|
||||
$rep = new ToolRepository();
|
||||
$result = $rep->cronjobBackup();
|
||||
$log = sprintf(
|
||||
'[%s], %s, result: %s',
|
||||
REQUEST_ID, __METHOD__, var_export($result, true)
|
||||
);
|
||||
$this->info($log);
|
||||
do_log($log);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,7 @@ class Kernel extends ConsoleKernel
|
||||
{
|
||||
$schedule->command('exam:assign_cronjob')->everyMinute();
|
||||
$schedule->command('exam:checkout_cronjob')->everyMinute();
|
||||
$schedule->command('backup:cronjob')->everyMinute();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,4 +27,5 @@ class Setting extends NexusModel
|
||||
}
|
||||
return Arr::get($settings, $name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,19 +12,10 @@ class SettingRepository extends BaseRepository
|
||||
{
|
||||
public function getList(array $params)
|
||||
{
|
||||
$query = Setting::query();
|
||||
if (!empty($params['prefix'])) {
|
||||
$query->where('name', 'like', "{$params['prefix']}%");
|
||||
}
|
||||
$settings = $query->get();
|
||||
$results = [];
|
||||
foreach ($settings as $setting) {
|
||||
$value = $setting->value;
|
||||
$arr = json_decode($value, true);
|
||||
if (is_array($arr)) {
|
||||
$value = $arr;
|
||||
}
|
||||
Arr::set($results, $setting->name, $value);
|
||||
$results = Setting::get();
|
||||
$prefix = $params['prefix'] ?? null;
|
||||
if ($prefix) {
|
||||
return [$prefix => Arr::get($results, $prefix, [])];
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
<?php
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\Setting;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class ToolRepository extends BaseRepository
|
||||
{
|
||||
public function getSystemInfo()
|
||||
public function getSystemInfo(): array
|
||||
{
|
||||
$systemInfo = [
|
||||
'nexus_version' => config('app.nexus_version'),
|
||||
@@ -21,7 +22,7 @@ class ToolRepository extends BaseRepository
|
||||
return $systemInfo;
|
||||
}
|
||||
|
||||
public function backupWeb()
|
||||
public function backupWeb(): array
|
||||
{
|
||||
$webRoot = base_path();
|
||||
$dirName = basename($webRoot);
|
||||
@@ -55,7 +56,7 @@ class ToolRepository extends BaseRepository
|
||||
return compact('result_code', 'filename');
|
||||
}
|
||||
|
||||
public function backupAll($uploadToGoogleDrive = false)
|
||||
public function backupAll(): array
|
||||
{
|
||||
$backupWeb = $this->backupWeb();
|
||||
if ($backupWeb['result_code'] != 0) {
|
||||
@@ -77,12 +78,82 @@ class ToolRepository extends BaseRepository
|
||||
"command: %s, output: %s, result_code: %s, result: %s, filename: %s",
|
||||
$command, json_encode($output), $result_code, $result, $filename
|
||||
));
|
||||
$upload_result = '';
|
||||
if ($uploadToGoogleDrive) {
|
||||
$disk = Storage::disk('google_drive');
|
||||
$upload_result = $disk->put(basename($filename), fopen($filename, 'r'));
|
||||
}
|
||||
return compact('result_code', 'filename', 'upload_result');
|
||||
return compact('result_code', 'filename');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* do backup cronjob
|
||||
*
|
||||
* @return array|false
|
||||
*/
|
||||
public function cronjobBackup()
|
||||
{
|
||||
$setting = Setting::get('backup');
|
||||
if ($setting['enabled'] != 'yes') {
|
||||
do_log("Backup not enabled.");
|
||||
return false;
|
||||
}
|
||||
$now = now();
|
||||
$frequency = $setting['frequency'];
|
||||
$settingHour = (int)$setting['hour'];
|
||||
$settingMinute = (int)$setting['minute'];
|
||||
$nowHour = (int)$now->format('H');
|
||||
$nowMinute = (int)$now->format('m');
|
||||
do_log("Backup frequency: $frequency");
|
||||
if ($frequency == 'daily') {
|
||||
if ($settingHour != $nowHour) {
|
||||
do_log(sprintf('Backup setting hour: %s != now hour: %s', $settingHour, $nowHour));
|
||||
return false;
|
||||
}
|
||||
if ($settingMinute != $nowMinute) {
|
||||
do_log(sprintf('Backup setting minute: %s != now minute: %s', $settingMinute, $nowMinute));
|
||||
return false;
|
||||
}
|
||||
} elseif ($frequency == 'hourly') {
|
||||
if ($settingMinute != $nowMinute) {
|
||||
do_log(sprintf('Backup setting minute: %s != now minute: %s', $settingMinute, $nowMinute));
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
throw new \RuntimeException("Unknown backup frequency: $frequency");
|
||||
}
|
||||
$backupResult = $this->backupAll();
|
||||
do_log("Backup all result: " . json_encode($backupResult));
|
||||
if ($backupResult['result_code'] != 0) {
|
||||
throw new \RuntimeException("Backup all fail.");
|
||||
}
|
||||
$clientId = $setting['google_drive_client_id'] ?? '';
|
||||
$clientSecret = $setting['google_drive_client_secret'] ?? '';
|
||||
$refreshToken = $setting['google_drive_refresh_token'] ?? '';
|
||||
$folderId = $setting['google_drive_folder_id'] ?? '';
|
||||
|
||||
if (empty($clientId)) {
|
||||
do_log("No google_drive_client_id, won't do upload.");
|
||||
return false;
|
||||
}
|
||||
if (empty($clientSecret)) {
|
||||
do_log("No google_drive_client_secret, won't do upload.");
|
||||
return false;
|
||||
}
|
||||
if (empty($refreshToken)) {
|
||||
do_log("No google_drive_refresh_token, won't do upload.");
|
||||
return false;
|
||||
}
|
||||
do_log("Google drive info: clientId: $clientId, clientSecret: $clientSecret, refreshToken: $refreshToken, folderId: $folderId");
|
||||
|
||||
$client = new \Google_Client();
|
||||
$client->setClientId($clientId);
|
||||
$client->setClientSecret($clientSecret);
|
||||
$client->refreshToken($refreshToken);
|
||||
$service = new \Google_Service_Drive($client);
|
||||
$adapter = new \Hypweb\Flysystem\GoogleDrive\GoogleDriveAdapter($service, $folderId);
|
||||
$filesystem = new \League\Flysystem\Filesystem($adapter);
|
||||
|
||||
$filename = $backupResult['filename'];
|
||||
$upload_result = $filesystem->put(basename($filename), fopen($filename, 'r'));
|
||||
$backupResult['upload_result'] = $upload_result;
|
||||
|
||||
return $backupResult;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
return array (
|
||||
'basic' =>
|
||||
'basic' =>
|
||||
array (
|
||||
'SITENAME' => 'NexusPHP',
|
||||
),
|
||||
'main' =>
|
||||
'main' =>
|
||||
array (
|
||||
'site_online' => 'yes',
|
||||
'max_torrent_size' => '1048576',
|
||||
@@ -36,13 +36,13 @@
|
||||
'autoclean_interval_two' => '1800',
|
||||
'autoclean_interval_three' => '3600',
|
||||
'autoclean_interval_four' => '43200',
|
||||
'autoclean_interval_five' => '1296000',
|
||||
'autoclean_interval_five' => '648000',
|
||||
'reportemail' => 'nobody@gmail.com',
|
||||
'invitesystem' => 'no',
|
||||
'registration' => 'yes',
|
||||
'showhotmovies' => 'no',
|
||||
'showclassicmovies' => 'no',
|
||||
'showimdbinfo' => 'yes',
|
||||
'showimdbinfo' => 'no',
|
||||
'enablenfo' => 'yes',
|
||||
'enableschool' => 'no',
|
||||
'restrictemail' => 'no',
|
||||
@@ -82,7 +82,7 @@
|
||||
'enable_pt_gen_system' => 'no',
|
||||
'enable_technical_info' => 'no',
|
||||
),
|
||||
'smtp' =>
|
||||
'smtp' =>
|
||||
array (
|
||||
'smtptype' => 'advanced',
|
||||
'emailnotify' => 'no',
|
||||
@@ -94,7 +94,7 @@
|
||||
'accountname' => '',
|
||||
'accountpassword' => '',
|
||||
),
|
||||
'security' =>
|
||||
'security' =>
|
||||
array (
|
||||
'securelogin' => 'no',
|
||||
'securetracker' => 'no',
|
||||
@@ -114,7 +114,7 @@
|
||||
'login_secret_deadline' => '2021-02-03 18:55:46',
|
||||
'login_secret' => '8e19c6a796602bda113fb2f5bc9da2b0',
|
||||
),
|
||||
'authority' =>
|
||||
'authority' =>
|
||||
array (
|
||||
'defaultclass' => '1',
|
||||
'staffmem' => '13',
|
||||
@@ -162,7 +162,7 @@
|
||||
'againstoffer' => '1',
|
||||
'userbar' => '2',
|
||||
),
|
||||
'tweak' =>
|
||||
'tweak' =>
|
||||
array (
|
||||
'where' => 'no',
|
||||
'iplog1' => 'yes',
|
||||
@@ -179,7 +179,7 @@
|
||||
'prolinkimg' => 'pic/prolink.png',
|
||||
'analyticscode' => '',
|
||||
),
|
||||
'bonus' =>
|
||||
'bonus' =>
|
||||
array (
|
||||
'donortimes' => '2',
|
||||
'perseeding' => '1',
|
||||
@@ -213,7 +213,7 @@
|
||||
'prolinkpoint' => '1',
|
||||
'prolinktime' => '600',
|
||||
),
|
||||
'account' =>
|
||||
'account' =>
|
||||
array (
|
||||
'neverdelete' => '6',
|
||||
'neverdeletepacked' => '3',
|
||||
@@ -264,7 +264,7 @@
|
||||
'nmdl' => '3072',
|
||||
'nmprratio' => '4.55',
|
||||
'nmderatio' => '4.45',
|
||||
'getInvitesByPromotion' =>
|
||||
'getInvitesByPromotion' =>
|
||||
array (
|
||||
2 => '1',
|
||||
3 => '0',
|
||||
@@ -276,7 +276,7 @@
|
||||
9 => '10',
|
||||
),
|
||||
),
|
||||
'torrent' =>
|
||||
'torrent' =>
|
||||
array (
|
||||
'prorules' => 'no',
|
||||
'randomhalfleech' => '5',
|
||||
@@ -307,7 +307,7 @@
|
||||
'expirethirtypercentleech' => '0',
|
||||
'minvotes' => '10',
|
||||
),
|
||||
'attachment' =>
|
||||
'attachment' =>
|
||||
array (
|
||||
'enableattach' => 'yes',
|
||||
'classone' => '1',
|
||||
@@ -340,7 +340,7 @@
|
||||
'altthumbwidth' => '180',
|
||||
'altthumbheight' => '135',
|
||||
),
|
||||
'advertisement' =>
|
||||
'advertisement' =>
|
||||
array (
|
||||
'enablead' => 'yes',
|
||||
'enablenoad' => 'yes',
|
||||
@@ -351,11 +351,22 @@
|
||||
'bonusnoadtime' => '15',
|
||||
'adclickbonus' => '0',
|
||||
),
|
||||
'code' =>
|
||||
'code' =>
|
||||
array (
|
||||
'mainversion' => 'NexusPHP',
|
||||
'subversion' => 'v1.6.0-beta6',
|
||||
'releasedate' => '2021-05-08',
|
||||
'website' => '<a href="https://nexusphp.org" target="_blank">https://nexusphp.org</a>',
|
||||
),
|
||||
);
|
||||
'backup' =>
|
||||
array (
|
||||
'enabled' => 'no',
|
||||
'frequency' => 'daily',
|
||||
'hour' => '0',
|
||||
'minute' => '0',
|
||||
'google_drive_client_id' => '',
|
||||
'google_drive_client_secret' => '',
|
||||
'google_drive_refresh_token' => '',
|
||||
'google_drive_folder_id' => '',
|
||||
),
|
||||
);
|
||||
Reference in New Issue
Block a user