diff --git a/src/components/SceneryView/SceneryTopList.vue b/src/components/SceneryView/SceneryTopList.vue new file mode 100644 index 0000000..cce03ec --- /dev/null +++ b/src/components/SceneryView/SceneryTopList.vue @@ -0,0 +1,183 @@ + + + {{ t('scenery.top-list.header') }} + + + + + {{ t(`scenery.top-list.mode-${mode}`) }} + + + + + + {{ t(`scenery.top-list.scope-${scope}`) }} + + + + + + + Ups, coś poszło nie tak... + + + {{ + value.dispatcherName + }} + - + {{ + value.count + }} + + + {{ + value.dispatcherName + }} + - + {{ + value.sumRate + }} + + + + + + + + diff --git a/src/http.ts b/src/http.ts index ca54329..a1df38b 100644 --- a/src/http.ts +++ b/src/http.ts @@ -15,7 +15,7 @@ export class HttpClient { const data = await fetch(absoluteURL); if (!data.ok) { - throw new Error(`Cannot fetch: ${absoluteURL}`); + throw new Error(`Cannot fetch ${absoluteURL}: ${data.statusText}`); } return data.json(); diff --git a/src/locales/en.json b/src/locales/en.json index 9c47e75..664b684 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -573,6 +573,7 @@ "option-active-timetables": "Active timetables", "option-timetables-history": "Timetables history PL1", "option-dispatchers-history": "Dispatchers history PL1", + "option-top-list": "Scenery records", "btn-show-timetable-thumbnails": "Show rolling stock thumbnails", "btn-hide-timetable-thumbnails": "Hide rolling stock thumbnails", "timetable-includesScenery": "ALL TIMETABLES", diff --git a/src/locales/pl.json b/src/locales/pl.json index c01c5fa..59e623e 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -559,6 +559,7 @@ "option-active-timetables": "Aktywne rozkłady jazdy", "option-timetables-history": "Historia rozkładów PL1", "option-dispatchers-history": "Historia dyżurów PL1", + "option-top-list": "Rekordy scenerii", "btn-show-timetable-thumbnails": "Pokazuj podglądy składów", "btn-hide-timetable-thumbnails": "Ukrywaj podglądy składów", "timetable-includesScenery": "WSZYSTKIE RJ", @@ -578,7 +579,15 @@ "tablice-link": "Tablica informacyjna zbiorcza (autorstwa Thundo)", "bottom-info": "Pokaż pełną historię w zakładce Dziennika", "btn-show-internal-routes": "Pokazuj szlaki wewnętrzne", - "btn-hide-internal-routes": "Ukrywaj szlaki wewnętrzne" + "btn-hide-internal-routes": "Ukrywaj szlaki wewnętrzne", + + "top-list": { + "header": "REKORDY NA SCENERII", + "mode-likes": "OCENA DR", + "mode-dispatchers": "LICZBA DYŻURÓW", + "scope-name": "OGÓLNIE", + "scope-hash": "OBECNY HASH" + } }, "availability": { "title": "Dostępność", diff --git a/src/views/SceneryView.vue b/src/views/SceneryView.vue index 3afd75a..60ddb63 100644 --- a/src/views/SceneryView.vue +++ b/src/views/SceneryView.vue @@ -58,6 +58,7 @@ import SceneryDispatchersHistory from '../components/SceneryView/SceneryDispatch import { useApiStore } from '../store/apiStore'; import { Status } from '../typings/common'; +import SceneryTopList from '../components/SceneryView/SceneryTopList.vue'; const route = useRoute(); const router = useRouter(); @@ -89,6 +90,10 @@ const viewModes = [ { id: 'scenery.option-dispatchers-history', component: SceneryDispatchersHistory + }, + { + id: 'scenery.option-top-list', + component: SceneryTopList } ];