2022-07-05 13:41:31 -04:00
|
|
|
{{#unless this.isHidden}}
|
|
|
|
{{#if this.isEnabled}}
|
|
|
|
<ConditionalLoadingSection @isLoading={{this.isLoading}}>
|
|
|
|
{{#if this.showHeader}}
|
2020-04-30 11:31:04 -04:00
|
|
|
<div class="header">
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.showTitle}}
|
2020-04-30 11:31:04 -04:00
|
|
|
<ul class="breadcrumb">
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.showAllReportsLink}}
|
2020-04-30 11:31:04 -04:00
|
|
|
<li class="item all-reports">
|
2022-06-30 06:30:50 -04:00
|
|
|
<LinkTo @route="admin.dashboardReports" class="report-url">
|
2020-04-30 11:31:04 -04:00
|
|
|
{{i18n "admin.dashboard.all_reports"}}
|
2022-06-30 06:30:50 -04:00
|
|
|
</LinkTo>
|
2020-04-30 11:31:04 -04:00
|
|
|
</li>
|
|
|
|
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#unless this.showNotFoundError}}
|
2020-04-30 11:31:04 -04:00
|
|
|
<li class="item separator">|</li>
|
|
|
|
{{/unless}}
|
|
|
|
{{/if}}
|
2020-04-13 11:17:20 -04:00
|
|
|
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#unless this.showNotFoundError}}
|
2020-04-30 11:31:04 -04:00
|
|
|
<li class="item report">
|
2022-07-05 13:41:31 -04:00
|
|
|
<a href={{this.model.reportUrl}} class="report-url">
|
|
|
|
{{this.model.title}}
|
2020-04-30 11:31:04 -04:00
|
|
|
</a>
|
2018-08-17 10:19:25 -04:00
|
|
|
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.model.description}}
|
|
|
|
{{#if this.model.description_link}}
|
2022-12-28 07:28:11 -05:00
|
|
|
<a
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
href={{this.model.description_link}}
|
|
|
|
class="info"
|
|
|
|
data-tooltip={{this.model.description}}
|
|
|
|
>
|
2020-04-30 11:31:04 -04:00
|
|
|
{{d-icon "question-circle"}}
|
|
|
|
</a>
|
|
|
|
{{else}}
|
2022-12-28 07:28:11 -05:00
|
|
|
<span
|
|
|
|
class="info"
|
|
|
|
data-tooltip={{this.model.description}}
|
|
|
|
>
|
2020-04-30 11:31:04 -04:00
|
|
|
{{d-icon "question-circle"}}
|
|
|
|
</span>
|
|
|
|
{{/if}}
|
2020-04-13 11:17:20 -04:00
|
|
|
{{/if}}
|
2020-04-30 11:31:04 -04:00
|
|
|
</li>
|
|
|
|
{{/unless}}
|
|
|
|
</ul>
|
2020-03-09 08:44:34 -04:00
|
|
|
{{/if}}
|
|
|
|
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.shouldDisplayTrend}}
|
|
|
|
<div class="trend {{this.model.trend}}">
|
|
|
|
<span class="value" title={{this.model.trendTitle}}>
|
|
|
|
{{#if this.model.average}}
|
2022-12-28 07:28:11 -05:00
|
|
|
{{number this.model.currentAverage}}{{#if
|
|
|
|
this.model.percent
|
|
|
|
}}%{{/if}}
|
2020-04-30 11:31:04 -04:00
|
|
|
{{else}}
|
2022-12-28 07:28:11 -05:00
|
|
|
{{number this.model.currentTotal noTitle="true"}}{{#if
|
|
|
|
this.model.percent
|
|
|
|
}}%{{/if}}
|
2020-04-30 11:31:04 -04:00
|
|
|
{{/if}}
|
2018-08-17 10:19:25 -04:00
|
|
|
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.model.trendIcon}}
|
|
|
|
{{d-icon this.model.trendIcon class="icon"}}
|
2020-04-30 11:31:04 -04:00
|
|
|
{{/if}}
|
|
|
|
</span>
|
2020-04-13 11:17:20 -04:00
|
|
|
</div>
|
2018-07-31 21:23:28 -04:00
|
|
|
{{/if}}
|
2020-04-30 11:31:04 -04:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
2020-04-13 11:17:20 -04:00
|
|
|
|
2020-04-30 11:31:04 -04:00
|
|
|
<div class="body">
|
|
|
|
<div class="main">
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.showError}}
|
|
|
|
{{#if this.showTimeoutError}}
|
2020-04-30 11:31:04 -04:00
|
|
|
<div class="alert alert-error report-alert timeout">
|
|
|
|
{{d-icon "exclamation-triangle"}}
|
|
|
|
<span>{{i18n "admin.dashboard.timeout_error"}}</span>
|
|
|
|
</div>
|
2020-04-13 11:17:20 -04:00
|
|
|
{{/if}}
|
2020-04-30 11:31:04 -04:00
|
|
|
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.showExceptionError}}
|
2020-04-30 11:31:04 -04:00
|
|
|
<div class="alert alert-error report-alert exception">
|
|
|
|
{{d-icon "exclamation-triangle"}}
|
|
|
|
<span>{{i18n "admin.dashboard.exception_error"}}</span>
|
2018-08-22 05:25:12 -04:00
|
|
|
</div>
|
2020-04-30 11:31:04 -04:00
|
|
|
{{/if}}
|
|
|
|
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.showNotFoundError}}
|
2020-04-30 11:31:04 -04:00
|
|
|
<div class="alert alert-error report-alert not-found">
|
|
|
|
{{d-icon "exclamation-triangle"}}
|
|
|
|
<span>{{i18n "admin.dashboard.not_found_error"}}</span>
|
2020-04-13 11:17:20 -04:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
2020-04-30 11:31:04 -04:00
|
|
|
{{else}}
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.hasData}}
|
|
|
|
{{#if this.currentMode}}
|
2022-12-28 07:28:11 -05:00
|
|
|
{{component
|
|
|
|
this.modeComponent
|
|
|
|
model=this.model
|
|
|
|
options=this.options
|
|
|
|
}}
|
2018-08-17 10:19:25 -04:00
|
|
|
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.model.relatedReport}}
|
2022-12-28 07:28:11 -05:00
|
|
|
<AdminReport
|
|
|
|
@showFilteringUI={{false}}
|
|
|
|
@dataSourceName={{this.model.relatedReport.type}}
|
|
|
|
/>
|
2020-04-30 11:31:04 -04:00
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
|
|
|
{{else}}
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.rateLimitationString}}
|
2020-04-30 11:31:04 -04:00
|
|
|
<div class="alert alert-error report-alert rate-limited">
|
|
|
|
{{d-icon "thermometer-three-quarters"}}
|
2022-07-05 13:41:31 -04:00
|
|
|
<span>{{this.rateLimitationString}}</span>
|
2020-04-30 11:31:04 -04:00
|
|
|
</div>
|
|
|
|
{{else}}
|
|
|
|
<div class="alert alert-info report-alert no-data">
|
|
|
|
{{d-icon "chart-pie"}}
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.model.reportUrl}}
|
|
|
|
<a href={{this.model.reportUrl}} class="report-url">
|
2020-04-30 11:31:04 -04:00
|
|
|
<span>
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.model.title}}
|
2022-12-28 07:28:11 -05:00
|
|
|
{{this.model.title}}
|
|
|
|
—
|
2020-04-30 11:31:04 -04:00
|
|
|
{{/if}}
|
|
|
|
{{i18n "admin.dashboard.reports.no_data"}}
|
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
{{else}}
|
|
|
|
<span>{{i18n "admin.dashboard.reports.no_data"}}</span>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
2018-08-17 10:19:25 -04:00
|
|
|
{{/if}}
|
2020-04-30 11:31:04 -04:00
|
|
|
</div>
|
2018-07-19 14:33:11 -04:00
|
|
|
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.showFilteringUI}}
|
2020-04-30 11:31:04 -04:00
|
|
|
<div class="filters">
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.showModes}}
|
2020-04-30 11:31:04 -04:00
|
|
|
<div class="modes">
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#each this.displayedModes as |displayedMode|}}
|
2022-12-28 07:28:11 -05:00
|
|
|
<DButton
|
|
|
|
@action={{action "onChangeMode"}}
|
|
|
|
@actionParam={{displayedMode.mode}}
|
|
|
|
@class={{displayedMode.cssClass}}
|
|
|
|
@icon={{displayedMode.icon}}
|
|
|
|
/>
|
2020-04-30 11:31:04 -04:00
|
|
|
{{/each}}
|
2020-04-13 11:17:20 -04:00
|
|
|
</div>
|
2020-04-30 11:31:04 -04:00
|
|
|
{{/if}}
|
2018-07-19 14:33:11 -04:00
|
|
|
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.isChartMode}}
|
|
|
|
{{#if this.model.average}}
|
2021-06-21 04:35:11 -04:00
|
|
|
<span class="average-chart">
|
|
|
|
{{i18n "admin.dashboard.reports.average_chart_label"}}
|
|
|
|
</span>
|
|
|
|
{{/if}}
|
2020-07-28 10:14:41 -04:00
|
|
|
<div class="chart-groupings">
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#each this.chartGroupings as |chartGrouping|}}
|
2022-12-28 07:28:11 -05:00
|
|
|
<DButton
|
|
|
|
@label={{chartGrouping.label}}
|
|
|
|
@action={{action "changeGrouping" chartGrouping.id}}
|
|
|
|
@class={{chartGrouping.class}}
|
|
|
|
@disabled={{chartGrouping.disabled}}
|
|
|
|
/>
|
2020-07-28 10:14:41 -04:00
|
|
|
{{/each}}
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.showDatesOptions}}
|
2020-04-30 11:31:04 -04:00
|
|
|
<div class="control">
|
|
|
|
<span class="label">
|
|
|
|
{{i18n "admin.dashboard.reports.dates"}}
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<div class="input">
|
2022-12-28 07:28:11 -05:00
|
|
|
<DateTimeInputRange
|
|
|
|
@from={{this.startDate}}
|
|
|
|
@to={{this.endDate}}
|
|
|
|
@onChange={{action "onChangeDateRange"}}
|
|
|
|
@showFromTime={{false}}
|
|
|
|
@showToTime={{false}}
|
|
|
|
/>
|
2020-04-30 11:31:04 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
2020-04-13 11:17:20 -04:00
|
|
|
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#each this.model.available_filters as |filter|}}
|
2020-04-30 11:31:04 -04:00
|
|
|
<div class="control">
|
|
|
|
<span class="label">
|
2022-12-28 07:28:11 -05:00
|
|
|
{{i18n
|
|
|
|
(concat
|
|
|
|
"admin.dashboard.reports.filters." filter.id ".label"
|
|
|
|
)
|
|
|
|
}}
|
2020-04-30 11:31:04 -04:00
|
|
|
</span>
|
|
|
|
|
|
|
|
<div class="input">
|
|
|
|
{{component
|
|
|
|
(concat "report-filters/" filter.type)
|
2022-07-05 13:41:31 -04:00
|
|
|
model=this.model
|
2020-04-30 11:31:04 -04:00
|
|
|
filter=filter
|
2022-12-28 07:28:11 -05:00
|
|
|
applyFilter=(action "applyFilter")
|
|
|
|
}}
|
2020-04-30 11:31:04 -04:00
|
|
|
</div>
|
2020-04-13 11:17:20 -04:00
|
|
|
</div>
|
2020-04-30 11:31:04 -04:00
|
|
|
{{/each}}
|
2020-04-13 11:17:20 -04:00
|
|
|
|
2018-08-17 10:19:25 -04:00
|
|
|
<div class="control">
|
|
|
|
<div class="input">
|
2022-12-28 07:28:11 -05:00
|
|
|
<DButton
|
|
|
|
@class="btn-default export-csv-btn"
|
|
|
|
@action={{action "exportCsv"}}
|
|
|
|
@label="admin.export_csv.button_text"
|
|
|
|
@icon="download"
|
|
|
|
/>
|
2018-08-17 10:19:25 -04:00
|
|
|
</div>
|
2020-04-13 11:17:20 -04:00
|
|
|
</div>
|
2020-04-30 11:31:04 -04:00
|
|
|
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.showRefresh}}
|
2020-04-30 11:31:04 -04:00
|
|
|
<div class="control">
|
|
|
|
<div class="input">
|
2022-12-28 07:28:11 -05:00
|
|
|
<DButton
|
|
|
|
@class="refresh-report-btn btn-primary"
|
|
|
|
@action={{action "refreshReport"}}
|
|
|
|
@label="admin.dashboard.reports.refresh_report"
|
|
|
|
@icon="sync"
|
|
|
|
/>
|
2020-04-30 11:31:04 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
2022-06-30 06:30:50 -04:00
|
|
|
</ConditionalLoadingSection>
|
2020-04-30 11:31:04 -04:00
|
|
|
{{else}}
|
|
|
|
<div class="alert alert-info">
|
2022-07-05 13:41:31 -04:00
|
|
|
{{html-safe this.disabledLabel}}
|
2020-04-13 11:17:20 -04:00
|
|
|
</div>
|
2020-04-30 11:31:04 -04:00
|
|
|
{{/if}}
|
2022-12-28 07:28:11 -05:00
|
|
|
{{/unless}}
|