DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:rack

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
plugin:rack [2012-08-16 18:35] 216.240.30.5plugin:rack [2017-11-07 15:30] 185.75.2.10
Line 1: Line 1:
-====== rack plugin ======+====== rack Plugin ======
  
 ---- plugin ---- ---- plugin ----
-description: Displays an elevation of a datacenter rack.+description: Displays an elevation of a datacenter rack
 author     : Tyler Bletsch author     : Tyler Bletsch
 email      : Tyler.Bletsch@netapp.com email      : Tyler.Bletsch@netapp.com
Line 10: Line 10:
 depends    :  depends    : 
 conflicts  conflicts 
-similar    :  +similar    : advrack 
-tags       : media, images, diagram+tags       : media, images, diagram, cage, rack, server
  
-downloadurl: http://dsss.be/f/dat/rack-20120816.0.zip+downloadurl: http://dsss.be/f/dat/rack-20120816.1.zip
 ---- ----
 +
 +
 +<rack name=A20 height=16>
 +# This line is a comment, and will be ignored.
 +
 +# Here's a 4U server.  We just give the location, size, model, and name:
 +1 4 "IBM x3950" webserver1
 +
 +# Here's another server with a comment appended and a link to a web page:
 +5 4 "HP DL380" webdemo  link:http://company.com/bob/  On loan from Bob.
 +
 +# There's some empty space in the rack here, but there's no need to make a note of it.
 +
 +# If the model or name doesn't have any spaces, you can drop the quotes.
 +# Also, the name field is optional.
 +12 1 Cableguide
 +
 +# The color is automatically picked based on the model, unless you override it.  
 +# This unknown device will be gray by default.
 +13 1 "Crazytown 9000" crazy1
 +
 +# To override the color, just specify a #RRGGBB HTML color after the model/name.  We'll make this one yellow:
 +14 1 "Crazytown 9000" crazy2 #FFFF00 link:http://example.com/
 +</rack>
  
 ===== Download and Installation ===== ===== Download and Installation =====
Line 20: Line 44:
 Download and install the plugin using the [[plugin:plugin|Plugin Manager]] using the following URL. Refer to [[:Plugins]] on how to install plugins manually. Download and install the plugin using the [[plugin:plugin|Plugin Manager]] using the following URL. Refer to [[:Plugins]] on how to install plugins manually.
  
