From 4c220daee80a863e20460950a2a49d29d5bc3075 Mon Sep 17 00:00:00 2001 From: Daniel Stefan Haischt Date: Wed, 10 Jan 2007 21:22:10 +0000 Subject: * added Ajax support to each *_tools.php page --- packages/freenas/pkg/freenas_guiconfig.inc | 124 +++++++++ packages/freenas/www/disks_manage_init.php | 392 ++++++---------------------- packages/freenas/www/disks_manage_tools.php | 151 ++++++----- packages/freenas/www/disks_mount_tools.php | 91 ++++--- 4 files changed, 359 insertions(+), 399 deletions(-) diff --git a/packages/freenas/pkg/freenas_guiconfig.inc b/packages/freenas/pkg/freenas_guiconfig.inc index c049659a..93e7a826 100644 --- a/packages/freenas/pkg/freenas_guiconfig.inc +++ b/packages/freenas/pkg/freenas_guiconfig.inc @@ -38,8 +38,132 @@ $d_groupconfdirty_path = $g['varrun_path'] . "/group.conf.dirty"; $d_smbshareconfdirty_path = $g['varrun_path'] . "/smbshare.conf.dirty"; $d_upnpconfdirty_path = $g['varrun_path'] . "/upnp.conf.dirty"; +/* ============================================================================= */ +/* == Constants used together with executing a UNIX command line tool == */ +/* ============================================================================= */ + +define("DONE_PARAGRAPH", " +

+ Done! +

+ "); + +define("CMDOUT_PARA", " +

+ Command output: (use the toggle icon to unveil detailed infos): +

+ "); + +define("CMDOUT_TOGGLE_FUNC", " +function toggle_cmdout(image, totoggle) { + var plusSrc = \"/themes/{$g['theme']}/images/misc/bullet_toggle_plus.png\"; + var minusSrc = \"/themes/{$g['theme']}/images/misc/bullet_toggle_minus.png\"; + var currentSrc = image.src; + var newSrc = (currentSrc.indexOf(\"plus\") >= 0) ? minusSrc : plusSrc; + + image.src = newSrc; + Effect.toggle(totoggle, 'appear', { duration: 0.75 }); +} +"); + +define("CMDOUT_AJAX_SCRIPT", " + +"); + $freenas_config =& $config['installedpackages']['freenas']['config'][0]; +/* ============================================================================= */ +/* == Functions used together with executing a UNIX command line tool == */ +/* ============================================================================= */ + +function assemble_cmdout($button, $out, $done = false) { + $dopara = DONE_PARAGRAPH; + + $retvalue =<<