Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
RightScale Dashboard Widget in Liquid markup
{% if servers == empty %}
<div style="text-align:center;padding:20px">-no matching servers-</div>
{% else %}
{% counter total_count = 0 %}
{% assign my_table_contents = "" %}
{% for s in servers %}
{% increment total_count %}
{% capture my_server_table_contents %}
{{ my_server_table_contents }}
<tr>
<td>{{ s.link }}</td>
<td>{{ s.runtime }}</td>
{% if config.current_view == "expanded" %}
<td>{{ s.server_template_link }}</td>
<td>{{ s.deployment_link }}</td>
<td>{{ s.cpu_icon }}</td>
<td>{{ s.zone }}</td>
<td>{{ s.cloud_name }}</td>
{% endif %}
</tr>
{% endcapture %}
{% endfor %}
</div>
<table>
<tr>
<th>Nickname</th>
<th>Runtime</th>
{% if config.current_view == "expanded" %}
<th>ServerTemplate</th>
<th>Deployment</th>
<th>CPU</th>
<th>Zone</th>
<th>Cloud</th>
{% endif %}
</tr>
{{ my_server_table_contents }}
</table>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment