Skip to content

Commit

Permalink
frontend: network: Add positioning
Browse files Browse the repository at this point in the history
* Add positioning
* Add serving cell info
* Add bettwer signal chart
  • Loading branch information
JoaoMario109 authored and patrickelectric committed Dec 10, 2024
1 parent fc8d47b commit 1f65027
Show file tree
Hide file tree
Showing 6 changed files with 457 additions and 127 deletions.
29 changes: 17 additions & 12 deletions frontend/src/components/network/NeighborCellsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@
>
<strong>No nearby cells info available.</strong>
</div>
<div v-else>
<v-card-text>
<v-row class="virtual-table-row">
<v-col
v-for="column in tableColumns"
class="virtual-table-cell"
>
<strong>{{ column }}</strong>
</v-col>
</v-row>
</v-card-text>
<v-card v-else>
<v-row class="pt-3 virtual-table-row">
<v-col
v-for="column in tableColumns"
class="virtual-table-cell title-table-cell"
>
<strong>{{ column }}</strong>
</v-col>
</v-row>
<v-virtual-scroll
:items="tableData"
height="300"
Expand All @@ -33,13 +31,15 @@
</v-row>
</template>
</v-virtual-scroll>
</div>
</v-card>
</template>

<script setup lang="ts">
import { computed, defineProps } from 'vue';
import { ModemCellInfo, NeighborCellInfo } from '@/types/ModemManager';
/** Props / Emits */
const props = defineProps<{
cellInfo: ModemCellInfo | null;
}>();
Expand Down Expand Up @@ -106,6 +106,11 @@ const tableData = computed<string[][]>(() => {
text-wrap: nowrap;
}
.title-table-cell {
font-weight: bold;
text-wrap: nowrap;
}
.virtual-table {
overflow-x: hidden;
}
Expand Down
46 changes: 35 additions & 11 deletions frontend/src/components/network/NetworkDetailsTab.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
<template>
<v-container fluid class="d-flex flex-wrap">
<ServingTower
:modem="props.modem"
:cell-info="cellInfo"
/>
<NetworkTowers
:modem="props.modem"
:cell-info="cellInfo"
/>
<v-container fluid class="ga-3 d-flex flex-wrap align-center">
<v-col cols="12" md="6" class="tab-col right-col">
<NetworkTowers
:modem="props.modem"
:cell-info="cellInfo"
/>
</v-col>
<v-col cols="12" md="6" class="tab-col left-col">
<ServingTower
:modem="props.modem"
:cell-info="cellInfo"
/>
</v-col>
</v-container>
</template>

Expand All @@ -21,6 +25,7 @@ import { ModemCellInfo, ModemDevice } from '@/types/ModemManager';
import NetworkTowers from './NetworkTowers.vue';
import ServingTower from './ServingTower.vue';
/** Props / Emits */
const props = defineProps<{
modem: ModemDevice;
}>();
Expand All @@ -34,10 +39,29 @@ const fetchCellInfo = async () => {
cellInfo.value = await ModemManager.fetchCellInfoById(props.modem.id);
} catch (error) {
cellInfo.value = null;
console.error('Unable to fetch cellInfo', (error as any)?.message);
console.error('Failed to fetch Cell Info, error:', (error as any)?.message);
}
};
/** Tasks */
new OneMoreTime({ delay: 10000, disposeWith: this }, fetchCellInfo);
new OneMoreTime({ delay: 25000, disposeWith: this }, fetchCellInfo);
</script>

<style scoped>
.tab-col {
flex: 1;
flex-grow: 1;
display: flex;
flex-direction: column;
max-width: 100%;
}
.left-col {
min-width: 400px;
}
.right-col {
min-width: 400px;
height: 100%;
}
</style>
Loading

0 comments on commit 1f65027

Please sign in to comment.