Browse Source

New usage reporting mechanism. Cleanup variables on uninstall.

- new: hook_cron implementation triggers an XML-RPC service
- new: UI at admin/settings/munin_api for opt-in
- fixed: i18n error on requirements page
Frederic G. MARAND 13 years ago
parent
commit
2fd21df1a2

BIN
help/munin_api.png


+ 1 - 1
modules/munin_apc/munin_apc.info

@@ -19,4 +19,4 @@ core = 6.x
 project = "munin_api"
 datestamp = "1296219892"
 project status url = http://features.osinet.eu/fserver
-version = "6.x-1.0-dev11a2801"
+version = "6.x-1.0-dev11b0901"

+ 1 - 1
modules/munin_core/munin_core.info

@@ -19,4 +19,4 @@ core = 6.x
 project = "munin_api"
 datestamp = "1296219892"
 project status url = http://features.osinet.eu/fserver
-version = " 6.x-1.0-dev11a2801"
+version = "6.x-1.0-dev11b0901"

+ 1 - 1
modules/munin_core/munin_core.install

@@ -22,4 +22,4 @@ function munin_core_enable() {
  */
 function munin_core_disable() {
   variable_set('menu_rebuild_needed', TRUE);
-}
+}

+ 1 - 1
munin_api.info

@@ -19,4 +19,4 @@ core = 6.x
 project = "munin_api"
 datestamp = "1296219892"
 project status url = http://features.osinet.eu/fserver
-version = " 6.x-1.0-dev11a2801"
+version = "6.x-1.0-dev11b0901"

+ 17 - 1
munin_api.install

@@ -43,7 +43,7 @@ function munin_api_requirements($phase) {
         $req = array(
           'title' => t('Munin plugin modules'),
           // format plural although $count >= 2 because some languages have several plural forms
-          'value' => t($count, '1 Munin plugin enabled.',
+          'value' => format_plural($count, '1 Munin plugin enabled.',
             '<a href="!link">@count Munin plugins</a> enabled.', array('!link' => url('admin/reports/munin_api'))),
           'severity' => REQUIREMENT_OK,
         );
@@ -61,3 +61,19 @@ function munin_api_requirements($phase) {
 
   return $ret;
 }
+
+/**
+ * Implements hook_uninstall()
+ */
+function munin_api_uninstall() {
+  $vars = array(
+    'init_path',
+    'last',
+    'next_report',
+    'watchdog',
+  );
+  foreach ($vars as $tail) {
+    $name = 'munin_api_'. $tail;
+    variable_del($name);
+  }
+}

+ 10 - 2
munin_api.js

@@ -43,19 +43,27 @@ function muninApiFade(selector, visible) {
  *
  * @return void
  */
-function onReadyPathVisibility() {
+function onReadySettingsVisibility() {
   if ($('#edit-munin-api-watchdog-init').attr('checked') === false) {
     $('#edit-munin-api-init-path-wrapper').hide();
   }
+  if ($('#edit-munin-api-next-report').attr('checked') === false) {
+    $('.munin-api-report').hide();
+  }
+
   $("input:radio[name='munin_api_watchdog']").click(function () {
     muninApiFade('#edit-munin-api-init-path-wrapper',
       $("input:radio[name='munin_api_watchdog']:checked").val() === 'init');
   });
+  $('#edit-munin-api-next-report').click(function () {
+    muninApiFade('.munin-api-report',
+      $("#edit-munin-api-next-report").attr('checked'));
+  });
 }
 
 /**
  * Assign ready handler
  */
 $(function () {
-  onReadyPathVisibility();
+  onReadySettingsVisibility();
 });

File diff suppressed because it is too large
+ 54 - 3
munin_api.module


Some files were not shown because too many files changed in this diff