← Back
Editing: index-legacy35.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){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}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,u=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function p(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(e){p=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof x?e:x,a=Object.create(o.prototype),i=new T(n||[]);return u(a,"_invoke",{value:L(t,r,i)}),a}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=f;var m="suspendedStart",v="suspendedYield",h="executing",y="completed",g={};function x(){}function b(){}function k(){}var w={};p(w,c,(function(){return this}));var _=Object.getPrototypeOf,S=_&&_(_(V([])));S&&S!==n&&a.call(S,c)&&(w=S);var C=k.prototype=x.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){p(t,e,(function(t){return this._invoke(e,t)}))}))}function D(e,r){function n(o,u,i,c){var s=d(e[o],e,u);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==t(p)&&a.call(p,"__await")?r.resolve(p.__await).then((function(t){n("next",t,i,c)}),(function(t){n("throw",t,i,c)})):r.resolve(p).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,c)}))}c(s.arg)}var o;u(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 L(t,r,n){var o=m;return function(a,u){if(o===h)throw Error("Generator is already running");if(o===y){if("throw"===a)throw u;return{value:e,done:!0}}for(n.method=a,n.arg=u;;){var i=n.delegate;if(i){var c=P(i,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===m)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var s=d(t,r,n);if("normal"===s.type){if(o=n.done?y:v,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=y,n.method="throw",n.arg=s.arg)}}}function P(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,P(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=d(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var u=a.arg;return u?u.done?(r[t.resultName]=u.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):u:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function q(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 O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(q,this),this.reset(!0)}function V(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,u=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 u.next=u}}throw new TypeError(t(r)+" is not iterable")}return b.prototype=k,u(C,"constructor",{value:k,configurable:!0}),u(k,"constructor",{value:b,configurable:!0}),b.displayName=p(k,l,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,k):(t.__proto__=k,p(t,l,"GeneratorFunction")),t.prototype=Object.create(C),t},r.awrap=function(t){return{__await:t}},j(D.prototype),p(D.prototype,s,(function(){return this})),r.AsyncIterator=D,r.async=function(t,e,n,o,a){void 0===a&&(a=Promise);var u=new D(f(t,e,n,o),a);return r.isGeneratorFunction(e)?u:u.next().then((function(t){return t.done?t.value:u.next()}))},j(C),p(C,l,"Generator"),p(C,c,(function(){return this})),p(C,"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=V,T.prototype={constructor:T,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(O),!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 i.type="throw",i.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],i=u.completion;if("root"===u.tryLoc)return n("end");if(u.tryLoc<=this.prev){var c=a.call(u,"catchLoc"),s=a.call(u,"finallyLoc");if(c&&s){if(this.prev<u.catchLoc)return n(u.catchLoc,!0);if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else if(c){if(this.prev<u.catchLoc)return n(u.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return n(u.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 u=o?o.completion:{};return u.type=t,u.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(u)},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),O(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;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:V(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},r}function a(t,e,r,n,o,a,u){try{var i=t[a](u),c=i.value}catch(t){return void r(t)}i.done?e(c):Promise.resolve(c).then(n,o)}function u(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var u=t.apply(e,r);function i(t){a(u,n,o,i,c,"next",t)}function c(t){a(u,n,o,i,c,"throw",t)}i(void 0)}))}}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./index-legacy140.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./form-item-legacy.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./index-legacy116.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./ace-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER"],(function(t,r){"use strict";var a,i,c,s,l,p,f,d,m,v,h,y,g,x,b,k,w,_,S,C,j,D,L,P,q,O,T,V,E,N,U,A,F,H,I,z,B,G,J,M,R,$,K,Y,Q,W,X,Z,tt,et,rt,nt,ot,at,ut,it,ct,st,lt,pt;return{setters:[function(t){a=t.ay,i=t.K,c=t.c9,s=t.p,l=t.ca,p=t.M,f=t.n,d=t.cb,m=t.cc,v=t.cd,h=t.L,y=t.ce,g=t.cf,x=t.G,b=t.cg,k=t.ch,w=t.ci,_=t.Q,S=t.ah,C=t.w,j=t.c,D=t.j,L=t.e},function(t){P=t.B},function(t){q=t.r,O=t.c,T=t.aB,V=t.p,E=t.a4,N=t.g,U=t.bm,A=t.G,F=t.H,H=t.x,I=t.q,z=t.v,B=t.y,G=t.e,J=t.F,M=t.a_,R=t.A,$=t.P,K=t.B,Y=t.D,Q=t.al,W=t.S,X=t.z,Z=t.M,tt=t.N,et=t.C},function(t){rt=t.h,nt=t.c,ot=t.b,at=t.f,ut=t.F,it=t.d,ct=t.g,st=t.i},function(t){lt=t.m},function(t){pt=t._},null,null,null,null],execute:function(){var ft=a(),dt=ft.refs,mt=dt.settingData,vt=dt.loading,ht=ft.getSet,yt=ft.getDockerState,gt=q(!1),xt=q(""),bt=q({}),kt=[{name:"主机名",key:"Name"},{name:"系统版本",key:"OperatingSystem"},{name:"架构",key:"Architecture"},{name:"内核版本",key:"KernelVersion"},{name:"CPU核心",key:"NCPU"},{name:"内存大小",key:"MemTotal"},{name:"Docker版本",key:"ServerVersion"},{name:"docker-compose版本",key:"DockerComposeVersion",append:O({name:"UpdateButton",setup:function(){return function(){return T("span",{class:"bt-link ml-[1rem]",onClick:(t=u(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s({title:"更新docker-compose版本",content:"是否更新docker-compose版本?"});case 2:i({request:l(),loading:"正在更新docker-compose版本,请稍后...",success:function(t){t.status?f({title:"更新日志",area:56,btns:!1,component:O({setup:function(){var t=null,e=q(""),r=U(),n=function(n,o){try{var a,u=o.data;e.value+=u,(u.includes("bt_successful")||u.includes("bt_failed"))&&(null===(a=t)||void 0===a||a.close(),r("close"),yt())}catch(c){var i;null===(i=t)||void 0===i||i.close()}};return V((function(){var e;null===(e=t=S({route:"/sock_shell",onMessage:n}))||void 0===e||e.send("tail -f /tmp/update_dk-compose.log")})),E((function(){var e;null===(e=t)||void 0===e||e.close()})),function(){return T("div",{class:"overflow-y-auto"},T(pt,{class:"!h-[40rem]",content:e.value,isHtml:!0}))}}})}):p.error(t.msg)}});case 3:case"end":return t.stop()}}),t)}))),function(){return t.apply(this,arguments)})},"更新");var t}}})},{name:"unix地址",key:"DockerUnixSocket"},{name:"数据目录",key:"DockerRootDir"}],wt=function(t){switch(t){case"MemTotal":return C(bt.value.MemTotal);case"DockerUnixSocket":return mt.value.socket;case"DockerComposeVersion":return mt.value.docker_compose_version;default:return bt.value[t]}},_t=function(){i({request:c({data:JSON.stringify({daemon_json:xt.value})}),message:!0,success:function(t){t.status&&(gt.value=!1)}})},St=function(){var t=u(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,t.t0=!(!mt.value.service_status&&"toggle"===e),!t.t0){t.next=5;break}return t.next=5,s({title:"".concat("reset"===e?"重启":"关闭","Docker服务"),content:"是否".concat("reset"===e?"重启":"关闭","Docker服务?")});case 5:if(vt.value=!0,"reset"!==e){t.next=12;break}return t.next=9,d({data:JSON.stringify({act:"restart"})});case 9:window.location.reload(),t.next=13;break;case 12:i({request:d({data:JSON.stringify({act:mt.value.service_status?"stop":"start"})}),message:!0,success:function(t){t.status&&window.location.reload()}});case 13:t.next=18;break;case 15:t.prev=15,t.t1=t.catch(0);case 18:return t.prev=18,vt.value=!1,t.finish(18);case 21:case"end":return t.stop()}}),t,null,[[0,15,18,21]])})));return function(e){return t.apply(this,arguments)}}(),Ct=function(){var t=u(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,s({title:"修复docker模块",content:"修复docker可能会导致容器异常,修复大约5分钟,是否继续修复?"});case 3:i({request:m(),message:!0,success:function(t){t.status&<()}}),t.next=8;break;case 6:t.prev=6,t.t0=t.catch(0);case 8:case"end":return t.stop()}}),t,null,[[0,6]])})));return function(){return t.apply(this,arguments)}}(),jt=function(){var t=u(o().mark((function t(){var e;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,v();case 3:e=t.sent,f({component:function(){return h((function(){return r.import("./index-legacy229.js?v=VERSION_NUMBER")}),void 0,r.meta.url)},compData:{needForce:!e.status,msg:e.msg},title:"卸载Docker",btn:"确定",area:45}),t.next=9;break;case 7:t.prev=7,t.t0=t.catch(0);case 9:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}(),Dt=function(){var t=u(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:mt.value.monitor_status=e,i({request:y({data:JSON.stringify({act:e?"start":"stop"})}),message:!0,success:ht});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Lt=function(){var t=u(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e,t.next="date"===t.t0?3:5;break;case 3:return i({request:g({data:JSON.stringify({save_date:mt.value.monitor_save_date})}),message:!0,success:ht()}),t.abrupt("break",5);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Pt=function(){var t=u(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:f({component:function(){return h((function(){return r.import("./index-legacy230.js?v=VERSION_NUMBER")}),void 0,r.meta.url)},title:"设置加速URL",area:64,btn:!0,compData:{url:e}});case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),qt=function(){var t=u(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:f({component:function(){return h((function(){return r.import("./index-legacy231.js?v=VERSION_NUMBER")}),void 0,r.meta.url)},title:"设置Compose路径",area:45,btn:!0});case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Ot=function(){var t=u(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,!e){t.next=4;break}return Tt(),t.abrupt("return");case 4:return t.next=6,s({icon:"question-filled",title:e?"开启日志切割":"关闭日志切割",content:"".concat(e?"开启":"关闭","日志切割后需要重启docker,请确保可以重启docker再操作。是否继续?")});case 6:return t.next=8,i({loading:"正在设置日志切割,请稍后...",request:b({log_cutting:e?JSON.stringify({"max-file":mt.value.log_cutting.file,"max-size":"".concat(mt.value.log_cutting.size,"m")}):JSON.stringify({})}),message:!0,success:yt,error:function(){mt.value.log_cutting.status=!e}});case 8:t.next=13;break;case 10:t.prev=10,t.t0=t.catch(0),mt.value.log_cutting.status=!e;case 13:case"end":return t.stop()}}),t,null,[[0,10]])})));return function(e){return t.apply(this,arguments)}}(),Tt=function(){var t,e=x({data:function(){return{"max-file":Number(mt.value.log_cutting.file)||1,"max-size":Number(mt.value.log_cutting.size)||10}},options:function(){return N((function(){return[ot("文件大小","max-size",{attrs:{placeholder:"文件大小",style:"width:27rem;"},slots:{unit:function(){return T("div",{class:"inline-block w-[3rem] text-[#999] mt-[2px] leading-[2rem] text-[12px] ml-[20px]"},"MB")}},rules:[{required:!0,message:"请输入文件大小",trigger:"blur"},{validator:function(t,e,r){e&&/^\d+$/.test(e)?r():r(new Error("请输入正整数"))}}]}),ot("保留份数","max-file",{attrs:{placeholder:"保留份数",style:"width:27rem;"},slots:{unit:function(){return T("div",{class:"inline-block w-[3rem] text-[#999] mt-[2px] leading-[2rem] text-[12px] ml-[20px]"},"份")}},rules:[{required:!0,message:"请输入保留份数",trigger:"blur"},{validator:function(t,e,r){e&&/^\d+$/.test(e)?r():r(new Error("请输入正整数"))}}]}),at("",[{content:"当前配置只会影响新创建的容器,已经创建的容器需要重新创建使配置生效"},{content:"如果你的容器中有重要数据,确保在执行重建操作之前进行备份"}])]}))},submit:(t=u(o().mark((function t(e,r){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,r();case 3:return t.next=5,i({request:b({log_cutting:JSON.stringify({"max-file":e.value["max-file"],"max-size":"".concat(e.value["max-size"],"m")})}),message:!0,loading:"正在设置日志切割,请稍后..."});case 5:if(!t.sent.status){t.next=9;break}return yt(),t.abrupt("return",!0);case 9:return t.abrupt("return",!1);case 12:return t.prev=12,t.t0=t.catch(0),t.abrupt("return",!1);case 15:case"end":return t.stop()}}),t,null,[[0,12]])}))),function(e,r){return t.apply(this,arguments)})}),r=e.BtForm,n=e.submit;return f({component:function(){return T("div",{class:"p-[1.6rem]"},T(r))},title:"设置日志切割",area:45,btn:!0,onConfirm:n,onCancel:function(){yt()}})},Vt=function(){var t=u(o().mark((function t(e,r){var a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.prev=0,a="",t.t0=e,t.next="iptables"===t.t0?5:"live_restore"===t.t0?7:9;break;case 5:return a="iptables",t.abrupt("break",9);case 7:return a="live_restore",t.abrupt("break",9);case 9:return t.next=11,s({icon:"question-filled",title:r?"开启".concat(a):"关闭".concat(a),content:"".concat(r?"开启":"关闭").concat(a,"后需要重启docker,请确保可以重启docker再操作。是否继续?")});case 11:return t.next=13,i({loading:"正在设置".concat(a,",请稍后..."),request:b(n({},e,r?1:0)),message:!0,success:yt,error:function(){mt.value[e]=!r}});case 13:t.next=18;break;case 15:t.prev=15,t.t1=t.catch(0),mt.value[e]=!r;case 18:case"end":return t.stop()}}),t,null,[[0,15]])})));return function(e,r){return t.apply(this,arguments)}}(),Et=function(){var t=u(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,s({icon:"question-filled",title:"设置cgroup driver",content:"设置cgroup driver后需要重启docker,请确保可以重启docker再操作。是否继续?"});case 3:return t.next=5,i({loading:"正在设置cgroup driver,请稍后...",request:b({driver:e}),message:!0,success:yt});case 5:t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),yt();case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e){return t.apply(this,arguments)}}(),Nt=function(){return f({component:function(){return h((function(){return r.import("./index-legacy232.js?v=VERSION_NUMBER")}),void 0,r.meta.url)},title:"ipv6设置",btn:"确定",area:60})},Ut=function(){var t=u(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,s({icon:"question-filled",title:e?"开启IPV6":"关闭IPV6",content:"".concat(e?"开启":"关闭","IPV6后需要重启docker,请确保可以重启docker再操作。是否继续?")});case 3:return t.next=5,i({loading:"正在设置IPV6,请稍后...",request:b({status:e?1:0}),message:!0,success:yt,error:function(){mt.value.ipv6=!e}});case 5:t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),mt.value.ipv6=!e;case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e){return t.apply(this,arguments)}}(),At=function(){var t=u(o().mark((function t(e){var r,n,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!1===e){t.next=5;break}return r=x({data:function(){return{http_proxy:mt.value.proxy.http_proxy||"http://",https_proxy:mt.value.proxy.https_proxy||"https://",no_proxy:mt.value.proxy.no_proxy||"localhost,127.0.0.1"}},options:function(t){return N((function(){return[ot("HTTP代理","http_proxy",{attrs:{placeholder:"请输入HTTP代理地址",style:"width:32rem",onInput:function(e){var r=e.replace(/^http:\/\//,"");t.value.https_proxy="https://".concat(r)}},rules:[{required:!0,message:"请输入HTTP代理地址",trigger:"blur"},{pattern:/^http:\/\/.+/,message:"HTTP代理必须以http://开头",trigger:"blur"}]}),ot("HTTPS代理","https_proxy",{attrs:{placeholder:"请输入HTTPS代理地址",style:"width:32rem"},rules:[{required:!0,message:"请输入HTTPS代理地址",trigger:"blur"},{pattern:/^https?:\/\/.+/,message:"HTTPS代理必须以http://或https://开头",trigger:"blur"}]}),ot("不代理的地址","no_proxy",{attrs:{placeholder:"请输入无需代理的地址,多个地址用逗号分隔",style:"width:32rem"}}),ut((function(){return T("span",{class:"text-[#999] mt-[2px] leading-[2rem] text-[12px] ml-[20px]"},"*设置代理后需要重启Docker服务才能生效")})),ut((function(){return T("div",{class:"text-[#999] mt-[2px] leading-[2rem] text-[12px] ml-[20px]"},"*http示例:http://127.0.0.1:8888")})),ut((function(){return T("div",{class:"text-[#999] mt-[2px] leading-[2rem] text-[12px] ml-[20px]"},"*https示例:https://127.0.0.1:8888")}))]}))},submit:function(){var t=u(o().mark((function t(e,r){var n,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,r();case 3:return t.next=5,s({icon:"question-filled",title:"设置Docker代理",content:"设置代理后需要重启docker,请确保可以重启docker再操作。是否继续?"});case 5:return n={http_proxy:e.value.http_proxy,https_proxy:e.value.https_proxy,no_proxy:e.value.no_proxy},t.next=8,i({loading:"正在设置Docker代理,请稍后...",request:b({proxy_settings:JSON.stringify(n)}),message:!0,success:yt});case 8:return a=t.sent,t.abrupt("return",a.status);case 12:return t.prev=12,t.t0=t.catch(0),t.abrupt("return",!1);case 15:case"end":return t.stop()}}),t,null,[[0,12]])})));return function(e,r){return t.apply(this,arguments)}}()}),n=r.BtForm,a=r.submit,t.abrupt("return",f({component:function(){return T("div",{class:"p-2rem"},T(n))},title:"Docker代理设置",area:50,btn:"确定",onConfirm:a,onCancel:function(){yt()}}));case 5:return t.prev=5,t.next=8,s({icon:"question-filled",title:"关闭Docker代理",content:"是否关闭Docker代理?"});case 8:return t.next=10,i({loading:"正在关闭Docker代理?,请稍后...",request:b({proxy_settings:JSON.stringify({})}),message:!0,success:yt,error:function(){yt()}});case 10:t.next=15;break;case 12:t.prev=12,t.t0=t.catch(5),mt.value.proxy.status=!e;case 15:case"end":return t.stop()}}),t,null,[[5,12]])})));return function(e){return t.apply(this,arguments)}}(),Ft=function(t){return rt("",(function(){return T("span",{class:"text-[#999] mt-[2px] leading-[2rem] text-[12px] ml-[20px]"},"".concat(t))}))},Ht=function(){ht(!1),i({request:k(),success:function(t){bt.value=t.data}})},It=function(){var t=u(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,e&&"string"==typeof e&&/^\/.+/.test(e)){t.next=4;break}return p.error("请输入有效的目录路径!"),t.abrupt("return");case 4:return t.next=6,s({title:"设置应用商店目录",content:"修改应用商店目录将会重启面板,是否继续?"});case 6:return t.next=8,i({request:w({path:e}),loading:"正在设置应用商店目录,请稍后...",success:function(t){t.status||p.error(t.msg)}});case 8:return t.next=10,i({loading:"正在重启面板,请稍候...",request:_(),message:!0,success:function(t){t.status&&setTimeout((function(){localStorage.clear(),sessionStorage.clear(),window.location.reload()}),1e3)}});case 10:t.next=16;break;case 12:return t.prev=12,t.t0=t.catch(0),t.abrupt("return",!1);case 16:case"end":return t.stop()}}),t,null,[[0,12]])})));return function(e){return t.apply(this,arguments)}}(),zt={class:"module-ui mb-16px !mt-0",shadow:"never",header:"全局设置","body-style":{padding:0,display:"flex",minHeight:"5.2rem"}},Bt={class:"module-ui mb-16px",shadow:"never",header:"系统信息","body-style":{padding:0,display:"flex",minHeight:"5.2rem"}},Gt={class:"leading-[3.2rem]"},Jt={key:0},Mt={class:"h-[50rem] p-2rem"},Rt=O({__name:"index",setup:function(t){var r=a().refs,n=r.settingData,c=r.loading,l=N((function(){return!n.value.docker_installed||!n.value.docker_compose_installed})),p=x({data:function(){return n.value},options:function(t){return N((function(){return[rt("服务状态",(function(){return G("div",null,[l.value?G("span",null,[K("当前状态:未安装")]):G("span",{class:"flex items-center text-[1.2rem]"},[K("当前状态:"),n.value.service_status?"开启":"停止",G("span",{class:n.value.service_status?"svgtofont-icon-start text-[#20a53a]":"svgtofont-icon-stop text-[#ff0000]"},null),G(Y,{class:"!ml-[2rem]",onClick:function(){return St("toggle")}},{default:function(){return[n.value.service_status?"停止":"开启"]}}),G(Y,{onClick:function(){return St("reset")}},{default:function(){return[K("重启")]}}),!n.value.service_status&&G(Y,{onClick:Ct},{default:function(){return[K("修复")]}})])])}))].concat(e(n.value.monitor_status?[it([rt("容器监控",(function(){return G(Q,{modelValue:n.value.monitor_status,"onUpdate:modelValue":function(t){return n.value.monitor_status=t},onChange:Dt},null)}),"monitor_status"),Ft("*设置容器页面监控开关,关闭后CPU使用率将不再监控")]),it([ot("监控天数","monitor_save_date",{attrs:{class:"!w-[32rem]",placeholder:"请输入保存天数"}}),ct("保存",{attrs:{class:"!ml-4px",type:"primary",onClick:function(){return Lt("date")}}}),Ft("*设置容器页面监控保存天数")])]:[]),[it([ot("加速URL","url",{attrs:{class:"!w-[32rem]",placeholder:"加速URL",disabled:!0}}),ct("修改",{attrs:{class:"!ml-4px",type:"primary",onClick:function(){return Pt(t.value.url)}}}),ut((function(){return G(j,{class:"mx-[2rem] text-[#20a53a] cursor-pointer leading-[3.2rem] mb-[1.8rem]",target:"_blank",href:"https://www.bt.cn/bbs/thread-134771-1-1.html"},{default:function(){return[K(">>帮助")]}})}))].concat(e(n.value.bad_registry?[Ft("*提示:检测到您上次拉取镜像出现异常,请尝试更换推荐的加速站: ".concat(n.value.bad_registry_path))]:[]))),it([ot("docker compose","docker_compose_path",{attrs:{class:"!w-[32rem]",placeholder:"docker compose路径",disabled:!0}}),ct("修改",{attrs:{class:"!ml-4px",type:"primary",onClick:qt}}),Ft("*docker compose路径")]),it([nt("私有仓库","warehouse",{attrs:{class:"!w-[32rem]",disabled:!0,rows:4,autosize:{minRows:4,maxRows:4},placeholder:"Docker私有仓库地址"}}),ct("修改",{attrs:{class:"!ml-4px self-end",type:"primary",onClick:function(){return function(t){var e,r=x({data:function(){return{warehouse:t.replaceAll(/,/g,"\n")}},options:function(){return N((function(){return[nt("私有仓库","warehouse",{attrs:{placeholder:"请输入私有仓库地址,一行一个,如:\n192.168.1.111:8087\n192.168.1.112:8087",style:"width:27rem;",rows:5},rules:[]}),Ft("*设置后将重启Docker")]}))},submit:(e=u(o().mark((function t(e,r){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,r();case 3:return t.next=5,s({title:"提示",content:"即将重启Docker,是否继续?"});case 5:return t.next=7,i({request:b({warehouse:e.value.warehouse.replace(/ /g,"").replaceAll(/\n/g,",")}),message:!0,loading:"正在设置私有仓库,请稍后..."});case 7:if(!t.sent.status){t.next=11;break}return yt(),t.abrupt("return",!0);case 11:return t.abrupt("return",!1);case 14:return t.prev=14,t.t0=t.catch(0),t.abrupt("return",!1);case 17:case"end":return t.stop()}}),t,null,[[0,14]])}))),function(t,r){return e.apply(this,arguments)})}),n=r.BtForm,a=r.submit;f({component:function(){return T("div",{class:"p-[1.6rem]"},T(n))},title:"设置私有仓库",area:45,btn:!0,onConfirm:a})}(t.value.warehouse)}}})]),it([rt("日志切割",(function(){return G(Q,{modelValue:n.value.log_cutting.status,"onUpdate:modelValue":function(t){return n.value.log_cutting.status=t},onChange:Ot},null)}),"log_cutting",{onClick:function(t){return t.preventDefault()}}),ct("设置",{attrs:{class:"!ml-[1rem]",type:"primary",onClick:function(){return Tt()}}}),rt("",(function(){return T("span",{class:"text-[#999] mt-[2px] leading-[2rem] text-[12px] ml-[20px]"},"*切割文件大小".concat(n.value.log_cutting.size,"MB,保留份数").concat(n.value.log_cutting.file,"份"))}))]),it([rt("ipv6",(function(){return G(Q,{modelValue:n.value.ipv6,"onUpdate:modelValue":function(t){return n.value.ipv6=t},onChange:Ut},null)}),"ipv6",{onClick:function(t){return t.preventDefault()}}),ct("ipv6地址配置",{attrs:{class:"!ml-[1rem]",type:"primary",onClick:Nt}}),Ft("*此ipv6范围将会在默认的bridge网络中使用,启用或关闭ipv6后需要重启docker,请确保可以重启docker再操作")]),it([rt("iptables",(function(){return G(Q,{modelValue:n.value.iptables,"onUpdate:modelValue":function(t){return n.value.iptables=t},onChange:function(t){return Vt("iptables",t)}},null)}),"iptables",{onClick:function(t){return t.preventDefault()}}),Ft("*Docker 对 iptables 规则的自动配置")]),it([rt("live_restore",(function(){return G(Q,{modelValue:n.value.live_restore,"onUpdate:modelValue":function(t){return n.value.live_restore=t},onChange:function(t){return Vt("live_restore",t)}},null)}),"live_restore",{onClick:function(t){return t.preventDefault()}}),Ft("*开启后Docker守护进程发生意外停机或崩溃时保留正在运行的容器状态")]),it([st("cgroup driver","driver",[{label:"cgroupfs",value:"cgroupfs"},{label:"systemd",value:"systemd"}],{attrs:{onChange:function(t){return Et(t)}}})]),rt("配置文件",(function(){return G(Y,{type:"primary",title:"全局配置文件",onClick:function(){return gt.value=!0}},{default:function(){return[K("打开配置文件")]}})})),rt("Docker代理",(function(){return G("div",null,[G(Q,{class:"mr-[1rem]",modelValue:n.value.proxy.status,"onUpdate:modelValue":function(t){return n.value.proxy.status=t},onChange:At},null),G(Y,{type:"primary",onClick:At},{default:function(){return[K("设置代理")]}})])}),"customProxy",{onClick:function(t){return t.preventDefault()}}),rt("应用商店目录",(function(){return G("div",{class:"flex items-center"},[G(W,{modelValue:n.value.dk_project_path,"onUpdate:modelValue":function(t){return n.value.dk_project_path=t},disabled:!n.value.allow_update_install_path,style:"width: 32rem",placeholder:"请输入目录"},null),G(Y,{type:"primary",class:"ml-4px",disabled:!n.value.allow_update_install_path,onClick:function(){It(n.value.dk_project_path)}},{default:function(){return[K("修改")]}}),n.value.allow_update_install_path?null:G("span",{class:"ml-[1.6rem] text-red-500 text-[1.2rem]"},[K("当前已有应用存在,无法修改")])])}),"dk_project_path"),rt("卸载Docker",(function(){return G(Y,{type:"default",onClick:jt},{default:function(){return[K("卸载")]}})}))])}))}}),d=p.BtForm;return V((function(){Ht()})),E((function(){gt.value=!1,xt.value="",bt.value={}})),function(t,e){var r=P,o=D,a=A("bt-loading");return F((I(),z("div",null,[B("div",zt,[G(H(d),{"label-position":"right",labelWidth:"9.6rem"})]),B("div",Bt,[B("div",Gt,[(I(!0),z(J,null,M(H(kt),(function(t){return I(),z("div",{key:t.key,class:"line"},[B("div",null,X(t.name),1),B("div",null,X(H(wt)(t.key)),1),t.append?(I(),z("div",Jt,[(I(),Z(tt(t.append)))])):et("",!0)])})),128))])]),G(o,{title:"全局配置文件",modelValue:H(gt),"onUpdate:modelValue":e[1]||(e[1]=function(t){return $(gt)?gt.value=t:null}),showFooter:"",area:64,onConfirm:H(_t)},{default:R((function(){return[B("div",Mt,[G(r,{modelValue:H(xt),"onUpdate:modelValue":e[0]||(e[0]=function(t){return $(xt)?xt.value=t:null}),filePath:H(n).daemon_path,autoSave:!1,editorOption:{mode:"ace/mode/nginx"}},null,8,["modelValue","filePath"])])]})),_:1},8,["modelValue","onConfirm"])])),[[a,H(c)],[a,"正在获取docker设置,请稍候...","title"]])}}});t("default",L(Rt,[["__scopeId","data-v-7769023f"]]))}}}))}();
Save File
Cancel