Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow more customization. #3

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# Public
PUBLIC_SERVICE_URL=https://botsharp.azurewebsites.net
PUBLIC_SERVICE_URL=https://botsharp.azurewebsites.net
PUBLIC_LOGO_URL=/images/logo.png
PUBLIC_LOGIN_IMAGE=/images/profile-img.png
PUBLIC_FAVICON_URL=/icons/favicon.ico
PUBLIC_BRAND_NAME=BotSharp
[email protected]
PUBLIC_ADMIN_PASSWORD=123456
PUBLIC_COMPANY_NAME=SciSharp STACK
2 changes: 1 addition & 1 deletion src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.ico" />
<!--<link rel="icon" href="%sveltekit.assets%/icons/favicon.ico" />-->
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
</head>
Expand Down
4 changes: 3 additions & 1 deletion src/lib/common/HeadTitle.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<script>
import {PUBLIC_FAVICON_URL, PUBLIC_BRAND_NAME} from '$env/static/public'
export let title = 'Home';
</script>

<svelte:head>
<title>{title} | BotSharp - Admin & Dashboard</title>
<link rel="icon" type="image/x-icon" href={PUBLIC_FAVICON_URL}>
<title>{title} | {PUBLIC_BRAND_NAME} - Admin & Dashboard</title>
</svelte:head>
4 changes: 2 additions & 2 deletions src/lib/drawflow/drawflow.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.drawflow .drawflow-node {
background: rgb(128, 0, 128);
background: var(--bs-primary);
color: white;
}

