diff --git a/launcher/src/components/UI/control-page/components/widgets/ClientPairWidget.vue b/launcher/src/components/UI/control-page/components/widgets/ClientPairWidget.vue index 7931bff14..c4baef5ce 100644 --- a/launcher/src/components/UI/control-page/components/widgets/ClientPairWidget.vue +++ b/launcher/src/components/UI/control-page/components/widgets/ClientPairWidget.vue @@ -2,18 +2,48 @@
CLIENT PAIR
-
+
index - 7 + {{ + setupStore.currentPairIndex + }}
-
+
total - 12 + {{ + setupStore.clientPairsLength + }}
- + diff --git a/launcher/src/components/UI/control-page/components/widgets/SelectServiceWidget.vue b/launcher/src/components/UI/control-page/components/widgets/SelectServiceWidget.vue index e7415f5a2..d5aa1abc8 100644 --- a/launcher/src/components/UI/control-page/components/widgets/SelectServiceWidget.vue +++ b/launcher/src/components/UI/control-page/components/widgets/SelectServiceWidget.vue @@ -209,27 +209,24 @@ const servicePairs = computed(() => { return pairs; }); -const currentPairIndex = ref(0); - const prevPair = () => { if (!servicePairs.value.length) return; - currentPairIndex.value = (currentPairIndex.value - 1 + servicePairs.value.length) % servicePairs.value.length; + setupStore.currentPairIndex = (setupStore.currentPairIndex - 1 + servicePairs.value.length) % servicePairs.value.length; }; const nextPair = () => { if (!servicePairs.value.length) return; - currentPairIndex.value = (currentPairIndex.value + 1) % servicePairs.value.length; + setupStore.currentPairIndex = (setupStore.currentPairIndex + 1) % servicePairs.value.length; }; const selectedPair = computed(() => { - return servicePairs.value.length ? servicePairs.value[currentPairIndex.value] : null; + return servicePairs.value.length ? servicePairs.value[setupStore.currentPairIndex] : null; }); watch( selectedPair, (newPair) => { setupStore.selectedServicePairs = newPair; - console.log("selectedServicePairs =====>", setupStore.selectedServicePairs); }, { immediate: true } ); @@ -237,8 +234,19 @@ watch( watch( servicePairs, (newPairs) => { - if (currentPairIndex.value >= newPairs.length) { - currentPairIndex.value = 0; // Reset index if out of bounds + if (setupStore.currentPairIndex >= newPairs.length) { + setupStore.currentPairIndex = 0; // Reset index if out of bounds + } + }, + { immediate: true } +); + +watch( + () => servicePairs.value.length, + (newLength) => { + setupStore.clientPairsLength = newLength; + if (setupStore.currentPairIndex >= newLength) { + setupStore.currentPairIndex = 0; } }, { immediate: true } diff --git a/launcher/src/languages/en.json b/launcher/src/languages/en.json index 93833abad..a8d48d155 100755 --- a/launcher/src/languages/en.json +++ b/launcher/src/languages/en.json @@ -153,7 +153,9 @@ "ramUsageIs": "RAM Usage is {usage} MB", "ramTotalis": "Total RAM is {total} MB", "receiveDataIs": "Receiving Data is {data} KB/s", - "transmitDataIs": "Transmitting Data is {data} KB/s" + "transmitDataIs": "Transmitting Data is {data} KB/s", + "clientPairIndexIs": "Client Pair Index is {index}", + "totalClientPairs": "Total Client Pairs is {total}" }, "taskManager": { "clickDisplay": "Click on tasks to display" diff --git a/launcher/src/store/setups.js b/launcher/src/store/setups.js index b62e48024..822c427cc 100644 --- a/launcher/src/store/setups.js +++ b/launcher/src/store/setups.js @@ -6,7 +6,11 @@ export const useSetups = defineStore("setups", { allSetups: [], editSetups: [], stakingSetups: [], + + //select service pairs widget selectedServicePairs: null, + currentPairIndex: 0, + clientPairsLength: 0, //Setup Node Page isConfigViewActive: false,