diff --git a/gui/src/components/dynamic_components.vue b/gui/src/components/dynamic_components.vue index ef8ec469..bb83cbd8 100644 --- a/gui/src/components/dynamic_components.vue +++ b/gui/src/components/dynamic_components.vue @@ -3,47 +3,56 @@ import { ref, onMounted, reactive, nextTick } from "vue"; import { setActivePinia } from "pinia"; import pinia from "../store/index"; setActivePinia(pinia); -import "../../node_modules/gridstack/dist/gridstack.min.css" +import "../../node_modules/gridstack/dist/gridstack.min.css"; import { GridStack } from "gridstack"; import { settingsStore as settings } from "../store/settingsStore.js"; -import hsl from "./main_active_heard_stations.vue" -import stats from "./main_active_stats.vue" -import audio from "./main_active_audio_level.vue" -import rigctl from "./main_active_rig_control.vue" -import beacon from "./main_active_broadcasts.vue" +import hsl from "./main_active_heard_stations.vue"; +import stats from "./main_active_stats.vue"; +import audio from "./main_active_audio_level.vue"; +import rigctl from "./main_active_rig_control.vue"; +import beacon from "./main_active_broadcasts.vue"; let count = ref(0); let info = ref(""); let grid = null; // DO NOT use ref(null) as proxies GS will break all logic when comparing structures... see https://github.com/gridstack/gridstack.js/issues/2115 const items = [ -{ x: 0, y: 1, h: 2 }, -{ x: 0, y: 2, w: 3 }, -{ x: 0, y: 7 }, -{ x: 3, y: 1, h: 2 }, -{ x: 0, y: 6, w: 2, h: 2 }, + { x: 0, y: 1, h: 2 }, + { x: 0, y: 2, w: 3 }, + { x: 0, y: 7 }, + { x: 3, y: 1, h: 2 }, + { x: 0, y: 6, w: 2, h: 2 }, ]; let components = reactive({ - yourRandomComponent1: { - name: hsl, props: {}, gridPos: { x: 0, y: 1, w: 8, h: 13 } - }, - yourRandomComponent2: { - name: stats, props: {}, gridPos: { x: 9, y: 1, w: 4, h: 13 } - }, - yourRandomComponent5: { - name: beacon, props: {}, gridPos: { x: 0, y: 15, w: 4, h: 5 }, - }, - yourRandomComponent4: { - name: rigctl, props: {}, gridPos: { x: 5, y: 15, w: 4, h: 5}, - }, - yourRandomComponent3: { - name: audio, props: {}, gridPos: { x: 14, y: 15, w: 4, h: 5}, - }, - - - }); + yourRandomComponent1: { + name: hsl, + props: {}, + gridPos: { x: 0, y: 1, w: 8, h: 13 }, + }, + yourRandomComponent2: { + name: stats, + props: {}, + gridPos: { x: 9, y: 1, w: 4, h: 13 }, + }, + yourRandomComponent5: { + name: beacon, + props: {}, + gridPos: { x: 0, y: 15, w: 4, h: 5 }, + }, + yourRandomComponent4: { + name: rigctl, + props: {}, + gridPos: { x: 5, y: 15, w: 4, h: 5 }, + }, + yourRandomComponent3: { + name: audio, + props: {}, + gridPos: { x: 14, y: 15, w: 4, h: 5 }, + }, +}); onMounted(() => { - grid = GridStack.init({ // DO NOT use grid.value = GridStack.init(), see above + grid = GridStack.init({ + // DO NOT use grid.value = GridStack.init(), see above float: true, cellHeight: "25px", minRow: 24, @@ -56,11 +65,13 @@ onMounted(() => { }); function addNewWidget() { -components.yourRandomComponent3= { -name: rigctl, props: {}, gridPos: {x: 14, y: 15, w: 4, h: 5 } -} + components.yourRandomComponent3 = { + name: rigctl, + props: {}, + gridPos: { x: 14, y: 15, w: 4, h: 5 }, + }; - // we have to wait for vue to update v-for, + // we have to wait for vue to update v-for, // until then the querySelector wont find the element nextTick(() => { console.log(grid); @@ -70,7 +81,6 @@ name: rigctl, props: {}, gridPos: {x: 14, y: 15, w: 4, h: 5 } }); //console.warn("i will only work once, fix my inputs to reuse me"); } - \ No newline at end of file + diff --git a/gui/src/components/dynamic_components2.vue b/gui/src/components/dynamic_components2.vue index 9ea9c6b4..98c7fe1b 100644 --- a/gui/src/components/dynamic_components2.vue +++ b/gui/src/components/dynamic_components2.vue @@ -1,18 +1,18 @@ \ No newline at end of file + diff --git a/gui/src/components/main.vue b/gui/src/components/main.vue index e4df7ab5..4dcbf540 100644 --- a/gui/src/components/main.vue +++ b/gui/src/components/main.vue @@ -336,9 +336,9 @@ function stopAllTransmissions() { role="tabpanel" aria-labelledby="list-grid-list" > - + - +