Uniform webui

This commit is contained in:
Ettore Di Giacinto
2024-04-11 23:45:57 +02:00
parent 26baaecbcd
commit adf649be99
7 changed files with 92 additions and 61 deletions

View File

@@ -6,58 +6,62 @@
<title>Agent List</title> <title>Agent List</title>
{{template "views/partials/header"}} {{template "views/partials/header"}}
</head> </head>
<body class="bg-gray-900 p-4 text-white"> <body class="bg-gray-900 p-4 text-white font-sans">
<div class="max-w-6xl mx-auto"> {{template "views/partials/menu"}}
<div class="text-center mb-6"> <div class="max-w-6xl mx-auto">
<h1 class="text-3xl md:text-4xl font-bold">Smart Agent List</h1> <header class="text-center mb-8">
</div> <h1 class="text-3xl md:text-5xl font-bold">Smart Agent List</h1>
<div class="flex flex-col"> </header>
<div class="overflow-x-auto"> <section class="flex flex-col">
<div class="py-2 align-middle inline-block min-w-full"> <div class="overflow-x-auto">
<div class="shadow overflow-hidden border-b border-gray-700 rounded-lg"> <div class="py-2 align-middle inline-block min-w-full">
<table class="min-w-full divide-y divide-gray-700"> <div class="shadow overflow-hidden border-b border-gray-700 rounded-lg">
<thead class="bg-gray-700"> <table class="min-w-full divide-y divide-gray-700">
<tr> <thead class="bg-gray-700">
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider"> <tr>
Name <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider">
</th> Name
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider"> </th>
Status <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider">
</th> Status
<th scope="col" class="relative px-6 py-3"> </th>
<span class="sr-only">Talk</span> <th scope="col" class="px-6 py-3 text-center">
</th> <span class="sr-only">Talk</span>
<th scope="col" class="relative px-6 py-3"> </th>
<span class="sr-only">Delete</span> <th scope="col" class="px-6 py-3 text-center">
</th> <span class="sr-only">Delete</span>
</tr> </th>
</thead> </tr>
<tbody class="bg-gray-800 divide-y divide-gray-700"> </thead>
<!-- Dynamic agent rows go here --> <tbody class="bg-gray-800 divide-y divide-gray-700">
{{ range .Agents }} <!-- Dynamic agent rows go here -->
<tr> {{ range .Agents }}
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-300">{{.}}</td> <tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-300">Online</td> <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-300">{{.}}</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium"> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-300">{{.}}</td>
<a href="/talk/{{.}}" class="text-indigo-500 hover:text-indigo-400">Talk</a> <td class="px-6 py-4 whitespace-nowrap text-center text-sm font-medium">
</td> <a href="/talk/{{.}}" class="text-indigo-500 hover:text-indigo-400">
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium"> <i class="fas fa-comments"></i> Talk
<a href="/delete/{{.}}" class="text-red-500 hover:text-red-400">Delete</a> </a>
</td> </td>
</tr> <td class="px-6 py-4 whitespace-nowrap text-center text-sm font-medium">
{{ end }} <a href="/delete/{{.}}" class="text-red-500 hover:text-red-400">
<!-- Repeat for each agent --> <i class="fas fa-trash-alt"></i> Delete
</tbody> </a>
</table> </td>
</tr>
{{ end }}
<!-- Repeat for each agent -->
</tbody>
</table>
</div>
</div> </div>
</div> </section>
<footer class="mt-8 text-center">
<a href="/create" class="bg-indigo-500 hover:bg-indigo-700 text-white font-bold py-2 px-4 rounded transition duration-300 ease-in-out">
Add New Agent
</a>
</footer>
</div> </div>
</div> </body>
<div class="mt-6 text-center">
<a href="/create" class="bg-indigo-500 hover:bg-indigo-700 text-white font-bold py-2 px-4 rounded transition duration-300 ease-in-out">
Add New Agent
</a>
</div>
</div>
</body>
</html> </html>

View File

@@ -40,8 +40,10 @@
} }
</style> </style>
</head> </head>
<body class="bg-gray-900 p-4 text-white" hx-ext="sse" sse-connect="/sse/{{.Name}}"> <body class="bg-gray-900 p-4 text-white font-sans" hx-ext="sse" sse-connect="/sse/{{.Name}}">
{{template "views/partials/menu"}}
<div class="chat-container bg-gray-800 shadow-lg rounded-lg" > <div class="chat-container bg-gray-800 shadow-lg rounded-lg" >
<!-- Chat Header --> <!-- Chat Header -->
<div class="border-b border-gray-700 p-4"> <div class="border-b border-gray-700 p-4">
<h1 class="text-lg font-semibold">Talk to '{{.Name}}'</h1> <h1 class="text-lg font-semibold">Talk to '{{.Name}}'</h1>

