| Index: appengine/sheriff_o_matic/ui/ct-health.html
|
| diff --git a/appengine/sheriff_o_matic/ui/ct-health.html b/appengine/sheriff_o_matic/ui/ct-health.html
|
| index 5ad91bae0c421f1a7abea855732a313eb40660d0..d09aeb83b3a6c332dfc07fcd86f961a8c9c58be5 100644
|
| --- a/appengine/sheriff_o_matic/ui/ct-health.html
|
| +++ b/appengine/sheriff_o_matic/ui/ct-health.html
|
| @@ -2,19 +2,41 @@
|
| Copyright 2015 The Chromium Authors. All rights reserved.
|
| Use of this source code is governed by a BSD-style license that can be
|
| found in the LICENSE file.
|
| --->
|
| -
|
| -<link rel="import" href="ct-trooper-card.html">
|
| -<polymer-element name="ct-health" attributes="failures" noscript>
|
| -<template>
|
| +--><html><head><link rel="import" href="ct-trooper-card.html">
|
| +<dom-module id="ct-health">
|
| + <template>
|
| <h2>System Health</h2>
|
| - <template repeat="{{ group in failures.failures['health'] }}">
|
| - <template if="{{ group.data.category == 'trooper' }}">
|
| - <ct-trooper-card class='{{ { snoozed: group.isSnoozed } | tokenList }}' group="{{ group.data }}"></ct-trooper-card>
|
| + <template is="dom-repeat" items="{{failures.failures['health']}}" as="group">
|
| + <template is="dom-if" if="{{computeIf2(group)}}">
|
| + <ct-trooper-card group="{{ group.data }}" class$="{{computeClass(group)}}"></ct-trooper-card>
|
| </template>
|
| </template>
|
| - <template if="{{ !failures.failures['health'] || failures.failures['health'].length == 0 }}">
|
| + <template is="dom-if" if="{{computeIf(failures)}}">
|
| <ct-party-time></ct-party-time>
|
| </template>
|
| </template>
|
| -</polymer-element>
|
| + <script>
|
| + Polymer({
|
| + is: 'ct-health',
|
| + properties: { failures: { notify: true } },
|
| + computeIf: function (failures) {
|
| + return !failures.failures['health'] || failures.failures['health'].length == 0;
|
| + },
|
| + computeIf2: function (group) {
|
| + return group.data.category == 'trooper';
|
| + },
|
| + computeClass: function (group) {
|
| + return this.tokenList({ snoozed: group.isSnoozed });
|
| + },
|
| + tokenList: function (obj) {
|
| + var pieces = [];
|
| + for (key in obj) {
|
| + if (obj[key]) {
|
| + pieces.push(key);
|
| + }
|
| + }
|
| + return pieces.join(' ');
|
| + }
|
| + });
|
| + </script>
|
| +</dom-module>
|
|
|