← Back
Editing: row-reinforce-legacy.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 r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function r(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?e(Object(o),!0).forEach((function(e){n(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function n(e,r,n){return(r=function(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==t(r)?r:r+""}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return r};var e,r={},n=Object.prototype,a=n.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(e){s=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),u=new N(n||[]);return i(a,"_invoke",{value:P(t,r,u)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var d="suspendedStart",y="suspendedYield",m="executing",v="completed",g={};function b(){}function w(){}function _(){}var x={};s(x,c,(function(){return this}));var j=Object.getPrototypeOf,O=j&&j(j(T([])));O&&O!==n&&a.call(O,c)&&(x=O);var L=_.prototype=b.prototype=Object.create(x);function E(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function k(e,r){function n(o,i,u,c){var l=h(e[o],e,i);if("throw"!==l.type){var f=l.arg,s=f.value;return s&&"object"==t(s)&&a.call(s,"__await")?r.resolve(s.__await).then((function(t){n("next",t,u,c)}),(function(t){n("throw",t,u,c)})):r.resolve(s).then((function(t){f.value=t,u(f)}),(function(t){return n("throw",t,u,c)}))}c(l.arg)}var o;i(this,"_invoke",{value:function(t,e){function a(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(a,a):a()}})}function P(t,r,n){var o=d;return function(a,i){if(o===m)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var u=n.delegate;if(u){var c=S(u,n);if(c){if(c===g)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var l=h(t,r,n);if("normal"===l.type){if(o=n.done?v:y,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function S(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,S(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function V(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function G(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(V,this),this.reset(!0)}function T(r){if(r||""===r){var n=r[c];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,i=function t(){for(;++o<r.length;)if(a.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return i.next=i}}throw new TypeError(t(r)+" is not iterable")}return w.prototype=_,i(L,"constructor",{value:_,configurable:!0}),i(_,"constructor",{value:w,configurable:!0}),w.displayName=s(_,f,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,s(t,f,"GeneratorFunction")),t.prototype=Object.create(L),t},r.awrap=function(t){return{__await:t}},E(k.prototype),s(k.prototype,l,(function(){return this})),r.AsyncIterator=k,r.async=function(t,e,n,o,a){void 0===a&&(a=Promise);var i=new k(p(t,e,n,o),a);return r.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},E(L),s(L,f,"Generator"),s(L,c,(function(){return this})),s(L,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=T,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(G),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=a.call(i,"catchLoc"),l=a.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),G(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;G(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},r}function a(t,e,r,n,o,a,i){try{var u=t[a](i),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function i(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function u(t){a(i,n,o,u,c,"next",t)}function c(t){a(i,n,o,u,c,"throw",t)}u(void 0)}))}}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./index-legacy103.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./index-legacy101.js?v=VERSION_NUMBER","./firewall-legacy.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER"],(function(t,e){"use strict";var n,a,u,c,l,f,s,p,h,d,y,m,v,g,b,w,_,x,j,O,L,E,k,P,S,V,G,N,T,D;return{setters:[function(t){n=t.K,a=t.l,u=t.k,c=t.j,l=t.W},function(t){f=t._},function(t){s=t.c,p=t.U,h=t.r,d=t.e,y=t.p,m=t.G,v=t.q,g=t.v,b=t.A,w=t.B,_=t.H,x=t.x,j=t.P,O=t.D,L=t.a9,E=t.ai,k=t.aj,P=t.a7},function(t){S=t._},function(t){V=t.bC,G=t.bD,N=t.bE},function(t){T=t.u},function(t){D=t.f},null,null],execute:function(){var e={class:"px-[1.6rem] py-[1.6rem]"};t("default",s({__name:"row-reinforce",props:{compData:{default:function(){return{}}}},setup:function(t){var s=t.compData.key,F=p(!1),q={a:"追加",i:"只读"},C=p([]),U=h(),A=p(!1),I=h({path:"",chattr:"i",d_mode:""}),H=[{content:"【只读】无法修改、创建、删除文件和目录"},{content:"【追加】只能追加内容,不能删除或修改原有内容"},{content:"【权限】设置文件或目录在受保护状态下的权限(非继承),关闭保护后权限自动还原"},{content:"【如何填写权限】请填写Linux权限代号,如:644、755、600、555等,如果不填写,则使用文件原来的权限"}],R={path:[{required:!0,message:"请输入被保护的文件或路径",trigger:["blur","change"]}],d_mode:[{required:!0,message:"请输入权限",trigger:["blur","change"]}]},Y=function(){var t=i(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n({loading:F,request:V({s_key:s}),data:{paths:[Array,C]}});case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),B=function(){var t=i(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n({request:G({s_key:s,path:e.path}),loading:"正在删除保护配置,请稍后...",message:!0});case 2:Y();case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),K=function(){D({type:"all",path:"/www/wwwroot",change:function(t){I.value.path=t}})},W=function(){var t=i(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,U.value.validate();case 2:return t.next=4,n({loading:"正在添加保护文件/目录,请稍后...",request:N(r(r({},I.value),{},{s_key:s})),message:!0});case 4:A.value=!1,Y(),I.value={path:"",chattr:"i",d_mode:""};case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),z=[{label:"路径",prop:"path",showOverflowTooltip:!0},{label:"模式",prop:"chattr",render:function(t){return q[t.chattr]}},{label:"权限",prop:"s_mode",render:function(t,e){return d("span",null,[t.s_mode+(t.s_mode===t.d_mode?"":" >> "+t.d_mode)])}},{label:"状态",prop:"state",render:function(t){return d("span",{class:"text-".concat(t.state?"primary":"danger")},[t.state?"已保护":"未保护"])}},T([{title:"删除",onClick:B}])];return y((function(){return Y()})),function(t,r){var n=O,o=a,i=S,s=L,p=E,h=k,y=u,V=P,G=c,N=f,T=l,D=m("bt-loading");return v(),g("div",e,[d(N,null,{"header-left":b((function(){return[d(n,{type:"primary",onClick:r[0]||(r[0]=function(t){return A.value=!0})},{default:b((function(){return r[5]||(r[5]=[w(" 添加保护文件/目录 ")])})),_:1})]})),content:b((function(){return[_(d(o,{"max-height":"400",column:z,data:x(C)},null,8,["data"]),[[D,x(F)],[D,"正在加载中,请稍后...","title"]])]})),popup:b((function(){return[d(G,{title:"添加保护文件/目录",modelValue:x(A),"onUpdate:modelValue":r[4]||(r[4]=function(t){return j(A)?A.value=t:null}),area:42,onConfirm:W,showFooter:""},{default:b((function(){return[d(V,{class:"p-2rem",ref_key:"addReinforceFormRef",ref:U,model:x(I),rules:R},{default:b((function(){return[d(s,{label:"路径",prop:"path"},{default:b((function(){return[d(i,{icon:"icon-file_mode",modelValue:x(I).path,"onUpdate:modelValue":r[1]||(r[1]=function(t){return x(I).path=t}),width:"24rem",placeholder:"被保护的文件或路径",onIconClick:K,iconType:"folder"},null,8,["modelValue"])]})),_:1}),d(s,{label:"模式"},{default:b((function(){return[d(h,{modelValue:x(I).chattr,"onUpdate:modelValue":r[2]||(r[2]=function(t){return x(I).chattr=t}),class:"!w-[24rem]"},{default:b((function(){return[d(p,{label:"只读",value:"i"}),d(p,{label:"追加",value:"a"})]})),_:1},8,["modelValue"])]})),_:1}),d(s,{label:"权限",prop:"d_mode"},{default:b((function(){return[d(y,{modelValue:x(I).d_mode,"onUpdate:modelValue":r[3]||(r[3]=function(t){return x(I).d_mode=t}),width:"24rem",placeholder:"请输入权限",clearable:""},null,8,["modelValue"])]})),_:1})]})),_:1},8,["model"])]})),_:1},8,["modelValue"])]})),_:1}),d(T,{options:H,class:"mx-[1.6rem] mt-[1.6rem]"})])}}}))}}}))}();
Save File
Cancel