mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 17:49:11 +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"),m=t("yWgo");class o 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:"\u6211\u7684\u5de5\u5355",type:"item",href:"/ticket",icon:l.a.createElement("i",{className:"nav-main-link-icon si si-support"})},{title:"\u6d41\u91cf\u660e\u7ec6",type:"item",href:"/traffic",icon:l.a.createElement("i",{className:"nav-main-link-icon si si-bar-chart"})},{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:"\u4eea\u8868\u76d8",type:"item",href:"/admin/dashboard",icon:l.a.createElement("i",{className:"nav-main-link-icon si si-speedometer"})},{title:"\u8bbe\u7f6e",type:"heading"},{title:"\u7cfb\u7edf\u914d\u7f6e",type:"item",href:"/admin/config/system",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:"\u4f63\u91d1\u7ba1\u7406",type:"item",href:"/admin/commission",icon:l.a.createElement("i",{className:"nav-main-link-icon si si-user-following"})},{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"})},{title:"\u516c\u544a\u7ba1\u7406",type:"item",href:"/admin/notice",icon:l.a.createElement("i",{className:"nav-main-link-icon si si-speech"})},{title:"\u5de5\u5355\u7ba1\u7406",type:"item",href:"/admin/ticket",icon:l.a.createElement("i",{className:"nav-main-link-icon si si-support"})}];Object(m["c"])("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 p=Object(r["c"])(e=>{var a=e.header;return{header:a}})(o),d=t("t3Un");class h extends l.a.Component{constructor(){super(...arguments),this.state={showAvatarMenu:!1,loading:!1,showSearchBar:!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(d["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?"block":"none"}},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("button",{type:"button",className:"btn btn-dual",onClick:()=>{this.setState({showSearchBar:!0})}},l.a.createElement("i",{className:"fa fa-fw fa-search"})," ",l.a.createElement("span",{className:"ml-1 d-none d-sm-inline-block"},"\u641c\u7d22"))),l.a.createElement("div",null),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:void(0)",onClick:()=>this.logout()},"\u9000\u51fa\u767b\u5f55",l.a.createElement("i",{className:"fa fa-fw fa-sign-out-alt text-danger ml-1"}))))))),this.props.search&&l.a.createElement("div",{className:"overlay-header bg-dark ".concat(this.state.showSearchBar?"show":"")},l.a.createElement("div",{className:"content-header bg-dark"},l.a.createElement("div",{className:"w-100"},l.a.createElement("div",{className:"input-group"},l.a.createElement("div",{className:"input-group-prepend"},l.a.createElement("button",{type:"button",className:"btn btn-dark",onClick:()=>{this.setState({showSearchBar:!1})}},l.a.createElement("i",{className:"fa fa-fw fa-times-circle"}))),l.a.createElement("input",{type:"text",className:"form-control border-0",placeholder:this.props.search.placeholder,onChange:e=>this.props.search.onChange(e.target.value),defaultValue:this.props.search.defaultValue}))))))}}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:"javascript:void(0)"},window.v2board.title?window.v2board.title:"V2Board"," v1.0.2"),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(p,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)},"cD2/":function(e,a,t){"use strict";t.r(a),t.d(a,"default",function(){return u});var n=t("jehZ"),l=t.n(n),i=(t("BoS7"),t("Sdc0")),s=(t("+L6B"),t("2/Rp")),r=(t("miYZ"),t("tsqr")),c=t("p0pE"),m=t.n(c),o=t("q1tI"),p=t.n(o),d=t("Bl7J"),h=t("t3Un");class u extends p.a.Component{constructor(){super(...arguments),this.state={invite:{},site:{},pay:{},loading:!0}}componentDidMount(){this.fetchData()}fetchData(){Object(h["a"])("/admin/config/fetch").then(e=>{200===e.code&&this.setState(m()({},e.data,{loading:!1}))})}submit(e){Object(h["b"])("/admin/config/save",this.state[e]).then(e=>{200===e.code&&e.data&&(this.fetchData(),r["a"].success("\u4fdd\u5b58\u6210\u529f"))})}set(e,a,t){this.setState({[e]:m()({},this.state[e],{[a]:t})})}render(){return p.a.createElement(d["a"],l()({},this.props,{loading:this.state.loading}),p.a.createElement("main",{id:"main-container"},p.a.createElement("div",{className:"content content-full"},p.a.createElement("h2",{className:"font-w300 mt-4 mb-3"},"\u652f\u4ed8\u914d\u7f6e"),p.a.createElement("div",{className:"block block-rounded block-bordered"},p.a.createElement("div",{className:"block-header block-header-default"},p.a.createElement("h3",{className:"block-title"},"\u652f\u4ed8\u5b9d\u5f53\u9762\u4ed8"),p.a.createElement("div",{className:"block-options"},p.a.createElement(s["a"],{type:"primary",onClick:()=>this.submit("pay")},"\u4fdd\u5b58"))),p.a.createElement("div",{className:"block-content"},p.a.createElement("div",{className:"row push"},p.a.createElement("div",{className:"col-lg-8 col-xl-5"},p.a.createElement("div",{className:"form-group"},p.a.createElement("label",{for:"example-text-input"},"\u542f\u7528"),p.a.createElement("div",null,p.a.createElement(i["a"],{checked:parseInt(this.state.pay.alipay_enable),onChange:e=>this.set("pay","alipay_enable",e?1:0)}))),p.a.createElement("div",{className:"form-group"},p.a.createElement("label",{for:"example-text-input"},"APPID"),p.a.createElement("input",{type:"text",className:"form-control",placeholder:"\u8bf7\u8f93\u5165",defaultValue:this.state.pay.alipay_appid,onChange:e=>this.set("pay","alipay_appid",parseInt(e.target.value))})),p.a.createElement("div",{className:"form-group"},p.a.createElement("label",{for:"example-text-input"},"\u516c\u94a5"),p.a.createElement("input",{type:"text",className:"form-control",placeholder:"\u8bf7\u8f93\u5165",defaultValue:this.state.pay.alipay_pubkey,onChange:e=>this.set("pay","alipay_pubkey",e.target.value)})),p.a.createElement("div",{className:"form-group"},p.a.createElement("label",{for:"example-text-input"},"\u79c1\u94a5"),p.a.createElement("input",{type:"text",className:"form-control",placeholder:"\u8bf7\u8f93\u5165",defaultValue:this.state.pay.alipay_privkey,onChange:e=>this.set("pay","alipay_privkey",e.target.value)})))))),p.a.createElement("div",{className:"block block-rounded block-bordered"},p.a.createElement("div",{className:"block-header block-header-default"},p.a.createElement("h3",{className:"block-title"},"Stripe"),p.a.createElement("div",{className:"block-options"},p.a.createElement(s["a"],{type:"primary",onClick:()=>this.submit("pay")},"\u4fdd\u5b58"))),p.a.createElement("div",{className:"block-content"},p.a.createElement("div",{className:"row"},p.a.createElement("div",{className:"col-lg-8 col-xl-5"},p.a.createElement("div",{className:"alert alert-primary",role:"alert"},p.a.createElement("p",{class:"mb-0"},"Stripe\u7684Webhook\u8def\u5f84\u4e3a\uff1a ",p.a.createElement("a",{className:"alert-link",href:"javascript:void(0)"},"/api/v1/guest/order/stripeNotify"))))),p.a.createElement("div",{className:"row push"},p.a.createElement("div",{className:"col-lg-8 col-xl-5"},p.a.createElement("div",{className:"form-group"},p.a.createElement("label",{for:"example-text-input"},"\u542f\u7528\u652f\u4ed8\u5b9d\u6536\u6b3e"),p.a.createElement("div",null,p.a.createElement(i["a"],{checked:parseInt(this.state.pay.stripe_alipay_enable),onChange:e=>this.set("pay","stripe_alipay_enable",e?1:0)}))),p.a.createElement("div",{className:"form-group"},p.a.createElement("label",{for:"example-text-input"},"\u542f\u7528\u5fae\u4fe1\u6536\u6b3e"),p.a.createElement("div",null,p.a.createElement(i["a"],{checked:parseInt(this.state.pay.stripe_wepay_enable),onChange:e=>this.set("pay","stripe_wepay_enable",e?1:0)}))),p.a.createElement("div",{className:"form-group"},p.a.createElement("label",{for:"example-text-input"},"SK_LIVE"),p.a.createElement("input",{type:"text",className:"form-control",placeholder:"\u8bf7\u8f93\u5165",defaultValue:this.state.pay.stripe_sk_live,onChange:e=>this.set("pay","stripe_sk_live",e.target.value)})),p.a.createElement("div",{className:"form-group"},p.a.createElement("label",{for:"example-text-input"},"PK_LIVE"),p.a.createElement("input",{type:"text",className:"form-control",placeholder:"\u8bf7\u8f93\u5165",defaultValue:this.state.pay.stripe_pk_live,onChange:e=>this.set("pay","stripe_pk_live",e.target.value)})),p.a.createElement("div",{className:"form-group"},p.a.createElement("label",{for:"example-text-input"},"WebHook\u5bc6\u94a5\u7b7e\u540d"),p.a.createElement("input",{type:"text",className:"form-control",placeholder:"\u8bf7\u8f93\u5165",defaultValue:this.state.pay.stripe_webhook_key,onChange:e=>this.set("pay","stripe_webhook_key",e.target.value)})))))),p.a.createElement("div",{className:"block block-rounded block-bordered"},p.a.createElement("div",{className:"block-header block-header-default"},p.a.createElement("h3",{className:"block-title"},"BitpayX"),p.a.createElement("div",{className:"block-options"},p.a.createElement(s["a"],{type:"primary",onClick:()=>this.submit("pay")},"\u4fdd\u5b58"))),p.a.createElement("div",{className:"block-content"},p.a.createElement("div",{className:"row"},p.a.createElement("div",{className:"col-lg-8 col-xl-5"},p.a.createElement("div",{className:"alert alert-primary",role:"alert"},p.a.createElement("p",{class:"mb-0"},"\u5982\u679c\u4f60\u6ca1\u6709BitpayX\u7684\u4fe1\u606f\uff0c\u8bf7 ",p.a.createElement("a",{className:"alert-link",href:"https://merchants.mugglepay.com/user/register?ref=MP8F751FACEDB8"},"\u7533\u8bf7"),"\u3002")))),p.a.createElement("div",{className:"row push"},p.a.createElement("div",{className:"col-lg-8 col-xl-5"},p.a.createElement("div",{className:"form-group"},p.a.createElement("label",{for:"example-text-input"},"\u542f\u7528"),p.a.createElement("div",null,p.a.createElement(i["a"],{checked:parseInt(this.state.pay.bitpayx_enable),onChange:e=>this.set("pay","bitpayx_enable",e?1:0)}))),p.a.createElement("div",{className:"form-group"},p.a.createElement("label",{for:"example-text-input"},"AppSecret"),p.a.createElement("input",{type:"text",className:"form-control",placeholder:"\u8bf7\u8f93\u5165",defaultValue:this.state.pay.bitpayx_appsecret,onChange:e=>this.set("pay","bitpayx_appsecret",e.target.value)})))))))))}}}}]); |