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