.drawflow .drawflow-node.selected {
background: rgb(0, 200, 50);
background: var(--bs-success);
}
3 changes: 3 additions & 0 deletions src/lib/helpers/datetime.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ export function format(datetime, type = 'date') {
if (type == 'date') {
const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
return date.toLocaleString(undefined, options);
} else if (type == 'short-date') {
const options = { year: 'numeric', month: 'short', day: 'numeric' };
return date.toLocaleString(undefined, options);
} else if (type == 'time') {
const options = { month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' };
return date.toLocaleString(undefined, options);
Expand Down
8 changes: 5 additions & 3 deletions src/lib/helpers/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
* @typedef {Object} AgentFilter
* @property {boolean} [isRouter]
* @property {boolean} [isEvaluator]
* @property {boolean} [allowRouting]
*/

/**
Expand All @@ -73,6 +74,7 @@
* @property {string} instruction - System prompt
* @property {boolean} disabled
* @property {boolean} is_public
* @property {boolean} is_router
* @property {string} icon_url - Icon
* @property {boolean} allow_routing
* @property {Date} created_datetime
Expand Down Expand Up @@ -100,9 +102,9 @@
/**
* @typedef {Object} ConversationFilter
* @property {Pagination} pager - Pagination
* @property {string?} agentId - The agent id.
* @property {string?} channel - The conversation channel.
* @property {string?} status - The conversation status.
* @property {string?} [agentId] - The agent id.
* @property {string?} [channel] - The conversation channel.
* @property {string?} [status] - The conversation status.
*/

/**
Expand Down
22 changes: 15 additions & 7 deletions src/routes/(authentication)/login/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@
import Headtitle from '$lib/common/HeadTitle.svelte';
import { getToken } from '$lib/services/auth-service.js'
import { goto } from '$app/navigation';
import {
PUBLIC_LOGO_URL,
PUBLIC_LOGIN_IMAGE,
PUBLIC_BRAND_NAME,
PUBLIC_ADMIN_USERNAME,
PUBLIC_ADMIN_PASSWORD,
PUBLIC_COMPANY_NAME
} from '$env/static/public';

let username = '[email protected]';
let password = '123456';
let username = PUBLIC_ADMIN_USERNAME;
let password = PUBLIC_ADMIN_PASSWORD;
let isOpen = false;
let msg = '';
let status = '';
Expand All @@ -44,11 +52,11 @@
<Col class="col-7">
<div class="text-primary p-4">
<h5 class="text-primary">Welcome Back !</h5>
<p>Sign in to continue to BotSharp.</p>
<p>Sign in to continue to {PUBLIC_BRAND_NAME}.</p>
</div>
</Col>
<Col class="col-5 align-self-end">
<img src='/images/profile-img.png' alt="" class="img-fluid" />
<img src={PUBLIC_LOGIN_IMAGE} alt="" class="img-fluid" />
</Col>
</Row>
</div>
Expand All @@ -57,14 +65,14 @@
<Link href="/dashboard" class="auth-logo-light">
<div class="avatar-md profile-user-wid mb-4">
<span class="avatar-title rounded-circle bg-light">
<img src='/images/logo.png' alt="" class="rounded-circle" height="55" />
<img src={PUBLIC_LOGO_URL} alt="" class="rounded-circle" height="55" />
</span>
</div>
</Link>
<Link href="/dashboard" class="auth-logo-dark">
<div class="avatar-md profile-user-wid mb-4">
<span class="avatar-title rounded-circle bg-light">
<img src='/images/logo.png' alt="" class="rounded-circle" height="55" />
<img src={PUBLIC_LOGO_URL} alt="" class="rounded-circle" height="55" />
</span>
</div>
</Link>
Expand Down Expand Up @@ -149,7 +157,7 @@
<Link href="/register" class="fw-medium text-primary">Signup now</Link>
</p>
<p>
© {new Date().getFullYear()} SciSharp STACK. Crafted with
© {new Date().getFullYear()} {PUBLIC_COMPANY_NAME}. Crafted with
<i class="mdi mdi-heart text-danger" /> by open source community
</p>
</div>
Expand Down
7 changes: 4 additions & 3 deletions src/routes/(authentication)/recoverpw/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import Link from 'svelte-link';
import { Row, Col, CardBody, Card, Container, Form, Label, Input, Button, Alert } from '@sveltestrap/sveltestrap';
import Headtitle from '$lib/common/HeadTitle.svelte';
import { PUBLIC_LOGO_URL, PUBLIC_COMPANY_NAME } from '$env/static/public';
</script>

<Headtitle title="Recover Password" />
Expand Down Expand Up @@ -29,7 +30,7 @@
<Link href="/dashboard">
<div class="avatar-md profile-user-wid mb-4">
<span class="avatar-title rounded-circle bg-light">
<img src='/images/logo.png' alt="" class="rounded-circle" height="34" />
<img src={PUBLIC_LOGO_URL} alt="" class="rounded-circle" height="34" />
</span>
</div>
</Link>
Expand Down Expand Up @@ -66,8 +67,8 @@
<Link href="/login" class="fw-medium text-primary">Sign In here</Link>
</p>
<p>
© {new Date().getFullYear()} SciSharp STACK. Crafted with
<i class="mdi mdi-heart text-danger" /> by SciSharp STACK
© {new Date().getFullYear()} {PUBLIC_COMPANY_NAME}. Crafted with
<i class="mdi mdi-heart text-danger" /> by Open Source community
</p>
</div>
</Col>
Expand Down
11 changes: 6 additions & 5 deletions src/routes/(authentication)/register/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { Row, Col, CardBody, Card, Container, Form, Label, Input, Button, Alert } from '@sveltestrap/sveltestrap';
import Headtitle from '$lib/common/HeadTitle.svelte';
import { goto } from '$app/navigation';
import { PUBLIC_LOGO_URL, PUBLIC_COMPANY_NAME } from '$env/static/public';

let username = '';
let emailid = '';
Expand Down Expand Up @@ -65,7 +66,7 @@
<Col class="col-7">
<div class="text-primary p-4">
<h5 class="text-primary">Free Register</h5>
<p>Get your free SciSharp account now.</p>
<p>Get your free account now.</p>
</div>
</Col>
<Col class="col-5 align-self-end">
Expand All @@ -78,7 +79,7 @@
<Link href="/dashboard">
<div class="avatar-md profile-user-wid mb-4">
<span class="avatar-title rounded-circle bg-light">
<img src='/images/logo.png' alt="" class="rounded-circle" height="34" />
<img src={PUBLIC_LOGO_URL} alt="" class="rounded-circle" height="34" />
</span>
</div>
</Link>
Expand Down Expand Up @@ -155,7 +156,7 @@

<div class="mt-4 text-center">
<p class="mb-0">
By registering you agree to the SciSharp <Link href="#" class="text-primary"
By registering you agree to the <Link href="#" class="text-primary"
>Terms of Use</Link
>
</p>
Expand All @@ -170,8 +171,8 @@
<Link href="/login" class="fw-medium text-primary">Login</Link>
</p>
<p>
© {new Date().getFullYear()} SciSharp STACK. Crafted with
<i class="mdi mdi-heart text-danger" /> by SciSharp STACK
© {new Date().getFullYear()} {PUBLIC_COMPANY_NAME}. Crafted with
<i class="mdi mdi-heart text-danger" /> by Open Source community
</p>
</div>
</Col>
Expand Down
7 changes: 4 additions & 3 deletions src/routes/(home)/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
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';
</script>

<HeadTitle title="BotSharp Workspace" />
<HeadTitle title="{PUBLIC_BRAND_NAME} Workspace" />

<div class="home-btn d-none d-sm-block">
<Link href="/" class="text-dark">
<img
src="/images/logo.png"
src={PUBLIC_LOGO_URL}
alt="logo"
height="50"
class="auth-logo-dark mx-auto"
Expand All @@ -29,7 +30,7 @@
</div>
</Col>
</Row>
<h4 class="mt-5">Let&#39;s <a href="/login">get started</a> with BotSharp</h4>
<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.
</p>
Expand Down
26 changes: 18 additions & 8 deletions src/routes/(pages)/agent/card-agent.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@
</h5>
<p class="text-muted mb-4" style="height: 35px;">{agent.description}</p>
<div class="avatar-group" style="height:35px;">
{#if agent.is_router}
<div class="avatar-group-item me-3">
<img src="/icons/router.png" class="rounded-circle avatar-xs" alt="routing"/>
</div>
{/if}
{#if agent.allow_routing}
<div class="avatar-group-item me-3">
<img src="/icons/routing-2.png" class="rounded-circle avatar-xs" alt="routing"/>
</div>
{/if}
{#each agent.functions as fn}
<div class="avatar-group-item">
<Link href="#" class="d-inline-block" id={"member" + fn.name}>
Expand All @@ -43,17 +53,17 @@
</CardBody>
<div class="px-4 py-3 border-top">
<ul class="list-inline mb-0">
<li class="list-inline-item me-3">
<Badge color={agent.disabled ? "warning" : "success"} class={"bg-" + agent.disabled ? "warning" : "success"}
>{agent.disabled ? "Disabled" : "Enabled"}</Badge>
<li class="list-inline-item me-1">
<Badge color={agent.disabled ? "warning" : "success"}>{agent.disabled ? "Disabled" : "Enabled"}</Badge>
</li>
<li class="list-inline-item me-1">
<Badge color={agent.is_public ? "success" : "warning"}>{agent.is_public ? "Public" : "Private"}</Badge>
</li>
{" "}
<li class="list-inline-item me-3" id="dueDate">
<li class="list-inline-item me-1" id="dueDate">
<i class="bx bx-calendar me-1" />
{format(agent.updated_datetime)}
{format(agent.updated_datetime, 'short-date')}
</li>
{" "}
<li class="list-inline-item me-3" id="comments">
<li class="list-inline-item me-1" id="comments">
<a href= "/chat/{agent.id}" class="btn btn-primary btn-sm" target="_blank">
<i class="bx bx-chat" /> Live Chat
</a>
Expand Down
3 changes: 2 additions & 1 deletion src/routes/(pages)/agent/router/routing-flow.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
onMount(async () => {
agents = await getAgents({
isRouter: false,
isEvaluator: false
isEvaluator: false,
allowRouting: true
});

const container = document.getElementById("drawflow");
Expand Down
5 changes: 1 addition & 4 deletions src/routes/(pages)/conversation/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@

/** @type {import('$types').ConversationFilter} */
let filter = {
pager: { page: 0, size: 20, count: 0 },
agentId: '01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a',
channel: null,
status: null
pager: { page: 0, size: 20, count: 0 }
};

/** @type {import('$types').Pagination} */
Expand Down
3 changes: 2 additions & 1 deletion src/routes/VerticalLayout/Footer.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<script>
import { Col, Container, Row } from '@sveltestrap/sveltestrap';
import { PUBLIC_COMPANY_NAME } from '$env/static/public'

</script>

<footer class="footer">
<Container fluid>
<Row>
<Col sm={6}>
{new Date().getFullYear()} © SciSharp STACK.
{new Date().getFullYear()} © {PUBLIC_COMPANY_NAME}.
</Col>
<Col sm={6}>
<div class="text-sm-end d-none d-sm-block">
Expand Down
9 changes: 5 additions & 4 deletions src/routes/VerticalLayout/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import NotificationDropdown from '$lib/common/NotificationDropdown.svelte';
import ProfileDropdown from '$lib/common/ProfileDropdown.svelte';
import { OverlayScrollbars } from 'overlayscrollbars';
import { PUBLIC_LOGO_URL } from '$env/static/public';

const toggleSideBar = () => {
if (browser) {
Expand Down Expand Up @@ -44,19 +45,19 @@
<div class="navbar-brand-box">
<a href="/dashboard" class="logo logo-dark">
<span class="logo-sm">
<img src='/images/logo.png' alt="" height="25" />
<img src={PUBLIC_LOGO_URL} alt="" height="25" />
</span>
<span class="logo-lg">
<img src='/images/logo.png' alt="" height="50" />
<img src={PUBLIC_LOGO_URL} alt="" height="40" />
</span>
</a>

<a href="/dashboard" class="logo logo-light">
<span class="logo-sm">
<img src='/images/logo.png' alt="" height="25" />
<img src={PUBLIC_LOGO_URL} alt="" height="25" />
</span>
<span class="logo-lg">
<img src='/images/logo.png' alt="" height="50" />
<img src={PUBLIC_LOGO_URL} alt="" height="40" />
</span>
</a>
</div>
Expand Down
File renamed without changes.
Binary file added static/icons/router.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/icons/routing-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/icons/routing-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.