Skip to content

Commit

Permalink
chore: switch back to consumption UI at /
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuildthecloud committed Dec 16, 2024
1 parent 46284d4 commit e4a854b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
13 changes: 2 additions & 11 deletions ui/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Handler(devPort int) http.Handler {
if devPort == 0 {
return server
}
rp := httputil.ReverseProxy{
return &httputil.ReverseProxy{
Director: func(r *http.Request) {
r.URL.Scheme = "http"
if strings.HasPrefix(r.URL.Path, "/admin") {
Expand All @@ -29,13 +29,6 @@ func Handler(devPort int) http.Handler {
}
},
}
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.Header.Get("Upgrade") == "" && r.URL.Path == "/" {
http.Redirect(w, r, "/admin/", http.StatusFound)
} else {
rp.ServeHTTP(w, r)
}
})
}

type uiServer struct{}
Expand All @@ -49,9 +42,7 @@ func (s *uiServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
userPath := path.Join("user/build/", r.URL.Path)
adminPath := path.Join("admin/build/client", strings.TrimPrefix(r.URL.Path, "/admin"))

if r.URL.Path == "/" {
http.Redirect(w, r, "/admin/", http.StatusFound)
} else if _, err := fs.Stat(embedded, userPath); err == nil {
if _, err := fs.Stat(embedded, userPath); err == nil {
http.ServeFileFS(w, r, embedded, userPath)
} else if _, err := fs.Stat(embedded, adminPath); err == nil {
http.ServeFileFS(w, r, embedded, adminPath)
Expand Down
9 changes: 1 addition & 8 deletions ui/user/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
{/if}
</div>
<h1 class="text-7xl text-blue-50">
Friendly. <span class="text-black dark:text-white">Open Source.</span> Assistant.
<span class="text-black dark:text-white">Friendly. Open Source. Assistant.</span>
</h1>

<div class="mt-32 flex items-center gap-4">
Expand All @@ -79,13 +79,6 @@
alt="Google"
/>
</a>
<h3 class="text-lg">or</h3>
<pre><code
class="rounded-full bg-gray-100 dark:bg-gray-900"
style="padding: 16px 32px 16px 32px"
data-language="shell">docker run -p 80:8080 -e OPENAI_API_KEY otto8/otto8</code
></pre>
</div>
<h2 class="text-2xl">Talk to me here or run me yourself.</h2>
</div>
</div>

0 comments on commit e4a854b

Please sign in to comment.