Skip to content

Commit

Permalink
Added display of free space on SD card
Browse files Browse the repository at this point in the history
  • Loading branch information
martignoni committed Aug 6, 2016
1 parent 890dc0e commit 4116860
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ SHA1 fingerprint of the compressed disk image (moodlebox.img.gz): 44c699a91c39c2

### Release notes

* 2016-08-06, version 1.1: added display of free space on SD card
* 2016-07-11, version 1.0: added time setting feature
* 2016-06-26, version 1.0b (beta): added two folder as RAM disks, for better performance
* 2016-06-19, version 1.0a2 (alpha): reorganisation of project
Expand Down
6 changes: 6 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
exec('awk \'{print $1/1000" °C"}\' /sys/class/thermal/thermal_zone0/temp', $cputemperature);
exec('awk \'{print $1/1000" Mhz"}\' /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq', $cpufrequency);
exec('uptime -p', $uptime);
$sdcardtotalspace = disk_total_space('/');
$sdcardfreespace = disk_free_space('/');
$moodleboxversion = $plugin->release . ' (' . $plugin->version . ')';

class datetimeset_form extends moodleform {
Expand Down Expand Up @@ -111,6 +113,10 @@ public function definition() {
echo html_writer::tag('td', $raspbianversion[0], array('class' => 'cell c1'));
echo html_writer::end_tag('tr');
echo html_writer::start_tag('tr');
echo html_writer::tag('th', get_string('sdcardavailablespace', 'local_moodlebox'), array('class' => 'cell c0'));
echo html_writer::tag('td', display_size($sdcardfreespace) . ' (' . 100*round($sdcardfreespace/$sdcardtotalspace, 3) . '%)', array('class' => 'cell c1'));
echo html_writer::end_tag('tr');
echo html_writer::start_tag('tr');
echo html_writer::tag('th', get_string('cpuload', 'local_moodlebox'), array('class' => 'cell c0'));
echo html_writer::tag('td', $cpuload[0] . ', ' . $cpuload[1] . ', ' . $cpuload[2], array('class' => 'cell c1'));
echo html_writer::end_tag('tr');
Expand Down
1 change: 1 addition & 0 deletions lang/en/local_moodlebox.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
$string['restart'] = 'Restart MoodleBox';
$string['restartmessage'] = 'The MoodleBox is restarting. It will be online again in a moment.';
$string['restartstop'] = 'Restart and shutdown';
$string['sdcardavailablespace'] = 'Free space on SD card';
$string['shutdown'] = 'Shutdown MoodleBox';
$string['shutdownmessage'] = 'The MoodleBox is shutting down. Please wait a few seconds before disconnecting the power supply.';
$string['systeminfo'] = 'System information';
Expand Down
1 change: 1 addition & 0 deletions lang/fr/local_moodlebox.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
$string['restart'] = 'Redémarrer la MoodleBox';
$string['restartmessage'] = 'La MoodleBox va redémarrer. Elle sera à nouveau accessible dans quelques instants.';
$string['restartstop'] = 'Redémarrage et arrêt';
$string['sdcardavailablespace'] = 'Espace libre sur la carte SD';
$string['shutdown'] = 'Éteindre la MoodleBox';
$string['shutdownmessage'] = 'La MoodleBox va s\'éteindre. Veuillez attendre quelques secondes avant de retirer l\'alimentation.';
$string['systeminfo'] = 'Informations système';
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

defined('MOODLE_INTERNAL') || die;

$plugin->version = 2016071100;
$plugin->release = '1.0';
$plugin->version = 2016080600;
$plugin->release = '1.1';
$plugin->requires = 2015051103;
$plugin->maturity = MATURITY_STABLE;
$plugin->component = 'local_moodlebox';

0 comments on commit 4116860

Please sign in to comment.