| <link rel="import" href="../../../third-party/polymer/polymer.html"> |
| <link rel="import" href="../../../third-party/core-icon/core-icon.html"> |
| <link rel="import" href="../../../libs/ui-components/data-grid/grid/component.html"> |
| <link rel="import" href="../../../libs/ui-components/data-grid/grid/column/component.html"> |
| <link rel="import" href="../../../libs/ui-components/data-grid/filter/select/component.html"> |
| <link rel="import" href="../../../libs/ui-components/data-grid/filter/select/item/component.html"> |
| <link rel="import" href="../../../libs/ui-components/data-grid/filter/toggle/component.html"> |
| <link rel="import" href="../../../libs/ui-components/data-grid/search/component.html"> |
| |
| <polymer-element name="p2b-plugin-vlog"> |
| <template> |
| <link rel="stylesheet" href="../../../libs/css/common-style.css"> |
| <link rel="stylesheet" href="component.css"> |
| |
| <p2b-grid id="grid" defaultSortKey="date" dataSource="{{ dataSource }}" summary="Data Grid displaying veyron log items in a tabular format with filters and search options."> |
| |
| <!-- Search --> |
| <p2b-grid-search label="Search Logs"></p2b-grid-search> |
| |
| <!-- Filter to select log level (multiple allowed) --> |
| <p2b-grid-filter-select multiple key="level" label="Show levels"> |
| <p2b-grid-filter-select-item checked label="Fatal" value="fatal"></p2b-grid-filter-select-item> |
| <p2b-grid-filter-select-item checked label="Error" value="error"></p2b-grid-filter-select-item> |
| <p2b-grid-filter-select-item checked label="Warning" value="warning"></p2b-grid-filter-select-item> |
| <p2b-grid-filter-select-item checked label="Info" value="info"></p2b-grid-filter-select-item> |
| </p2b-grid-filter-select> |
| |
| <!-- Filter to select date range --> |
| <p2b-grid-filter-select key="date" label="Logs since"> |
| <p2b-grid-filter-select-item checked label="Any time" value="all"></p2b-grid-filter-select-item> |
| <p2b-grid-filter-select-item label="Past 1 hour" value="1"></p2b-grid-filter-select-item> |
| <p2b-grid-filter-select-item label="Past 24 hours" value="24"></p2b-grid-filter-select-item> |
| </p2b-grid-filter-select> |
| |
| <!-- Toggle to allow one to pause the display of incoming logs --> |
| <p2b-grid-filter-toggle key="autorefresh" label="Live Refresh" checked></p2b-grid-filter-toggle> |
| |
| <!-- Columns, sorting and cell templates --> |
| <p2b-grid-column label="Level" key="level" sortable flex="2" priority="2" > |
| <template> |
| <core-icon class="level-icon {{ item.level }}" icon="{{ item.icon }}" title="{{item.level}}"></core-icon> |
| <span moreInfoOnly style="vertical-align:middle">{{item.level}}</span> |
| </template> |
| </p2b-grid-column> |
| <p2b-grid-column label="File" key="file" sortable flex="4" minFlex="2" priority="4" > |
| <template>{{ item.file }}<span class="line-number">{{ item.fileLine }}</span></template> |
| </p2b-grid-column> |
| <p2b-grid-column label="Message" key="message" primary flex="8" minFlex="5" priority="1" > |
| <template><div class="message-text">{{ item.message }}</div></template> |
| </p2b-grid-column> |
| <p2b-grid-column label="Date" key="date" sortable flex="4" minFlex="3" priority="3"> |
| <template> |
| <abbr gridOnly title="{{item.date}}">{{ item.formattedDate }}</abbr> |
| <span moreInfoOnly>{{item.date}}</span> |
| </template> |
| |
| </p2b-grid-column> |
| <p2b-grid-column label="Threadid" key="threadid" sortable flex="0" priority="5"> |
| <template>{{ item.threadId }}</template> |
| </p2b-grid-column> |
| |
| </p2b-grid> |
| </template> |
| |
| <script> |
| Polymer('p2b-plugin-vlog', { |
| refreshGrid: function() { |
| this.$.grid.refresh(); |
| } |
| }); |
| </script> |
| </polymer-element> |