mirror of
https://github.com/v2board/v2board.git
synced 2024-11-14 07:29:13 +08:00
1 line
17 KiB
JavaScript
Vendored
1 line
17 KiB
JavaScript
Vendored
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[2],{Bl7J:function(e,a,t){"use strict";var n=t("q1tI"),l=t.n(n),i=t("3a4m"),s=t.n(i),r=t("/MKj"),c=t("20nU"),o=t("yWgo");class m extends l.a.Component{constructor(){super(...arguments),this.state={nav:[]}}componentDidMount(){var e=[{title:"\u4eea\u8868\u76d8",type:"item",href:"/dashboard",icon:l.a.createElement("i",{className:"nav-main-link-icon si si-speedometer"})},{title:"\u8ba2\u9605",type:"heading"},{title:"\u6211\u7684\u8ba2\u9605",type:"item",href:"/subscribe",icon:l.a.createElement("i",{className:"nav-main-link-icon si si-badge"})},{title:"\u8d2d\u4e70\u8ba2\u9605",type:"item",href:"/plan",icon:l.a.createElement("i",{className:"nav-main-link-icon si si-bag"})},{title:"\u8d22\u52a1",type:"heading"},{title:"\u6211\u7684\u8ba2\u5355",type:"item",href:"/order",icon:l.a.createElement("i",{className:"nav-main-link-icon si si-list"})},{title:"\u6211\u7684\u9080\u8bf7",type:"item",href:"/invite",icon:l.a.createElement("i",{className:"nav-main-link-icon si si-users"})},{title:"\u7528\u6237",type:"heading"},{title:"\u4e2a\u4eba\u4e2d\u5fc3",type:"item",href:"/profile",icon:l.a.createElement("i",{className:"nav-main-link-icon si si-user"})},{title:"\u4f7f\u7528\u6559\u7a0b",type:"item",href:"/tutorial",icon:l.a.createElement("i",{className:"nav-main-link-icon si si-book-open"})}],a=[{title:"\u8fd4\u56de\u7528\u6237\u4e2d\u5fc3",type:"item",href:"/dashboard",icon:l.a.createElement("i",{className:"nav-main-link-icon si si-action-undo"})},{title:"\u8bbe\u7f6e",type:"heading"},{title:"\u7ad9\u70b9\u914d\u7f6e",type:"item",href:"/admin/config/site",icon:l.a.createElement("i",{className:"nav-main-link-icon si si-equalizer"})},{title:"\u652f\u4ed8\u914d\u7f6e",type:"item",href:"/admin/config/payment",icon:l.a.createElement("i",{className:"nav-main-link-icon si si-credit-card"})},{title:"\u670d\u52a1\u5668",type:"heading"},{title:"\u8282\u70b9\u7ba1\u7406",type:"item",href:"/admin/server",icon:l.a.createElement("i",{className:"nav-main-link-icon si si-vector"})},{title:"\u6743\u9650\u7ec4\u7ba1\u7406",type:"item",href:"/admin/server/group",icon:l.a.createElement("i",{className:"nav-main-link-icon si si-wrench"})},{title:"\u8d22\u52a1",type:"heading"},{title:"\u8ba2\u9605\u7ba1\u7406",type:"item",href:"/admin/plan",icon:l.a.createElement("i",{className:"nav-main-link-icon si si-bag"})},{title:"\u8ba2\u5355\u7ba1\u7406",type:"item",href:"/admin/order",icon:l.a.createElement("i",{className:"nav-main-link-icon si si-list"})},{title:"\u7528\u6237",type:"heading"},{title:"\u7528\u6237\u7ba1\u7406",type:"item",href:"/admin/user",icon:l.a.createElement("i",{className:"nav-main-link-icon si si-users"})}];Object(o["b"])("is_admin")&&e.unshift({title:"\u8fd4\u56de\u7ba1\u7406\u4e2d\u5fc3",type:"item",href:"/admin/dashboard",icon:l.a.createElement("i",{className:"nav-main-link-icon si si-action-undo"})}),this.isAdmin()?this.setState({nav:a}):this.setState({nav:e})}renderMenu(e,a,t,n){switch(e){case"heading":return l.a.createElement("li",{className:"nav-main-heading"},a);case"item":return l.a.createElement("li",{className:"nav-main-item"},l.a.createElement("a",{className:"nav-main-link ".concat(this.props.location.pathname===t&&"active"),onClick:()=>{s.a.push(t),this.props.dispatch({type:"header/showNav"})}},n&&n,l.a.createElement("span",{className:"nav-main-link-name"},a)))}}isAdmin(){return-1!==this.props.location.pathname.indexOf("admin")}render(){return l.a.createElement("nav",{id:"sidebar","aria-label":"Main Navigation"},l.a.createElement("div",{className:"smini-visible-block"},l.a.createElement("div",{className:"content-header bg-black-10"},l.a.createElement("a",{className:"link-fx font-size-lg text-white",href:"index.html"},l.a.createElement("span",{className:"text-white-75"},"X"),l.a.createElement("span",{className:"text-white"},"H")))),l.a.createElement("div",{className:"smini-hidden ".concat(1===c["a"].theme?"":"bg-header-dark")},l.a.createElement("div",{className:"content-header justify-content-lg-center bg-black-10"},l.a.createElement("a",{className:"link-fx font-size-lg text-white",href:"index.html"},l.a.createElement("span",{className:"text-white-75"},window.v2board.title?window.v2board.title:"V2Board")),l.a.createElement("div",{className:"d-lg-none"},l.a.createElement("a",{className:"text-white ml-2","data-toggle":"layout","data-action":"sidebar_close",href:"javascript:void(0)",onClick:()=>this.props.dispatch({type:"header/showNav"})},l.a.createElement("i",{className:"fa fa-times-circle"}))))),l.a.createElement("div",{className:"content-side content-side-full"},l.a.createElement("ul",{className:"nav-main"},this.state.nav.map(e=>{return this.renderMenu(e.type,e.title,e.href,e.icon)}))))}}var d=Object(r["c"])(e=>{var a=e.header;return{header:a}})(m),p=t("t3Un");class h extends l.a.Component{constructor(){super(...arguments),this.state={showAvatarMenu:!1,loading:!1}}componentDidMount(){var e=this;this.props.header.userInfo.email||this.setState({loading:!0},()=>{this.props.dispatch({type:"header/getUserInfo",complete:()=>e.setState({loading:!1})})})}showAvatarMenu(){var e=this;this.setState({showAvatarMenu:!this.state.showAvatarMenu},()=>{document.onclick=function(a){e.state.showAvatarMenu&&e.setState({showAvatarMenu:!1}),document.onclick=void 0}})}logout(){Object(p["a"])("/user/logout").then(e=>{s.a.push("/login")})}render(){return l.a.createElement("header",{id:"page-header"},l.a.createElement("div",{className:"content-header"},l.a.createElement("div",{className:"sidebar-toggle",style:{display:this.props.search?"none":"block"}},l.a.createElement("button",{type:"button",className:"btn btn-dual mr-1 d-lg-none","data-toggle":"layout","data-action":"sidebar_toggle",onClick:()=>this.props.dispatch({type:"header/showNav"})},l.a.createElement("i",{className:"fa fa-fw fa-bars"}))),this.props.search&&l.a.createElement("div",null,l.a.createElement("input",{type:"text",className:"form-control rounded-lg px-4",placeholder:this.props.search.placeholder,onChange:e=>this.props.search.onChange(e.target.value)})),l.a.createElement("div",null,this.state.loading?l.a.createElement("div",{className:"spinner-grow text-primary"}):l.a.createElement("div",{className:"dropdown d-inline-block"},l.a.createElement("button",{type:"button",className:"btn btn-dual",id:"page-header-user-dropdown","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",onClick:()=>this.showAvatarMenu()},l.a.createElement("img",{className:"img-avatar img-avatar32 img-avatar-thumb",src:this.props.header.userInfo.avatar_url,alt:""}),l.a.createElement("span",{className:"d-none d-lg-inline ml-1"},this.props.header.userInfo.email),l.a.createElement("i",{className:"fa fa-fw fa-angle-down ml-1"})),l.a.createElement("div",{className:"dropdown-menu dropdown-menu-right dropdown-menu-lg p-0 ".concat(this.state.showAvatarMenu&&"show"),"aria-labelledby":"page-header-user-dropdown"},l.a.createElement("div",{className:"p-2"},l.a.createElement("a",{className:"dropdown-item d-flex justify-content-between align-items-center",href:"javascript:;",onClick:()=>this.logout()},"\u9000\u51fa\u767b\u5f55",l.a.createElement("i",{className:"fa fa-fw fa-sign-out-alt text-danger ml-1"}))))))))}}var u=Object(r["c"])(e=>{var a=e.header;return{header:a}})(h);class v extends l.a.Component{render(){return l.a.createElement("footer",{id:"page-footer",className:"bg-body-light"},l.a.createElement("div",{className:"content py-0"},l.a.createElement("div",{className:"row font-size-sm"},l.a.createElement("div",{className:"col-sm-6 order-sm-2 mb-1 mb-sm-0 text-center text-sm-right"},l.a.createElement("i",{className:"fa fa-heart text-danger"})," ",window.v2board.title?window.v2board.title:"V2Board"),l.a.createElement("div",{className:"col-sm-6 order-sm-1 text-center text-sm-left"},l.a.createElement("a",{className:"font-w600",href:"/",target:"_blank"},"V2Board v0.1"),l.a.createElement("span",{"data-toggle":"year-copy"})))))}}class E extends l.a.Component{render(){return l.a.createElement("div",{id:"page-container",className:"sidebar-o ".concat(1===c["a"].theme?"sidebar-dark":"page-header-dark"," side-scroll page-header-fixed main-content-boxed side-trans-enabled ").concat(this.props.header.showNav&&"sidebar-o-xs")},l.a.createElement(d,this.props),l.a.createElement(u,{search:this.props.search}),this.props.loading?l.a.createElement("main",{id:"main-container"},l.a.createElement("div",{className:"content content-full"},l.a.createElement("div",{className:"spinner-grow text-primary",role:"status"},l.a.createElement("span",{className:"sr-only"},"Loading...")))):this.props.children,l.a.createElement(v,null))}}a["a"]=Object(r["c"])(e=>{var a=e.header;return{header:a}})(E)},L4tb:function(e,a,t){"use strict";t.r(a),t.d(a,"default",function(){return E});var n=t("jehZ"),l=t.n(n),i=(t("BoS7"),t("Sdc0")),s=(t("5Dmo"),t("3S7+")),r=(t("Pwec"),t("CtXQ")),c=(t("+L6B"),t("2/Rp")),o=(t("miYZ"),t("tsqr")),m=t("p0pE"),d=t.n(m),p=t("q1tI"),h=t.n(p),u=t("Bl7J"),v=t("t3Un");class E extends h.a.Component{constructor(){super(...arguments),this.state={invite:{},site:{},server:{},tutorial:{},loading:!0}}componentDidMount(){this.fetchData()}fetchData(){Object(v["a"])("/admin/config").then(e=>{200===e.code&&this.setState(d()({},e.data,{loading:!1}))})}submit(e){Object(v["b"])("/admin/config/save",this.state[e]).then(e=>{200===e.code&&e.data&&(this.fetchData(),o["a"].success("\u4fdd\u5b58\u6210\u529f"))})}set(e,a,t){this.setState({[e]:d()({},this.state[e],{[a]:t})})}render(){return h.a.createElement(u["a"],l()({},this.props,{loading:this.state.loading}),h.a.createElement("main",{id:"main-container"},h.a.createElement("div",{className:"content content-full"},h.a.createElement("h2",{className:"font-w300 mt-4 mb-3"},"\u7ad9\u70b9\u914d\u7f6e"),h.a.createElement("div",{className:"block block-rounded block-bordered"},h.a.createElement("div",{className:"block-header block-header-default"},h.a.createElement("h3",{className:"block-title"},"\u7ad9\u70b9"),h.a.createElement("div",{className:"block-options"},h.a.createElement(c["a"],{type:"primary",onClick:()=>this.submit("site")},"\u4fdd\u5b58"))),h.a.createElement("div",{className:"block-content"},h.a.createElement("div",{className:"row push"},h.a.createElement("div",{className:"col-lg-8 col-xl-5"},h.a.createElement("div",{className:"form-group"},h.a.createElement("label",{for:"example-text-input"},"\u7ad9\u70b9\u540d\u79f0"),h.a.createElement("input",{type:"text",className:"form-control",placeholder:"\u8bf7\u8f93\u5165",defaultValue:this.state.site.app_name,onChange:e=>this.set("site","app_name",e.target.value)})),h.a.createElement("div",{className:"form-group"},h.a.createElement("label",{for:"example-text-input"},"\u7ad9\u70b9URL ",h.a.createElement(s["a"],{placement:"top",title:"\u524d\u540e\u7aef\u5206\u79bb\u540e\u524d\u7aef\u5730\u5740\u6240\u4f7f\u7528\u3002"},h.a.createElement(r["a"],{type:"question-circle"}))),h.a.createElement("input",{type:"text",className:"form-control",placeholder:"\u8bf7\u8f93\u5165",defaultValue:this.state.site.app_url,onChange:e=>this.set("site","app_url",e.target.value)})),h.a.createElement("div",{className:"form-group"},h.a.createElement("label",{for:"example-text-input"},"\u8ba2\u9605URL ",h.a.createElement(s["a"],{placement:"top",title:"\u7528\u4e8e\u8ba2\u9605\u6240\u4f7f\u7528\uff0c\u7559\u7a7a\u5219\u4e3a\u7ad9\u70b9URL\u3002"},h.a.createElement(r["a"],{type:"question-circle"}))),h.a.createElement("input",{type:"text",className:"form-control",placeholder:"\u8bf7\u8f93\u5165",defaultValue:this.state.site.subscribe_url,onChange:e=>this.set("site","subscribe_url",e.target.value)})),h.a.createElement("div",{className:"form-group"},h.a.createElement("label",{for:"example-text-input"},"\u505c\u6b62\u65b0\u7528\u6237\u6ce8\u518c"),h.a.createElement("div",null,h.a.createElement(i["a"],{checked:parseInt(this.state.site.stop_register),onChange:e=>this.set("site","stop_register",e?1:0)}))),h.a.createElement("div",{className:"form-group"},h.a.createElement("label",{for:"example-text-input"},"\u90ae\u7bb1\u9a8c\u8bc1"),h.a.createElement("div",null,h.a.createElement(i["a"],{checked:parseInt(this.state.site.email_verify),onChange:e=>this.set("site","email_verify",e?1:0)}))),h.a.createElement("div",{className:"form-group"},h.a.createElement("label",{for:"example-text-input"},"\u662f\u5426\u5141\u8bb8\u7528\u6237\u66f4\u6539\u8ba2\u9605"),h.a.createElement("div",null,h.a.createElement(i["a"],{checked:parseInt(this.state.site.plan_is_update),onChange:e=>this.set("site","plan_is_update",e?1:0)}))),h.a.createElement("div",{className:"form-group"},h.a.createElement("label",{for:"example-text-input"},"\u66f4\u6539\u8ba2\u9605\u624b\u7eed\u8d39 ",h.a.createElement(s["a"],{placement:"top",title:"\u5347\u7ea7\u6216\u964d\u7ea7\u8ba2\u9605\u5c06\u6309\u7167\u5269\u4f59\u5929\u6570\u4e58\u4ee5\u624b\u7eed\u8d39\u8fdb\u884c\u5dee\u4ef7\u8ba1\u7b97\u3002"},h.a.createElement(r["a"],{type:"question-circle"}))),h.a.createElement("input",{type:"text",className:"form-control",placeholder:"\u8bf7\u8f93\u5165",defaultValue:this.state.site.plan_update_fee,onChange:e=>this.set("site","plan_update_fee",e.target.value)})))))),h.a.createElement("div",{className:"block block-rounded block-bordered"},h.a.createElement("div",{className:"block-header block-header-default"},h.a.createElement("h3",{className:"block-title"},"\u9080\u8bf7"),h.a.createElement("div",{className:"block-options"},h.a.createElement(c["a"],{type:"primary",onClick:()=>this.submit("invite")},"\u4fdd\u5b58"))),h.a.createElement("div",{className:"block-content"},h.a.createElement("div",{className:"row push"},h.a.createElement("div",{className:"col-lg-8 col-xl-5"},h.a.createElement("div",{className:"form-group"},h.a.createElement("label",{for:"example-text-input"},"\u5f00\u542f\u5f3a\u5236\u9080\u8bf7"),h.a.createElement("div",null,h.a.createElement(i["a"],{checked:parseInt(this.state.invite.invite_force),onChange:e=>this.set("invite","invite_force",e?1:0)}))),h.a.createElement("div",{className:"form-group"},h.a.createElement("label",{for:"example-email-input"},"\u9080\u8bf7\u4f63\u91d1\u767e\u5206\u6bd4"),h.a.createElement("input",{type:"text",className:"form-control",placeholder:"\u8bf7\u8f93\u5165",defaultValue:this.state.invite.invite_commission,onChange:e=>this.set("invite","invite_commission",parseInt(e.target.value))})),h.a.createElement("div",{className:"form-group"},h.a.createElement("label",{for:"example-email-input"},"\u7528\u6237\u53ef\u521b\u5efa\u9080\u8bf7\u7801\u4e0a\u9650"),h.a.createElement("input",{type:"text",className:"form-control",placeholder:"\u8bf7\u8f93\u5165",defaultValue:this.state.invite.invite_gen_limit,onChange:e=>this.set("invite","invite_gen_limit",parseInt(e.target.value))})),h.a.createElement("div",{className:"form-group"},h.a.createElement("label",{for:"example-email-input"},"\u9080\u8bf7\u7801\u6c38\u4e0d\u8fc7\u671f"),h.a.createElement("div",null,h.a.createElement(i["a"],{checked:parseInt(this.state.invite.invite_never_expire),onChange:e=>this.set("invite","invite_never_expire",e?1:0)}))))))),h.a.createElement("div",{className:"block block-rounded block-bordered"},h.a.createElement("div",{className:"block-header block-header-default"},h.a.createElement("h3",{className:"block-title"},"\u670d\u52a1\u7aef"),h.a.createElement("div",{className:"block-options"},h.a.createElement(c["a"],{type:"primary",onClick:()=>this.submit("server")},"\u4fdd\u5b58"))),h.a.createElement("div",{className:"block-content"},h.a.createElement("div",{className:"row push"},h.a.createElement("div",{className:"col-lg-8 col-xl-5"},h.a.createElement("div",{className:"form-group"},h.a.createElement("label",{for:"example-text-input"},"\u901a\u8baf\u5bc6\u94a5"),h.a.createElement("input",{type:"text",className:"form-control",placeholder:"\u8bf7\u8f93\u5165",defaultValue:this.state.server.server_token,onChange:e=>this.set("server","server_token",e.target.value)})))))),h.a.createElement("div",{className:"block block-rounded block-bordered"},h.a.createElement("div",{className:"block-header block-header-default"},h.a.createElement("h3",{className:"block-title"},"\u6559\u7a0b ",h.a.createElement(s["a"],{placement:"top",title:"\u4e3a\u7528\u6237\u63d0\u4f9bApple ID\uff0c\u8be5\u4fe1\u606f\u5c06\u4f1a\u5728\u6559\u7a0b\u5904\u4f53\u73b0\uff0c\u975e\u4ed8\u8d39\u7528\u6237\u5c06\u65e0\u6cd5\u770b\u5230\u3002"},h.a.createElement(r["a"],{type:"question-circle"}))),h.a.createElement("div",{className:"block-options"},h.a.createElement(c["a"],{type:"primary",onClick:()=>this.submit("tutorial")},"\u4fdd\u5b58"))),h.a.createElement("div",{className:"block-content"},h.a.createElement("div",{className:"row push"},h.a.createElement("div",{className:"col-lg-8 col-xl-5"},h.a.createElement("div",{className:"form-group"},h.a.createElement("label",{for:"example-text-input"},"Apple ID \u8d26\u53f7"),h.a.createElement("input",{type:"text",className:"form-control",placeholder:"\u8bf7\u8f93\u5165",defaultValue:this.state.tutorial.apple_id,onChange:e=>this.set("tutorial","apple_id",e.target.value)})),h.a.createElement("div",{className:"form-group"},h.a.createElement("label",{for:"example-text-input"},"Apple ID \u5bc6\u7801"),h.a.createElement("input",{type:"password",className:"form-control",placeholder:"\u8bf7\u8f93\u5165",defaultValue:this.state.tutorial.apple_id_password,onChange:e=>this.set("tutorial","apple_id_password",e.target.value)})))))))))}}}}]); |