Skip to content

Commit

Permalink
Made the logviewer more accessible (umbraco#8213)
Browse files Browse the repository at this point in the history
  • Loading branch information
RachBreeze authored Aug 31, 2020
1 parent ae7290f commit 108ea2d
Show file tree
Hide file tree
Showing 5 changed files with 199 additions and 173 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ Use this directive to construct a header inside the main editor window.
// to make it work for language edit/create
setAccessibilityForEditorState();
scope.loading = false;
} else if (scope.name) {
setAccessibilityForName();
scope.loading = false;
} else {
scope.loading = false;
}
Expand Down Expand Up @@ -265,6 +268,15 @@ Use this directive to construct a header inside the main editor window.
editorService.iconPicker(iconPicker);
};

function setAccessibilityForName() {
var setTitle = false;
if (scope.setpagetitle !== undefined) {
setTitle = scope.setpagetitle;
}
if (setTitle) {
setAccessibilityHeaderDirective(false, scope.editorfor, scope.nameLocked, scope.name, "", true);
}
}
function setAccessibilityForEditorState() {
var isNew = editorState.current.id === 0 ||
editorState.current.id === "0" ||
Expand Down
12 changes: 12 additions & 0 deletions src/Umbraco.Web.UI.Client/src/less/components/umb-logviewer.less
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@
.table {
table-layout: fixed;

table {
display: table;
width: 100%;
}

thead th:first-child, thead th:nth-child(3) {
width: 20%;
}
Expand All @@ -130,9 +135,16 @@
width: 15%;
}


tr td:nth-child(3) {
word-break: break-word;
}

button {
white-space: normal;
word-break: break-word;
text-align-last: left;
}
}

.exception {
Expand Down
65 changes: 35 additions & 30 deletions src/Umbraco.Web.UI.Client/src/views/logviewer/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
name-locked="true"
hide-icon="true"
hide-description="true"
hide-alias="true">
hide-alias="true"
setPageTitle="true">
</umb-editor-header>

<umb-editor-container>
Expand All @@ -32,17 +33,20 @@
<umb-box-header title="Saved Searches"></umb-box-header>
<umb-box-content>
<table>
<tr>
<td>
<a ng-click="vm.searchLogQuery()" title="View all Logs" class="btn btn-link">All Logs <i class="icon-search"></i></a>
</td>
</tr>
<!-- Fetch saved searches -->
<tr ng-repeat="search in vm.searches">
<td>
<a ng-click="vm.searchLogQuery(search.query)" title="{{search.name}}" class="btn btn-link">{{search.name}} <i class="icon-search"></i></a>
</td>
</tr>
<caption class="sr-only">Saved Searches</caption>
<tbody>
<tr>
<td>
<button type="button" ng-click="vm.searchLogQuery()" title="View all Logs" class="btn btn-link">All Logs <i class="icon-search" aria-hidden="true"></i></button>
</td>
</tr>
<!-- Fetch saved searches -->
<tr ng-repeat="search in vm.searches">
<td>
<button type="button" ng-click="vm.searchLogQuery(search.query)" title="{{search.name}}" class="btn btn-link">{{search.name}} <i class="icon-search" aria-hidden="true"></i></button>
</td>
</tr>
</tbody>
</table>
</umb-box-content>
</umb-box>
Expand All @@ -52,18 +56,19 @@
<umb-box-header title="Common Log Messages"></umb-box-header>
<umb-box-content class="block-form">
<em>Total Unique Message types</em>: {{ vm.commonLogMessages.length }}
<table class="table table-hover">
<tbody>
<tr ng-repeat="template in vm.commonLogMessages | limitTo:vm.commonLogMessagesCount" ng-click="vm.findMessageTemplate(template)" style="cursor: pointer;">
<td>
{{ template.MessageTemplate }}
</td>
<td>
{{ template.Count }}
</td>
</tr>
</tbody>
</table>
<table class="table table-hover">
<caption class="sr-only">Common Log Messages Total Unique Message types: {{ vm.commonLogMessages.length }}</caption>
<tbody>
<tr ng-repeat="template in vm.commonLogMessages | limitTo:vm.commonLogMessagesCount" ng-click="vm.findMessageTemplate(template)" style="cursor: pointer;">
<td>
{{ template.MessageTemplate }}
</td>
<td>
{{ template.Count }}
</td>
</tr>
</tbody>
</table>
<umb-button ng-if="vm.commonLogMessagesCount < vm.commonLogMessages.length"
button-style="action"
type="button"
Expand All @@ -89,20 +94,20 @@

<div ng-show=" vm.canLoadLogs">
<div class="umb-box-row">
<!-- No of Errors -->
<!-- No of Errors -->
<umb-box ng-click="vm.searchErrors()" style="cursor:pointer;">
<umb-box-header title="Number of Errors"></umb-box-header>
<umb-box-content class="block-form" style="font-size: 40px; font-weight:900; text-align:center; color:#fe6561;">
{{ vm.numberOfErrors }}
</umb-box-content>
</umb-box>
</umb-box>

<umb-box>
<umb-box-header title="Log level"></umb-box-header>
<umb-box-content class="block-form" style="font-weight:900; text-align:center; color: {{ vm.logLevelColor }}">
{{ vm.logLevel }}
</umb-box-content>
</umb-box>
</umb-box>
</div>

<!-- Chart of diff log types -->
Expand All @@ -118,8 +123,8 @@
</canvas>

</umb-box-content>
</umb-box>
</umb-box>

</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,12 @@
"name": "Find all logs that use a specific log message template",
"query": "@MessageTemplate = '[Timing {TimingId}] {EndMessage} ({TimingDuration}ms)'"
}
]
];
});

//Get all logs on init load
getLogs();

}


Expand Down
Loading

0 comments on commit 108ea2d

Please sign in to comment.