8 changed files with 357 additions and 107 deletions
@ -0,0 +1,67 @@ |
|||||
|
extends ../layouts/main |
||||
|
block content |
||||
|
|
||||
|
section.uk-section.uk-section-default.links-dashboard |
||||
|
.uk-container.uk-container-expand |
||||
|
|
||||
|
.uk-margin |
||||
|
.uk-card.uk-card-secondary.uk-card-small.uk-card-body |
||||
|
div(uk-grid).uk-grid-small |
||||
|
.uk-width-expand |
||||
|
h4.uk-card-title #{link.label} #[small.uk-text-muted past 7 days] |
||||
|
.uk-width-auto |
||||
|
a(href="/dashboard").uk-button.dtp-button-secondary.uk-button-small |
||||
|
+renderButtonIcon('fa-back', 'Back to Dashboard') |
||||
|
|
||||
|
canvas(id="link-visits").visit-graph |
||||
|
|
||||
|
div(uk-grid).uk-flex-between.uk-text-small |
||||
|
.uk-width-auto |
||||
|
.uk-margin |
||||
|
div= moment(linkVisitStats.start).format('MMM DD, YYYY h:mm:ss a') |
||||
|
.uk-width-auto |
||||
|
.uk-margin |
||||
|
div= moment(linkVisitStats.end).format('MMM DD, YYYY h:mm:ss a') |
||||
|
|
||||
|
.uk-margin |
||||
|
div(uk-grid).uk-grid-small |
||||
|
div(class="uk-width-1-1 uk-width-1-2@m") |
||||
|
.uk-margin |
||||
|
.uk-card.uk-card-secondary.uk-card-small.uk-card-body |
||||
|
h5.uk-card-title Top Countries |
||||
|
table.uk-table.uk-table-small |
||||
|
thead |
||||
|
tr |
||||
|
th Country |
||||
|
th Visits |
||||
|
tbody |
||||
|
each entry in linkCountryStats.stats |
||||
|
tr |
||||
|
td.uk-table-expand= entry.country ? entry.country : '--' |
||||
|
td= entry.count |
||||
|
div(class="uk-width-1-1 uk-width-1-2@m") |
||||
|
.uk-margin |
||||
|
.uk-card.uk-card-secondary.uk-card-small.uk-card-body |
||||
|
h5.uk-card-title Top Cities |
||||
|
table.uk-table.uk-table-small |
||||
|
thead |
||||
|
tr |
||||
|
th City |
||||
|
th(class="uk-visible@m") State |
||||
|
th Country |
||||
|
th Visits |
||||
|
tbody |
||||
|
each entry in linkCityStats.stats |
||||
|
tr |
||||
|
td= entry.city ? entry.city : '--' |
||||
|
td(class="uk-visible@m")= entry.region ? entry.region : '--' |
||||
|
td= entry.country ? entry.country : '--' |
||||
|
td= entry.count |
||||
|
|
||||
|
block viewjs |
||||
|
script(src="/chart.js/chart.min.js") |
||||
|
script(src="/chartjs-adapter-moment/chartjs-adapter-moment.min.js") |
||||
|
script. |
||||
|
window.addEventListener('dtp-load', ( ) => { |
||||
|
dtp.app.renderProfileStats('canvas#link-visits', !{JSON.stringify(linkVisitStats.stats)}); |
||||
|
}); |
@ -1,81 +1,7 @@ |
|||||
.dtp-dashboard-cluster { |
.links-dashboard { |
||||
|
|
||||
fieldset { |
canvas.visit-graph { |
||||
border-color: #9e9e9e; |
width: 960px; |
||||
color: #c8c8c8; |
height: 360px; |
||||
|
|
||||
legend { |
|
||||
font-family: 'Courier New', Courier, monospace; |
|
||||
font-size: 11px; |
|
||||
color: #9e9e9e; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.dtp-cpu-graph { |
|
||||
background: none; |
|
||||
|
|
||||
&.cpu-overload { |
|
||||
background: #4e0000; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.dtp-stat-cell { |
|
||||
line-height: 1; |
|
||||
} |
|
||||
|
|
||||
.dtp-stats-bar { |
|
||||
width: 100%; |
|
||||
height: 16px; |
|
||||
margin: 0; |
|
||||
padding: 0; |
|
||||
|
|
||||
.dtp-cpu-stat-bar { |
|
||||
display: inline-block; |
|
||||
height: 16px; |
|
||||
text-align: center; |
|
||||
font-size: 10px; |
|
||||
overflow: hidden; |
|
||||
|
|
||||
&.dtp-cpu-user { |
|
||||
background-color: #008000; |
|
||||
} |
|
||||
&.dtp-cpu-nice { |
|
||||
background-color: #808080; |
|
||||
} |
|
||||
&.dtp-cpu-sys { |
|
||||
background-color: #808000; |
|
||||
} |
|
||||
&.dtp-cpu-idle { |
|
||||
background-color: #484848; |
|
||||
} |
|
||||
&.dtp-cpu-irq { |
|
||||
background-color: #800000; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.dtp-mem-stat-bar { |
|
||||
display: inline-block; |
|
||||
height: 16px; |
|
||||
text-align: center; |
|
||||
font-size: 10px; |
|
||||
overflow: hidden; |
|
||||
|
|
||||
&.dtp-mem-used { |
|
||||
background-color: #008000; |
|
||||
} |
|
||||
&.dtp-mem-available { |
|
||||
background-color: #404040; |
|
||||
} |
|
||||
|
|
||||
&.dtp-mem-cached { |
|
||||
background-color: #008000; |
|
||||
} |
|
||||
&.dtp-mem-buffers { |
|
||||
background-color: #004000; |
|
||||
} |
|
||||
&.dtp-mem-slab { |
|
||||
background-color: #808000; |
|
||||
} |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
Loading…
Reference in new issue