Skip to content

Commit

Permalink
Merge branch 'develop' into dependabot/npm_and_yarn/freedata_gui/deve…
Browse files Browse the repository at this point in the history
…lop/eslint-9.10.0
  • Loading branch information
DJ2LS authored Oct 1, 2024
2 parents db167b5 + c54229e commit f6e685b
Show file tree
Hide file tree
Showing 32 changed files with 612 additions and 280 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build_nsis_bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,3 @@ jobs:
draft: true
files: ./FreeDATA-Installer.exe
tag_name: ${{ github.ref_name }}
name: 'FreeDATA-${{ github.ref_name }}'
2 changes: 1 addition & 1 deletion .github/workflows/modem_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- python-version: "3.9"
- python-version: "3.10"
- python-version: "3.11"
#- python-version: "3.12" NOT YET SUPPORTED BY NUITKA!
- python-version: "3.12"

steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pip_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
- name: Publish to PyPI
uses: pypa/[email protected]
if: startsWith(github.ref, 'refs/tags/v')
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ coverage.xml
venv_3.11/
venv/
test_venv/
freedata_server/lib/codec2/codec2/
2 changes: 1 addition & 1 deletion freedata_gui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "FreeDATA",
"version": "0.16.4-alpha",
"version": "0.16.8-alpha",
"description": "FreeDATA Client application for connecting to FreeDATA server",
"private": true,
"scripts": {
Expand Down
11 changes: 7 additions & 4 deletions freedata_gui/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@
<script>
function setAppHeight() {
const appHeight = window.innerHeight;
document.documentElement.style.setProperty('--app-height', `${appHeight}px`);
document.documentElement.style.setProperty(
"--app-height",
`${appHeight}px`,
);
}
window.addEventListener('resize', setAppHeight);
window.addEventListener('orientationchange', setAppHeight); // Handle orientation changes
document.addEventListener('DOMContentLoaded', setAppHeight); // Set height on initial load
window.addEventListener("resize", setAppHeight);
window.addEventListener("orientationchange", setAppHeight); // Handle orientation changes
document.addEventListener("DOMContentLoaded", setAppHeight); // Set height on initial load
</script>

<!-- Custom styles to use the dynamic height -->
Expand Down
29 changes: 24 additions & 5 deletions freedata_gui/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
<template>
<FreeDATAMain />
<Suspense>
<template #default>
<!-- Lazy load FreeDATAMain -->
<FreeDATAMain />
</template>
<template #fallback>
<!-- Show loading screen while the component is loading -->
<LoadingScreen />
</template>
</Suspense>
</template>

<script setup>
import FreeDATAMain from './components/main_screen.vue';
import { onMounted } from 'vue';
import { defineAsyncComponent, onMounted } from 'vue';
// Lazy load FreeDATAMain
const FreeDATAMain = defineAsyncComponent(() =>
import('./components/main_screen.vue')
);
// Import the loading screen
const LoadingScreen = defineAsyncComponent(() =>
import('./components/main_loading_screen.vue')
);
// Set attributes on the <html> element
onMounted(() => {
// Set attributes on the <html> element
document.documentElement.setAttribute('lang', 'en');
document.documentElement.setAttribute('data-bs-theme', 'light');
});
</script>
</script>
9 changes: 7 additions & 2 deletions freedata_gui/src/components/chat_conversations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
{{ details.unread_messages }} new
</span>
<br />
<small>{{ details.body ? details.body : '<file>' }}</small>
<small>{{ sanitizeBody(details.body) || '<file>' }}</small>
</div>
<div class="col-3 text-end">
<small>{{ getDateTime(details.timestamp) }}</small>
Expand All @@ -48,6 +48,7 @@
</template>

<script>
import DOMPurify from 'dompurify';
import { setActivePinia } from 'pinia';
import pinia from '../store/index';
import { useChatStore } from '../store/chatStore.js';
Expand Down Expand Up @@ -117,9 +118,13 @@ function startNewChat() {
chat.newChatMessage = "Hi there! Nice to meet you!";
}
function sanitizeBody(body) {
return body ? DOMPurify.sanitize(body, { ALLOWED_TAGS: [] }) : null;
}
export default {
setup() {
return { chat, newChatCall, chatSelected, setMessagesAsRead, processBeaconData, getDateTime, newChat, startNewChat };
return { chat, newChatCall, chatSelected, setMessagesAsRead, processBeaconData, getDateTime, newChat, startNewChat, sanitizeBody };
}
};
</script>
8 changes: 7 additions & 1 deletion freedata_gui/src/components/dynamic_components.vue
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,13 @@ onMounted(() => {
data-bs-target="#offcanvasGridItems"
aria-controls="offcanvasGridItems"
>
<i class="bi bi-grip-vertical h5"></i>
<!-- <i class="bi bi-grip-vertical h5"> </i>-->
<span class="me-4 text-white" style="writing-mode: vertical-rl; transform: rotate(180deg);">
screen settings
</span>
</button>
<div class="grid-container z-0" style="height: calc(100vh - 51px);">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ window.addEventListener(

<template>
<div class="card h-100">
<div class="card-header p-0">
<div class="card-header">
<i class="bi bi-broadcast" style="font-size: 1.2rem"></i>&nbsp;
<strong>Broadcasts</strong>
</div>
Expand Down
14 changes: 7 additions & 7 deletions freedata_gui/src/components/grid/grid_active_heard_stations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function transmitPing(callsign) {
<template>
<div class="card h-100">
<!--325px-->
<div class="card-header p-0">
<div class="card-header">
<i class="bi bi-list-columns-reverse" style="font-size: 1.2rem"></i>&nbsp;
<strong>Heard stations</strong>
</div>
Expand Down Expand Up @@ -107,9 +107,9 @@ function transmitPing(callsign) {
@click="pushToPing(item.origin)"
>
<td>
{{ getDateTime(item.timestamp) }}
<small>{{ getDateTime(item.timestamp) }}</small>
</td>
<td>{{ item.frequency / 1000 }} kHz</td>
<td><small>{{ item.frequency / 1000 }} kHz</small></td>
<td>
<button
class="btn btn-sm btn-outline-secondary ms-2 border-0"
Expand All @@ -118,7 +118,7 @@ function transmitPing(callsign) {
@click="getStationInfoByCallsign(item.origin)"
disabled
>
<h6 class="p-0 m-0">{{ item.origin }}</h6>
<h6 class="p-0 m-0"><span class="badge text-bg-primary">{{ item.origin }}</span></h6>
</button>

<button
Expand Down Expand Up @@ -146,9 +146,9 @@ function transmitPing(callsign) {
</button>
</td>
<td>
{{ item.gridsquare }}
<small>{{ item.gridsquare }}</small>
</td>
<td>{{ getMaidenheadDistance(item.gridsquare) }} km</td>
<td><small>{{ getMaidenheadDistance(item.gridsquare) }} km</small></td>
<td>
<i
:class="getActivityInfo(item.activity_type).iconClass"
Expand All @@ -157,7 +157,7 @@ function transmitPing(callsign) {
></i>
</td>
<td>
{{ item.snr }}
<small>{{ item.snr }}</small>
</td>
<td>
<i v-if="item.away_from_key" class="bi bi-house-x"></i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function pushToPing(origin) {

<template>
<div class="card h-100">
<div class="card-header p-0">
<div class="card-header">
<i class="bi bi-list-columns-reverse" style="font-size: 1.2rem"></i>&nbsp;
<strong>Heard Stations</strong>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function setRadioParameterTuner() {

<template>
<div class="card h-100">
<div class="card-header p-0">
<div class="card-header">
<i class="bi bi-house-door" style="font-size: 1.2rem"></i>&nbsp;
<strong>Radio control</strong>
</div>
Expand Down
2 changes: 1 addition & 1 deletion freedata_gui/src/components/grid/grid_active_stats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ onMounted(() => {

<template>
<div class="card h-100">
<div class="card-header p-1">
<div class="card-header">
<div class="btn-group" role="group">
<div
class="list-group bg-body-tertiary list-group-horizontal"
Expand Down
10 changes: 6 additions & 4 deletions freedata_gui/src/components/grid/grid_activities.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,20 @@ function getDateTime(timestampRaw) {

<template>
<div class="card h-100">
<div class="card-header p-0">
<div class="card-header">
<i class="bi bi-card-list" style="font-size: 1.2rem"></i>&nbsp;
<strong>Activity</strong>
</div>
<div class="card-body overflow-auto m-0 p-0" style="align-items: start">
<div v-for="item in state.activities" :key="item[0]">
<h6 style="text-align: start" class="mb-0">
{{ item[1].origin }} -
<span>{{ getDateTime(item[1].timestamp) }}</span>
<span class="badge text-bg-primary">
{{ item[1].origin }}</span> -
<span class="badge text-bg-secondary">{{ getDateTime(item[1].timestamp) }}</span>
</h6>

<p class="mb-2" style="text-align: start; font-size: smaller">
{{ item[1].activity_type }} - {{ item[1].direction }}
<small>{{ item[1].activity_type }} - {{ item[1].direction }}</small>
</p>
</div>
</div>
Expand Down
Loading

0 comments on commit f6e685b

Please sign in to comment.