hotfix: update dependencies and UI elements

- Updated various npm packages in `package-lock.json` including `@adonisjs/drive`, `@adonisjs/env`, `axios`, `electron-to-chromium`, `nanoid`, `pg`, and `quansync`.
- Removed the GitHub link from the navbar and dashboard.
- Added an OAI interface link to the navbar and menu.
- Removed the "Star on GitHub" button from the dashboard.
- Updated the chart data fetching logic in `HomeController.ts` to calculate the last 4 years dynamically.
- Removed unused imports and commented-out code.
This commit is contained in:
Kaimbacher 2025-03-20 10:29:34 +01:00
parent 70f016422c
commit a25f8bf6f7
5 changed files with 68 additions and 69 deletions

View file

@ -17,7 +17,8 @@ export default class HomeController {
// .preload('authors')
// .orderBy('server_date_published');
const datasets = await db.from('documents as doc')
const datasets = await db
.from('documents as doc')
.select(['publish_id', 'server_date_published', db.raw(`date_part('year', server_date_published) as pub_year`)])
.where('server_state', serverState)
.innerJoin('link_documents_persons as ba', 'doc.id', 'ba.document_id')
@ -59,7 +60,6 @@ export default class HomeController {
// const year = params.year;
// const from = parseInt(year);
try {
// const datasets = await Database.from('documents as doc')
// .select([Database.raw(`date_part('month', server_date_published) as pub_month`), Database.raw('COUNT(*) as count')])
// .where('server_state', serverState)
@ -68,9 +68,12 @@ export default class HomeController {
// .groupBy('pub_month');
// // .orderBy('server_date_published');
const years = [2021, 2022, 2023]; // Add the second year
// Calculate the last 4 years including the current year
const currentYear = new Date().getFullYear();
const years = Array.from({ length: 4 }, (_, i) => currentYear - (i + 1)).reverse();
const result = await db.from('documents as doc')
const result = await db
.from('documents as doc')
.select([
db.raw(`date_part('year', server_date_published) as pub_year`),
db.raw(`date_part('month', server_date_published) as pub_month`),
@ -100,14 +103,14 @@ export default class HomeController {
acc[pub_year].data[pub_month - 1] = parseInt(count);
return acc ;
return acc;
}, {});
const outputDatasets = Object.entries(inputDatasets).map(([year, data]) => ({
data: data.data,
label: year,
borderColor: data.borderColor,
fill: data.fill
fill: data.fill,
}));
const data = {
@ -139,5 +142,4 @@ interface ChartDataset {
label: string;
borderColor: string;
fill: boolean;
}

58
package-lock.json generated
View file

@ -348,12 +348,12 @@
}
},
"node_modules/@adonisjs/drive": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@adonisjs/drive/-/drive-3.2.0.tgz",
"integrity": "sha512-vfZphRUmnOHlt5insWes07xXtQn3pn3bvI1SyfOeFV8rK5stKLQ7xD7qp/DcmhW5qzMnyGTuOYUdVOYDJHIiEg==",
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/@adonisjs/drive/-/drive-3.4.1.tgz",
"integrity": "sha512-oDYY4wJ7wDMlO4E+dZPYBu+T3Av7Mj+JL8+J33qgyxtiJylnZgoZDuRfFjZZix/bFNNuWX2sLwTMnyiDcK+YsA==",
"license": "MIT",
"dependencies": {
"flydrive": "^1.0.3"
"flydrive": "^1.1.0"
},
"engines": {
"node": ">=20.6.0"
@ -389,13 +389,13 @@
}
},
"node_modules/@adonisjs/env": {
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/@adonisjs/env/-/env-6.1.1.tgz",
"integrity": "sha512-sYvcJMbLSqwFWH0WtTTLddxkyXzERZl+8TEkXlMiIFaAZveq9h5eC4SQ+L5ILe9FHHiHVfmHsYF6LlAfcsIG1w==",
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/@adonisjs/env/-/env-6.2.0.tgz",
"integrity": "sha512-DZ7zQ4sBhzWftjU/SxJ7BstimrEiByCvmtAcMNDpDjOtJnR50172PRz1X7KjM3EqjCVrB19izzRVx/rmpCRPOA==",
"license": "MIT",
"dependencies": {
"@poppinss/utils": "^6.9.2",
"@poppinss/validator-lite": "^2.0.1",
"@poppinss/validator-lite": "^2.1.0",
"dotenv": "^16.4.7",
"split-lines": "^3.0.0"
},
@ -3128,9 +3128,9 @@
"license": "CC0-1.0"
},
"node_modules/@swc/wasm": {
"version": "1.11.10",
"resolved": "https://registry.npmjs.org/@swc/wasm/-/wasm-1.11.10.tgz",
"integrity": "sha512-ujwBa7w9wYa5L8J+KptuWlaDm3r/MUvVntVaNsseJSmW/A7SkvqizDGCYJU9wHMaQqED7J2bN1e3xdOnyPwFtQ==",
"version": "1.11.11",
"resolved": "https://registry.npmjs.org/@swc/wasm/-/wasm-1.11.11.tgz",
"integrity": "sha512-mPwKhESXb/SHtKGEeTM+TwA7zrpn1tF2cf7GnUakJh07SeUdJeTGP+zadotUzqqAWzYNHHWcMcM3C8Wef1ObjQ==",
"dev": true,
"license": "Apache-2.0"
},
@ -4812,9 +4812,9 @@
"license": "MIT"
},
"node_modules/axios": {
"version": "1.8.3",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.8.3.tgz",
"integrity": "sha512-iP4DebzoNlP/YN2dpwCgb8zoCmhtkajzS48JvwmkSkXvPI3DHc7m+XYL5tGnSlJtR6nImXZmdCuN5aP8dh1d8A==",
"version": "1.8.4",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.8.4.tgz",
"integrity": "sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw==",
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.15.6",
@ -5189,9 +5189,9 @@
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001705",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001705.tgz",
"integrity": "sha512-S0uyMMiYvA7CxNgomYBwwwPUnWzFD83f3B1ce5jHUfHTH//QL6hHsreI8RVC5606R4ssqravelYO5TU6t8sEyg==",
"version": "1.0.30001706",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001706.tgz",
"integrity": "sha512-3ZczoTApMAZwPKYWmwVbQMFpXBDds3/0VciVoUwPUbldlYyVLmRVuRs/PcUZtHpbLRpzzDvrvnFuREsGt6lUug==",
"dev": true,
"funding": [
{
@ -6354,9 +6354,9 @@
"license": "MIT"
},
"node_modules/electron-to-chromium": {
"version": "1.5.119",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.119.tgz",
"integrity": "sha512-Ku4NMzUjz3e3Vweh7PhApPrZSS4fyiCIbcIrG9eKrriYVLmbMepETR/v6SU7xPm98QTqMSYiCwfO89QNjXLkbQ==",
"version": "1.5.122",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.122.tgz",
"integrity": "sha512-EML1wnwkY5MFh/xUnCvY8FrhUuKzdYhowuZExZOfwJo+Zu9OsNCI23Cgl5y7awy7HrUHSwB1Z8pZX5TI34lsUg==",
"dev": true,
"license": "ISC"
},
@ -9648,9 +9648,9 @@
}
},
"node_modules/nanoid": {
"version": "3.3.10",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.10.tgz",
"integrity": "sha512-vSJJTG+t/dIKAUhUDw/dLdZ9s//5OxcHqLaDWWrW4Cdq7o6tdLIczUkMXt2MBNmk6sJRZBZRXVixs7URY1CmIg==",
"version": "3.3.11",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
"integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",
"funding": [
{
"type": "github",
@ -10360,9 +10360,9 @@
}
},
"node_modules/pg": {
"version": "8.14.0",
"resolved": "https://registry.npmjs.org/pg/-/pg-8.14.0.tgz",
"integrity": "sha512-nXbVpyoaXVmdqlKEzToFf37qzyeeh7mbiXsnoWvstSqohj88yaa/I/Rq/HEVn2QPSZEuLIJa/jSpRDyzjEx4FQ==",
"version": "8.14.1",
"resolved": "https://registry.npmjs.org/pg/-/pg-8.14.1.tgz",
"integrity": "sha512-0TdbqfjwIun9Fm/r89oB7RFQ0bLgduAhiIqIXOsyKoiC/L54DbuAAzIEN/9Op0f1Po9X7iCPXGoa/Ah+2aI8Xw==",
"license": "MIT",
"dependencies": {
"pg-connection-string": "^2.7.0",
@ -11076,9 +11076,9 @@
}
},
"node_modules/quansync": {
"version": "0.2.8",
"resolved": "https://registry.npmjs.org/quansync/-/quansync-0.2.8.tgz",
"integrity": "sha512-4+saucphJMazjt7iOM27mbFCk+D9dd/zmgMDCzRZ8MEoBfYp7lAvoN38et/phRQF6wOPMy/OROBGgoWeSKyluA==",
"version": "0.2.10",
"resolved": "https://registry.npmjs.org/quansync/-/quansync-0.2.10.tgz",
"integrity": "sha512-t41VRkMYbkHyCYmOvx/6URnN80H7k4X0lLdBMGsz+maAwrJQYB1djpV6vHrQIBE0WBSGqhtEHrK9U3DWWH8v7A==",
"funding": [
{
"type": "individual",

View file

@ -21,12 +21,11 @@ import {
mdiFormatListGroup,
mdiFormatListNumbered,
mdiLogout,
mdiGithub,
mdiThemeLightDark,
mdiViewDashboard,
mdiMapSearch,
mdiInformationVariant,
mdiGlasses,
mdiXml
} from '@mdi/js';
import NavBarItem from '@/Components/NavBarItem.vue';
import NavBarItemLabel from '@/Components/NavBarItemLabel.vue';
@ -100,7 +99,8 @@ const showAbout = async () => {
<FirstrunWizard ref="about"></FirstrunWizard>
<div class="flex lg:items-stretch" :class="containerMaxW">
<div class="flex-1 items-stretch flex h-14">
<NavBarItem type="flex lg:hidden" @click.prevent="layoutStore.asideMobileToggle()" v-if="props.showBurger">
<NavBarItem type="flex lg:hidden" @click.prevent="layoutStore.asideMobileToggle()"
v-if="props.showBurger">
<BaseIcon :path="layoutStore.isAsideMobileExpanded ? mdiBackburger : mdiForwardburger" size="24" />
</NavBarItem>
<NavBarItem type="hidden lg:flex xl:hidden" @click.prevent="menuOpenLg" v-if="props.showBurger">
@ -110,9 +110,9 @@ const showAbout = async () => {
<NavBarItemLabel :icon="mdiViewDashboard" label="Dashboard" size="22" is-hover-label-only
route-name="apps.dashboard" />
</NavBarItem>
<NavBarItem route-name="apps.map">
<!-- <NavBarItem route-name="apps.map">
<NavBarItemLabel :icon="mdiMapSearch" label="Map" size="22" is-hover-label-only route-name="apps.map" />
</NavBarItem>
</NavBarItem> -->
<!-- <NavBarItem>
<NavBarSearch />
</NavBarItem> -->
@ -186,12 +186,15 @@ const showAbout = async () => {
<NavBarItem is-desktop-icon-only @click.prevent="toggleLightDark">
<NavBarItemLabel v-bind:icon="mdiThemeLightDark" label="Light/Dark" is-desktop-icon-only />
</NavBarItem>
<NavBarItem href="https://gitea.geosphere.at/geolba/tethys.backend" target="_blank" is-desktop-icon-only>
<!-- <NavBarItem href="" target="_blank" is-desktop-icon-only>
<NavBarItemLabel v-bind:icon="mdiGithub" label="GitHub" is-desktop-icon-only />
</NavBarItem> -->
<NavBarItem href="/oai" target="_blank" is-desktop-icon-only>
<NavBarItemLabel v-bind:icon="mdiXml" label="OAI Interface" is-desktop-icon-only />
</NavBarItem>
<NavBarItem is-desktop-icon-only @click="showAbout">
<!-- <NavBarItem is-desktop-icon-only @click="showAbout">
<NavBarItemLabel v-bind:icon="mdiInformationVariant" label="About" is-desktop-icon-only />
</NavBarItem>
</NavBarItem> -->
<NavBarItem is-desktop-icon-only @click="logout">
<NavBarItemLabel v-bind:icon="mdiLogout" label="Log out" is-desktop-icon-only />
</NavBarItem>

View file

@ -18,20 +18,19 @@ import CardBoxWidget from '@/Components/CardBoxWidget.vue';
import CardBox from '@/Components/CardBox.vue';
import TableSampleClients from '@/Components/TableSampleClients.vue';
// import NotificationBar from '@/Components/NotificationBar.vue';
import BaseButton from '@/Components/BaseButton.vue';
import CardBoxClient from '@/Components/CardBoxClient.vue';
import LayoutAuthenticated from '@/Layouts/LayoutAuthenticated.vue';
import SectionTitleLineWithButton from '@/Components/SectionTitleLineWithButton.vue';
import SectionBannerStarOnGitHub from '@/Components/SectionBannerStarOnGitea.vue';
// import SectionBannerStarOnGitHub from '@/Components/SectionBannerStarOnGitea.vue';
import CardBoxDataset from '@/Components/CardBoxDataset.vue';
const mainService = MainService()
// const chartData = ref();
const fillChartData = async () => {
await mainService.fetchChartData("2022");
// chartData.value = chartConfig.sampleChartData();
// chartData.value = mainService.graphData;
};
// const fillChartData = async () => {
// await mainService.fetchChartData("2022");
// // chartData.value = chartConfig.sampleChartData();
// // chartData.value = mainService.graphData;
// };
const chartData = computed(() => mainService.graphData);
// onMounted(async () => {
// await mainService.fetchChartData("2022");
@ -61,15 +60,15 @@ const datasetBarItems = computed(() => mainService.datasets.slice(0, 5));
<SectionMain>
<SectionTitleLineWithButton v-bind:icon="mdiChartTimelineVariant" title="Overview" main>
<BaseButton
href="https://gitea.geosphere.at/geolba/tethys.backend"
<!-- <BaseButton
href=""
target="_blank"
:icon="mdiGithub"
label="Star on GeoSphere Forgejo"
color="contrast"
rounded-full
small
/>
/> -->
</SectionTitleLineWithButton>
<div class="grid grid-cols-1 gap-6 lg:grid-cols-3 mb-6">
@ -120,7 +119,7 @@ const datasetBarItems = computed(() => mainService.datasets.slice(0, 5));
</div>
</div>
<SectionBannerStarOnGitHub />
<!-- <SectionBannerStarOnGitHub /> -->
<SectionTitleLineWithButton :icon="mdiChartPie" title="Trends overview: Publications per month" />
<CardBox title="Performance" :icon="mdiFinance" :header-icon="mdiReload" class="mb-6" @header-icon-click="fillChartData">

View file

@ -158,16 +158,11 @@ export default [
],
},
// {
// route: 'dataset.create',
// icon: mdiDatabasePlus,
// label: 'Create Dataset',
// href: '',
// icon: mdiGithub,
// label: 'Forgejo',
// target: '_blank',
// },
{
href: 'https://gitea.geosphere.at/geolba/tethys.backend',
icon: mdiGithub,
label: 'Forgejo',
target: '_blank',
},
{
href: '/oai',
icon: mdiAccountEye,