Skip to content

Commit

Permalink
Merge pull request #826 from DJ2LS/develop
Browse files Browse the repository at this point in the history
0.16.7
  • Loading branch information
DJ2LS authored Sep 30, 2024
2 parents 9e9bef5 + e81da9e commit 999295b
Show file tree
Hide file tree
Showing 14 changed files with 214 additions and 99 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/gh-action-pypi-publish@v1.10.1
if: startsWith(github.ref, 'refs/tags/v')
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
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.6-alpha",
"version": "0.16.7-alpha",
"description": "FreeDATA Client application for connecting to FreeDATA server",
"private": true,
"scripts": {
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>
45 changes: 27 additions & 18 deletions freedata_gui/src/components/grid/grid_stations_map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ const drawMap = () => {
// Adjust pin size and line width with zoom
actualPinRadius = basePinRadius / event.transform.k;
svg.selectAll('.pin').attr('r', actualPinRadius);
svg.selectAll('.my-pin').attr('r', actualPinRadius);
svg.selectAll('.heard-pin').attr('r', actualPinRadius);
svg.selectAll('.connection-line').attr('stroke-width', 1 / event.transform.k);
svg.selectAll('.country-path').attr('stroke-width', 0.5 / event.transform.k);
Expand Down Expand Up @@ -123,7 +125,7 @@ const drawMap = () => {
// Draw the pin for your station
g.append('circle')
.attr('class', 'pin my-pin')
.attr('class', 'my-pin')
.attr('r', actualPinRadius + 2)
.attr('fill', 'blue')
.attr('cx', myX)
Expand Down Expand Up @@ -185,10 +187,12 @@ const drawMap = () => {
});
};
// Function to update pins and draw lines
// Function to update pins and draw lines
const updatePinsAndLines = (g) => {
// Remove existing pins and lines
g.selectAll('.pin').remove();
g.selectAll('.my-pin').remove();
g.selectAll('.heard-pin').remove();
g.selectAll('.connection-line').remove();
const heardStations = toRaw(state.heard_stations); // Ensure it's the raw data
Expand All @@ -210,7 +214,7 @@ const updatePinsAndLines = (g) => {
// Draw the pin for your station
g.append('circle')
.attr('class', 'pin my-pin')
.attr('class', 'my-pin')
.attr('r', actualPinRadius + 2)
.attr('fill', 'blue')
.attr('cx', myX)
Expand Down Expand Up @@ -238,11 +242,11 @@ const updatePinsAndLines = (g) => {
}
// Add pins for heard stations
g.selectAll('.pin')
g.selectAll('.heard-pin')
.data(points)
.enter()
.append('circle')
.attr('class', 'pin')
.attr('class', 'heard-pin')
.attr('r', actualPinRadius)
.attr('fill', 'red')
.attr('cx', d => projection([d.lon, d.lat])[0])
Expand All @@ -255,16 +259,6 @@ const updatePinsAndLines = (g) => {
});
};
// Zoom in function
const zoomIn = () => {
svg.transition().call(zoom.scaleBy, 1.2);
};
// Zoom out function
const zoomOut = () => {
svg.transition().call(zoom.scaleBy, 0.8);
};
// Center the map
const centerMap = () => {
let mygrid = settings.remote.STATION.mygrid;
Expand All @@ -288,6 +282,15 @@ const centerMap = () => {
);
};
// Zoom in function
const zoomIn = () => {
svg.transition().call(zoom.scaleBy, 1.2);
};
// Zoom out function
const zoomOut = () => {
svg.transition().call(zoom.scaleBy, 0.8);
};
// Lifecycle hooks
onMounted(async () => {
Expand All @@ -308,7 +311,13 @@ onBeforeUnmount(() => {
height: 400px;
}
.pin {
.my-pin {
fill: blue;
stroke: black;
stroke-width: 1px;
}
.heard-pin {
fill: red;
stroke: black;
stroke-width: 1px;
Expand All @@ -320,7 +329,7 @@ onBeforeUnmount(() => {
}
.connection-line {
stroke: blue;
stroke: red;
stroke-width: 1;
stroke-opacity: 0.5;
}
Expand Down
Loading

0 comments on commit 999295b

Please sign in to comment.