Refactoring: Pinia stores are called *Store now.
This commit is contained in:
parent
5ae27f530e
commit
2cbdc92ef1
5 changed files with 31 additions and 31 deletions
|
@ -50,7 +50,7 @@ const props = defineProps<Props>();
|
||||||
const input = ref();
|
const input = ref();
|
||||||
const hasFocus = ref(false);
|
const hasFocus = ref(false);
|
||||||
const suggestedFiltersExpanded = ref(false);
|
const suggestedFiltersExpanded = ref(false);
|
||||||
const config = useConfigStore();
|
const configStore = useConfigStore();
|
||||||
|
|
||||||
type Filter = {
|
type Filter = {
|
||||||
field: string,
|
field: string,
|
||||||
|
@ -81,7 +81,7 @@ function selectedFilterIndexForField(field: string): number {
|
||||||
}
|
}
|
||||||
|
|
||||||
const suggestedFilters = computed<Filter[][]>(() => {
|
const suggestedFilters = computed<Filter[][]>(() => {
|
||||||
const cfg = config.getConfig;
|
const cfg = configStore.getConfig;
|
||||||
const sites = cfg?.community.sites || [];
|
const sites = cfg?.community.sites || [];
|
||||||
const domains = cfg?.community.domains || [];
|
const domains = cfg?.community.domains || [];
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
import {useConfigStore} from "@/stores/config";
|
import {useConfigStore} from "@/stores/config";
|
||||||
import {useVersionStore} from "@/stores/version";
|
import {useVersionStore} from "@/stores/version";
|
||||||
|
|
||||||
const config = useConfigStore();
|
const configStore = useConfigStore();
|
||||||
const version = useVersionStore();
|
const versionStore = useVersionStore();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<footer v-if="config.getConfig">
|
<footer v-if="configStore.getConfig">
|
||||||
ffffng ({{ version.getVersion }})
|
ffffng ({{ versionStore.getVersion }})
|
||||||
<a href="https://github.com/freifunkhamburg/ffffng" target="_blank">
|
<a href="https://github.com/freifunkhamburg/ffffng" target="_blank">
|
||||||
<i class="fa fa-code" aria-hidden="true" /> Source Code
|
<i class="fa fa-code" aria-hidden="true" /> Source Code
|
||||||
</a>
|
</a>
|
||||||
|
@ -16,12 +16,12 @@ const version = useVersionStore();
|
||||||
<i class="fa fa-bug" aria-hidden="true" /> Fehler melden
|
<i class="fa fa-bug" aria-hidden="true" /> Fehler melden
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
v-if="config.getConfig.legal.privacyUrl"
|
v-if="configStore.getConfig.legal.privacyUrl"
|
||||||
:href="config.getConfig.legal.privacyUrl"
|
:href="configStore.getConfig.legal.privacyUrl"
|
||||||
target="_blank">Datenschutz</a>
|
target="_blank">Datenschutz</a>
|
||||||
<a
|
<a
|
||||||
v-if="config.getConfig.legal.imprintUrl"
|
v-if="configStore.getConfig.legal.imprintUrl"
|
||||||
:href="config.getConfig.legal.imprintUrl"
|
:href="configStore.getConfig.legal.imprintUrl"
|
||||||
target="_blank">Impressum</a>
|
target="_blank">Impressum</a>
|
||||||
</footer>
|
</footer>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
import {useConfigStore} from "@/stores/config";
|
import {useConfigStore} from "@/stores/config";
|
||||||
import {route, RouteName} from "@/router";
|
import {route, RouteName} from "@/router";
|
||||||
|
|
||||||
const config = useConfigStore();
|
const configStore = useConfigStore();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<header v-if="config.getConfig">
|
<header v-if="configStore.getConfig">
|
||||||
<nav>
|
<nav>
|
||||||
<RouterLink class="logo" :to="route(RouteName.HOME)">
|
<RouterLink class="logo" :to="route(RouteName.HOME)">
|
||||||
<img
|
<img
|
||||||
|
@ -17,8 +17,8 @@ const config = useConfigStore();
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
|
|
||||||
<h1>
|
<h1>
|
||||||
{{ config.getConfig.community.name }} – Knotenverwaltung
|
|
||||||
<RouterLink :to="route(RouteName.HOME)">
|
<RouterLink :to="route(RouteName.HOME)">
|
||||||
|
{{ configStore.getConfig.community.name }} – Knotenverwaltung
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
|
|
|
@ -5,17 +5,17 @@ import {ComponentVariant, MonitoringState} from "@/types";
|
||||||
import {RouteName} from "@/router";
|
import {RouteName} from "@/router";
|
||||||
import PageContainer from "@/components/page/PageContainer.vue";
|
import PageContainer from "@/components/page/PageContainer.vue";
|
||||||
|
|
||||||
const statistics = useStatisticsStore();
|
const statisticsStore = useStatisticsStore();
|
||||||
|
|
||||||
function refresh(): void {
|
function refresh(): void {
|
||||||
statistics.refresh();
|
statisticsStore.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh();
|
refresh();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<PageContainer v-if="statistics.getStatistics">
|
<PageContainer v-if="statisticsStore.getStatistics">
|
||||||
<h2>Knotenstatistik</h2>
|
<h2>Knotenstatistik</h2>
|
||||||
|
|
||||||
<div class="statistics">
|
<div class="statistics">
|
||||||
|
@ -23,14 +23,14 @@ refresh();
|
||||||
title="Registrierte Knoten"
|
title="Registrierte Knoten"
|
||||||
icon="circle-o"
|
icon="circle-o"
|
||||||
:variant="ComponentVariant.INFO"
|
:variant="ComponentVariant.INFO"
|
||||||
:value="statistics.getStatistics.nodes.registered"
|
:value="statisticsStore.getStatistics.nodes.registered"
|
||||||
:route="RouteName.ADMIN_NODES"
|
:route="RouteName.ADMIN_NODES"
|
||||||
/>
|
/>
|
||||||
<StatisticsCard
|
<StatisticsCard
|
||||||
title="Mit hinterlegtem fastd-Key"
|
title="Mit hinterlegtem fastd-Key"
|
||||||
icon="lock"
|
icon="lock"
|
||||||
:variant="ComponentVariant.WARNING"
|
:variant="ComponentVariant.WARNING"
|
||||||
:value="statistics.getStatistics.nodes.withVPN"
|
:value="statisticsStore.getStatistics.nodes.withVPN"
|
||||||
:route="RouteName.ADMIN_NODES"
|
:route="RouteName.ADMIN_NODES"
|
||||||
:filter="{hasKey: true}"
|
:filter="{hasKey: true}"
|
||||||
/>
|
/>
|
||||||
|
@ -38,7 +38,7 @@ refresh();
|
||||||
title="Mit Koordinaten"
|
title="Mit Koordinaten"
|
||||||
icon="map-marker"
|
icon="map-marker"
|
||||||
:variant="ComponentVariant.SUCCESS"
|
:variant="ComponentVariant.SUCCESS"
|
||||||
:value="statistics.getStatistics.nodes.withCoords"
|
:value="statisticsStore.getStatistics.nodes.withCoords"
|
||||||
:route="RouteName.ADMIN_NODES"
|
:route="RouteName.ADMIN_NODES"
|
||||||
:filter="{hasCoords: true}"
|
:filter="{hasCoords: true}"
|
||||||
/>
|
/>
|
||||||
|
@ -46,7 +46,7 @@ refresh();
|
||||||
title="Monitoring aktiv"
|
title="Monitoring aktiv"
|
||||||
icon="heartbeat"
|
icon="heartbeat"
|
||||||
:variant="ComponentVariant.SUCCESS"
|
:variant="ComponentVariant.SUCCESS"
|
||||||
:value="statistics.getStatistics.nodes.monitoring.active"
|
:value="statisticsStore.getStatistics.nodes.monitoring.active"
|
||||||
:route="RouteName.ADMIN_NODES"
|
:route="RouteName.ADMIN_NODES"
|
||||||
:filter="{monitoringState: MonitoringState.ACTIVE}"
|
:filter="{monitoringState: MonitoringState.ACTIVE}"
|
||||||
/>
|
/>
|
||||||
|
@ -54,7 +54,7 @@ refresh();
|
||||||
title="Monitoring noch nicht bestätigt"
|
title="Monitoring noch nicht bestätigt"
|
||||||
icon="envelope"
|
icon="envelope"
|
||||||
:variant="ComponentVariant.DANGER"
|
:variant="ComponentVariant.DANGER"
|
||||||
:value="statistics.getStatistics.nodes.monitoring.pending"
|
:value="statisticsStore.getStatistics.nodes.monitoring.pending"
|
||||||
:route="RouteName.ADMIN_NODES"
|
:route="RouteName.ADMIN_NODES"
|
||||||
:filter="{monitoringState: MonitoringState.PENDING}"
|
:filter="{monitoringState: MonitoringState.PENDING}"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -39,7 +39,7 @@ type NodeRedactField = "nickname" | "email" | "token";
|
||||||
type NodeRedactFieldsMap = Partial<Record<NodeRedactField, boolean>>;
|
type NodeRedactFieldsMap = Partial<Record<NodeRedactField, boolean>>;
|
||||||
|
|
||||||
type NodesRedactFieldsMap = Partial<Record<MAC, NodeRedactFieldsMap>>;
|
type NodesRedactFieldsMap = Partial<Record<MAC, NodeRedactFieldsMap>>;
|
||||||
const nodes = useNodesStore();
|
const nodesStore = useNodesStore();
|
||||||
const redactFieldsByDefault = ref(true);
|
const redactFieldsByDefault = ref(true);
|
||||||
const nodesRedactFieldsMap = ref({} as NodesRedactFieldsMap)
|
const nodesRedactFieldsMap = ref({} as NodesRedactFieldsMap)
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ async function refresh(page: number): Promise<void> {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
redactAllFields(true);
|
redactAllFields(true);
|
||||||
try {
|
try {
|
||||||
await nodes.refresh(
|
await nodesStore.refresh(
|
||||||
page,
|
page,
|
||||||
NODE_PER_PAGE,
|
NODE_PER_PAGE,
|
||||||
props.sortDirection,
|
props.sortDirection,
|
||||||
|
@ -127,9 +127,9 @@ watch(props, async () => {
|
||||||
<NodesFilterPanel :search-term="searchTerm" :filter="filter" @update-filter="updateFilter"/>
|
<NodesFilterPanel :search-term="searchTerm" :filter="filter" @update-filter="updateFilter"/>
|
||||||
|
|
||||||
<Pager
|
<Pager
|
||||||
:page="nodes.getPage"
|
:page="nodesStore.getPage"
|
||||||
:itemsPerPage="nodes.getNodesPerPage"
|
:itemsPerPage="nodesStore.getNodesPerPage"
|
||||||
:totalItems="nodes.getTotalNodes"
|
:totalItems="nodesStore.getTotalNodes"
|
||||||
@changePage="refresh"/>
|
@changePage="refresh"/>
|
||||||
|
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
|
@ -237,7 +237,7 @@ watch(props, async () => {
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr
|
<tr
|
||||||
v-for="node in nodes.getNodes"
|
v-for="node in nodesStore.getNodes"
|
||||||
:class="[node.onlineState ? node.onlineState.toLowerCase() : 'online-state-unknown']">
|
:class="[node.onlineState ? node.onlineState.toLowerCase() : 'online-state-unknown']">
|
||||||
<td>{{ node.hostname }}</td>
|
<td>{{ node.hostname }}</td>
|
||||||
<td v-if="shallRedactField(node, 'nickname')">
|
<td v-if="shallRedactField(node, 'nickname')">
|
||||||
|
@ -334,9 +334,9 @@ watch(props, async () => {
|
||||||
</LoadingContainer>
|
</LoadingContainer>
|
||||||
|
|
||||||
<Pager
|
<Pager
|
||||||
:page="nodes.getPage"
|
:page="nodesStore.getPage"
|
||||||
:itemsPerPage="nodes.getNodesPerPage"
|
:itemsPerPage="nodesStore.getNodesPerPage"
|
||||||
:totalItems="nodes.getTotalNodes"
|
:totalItems="nodesStore.getTotalNodes"
|
||||||
@changePage="refresh"/>
|
@changePage="refresh"/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue