Linux vmi2545633.contaboserver.net 6.1.0-32-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.129-1 (2025-03-06) x86_64
Apache/2.4.62 (Debian)
Server IP : 127.0.0.1 & Your IP : 127.0.0.1
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
node_modules /
pm2 /
node_modules /
tx2 /
src /
Delete
Unzip
Name
Size
Permission
Date
Action
utils
[ DIR ]
drwxr-xr-x
2025-04-08 13:05
actions.js
2.17
KB
-rw-r--r--
2025-04-08 13:05
events.js
662
B
-rw-r--r--
2025-04-08 13:05
index.js
1.08
KB
-rw-r--r--
2025-04-08 13:05
issues.js
1.36
KB
-rw-r--r--
2025-04-08 13:05
metrics.js
6.02
KB
-rw-r--r--
2025-04-08 13:05
Save
Rename
module.exports = { /** * Expose an action/function triggerable via PM2 or PM2.io * @memberof TX2 * @param {string} action_name Name of the action * @param {object} [opts] Optional parameter * @param {function} fn Function to be called * * @example <caption>Action without arguments</caption> * tx2.action('run_query', (cb) => { * cb({ success: true }) * }) * @example <caption>Action with arguments</caption> * tx2.action('run_query', arg1, (cb) => { * cb({ success: arg1 }) * }) */ action(action_name, opts, fn) { if (!fn) { fn = opts opts = null } if (!action_name) return console.error('[PMX] action.action_name is missing') if (!fn) return console.error('[PMX] emit.data is mission') // Notify the action this.send({ type : 'axm:action', data : { action_name : action_name, opts : opts, arity : fn.length } }) let reply = (data) => { if (data.length) { data._length = data.length delete data.length } this.send({ type : 'axm:reply', data : { return : data, action_name : action_name } }) } process.on('message', (data) => { if (!data) return false // Notify the action if (data && (data == action_name || data.msg == action_name)) this.event('action triggered', { action_name, opts }) // In case 2 arguments has been set but no options has been transmitted if (fn.length === 2 && typeof(data) === 'string' && data === action_name) return fn({}, reply) // In case 1 arguments has been set but options has been transmitted if (fn.length === 1 && typeof(data) === 'object' && data.msg === action_name) return fn(reply) /** * Classical call */ if (typeof(data) === 'string' && data === action_name) return fn(reply) /** * If data is an object == v2 protocol * Pass the opts as first argument */ if (typeof(data) === 'object' && data.msg === action_name) return fn(data.opts, reply) }) } }