File tree Expand file tree Collapse file tree 13 files changed +71
-40
lines changed
Expand file tree Collapse file tree 13 files changed +71
-40
lines changed Original file line number Diff line number Diff line change 226226 "mostVisited" : {
227227 "message" : " Die meistbesuchte Website "
228228 },
229- "timeChart " : {
230- "message" : " Die heutige Zeit "
229+ "dashboard " : {
230+ "message" : " Dashboard "
231231 },
232232 "timeChartDescription" : {
233233 "message" : " Dies ist eine stundenweise Zeitleiste für den Tag"
Original file line number Diff line number Diff line change 226226 "mostVisited" : {
227227 "message" : " Most visited website "
228228 },
229- "timeChart " : {
230- "message" : " Today's time "
229+ "dashboard " : {
230+ "message" : " Dashboard "
231231 },
232232 "timeChartDescription" : {
233233 "message" : " This is a chart of time during the day by the hour"
Original file line number Diff line number Diff line change 226226 "mostVisited" : {
227227 "message" : " Самый посещаемый сайт "
228228 },
229- "timeChart " : {
230- "message" : " Время сегодня "
229+ "dashboard " : {
230+ "message" : " Дашборд "
231231 },
232232 "timeChartDescription" : {
233233 "message" : " Это график времени в течение дня по часам"
Original file line number Diff line number Diff line change 1+ : root {
2+ --main-color : # 6ebf5d ;
3+ --popup-header : # efefef ;
4+ --progress-bar : # 428bff ;
5+ }
6+
17.float-right {
28 float : right;
39}
Original file line number Diff line number Diff line change 1- : root {
2- --main-color : # 6ebf5d ;
3- --popup-header : # efefef ;
4- --progress-bar : # 428bff ;
5- }
61::-webkit-scrollbar-track {
72 border-radius : 10px ;
83 background-color : # f5f5f5 ;
Original file line number Diff line number Diff line change @@ -31,7 +31,11 @@ const isLimit = computedAsync(async () => {
3131}, false );
3232
3333const showDocumentBadge = computed (() => props .type == TypeOfUrl .Document );
34- const showLimitBadge = computed (() => props .listType == TypeOfList .Today && isLimit .value == true );
34+ const showLimitBadge = computed (
35+ () =>
36+ (props .listType == TypeOfList .Today || props .listType == TypeOfList .Dashboard ) &&
37+ isLimit .value == true ,
38+ );
3539 </script >
3640
3741<style scoped>
Original file line number Diff line number Diff line change 1+ <template >
2+ <div class =" settings-item" >
3+ <label class =" setting-header" > {{ t('dashboard.message') }} </label >
4+ <p class =" description" >{{ t('timeChartDescription.message') }}</p >
5+ </div >
6+ <div class =" chart chartByHours" >
7+ <TimeIntervalChart />
8+ </div >
9+ <div class =" chart mt-20" >
10+ <TabList :type =" TypeOfList.Dashboard" :showAllStats =" false" />
11+ </div >
12+ </template >
13+
14+ <script lang="ts">
15+ export default {
16+ name: ' Dashboard' ,
17+ };
18+ </script >
19+
20+ <script lang="ts" setup>
21+ import { useI18n } from ' vue-i18n' ;
22+ import TimeIntervalChart from ' ./TimeIntervalChart.vue' ;
23+ import TabList from ' ../components/TabList.vue' ;
24+ import { TypeOfList } from ' ../utils/enums' ;
25+
26+ const { t } = useI18n ();
27+ </script >
28+
29+ <style scoped>
30+ .chart {
31+ margin : 20px ;
32+ width : 80% ;
33+ }
34+ .chartByHours {
35+ height : 350px ;
36+ }
37+ </style >
Original file line number Diff line number Diff line change @@ -43,7 +43,8 @@ const emit = defineEmits<{
4343}>();
4444
4545const title = computed (() => {
46- if (props .listType == TypeOfList .Today ) return t (' today.message' );
46+ if (props .listType == TypeOfList .Today || props .listType == TypeOfList .Dashboard )
47+ return t (' today.message' );
4748 if (props .listType == TypeOfList .All ) {
4849 let countOfActiveDays =
4950 props .countOfActiveDays > 1 ? ` (${props .countOfActiveDays } ${t (' days.message' )}) ` : ' ' ;
Original file line number Diff line number Diff line change 88 </div >
99 <div v-else >
1010 <OverallStatistics v-if =" isShowOverallStats" :data =" dataForOvarallStats" />
11- <DonutChart :time =" timeForChart" :labels =" sitesForChart" />
11+ <DonutChart
12+ :time =" timeForChart"
13+ :labels =" sitesForChart"
14+ v-if =" type != TypeOfList.Dashboard"
15+ />
1216 <TabItemHeader
1317 :listType =" type"
1418 :summaryTime =" summaryTime"
@@ -86,7 +90,8 @@ function showAllWebSites() {
8690
8791async function loadList(sortingBy : SortingBy ) {
8892 let tabSummary = null ;
89- if (props .type == TypeOfList .Today ) tabSummary = await useTodayTabListSummary (sortingBy );
93+ if (props .type == TypeOfList .Today || props .type == TypeOfList .Dashboard )
94+ tabSummary = await useTodayTabListSummary (sortingBy );
9095 if (props .type == TypeOfList .All ) {
9196 tabSummary = await useAllTabListSummary (sortingBy );
9297
@@ -127,13 +132,13 @@ async function sorting(sortingBy: SortingBy) {
127132function getItem(tab : Tab ): CurrentTabItem {
128133 return {
129134 summaryTime:
130- props .type == TypeOfList .Today
135+ props .type == TypeOfList .Today || props . type == TypeOfList . Dashboard
131136 ? tab .days .find (day => day .date === todayLocalDate ())! .summary
132137 : tab .summaryTime ,
133138 favicon: tab .favicon ,
134139 url: tab .url ,
135140 sessions:
136- props .type == TypeOfList .Today
141+ props .type == TypeOfList .Today || props . type == TypeOfList . Dashboard
137142 ? tab .days .find (day => day .date === todayLocalDate ())! .counter
138143 : tab .counter ,
139144 };
Original file line number Diff line number Diff line change 11<template >
2- <div class =" settings-item" >
3- <label class =" setting-header" > {{ t('timeChart.message') }} </label >
4- <p class =" description" >{{ t('timeChartDescription.message') }}</p >
5- </div >
6- <div class =" chart" >
7- <Bar :data =" data" :options =" options" v-if =" isLoaded" />
8- </div >
2+ <Bar :data =" data" :options =" options" v-if =" isLoaded" />
93</template >
104
115<script lang="ts">
@@ -16,7 +10,6 @@ export default {
1610
1711<script lang="ts" setup>
1812import { Bar } from ' vue-chartjs' ;
19- import { useI18n } from ' vue-i18n' ;
2013import {
2114 Chart as ChartJS ,
2215 Title ,
@@ -33,8 +26,6 @@ import { TimeInterval } from '../entity/time-interval';
3326import { todayLocalDate } from ' ../utils/date' ;
3427import { convertHoursToTime , convertStringTimeIntervalToSeconds } from ' ../utils/converter' ;
3528
36- const { t } = useI18n ();
37-
3829type DataForChart = {
3930 summary: number ;
4031 hour: number ;
@@ -187,12 +178,3 @@ async function buildChart() {
187178
188179onMounted (async () => await buildChart ());
189180 </script >
190-
191- <style scoped>
192- .chart {
193- height : 350px ;
194- margin : auto ;
195- width : 80% ;
196- margin : 20px ;
197- }
198- </style >
You can’t perform that action at this time.
0 commit comments