← Back
Editing: software-legacy.js
!function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||r(e)||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 n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(e,t)||r(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){p(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var c=r&&r.prototype instanceof s?r:s,l=Object.create(c.prototype);return u(l,"_invoke",function(n,r,o){var i,c,u,s=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,c=0,u=e,p.n=n,a}};function d(n,r){for(c=n,u=r,t=0;!f&&s&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(c=0,p.v=r,p.n=i[1]):d<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,y),c=l,u=y;(t=c<2?e:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(s=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==a)break}catch(t){i=e,c=1,u=t}finally{s=1}}return{value:t,done:f}}}(n,o,i),!0),l}var a={};function s(){}function l(){}function f(){}t=Object.getPrototypeOf;var p=[][r]?t(t([][r]())):(u(t={},r,function(){return this}),t),d=f.prototype=s.prototype=Object.create(p);function y(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,u(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=f,u(d,"constructor",f),u(f,"constructor",l),l.displayName="GeneratorFunction",u(f,o,"GeneratorFunction"),u(d),u(d,o,"Generator"),u(d,r,function(){return this}),u(d,"toString",function(){return"[object Generator]"}),(c=function(){return{w:i,m:y}})()}function u(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}u=function(e,t,n,r){function i(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},u(e,t,n,r)}function s(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function l(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){s(i,r,o,a,c,"next",e)}function c(e){s(i,r,o,a,c,"throw",e)}a(void 0)})}}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,d(r.key),r)}}function p(e,t,n){return(t=d(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,n||"default");if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}System.register([],function(e,r){"use strict";return{execute:function(){var e=function(){return e=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),p(this,"loadList",[]),p(this,"pluginTimer",null),p(this,"fileList",{laydate:["static/laydate/laydate.js?v=1765440387"],echarts:["static/js/echarts.min.js?v=1765440387"],clipboard:["static/js/clipboard.min.js?v=1765440387"],qrcode:["static/js/jquery.qrcode.min.js?v=1765440387"],xterm:["static/css/xterm.css?v=1765440387","/static/js/xterm.js?v=1765440387"],jsencrypt:["static/js/jsencrypt.min.js?v=1765440387"],ace:["static/editor/ace.js?v=1765440387"]}),p(this,"triggerList",{laydate:["laydate.render"],echarts:["echarts.init"],clipboard:["ClipboardJS","bt.pub.copy_pass"],qrcode:["qrcode({"],xterm:["Term.run()","web_shell()"],jsencrypt:["JSEncrypt","rsa.encrypt_public"],ace:["ace.edit","bt.aceEditor","bt.fullScreenLog","bt.on_edit_file","bt.pub.on_edit_file","OnlineEditFile"]}),p(this,"getToken",function(){var e=Date.now(),t=window.vite_public_proxy_key;return{request_time:e,request_token:window.md5(String(e).concat(window.md5(t)))}}),t&&this.renderPlugin(t)},r=[{key:"renderPlugin",value:(d=l(c().m(function e(t){var n,r,o,i,a;return c().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=t.pluginTitle,r=t.pluginName,o=t.pluginBuilt,e.p=1,!Number(o)){e.n=2;break}window.soft.set_soft_config(r),e.n=7;break;case 2:return e.n=3,this.getPluginHtml(r);case 3:return i=e.v,e.n=4,this.getPluginDependence(i);case 4:return a=e.v,e.n=5,this.loadFileList(a);case 5:if("phpguard"!==r){e.n=6;break}return window.parent.postMessage("closePlugin&php守护已启动,无需设置!&success","*"),e.a(2);case 6:this.openPluginView({title:n,name:r,rhtml:i});case 7:e.n=9;break;case 8:e.p=8,e.v,window.parent.postMessage("closePlugin","*");case 9:return e.a(2)}},e,this,[[1,8]])})),function(e){return d.apply(this,arguments)})},{key:"openPluginView",value:(s=l(c().m(function e(t){var n,r,o,i,a=this;return c().w(function(e){for(;;)switch(e.n){case 0:n=t.title,r=t.name,o=t.rhtml,i=o.replace(/[\"\']javascript\/text[\"\']/,'"text/javascript"'),window.bt.open({type:1,shift:5,offset:"auto",closeBtn:2,area:n.indexOf("Node.js版本管理器")>-1?["700px","710px"]:"700px",title:'<img style="width: 24px;margin-right: 5px;margin-left: -10px;margin-top: -3px;" src="/static/img/soft_ico/ico-'.concat(r,'.png" />').concat(n),content:i,success:function(e){var t=$(window).height()||0,n=$(e).height()||0;n>=t?setTimeout(function(){$(e).css({top:"0px"})},100):($(e).find(".layui-layer-content").removeAttr("style").css({backgroundColor:"#fff"}),$(e).css({top:"".concat((t-n)/2,"px")}),$(e).find(".layui-layer-close").addClass("layui-layer-close2").removeClass("layui-layer-close1"));var r=$(window).width()||0;($(e).width()||0)>=r&&setTimeout(function(){$(e).css({left:"0px",width:"100%"})},100),window.parent.postMessage("pluginLoad","*")},end:function(){a.checkPopup()}});case 1:return e.a(2)}},e)})),function(e){return s.apply(this,arguments)})},{key:"closePluginView",value:function(){clearInterval(this.pluginTimer),window.parent.postMessage("closePlugin","*")}},{key:"checkPopup",value:function(){var e=this;this.pluginTimer=setInterval(function(){$(document).find(".layui-layer").length||e.closePluginView()},100)}},{key:"message",value:function(e){var t,n=e.message,r=e.type,o=e.time,i=void 0===o?2e3:o;null===(t=document.getElementById("el-message"))||void 0===t||t.remove();var a='<div id="el-message" class="el-message el-message--'.concat(r,'" style="z-index: 9999999;position:fixed">\n\t\t\t\t<div class="el-message__icon el-icon-').concat(r,'"></div>\n\t\t\t\t<div class="el-message__content">').concat(n||"","</div>\n\t\t\t</div>");window.document.body.insertAdjacentHTML("beforeend",a);var c=document.getElementById("el-message");c.style.top="calc(50% - ".concat(c.offsetHeight/2,"px)"),i&&setTimeout(function(){var e=document.getElementById("el-message");e&&e.remove()},i)}},{key:"objectToQueryString",value:function(e){return Object.keys(e).map(function(t){return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(e[t]))}).join("&")}},{key:"isDev",value:function(){return!1}},{key:"ajax",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"POST";return new Promise(function(o,i){var c=new XMLHttpRequest,u=n.isDev();if(u&&(e="/api/".concat(e).replace("//","/")),c.open(r,e,!0),c.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),u){var s=n.getToken();t=a(a({},t),s)}else c.setRequestHeader("x-http-token",window.vite_public_request_token);c.onreadystatechange=function(){if(c.readyState===XMLHttpRequest.DONE)if(200===c.status)try{var e=c.responseText;o(e)}catch(t){i(new Error("Error parsing response: ".concat(t)))}else i(new Error("Request failed with status: ".concat(c.status)))},c.onerror=function(){i(new Error("Network error"))},"POST"===r&&t?c.send(n.objectToQueryString(t)):c.send()})}},{key:"getPluginHtml",value:(u=l(c().m(function e(t){return c().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.ajax("/plugin?action=getConfigHtml",{name:t});case 1:return e.a(2,e.v);case 2:return e.p=2,e.v,e.a(2,"")}},e,this,[[0,2]])})),function(e){return u.apply(this,arguments)})},{key:"getPluginDependence",value:function(e){for(var r=[],o=this.triggerList,i=this.fileList,a=this.loadList,c=0,u=Object.entries(o);c<u.length;c++){var s=n(u[c],2),l=s[0];s[1].some(function(t){return e.includes(t)})&&(a.includes(l)||r.push.apply(r,t(i[l])),a.push(l))}return r}},{key:"loadScriptFile",value:function(e){return new Promise(function(t,n){var r=document.createElement("script");r.type="text/javascript",r.src=e,document.head.appendChild(r),r.onload=function(){return t(!0)},r.onerror=function(){return n()}})}},{key:"loadCssFile",value:function(e){return new Promise(function(t,n){var r=document.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=e,document.head.appendChild(r),r.onload=function(){return t(!0)},r.onerror=function(){return n()}})}},{key:"loadFileList",value:(i=l(c().m(function e(t){var n,r,o=this;return c().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,n=[],t.forEach(function(e){e.endsWith(".css?v=1765440387")?n.push(o.loadCssFile(e)):n.push(o.loadScriptFile(e))}),e.n=1,Promise.all(n);case 1:return e.a(2,Promise.resolve(!0));case 2:return e.p=2,r=e.v,e.a(2,Promise.reject(r))}},e,null,[[0,2]])})),function(e){return i.apply(this,arguments)})}],r&&f(e.prototype,r),o&&f(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,o,i,u,s,d}();window.plugin_view=new e,window.addEventListener("message",function(e){var t=e.data;t.includes("pluginName")&&window.plugin_view.renderPlugin(JSON.parse(t))})}}})}();
Save File
Cancel