Files
api/web/components/DummyServerSwitcher.vue
Pujit Mehrotra 0b8df2a43e chore(web): add pinia store and select dropdown for dummy server state (#1143)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced an interactive server selector that lets users toggle
between different server modes (e.g., Default and OEM Activation) via a
dropdown.
- Integrated reactive state management across key pages, ensuring
dynamic UI updates.
  - Added new popover components for enhanced UI interactions.
- Introduced a settings interface for developers, allowing access to
server selection within a popover.

- **Bug Fixes**
- Restored functionality for the downgrade feature that was previously
removed.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
  - https://app.asana.com/0/0/1209127325997642
2025-02-19 08:53:54 -05:00

37 lines
1.2 KiB
Vue

<script lang="ts" setup>
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@unraid/ui';
import { useDummyServerStore, type ServerSelector } from '~/_data/serverState';
const store = useDummyServerStore();
const { selector, serverState } = storeToRefs(store);
const updateSelector = (val: string) => {
selector.value = val as ServerSelector;
};
</script>
<template>
<div class="flex flex-col gap-2 border-solid border-2 p-2 border-r-2">
<h1 class="text-lg">Server State Selection</h1>
<details>
<summary>Initial Server State: {{ selector }}</summary>
<pre>{{ JSON.stringify(serverState, null, 4) }}</pre>
</details>
<Select v-model="selector" @update:model-value="updateSelector">
<SelectTrigger>
<SelectValue placeholder="Select an initial state" />
</SelectTrigger>
<SelectContent>
<SelectItem value="default">Default</SelectItem>
<SelectItem value="oemActiviation">OEM Activation</SelectItem>
</SelectContent>
</Select>
</div>
</template>
<style lang="postcss">
/* Import unraid-ui globals first */
@import '@unraid/ui/styles';
@import '../assets/main.css';
</style>