Skip to content

Commit fc919bf

Browse files
authored
Merge pull request #122 from Stigmatoz/website-stats
Website stats
2 parents 5813dea + aee26e4 commit fc919bf

23 files changed

+540
-78
lines changed

src/_locales/de/messages.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@
8686
"averageTime": {
8787
"message": "Durchschnittliche Zeit an aktiven Tagen"
8888
},
89+
"averageDailyUsage": {
90+
"message": "Durchschnittliche tägliche Nutzung"
91+
},
8992
"mostActiveDay": {
9093
"message": "Der aktivste Tag"
9194
},

src/_locales/en/messages.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@
8686
"averageTime": {
8787
"message": "Average time for active days"
8888
},
89+
"averageDailyUsage": {
90+
"message": "Average daily usage"
91+
},
8992
"mostActiveDay": {
9093
"message": "The most active day"
9194
},

src/_locales/ru/messages.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@
8686
"averageTime": {
8787
"message": "Среднее время по активным дням"
8888
},
89+
"averageDailyUsage": {
90+
"message": "Среднее ежедневное использование"
91+
},
8992
"mostActiveDay": {
9093
"message": "Самый активный день"
9194
},

src/assets/css/dashboard.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ label {
281281
display: table-cell;
282282
cursor: pointer;
283283
}
284+
.settings-tab label[name='tabName']:hover {
285+
background-color: #cccccc !important;
286+
border-radius: 10px;
287+
}
284288
.settings-tab [type='radio'] {
285289
display: none;
286290
}

src/assets/css/general.css

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535
.mr-10 {
3636
margin-right: 10px;
3737
}
38+
.ml-20 {
39+
margin-left: 20px;
40+
}
41+
.mr-20 {
42+
margin-right: 20px;
43+
}
3844
.mr-5 {
3945
margin-right: 5px;
4046
}
@@ -61,12 +67,6 @@ select {
6167
.w-100 {
6268
width: 100%;
6369
}
64-
.w-80 {
65-
width: 80%;
66-
}
67-
.w-60 {
68-
width: 60%;
69-
}
7070
input[type='button'] {
7171
background: #428bff;
7272
color: #fff;
@@ -143,3 +143,13 @@ input[type='button'][disabled] {
143143
text-decoration: none;
144144
cursor: pointer;
145145
}
146+
.no-data .date-picker {
147+
font-weight: normal;
148+
text-align: center;
149+
width: 250px;
150+
margin: auto;
151+
margin-top: 15px;
152+
}
153+
.date-block .date-picker {
154+
width: 250px;
155+
}

src/assets/icons/details-link.svg

Lines changed: 9 additions & 0 deletions
Loading

src/assets/icons/open-link.svg

Lines changed: 5 additions & 0 deletions
Loading

src/components/ByDays.vue

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
<img height="55" src="../assets/icons/preloader.gif" />
44
</div>
55
<div v-else>
6-
<div class="no-data" v-if="countOfDays == undefined || (countOfDays == 0 && !noData)">
7-
{{ t('noData.message') }}
8-
</div>
6+
<no-data-by-days v-if="countOfDays == undefined || (countOfDays == 0 && !noData)" />
97
<div v-else-if="noData">
108
<div class="no-data">
119
{{ t('noDataForPeriod.message') }}
@@ -43,7 +41,9 @@
4341
<div class="header">{{ t('averageTimeByDays.message') }}</div>
4442
<p>{{ convertSummaryTimeToString(tabsByDays!.averageTime) }}</p>
4543
</div>
46-
<ByDaysChart :data="tabsByDays!" />
44+
<div class="ml-20 mr-20 by-days-chart">
45+
<ByDaysChart :data="tabsByDays!" />
46+
</div>
4747
<div>
4848
<Expander
4949
v-for="(tabDay, i) of tabsByDays?.days"
@@ -73,6 +73,7 @@ export default {
7373
import { computed, onMounted, ref } from 'vue';
7474
import { useI18n } from 'vue-i18n';
7575
import TabItem from '../components/TabItem.vue';
76+
import NoDataByDays from './NoDataByDays.vue';
7677
import ByDaysChart from '../components/ByDaysChart.vue';
7778
import Expander from '../components/Expander.vue';
7879
import { TabListByDays } from '../dto/tabListSummary';
@@ -160,14 +161,7 @@ async function exportToCsv() {
160161
justify-content: space-between;
161162
margin: 0 25px;
162163
}
163-
.date-block .date-picker {
164-
width: 250px;
165-
}
166-
.no-data .date-picker {
167-
font-weight: normal;
168-
text-align: center;
169-
width: 250px;
170-
margin: auto;
171-
margin-top: 15px;
164+
.by-days-chart {
165+
height: 240px;
172166
}
173167
</style>

src/components/ByDaysChart.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,9 @@ function refreshChart() {
9595

9696
<style scoped>
9797
.chart {
98-
height: 230px;
98+
height: 100%;
9999
margin: auto;
100-
width: 80%;
101-
margin-top: -10px;
100+
margin-top: 10px;
102101
margin-bottom: 10px;
103102
}
104103
</style>

src/components/Dashboad.vue

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,27 @@
11
<template>
2-
<div class="main">
3-
<div class="settings-item">
4-
<label class="title"> {{ t('dashboard.message') }} </label>
5-
</div>
6-
<div class="chart chartByHours">
7-
<div class="mt-10 mb-20">
8-
<input
9-
type="button"
10-
:class="['chart-btn', chart == TypeOfChart.Horly ? 'active' : '']"
11-
:value="t('byHours.message')"
12-
@click="openChart(TypeOfChart.Horly)"
13-
/>
14-
<input
15-
type="button"
16-
:class="['ml-10', 'chart-btn', chart == TypeOfChart.Interval ? 'active' : '']"
17-
:value="t('intervals.message')"
18-
@click="openChart(TypeOfChart.Interval)"
19-
/>
20-
</div>
21-
<HourlyChart v-if="chart == TypeOfChart.Horly" />
22-
<TimeIntervalChart v-if="chart == TypeOfChart.Interval" />
23-
</div>
24-
<div class="tab-items">
25-
<TabList
26-
:type="TypeOfList.Dashboard"
27-
:showAllStats="false"
28-
v-if="chart == TypeOfChart.Horly"
2+
<div class="settings-item">
3+
<label class="title"> {{ t('dashboard.message') }} </label>
4+
</div>
5+
<div class="chart chartByHours">
6+
<div class="mt-10 mb-20">
7+
<input
8+
type="button"
9+
:class="['chart-btn', chart == TypeOfChart.Horly ? 'active' : '']"
10+
:value="t('byHours.message')"
11+
@click="openChart(TypeOfChart.Horly)"
12+
/>
13+
<input
14+
type="button"
15+
:class="['ml-10', 'chart-btn', chart == TypeOfChart.Interval ? 'active' : '']"
16+
:value="t('intervals.message')"
17+
@click="openChart(TypeOfChart.Interval)"
2918
/>
3019
</div>
20+
<HourlyChart v-if="chart == TypeOfChart.Horly" />
21+
<TimeIntervalChart v-if="chart == TypeOfChart.Interval" />
22+
</div>
23+
<div class="tab-items">
24+
<TabList :type="TypeOfList.Dashboard" :showAllStats="false" v-if="chart == TypeOfChart.Horly" />
3125
</div>
3226
</template>
3327

0 commit comments

Comments
 (0)