Skip to content

Commit

Permalink
Test Azue Static Web App
Browse files Browse the repository at this point in the history
  • Loading branch information
Oceania2018 committed Jan 8, 2024
1 parent b694be1 commit 1ffa53c
Show file tree
Hide file tree
Showing 17 changed files with 700 additions and 54 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ The `BotSharp UI` is a web app used to manage agents and conversations. Through

[![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/)

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

Expand Down
1 change: 1 addition & 0 deletions src/lib/helpers/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
* @property {string} description - The plugin description.
* @property {string} assembly - The plugin assembly.
* @property {string} icon_url
* @property {boolean} with_agent
*/

/**
Expand Down
1 change: 1 addition & 0 deletions src/lib/scss/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ File: Main Css File

// Pages
@import "custom/pages/authentication";
@import "custom/pages/ecommerce";
@import "custom/pages/email";
@import "custom/pages/file-manager";
@import "custom/pages/chat";
Expand Down
121 changes: 121 additions & 0 deletions src/lib/scss/custom/pages/_ecommerce.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
//
// ecommerce.scss
//

// product

.search-box{
.form-control{
border-radius: 30px;
padding-left: 40px;
}
.search-icon{
font-size: 16px;
position: absolute;
left: 13px;
top: 0;
line-height: 38px;
}
}

.product-list{
li{
a{
display: block;
padding: 4px 0px;
color: var(--#{$prefix}body-color);
}
}
}

.product-view-nav{
&.nav-pills {
.nav-item{
margin-left: 4px;
}
.nav-link{
width: 36px;
height: 36px;
font-size: 16px;
padding: 0;
line-height: 36px;
text-align: center;
border-radius: 50%;
}
}
}

.product-ribbon{
position: absolute;
right: 0px;
top: 0px;
}

// Product Details

.product-detai-imgs{
.nav{
.nav-link{
margin: 7px 0px;

&.active{
background-color: var(--#{$prefix}tertiary-bg);
}
}
}
}

.product-color{
a{
display: inline-block;
text-align: center;
color: var(--#{$prefix}body-color);
.product-color-item{
margin: 7px;
}
&.active, &:hover{
color: $primary;
.product-color-item{
border-color: $primary !important;
}
}
}
}

// ecommerce cart

.visa-card{
.visa-logo{
line-height: 0.5;
}

.visa-pattern{
position: absolute;
font-size: 385px;
color: rgba($white, 0.05);
line-height: 0.4;
right: 0px;
bottom: 0px;
}
}


// checkout

.checkout-tabs{
.nav-pills{
.nav-link{
margin-bottom: 24px;
text-align: center;
background-color: var(--#{$prefix}secondary-bg);
box-shadow: $box-shadow;

&.active{
background-color: $primary;
}
.check-nav-icon{
font-size: 36px;
}
}
}
}
3 changes: 2 additions & 1 deletion src/lib/services/api-endpoints.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const host = 'http://localhost:5500';
import { PUBLIC_SERVICE_URL } from '$env/static/public';
export const host = PUBLIC_SERVICE_URL;

export const endpoints = {
// user
Expand Down
2 changes: 1 addition & 1 deletion src/lib/services/web-speech.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function setVoiceSynthesis() {
const voices = synth.getVoices();
for (let i = 0; i < voices.length; i++) {
if (voices[i].name === "Microsoft Michelle Online (Natural) - English (United States)" ||
voices[i].name === "Microsoft Zira - English (United States)") {
voices[i].name === "Google US English") {
utterThis.voice = voices[i];
console.log(voices[i].name);
break;
Expand Down
5 changes: 0 additions & 5 deletions src/routes/(pages)/agent/card-agent.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@
</Link>
</h5>
<p class="text-muted mb-4" style="height: 35px;">{agent.description}</p>
<p>
<a href= "#" class="btn btn-link" target="_blank">
<i class="bx bx-book-open" /> Knowledge Base
</a>
</p>
<div class="avatar-group" style="height:35px;">
{#each agent.functions as fn}
<div class="avatar-group-item">
Expand Down
72 changes: 29 additions & 43 deletions src/routes/(pages)/knowledge-base/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,46 +1,32 @@
<script>
import { Button, Card, CardBody, CardHeader, CardTitle, Col, Input, Label, Row } from '@sveltestrap/sveltestrap';
import Breadcrumb from '$lib/common/Breadcrumb.svelte';
import HeadTitle from '$lib/common/HeadTitle.svelte';
import { uploadDocument } from '$lib/services/knowledge-base-service';
import { Row, Card, CardBody, CardHeader, Container } from '@sveltestrap/sveltestrap';
import Breadcrumb from '$lib/common/Breadcrumb.svelte';
import HeadTitle from '$lib/common/HeadTitle.svelte';
/** @type {FileList} */
let files;
$: if (files) {
// Note that `files` is of type `FileList`, not an Array:
// https://developer.mozilla.org/en-US/docs/Web/API/FileList
console.log(files);
for (const file of files) {
console.log(`${file.name}: ${file.size} bytes`);
}
}
async function handleFileUpload() {
for (const file of files) {
await uploadDocument(file);
}
}
import UploadDocument from "./upload-document.svelte";
import FileLeftBar from './FileLeftBar.svelte';
import FileLists from "./FileLists.svelte";
import RecentFile from "./RecentFile.svelte";
import Storage from "./Storage.svelte";
</script>

<HeadTitle title="Agent Knowledge Base" />
<Breadcrumb title="Agent" pagetitle="Knowledge Base" />

<Card>
<CardHeader>
<p>Upload your own document, BotSharp will convert this data into its knowledges.</p>
</CardHeader>
<CardBody>
<div class="input-group">
<Input
type="file"
bind:files
class="form-control"
aria-describedby="inputGroupFileAddon04"
aria-label="Upload"
/>
<Button color="primary" on:click={() => handleFileUpload()}>Upload</Button>
</div>
</CardBody>
</Card>
<HeadTitle title="Knowledge Manager" />
<Breadcrumb pagetitle="Knowledge Management" title="Knowledge Base"/>
<div class="d-xl-flex">
<div class="w-100">
<div class="d-md-flex">
<FileLeftBar />
<div class="w-100">
<Card>
<CardBody>
<FileLists />
<div class="mb-3">
<UploadDocument />
</div>
<RecentFile />
</CardBody>
</Card>
</div>
</div>
</div>
<Storage />
</div>
115 changes: 115 additions & 0 deletions src/routes/(pages)/knowledge-base/FileLeftBar.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<script>
import Link from "svelte-link";
import {
Card,
CardBody,
Collapse,
DropdownMenu,
DropdownToggle,
Alert,
Dropdown,
Button,
} from "@sveltestrap/sveltestrap";
let isOpen = true;
const handleOnClick = () => {
isOpen = !isOpen;
};
</script>

<Card class="filemanager-sidebar me-md-2">
<CardBody>
<div class="d-flex flex-column h-100">
<div class="mb-4">
<ul class="list-unstyled categories-list">
<li>
<div class="custom-accordion">
<Link
style="cursor:pointer"
class="text-body fw-medium py-1 d-flex align-items-center"
on:click={handleOnClick}
id="toggler"
>
<i class="mdi mdi-folder font-size-16 text-warning me-2" />{" "}
Files{" "}
<i
class={isOpen
? "mdi mdi-chevron-up accor-down-icon ms-auto"
: "mdi mdi-chevron-down accor-down-icon ms-auto"}
/>
</Link>
<Collapse {isOpen} toggler="#toggler">
<div class="card border-0 shadow-none ps-2 mb-0">
<ul class="list-unstyled mb-0">
<li>
<Link href="#" class="d-flex align-items-center">
<span class="me-auto">Design</span>
</Link>
</li>
</ul>
</div>
</Collapse>
</div>
</li>
<li>
<Link href="#" class="text-body d-flex align-items-center">
<i
class="mdi mdi-google-drive font-size-16 text-muted me-2"
/>{" "}
<span class="me-auto">Google Drive</span>
</Link>
</li>
<li>
<Link href="#" class="text-body d-flex align-items-center">
<i class="mdi mdi-dropbox font-size-16 me-2 text-primary" />{" "}
<span class="me-auto">Dropbox</span>
</Link>
</li>
<li>
<Link href="#" class="text-body d-flex align-items-center">
<i
class="mdi mdi-star-outline text-muted font-size-16 me-2"
/>{" "}
<span class="me-auto">Starred</span>
</Link>
</li>
<li>
<Link href="#" class="text-body d-flex align-items-center">
<i class="mdi mdi-trash-can text-danger font-size-16 me-2" />{" "}
<span class="me-auto">Trash</span>
</Link>
</li>
<li>
<Link href="#" class="text-body d-flex align-items-center">
<i class="mdi mdi-cog text-muted font-size-16 me-2" />{" "}
<span class="me-auto">Setting</span>
<span class="badge bg-success rounded-pill ms-2"> 01 </span>
</Link>
</li>
</ul>
</div>

<div class="mt-auto">
<Alert color="success" dismissible class="px-3 mb-0">
<div class="mb-3">
<i class="bx bxs-folder-open h1 text-success" />
</div>

<div>
<h5 class="text-success">Upgrade Features</h5>
<p>Cum sociis natoque penatibus et</p>
<div class="text-center">
<button
type="button"
class="btn btn-link text-decoration-none text-success"
>
Upgrade <i class="mdi mdi-arrow-right" />
</button>
</div>
</div>
</Alert>
</div>
</div>
</CardBody>
</Card>
Loading

0 comments on commit 1ffa53c

Please sign in to comment.