X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=clearadm%2Flib%2FClearadmWeb.pm;h=e5848b009bc978923cc8ce66b44a22aee1ea7fe3;hb=31e9f564af916b71bb6acdcabdc3e872d4e33899;hp=17ccb6e53279e32815c70da67af7e99f386b28ec;hpb=559f9045ae05e457c7eb4b6c684aa9651b98971a;p=clearscm.git
diff --git a/clearadm/lib/ClearadmWeb.pm b/clearadm/lib/ClearadmWeb.pm
index 17ccb6e..e5848b0 100644
--- a/clearadm/lib/ClearadmWeb.pm
+++ b/clearadm/lib/ClearadmWeb.pm
@@ -47,7 +47,7 @@ use strict;
use base 'Exporter';
-use CGI qw (
+use CGI qw(
:standard
start_a
end_a
@@ -73,6 +73,8 @@ use FindBin;
use lib "$FindBin::Bin/../../lib";
use Clearadm;
+use Clearcase::Vobs;
+use Clearcase::Views;
use DateUtils;
use Display;
use Utils;
@@ -83,7 +85,7 @@ our $APPNAME= 'Clearadm';
our $VERSION = '$Revision: 1.46 $';
($VERSION) = ($VERSION =~ /\$Revision: (.*) /);
-our @EXPORT = qw (
+our @EXPORT = qw(
autoScale
displayError
displayAlert
@@ -109,7 +111,9 @@ our @EXPORT = qw (
makeFilesystemDropdown
makeIntervalDropdown
makeNotificationDropdown
+ makeStoragePoolDropdown
makeSystemDropdown
+ makeTagsDropdown
makeTimeDropdown
makeTaskDropdown
setField
@@ -121,25 +125,28 @@ our @PREDEFINED_ALERTS = (
);
our @PREDEFINED_NOTIFICATIONS = (
+ 'Clearcase Storage',
+ 'Heartbeat',
'Loadavg',
'Filesystem',
'Scrub',
- 'Heartbeat',
'System checkin',
'Update systems',
);
our @PREDEFINED_TASKS = (
- 'Loadavg',
+ 'Clearcase Storage',
'Filesystem',
+ 'Loadavg',
'Scrub',
'System checkin',
'Update systems',
);
our @PREDEFINED_SCHEDULES = (
- 'Loadavg',
+ 'Clearcase Storage',
'Filesystem',
+ 'Loadavg',
'Scrub',
'Update systems',
);
@@ -158,7 +165,7 @@ our @PREDEFINED_MULTIPLIERS = (
'Days',
);
-sub dbug ($) {
+sub dbug($) {
my ($msg) = @_;
display font ({-class => 'error'}, '
DEBUG: '). $msg;
@@ -166,7 +173,7 @@ sub dbug ($) {
return;
} # dbug
-sub displayError ($) {
+sub displayError($) {
my ($msg) = @_;
display font ({-class => 'error'}, 'Error: ') . $msg;
@@ -174,7 +181,7 @@ sub displayError ($) {
return
} # displayError;
-sub setField ($;$) {
+sub setField($;$) {
my ($field, $label) = @_;
$label ||= 'Unknown';
@@ -184,26 +191,26 @@ sub setField ($;$) {
return defined $field ? $field : $undef;
} # setField
-sub setFields ($%) {
+sub setFields($%) {
my ($label, %rec) = @_;
$rec{$_} = setField ($rec{$_}, $label)
- foreach keys %rec;
+ for keys %rec;
return %rec;
} # setFields;
-sub dumpVars (%) {
+sub dumpVars(%) {
my (%vars) = @_;
- foreach (keys %vars) {
+ for (keys %vars) {
dbug "$_: $vars{$_}";
- } # foreach
+ } # for
return;
} # dumpVars
-sub graphError ($) {
+sub graphError($) {
my ($msg) = @_;
use GD;
@@ -233,7 +240,7 @@ sub graphError ($) {
exit;
} # graphError
-sub autoScale ($) {
+sub autoScale($) {
my ($amount) = @_;
my $kbyte = 1024;
@@ -249,7 +256,7 @@ sub autoScale ($) {
return $size;
} # autoScale
-sub _makeAlertlogSelection ($$) {
+sub _makeAlertlogSelection($$) {
my ($name, $default) = @_;
$default ||= 'All';
@@ -259,7 +266,7 @@ sub _makeAlertlogSelection ($$) {
$values{All} = 'All';
$values{$$_{$name}} = $$_{$name}
- foreach ($clearadm->FindAlertlog);
+ for ($clearadm->FindAlertlog);
my $dropdown = popup_menu {
name => $name,
@@ -271,7 +278,7 @@ sub _makeAlertlogSelection ($$) {
return $dropdown;
} # _makeAlertlogSelection
-sub _makeRunlogSelection ($$) {
+sub _makeRunlogSelection($$) {
my ($name, $default) = @_;
$default ||= 'All';
@@ -282,13 +289,13 @@ sub _makeRunlogSelection ($$) {
my %values;
- foreach (@values) {
+ for (@values) {
unless ($_ eq '') {
$values{$_} = $_;
} else {
$values{NULL} = '';
} #if
- } # foreach
+ } # for
my $dropdown = popup_menu {
name => $name,
@@ -301,7 +308,7 @@ sub _makeRunlogSelection ($$) {
return $dropdown;
} # _makeRunlogSelection
-sub _makeRunlogSelectionNumeric ($$) {
+sub _makeRunlogSelectionNumeric($$) {
my ($name, $default) = @_;
$default ||= 'All';
@@ -320,15 +327,14 @@ sub _makeRunlogSelectionNumeric ($$) {
return $dropdown;
} # _makeRunlogSelection
-sub makeAlertDropdown (;$$) {
+sub makeAlertDropdown(;$$) {
my ($label, $default) = @_;
$label ||= '';
my @values;
- push @values, $$_{name}
- foreach ($clearadm->FindAlert);
+ push @values, $$_{name} for ($clearadm->FindAlert);
my $dropdown = "$label ";
$dropdown .= popup_menu {
@@ -341,7 +347,7 @@ sub makeAlertDropdown (;$$) {
return $dropdown;
} # makeAlertDropdown
-sub makeMultiplierDropdown (;$$) {
+sub makeMultiplierDropdown(;$$) {
my ($label, $default) = @_;
$label ||= '';
@@ -357,7 +363,7 @@ sub makeMultiplierDropdown (;$$) {
return $dropdown;
} # makeMultiplierDropdown
-sub makeNoMoreThanDropdown (;$$) {
+sub makeNoMoreThanDropdown(;$$) {
my ($label, $default) = @_;
$label ||= '';
@@ -373,20 +379,71 @@ sub makeNoMoreThanDropdown (;$$) {
return $dropdown;
} # makeNoMorThanDropdown
-sub makeFilesystemDropdown ($;$$$) {
+sub makeTagsDropdown($$) {
+ my ($type, $tag) = @_;
+
+ my $dropdown = ucfirst $type . ' ';
+
+ if ($type eq 'vob') {
+ my $vobs = Clearcase::Vobs->new;
+
+ $dropdown .= popup_menu {
+ name => 'tag',
+ class => 'dropdown',
+ values => [sort $vobs->vobs],
+ default => $tag,
+ };
+ } else {
+ my $views = Clearcase::Views->new;
+
+ $dropdown .= popup_menu {
+ name => 'tag',
+ class => 'dropdown',
+ values => [sort $views->views],
+ default => $tag,
+ };
+ } # if
+
+ return span {id => $type}, $dropdown;
+} # makeTagsDropdown
+
+sub makeStoragePoolDropdown($$) {
+ my ($type, $tag) = @_;
+
+ my @values;
+
+ my $dropdown = 'Storage pool ';
+
+ if ($type eq 'vob') {
+ push @values, qw(admin db cleartext derivedobj source total);
+ } else {
+ push @values, qw(admin db private total);
+ } # if
+
+ $dropdown .= popup_menu {
+ name => 'storage',
+ class => 'dropdown',
+ values => \@values,
+ default => $tag,
+ };
+
+ return span {id => $type}, $dropdown;
+} # makeStoragePoolsDropdown
+
+sub makeFilesystemDropdown($;$$$) {
my ($system, $label, $default, $onchange) = @_;
$label ||= '';
my %filesystems;
- foreach ($clearadm->FindFilesystem ($system)) {
+ for ($clearadm->FindFilesystem ($system)) {
my %filesystem = %{$_};
my $value = "$filesystem{filesystem} ($filesystem{mount})";
$filesystems{$filesystem{filesystem}} = $value;
- } # foreach
+ } # for
my $dropdown .= "$label ";
$dropdown .= popup_menu {
@@ -401,7 +458,7 @@ sub makeFilesystemDropdown ($;$$$) {
return span {id => 'filesystems'}, $dropdown;
} # makeFilesystemDropdown
-sub makeIntervalDropdown (;$$$) {
+sub makeIntervalDropdown(;$$$) {
my ($label, $default, $onchange) = @_;
$label ||= '';
@@ -413,8 +470,7 @@ sub makeIntervalDropdown (;$$$) {
'Month',
);
- $default = ucfirst lc $default
- if $default;
+ $default = ucfirst lc $default if $default;
my $dropdown = "$label ";
$dropdown .= popup_menu {
@@ -429,7 +485,7 @@ sub makeIntervalDropdown (;$$$) {
return span {id => 'scaling'}, $dropdown;
} # makeIntervalDropdown;
-sub makeNotificationDropdown (;$$) {
+sub makeNotificationDropdown(;$$) {
my ($label, $default) = @_;
$label ||= '';
@@ -437,7 +493,7 @@ sub makeNotificationDropdown (;$$) {
my @values;
push @values, $$_{name}
- foreach ($clearadm->FindNotification);
+ for ($clearadm->FindNotification);
my $dropdown = "$label ";
$dropdown .= popup_menu {
@@ -450,7 +506,7 @@ sub makeNotificationDropdown (;$$) {
return $dropdown;
} # makeNotificationDropdown
-sub makeRestartableDropdown (;$$) {
+sub makeRestartableDropdown(;$$) {
my ($label, $default) = @_;
$label ||= '';
@@ -471,19 +527,19 @@ sub makeRestartableDropdown (;$$) {
return $dropdown;
} # makeRestartableDropdown
-sub makeSystemDropdown (;$$$%) {
+sub makeSystemDropdown(;$$$%) {
my ($label, $default, $onchange, %systems) = @_;
$label ||= '';
- foreach ($clearadm->FindSystem) {
+ for ($clearadm->FindSystem) {
my %system = %{$_};
my $value = $system{name};
$value .= $system{alias} ? " ($system{alias})" : '';
$systems{$system{name}} = $value;
- } # foreach
+ } # for
my $systemDropdown .= "$label ";
$systemDropdown .= popup_menu {
@@ -498,7 +554,7 @@ sub makeSystemDropdown (;$$$%) {
return span {id => 'systems'}, $systemDropdown;
} # makeSystemDropdown
-sub makeTaskDropdown (;$$) {
+sub makeTaskDropdown(;$$) {
my ($label, $default) = @_;
$label ||= '';
@@ -506,7 +562,7 @@ sub makeTaskDropdown (;$$) {
my @values;
push @values, $$_{name}
- foreach ($clearadm->FindTask);
+ for ($clearadm->FindTask);
my $taskDropdown = "$label ";
$taskDropdown .= popup_menu {
@@ -519,7 +575,7 @@ sub makeTaskDropdown (;$$) {
return $taskDropdown;
} # makeTaskDropdown
-sub makeTimeDropdown ($$$;$$$$$) {
+sub makeTimeDropdown($$$;$$$$$) {
my (
$table,
$elementID,
@@ -541,10 +597,10 @@ sub makeTimeDropdown ($$$;$$$$$) {
if ($table =~ /loadavg/i) {
push @times, $$_{timestamp}
- foreach ($clearadm->GetLoadavg ($system, undef, undef, undef, $interval));
+ for ($clearadm->GetLoadavg ($system, undef, undef, undef, $interval));
} elsif ($table =~ /filesystem/i) {
push @times, $$_{timestamp}
- foreach ($clearadm->GetFS ($system, $filesystem, undef, undef, undef, $interval));
+ for ($clearadm->GetFS ($system, $filesystem, undef, undef, undef, $interval));
} # if
push @times, 'Latest';
@@ -564,7 +620,7 @@ sub makeTimeDropdown ($$$;$$$$$) {
return $timeDropdown;
} # makeTimeDropdown
-sub heading (;$$) {
+sub heading(;$$) {
my ($title, $type) = @_;
if ($title) {
@@ -575,17 +631,17 @@ sub heading (;$$) {
display header;
display start_html {
- -title => $title,
- -author => 'Andrew DeFaria ',
- -meta => {
- keywords => 'ClearSCM Clearadm',
+ -title => $title,
+ -author => 'Andrew DeFaria ',
+ -meta => {
+ keywords => 'ClearSCM Clearadm',
copyright => 'Copyright (c) ClearSCM, Inc. 2010, All rights reserved',
- },
- -script => [{
- -language => 'JavaScript',
- -src => 'clearadm.js',
- }],
- -style => ['clearadm.css', 'clearmenu.css'],
+ },
+ -script => [{
+ -language => 'JavaScript',
+ -src => 'clearadm.js',
+ }],
+ -style => ['clearadm.css', 'clearmenu.css'],
}, $title;
return if $type;
@@ -609,7 +665,7 @@ sub heading (;$$) {
display start_li;
display a {href => 'systems.cgi'}, "Systems$ieTableWrapStart";
display start_ul;
- foreach (@allSystems) {
+ for (sort @allSystems) {
my %system = %{$_};
my $sysName = ucfirst $system{name};
$sysName .= " ($system{alias})"
@@ -618,7 +674,7 @@ sub heading (;$$) {
display li a {
href => "systemdetails.cgi?system=$system{name}"
}, ucfirst " $sysName";
- } # foreach
+ } # for
display end_ul;
display $ieTableWrapEnd;
display end_li;
@@ -630,7 +686,7 @@ sub heading (;$$) {
display start_li;
display a {href => 'filesystems.cgi'}, "Filesystems$ieTableWrapStart";
display start_ul;
- foreach (@allSystems) {
+ for (@allSystems) {
my %system = %{$_};
my $sysName = ucfirst $system{name};
$sysName .= " ($system{alias})"
@@ -639,49 +695,16 @@ sub heading (;$$) {
display li a {
href => "filesystems.cgi?system=$system{name}"
}, ucfirst " $sysName";
- } # foreach
+ } # for
display end_ul;
display $ieTableWrapEnd;
display end_li;
display end_ul;
- # Servers
- display start_ul;
- display start_li;
- display a {href => '#'}, "Servers$ieTableWrapStart";
- display start_ul {class => 'skinny'};
- display start_li;
- display start_a {href => 'vobs.cgi'};
- display "VOB»$ieTableWrapStart";
- display start_ul;
- display li a {href => "systemdetails.cgi?system=jupiter"}, ' Jupiter (defaria.com)';
- display end_ul;
- display $ieTableWrapEnd;
- display end_li;
-
- display start_li;
- display start_a {href => 'views.cgi'};
- display "View»$ieTableWrapStart";
- display start_ul;
- display li a {href => "systemdetails.cgi?system=earth"}, ' Earth';
- display li a {href => "systemdetails.cgi?system=mars"}, ' Mars';
- display end_ul;
- display $ieTableWrapEnd;
- display end_ul;
- display $ieTableWrapEnd;
- display end_li;
- display end_ul;
-
# Vobs
display start_ul;
display start_li;
- display a {href => 'vobs.cgi'}, "VOBs$ieTableWrapStart";
- display start_ul;
- display li a {href => '#'}, ' /vobs/clearscm';
- display li a {href => '#'}, ' /vobs/clearadm';
- display li a {href => '#'}, ' /vobs/test';
- display li a {href => '#'}, ' /vobs/test2';
- display end_ul;
+ display a {href => 'vobservers.cgi'}, " VOBs$ieTableWrapStart";
display $ieTableWrapEnd;
display end_li;
display end_ul;
@@ -689,11 +712,7 @@ sub heading (;$$) {
# Views
display start_ul;
display start_li;
- display a {href => 'views.cgi'}, "Views$ieTableWrapStart";
- display start_ul;
- display li a {href => 'viewager.cgi'}, ' View Ager';
- display li a {href => '#'}, ' Releast View';
- display end_ul;
+ display a {href => 'viewager.cgi'}, "Views$ieTableWrapStart";
display $ieTableWrapEnd;
display end_li;
display end_ul;
@@ -741,7 +760,7 @@ sub heading (;$$) {
return;
} # heading
-sub displayAlert (;$) {
+sub displayAlert(;$) {
my ($alert) = @_;
display start_table {cellspacing => 1};
@@ -754,7 +773,7 @@ sub displayAlert (;$) {
display th {class => 'labelCentered'}, 'Category';
display end_Tr;
- foreach ($clearadm->FindAlert ($alert)) {
+ for ($clearadm->FindAlert ($alert)) {
my %alert = %{$_};
$alert{who} = setField $alert{who}, 'System Administrator';
@@ -827,7 +846,7 @@ sub displayAlert (;$) {
display td {class => 'data'},
(InArray $alert{name}, @PREDEFINED_ALERTS) ? 'Predefined' : 'User Defined';
display end_Tr;
- } # foreach
+ } # for
display end_table;
@@ -841,7 +860,7 @@ sub displayAlert (;$) {
return;
} # DisplayAlerts
-sub displayAlertlog (%) {
+sub displayAlertlog(%) {
my (%opts) = @_;
my $optsChanged;
@@ -1018,7 +1037,7 @@ sub displayAlertlog (%) {
my $i = $opts{start};
- foreach ($clearadm->FindAlertlog (
+ for ($clearadm->FindAlertlog (
$opts{alert},
$opts{system},
$opts{notification},
@@ -1055,7 +1074,7 @@ sub displayAlertlog (%) {
}, $alertlog{runlog};
display td {class => 'data'}, $alertlog{message};
display end_Tr;
- } # foreach
+ } # for
display end_form;
@@ -1064,7 +1083,7 @@ sub displayAlertlog (%) {
return;
} # displayAlertlog
-sub displayFilesystem ($) {
+sub displayFilesystem($) {
my ($systemName) = @_;
display start_table {cellspacing => 1, width => '98%'};
@@ -1083,7 +1102,7 @@ sub displayFilesystem ($) {
display th {class => 'labelCentered'}, 'Usage';
display end_Tr;
- foreach ($clearadm->FindSystem ($systemName)) {
+ for (sort { $a->{mount} cmp $b->{mount} } $clearadm->FindSystem ($systemName)) {
my %system = %{$_};
%system = setFields ('N/A', %system);
@@ -1092,7 +1111,7 @@ sub displayFilesystem ($) {
? a {-href => "mailto:$system{email}"}, $system{admin}
: $system{admin};
- foreach ($clearadm->FindFilesystem ($system{name})) {
+ for ($clearadm->FindFilesystem ($system{name})) {
my %filesystem = %{$_};
my %fs = $clearadm->GetLatestFS ($system{name}, $filesystem{filesystem});
@@ -1192,25 +1211,29 @@ sub displayFilesystem ($) {
display td {class => $classRightTop}, "$used ($usedPct%)
",
font {class => 'unknown'}, "$fs{timestamp}";
display td {class => $classRightTop}, "$filesystem{threshold}%";
+
+ my $image = $filesystem{fssmall}
+ ? "data:image/png;base64,$filesystem{fssmall}"
+ : "plotfs.cgi?system=$system{name}&filesystem=$filesystem{filesystem}&tiny=1";
+
display td {class => $class},
a {href =>
"plot.cgi?type=filesystem&system=$system{name}"
. "&filesystem=$filesystem{filesystem}&scaling=Day&points=7"
}, img {
- src => "plotfs.cgi?system=$system{name}"
- . "&filesystem=$filesystem{filesystem}&tiny=1",
+ src => $image,
border => 0,
};
display end_Tr;
- } # foreach
- } # foreach
+ } # for
+ } # for
display end_table;
return;
} # displayFilesystem
-sub displayNotification (;$) {
+sub displayNotification(;$) {
my ($notification) = @_;
display start_table {cellspacing => 1};
@@ -1224,7 +1247,7 @@ sub displayNotification (;$) {
display th {class => 'labelCentered'}, 'Category';
display end_Tr;
- foreach ($clearadm->FindNotification ($notification)) {
+ for ($clearadm->FindNotification ($notification)) {
my %notification= setFields 'N/A', %{$_};
display start_Tr;
@@ -1296,7 +1319,7 @@ sub displayNotification (;$) {
: 'User Defined';
display end_Tr;
- } # foreach
+ } # for
display end_table;
@@ -1310,30 +1333,29 @@ sub displayNotification (;$) {
return;
} # displayNotification
-sub displayRunlog (%) {
+sub displayRunlog(%) {
my (%opts) = @_;
my $optsChanged;
- unless (($opts{oldtask} and $opts{task} or
- $opts{oldtask} eq $opts{task}) and
- ($opts{oldsystem} and $opts{system} or
- $opts{oldsystem} eq $opts{system}) and
- ($opts{oldnot} and $opts{not} or
- $opts{oldnot} eq $opts{not}) and
- ($opts{oldstatus} and $opts{status} or
- $opts{oldstatus} eq $opts{status})) {
- $optsChanged = 1;
- } # unless
+ for (qw(task system not status)) {
+ my $old = "old$_";
+ if (($opts{$old} and $opts{$_}) and ($opts{$old} ne $opts{$_})) {
+ $optsChanged = 1;
+ last;
+ } # if
+ } # for
- my $condition;
+ my $condition = '';
unless ($opts{id}) {
- $condition = "task like '%";
- $condition .= $opts{task} ? $opts{task} : '';
- $condition .= "%'";
+ if ($opts{task} !~ /all/i) {
+ $condition = "task like '%";
+ $condition .= $opts{task} ? $opts{task} : '';
+ $condition .= "%'";
+ } # if
- if ($opts{system}) {
+ if ($opts{system} !~ /all/i) {
if ($opts{system} eq '') {
$condition .= ' and system is null';
undef $opts{system}
@@ -1342,7 +1364,7 @@ sub displayRunlog (%) {
} # if
} # if
- if (defined $opts{status}) {
+ if ($opts{status} !~ /all/i) {
$condition .= ' and ';
unless ($opts{not}) {
$condition .= "status=$opts{status}";
@@ -1490,13 +1512,13 @@ sub displayRunlog (%) {
my $status;
- if (defined $opts{status}) {
+ if ($opts{status}) {
if ($opts{status} !~ /all/i) {
$status = $opts{not} ne 'true' ? $opts{status} : "!$opts{status}";
} # if
} # if
- foreach ($clearadm->FindRunlog (
+ for ($clearadm->FindRunlog (
$opts{task},
$opts{system},
$status,
@@ -1522,7 +1544,7 @@ sub displayRunlog (%) {
display td {class => 'data'}, a {
href => "tasks.cgi?task=$runlog{task}"
}, $runlog{task};
- display td {class => 'data'}, $runlog{system} eq 'Localhost'
+ display td {class => 'data'}, $runlog{system} eq 'localhost'
? $runlog{system}
: a {
href => "systemdetails.cgi?system=$runlog{system}"
@@ -1536,14 +1558,14 @@ sub displayRunlog (%) {
display td {class => $class, width => '50%'}, $message;
display end_Tr;
- } # foreach
+ } # for
display end_table;
return;
} # displayRunlog
-sub displaySchedule () {
+sub displaySchedule() {
display start_table {cellspacing => 1};
display start_Tr;
@@ -1556,7 +1578,7 @@ sub displaySchedule () {
display th {class => 'labelCentered'}, 'Category';
display end_Tr;
- foreach ($clearadm->FindSchedule) {
+ for ($clearadm->FindSchedule) {
my %schedule = setFields 'N/A', %{$_};
display start_Tr;
@@ -1634,7 +1656,7 @@ sub displaySchedule () {
: 'User Defined';
display end_Tr;
- } # foreach
+ } # for
display end_table;
@@ -1648,7 +1670,7 @@ sub displaySchedule () {
return;
} # displaySchedule
-sub displaySystem ($) {
+sub displaySystem($) {
my ($systemName) = @_;
my %system = $clearadm->GetSystem ($systemName);
@@ -1765,7 +1787,7 @@ sub displaySystem ($) {
a {href =>
"plot.cgi?type=loadavg&system=$system{name}&scaling=Hour&points=24"
}, img {
- src => "plotloadavg.cgi?system=$system{name}&tiny=1",
+ src => "data:image/png;base64,$system{loadavgsmall}",
border => 0,
};
@@ -1805,7 +1827,7 @@ sub displaySystem ($) {
display th {class => 'labelCentered'}, 'Usage';
display end_Tr;
- foreach ($clearadm->FindFilesystem ($system{name})) {
+ for ($clearadm->FindFilesystem ($system{name})) {
my %filesystem = %{$_};
my %fs = $clearadm->GetLatestFS (
@@ -1830,58 +1852,59 @@ sub displaySystem ($) {
my $classRight = $class . 'Right';
display start_Tr;
- display start_td {class => 'data'};
+ display start_td {class => 'data'};
- my $areYouSure = 'Are you sure you want to delete '
- . "$system{name}:$filesystem{filesystem}?" . '\n'
- . 'Doing so will remove all records related to this\n'
- . 'filesystem and its history.';
+ my $areYouSure = 'Are you sure you want to delete '
+ . "$system{name}:$filesystem{filesystem}?" . '\n'
+ . 'Doing so will remove all records related to this\n'
+ . 'filesystem and its history.';
- display start_form {
- method => 'post',
- action => 'processfilesystem.cgi',
- };
+ display start_form {
+ method => 'post',
+ action => 'processfilesystem.cgi',
+ };
- display input {
- type => 'hidden',
- name => 'system',
- value => $system{name},
- };
- display input {
- type => 'hidden',
- name => 'filesystem',
- value => $filesystem{filesystem},
- };
+ display input {
+ type => 'hidden',
+ name => 'system',
+ value => $system{name},
+ };
+ display input {
+ type => 'hidden',
+ name => 'filesystem',
+ value => $filesystem{filesystem},
+ };
- display input {
- name => 'delete',
- type => 'image',
- src => 'delete.png',
- alt => 'Delete',
- value => 'Delete',
- title => 'Delete',
- onclick => "return AreYouSure ('$areYouSure');"
- };
- display input {
- name => 'edit',
- type => 'image',
- src => 'edit.png',
- alt => 'Edit',
- value => 'Edit',
- title => 'Edit',
+ display input {
+ name => 'delete',
+ type => 'image',
+ src => 'delete.png',
+ alt => 'Delete',
+ value => 'Delete',
+ title => 'Delete',
+ onclick => "return AreYouSure ('$areYouSure');"
+ };
+ display input {
+ name => 'edit',
+ type => 'image',
+ src => 'edit.png',
+ alt => 'Edit',
+ value => 'Edit',
+ title => 'Edit',
+ };
+
+ if ($filesystem{notification}) {
+ display a {
+ href => "alertlog.cgi?system=$filesystem{system}"}, img {
+ src => 'alert.png',
+ border => 0,
+ alt => 'Alert!',
+ title => 'This filesystem has alerts',
};
+ } # if
- if ($filesystem{notification}) {
- display a {
- href => "alertlog.cgi?system=$filesystem{system}"}, img {
- src => 'alert.png',
- border => 0,
- alt => 'Alert!',
- title => 'This filesystem has alerts',
- };
- } # if
+ display end_form;
- display end_form;
display td {class => $class}, $filesystem{filesystem};
display td {class => $classCentered}, $filesystem{fstype};
display td {class => $class}, $filesystem{mount};
@@ -1897,20 +1920,18 @@ sub displaySystem ($) {
. "&filesystem=$filesystem{filesystem}"
. "&scaling=Day&points=7"
}, img {
- src => "plotfs.cgi?system=$system{name}&"
- . "filesystem=$filesystem{filesystem}"
- . '&tiny=1',
- border => 0,
+ src => "data:image/png;base64,$filesystem{fssmall}",
+ border => 0,
};
display end_Tr;
- } # foreach
+ } # for
display end_table;
return;
} # displaySystem
-sub displayTask (;$) {
+sub displayTask(;$) {
my ($task) = @_;
display start_table {cellspacing => 1, width => '98%'};
@@ -1925,7 +1946,7 @@ sub displayTask (;$) {
display th {class => 'labelCentered'}, 'Category';
display end_Tr;
- foreach ($clearadm->FindTask ($task)) {
+ for ($clearadm->FindTask ($task)) {
my %task = %{$_};
$task{system} = 'All Systems'
@@ -1995,7 +2016,7 @@ sub displayTask (;$) {
display td {class => 'data'},
(InArray $task{name}, @PREDEFINED_TASKS) ? 'Predefined' : 'User Defined';
display end_Tr;
- } # foreach
+ } # for
display end_table;
@@ -2009,7 +2030,7 @@ sub displayTask (;$) {
return;
} # DisplayAlerts
-sub editAlert (;$) {
+sub editAlert(;$) {
my ($alert) = @_;
display start_form (
@@ -2090,7 +2111,7 @@ sub editAlert (;$) {
return;
} # editAlert
-sub editFilesystem ($$) {
+sub editFilesystem($$) {
my ($system, $filesystem) = @_;
display start_form (
@@ -2191,7 +2212,7 @@ sub editFilesystem ($$) {
return;
} # editFilesytem
-sub editNotification (;$) {
+sub editNotification(;$) {
my ($notification) = @_;
display start_form (
@@ -2276,7 +2297,7 @@ sub editNotification (;$) {
return;
} # editNotification
-sub editSchedule (;$) {
+sub editSchedule(;$) {
my ($schedule) = @_;
display start_form (
@@ -2379,7 +2400,7 @@ sub editSchedule (;$) {
return;
} # editSchedule
-sub editSystem (;$) {
+sub editSystem(;$) {
my ($system) = @_;
display start_form (
@@ -2564,7 +2585,7 @@ sub editSystem (;$) {
return;
} # editSystem
-sub editTask (;$) {
+sub editTask(;$) {
my ($task) = @_;
display start_form (
@@ -2619,10 +2640,9 @@ sub editTask (;$) {
};
my $systemDropdown = makeSystemDropdown (
undef,
- $task{system} ? $task{system} : 'All Systems',
+ $task{system} ? $task{system} : 'localhost',
undef, (
- 'All systems' => undef,
- 'Localhost' => 'Localhost',
+ 'localhost' => 'localhost',
),
);
@@ -2666,7 +2686,7 @@ sub editTask (;$) {
return;
} # editTask
-sub footing () {
+sub footing() {
my $clearscm = a {-href => 'http://clearscm.com'}, 'ClearSCM, Inc.';
# Figure out which script by using CLEARADM_BASE.