refactor: rename tabby-playground to tabby-ui (#639)

add-llama-model-converter
Meng Zhang 2023-10-25 16:05:11 -07:00 committed by GitHub
parent 1a4c2aa71f
commit 9ecbf9031f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
108 changed files with 31 additions and 30 deletions

View File

@ -9,8 +9,8 @@ fix:
cargo clippy --fix --allow-dirty --allow-staged && cargo +nightly fmt
update-playground:
cd clients/tabby-playground && yarn build
rm -rf crates/tabby/playground && cp -R clients/tabby-playground/out crates/tabby/playground
cd clients/tabby-ui && yarn build
rm -rf crates/tabby/ui && cp -R clients/tabby-ui/out crates/tabby/ui
bump-version:
cargo ws version --no-git-tag --force "*"

View File

@ -1,5 +1,5 @@
{
"name": "tabby-playground",
"name": "tabby-ui",
"version": "0.1.0",
"private": true,
"scripts": {

View File

@ -3,8 +3,8 @@ mod completions;
mod engine;
mod events;
mod health;
mod playground;
mod search;
mod ui;
use std::{
net::{Ipv4Addr, SocketAddr},
@ -155,15 +155,16 @@ pub async fn main(config: &Config, args: &ServeArgs) {
doc.override_doc(args);
let app = Router::new()
.route("/", routing::get(playground::handler))
.route("/index.txt", routing::get(playground::handler))
.route("/_next/*path", routing::get(playground::handler))
.route("/", routing::get(ui::handler))
.route("/index.txt", routing::get(ui::handler))
.route("/_next/*path", routing::get(ui::handler))
.merge(api_router(args, config))
.merge(SwaggerUi::new("/swagger-ui").url("/api-docs/openapi.json", doc));
.merge(SwaggerUi::new("/swagger-ui").url("/api-docs/openapi.json", doc))
.fallback(ui::handler);
let app = if args.chat_model.is_some() {
app.route("/playground", routing::get(playground::handler))
.route("/playground.txt", routing::get(playground::handler))
app.route("/playground", routing::get(ui::handler))
.route("/playground.txt", routing::get(ui::handler))
} else {
app
};

View File

@ -7,7 +7,7 @@ use axum::{
use crate::fatal;
#[derive(rust_embed::RustEmbed)]
#[folder = "./playground"]
#[folder = "./ui"]
struct WebAssets;
struct WebStaticFile<T>(pub T);
@ -29,7 +29,7 @@ where
}
None => Response::builder()
.status(StatusCode::NOT_FOUND)
.body(boxed(Full::from("404")))
.body(boxed(Full::from(WebAssets::get("404.html").unwrap().data)))
.unwrap_or_else(|_| fatal!("Invalid response")),
}
}

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{35762:function(e,n,r){Promise.resolve().then(r.t.bind(r,58877,23)),Promise.resolve().then(r.bind(r,78963)),Promise.resolve().then(r.bind(r,78495)),Promise.resolve().then(r.t.bind(r,6928,23)),Promise.resolve().then(r.t.bind(r,33195,23)),Promise.resolve().then(r.bind(r,5925))},78963:function(e,n,r){"use strict";r.r(n),r.d(n,{Header:function(){return h}});var t=r(57437),s=r(2265),i=r(39311),a=r(93023),o=r(84168),d=r(30415),l=r.n(d),c=r(61396),f=r.n(c);let u=l()(()=>r.e(376).then(r.bind(r,15376)).then(e=>e.ThemeToggle),{loadableGenerated:{webpack:()=>[15376]},ssr:!1});function h(){let[e,n]=s.useState(!1);return s.useEffect(()=>{m().then(n)},[]),(0,t.jsxs)("header",{className:"sticky top-0 z-50 flex items-center justify-between w-full h-16 px-4 border-b shrink-0 bg-gradient-to-b from-background/10 via-background/50 to-background/80 backdrop-blur-xl",children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(u,{}),(0,t.jsx)(f(),{href:"/",className:(0,i.cn)((0,a.d)({variant:"link"})),children:"Home"}),e&&(0,t.jsx)(f(),{href:"/playground",className:(0,i.cn)((0,a.d)({variant:"link"})),children:"Playground"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-end space-x-2",children:[(0,t.jsxs)("a",{target:"_blank",href:"https://github.com/TabbyML/tabby",rel:"noopener noreferrer",className:(0,i.cn)((0,a.d)({variant:"outline"})),children:[(0,t.jsx)(o.Mr,{}),(0,t.jsx)("span",{className:"hidden ml-2 md:flex",children:"GitHub"})]}),(0,t.jsxs)("a",{target:"_blank",href:"/swagger-ui",rel:"noopener noreferrer",className:(0,i.cn)((0,a.d)({variant:"outline"})),children:[(0,t.jsx)(o.Tq,{}),(0,t.jsx)("span",{className:"hidden ml-2 md:flex",children:"OpenAPI"})]})]})]})}async function m(){{let e=await fetch("/v1/health"),n=await e.json();return!!n.chat_model}}},78495:function(e,n,r){"use strict";r.r(n),r.d(n,{Providers:function(){return a}});var t=r(57437);r(2265);var s=r(6435),i=r(95482);function a(e){let{children:n,...r}=e;return(0,t.jsx)(s.f,{...r,children:(0,t.jsx)(i.pn,{children:n})})}},95482:function(e,n,r){"use strict";r.d(n,{_v:function(){return c},aJ:function(){return l},pn:function(){return o},u:function(){return d}});var t=r(57437),s=r(2265),i=r(43212),a=r(39311);let o=i.zt,d=i.fC,l=i.xz,c=s.forwardRef((e,n)=>{let{className:r,sideOffset:s=4,...o}=e;return(0,t.jsx)(i.VY,{ref:n,sideOffset:s,className:(0,a.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-xs font-medium text-popover-foreground shadow-md animate-in fade-in-50 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",r),...o})});c.displayName=i.VY.displayName},58877:function(){}},function(e){e.O(0,[358,406,832,894,971,864,744],function(){return e(e.s=35762)}),_N_E=e.O()}]);
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{21050:function(e,n,r){Promise.resolve().then(r.t.bind(r,58877,23)),Promise.resolve().then(r.bind(r,78963)),Promise.resolve().then(r.bind(r,78495)),Promise.resolve().then(r.t.bind(r,6928,23)),Promise.resolve().then(r.t.bind(r,33195,23)),Promise.resolve().then(r.bind(r,5925))},78963:function(e,n,r){"use strict";r.r(n),r.d(n,{Header:function(){return h}});var t=r(57437),s=r(2265),i=r(39311),a=r(93023),o=r(84168),d=r(30415),l=r.n(d),c=r(61396),f=r.n(c);let u=l()(()=>r.e(376).then(r.bind(r,15376)).then(e=>e.ThemeToggle),{loadableGenerated:{webpack:()=>[15376]},ssr:!1});function h(){let[e,n]=s.useState(!1);return s.useEffect(()=>{m().then(n)},[]),(0,t.jsxs)("header",{className:"sticky top-0 z-50 flex items-center justify-between w-full h-16 px-4 border-b shrink-0 bg-gradient-to-b from-background/10 via-background/50 to-background/80 backdrop-blur-xl",children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(u,{}),(0,t.jsx)(f(),{href:"/",className:(0,i.cn)((0,a.d)({variant:"link"})),children:"Home"}),e&&(0,t.jsx)(f(),{href:"/playground",className:(0,i.cn)((0,a.d)({variant:"link"})),children:"Playground"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-end space-x-2",children:[(0,t.jsxs)("a",{target:"_blank",href:"https://github.com/TabbyML/tabby",rel:"noopener noreferrer",className:(0,i.cn)((0,a.d)({variant:"outline"})),children:[(0,t.jsx)(o.Mr,{}),(0,t.jsx)("span",{className:"hidden ml-2 md:flex",children:"GitHub"})]}),(0,t.jsxs)("a",{target:"_blank",href:"/swagger-ui",rel:"noopener noreferrer",className:(0,i.cn)((0,a.d)({variant:"outline"})),children:[(0,t.jsx)(o.Tq,{}),(0,t.jsx)("span",{className:"hidden ml-2 md:flex",children:"OpenAPI"})]})]})]})}async function m(){{let e=await fetch("/v1/health"),n=await e.json();return!!n.chat_model}}},78495:function(e,n,r){"use strict";r.r(n),r.d(n,{Providers:function(){return a}});var t=r(57437);r(2265);var s=r(6435),i=r(95482);function a(e){let{children:n,...r}=e;return(0,t.jsx)(s.f,{...r,children:(0,t.jsx)(i.pn,{children:n})})}},95482:function(e,n,r){"use strict";r.d(n,{_v:function(){return c},aJ:function(){return l},pn:function(){return o},u:function(){return d}});var t=r(57437),s=r(2265),i=r(43212),a=r(39311);let o=i.zt,d=i.fC,l=i.xz,c=s.forwardRef((e,n)=>{let{className:r,sideOffset:s=4,...o}=e;return(0,t.jsx)(i.VY,{ref:n,sideOffset:s,className:(0,a.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-xs font-medium text-popover-foreground shadow-md animate-in fade-in-50 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",r),...o})});c.displayName=i.VY.displayName},58877:function(){}},function(e){e.O(0,[358,406,832,894,971,864,744],function(){return e(e.s=21050)}),_N_E=e.O()}]);

View File

@ -1 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{47469:function(e,n,t){Promise.resolve().then(t.t.bind(t,76054,23)),Promise.resolve().then(t.t.bind(t,41729,23)),Promise.resolve().then(t.t.bind(t,81443,23)),Promise.resolve().then(t.t.bind(t,36384,23)),Promise.resolve().then(t.t.bind(t,18639,23)),Promise.resolve().then(t.t.bind(t,65146,23))}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[971,864],function(){return n(23123),n(47469)}),_N_E=e.O()}]);
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{50588:function(e,n,t){Promise.resolve().then(t.t.bind(t,76054,23)),Promise.resolve().then(t.t.bind(t,41729,23)),Promise.resolve().then(t.t.bind(t,81443,23)),Promise.resolve().then(t.t.bind(t,36384,23)),Promise.resolve().then(t.t.bind(t,18639,23)),Promise.resolve().then(t.t.bind(t,65146,23))}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[971,864],function(){return n(23123),n(50588)}),_N_E=e.O()}]);

Some files were not shown because too many files have changed in this diff Show More