Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
zomco committed Aug 16, 2024
1 parent ba4723b commit 7d7eb6a
Show file tree
Hide file tree
Showing 41 changed files with 4,583 additions and 979 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# misc
.DS_Store
*.pem
/.next/

# debug
npm-debug.log*
Expand Down
6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

113 changes: 113 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

76 changes: 63 additions & 13 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,68 @@
@tailwind components;
@tailwind utilities;

:root {
--foreground-rgb: 0, 0, 0;
--background-start-rgb: 214, 219, 220;
--background-end-rgb: 255, 255, 255;
}
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;
--card: 0 0% 100%;
--card-foreground: 222.2 84% 4.9%;
--popover: 0 0% 100%;
--popover-foreground: 222.2 84% 4.9%;
--primary: 222.2 47.4% 11.2%;
--primary-foreground: 210 40% 98%;
--secondary: 210 40% 96.1%;
--secondary-foreground: 222.2 47.4% 11.2%;
--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;
--accent: 210 40% 96.1%;
--accent-foreground: 222.2 47.4% 11.2%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 210 40% 98%;
--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;
--ring: 222.2 84% 4.9%;
--radius: 0.5rem;
--chart-1: 12 76% 61%;
--chart-2: 173 58% 39%;
--chart-3: 197 37% 24%;
--chart-4: 43 74% 66%;
--chart-5: 27 87% 67%;
}

body {
color: rgb(var(--foreground-rgb));
background: linear-gradient(
to bottom,
transparent,
rgb(var(--background-end-rgb))
)
rgb(var(--background-start-rgb));
.dark {
--background: 222.2 84% 4.9%;
--foreground: 210 40% 98%;
--card: 222.2 84% 4.9%;
--card-foreground: 210 40% 98%;
--popover: 222.2 84% 4.9%;
--popover-foreground: 210 40% 98%;
--primary: 210 40% 98%;
--primary-foreground: 222.2 47.4% 11.2%;
--secondary: 217.2 32.6% 17.5%;
--secondary-foreground: 210 40% 98%;
--muted: 217.2 32.6% 17.5%;
--muted-foreground: 215 20.2% 65.1%;
--accent: 217.2 32.6% 17.5%;
--accent-foreground: 210 40% 98%;
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 210 40% 98%;
--border: 217.2 32.6% 17.5%;
--input: 217.2 32.6% 17.5%;
--ring: 212.7 26.8% 83.9%;
--chart-1: 220 70% 50%;
--chart-2: 160 60% 45%;
--chart-3: 30 80% 55%;
--chart-4: 280 65% 60%;
--chart-5: 340 75% 55%;
}
}

@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
}
}
161 changes: 161 additions & 0 deletions app/install-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
'use client'

import React, {useState} from 'react';
import {Button} from "@/components/ui/button";
import {Alert, AlertDescription, AlertTitle} from "@/components/ui/alert";
import {AlertCircle} from "lucide-react";
import Script from 'next/script';
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
import {
Bird,
Book,
Bot,
Code2,
CornerDownLeft,
LifeBuoy,
Mic,
Paperclip,
Rabbit,
Settings,
Settings2,
Share,
SquareTerminal,
SquareUser,
Triangle,
Turtle,
} from "lucide-react"
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"
import { Bold, Italic, Underline } from "lucide-react"
import Releases from './release.json';


export default function InstallButton() {
const [version, updateVersion] = useState<string>("");
const [radar, updateRadar] = useState<string>("");
const [radars, updateRadars] = useState<[]>([])
const [model, updateModel] = useState<string>("");
return <div>
<Script
type="module"
src="https://unpkg.com/esp-web-tools@10/dist/web/install-button.js?module"
></Script>
<div className="mb-6">
<div>Welcome to the OwRadar web installer!</div>
<div>Plug in your ESP to a USB port. We will install OwRadar 0.15.0-b4 to it. </div>
<div>Hit &quot;Install&quot; and select the correct COM port. </div>
<div>Get OwRadar installed and connected in less than 3 minutes! </div>
</div>
<div className="mb-6">
<ToggleGroup variant="outline" size="lg" type="single" onValueChange={(value) => updateRadar(value)}>
{
Releases.radars.map((radar, index) => {
return <ToggleGroupItem
value={radar.name}
aria-label={radar.name}
key={radar.name}
>
{radar.name}
</ToggleGroupItem>
})
}
</ToggleGroup>
</div>
<div className="mb-6">
<ToggleGroup variant="outline" size="lg" type="single">
<ToggleGroupItem value="zero" aria-label="Toggle Model Zero">
Zero
</ToggleGroupItem>
<ToggleGroupItem value="a4" aria-label="Toggle Model A4">
A4
</ToggleGroupItem>
</ToggleGroup>
</div>
<div className="mb-6">
<Select>
<SelectTrigger
id="model"
className="items-start [&_[data-description]]:hidden"
>
<SelectValue placeholder="Select a model" />
</SelectTrigger>
<SelectContent>
<SelectItem value="genesis">
<div className="flex items-start gap-3 text-muted-foreground">
<Rabbit className="size-5" />
<div className="grid gap-0.5">
<p>
Neural{" "}
<span className="font-medium text-foreground">
Genesis
</span>
</p>
<p className="text-xs" data-description>
Our fastest model for general use cases.
</p>
</div>
</div>
</SelectItem>
<SelectItem value="explorer">
<div className="flex items-start gap-3 text-muted-foreground">
<Bird className="size-5" />
<div className="grid gap-0.5">
<p>
Neural{" "}
<span className="font-medium text-foreground">
Explorer
</span>
</p>
<p className="text-xs" data-description>
Performance and speed for efficiency.
</p>
</div>
</div>
</SelectItem>
<SelectItem value="quantum">
<div className="flex items-start gap-3 text-muted-foreground">
<Turtle className="size-5" />
<div className="grid gap-0.5">
<p>
Neural{" "}
<span className="font-medium text-foreground">
Quantum
</span>
</p>
<p className="text-xs" data-description>
The most powerful model for complex
computations.
</p>
</div>
</div>
</SelectItem>
</SelectContent>
</Select>
</div>
<div>
<esp-web-install-button manifest="">
<Button slot="activate" className="w-full">Install</Button>
<Alert slot="unsupported" variant="destructive">
<AlertCircle className="h-4 w-4"/>
<AlertTitle>Error</AlertTitle>
<AlertDescription>
Browser does not work
</AlertDescription>
</Alert>
<Alert slot="not-allowed" variant="destructive">
<AlertCircle className="h-4 w-4"/>
<AlertTitle>Error</AlertTitle>
<AlertDescription>
HTTPS not allowed
</AlertDescription>
</Alert>
</esp-web-install-button>
</div>
</div>

}
4 changes: 2 additions & 2 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import './globals.css'
import { Inter } from 'next/font/google'

export const metadata = {
title: 'owkor',
description: 'owkor',
title: 'OwRadar',
description: 'OwRadar',
manifest: 'site.webmanifest',
icons: {
icon: ['/favicon-32x32.png', '/favicon-16x16.png'],
Expand Down
Loading

0 comments on commit 7d7eb6a

Please sign in to comment.