-
Notifications
You must be signed in to change notification settings - Fork 138
Hacking
Hacking instructions for munkireport-php (at the moment just a braindump)
To add new data to MunkiReport you can set up a module. A module is a directory that contains
- an install script for the client (which will gather the appropriate data and point munkireport to it)
- a model (which describes how the data is represented in the database)
- optionally a controller (which you can use to download additional files)
If you want to understand how modules work, take a look at some modules in the modules directory.
MunkiReport comes with a bundled graphing library: NVD3 graphing library, based on D3.js.
If you want to plot where your clients are in the network, you can use the network pie. Global network locations can be set in local/module_configs/ip_ranges.yml
.
If you want to use those, just add an empty parameter object (parms = {}).
// Override network settings
var parms = {
"Campus": ["145.108.", "130.37."]
};
drawGraph("<?php echo url('module/reportdata/ip'); ?>", '#ip-plot', pieOptions, parms);
Don't pollute the $GLOBALS array, at the moment there are a handful of variables passed around via $GLOBALS:
- $GLOBALS['alerts'] - alerts and messages
- $GLOBALS['auth'] - authorization variable (currently only in use for report)
- $GLOBALS['conf'] - config items access with conf()
- $GLOBALS['dbh'] - the database handle
- $GLOBALS['version'] - the current version of MunkiReport
A large portion of the UI is based on javascript.
When the DOM is ready and the language files are loaded, the appReady event is triggered.
When there is an update in the filters or a refresh for a dashboard, appUpdate is triggered..
- General Upgrade Procedures
- How to Upgrade Versions
- Troubleshooting Upgrades
- Migrating sqlite to MySQL