View File

@@ -7,7 +7,8 @@
<script src="https://unpkg.com/htmx.org/dist/ext/sse.js"></script> <script src="https://unpkg.com/htmx.org/dist/ext/sse.js"></script>
<script src="https://unpkg.com/hyperscript.org@0.9.12"></script> <script src="https://unpkg.com/hyperscript.org@0.9.12"></script>
</head> </head>
<body class="bg-gray-900 p-4 text-white"> <body class="bg-gray-900 p-4 text-white font-sans">
{{template "views/partials/menu"}}
<div class="max-w-2xl mx-auto my-12 bg-gray-800 p-8 rounded-lg shadow-lg"> <div class="max-w-2xl mx-auto my-12 bg-gray-800 p-8 rounded-lg shadow-lg">
<h1 class="text-3xl font-bold text-center mb-10 text-blue-400">Create New Agent</h1> <h1 class="text-3xl font-bold text-center mb-10 text-blue-400">Create New Agent</h1>

View File

@@ -4,11 +4,12 @@
<title>Smart Assistant Dashboard</title> <title>Smart Assistant Dashboard</title>
{{template "views/partials/header"}} {{template "views/partials/header"}}
</head> </head>
<body class="bg-gray-900 p-4 text-white"> <body class="bg-gray-900 p-4 text-white font-sans">
{{template "views/partials/menu"}}
<div class="max-w-4xl mx-auto"> <div class="max-w-4xl mx-auto">
<div class="text-center mb-6"> <header class="text-center mb-8">
<h1 class="text-3xl font-bold">Smart Assistant Dashboard</h1> <h1 class="text-3xl md:text-5xl font-bold">Smart Agent Dashboard</h1>
</div> </header>
<div class="flex flex-col items-center space-y-4"> <div class="flex flex-col items-center space-y-4">
<!-- Button to Agent List Page --> <!-- Button to Agent List Page -->
<a href="/agents" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"> <a href="/agents" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">

View File

@@ -7,10 +7,12 @@
<script src="https://unpkg.com/htmx.org/dist/ext/sse.js"></script> <script src="https://unpkg.com/htmx.org/dist/ext/sse.js"></script>
<script src="https://unpkg.com/hyperscript.org@0.9.12"></script> <script src="https://unpkg.com/hyperscript.org@0.9.12"></script>
</head> </head>
<body class="bg-gray-900 p-4 text-white"> <body class="bg-gray-900 p-4 text-white font-sans">
{{template "views/partials/menu"}}
<header class="text-center mb-8">
<h1 class="text-3xl md:text-5xl font-bold">Knowledgebase (items: {{.KnowledgebaseItemsCount}})</h1>
</header>
<div class="max-w-2xl mx-auto my-12 bg-gray-800 p-8 rounded-lg shadow-lg"> <div class="max-w-2xl mx-auto my-12 bg-gray-800 p-8 rounded-lg shadow-lg">
<h1 class="text-3xl font-bold text-center mb-10 text-blue-400">Knowledgebase (items: {{.KnowledgebaseItemsCount}})</h1>
<form action="/knowledgebase" method="POST" class="space-y-6"> <form action="/knowledgebase" method="POST" class="space-y-6">
Add sites to KB Add sites to KB
<div class="mb-6"> <div class="mb-6">

View File

@@ -2,6 +2,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<style> <style>
body { body {
font-family: 'Roboto', sans-serif; font-family: 'Roboto', sans-serif;

View File

@@ -0,0 +1,20 @@
<nav class="bg-gray-800 w-full">
<div class="px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex">
<div class="flex-shrink-0 flex items-center">
<a href="/" class="px-3 py-2 rounded-md text-sm font-medium text-white bg-gray-900 focus:outline-none focus:text-white focus:bg-gray-700">
<i class="fas fa-home"></i> Home
</a>
<a href="/agents" class="px-3 py-2 rounded-md text-sm font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700">
<i class="fas fa-users"></i> Agent list
</a>
<a href="/knowledgebase" class="px-3 py-2 rounded-md text-sm font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700">
<i class="fas fa-book"></i> Knowledgebase
</a>
</div>
</div>
</div>
</div>
</nav>
<br>