X-Git-Url: http://git.onelab.eu/?p=myops.git;a=blobdiff_plain;f=web%2Fview%2Findex.php;fp=web%2Fview%2Findex.php;h=8d47793fb6475ff634fd951ff1868304b9113921;hp=0000000000000000000000000000000000000000;hb=85070b3d456667f238051af1a2f1f2a0c12300ab;hpb=607f0e13927eb18075c375fa9ba5527da4fcbb44
diff --git a/web/view/index.php b/web/view/index.php
new file mode 100644
index 0000000..8d47793
--- /dev/null
+++ b/web/view/index.php
@@ -0,0 +1,75 @@
+
+
MyOps-View
+
+
+
+
+
+ 'False',
+ 'width' => '900',
+ 'height' => '500' );
+
+print "Page rendered at " . date("Y-m-d H:i:s e") . ". Refreshes every 10 minutes.";
+$url = "http://" . $_SERVER['SERVER_NAME'] . ":5984/myops/_design/myops/index.html";
+print "
Raw MyOps-Query";
+
+$tag = NULL;
+$show_all_default = True;
+$tagcount = 0;
+$tag_matches = False;
+$t = "";
+if ( isset($_REQUEST['tag']) )
+{
+ $tag = $_REQUEST['tag'];
+ $show_all_default = False;
+}
+
+# there are three cases
+# show thumbnails of everything
+# show thumbnails of just one tag
+# show large version of a thumbnail
+
+foreach ( $f_list as $url )
+{
+ $url = trim($url);
+ #print_r($show_all_default); print("sad
\n");
+ #print_r($tag); print(": tag
\n");
+ #print_r(isset($tag)); print(": tag
\n");
+ #print_r($tagcount); print(": tagcount
\n");
+ #print_r($tag_matches); print(": tag_matches
\n");
+ #print_r(preg_match("/#/", $url) > 0); print(": preg_match(#)
\n");
+ #print_r(strcmp(substr($url,1), $tag)); print(": strcmp: " . substr($url, 1) . "--" . $tag . "
\n");
+ if ( $show_all_default || isset($tag) )
+ {
+ if ( preg_match("/#/", $url) > 0 )
+ {
+ if ( strcmp(substr($url,1), $tag) == 0 )
+ {
+ $tag_matches = True;
+ } else {
+ $tag_matches = False;
+ }
+ if ( $tag_matches || $show_all_default ) {
+ if ( $tagcount >= 4 && $t != "") {
+ print "" . ($tagcount-4) ." more graphs...\n";
+ }
+ $t = substr($url, 1);
+ print "
\n";
+ $tagcount = 0;
+ }
+ } else {
+ if ( ( ( $tagcount < 4 && $show_all_default ) || $tag_matches ) && preg_match("/http/", $url) > 0 ) {
+ print "\n";
+ }
+ $tagcount += 1;
+ }
+ }
+}
+
+?>
+
+