Skip to content

Commit 2844894

Browse files
authored
Merge pull request #2597 from Particular/john/better-instructions
2 parents f4c4c4e + 99f41e2 commit 2844894

File tree

1 file changed

+48
-37
lines changed

1 file changed

+48
-37
lines changed

src/Frontend/src/views/throughputreport/setup/ConnectionSetupView.vue

Lines changed: 48 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { onMounted, ref } from "vue";
2+
import { computed, onMounted, ref } from "vue";
33
import ThroughputConnectionSettings from "@/resources/ThroughputConnectionSettings";
44
import throughputClient from "@/views/throughputreport/throughputClient";
55
import { useIsMonitoringEnabled } from "@/composables/serviceServiceControlUrls";
@@ -16,11 +16,18 @@ const settingsInfo = ref<ThroughputConnectionSettings | null>(null);
1616
onMounted(async () => {
1717
settingsInfo.value = await throughputClient.setting();
1818
});
19+
20+
const needsConfiguration = computed(() => {
21+
const broker = settingsInfo.value?.broker_settings?.length ?? 0;
22+
const monitoring = settingsInfo.value?.monitoring_settings?.length ?? 0;
23+
const serviceControl = settingsInfo.value?.service_control_settings?.length ?? 0;
24+
return broker > 0 || (monitoring > 0 && useIsMonitoringEnabled()) || serviceControl > 0;
25+
});
1926
</script>
2027

2128
<template>
2229
<div class="row">
23-
<p v-if="(settingsInfo?.broker_settings.length ?? 0 > 0) || (!isBrokerTransport && useIsMonitoringEnabled())">
30+
<p v-if="needsConfiguration">
2431
In order for ServicePulse to collect usage data from {{ store.transportNameForInstructions() }} you need to configure the below settings.<br />
2532
There are two configuration options, as environment variables or directly in the
2633
<a href="https://docs.particular.net/servicecontrol/creating-config-file"><code>ServiceControl.exe.config</code></a> file.
@@ -48,45 +55,49 @@ onMounted(async () => {
4855
</div>
4956
</div>
5057
</template>
51-
<template v-if="!isBrokerTransport && useIsMonitoringEnabled()">
52-
<div class="row configuration">
53-
<div class="col-12">
54-
<h4>ServiceControl Settings</h4>
55-
<p class="nogap">
56-
For more information read the
57-
<a href="https://docs.particular.net/servicecontrol/creating-config-file#usage-reporting-when-using-servicecontrol-licensingcomponentservicecontrolthroughputdataqueue">LicensingComponent/ServiceControlThroughputDataQueue</a> settings
58-
documentation.
59-
</p>
60-
<ConfigurationCode :settings="settingsInfo?.service_control_settings ?? []">
61-
<template #configInstructions>
62-
<div>Paste the settings above into the <code>ServiceControl.exe.config</code> file of the ServiceControl Error instance.</div>
63-
</template>
64-
<template #environmentVariableInstructions>
65-
<div>Execute the above instructions in a terminal to set the environment variables , these variables need to be set for the account under which the ServiceControl Error instance is running.</div>
66-
</template>
67-
</ConfigurationCode>
58+
<template v-if="!isBrokerTransport">
59+
<template v-if="settingsInfo?.service_control_settings.length ?? 0 > 0">
60+
<div class="row configuration">
61+
<div class="col-12">
62+
<h4>ServiceControl Settings</h4>
63+
<p class="nogap">
64+
For more information read the
65+
<a href="https://docs.particular.net/servicecontrol/creating-config-file#usage-reporting-when-using-servicecontrol-licensingcomponentservicecontrolthroughputdataqueue">LicensingComponent/ServiceControlThroughputDataQueue</a> settings
66+
documentation.
67+
</p>
68+
<ConfigurationCode :settings="settingsInfo?.service_control_settings ?? []">
69+
<template #configInstructions>
70+
<div>Paste the settings above into the <code>ServiceControl.exe.config</code> file of the ServiceControl Error instance.</div>
71+
</template>
72+
<template #environmentVariableInstructions>
73+
<div>Execute the above instructions in a terminal to set the environment variables , these variables need to be set for the account under which the ServiceControl Error instance is running.</div>
74+
</template>
75+
</ConfigurationCode>
76+
</div>
6877
</div>
69-
</div>
70-
<div class="row configuration">
71-
<div class="col-12">
72-
<h4>Monitoring Settings</h4>
73-
<p class="nogap">
74-
For more information read the
75-
<a href="https://docs.particular.net/servicecontrol/monitoring-instances/installation/creating-config-file#usage-reporting-monitoringservicecontrolthroughputdataqueue">Monitoring/ServiceControlThroughputDataQueue</a> settings documentation.
76-
</p>
77-
<ConfigurationCode :settings="settingsInfo?.monitoring_settings ?? []" configFileName="ServiceControl.Monitoring.exe.config">
78-
<template #configInstructions>
79-
<div>Paste the settings above into the <code>ServiceControl.Monitoring.exe.config</code> file of the ServiceControl Monitoring instance.</div>
80-
</template>
81-
<template #environmentVariableInstructions>
82-
<div>Execute the above instructions in a terminal to set the environment variables, these variables need to be set for the account under which the ServiceControl Monitoring instance is running.</div>
83-
</template>
84-
</ConfigurationCode>
78+
</template>
79+
<template v-if="useIsMonitoringEnabled() && (settingsInfo?.monitoring_settings.length ?? 0 > 0)">
80+
<div class="row configuration">
81+
<div class="col-12">
82+
<h4>Monitoring Settings</h4>
83+
<p class="nogap">
84+
For more information read the
85+
<a href="https://docs.particular.net/servicecontrol/monitoring-instances/installation/creating-config-file#usage-reporting-monitoringservicecontrolthroughputdataqueue">Monitoring/ServiceControlThroughputDataQueue</a> settings
86+
documentation.
87+
</p>
88+
<ConfigurationCode :settings="settingsInfo?.monitoring_settings ?? []" configFileName="ServiceControl.Monitoring.exe.config">
89+
<template #configInstructions>
90+
<div>Paste the settings above into the <code>ServiceControl.Monitoring.exe.config</code> file of the ServiceControl Monitoring instance.</div>
91+
</template>
92+
<template #environmentVariableInstructions>
93+
<div>Execute the above instructions in a terminal to set the environment variables, these variables need to be set for the account under which the ServiceControl Monitoring instance is running.</div>
94+
</template>
95+
</ConfigurationCode>
96+
</div>
8597
</div>
86-
</div>
98+
</template>
8799
</template>
88100
</template>
89-
90101
<style scoped>
91102
.configuration {
92103
margin-bottom: 15px;

0 commit comments

Comments
 (0)