summaryrefslogtreecommitdiffstats
path: root/app/server-health/controllers/syslog-controller.html
blob: 6a5e8ea8367d13dce774e8ce548314fb440fa841 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<loader loading="loading"></loader>
<div id="sys-log">
    <section id="sys-log__logs">
      <div class="row column">
        <h1>System Logs</h1>
        <div class="page-header">
          <p class="inline h4">Select system log type: </p>
          <div class="inline dropdown__wrapper" >
            <button type="button" class="dropdown__button" ng-click="showLogDropdown = !showLogDropdown"><strong>{{selectedRecordType}}</strong></button>
            <ul class="dropdown__list inline" ng-show="showLogDropdown">
              <li ng-repeat="recordType in recordTypeList">
                <button type="button" ng-click="selectRecordType(recordType);">{{recordType}}</button>
              </li>
            </ul>
          </div>
          <a ng-href="data:text/json;charset=utf-8,{{sysLogs}}" class="inline btn-export float-right"  download="systemLogs.json" ng-show="sysLogs.length">Export </a>
          <button class="inline clear-input float-right btn-secondary" ng-click="confirm = !confirm" ng-show="sysLogs.length">&#10005; Clear {{selectedRecordType}} Logs</button>
          <div class="inline__confirm sys-log__confirm" ng-show="confirm">
            <div class="inline__confirm-message">
              <p class="h3">Are you sure you want to <strong class="ng-binding">clear {{selectedRecordType}} logs</strong>?
              </p>
            </div>
            <div class="inline__confirm-buttons">
              <button class="btn-primary" ng-click="clearSystemLogEntries()">Yes</button>
              <button class="btn-primary" ng-click="confirm = false">No</button>
            </div>
          </div>
        </div>
      </div>
    </section>
    <section class="row column">
      <p class="content-label">Filter {{selectedRecordType}} Logs</p>
      <div class="content__search">
        <label for="content__search-input">Search</label>
        <input id="content__search-input" type="text" ng-model="customSearch" ng-keydown="doSearchOnEnter($event)"/>
        <div class="search-submit__wrapper">
          <button class="clear-input" ng-click="clear()">&#10005;</button>
          <input id="content__search-submit" type="submit" class="btn btn-primary content__search-submit" value="Filter" ng-click="doSearchOnClick()"/>
        </div>
      </div>
    </section>
    <section>
      <syslog-filter></syslog-filter>
    </section>
    <section id="sys-log__logs" class="table row column" ng-show="sysLogs.length">
      <div class="table row column">
        <div class="table__head">
          <div class="table__row">
            <div class="table__cell sys-log__col-wrapper sys-log__col-id">
              <div class="column small-2 sort_button_wrapper">
                <button class="sort-ascending" ng-click="sortBy('Id', false)"></button>
                <button class="sort-descending" ng-click="sortBy('Id', true)"></button>
              </div>
              ID
            </div>
            <div class="table__cell sys-log__col-wrapper">
              <div class="column small-2 sort_button_wrapper">
                <button class="sort-ascending" ng-click="sortBy('Created', false)"></button>
                <button class="sort-descending" ng-click="sortBy('Created', true)"></button>
              </div>
              Timestamp
            </div>
            <div class="table__cell sys-log__col-wrapper">
              <div class="column small-2 sort_button_wrapper">
                <button class="sort-ascending" ng-click="sortBy('Name', false)"></button>
                <button class="sort-descending" ng-click="sortBy('Name', true)"></button>
              </div>
              Name
            </div>
            <div class="table__cell sys-log__col-wrapper">
              <div class="column small-2 sort_button_wrapper">
                <button class="sort-ascending" ng-click="sortBy('SensorType', false)"></button>
                <button class="sort-descending" ng-click="sortBy('SensorType', true)"></button>
              </div>
              Type
            </div>
            <div class="table__cell sys-log__col-wrapper sys-log__col-sev">
              <div class="column small-2 sort_button_wrapper">
                <button class="sort-ascending" ng-click="sortBy('Severity', false)"></button>
                <button class="sort-descending" ng-click="sortBy('Severity', true)"></button>
              </div>
              Severity
            </div>
            <div class="table__cell sys-log__col-wrapper sys-log__col-desc">Description</div>
          </div>
        </div>
        <div class="table__body">
          <div class="table__row" dir-paginate="log in (sysLogs | filter:filterBySearchTerms | filter:filterBySeverity | filter:filterByDate | filter:filterByType | orderBy:sortKey:reverse) | itemsPerPage:itemsPerPage">
            <div class="table__cell sys-log__col-wrapper sys-log__col-id">{{log.Id}}</div>
            <div class="table__cell sys-log__col-wrapper">{{log.Created | localeDate}}</div>
            <div class="table__cell sys-log__col-wrapper">{{log.Name}}</div>
            <div class="table__cell sys-log__col-wrapper">{{log.SensorType}}</div>
            <div class="table__cell sys-log__col-wrapper sys-log__col-sev">{{log.Severity}}</div>
            <div class="table__cell sys-log__col-wrapper sys-log__col-desc">{{log.Message}}</div>
          </div>
        </div>
      </div>
      <dir-pagination-controls></dir-pagination-controls>
    </section>
    <section id="sys-log__logs" class="table row column" ng-show="!sysLogs.length">
      <p>There are no {{selectedRecordType}} logs to display at this time.</p>
    </section>
</div> <!-- end log -->
OpenPOWER on IntegriCloud