Server IP : 184.154.167.98 / Your IP : 18.189.194.36 Web Server : Apache System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 User : puertode ( 1767) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/l.v.e-manager/commons/js/ |
Upload File : |
/** * Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2019 All Rights Reserved * * Licensed under CLOUD LINUX LICENSE AGREEMENT * http://cloudlinux.com/docs/LICENSE.TXT */ (function(win){ var doc = win.document, project_creator = doc.getElementById('project-create-btn'), project_path = doc.getElementById('project-path-field'), project_domain = doc.getElementById('project-domain-field'), project_uri = doc.getElementById('project-uri-field'), version_list = doc.getElementById('version-selector'), project_list = doc.getElementById('project-list'); var uuid = function(){ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); return v.toString(16); }); }; var apps = (function(a){ var o = {}; Array.prototype.forEach.call(a, function(i){ var id = uuid(); i.id = id; o[id] = new Project(id, backend_uri, 'ruby'); o[id].add_hook(); }); return o; }(doc.getElementsByClassName('app-container'))); var get_app_id = function(el){ if (el.nodeType !== 1) return; while (el.className !== 'app-container') el = el.parentNode; return el.id; }; project_list.onchange = function(e) { e = e || win.event; var tgt = e.target || e.srcElement, classname = tgt.className, token = 'app-'; if (classname === '') return; var pos = classname.indexOf(token); if (pos !== 0) return; var item = classname.substring(token.length); if (item !== 'versionselector') return; var id = get_app_id(tgt); if (id === undefined) return; apps[id]['versionedit'](tgt, 'ruby'); }; project_list.onclick = function(e){ e = e || win.event; var tgt = e.target || e.srcElement, classname = tgt.className, token = 'app-'; if (classname === '') return; var regex = new RegExp(token + '([\\w-_]+)'), actionMatch = classname.match(regex); if(!actionMatch) { return; } var action = actionMatch[1], actions = {remove: true, update: true, modexpand: true, modcollapse: true, modremove: true, modadd: true, pathedit: true, uriedit: true, wsgiedit: true, reset: true, restart: true, execute: true}; var id = get_app_id(tgt); if (id === undefined) return; if (action in actions) apps[id][action](tgt, 'ruby'); if (action === 'remove') delete apps[id]; }; doc.documentElement.onclick = function(e){ var popup = doc.getElementById('listpopup'), style = win.getComputedStyle(popup, null).display; if (style === 'block' && popup.getAttribute('verCount') == null) popup.style.display = 'none'; }; project_creator.onclick = function(e){ var path = project_path.value, uri = project_uri.value || '/', version = version_list.options[version_list.selectedIndex].firstChild.nodeValue; if (path === '' || uri === '') { alert("Project path and uri must be given"); return false; } if(!isAllowedText(path) || !isAllowedText(uri)) { alert("Path or URI contains not allowed symbols"); return false; } var id = uuid(), project = new Project(id, backend_uri, 'ruby'); project.id = id; project.create(path, uri, version, project_list, 'ruby', project_domain.value); apps[id] = project; return true; }; (function(uri){ var request = new XMLHttpRequest(); request.open("POST", uri); request.onreadystatechange = function(){ if ( request.readyState === 4 && request.status === 200 ) { var data = JSON.parse(request.responseText); if (data['status'] === 'OK') { modlist = data['data']; } } }; request.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded" ); request.send(encodeFormData({action:'rbmodlist'})); }(backend_uri)); }(window));