</td>
<td class="cs-table__column">{{ getWSState() }}</td>
<td class="cs-table__column">
- {{ chargingStation?.bootNotificationResponse?.status ?? 'Ø' }}
+ {{ chargingStation.bootNotificationResponse?.status ?? 'Ø' }}
</td>
<td class="cs-table__column">
{{ chargingStation.stationInfo.templateName }}
:status="state.simulatorState?.started"
:on="() => startSimulator()"
:off="() => stopSimulator()"
- :class="
- state.simulatorState?.started === true
- ? 'simulator-stop-button'
- : 'simulator-start-button'
- "
+ :class="simulatorButtonClass"
>
- {{ state.simulatorState?.started === true ? 'Stop' : 'Start' }} Simulator
- {{ state.simulatorState?.version != null ? ` (${state.simulatorState?.version})` : '' }}
+ {{ simulatorButtonMessage }}
</ToggleButton>
<ToggleButton
:id="'add-charging-stations'"
</template>
<script setup lang="ts">
-import { getCurrentInstance, onMounted, ref } from 'vue'
+import { computed, getCurrentInstance, onMounted, ref } from 'vue'
import { useToast } from 'vue-toast-notification'
import CSTable from '@/components/charging-stations/CSTable.vue'
import type { ResponsePayload, SimulatorState, UIServerConfigurationSection } from '@/types'
uiServerIndex: getFromLocalStorage<number>('uiServerConfigurationIndex', 0)
})
+const simulatorButtonClass = computed<string>(() =>
+ state.value.simulatorState?.started === true ? 'simulator-stop-button' : 'simulator-start-button'
+)
+const simulatorButtonMessage = computed<string>(
+ () =>
+ `${state.value.simulatorState?.started === true ? 'Stop' : 'Start'} Simulator ${state.value.simulatorState?.version != null ? `(${state.value.simulatorState.version})` : ''}`
+)
+
const app = getCurrentInstance()
const clearToggleButtons = (): void => {