SuperAdmin / 05. Documentation
Updated: 28. June 2018
Author: Peter Širka

05. Documentation

Professional Support Chat with contributors

Events

Events can be used in e.g. Total.js Flow.

Login events:

ON('superadmin.blocked', function(controller) {
    // Someone wants to login with more than 3x times of bad credentials
    // IP is blocked for 10 minutes
});

ON('superadmin.login', function(controller) {
    // User is logged
    // User instance: controller.user
});

State of applications:

ON('superadmin.app.create', function(app) {
    // App is created
});

ON('superadmin.app.update', function(app) {
    // App is updated
});

ON('superadmin.app.remove', function(app) {
    // App is removed (files + directories are removed)
});

ON('superadmin.app.monitor', function(app) {
    // App has been monitored
    // Data: "app.currentmonitor"
});

ON('superadmin.app.renew', function(app) {
    // App has renew SSL certificate
});

ON('superadmin.app.run', function(app) {
    // App has been started
});

ON('superadmin.app.kill', function(app) {
    // App has been killed
});

ON('superadmin.app.alarm', function(app, alarm, message) {
    // App alarm is triggered
});

ON('superadmin.app.backup', function(app, filename) {
    // App is backuped
});

Global events:

ON('superadmin.system', function(system) {

    // System information

    // system.cpu (String, percentage)
    // system.uptime (Number, seconds)

    // system.hddtotal (Number, bytes)
    // system.hddfree (Number, bytes)
    // system.hddused (Number, bytes)

    // system.memtotal (Number, bytes)
    // system.memfree (Number, bytes)
    // system.memused (Number, bytes)

    // system.networkconnections (Number)
    // system.networkdownload (Number, bytes)
    // system.networkupload (Number, bytes)

    // system.nginx.cpu (String, percentage)
    // system.nginx.memory (Number, bytes)

    // system.couchdb.cpu (String, percentage)
    // system.couchdb.memory (Number, bytes)

    // system.redis.cpu (String, percentage)
    // system.redis.memory (Number, bytes)

    // system.mysql.cpu (String, percentage)
    // system.mysql.memory (Number, bytes)

    // system.mongodb.cpu (String, percentage)
    // system.mongodb.memory (Number, bytes)

    // system.postgresql.cpu (String, percentage)
    // system.postgresql.memory (Number, bytes)

    // system.version_nginx (String)
    // system.version_server (String)
    // system.version_node (String)
    // system.version_gm (String)
    // system.version_postgresql (String)
    // system.version_mongodb (String)
    // system.version_mysql (String)
    // system.version_couchdb (String)
    // system.version_redis (String)
});

ON('superadmin.settings', function(settings) {
    // Settings have been changed
});