mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-21 03:36:35 +00:00
refactor: rename frontend UI branding from hive to spinifex
- package.json: name → spinifex-ui - index.html: page title → Spinifex Control Panel - sidebar-layout: Mulga Hive → Mulga Spinifex - auth.ts: localStorage key → spinifex:v1:aws-credentials - main.tsx: theme storage key → spinifex-ui-theme - spinifexui_test.go: update service name assertion
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<meta name="description" content="Hive Control Panel" />
|
||||
<meta name="description" content="Spinifex Control Panel" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "hive-ui",
|
||||
"name": "spinifex-ui",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -260,12 +260,12 @@ export function SidebarLayout() {
|
||||
{...props}
|
||||
>
|
||||
<Avatar className="h-8 w-8 rounded-lg">
|
||||
<AvatarImage alt="Mulga Hive" src="/favicon.ico" />
|
||||
<AvatarImage alt="Mulga Spinifex" src="/favicon.ico" />
|
||||
<AvatarFallback className="rounded-lg">MH</AvatarFallback>
|
||||
</Avatar>
|
||||
<div className="grid flex-1 text-left text-sm leading-tight">
|
||||
<span className="truncate font-semibold">Mulga Hive</span>
|
||||
<span className="truncate text-xs">hive@mulgadc.com</span>
|
||||
<span className="truncate font-semibold">Mulga Spinifex</span>
|
||||
<span className="truncate text-xs">spinifex@mulgadc.com</span>
|
||||
</div>
|
||||
<ChevronsUpDown className="ml-auto size-4" />
|
||||
</SidebarMenuButton>
|
||||
|
||||
@@ -27,7 +27,7 @@ afterEach(() => {
|
||||
describe("setCredentials", () => {
|
||||
it("stores credentials in localStorage", () => {
|
||||
setCredentials(validCreds)
|
||||
const stored = localStorage.getItem("hive:v1:aws-credentials")
|
||||
const stored = localStorage.getItem("spinifex:v1:aws-credentials")
|
||||
expect(JSON.parse(stored ?? "")).toEqual(validCreds)
|
||||
})
|
||||
|
||||
@@ -45,7 +45,7 @@ describe("getCredentials", () => {
|
||||
})
|
||||
|
||||
it("reads from localStorage on first call", () => {
|
||||
localStorage.setItem("hive:v1:aws-credentials", JSON.stringify(validCreds))
|
||||
localStorage.setItem("spinifex:v1:aws-credentials", JSON.stringify(validCreds))
|
||||
expect(getCredentials()).toEqual(validCreds)
|
||||
})
|
||||
|
||||
@@ -58,13 +58,13 @@ describe("getCredentials", () => {
|
||||
})
|
||||
|
||||
it("returns null for invalid JSON in localStorage", () => {
|
||||
localStorage.setItem("hive:v1:aws-credentials", "not-json")
|
||||
localStorage.setItem("spinifex:v1:aws-credentials", "not-json")
|
||||
expect(getCredentials()).toBeNull()
|
||||
})
|
||||
|
||||
it("returns null when stored data fails schema validation", () => {
|
||||
localStorage.setItem(
|
||||
"hive:v1:aws-credentials",
|
||||
"spinifex:v1:aws-credentials",
|
||||
JSON.stringify({ accessKeyId: "short", secretAccessKey: "" }),
|
||||
)
|
||||
expect(getCredentials()).toBeNull()
|
||||
@@ -72,7 +72,7 @@ describe("getCredentials", () => {
|
||||
|
||||
it("returns null when stored object is missing fields", () => {
|
||||
localStorage.setItem(
|
||||
"hive:v1:aws-credentials",
|
||||
"spinifex:v1:aws-credentials",
|
||||
JSON.stringify({ accessKeyId: "AKIAIOSFODNN7EXAMPLE" }),
|
||||
)
|
||||
expect(getCredentials()).toBeNull()
|
||||
@@ -83,7 +83,7 @@ describe("clearCredentials", () => {
|
||||
it("removes credentials from localStorage", () => {
|
||||
setCredentials(validCreds)
|
||||
clearCredentials()
|
||||
expect(localStorage.getItem("hive:v1:aws-credentials")).toBeNull()
|
||||
expect(localStorage.getItem("spinifex:v1:aws-credentials")).toBeNull()
|
||||
})
|
||||
|
||||
it("clears the in-memory cache", () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { z } from "zod"
|
||||
|
||||
// Versioned storage key - increment version when schema changes
|
||||
const STORAGE_KEY = "hive:v1:aws-credentials"
|
||||
const STORAGE_KEY = "spinifex:v1:aws-credentials"
|
||||
|
||||
export const awsCredentialsSchema = z.object({
|
||||
accessKeyId: z
|
||||
|
||||
@@ -40,7 +40,7 @@ if (rootElement && !rootElement.innerHTML) {
|
||||
const root = ReactDOM.createRoot(rootElement)
|
||||
root.render(
|
||||
<StrictMode>
|
||||
<ThemeProvider defaultTheme="system" storageKey="hive-ui-theme">
|
||||
<ThemeProvider defaultTheme="system" storageKey="spinifex-ui-theme">
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<SidebarProvider>
|
||||
<RouterProvider router={router} />
|
||||
|
||||
@@ -107,7 +107,7 @@ func TestStatus_ReturnsValidState(t *testing.T) {
|
||||
status, err := svc.Status()
|
||||
|
||||
assert.NoError(t, err)
|
||||
// On a dev machine the hive-ui PID file may exist, so accept either outcome
|
||||
// On a dev machine the spinifex-ui PID file may exist, so accept either outcome
|
||||
assert.True(t, status == "stopped" || len(status) > 0, "status should be non-empty")
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ func TestReload_ReturnsNil(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestServiceName(t *testing.T) {
|
||||
assert.Equal(t, "hive-ui", serviceName)
|
||||
assert.Equal(t, "spinifex-ui", serviceName)
|
||||
}
|
||||
|
||||
func TestSecurityHeadersMiddleware(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user