-  * [[http://dsss.be/f/dat/rack-20120816.0.zip|Rack 20120816.0]]+  * [[http://dsss.be/f/dat/rack-20120816.1.zip|Rack 20120816.1]]
   * Old versions:   * Old versions:
 +    * [[http://dsss.be/f/dat/rack-20120816.0.zip|Rack 20120816.0]]
     * [[http://dsss.be/f/dat/rack-20100301.0.zip|Rack 20100301.0]]     * [[http://dsss.be/f/dat/rack-20100301.0.zip|Rack 20100301.0]]
     * [[http://dsss.be/f/dat/rack-20100118.0.zip|Rack 20100118.0]]     * [[http://dsss.be/f/dat/rack-20100118.0.zip|Rack 20100118.0]]
Line 30: Line 55:
  
 ===== Update notes ===== ===== Update notes =====
 +**20120816.1**: Make "show CSV" toggleable and a few tiny tweaks.
 +
 **20120816.0**: (1) Added "show CSV" option at the bottom for easy exporting to a spreadsheet.  (2) Committed the link improvements suggested by [[user>schplurtz]] below. **20120816.0**: (1) Added "show CSV" option at the bottom for easy exporting to a spreadsheet.  (2) Committed the link improvements suggested by [[user>schplurtz]] below.
  
Line 49: Line 76:
 //Put your comments/fixes here// //Put your comments/fixes here//
  
-==== Proposed change ====+==== Proposed changes ==== 
 + 
 +(None) 
 + 
 + 
 +==== Changes accepted ====
  
 === Internal link and link recognized even if no name field is present === === Internal link and link recognized even if no name field is present ===
Line 59: Line 91:
 12 1 Cableguide link:http://www.example.com/ 12 1 Cableguide link:http://www.example.com/
 </rack> </rack>
-</code>\\ This can be resolved using a negative lookahead in the regexp part that matches the name field. The regexp is "either it is empty or it not starting with ''#'' or ''link:''". ie ''%%((?:"[^"]*")|(?!(?:(?:\#)|(?:link:)))\S*)?%%'' instead of ''%%((?:\"[^\"]*\")|[^#]\S*)?%%'' +</code> 
-  - Second, the ''link:somelink'' can only be an external link. With the following patch, it is now possible to use such links as ''%%link:[[page]]%%'', ''%%link:[[page|]]%%'' or ''%%link:[[ns:page|link title]]%%'' to point to internal pages.+  - Second, the ''link:somelink'' can only be an external link. With the //recently accepted// patch, it is now possible to use such links as ''%%link:[[page]]%%'', ''%%link:[[page|]]%%'' or ''%%link:[[ns:page|link title]]%%'' to point to internal pages.
  
 + --- [[user>schplurtz]] //2011/01/19 11:50//
  
-<code diff syntax.php.patch> + --- Edited //2011/01/19 11:50// by Tyler Bletsch to accept this patch
---- syntax.php.orig     2011-01-18 15:05:00.109173222 +0100 +
-+++ syntax.php  2011-01-19 12:32:49.058595826 +0100 +
-@@ -157,19 +157,25 @@ +
-                foreach (explode("\n",$content) as $line) { +
-                        $item = array(); +
-                        if (preg_match("/^\s*#/",$line) || !trim($line)) { continue; } # skip comments & blanks +
--                       #                     Ustart    Usize     Model                    Name?                         Color?       Link?               Comment +
--                       if (preg_match("/^\s* (\d+) \s+ (\d+) \s+ ((?:\"[^\"]*\")|\S+) \s* ((?:\"[^\"]*\")|[^#]\S*)? \s* (\#\w+)? \s* ((?=link:)\S*)? \s* (.*?)? \s* \$/x",$line,$matches)) { +
-+                       #                      Ustart    Usize     Model                 Name?                                         Color?       Link?                                                   Comment +
-+                       if (preg_match('/^\s* (\d+) \s+ (\d+) \s+ ((?:"[^"]*")|\S+) \s* ((?:"[^"]*")|(?!(?:(?:\#)|(?:link:)))\S*)? \s* (\#\w+)? \s* ( link: (?: (?:\[\[[^]|]+(?:\|[^]]*)?]]) | \S* ) )? \s* (.*?)? \s* $/x',$line,$matches)) { +
-                                $item['u_bottom'] = $matches[1]; +
-                                $item['u_size'] = $matches[2]; +
-                                $item['model'] = preg_replace('/^"/','',preg_replace('/"$/','',$matches[3])); +
-                                $item['name'] = preg_replace('/^"/','',preg_replace('/"$/','',$matches[4])); +
-                                $item['color'] = $matches[5] ? $matches[5] : $this->autoselect_color($item); +
-+                               $item['linktitle'] = ''; +
-                                $item['link'] = substr($matches[6], 5); +
-+                               if( '[' == substr($item['link'], 0, 1)) { +
-+                                               if(preg_match( '/^\[\[[^|]+\|([^]]+)]]$/', $item['link'], $titlematch )) +
-+                                                       $item['linktitle']=' title="'.hsc($titlematch[1]). '"'; +
-+                                       $item['link']=wl(cleanID(preg_replace( '/^\[\[([^]|]+).*/', '$1', $item['link'] ))); +
-+                               } +
-                                $item['comment'] = $matches[7]; +
-                                $item['u_top'] = $item['u_bottom'] + ($opt['descending']?-1:1)*($item['u_size'] - 1); +
-                                $items[$item['u_top']] = $item; +
-                        } else { +
--                               $renderer->doc .= "Syntax error on the following line: <pre style='color:red'>$line</pre>\n"; +
-+                               $renderer->doc .= 'Syntax error on the following line: <pre style="color:red">'.hsc($line)."</pre>\n"; +
-                        } +
-                } +
-  +
-@@ -187,7 +193,7 @@ +
-                                $renderer->doc .=  +
-                                        "<tr><th>$u</th>"+
-                                        "<td class='item' rowspan='$item[u_size]' style='background-color: $item[color];' title=\"".htmlspecialchars($item['comment'])."\">"+
--                                       ($item['link'] ? "<a href=\"$item[link]\">" : ''). +
-+                                       ($item['link'] ? '<a href="'.$item['link'].'"'.$item['linktitle'].'>' : ''). +
-                                        "<div style='float: left; font-weight:bold;'>"+
-                                                "$item[model]"+
-                                                ($item['comment'] ? ' *' : ''). +
-</code> +
- --- [[user>schplurtz]] //2011/01/19 11:50// +
-==== Changes accepted ====+
  
 === URL Add by Sylvain Bigonneau === === URL Add by Sylvain Bigonneau ===
plugin/rack.txt · Last modified: 2023-10-30 23:20 by Klap-in

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki