Changes the text that is being displayed when no log entry was found.
Also changes the log level to debug.
User can no longer select a date in the future to filter log entries.
Fixes: https://tracker.ceph.com/issues/42963
Signed-off-by: Sebastian Krah <skrah@suse.com>
def load_buffer(self, buf, channel_name):
lines = CephService.send_command(
- 'mon', 'log last', channel=channel_name, num=LOG_BUFFER_SIZE)
+ 'mon', 'log last', channel=channel_name, num=LOG_BUFFER_SIZE, level='debug')
for l in lines:
buf.appendleft(l)
<span class="message">{{ line.message }}</span>
</p>
- <span *ngIf="contentData.clog.length === 0"
- i18n>No entries found</span>
+ <ng-container *ngIf="clog.length != 0 else noEntriesTpl"></ng-container>
</div>
</div>
</ng-template>
<span class="message">{{ line.message }}</span>
</p>
- <span *ngIf="contentData.audit_log.length === 0"
- i18n>No entries found</span>
+ <ng-container *ngIf="audit_log.length != 0 else noEntriesTpl"></ng-container>
</div>
</div>
</ng-template>
id="logs-date"
placeholder="YYYY-MM-DD"
ngbDatepicker
+ [maxDate]="maxDate"
#d="ngbDatepicker"
(click)="d.open()"
[(ngModel)]="selectedDate"
</div>
</div>
</ng-template>
+
+<ng-template #noEntriesTpl>
+ <span i18n>No log entries found. Please try to select different filter options.</span>
+ <span> </span>
+ <a href="#"
+ (click)="resetFilter()"
+ i18n>Reset filter.</a>
+</ng-template>
.info {
color: bd.$info;
}
+
+ .debug {
+ color: bd.$gray-700;
+ }
}
::ng-deep cd-logs ngb-timepicker input.ngb-tp-input {
interval: number;
priorities: Array<{ name: string; value: string }> = [
+ { name: 'Debug', value: '[DBG]' },
{ name: 'Info', value: '[INF]' },
{ name: 'Warning', value: '[WRN]' },
{ name: 'Error', value: '[ERR]' },
selectedDate: NgbDateStruct;
startTime = { hour: 0, minute: 0 };
endTime = { hour: 23, minute: 59 };
+ maxDate = {
+ year: new Date().getFullYear(),
+ month: new Date().getMonth() + 1,
+ day: new Date().getDate()
+ };
constructor(
private logsService: LogsService,
this.selectedDate = null;
this.filterLogs();
}
+ resetFilter() {
+ this.priority = 'All';
+ this.search = '';
+ this.selectedDate = null;
+ this.startTime = { hour: 0, minute: 0 };
+ this.endTime = { hour: 23, minute: 59 };
+ this.filterLogs();
+
+ return false;
+ }
}
})
export class LogPriorityPipe implements PipeTransform {
transform(value: any): any {
- if (value === '[INF]') {
+ if (value === '[DBG]') {
+ return 'debug';
+ } else if (value === '[INF]') {
return 'info';
} else if (value === '[WRN]') {
return 'warn';