File: /www/server/panel/BTPanel/static/js/useController-legacy16.js
!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function n(t){for(var n=1;n<arguments.length;n++){var a=null!=arguments[n]?arguments[n]:{};n%2?e(Object(a),!0).forEach(function(e){r(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}function r(e,n,r){return(n=function(e){var n=function(e,n){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,n||"default");if("object"!=t(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==t(n)?n:n+""}(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function a(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,a,o){var i=r&&r.prototype instanceof s?r:s,l=Object.create(i.prototype);return u(l,"_invoke",function(n,r,a){var u,o,i,s=0,l=a||[],f=!1,v={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return u=e,o=0,i=t,v.n=n,c}};function p(n,r){for(o=n,i=r,e=0;!f&&s&&!a&&e<l.length;e++){var a,u=l[e],p=v.p,d=u[2];n>3?(a=d===r)&&(i=u[(o=u[4])?5:(o=3,3)],u[4]=u[5]=t):u[0]<=p&&((a=n<2&&p<u[1])?(o=0,v.v=r,v.n=u[1]):p<d&&(a=n<3||u[0]>r||r>d)&&(u[4]=n,u[5]=r,v.n=d,o=0))}if(a||n>1)return c;throw f=!0,r}return function(a,l,d){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,d),o=l,i=d;(e=o<2?t:i)||!f;){u||(o?o<3?(o>1&&(v.n=-1),p(o,i)):v.n=i:v.v=i);try{if(s=2,u){if(o||(a="next"),e=u[a]){if(!(e=e.call(u,i)))throw TypeError("iterator result is not an object");if(!e.done)return e;i=e.value,o<2&&(o=0)}else 1===o&&(e=u.return)&&e.call(u),o<2&&(i=TypeError("The iterator does not provide a '"+a+"' method"),o=1);u=t}else if((e=(f=v.n<0)?i:n.call(r,v))!==c)break}catch(e){u=t,o=1,i=e}finally{s=1}}return{value:e,done:f}}}(n,a,o),!0),l}var c={};function s(){}function l(){}function f(){}e=Object.getPrototypeOf;var v=[][r]?e(e([][r]())):(u(e={},r,function(){return this}),e),p=f.prototype=s.prototype=Object.create(v);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,u(t,o,"GeneratorFunction")),t.prototype=Object.create(p),t}return l.prototype=f,u(p,"constructor",f),u(f,"constructor",l),l.displayName="GeneratorFunction",u(f,o,"GeneratorFunction"),u(p),u(p,o,"Generator"),u(p,r,function(){return this}),u(p,"toString",function(){return"[object Generator]"}),(a=function(){return{w:i,m:d}})()}function u(t,e,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(t){a=0}u=function(t,e,n,r){function o(e,n){u(t,e,function(t){return this._invoke(e,n,t)})}e?a?a(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(o("next",0),o("throw",1),o("return",2))},u(t,e,n,r)}function o(t,e,n,r,a,u,o){try{var i=t[u](o),c=i.value}catch(t){return void n(t)}i.done?e(c):Promise.resolve(c).then(r,a)}function i(t){return function(){var e=this,n=arguments;return new Promise(function(r,a){var u=t.apply(e,n);function i(t){o(u,r,a,i,c,"next",t)}function c(t){o(u,r,a,i,c,"throw",t)}i(void 0)})}}System.register(["./utils-lib-legacy.js?v=1777008528","./site-legacy.js?v=1777008528","./base-lib-legacy.js?v=1777008528","./index-legacy3.js?v=1777008528","./useStore-legacy2.js?v=1777008528"],function(t,e){"use strict";var r,u,o,c,s,l,f,v,p,d,m,h,y,g,b,w,j,O,E,R,_,S,P;return{setters:[function(t){r=t.k,u=t.cX,o=t.c,c=t.e,s=t._,l=t.w,f=t.a2,v=t.M},function(t){p=t.modifyRedirect,d=t.removeRedirect,m=t.getRedirectFile,h=t.getFileBody,y=t.getRedirectList,g=t.createRedirect,b=t.getProjectDomain,w=t.setErrorRedirect,j=t.MulDelRedirect},function(t){O=t.aI,E=t.aJ,R=t.r},function(t){_=t.b},function(t){S=t.u,P=t.S}],execute:function(){var x=E("SITE-REDIRECT-STORE",function(){var t=S(),e=t.siteType,n=(t.siteInfo,R(!1)),o=function(){var t=i(a().m(function t(n){var u,o;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,r({loading:"正在修改,请稍后...",request:p(n,e.value),message:!0});case 1:return u=t.v,t.a(2,{status:u.status,msg:u.msg});case 2:return t.p=2,o=t.v,console.log(o),t.a(2,{status:!1,msg:"修改状态失败"})}},t,null,[[0,2]])}));return function(e){return t.apply(this,arguments)}}(),c=function(){var t=i(a().m(function t(n){var u,o;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,r({loading:"正在删除,请稍后...",request:d(n,e.value),message:!0});case 1:return u=t.v,t.a(2,{status:u.status,msg:u.msg});case 2:return t.p=2,o=t.v,console.log(o),t.a(2,{status:!1,msg:"删除重定向失败"})}},t,null,[[0,2]])}));return function(e){return t.apply(this,arguments)}}(),s=function(){var t=i(a().m(function t(n){var u,o,i;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,u=["php","html","proxy"].includes(e.value),t.n=1,r({loading:"正在获取内容,请稍候...",request:u?m(n,e.value):h(n)});case 1:if(o=t.v,"php"!==e.value&&"html"!==e.value){t.n=2;break}return t.a(2,{data:{content:o.data[0].data,redirect_conf_file:o.data[1]},status:!0});case 2:return t.a(2,{data:{content:o.data.data,redirect_conf_file:n.path},status:!0});case 3:return t.p=3,i=t.v,console.log(i),t.a(2,{status:!1,msg:"获取配置文件失败"})}},t,null,[[0,3]])}));return function(e){return t.apply(this,arguments)}}(),l=function(){var t=i(a().m(function t(n){var u,o;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,r({request:y(n,e.value),data:Array});case 1:return u=t.v,t.a(2,{data:u,total:u.length,other:{}});case 2:return t.p=2,o=t.v,console.log(o),t.a(2,{data:[],total:0,other:{}})}},t,null,[[0,2]])}));return function(e){return t.apply(this,arguments)}}(),f=function(){var t=i(a().m(function t(n,u){var o,i;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,r({loading:"正在提交,请稍后...",request:u?p(n,e.value):g(n,e.value),message:!0});case 1:return o=t.v,t.a(2,{status:o.status,msg:o.msg});case 2:return t.p=2,i=t.v,console.log(i),t.a(2,{status:!1,msg:"添加重定向失败"})}},t,null,[[0,2]])}));return function(e,n){return t.apply(this,arguments)}}(),v=function(){var t=i(a().m(function t(n){var o,i,c,s;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,o=["php","html"].includes(e.value),t.n=1,r({request:o?u(n):b(n,e.value)});case 1:if(i=t.v,c=i.data,"proxy"!==e.value){t.n=2;break}return t.a(2,{data:c.data.domain_list,status:!0});case 2:return t.a(2,{data:Array.isArray(c)?c:c.data,status:!0});case 3:t.n=5;break;case 4:return t.p=4,s=t.v,console.log(s),t.a(2,{status:!1,msg:"获取域名失败"});case 5:return t.a(2)}},t,null,[[0,4]])}));return function(e){return t.apply(this,arguments)}}(),j=function(){var t=i(a().m(function t(n,u){var o,i;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,r({loading:"正在保存,请稍后...",request:u||"html"===e.value?p(n,e.value):w(n),message:!0});case 1:return o=t.v,t.a(2,{status:o.status,msg:o.msg});case 2:return t.p=2,i=t.v,console.log(i),t.a(2,{status:!1,msg:"添加错误重定向失败"})}},t,null,[[0,2]])}));return function(e,n){return t.apply(this,arguments)}}();return{getDomainEvent:v,changeStatusEvent:o,delRedirectEvent:c,getRedirectFileEvent:s,getRedirectDataEvent:l,submitRedirectEvent:f,submitErrorRedirectEvent:j,isRefreshList:n}}),T=t("u",function(){return O(x())}),D=o().plugin,k=S(),I=k.siteInfo,F=k.siteType,L=k.isBindExtranet,N=P().saveFileEvent,U=T().isRefreshList,q=x(),G=q.getDomainEvent,J=q.changeStatusEvent,A=q.delRedirectEvent,M=q.getRedirectDataEvent,B=q.getRedirectFileEvent,C=q.submitRedirectEvent,X=q.submitErrorRedirectEvent,z=t("d",R(!1)),H=t("c",R(!1)),K=t("b",R("")),Q=R(""),V=R(!1),W=R(),Y=R(!1),Z=t("n",R()),$=t("r",R()),tt=(t("h",[{content:"设置域名重定向后,该域名的404重定向将失效"},{content:"取消重定向时,由于浏览器会缓存重定向信息,在清除缓存前,浏览器仍会根据缓存自动重定向"}]),t("o",[{content:"重定向类型:表示访问选择的“域名”或输入的“路径”时将会重定向到指定URL"},{content:"目标URL:可以填写你需要重定向到的站点,目标URL必须为可正常访问的URL,否则将返回错误"},{content:"重定向方式:使用301表示永久重定向,使用302表示临时重定向"},{content:"保留URI参数:表示重定向后访问的URL是否带有子路径或参数如设置访问http://b.com"},{content:"重定向到http://a.com 保留URI参数: http://b.com/1.html ---\x3e http://a.com/1.html"},{content:"不保留URI参数:http://b.com/1.html ---\x3e http://a.com"}]),function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F.value,r=n(n({},t),{},{type:t.type?0:1,redirectdomain:JSON.stringify(t.redirectdomain)});return delete r.redirect_conf_file,"proxy"===e&&(r.site_name=I.value.name,delete r.sitename),r}),et=(t("k",function(){var t=i(a().m(function t(e,r,u,o){var c,s,l,v;return a().w(function(t){for(;;)switch(t.n){case 0:return c=o.label,s=o.value,l=new Map([["start","批量启用选中的规则后,配置的重定向域名/目录将会生效"],["stop","批量停用选中的规则后,配置的重定向域名/目录将会失效"],["delete","批量删除当前选中的规则后,配置的重定向域名/目录将会彻底失效"]]),v=function(){var t=i(a().m(function t(e){var r,u,o,i,c;return a().w(function(t){for(;;)switch(t.n){case 0:r=new Map([["start",p],["stop",p],["delete",j]]),u=e.redirectname,o=r.get(s),c=s,t.n="start"===c||"stop"===c?1:"delete"===c?3:5;break;case 1:if(!o){t.n=3;break}return i=tt(n(n({},e),{},{type:"stop"===s?1:0})),t.n=2,o(i,F.value);case 2:case 4:return t.a(2,t.v);case 3:if(!o){t.n=5;break}return t.n=4,o({site_id:I.value.id,redirectnames:u},F.value);case 5:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}(),t.n=1,e({title:"批量".concat(c),content:"".concat(l.get(s),",是否继续操作?"),column:[{label:"规则名称",render:function(t){var e;return t.errorpage?"404错误页面":"domain"===t.domainorpath?null===(e=f(t.redirectdomain,"array",[]))||void 0===e?void 0:e.join("、"):t.redirectpath}},_()],onConfirm:function(){var t=i(a().m(function t(){return a().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,r(v);case 1:return U.value=!0,t.a(2,!1)}},t)}));return function(){return t.apply(this,arguments)}}()});case 1:return t.a(2)}},t)}));return function(e,n,r,a){return t.apply(this,arguments)}}()),t("f",function(){var t=i(a().m(function t(e){var n,r,u;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,n=tt(e),t.n=1,J(n);case 1:return(r=t.v).status&&(U.value=!0),t.a(2,r);case 2:return t.p=2,u=t.v,console.log(u),t.a(2,{status:!1,msg:"修改状态失败"})}},t,null,[[0,2]])}));return function(e){return t.apply(this,arguments)}}()),t("j",function(){var t=i(a().m(function t(e){var n,r,u,o,i,c,s,v=arguments;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:return n=v.length>1&&void 0!==v[1]?v[1]:F.value,t.p=1,t.n=2,l({title:"删除重定向【".concat("domain"===e.domainorpath?null===(r=f(e.redirectdomain,"array",[]))||void 0===r?void 0:r.join("、"):e.redirectpath,"】"),content:"删除选中的规则后,配置的重定向域名/目录将指向源地址,是否继续操作?",icon:"warning-filled",type:"calc"});case 2:return u=I.value.name,o=e.redirectname,i={proxy:{site_name:u,redirectname:o},default:{sitename:u,redirectname:o}},t.n=3,A(i[n]||i.default);case 3:return(c=t.v).status&&(U.value=!0),t.a(2,c);case 4:return t.p=4,s=t.v,console.log(s),t.a(2,{status:!1,msg:"删除重定向失败"})}},t,null,[[1,4]])}));return function(e){return t.apply(this,arguments)}}()),t("g",function(){var t=i(a().m(function t(e){var n,r,u,o,i,c;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,H.value=!0,n=["php","html"].includes(F.value),r={},r=n?{sitename:I.value.name,redirectname:e.redirectname,webserver:D.value.webserver}:{path:e.redirect_conf_file},t.n=1,B(r);case 1:(u=t.v).status?(z.value=!0,K.value=null===(o=u.data)||void 0===o?void 0:o.content,Q.value=null===(i=u.data)||void 0===i?void 0:i.redirect_conf_file):(v.error(u.msg),z.value=!1),H.value=!1,t.n=3;break;case 2:t.p=2,c=t.v,console.log(c),z.value=!1;case 3:return t.a(2)}},t,null,[[0,2]])}));return function(e){return t.apply(this,arguments)}}()),t("s",i(a().m(function t(){var e,n,r=arguments;return a().w(function(t){for(;;)switch(t.n){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{data:K.value,encoding:"utf-8",path:Q.value},t.n=1,N(e);case 1:return n=t.v,t.a(2,n)}},t)}))),function(){var t=i(a().m(function t(){var e,n,r,u,o=arguments;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:return e=o.length>0&&void 0!==o[0]&&o[0],n={sitename:I.value.name},t.p=1,t.n=2,M(n);case 2:return r=t.v,e&&v.success("刷新成功"),V.value=!1,W.value=null,Array.isArray(r.data)&&r.data.forEach(function(t){t.errorpage&&(V.value=!0,W.value=t)}),t.a(2,r);case 3:return t.p=3,u=t.v,console.log(u),t.a(2,{data:[],total:0,other:{}})}},t,null,[[1,3]])}));return function(){return t.apply(this,arguments)}}()),nt=(t("e",function(t){Y.value=!!t,$.value=t||!1,c({title:"".concat(t?"编辑":"添加","重定向").concat(t?"【".concat(t.sitename,"】"):""),area:68,component:function(){return s(function(){return e.import("./add-redirect-legacy.js?v=1777008528")},void 0,e.meta.url)},btn:!0})}),t("a",function(t){!t&&V.value&&(t=W.value),$.value=t||!1,c({title:"404重定向设置",area:42,component:function(){return s(function(){return e.import("./error-redirect-legacy.js?v=1777008528")},void 0,e.meta.url)},compData:{rowData:t,siteType:F.value,refresh:function(){return U.value=!0}},btn:!0})}),t("i",i(a().m(function t(){var e,r,u,o,i,c;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,r=I.value,u=r.project_type,o=r.project_config,L.value=!(null==o||!o.bind_extranet),["php","html","proxy","phpasync"].includes(u)&&(L.value=!0),t.n=1,et();case 1:return i=t.v,at.value=i.data,t.a(2,n(n({},i),{},{data:(null===(e=i.data)||void 0===e?void 0:e.map(function(t,e){return n(n({},t),{},{id:e+1})}))||[]}));case 2:t.p=2,c=t.v,console.log(c);case 3:return t.a(2)}},t,null,[[0,2]])}))),function(t){var e=I.value.name,r=t.holdpath,a=t.type,u=t.redirectdomain,o=n(n({},t),{},{sitename:e,holdpath:r?"1":"0",type:a?"1":"0",redirectdomain:JSON.stringify(u),redirectname:t.redirectname||(new Date).getTime()});return"proxy"===F.value&&(o.site_name=e,delete o.sitename),o}),rt=(t("l",function(){var t=i(a().m(function t(e){var n,r,u;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,n=nt(e),t.n=1,C(n,Y.value);case 1:return(r=t.v).status&&(U.value=!0),t.a(2,r.status);case 2:return t.p=2,u=t.v,console.log(u),t.a(2,!1)}},t,null,[[0,2]])}));return function(e){return t.apply(this,arguments)}}()),function(t){if(t)return{table:"domain",list:"True",search:I.value.id};var e={python:{data:JSON.stringify({name:I.value.name})},phpasync:{data:JSON.stringify({sitename:I.value.name})},proxy:{id:I.value.id,site_name:I.value.name},default:{data:JSON.stringify({project_name:I.value.name})}};return e[F.value]||e.default}),at=R([]),ut=(t("m",i(a().m(function t(){var e,n,r,u,o;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,e=["php","html"].includes(F.value),n=rt(e),t.n=1,G(n);case 1:return r=t.v,Y.value?Z.value=r.data:(u=at.value.map(function(t){return t.redirectdomain}).flat(),Z.value=r.data.filter(function(t){return!u.includes(t.name)})),Z.value=Z.value.filter(function(t,e,n){return e===n.findIndex(function(e){return e.name===t.name})}),t.a(2,r);case 2:return t.p=2,o=t.v,console.log(o),t.a(2,{status:!1,msg:"获取域名失败"})}},t,null,[[0,2]])}))),function(t){var e,r=I.value.name,a=n(n({},t),{},{sitename:r,type:Number(t.type)});return a.redirectname=(null===(e=W.value)||void 0===e?void 0:e.redirectname)||(new Date).getTime(),"html"===F.value&&(a.domainorpath="path",a.holdpath=999,a.redirectpath=""),"/"===a.topath&&(a.tourl=""),a});t("p",function(){var t=i(a().m(function t(e){var n,r,u;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,n=ut(e),t.n=1,X(n,V.value);case 1:return r=t.v,U.value=!0,t.a(2,r.status);case 2:return t.p=2,u=t.v,console.log(u),t.a(2,!1)}},t,null,[[0,2]])}));return function(e){return t.apply(this,arguments)}}())}}})}();