Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ vite.config.ts.timestamp-*
# traces for local dev
Trace-*.json

# bun lockfile
bun.lock

# cached VyOS ISOs
dev/vyos/.cache

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
4. `pve/init-cluster.sh`
5. Copy `apps/dashboard/.env.example` to `apps/dashboard/.env`
6. Add secrets to `apps/dashboard/.env`
- Update `CLOUDFLARE_HYPERDRIVE_LOCAL_CONNECTION_STRING_HYPERDRIVE` and set all `VPC` stuff to false
- set `BETTER_AUTH_SECRET`, `AUTUMN_SECRET` to anything
7. Set up the database: `pnpm --filter stack-dashboard db:migrate`
8. Seed test IPs: `podman exec -i fyra-postgres psql -U postgres < dev/seed-ipam.sql`
9. `pnpm --filter stack-dashboard dev`
Expand Down
8 changes: 8 additions & 0 deletions apps/dashboard/src/lib/name-generator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const choices = [
["kitten", "cat", "neko", "puppy", "dog", "doggy"],
["box", "stack", "rack", "server", "node"],
];

const choose = (i: int) => choices[i][Math.floor(Math.random() * choices[i].length)];

export const generateServerName = () => choose(0) + choose(1);
8 changes: 8 additions & 0 deletions apps/dashboard/src/lib/server/name-generator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const choices = [
["kitten", "cat", "neko", "puppy", "dog", "doggy"],
["box", "stack", "rack", "server", "node"],
];

const choose = (i: int) => choices[i][Math.floor(Math.random() * choices[i].length)];

export const generateServerName = () => choose(0) + choose(1);
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
EyeOff,
HardDriveUpload,
Plus,
X
X,
Dices
} from '@lucide/svelte';
import { generateServerName } from '$lib/name-generator';

type PageData = {
currentProject?: { id: string } | null;
Expand Down Expand Up @@ -123,7 +125,10 @@
const ipv6Available = $derived(Boolean(data.ipamAvailability?.ipv6.available));
const bothNetworksAvailable = $derived(ipv4Available && ipv6Available);

let serverName = $state('');
let serverName = $state(generateServerName());
function regenerateServerName() {
serverName = generateServerName();
}
let selectedImageId = $state<string | null>(null);
let selectedImageVersion = $state<string | null>(null);
let selectedPlanId = $state<string | null>(null);
Expand Down Expand Up @@ -417,12 +422,15 @@
>Name</span
>
</div>
<div class="mt-3">
<div class="mt-3 flex">
<Input
bind:value={serverName}
placeholder="my-server"
class="h-11 text-base sm:h-9 sm:text-sm"
/>
<Button variant="outline" class="h-11 sm:h-9" onclick={regenerateServerName}
><Dices /></Button
>
</div>
</div>

Expand Down