Jason,

You can use the template I  provided by adding a line into the HTML-File 
between the <head></head> tags:
<meta name="viewport" content="width=device-width, initial-scale=1" />

I use this already a few months (I didn't update the files here on Woodstone 
yet).
The advantage of the template is the way it displays any failure on the top so 
you don't have to search for it and your able to view the charts.

Regards,
Lau


-----Original Message-----
From: Servers Alive Discussion List [mailto:salive@woodstone.nu] On Behalf Of 
Jason Richards Pagh
Sent: donderdag 18 december 2014 20:26
To: Servers Alive Discussion List
Subject: Re: [SA-list] Nested SAIF tags

I looked at using <sa_select_case> more than shown in my example, but it looks 
too limited to solve the specific combination of problems I was trying to 
resolve. However, I did find another way to closely accomplish what I was 
shooting for. You can see a screenshot of my mobile template
(http://postimg.org/image/4s62d7t5r/) and the full template file 
(http://pastebin.com/UzwGUK0u).

It’s not super pretty, but it’s a start and I didn’t see any examples for 
mobile-specific templates on the website.

Thanks,
Jason




On 12/18/14, 7:55 AM, "Demeulemeester, Pieter" 
<pieter.demeulemees...@fracarita.org> wrote:

>Nested IF's are often used as a replacement for a "Do Case" or "Select" 
>construction. 
>Don't know if that's the case for you, but I've use the 
><SA_SELECT_CASE> tag with nested <SAIF> tags, see example :
>
>        <sa_select_case status>
>          <sa_case DOWN>
>            class="normal" style="background:red;        color:black; 
>font-weight:normal"
>          <sa_case UNAVAILABLE>
>            class="normal" style="background:darkorange; color:black; 
>font-weight:normal"
>          <sa_case UNCHECKED>
>            class="normal" style="background:lightblue;  color:black; 
>font-weight:normal"
>          <sa_case MAINTENANCE>
>               <saif sa_hostname NCO "[" AND sa_hostname NCO "]" > 
>class="normal" style="background:silver; color:black; font-weight:
>normal" </saif>
>               <saif sa_hostname CON "[" AND sa_hostname CON "]" > 
>class="normal" style="background:white;  color:black; font-weight:
>normal" </saif>
>          <sa_case UP>
>            class="normal" style="background:white;      color:black; 
>font-weight:normal"
>          <sa_case SCHEDULEDMAINTENANCE>
>            <saif sa_prevstatus is DOWN>        class="normal" 
>style="background:red;        color:black; font-weight:normal" </saif>
>            <saif sa_prevstatus is UNAVAILABLE> class="normal" 
>style="background:darkorange; color:black; font-weight:normal" </saif>
>            <saif sa_prevstatus is UNCHECKED>   class="normal" 
>style="background:lightblue;  color:black; font-weight:normal" </saif>
>            <saif sa_prevstatus is MAINTENANCE> class="normal" 
>style="background:silver;     color:black; font-weight:normal" </saif>
>            <saif sa_prevstatus is UP>          class="normal" 
>style="background:white;      color:black; font-weight:normal" </saif>
>            class="normal" style="background:olive;      color:blue; 
>font-weight:normal"
>          <sa_case ELSE>
>            class="normal" style="background:olive;      color:white; 
>font-weight:normal"
>        </sa_select_case>
>
>Kind regards,
>Pieter
>
>
>
>-----Original Message-----
>From: Servers Alive Discussion List [mailto:salive@woodstone.nu] On 
>Behalf Of dirk
>Sent: donderdag 18 december 2014 8:36
>To: Servers Alive Discussion List
>Subject: Re: [SA-list] Nested SAIF tags
>
>nested saif tags are not supported in SA...
>
>
>
>dirk
>
>On 2014-12-18 07:40, Jason Richards Pagh wrote:
>> Hi there,
>> 
>> I’m trying to develop a template that utilizes jQuery so it 
>> will format well on a mobile device. I am having a lot of success, 
>> but I think I’m running into a bug and am hoping for some 
>> help 
>> confirming that (and getting it fixed) or another way to accomplish 
>> what I want to do. Part of utilizing jQuery requires the use of <div> 
>> tags, which of course have to be properly closed. Because I want to 
>> use collapsible sets that use sa_hostname as the section title, I 
>> need to use nested <saif> blocks.
>> It
>> sort of seems to work in one example and then not in another.
>> 
>> My question is whether nested <saif> blocks is expected to work or not.
>> 
>> For more detail (if it matters), here’s the logic 
>> I’m 
>>finding  myself  trying to run through:
>> 
>> * In the header (before <sa_report> tag) I open a <div> tag with  
>>attribute  of data-role=“collapsibleset".
>> * For ONLY the very first entry inside the <sa_report> tag, I need to  
>>open  a <div> tag with attribute of data-role=â€Å
>>“collapsibleâ€. 
>>I can’t  have a  </div> tag first, or that would close the 
>>above section I just opened.
>> * For every next entry, if the sa_hostname is the same as the 
>>previous  one, I don’t want to close or open a new <div> tag 
>>at this level
>>      * However, if the sa_hostname is new, I need to close out the  
>>previous <div> tag at this level and start a new one.
>> * After the closing </sa_report> tag I have the last </div> tag to  
>>close  out the hanging collapsible for the last entry in the report, 
>>then I  have  another </div> tag to close out the collapsibleset 
>>started in the  header.
>> 
>> To accomplish this, I’m using the following snippet of code:
>> 
>> —SNIP—
>>         <div data-role="collapsibleset" data-inset="false">
>>             <!-- End of header for Servers Alive -->
>>             <sa_report sort=NOGROUP,CSTATUS,HOSTNAME>
>>                 <saif sa_previous_hostname_in_html IS ""><div 
>> data-role="collapsible" data-collapsed="true"
>> data-inset="false"><h3><sa_hostname></h3><ul data-role="listview"
>> data-inset="false"></saif>
>>                 <saif sa_previous_hostname_in_html NOT ""><saif 
>> sa_hostname not sa_previous_hostname_in_html></div><div
>> data-role="collapsible" data-collapsed="true"
>> data-inset="false"><h3><sa_hostname></h3><ul data-role="listview"
>> data-inset="false"></saif></saif>
>> 
>>                             <li>
>>                                 <h2><sa_prettyname></h2>
>> 
>> <p><strong><sa_checkdescription></strong></p>
>>                                 <p><sa_statuschangedate> 
>> <sa_statuschangetime></p>
>>                                 <p
>> class="ui-li-aside"><strong><sa_checkresponse></strong></p>
>>                             </li>
>> 
>> 
>>             </sa_report>
>>     <!-- Begin of footer for Servers Alive -->
>>             </div>
>>         </div>
>> 
>> —SNIP—
>> 
>> That works all well and good, but it leaves in a </saif> in the 
>> report only for the first entry as seen below:
>> 
>> —SNIP—
>>         <div data-role="collapsibleset" data-inset="false">
>>             <!-- End of header for Servers Alive --> <div 
>> data-role="collapsible" data-collapsed="true"
>> data-inset="false"><h3>192.168.20.105</h3><ul data-role="listview"
>> data-inset="false">
>>  </saif>
>> 
>> <li>
>> <h2>nsmn3220-1b - a_VM aggr used %</h2> <p><strong>SNMP 
>> (.1.3.6.1.4.1.789.1.5.4.1.6.1 result &gt; 80)</strong></p>
>> <p>12/17/2014 5:05:48 PM</p>
>> <p class="ui-li-aside"><strong>82</strong></p>
>> </li>
>> 
>> </div><div data-role="collapsible" data-collapsed="true"
>> data-inset="false"><h3>192.168.11.2</h3><ul data-role="listview"
>> data-inset="false">
>> 
>> <li>
>> <h2>phx-firewall - ping</h2>
>> <p><strong>ping</strong></p>
>> <p>12/17/2014 4:39:08 PM</p>
>> <p class="ui-li-aside"><strong>100%</strong></p>
>> </li>
>> 
>> <li>
>> <h2>phx-firewall01 - CPU load 1 min</h2> <p><strong>SNMP 
>> (.1.3.6.1.4.1.2021.10.1.5.1 result &gt; 50)</strong></p>
>> <p>12/17/2014 9:38:30 PM</p>
>> <p class="ui-li-aside"><strong>2</strong></p>
>> </li>
>> 
>> <li>
>> <h2>phx-firewall01 - Temperature Err Cond</h2> <p><strong>SNMP 
>> (.1.3.6.1.4.1.2620.1.6.7.8.1.1.6.1.0 result &lt;&gt; 0)</strong></p>
>> <p>12/17/2014 9:34:13 PM</p>
>> <p class="ui-li-aside"><strong>0</strong></p>
>> </li>
>> 
>> </div><div data-role="collapsible" data-collapsed="true"
>> data-inset="false"><h3>192.168.11.41</h3><ul data-role="listview"
>> data-inset="false">
>> 
>> <li>
>> <h2>phxn3220-1a - ping</h2>
>> <p><strong>ping</strong></p>
>> <p>12/17/2014 4:39:06 PM</p>
>> <p class="ui-li-aside"><strong>100%</strong></p>
>> </li>
>> 
>> 
>> 
>>     <!-- Begin of footer for Servers Alive -->
>>             </div>
>>         </div>
>> 
>> —SNIP—
>> 
>> That doesn’t seem like a problem, however I wanted to do 
>> some 
>>further  customization where I add some attributes to the <div> tag 
>>for the  collapsible level and so I tried changing the template as 
>>follows:
>> 
>> —SNIP—
>>         <div data-role="collapsibleset" data-inset="false">
>>             <!-- End of header for Servers Alive -->
>>             <sa_report sort=NOGROUP,CSTATUS,HOSTNAME>
>>                 <saif sa_previous_hostname_in_html IS ""><div </saif>
>>                 <saif sa_previous_hostname_in_html NOT ""><saif 
>> sa_hostname not sa_previous_hostname_in_html></div><div </saif> </saif>
>>         <sa_select_case status>
>>           <sa_case DOWN>
>>             data-icon="alert"
>>           <sa_case SCHEDULEDMAINTENANCE>
>>             data-icon="clock"
>>         </sa_select_case>
>>                 <saif sa_hostname not 
>> sa_previous_hostname_in_html>data-role="collapsible"
>> data-collapsed="true"
>> data-inset="false"><h3><sa_hostname></h3><ul data-role="listview"
>> data-inset="false"></saif>
>> 
>> 
>>                             <li>
>>                                 <h2><sa_prettyname></h2>
>> 
>> <p><strong><sa_checkdescription></strong></p>
>>                                 <p><sa_statuschangedate> 
>> <sa_statuschangetime></p>
>>                                 <p
>> class="ui-li-aside"><strong><sa_checkresponse></strong></p>
>>                             </li>
>> 
>> 
>>             </sa_report>
>>     <!-- Begin of footer for Servers Alive -->
>>             </div>
>>         </div>
>> 
>> —SNIP—
>> 
>> That would seem like it should work for me, however because of the  
>>leftover </saif> tag, the <div> tag that I’m trying to 
>>inject  
>>data-icon=“alert†attribute into gets closed 
>>prematurely by 
>>the  closing  angle bracket in the </saif> hanging tag. See below:
>> 
>> —SNIP—
>> <div data-role="collapsibleset" data-inset="false">
>>             <!-- End of header for Servers Alive --> <div  </saif> 
>> data-icon="alert"
>> data-role="collapsible" data-collapsed="true"
>> data-inset="false"><h3>192.168.20.105</h3><ul data-role="listview"
>> data-inset="false">
>> 
>> 
>> <li>
>> <h2>nsmn3220-1b - a_VM aggr used %</h2> <p><strong>SNMP 
>> (.1.3.6.1.4.1.789.1.5.4.1.6.1 result &gt; 80)</strong></p>
>> <p>12/17/2014 5:05:48 PM</p>
>> <p class="ui-li-aside"><strong>82</strong></p>
>> </li>
>> 
>> —SNIP—
>> 
>> So when the page renders, not only do I not get the alert icon, but I 
>> get the two lines after the </saif> hanging tag showing up in the web 
>> page (because the tag they were a part of got closed).
>> 
>> Thoughts about how to get this working?
>> 
>> Thanks,
>> Jason
>> 
>> 
>> To unsubscribe send a message with UNSUBSCRIBE in the subject line to 
>> salive@woodstone.nu If you use auto-responders (like 
>> out-of-the-office messages), make sure that they are not sent to the 
>> list nor to individual members.
>> Doing so will cause you to be automatically removed from the list.
>
>--
>Dirk Bulinckx
>Servers Alive - http://www.woodstone.nu DNS Hosting on StellarDNS - 
>http://www.stellardns.com
>
>To unsubscribe send a message with UNSUBSCRIBE in the subject line to 
>salive@woodstone.nu If you use auto-responders (like out-of-the-office 
>messages), make sure that they are not sent to the list nor to 
>individual members.  Doing so will cause you to be automatically 
>removed from the list.
>
>
>
>
>
>To unsubscribe send a message with UNSUBSCRIBE in the subject line to 
>salive@woodstone.nu If you use auto-responders (like out-of-the-office 
>messages), make sure that they are not sent to the list nor to 
>individual members.  Doing so will cause you to be automatically 
>removed from the list.


To unsubscribe send a message with UNSUBSCRIBE in the subject line to 
salive@woodstone.nu If you use auto-responders (like out-of-the-office 
messages), make sure that they are not sent to the list nor to individual 
members.  Doing so will cause you to be automatically removed from the list.

**************************************************
This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed.  If 
you have received this email in error please notify the sender.
Any views or opinions presented in this email are solely those of the author 
and do not necessarily represent those of the company.

This footnote also confirms that this email message has been swept by 
MIMEsweeper for the presence of computer viruses but we cannot accept 
responsibility for any loss or damage arising from the use of this email and/or 
attachment(s).



To unsubscribe send a message with UNSUBSCRIBE in the subject line to 
salive@woodstone.nu
If you use auto-responders (like out-of-the-office messages), make sure that 
they are not sent to the list nor to individual members.  Doing so will cause 
you to be automatically removed from the list.

Reply via email to