diff --git a/Makefile b/Makefile index 1c71541b..d9cdb67f 100644 --- a/Makefile +++ b/Makefile @@ -25,26 +25,25 @@ TARGETS = conf_default.php gweb.spec version.php default: $(TARGETS) clean: - rm -rf $(TARGETS) $(DIST_DIR) $(DIST_TARBALL) + rm -rf $(TARGETS) $(DIST_DIR) $(DIST_TARBALL) rpmbuild conf_default.php: conf_default.php.in sed -e "s|@varstatedir@|$(GWEB_STATEDIR)|" conf_default.php.in > conf_default.php gweb.spec: gweb.spec.in - sed -e s/@GWEB_VERSION@/$(GWEB_VERSION)/ -e "s|@varstatedir@|$(GWEB_STATEDIR)|" gweb.spec.in > gweb.spec + sed -e s/@GWEB_VERSION@/$(GWEB_VERSION)/ -e "s|@varstatedir@|$(GWEB_STATEDIR)|" -e "s|@varapacheuser@|$(APACHE_USER)|g" gweb.spec.in > gweb.spec version.php: version.php.in sed -e s/@GWEB_VERSION@/$(GWEB_VERSION)/ version.php.in > version.php dist-dir: default - rsync --exclude "$(DIST_DIR)" --exclude ".git*" --exclude "*~" -a . $(DIST_DIR) && \ - cp -a $(TARGETS) $(DIST_DIR) + rsync --exclude "rpmbuild" --exclude "*.gz" --exclude "Makefile" --exclude "$(DIST_DIR)" --exclude ".git*" --exclude "*.in" --exclude "*~" --exclude "#*#" --exclude "gweb.spec" -a . $(DIST_DIR) install: dist-dir - mkdir -p $(DESTDIR)/$(GWEB_DWOO) && \ - rsync --exclude debian -a $(DIST_DIR)/conf/ $(DESTDIR)/$(GANGLIA_STATEDIR)/conf && \ - cp -a $(DIST_DIR)/* $(DESTDIR) && \ - chown -R $(APACHE_USER):$(APACHE_USER) $(DESTDIR)/$(GWEB_DWOO) $(DESTDIR)/$(GANGLIA_STATEDIR)/conf + mkdir -p $(GWEB_DWOO) && \ + rsync -a $(DIST_DIR)/conf/ $(GANGLIA_STATEDIR)/conf && \ + rsync --exclude "conf" -a $(DIST_DIR)/* $(DESTDIR) && \ + chown -R $(APACHE_USER):$(APACHE_USER) $(GWEB_DWOO) $(GANGLIA_STATEDIR)/conf dist-gzip: dist-dir if [ -f $(DIST_TARBALL) ]; then \ @@ -52,6 +51,16 @@ dist-gzip: dist-dir fi ;\ tar -czf $(DIST_TARBALL) $(DIST_DIR)/* +rpm: dist-gzip gweb.spec + rm -rf rpmbuild + mkdir rpmbuild + mkdir rpmbuild/SOURCES + mkdir rpmbuild/BUILD + mkdir rpmbuild/RPMS + mkdir rpmbuild/SRPMS + cp $(DIST_TARBALL) rpmbuild/SOURCES + rpmbuild --define '_topdir $(PWD)/rpmbuild' -bb gweb.spec + uninstall: rm -rf $(DESTDIR) $(GWEB_DWOO) $(GANGLIA_STATEDIR)/conf diff --git a/conf_default.php.in b/conf_default.php.in index 0bc72ebf..72de1062 100644 --- a/conf_default.php.in +++ b/conf_default.php.in @@ -31,8 +31,8 @@ $conf['gmetad_root'] = "@varstatedir@/ganglia"; $conf['rrds'] = "${conf['gmetad_root']}/rrds"; # Where Dwoo (PHP templating engine) store compiled templates -$conf['dwoo_compiled_dir'] = "${conf['gweb_root']}/lib/dwoo/compiled"; -$conf['dwoo_cache_dir'] = "${conf['gweb_root']}/lib/dwoo/cache"; +$conf['dwoo_compiled_dir'] = "${conf['gmetad_root']}/dwoo/compiled"; +$conf['dwoo_cache_dir'] = "${conf['gmetad_root']}/dwoo/cache"; # Where to store web-based configuration $conf['views_dir'] = $conf['gmetad_root'] . '/conf'; @@ -316,14 +316,16 @@ $conf['overlay_events_line_type'] = "dashed"; $conf['overlay_events_provider'] = "json"; # Where is the Overlay events file stored $conf['overlay_events_file'] = $conf['conf_dir'] . "/events.json"; -$conf['overlay_events_color_map_file'] = $conf['conf_dir'] . "/event_color.json"; + # If using MDB2, connection string: -$conf['overlay_events_dsn'] = "mysql://dbuser:dbpasword@localhost/ganglia"; +$conf['overlay_events_dsn'] = "mysql://dbuser:dbpassword@localhost/ganglia"; + +$conf['overlay_events_color_map_file'] = $conf['conf_dir'] . "/event_color.json"; # For event shading. Value in hex, 'FF' = 100% opaque. # the _shade_ value should be less than _tick_ $conf['overlay_events_tick_alpha'] = '30'; -$conf['overlay_events_shade_alpha'] = '50'; +$conf['overlay_events_shade_alpha'] = '20'; # Colors to use e.g. in graph_colors $conf['graph_colors'] = array("0000A3", "FF3300", "FFCC33", "00CC66", "B88A00", "33FFCC", "809900", "FF3366", "FF33CC", "CC33FF", "CCFF33", "FFFF66", "33CCFF"); diff --git a/graph.php b/graph.php index 05eff49d..547966f6 100644 --- a/graph.php +++ b/graph.php @@ -38,6 +38,7 @@ sanitize($_GET["l"]) : NULL; $summary = isset($_GET["su"]) ? 1 : 0; $debug = isset($_GET['debug']) ? clean_number(sanitize($_GET["debug"])) : 0; +$showEvents = isset($_GET["event"]) ? sanitize ($_GET["event"]) : "show"; $command = ''; $graphite_url = ''; @@ -625,7 +626,8 @@ // Nagios event integration support ////////////////////////////////////////////////////////////////////////////// $nagios_events = array(); -if ( $conf['overlay_nagios_events'] && +if ( $showEvents == "show" && + $conf['overlay_nagios_events'] && ! in_array($range, $conf['overlay_events_exclude_ranges']) ) { $nagios_pull_url = $conf['overlay_nagios_base_url'] . @@ -652,7 +654,10 @@ ////////////////////////////////////////////////////////////////////////////// // Check whether user wants to overlay events on graphs ////////////////////////////////////////////////////////////////////////////// -if ( $conf['overlay_events'] && $conf['graph_engine'] == "rrdtool" && ! in_array($range, $conf['overlay_events_exclude_ranges']) ) { +if ( $showEvents == "show" && + $conf['overlay_events'] && + $conf['graph_engine'] == "rrdtool" && + ! in_array($range, $conf['overlay_events_exclude_ranges']) ) { $color_count = sizeof($conf['graph_colors']); $counter = 0; diff --git a/graph_all_periods.php b/graph_all_periods.php index 986db566..060dabcf 100644 --- a/graph_all_periods.php +++ b/graph_all_periods.php @@ -22,6 +22,7 @@ + Decompose'; } - print ' ' . + print ' '; + + $graphId = 'graph_img_' . $key; + + print ' ' . '
'; // If we are using flot we need to use a div instead of an image reference @@ -172,7 +191,7 @@ } else { - print ''; + print ''; } diff --git a/gweb.spec.in b/gweb.spec.in index 6179bc1b..79948481 100644 --- a/gweb.spec.in +++ b/gweb.spec.in @@ -14,9 +14,9 @@ Buildroot: %{_tmppath}/%{name}-%{version}-buildroot Obsoletes: ganglia-webfrontend Requires: php >= 5, php-gd %if 0%{?suse_version} -%define web_prefixdir /srv/www/htdocs/ganglia +%define web_prefixdir /srv/www/htdocs/gweb %else -%define web_prefixdir /var/www/html/ganglia +%define web_prefixdir /var/www/html/gweb %endif Prefix: %{web_prefixdir} BuildArchitectures: noarch @@ -37,29 +37,20 @@ written in the PHP5 language and uses the Dwoo templating engine. %__mkdir -p $RPM_BUILD_ROOT/%{web_prefixdir} %__cp -rf * $RPM_BUILD_ROOT/%{web_prefixdir} -%__rm -f $RPM_BUILD_ROOT/%{web_prefixdir}/bootstrap -%__rm -f $RPM_BUILD_ROOT/%{web_prefixdir}/Makefile* -%__rm -f $RPM_BUILD_ROOT/%{web_prefixdir}/*.in +%__rm -rf $RPM_BUILD_ROOT/%{web_prefixdir}/conf %__install -d -m 0755 $RPM_BUILD_ROOT@varstatedir@/ganglia/filters +%__install -d -m 0755 $RPM_BUILD_ROOT@varstatedir@/ganglia/conf +%__cp -rf conf/* $RPM_BUILD_ROOT@varstatedir@/ganglia/conf %__install -d -m 0755 $RPM_BUILD_ROOT@varstatedir@/ganglia/dwoo %files %defattr(-,root,root) %attr(0755,nobody,nobody)@varstatedir@/ganglia/filters -%attr(0755,apache,apache)@varstatedir@/ganglia/dwoo -%dir %{web_prefixdir}/ -#%dir %{web_prefixdir}/conf -#%dir %{web_prefixdir}/css -#%dir %{web_prefixdir}/dwoo -#%dir %{web_prefixdir}/img -#%dir %{web_prefixdir}/js +%attr(0755,@varapacheuser@,@varapacheuser@)@varstatedir@/ganglia/conf +%attr(0755,@varapacheuser@,@varapacheuser@)@varstatedir@/ganglia/dwoo %{web_prefixdir}/* +/var/lib/ganglia/conf/* %config(noreplace) %{web_prefixdir}/conf_default.php -#%{web_prefixdir}/conf/* -#%{web_prefixdir}/css/* -#%{web_prefixdir}/dwoo/* -#%{web_prefixdir}/img/* -#%{web_prefixdir}/js/* %clean %__rm -rf $RPM_BUILD_ROOT diff --git a/js/jquery.ba-bbq.min.js b/js/jquery.ba-bbq.min.js new file mode 100644 index 00000000..bcbf2483 --- /dev/null +++ b/js/jquery.ba-bbq.min.js @@ -0,0 +1,18 @@ +/* + * jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010 + * http://benalman.com/projects/jquery-bbq-plugin/ + * + * Copyright (c) 2010 "Cowboy" Ben Alman + * Dual licensed under the MIT and GPL licenses. + * http://benalman.com/about/license/ + */ +(function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.noEscape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this); \ No newline at end of file diff --git a/styles.css b/styles.css index f641e187..9e08bcee 100644 --- a/styles.css +++ b/styles.css @@ -407,3 +407,18 @@ button.shiny-blue { .ui-timepicker-div dl dt{ height: 25px; } .ui-timepicker-div dl dd{ margin: -25px 0 10px 65px; } .ui-timepicker-div td { font-size: 90%; } + +label[class~="show_event_text"] span.ui-button-text { + border-top: 1px solid; + border-right: 1px solid; + border-bottom: 1px solid; + border-left: 1px solid; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + -ms-border-radius: 4px; + -o-border-radius: 4px; + border-radius: 4px; + font: 8px "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif; + padding: 1px 2px 1px 2px; + display:inline; +} \ No newline at end of file