Skip to content

Commit

Permalink
Add demo dashboard.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oceania2018 committed Jan 12, 2024
1 parent 14badf4 commit a0e710a
Show file tree
Hide file tree
Showing 10 changed files with 563 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Public
PUBLIC_SERVICE_URL=https://botsharp.azurewebsites.net
PUBLIC_HOME_IMAGE=/images/megamenu-img.png
PUBLIC_HOME_SLOGAN=A central workspace for building, testing and evaluating your AI Agents.
PUBLIC_LOGO_URL=/images/logo.png
PUBLIC_LOGIN_IMAGE=/images/profile-img.png
PUBLIC_FAVICON_URL=/icons/favicon.ico
Expand Down
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# BotSharp UI

The `BotSharp UI` is a web app used to manage agents and conversations. Through it you can use it to build new Agents and manage existing Agents.
The `BotSharp UI` is a web app used to manage agents and conversations. Through it you can use it to build new Agent, manage existing Agents and conversations.
Thie project is written in [SvelteKit v2](https://svelte.dev/) and backed by [BotSharp](https://github.com/SciSharp/BotSharp) as the [LLM](https://en.wikipedia.org/wiki/Large_language_model) services.

[![Discord](https://img.shields.io/discord/1106946823282761851?label=Discord)](https://discord.com/channels/1106946823282761851/1106947212459642991)
[![QQ群聊](https://img.shields.io/static/v1?label=QQ&message=群聊&color=brightgreen)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=sN9VVMwbWjs5L0ATpizKKxOcZdEPMrp8&authKey=RLDw41bLTrEyEgZZi%2FzT4pYk%2BwmEFgFcrhs8ZbkiVY7a4JFckzJefaYNW6Lk4yPX&noverify=0&group_code=985366726)
[![Deployment](https://github.com/SciSharp/BotSharp-UI/actions/workflows/azure-static-web-apps-victorious-moss-007e11310.yml/badge.svg)](https://github.com/SciSharp/BotSharp-UI/actions/workflows/azure-static-web-apps-victorious-moss-007e11310.yml/)
[![Demo](https://img.shields.io/badge/demo-BotSharp%20UI-blue)](https://victorious-moss-007e11310.4.azurestaticapps.net/)
[![Latest Build Demo](https://img.shields.io/badge/Latest%20build%20demo-BotSharp%20UI-blue)](https://victorious-moss-007e11310.4.azurestaticapps.net/)

[<img src="https://i.ytimg.com/vi/nougEw-vyk0/maxresdefault.jpg" width="50%">](https://www.youtube.com/watch?v=nougEw-vyk0 "BotSharp UI")

Expand All @@ -30,6 +31,8 @@ npm run dev
npm run dev -- --open
```

You can override the `.env` values by creating a local env file named `.env.local` if needed.

## Building

To create a production version of your app:
Expand All @@ -41,3 +44,17 @@ npm run build
You can preview the production build with `npm run preview`.

> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
## Deployment

To manual deploy as [Azure Static Web Apps](https://learn.microsoft.com/en-us/azure/static-web-apps/) at scale.

```bash
npm install -g @azure/static-web-apps-cli
swa deploy ./build/ --env production --deployment-token {token}
```

## Customization

Create a new `.env.production` file in the root folder.
Set new values from the `.env` file.
2 changes: 1 addition & 1 deletion src/lib/common/ProfileDropdown.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
if (browser){
localStorage.removeItem('authUser');
}
goto('/login');
goto('/');
};
</script>

Expand Down
11 changes: 8 additions & 3 deletions src/routes/(home)/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
import Link from "svelte-link";
import { Container, Row, Col } from '@sveltestrap/sveltestrap';
import HeadTitle from "$lib/common/HeadTitle.svelte";
import { PUBLIC_LOGO_URL, PUBLIC_BRAND_NAME } from '$env/static/public';
import {
PUBLIC_LOGO_URL,
PUBLIC_BRAND_NAME,
PUBLIC_HOME_SLOGAN,
PUBLIC_HOME_IMAGE
} from '$env/static/public';
</script>

<HeadTitle title="{PUBLIC_BRAND_NAME} Workspace" />
Expand All @@ -26,13 +31,13 @@
<Row class="justify-content-center mt-5">
<Col sm="8">
<div class="maintenance-img">
<img src="/images/megamenu-img.png" alt="" style="width: 25vw;" />
<img src={PUBLIC_HOME_IMAGE} alt="" style="width: 25vw;" />
</div>
</Col>
</Row>
<h4 class="mt-5">Let&#39;s <a href="/login">get started</a> with {PUBLIC_BRAND_NAME}</h4>
<p class="text-muted">
A central workspace for building, testing and evaluating your AI Agents.
{PUBLIC_HOME_SLOGAN}
</p>
</div>
</Col>
Expand Down
207 changes: 207 additions & 0 deletions src/routes/page/dashboard/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
<script>
import HeadTitle from '$lib/common/HeadTitle.svelte';
import Breadcrumb from '$lib/common/Breadcrumb.svelte';
import {
Card,
Col,
Row,
Image,
CardBody,
CardTitle,
Nav,
NavItem,
Input,
Button
} from '@sveltestrap/sveltestrap';
import Link from 'svelte-link/src/Link.svelte';
import RadialBarChart from './RadialBarChart.svelte';
import StackedColumnChart from './StackedColumnChart.svelte';
import SocialSource from './SocialSource.svelte';
import Activity from './Activity.svelte';
import TopSellingProduct from './TopSellingProduct.svelte';
import {
PUBLIC_LOGIN_IMAGE,
PUBLIC_BRAND_NAME
} from '$env/static/public';
import { onMount } from 'svelte';
let subscribemodal = false;
const togglesubscribemodal = (() => {
subscribemodal = !subscribemodal;
})
onMount(() => {
setTimeout(() => {
subscribemodal = true;
}, 1000);
})
</script>

<HeadTitle title="Dashboard" />

<Breadcrumb title="Home" pagetitle="Dashboard" />

<Row>
<Col xl={4}>
<Card class="overflow-hidden">
<div class="bg-primary-subtle">
<Row class="row">
<Col xs={7}>
<div class="text-primary p-3">
<h5 class="text-primary">Welcome Back !</h5>
<p>{PUBLIC_BRAND_NAME}</p>
</div>
</Col>
<Col xs={5} class="align-self-end">
<Image src={PUBLIC_LOGIN_IMAGE} alt="" class="img-fluid" />
</Col>
</Row>
</div>
<CardBody class="pt-0">
<Row>
<Col sm={4}>
<div class="avatar-md profile-user-wid mb-4">
<Image src='/images/users/user-dummy.jpg' alt="" class="img-thumbnail rounded-circle" />
</div>
<h5 class="font-size-15 text-truncate">Henry Price</h5>
<p class="text-muted mb-0 text-truncate">Agent Manager</p>
</Col>
<Col sm={8}>
<div class="pt-4">
<Row>
<Col xs={6}>
<h5 class="font-size-15">125</h5>
<p class="text-muted mb-0">Conversations</p>
</Col>
<Col xs={6}>
<h5 class="font-size-15">$1245</h5>
<p class="text-muted mb-0">Token Cost</p>
</Col>
</Row>
<div class="mt-4">
<Link class="btn btn-primary waves-effect waves-light btn-sm">
View Profile <i class="mdi mdi-arrow-right ms-1" />
</Link>
</div>
</div>
</Col>
</Row>
</CardBody>
</Card>
<Card>
<CardBody>
<CardTitle class="mb-4">Monthly Cost</CardTitle>
<Row>
<Col sm={6}>
<p class="text-muted">This month</p>
<h3>$34,252</h3>
<p class="text-muted">
<span class="text-success me-2"> 12% <i class="mdi mdi-arrow-up" /> </span> From previous
period
</p>
<div class="mt-4">
<Link class="btn btn-primary waves-effect waves-light btn-sm"
>View More <i class="mdi mdi-arrow-right ms-1" /></Link
>
</div>
</Col>
<Col sm={6}>
<div class="mt-4 mt-sm-0">
<RadialBarChart chartColor={['--bs-primary']} />
</div>
</Col>
</Row>
<p class="text-muted mb-0">We craft digital, graphic and dimensional thinking.</p>
</CardBody>
</Card>
</Col>
<Col xl={8}>
<Row>
<Col md={4}>
<Card class="mini-stats-wid">
<CardBody>
<div class="d-flex">
<div class="flex-grow-1">
<p class="text-muted fw-medium">Conversations</p>
<h4 class="mb-0">1,235</h4>
</div>
<div class="flex-shrink-0 align-self-center">
<div class="mini-stat-icon avatar-sm rounded-circle bg-primary">
<span class="avatar-title">
<i class="bx bx-copy-alt font-size-24" />
</span>
</div>
</div>
</div>
</CardBody>
</Card>
</Col>
<Col md={4}
><Card class="mini-stats-wid">
<CardBody>
<div class="d-flex">
<div class="flex-grow-1">
<p class="text-muted fw-medium">Total Cost</p>
<h4 class="mb-0">$35, 723</h4>
</div>
<div class="flex-shrink-0 align-self-center">
<div class="mini-stat-icon avatar-sm rounded-circle bg-primary">
<span class="avatar-title">
<i class="bx bx-archive-in font-size-24" />
</span>
</div>
</div>
</div>
</CardBody>
</Card></Col
>
<Col md={4}>
<Card class="mini-stats-wid">
<CardBody>
<div class="d-flex">
<div class="flex-grow-1">
<p class="text-muted fw-medium">Average Cost</p>
<h4 class="mb-0">$16.2</h4>
</div>
<div class="flex-shrink-0 align-self-center">
<div class="mini-stat-icon avatar-sm rounded-circle bg-primary">
<span class="avatar-title">
<i class="bx bx-purchase-tag-alt font-size-24" />
</span>
</div>
</div>
</div>
</CardBody>
</Card>
</Col>
</Row>
<Card>
<CardBody>
<div class="d-sm-flex flex-wrap">
<CardTitle class="mb-4">Token Spent</CardTitle>
<div class="ms-auto">
<Nav pills>
<NavItem>
<Link href="#" class="nav-link">Week</Link>
</NavItem>
<NavItem>
<Link href="#" class="nav-link">Month</Link>
</NavItem>
<NavItem>
<Link href="#" class="nav-link" active>Year</Link>
</NavItem>
</Nav>
</div>
</div>
<StackedColumnChart chartColor={['--bs-primary', '--bs-warning', '--bs-success']} />
</CardBody>
</Card>
</Col>
</Row>

<Row>
<SocialSource />
<Activity />
<TopSellingProduct />
</Row>
81 changes: 81 additions & 0 deletions src/routes/page/dashboard/Activity.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<script>
import Link from 'svelte-link';
import { Card, CardBody, CardTitle, Col } from '@sveltestrap/sveltestrap';
</script>

<Col xl={4}>
<Card>
<CardBody>
<CardTitle class="mb-5">
Activity
</CardTitle>

<ul class="verti-timeline list-unstyled">
<li class="event-list">
<div class="event-timeline-dot">
<i class="bx bx-right-arrow-circle font-size-18"></i>
</div>
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<h5 class="font-size-14">22 Nov <i class="bx bx-right-arrow-alt font-size-16 text-primary align-middle ms-2"></i></h5>
</div>
<div class="flex-grow-1">
<div>
Responded to need “Volunteer Activities
</div>
</div>
</div>
</li>
<li class="event-list">
<div class="event-timeline-dot">
<i class="bx bx-right-arrow-circle font-size-18"></i>
</div>
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<h5 class="font-size-14">17 Nov <i class="bx bx-right-arrow-alt font-size-16 text-primary align-middle ms-2"></i></h5>
</div>
<div class="flex-grow-1">
<div>
Everyone realizes why a new common language would be desirable... <Link>Read more</Link>
</div>
</div>
</div>
</li>
<li class="event-list active">
<div class="event-timeline-dot">
<i class="bx bxs-right-arrow-circle font-size-18 bx-fade-right"></i>
</div>
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<h5 class="font-size-14">15 Nov <i class="bx bx-right-arrow-alt font-size-16 text-primary align-middle ms-2"></i></h5>
</div>
<div class="flex-grow-1">
<div>
Joined the group “Boardsmanship Forum”
</div>
</div>
</div>
</li>
<li class="event-list">
<div class="event-timeline-dot">
<i class="bx bx-right-arrow-circle font-size-18"></i>
</div>
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<h5 class="font-size-14">12 Nov <i class="bx bx-right-arrow-alt font-size-16 text-primary align-middle ms-2"></i></h5>
</div>
<div class="flex-grow-1">
<div>
Responded to need “In-Kind Opportunity”
</div>
</div>
</div>
</li>
</ul>
<div class="text-center mt-4">
<Link class="btn btn-primary waves-effect waves-light btn-sm">View More <i class="mdi mdi-arrow-right ms-1"></i></Link>
</div>

</CardBody>
</Card>
</Col>
Loading

0 comments on commit a0e710a

Please sign in to comment.