Spaces:
Runtime error
Runtime error
Delete templates
Browse filesFiles changed (24)
- templates/API_connectors.htmlDeleted-228
- templates/chatbot.htmlDeleted-81
- templates/company_profile.htmlDeleted-190
- templates/dashboard.htmlDeleted-156
- templates/data_connectors.htmlDeleted-368
- templates/footer.htmlDeleted-26
- templates/index.htmlDeleted-103
- templates/knowledgebase.htmlDeleted-360
- templates/prompt_template.htmlDeleted-224
- templates/redmindlogo2.jpgDeleted
- templates/redmindlogo3.jpgDeleted
- templates/sidepane.htmlDeleted-95
- templates/templates/API_connectors.htmlDeleted-228
- templates/templates/chatbot.htmlDeleted-81
- templates/templates/company_profile.htmlDeleted-185
- templates/templates/dashboard.htmlDeleted-156
- templates/templates/data_connectors.htmlDeleted-368
- templates/templates/footer.htmlDeleted-26
- templates/templates/index.htmlDeleted-103
- templates/templates/knowledgebase.htmlDeleted-360
- templates/templates/prompt_template.htmlDeleted-224
- templates/templates/redmindlogo2.jpgDeleted
- templates/templates/redmindlogo3.jpgDeleted
- templates/templates/sidepane.htmlDeleted-95
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228<!DOCTYPE html>
<html>
<head>
<title>API Connectors</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<!-- Include AdminLTE CSS -->
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/admin-lte@3.1/dist/css/adminlte.min.css">
<!-- Include DataTables CSS -->
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
<style>
.header-row {
display: flex;
justify-content: space-between;
align-items: center;
}
h2 {
text-align: center;
}
.table-container {
width: 100%;
overflow-x: auto;
}
.wrapper {
display: flex;
flex-direction: column;
height: 100vh;
}
.content-wrapper {
flex: 1;
overflow-y: auto;
}
.content-header {
padding: 1rem;
}
.footer {
text-align: right;
padding: 10px;
}
th,
td {
white-space: nowrap;
}
th:nth-child(1),
td:nth-child(1) {
/* Sno column */
width: 5%;
}
th:nth-child(2),
td:nth-child(2) {
/* API Name column */
width: 20%;
}
th:nth-child(3),
td:nth-child(3) {
/* API Endpoint column */
width: 40%;
}
th:nth-child(4),
td:nth-child(4) {
/* Auth/Bearer token column */
width: 20%;
}
th:nth-child(5),
td:nth-child(5) {
/* View column */
width: 15%;
}
</style>
</head>
<body>
{% include 'sidepane.html' %}
<div class="wrapper">
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-12">
<div class="header-row">
<h2 class="m-0 text-center" style="flex-grow: 1;">API Connectors</h2>
<button class="btn btn-primary" id="add">Add</button>
</div>
</div>
</div>
</div>
</div>
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body table-container">
<table id="knowledgeTable" class="table table-bordered table-striped">
<thead>
<tr>
<th>Sno</th>
<th>API Name</th>
<th>API Endpoint</th>
<th>View</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Warehouse</td>
<td>http://193.203.162.39:9090/nxt-wms/userWarehouse/fetchWarehouseForUserId
</td>
<td><button class="btn btn-primary viewButton">View</button></td>
</tr>
<tr>
<td>2</td>
<td>customer</td>
<td>http://193.203.162.39:9090/nxt-wms/userCustomer/fetchCustomerForUserId
</td>
<td><button class="btn btn-primary viewButton">View</button></td>
</tr>
<tr>
<td>3</td>
<td>SKU</td>
<td>http://193.203.162.39:9090/nxt-wms/sku/autoComplete?</td>
<td><button class="btn btn-primary viewButton">View</button></td>
</tr>
<tr>
<td>4</td>
<td>ASN</td>
<td>http://193.203.162.39:9090/nxt-wms/trnHeader</td>
<td><button class="btn btn-primary viewButton">View</button></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addModalLabel">Add Document</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label for="APIName">API Name <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="APIName" name="APIName" required>
</div>
<div class="form-group">
<label for="APIEndpoint">API Endpoint <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="APIEndpoint" name="APIEndpoint" required>
</div>
<div class="form-group">
<label for="Auth_Bearer">Auth/Bearer token <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="Auth_Bearer" name="Auth_Bearer" required>
</div>
<div class="form-group">
<label for="Inputjson">Input parameter <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="Inputjson" name="Inputjson" required>
</div>
<div class="form-group">
<label for="OutputJson">Output Json <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="OutputJson" name="OutputJson" required>
</div>
<div class="form-group">
<label for="Description">Description <span class="text-danger">*</span></label>
<textarea class="form-control" id="Description" name="Description" rows="3"
required></textarea>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" id="save" onclick="save_file()" class="btn btn-primary">Save</button>
</div>
</div>
</div>
</div>
<!-- Include DataTables JS and your custom script -->
<script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.25/js/dataTables.bootstrap4.min.js"></script>
<script>
$(document).ready(function () {
// Initialize DataTable
$('#knowledgeTable').DataTable();
// Show modal function
$('#add').on('click', function () {
$('#addModal').modal('show');
});
// Your save file function here
async function save_file() {
alert('Save button clicked');
// Your save file logic goes here
}
});
</script>
</body>
</html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081# jinja2 html page with chatbot functionality using adminlte3 theme
<html>
<body>
<form id="myform">
<div class="content-wrapper">
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>Chatbot</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active">Chatbot</li>
</ol>
</div>
</div>
</div>
</section>
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-md-8 offset-md-2">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title">Chat with our AI</h3>
</div>
<div class="card-body">
<div id="chat-container">
<div class="chat-messages">
<!-- Chat messages will be dynamically added here -->
</div>
<div class="chat-input">
<input type="text" id="user_question" placeholder="Type your message...">
<button id="send-button" onclick="clickform()">Send</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</form>
<script>
const chatContainer = document.getElementById('chat-container');
const userInput = document.getElementById('user_question');
const sendButton = document.getElementById('send-button');
function clickform() {
alert('Please enter');
var formElement = document.getElementById('myForm');
var user_question = document.getElementById('user_question').value;
alert(user_question);
//var data = new FormData(formElement);
//alert(data);
fetch('/chat_with_agent', {
method: 'POST',
//body: data,
})
.then(resp => resp.text()) // or, resp.json(), etc.
.then(data => {
//document.getElementById("responseArea").innerHTML = data;
alert(data);
const chatMessage = document.createElement('div');
chatMessage.classList.add('chat-message');
chatMessage.innerHTML = '<strong>You:</strong> ${user_question}<br><strong>AI:</strong> ${data}';
chatContainer.appendChild(chatMessage);
userInput.value = '';
userInput.focus();
})
.catch(error => {
console.error(error);
});
}
</script>
</body></html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190<!DOCTYPE html><html lang="en">
<head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Company Profile</title> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script> <!-- Include AdminLTE CSS --> <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/admin-lte@3.1/dist/css/adminlte.min.css"> <!-- Include DataTables CSS --> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css"> <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" /> <link href="https://cdn.jsdelivr.net/npm/@ttskch/select2-bootstrap4-theme@1.4.0/dist/select2-bootstrap4.min.css" rel="stylesheet" />
<style> .container { margin-top: 10px; margin-left: 420px; align-items: center; max-width: 600px; padding: 10px; border: 1px solid #ccc; border-radius: 5px; position: relative; z-index: 1; }
.container::before { content: ''; position: absolute; top: 50%; left: 40%; background: url('..\static\img\redmindlogo3.jpg') no-repeat center center; background-size: contain; opacity: 0.1; width: 100%; height: 90%; z-index: -1; }
.form-group { margin-bottom: 5px; }
.form-group label { font-weight: bold; margin-bottom: 5px; display: block; }
.form-group input .form-group select { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; text-align: center; }
.form-group select.select2-container--bootstrap4 .select2-selection--multiple { height: auto; /* Adjust height to fit content */ }
.btn-primary { margin-right: 10px; color: black; font-size: 16px; font-weight: bold; }
h3 { text-align: center; margin-bottom: 10px; }
.btn-container { text-align: center; margin-top: 10px; color: white; }
footer { position: absolute; bottom: 0; width: 100%; color: black; text-align: right; padding-right: 245px; padding-top: 0px; background-color: #f8f9fa; border: none !important; }
#llm_tools { text-align: center; font-weight: bold; } </style></head>
<body> {% include 'sidepane.html' %} <div class="container mt-4"> <h3>Company Profile</h3> <form id="companyProfileForm" class="needs-validation" novalidate action="/submit_company_profile" method="post"> <div class="form-group"> <label for="company_name">Company Name <span class="text-danger">*</span></label> <input type="text" id="company_name" name="company_name" class="form-control" required> <div class="invalid-feedback"> Please enter the company name. </div> </div> <div class="form-group"> <label for="company_code">Company Code <span class="text-danger">*</span></label> <input type="text" id="company_code" name="company_code" class="form-control" required> <div class="invalid-feedback"> Please enter the company code. </div> </div> <div class="form-group"> <label for="domain">Domain/Business <span class="text-danger">*</span></label> <input type="text" id="domain" name="domain" class="form-control" required> <div class="invalid-feedback"> Please enter the domain/business. </div> </div> <div class="form-group"> <label for="llm_tools">LLM Tools <span class="text-danger">*</span></label> <select type='text' id="llm_tools" name="llm_tools" class="form-control" multiple required> <option value="Database">Database</option> <option value="Static Documents">Static Documents</option> <option value="API">API</option> </select> <div class="invalid-feedback"> Please select at least one LLM tool. </div> </div> <div class="btn-container"> <button type="submit" class="btn btn-primary">Save</button> <button type="reset" class="btn btn-primary">Clear</button> </div> </form> </div>
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script> <script> $(document).ready(function () { // Initialize Select2 for multi-select dropdown $('#llm_tools').select2({ theme: 'bootstrap4', placeholder: 'Select', allowClear: true });
$('#companyProfileForm').on('submit', function (event) { event.preventDefault(); // Prevent default form submission
// Gather form data var formData = $(this).serialize();
$.ajax({ type: "POST", url: "/submit_company_profile", data: formData, success: function (response) { // Show success message alert('Data saved successfully'); // Reset the form values $('#companyProfileForm')[0].reset(); // Reset Select2 fields $('#llm_tools').val(null).trigger('change'); setTimeout(function () { window.location.href = '/company_profile'; // Redirect to the desired page after a delay }, 2000); // Delay for 2 seconds (2000 milliseconds) }, error: function (xhr) { alert("An error occurred: " + xhr.responseJSON.detail); // Show error message } }); }); }); </script>
</body>
</html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Dashboard</title>
<!-- AdminLTE CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/admin-lte/3.1.0/css/adminlte.min.css">
</head>
<body class="hold-transition sidebar-mini">
<div class="wrapper">
<!-- Main Sidebar -->
<aside class="main-sidebar sidebar-dark-primary elevation-4">
<!-- Sidebar -->
<div class="sidebar">
<!-- Sidebar Menu -->
<nav class="mt-2">
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
<!-- Navigation Links -->
<li class="nav-item">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-home"></i>
<p>Dashboard</p>
</a>
</li>
<li class="nav-item">
<a href="{{ url_for('company_profile') }}" class="nav-link">
<i class="nav-icon fas fa-cogs"></i>
<p>Company Profile</p>
</a>
</li>
<li class="nav-item">
<a href="{{ url_for('knowledgebase') }}" class="nav-link">
<i class="nav-icon fas fa-cogs"></i>
<p>KnowledgeBase</p>
</a>
</li>
<li class="nav-item">
<a href="{{ url_for('data_connectors') }}" class="nav-link">
<i class="nav-icon fas fa-home"></i>
<p>Data Connectors</p>
</a>
</li>
<li class="nav-item">
<a href="{{ url_for('API_connectors') }}" class="nav-link">
<i class="nav-icon fas fa-users"></i>
<p>API Connectors</p>
</a>
</li>
<li class="nav-item">
<a href="{{url_for('prompt_template')}}" class="nav-link">
<i class="nav-icon fas fa-cogs"></i>
<p>Prompt Templates</p>
</a>
</li>
<!-- <li class="nav-item">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-cogs"></i>
<p>LLM Settings</p>
</a>
</li>-->
<li class="nav-item">
<a href="{{ url_for('chatbot') }}" class="nav-link">
<i class="nav-icon fas fa-cogs"></i>
<p>Chat</p>
</a>
</li>
<!-- Add more navigation links here -->
</ul>
</nav>
<!-- /.sidebar-menu -->
</div>
<!-- /.sidebar -->
</aside>
<!-- Content Wrapper -->
<div class="content-wrapper">
<!-- Main content -->
<section class="content">
<!-- Project Information -->
<div class="container-fluid">
<h3 style="text-align: center; margin-bottom:40px;">RedMindGPT</h>
</div>
</section>
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-lg-4 col-6">
<div class="small-box bg-info">
<div class="inner">
<h3>4 </h3>
<h4> KnowledgeBase</h4>
</div>
<div class="icon">
<i class="ion ion-bag"></i>
</div>
</div>
</div>
<div class="col-lg-4 col-6">
<div class="small-box bg-success">
<div class="inner">
<h3>1</h3>
<h4>Data connectors</h4>
</div>
<div class="icon">
<i class="ion ion-stats-bars"></i>
</div>
</div>
</div>
<div class="col-lg-4 col-6">
<div class="small-box bg-warning">
<div class="inner">
<h3>4 </h3>
<h4>API Connectors</h4>
</div>
<div class="icon">
<i class="ion ion-person-add"></i>
</div>
</div>
</div>
<div class="col-lg-4 col-6">
<div class="small-box bg-warning">
<div class="inner">
<h3>5 </h3>
<h4>Prompt_Templates</h4>
</div>
<div class="icon">
<i class="ion ion-person-add"></i>
</div>
</div>
</div>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
</div>
<!-- ./wrapper -->
<!-- AdminLTE JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/admin-lte/3.1.0/js/adminlte.min.js"></script>
</body>
</html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Data Connectors</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/admin-lte@3.1/dist/css/adminlte.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
<style>
html,
body {
height: 90%;
margin: 0;
display: flex;
flex-direction: column;
}
body {
display: flex;
flex-direction: column;
min-height: 90%;
}
.main-content {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
padding: 20px;
}
.container {
margin-top: 50px;
margin-left: 420px;
max-width: 600px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
background-color: #fff;
position: relative;
z-index: 1;
}
.form-group {
margin-bottom: 20px;
}
.form-group label {
font-weight: bold;
margin-top: 5px;
margin-bottom: 5px;
display: block;
}
.form-group input,
.form-group select,
.form-group textarea {
width: 100%;
height: auto;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
}
.btn-primary {
margin-right: 10px;
color: black;
font-size: 16px;
font-weight: bold;
}
h2 {
text-align: center;
margin-bottom: 20px;
}
.btn-container {
text-align: center;
margin-top: 30px;
margin-bottom: 0px;
color: white;
}
#selectedTables,
#labelselected {
display: none;
}
#saveBtn1 {
display: none;
margin: 0 auto;
}
footer {
position: relative;
margin-top: auto;
width: 100%;
color: black;
text-align: right;
padding-right: 245px;
padding-top: 20px;
background-color: #f8f9fa;
border: none !important;
}
</style>
</head>
<body>
{% include 'sidepane.html' %}
<div class="main-content">
<div id="message-container"></div>
<div class="container mt-2">
<h2>Data Connectors</h2>
<div class="form-group">
<label for="company">Company Name <span class="text-danger">*</span></label>
<select type="text" id="company" name="company" class="form-control" required>
<option value="" selected>Select</option>
</select>
</div>
<form id="databaseconnectorForm" class="needs-validation" novalidate action="/save_data_connectors"
method="post" style="display:none;">
<div class="form-group">
<!-- <label for="company_id">company_id</label>--->
<input type="hidden" id="company_id" name="company_id" class="form-control" required>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="database">Database Type<span class="text-danger">*</span></label>
<select type="text" id="database" name="database" class="form-control" required>
<option value="" selected>Select</option>
<option value="Postgress">Postgres</option>
<option value="mysql">Mysql</option>
</select>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="server">Server IP <span class="text-danger">*</span></label>
<input type="text" id="server" name="server" class="form-control" required>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="port">Port <span class="text-danger">*</span></label>
<input type="text" id="port" name="port" class="form-control" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="databaseName">Database Name <span class="text-danger">*</span></label>
<input type="text" id="databaseName" name="databaseName" class="form-control" required>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="username">UserName <span class="text-danger">*</span></label>
<input type="text" id="username" name="username" class="form-control" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="password">Password <span class="text-danger">*</span></label>
<input type="password" id="password" name="password" class="form-control" required>
</div>
</div>
</div>
<div class="btn-container">
<button type="button" id="connectBtn" class="btn btn-primary">Connect</button>
<button type="reset" class="btn btn-primary">Clear</button>
</div>
<div id="schema-table-section" style="display: none;">
<div class="form-group">
<div class="row">
<div class="col">
<label for="schemas">Available Schemas <span class="text-danger">*</span></label>
<select type="text" id="schemas" name="schemas" class="form-control" required>
<option value="" selected>Select</option>
<option value="schema1">Lookup</option>
<option value="schema2">Public</option>
<option value="schema3" selected>tenant_default</option>
</select>
</div>
<div class="col">
<label for="tables">Available Tables <span class="text-danger">*</span></label>
<select type="text" id="tables" name="tables" class="form-control" multiple required>
<option disabled>Select</option>
<option value="customer_master">customer_master</option>
<option value="efs_company_master">efs_company_master</option>
<option value="efs_group_company_master">efs_group_company_master</option>
<option value="efs_region_master">efs_region_master</option>
<option value="party_address_detail">party_address_detail</option>
<option value="wms_warehouse_master">wms_warehouse_master</option>
</select>
</div>
</div>
</div>
<div class="btn-container">
<button type="button" id="saveBtn" class="btn btn-primary">Save</button>
</div>
<div class="form-group">
<label for="selectedTables" id="labelselected">Selected Tables:</label>
<textarea type="text" id="selectedTables" name="selectedTables" class="form-control" rows="5"
readonly style="display:none;"></textarea>
</div>
<div class="btn-container">
<button type="submit" id="saveBtn1" class="btn btn-primary">Save Tables</button>
</div>
</div>
</form>
</div>
</div>
<footer>
<p></p>
</footer>
<script>
document.addEventListener('DOMContentLoaded', function () {
fetchCompanies();
const companySelect = document.getElementById('company');
const databaseconnectorForm = document.getElementById('databaseconnectorForm');
companySelect.addEventListener('change', async function () {
const selectedCompanyName = companySelect.options[companySelect.selectedIndex].text;
console.log(`Selected Company Name: ${selectedCompanyName}`);
if (selectedCompanyName !== "Select") {
try {
const response = await fetch(`/api/company_id?company_name=${encodeURIComponent(selectedCompanyName)}`);
if (!response.ok) {
throw new Error('Network response was not ok');
}
const data = await response.json();
console.log(`Company ID: ${data.company_id}`);
const companyId = data.company_id;
document.getElementById('company_id').value = companyId;
if (companyId) {
try {
const connectorsResponse = await fetch(`/api/check_data_connectors?company_id=${companyId}&company_name=${selectedCompanyName}`);
if (!connectorsResponse.ok) {
throw new Error('data connector Network response was not ok');
}
const connectorsData = await connectorsResponse.json();
//setMultiSelectValues(document.getElementById('database'), connectorsData.databasetype); // Ensure this is an array
//setMultiSelectValues(document.getElementById('databaseName'), connectorsData.database_name); // Ensure this is an array
document.getElementById('database').value = connectorsData.databasetype;
document.getElementById('server').value = connectorsData.serverip;
document.getElementById('port').value = connectorsData.port;
document.getElementById('databaseName').value = connectorsData.database_name;
document.getElementById('username').value = connectorsData.username;
document.getElementById('password').value = connectorsData.password;
document.getElementById('tables').value = connectorsData.dbtablename;
databaseconnectorForm.style.display = 'block';
} catch (error) {
document.getElementById('database').value = " ";
document.getElementById('server').value = " ";
document.getElementById('port').value = " ";
document.getElementById('databaseName').value = " ";
document.getElementById('username').value = " ";
document.getElementById('password').value = " ";
document.getElementById('tables').value = " ";
console.error('Error fetching data from data connectors:', error);
("Company name does not exist. Please fill in the details.");
// Optionally, you can insert a message into the DOM
const messageContainer = document.getElementById('message-container');
if (messageContainer) {
messageContainer.innerHTML = "<div class='alert alert-danger'>Database details does not exist for this Company name.. Please fill in the details.</div>";
}
databaseconnectorForm.style.display = 'block';
}
} else {
console.log(`Company ID does not exist, you can create and save data: ${data.company_id}`);
databaseconnectorForm.style.display = 'none';
}
} catch (error) {
console.error('Error fetching company ID or data connectors:', error);
databaseconnectorForm.style.display = 'none';
}
} else {
databaseconnectorForm.style.display = 'none';
}
});
document.getElementById("connectBtn").addEventListener("click", function (event) {
var database = document.getElementById("database").value;
var server = document.getElementById("server").value;
var port = document.getElementById("port").value;
var databaseName = document.getElementById("databaseName").value;
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
if (!database || !server || !port || !databaseName || !username || !password) {
alert("Please fill in all required fields.");
return;
}
document.getElementById("schema-table-section").style.display = "block";
});
document.getElementById("saveBtn").addEventListener("click", function (event) {
var tables = Array.from(document.getElementById("tables").selectedOptions).map(option => option.value);
if (tables.length === 0) {
alert("Please select at least one table.");
return;
}
var selectedTables = document.getElementById("selectedTables");
selectedTables.value = tables.join(", ");
selectedTables.style.display = "block";
document.getElementById("labelselected").style.display = "block";
document.getElementById("saveBtn1").style.display = "block";
});
});
async function fetchCompanies() {
try {
const response = await fetch('/api/companies');
if (!response.ok) {
throw new Error('Network response was not ok');
}
const data = await response.json();
displayCompanies(data.companies);
} catch (error) {
console.error('Error fetching companies:', error);
}
}
function displayCompanies(companies) {
const companySelect = document.getElementById('company');
companySelect.innerHTML = '<option value="" selected>Select</option>'; // Reset the dropdown
companies.forEach(company => {
const option = document.createElement('option');
option.value = company.name;
option.textContent = company.name;
companySelect.appendChild(option);
});
}
function setMultiSelectValues(selectElement, values) {
// Ensure values is an array
if (!Array.isArray(values)) {
values = [values];
}
Array.from(selectElement.options).forEach(option => {
option.selected = values.includes(option.value);
});
}
</script>
</body>
</html>1234567891011121314151617181920212223242526<!-- footer.html -->
<!--
This is the HTML code for the footer section of a web page.
It displays the version number and copyright information.
HTML Structure:
- The footer element has a class of "main-footer".
- Inside the footer, there is a div element with classes "float-right" and "d-none d-sm-block".
- Inside the div, there is a bold tag (<b>) displaying the version number.
- After the div, there is a strong tag (<strong>) displaying the copyright information.
- The copyright information includes the year and a link to the company's website.
Example Usage:
<footer class="main-footer">
<div class="float-right d-none d-sm-block">
<b>Version</b> 3.0.5
</div>
<strong>© 2023 <a href="https://yourcompany.com">Your Company</a>.</strong> All rights reserved.
</footer>
-->
<footer class="main-footer" style="position: absolute; bottom: 0; width: 100%; color: black; text-align: right; padding-right:245px ;">
<div class="container-fluid">
<a href="https://redmindtechnologies.com" target="_blank" style="color: black; text-decoration: none;">Visit Redmind Technologies at https://redmindtechnologies.com</a>
</div>
</footer>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103<!--
This is the login page template for the RedMindGPT application.
It contains a login form where users can enter their username and password to sign in.
The form includes validation to ensure that both fields are filled out before submission.
The page also includes styling using CSS and utilizes the AdminLTE and Font Awesome libraries for additional design elements.
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
/* CSS styles for the login page */
.login-box-msg {
color: grey;
font-size: larger;
font-weight: bold;
}
.remember-me {
text-align: center;
}
</style>
<title>RedMindGPT</title>
<!-- AdminLTE CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/admin-lte@3.1/dist/css/adminlte.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
</head>
<body class="hold-transition login-page" style="background-image: url('static/img/AI.jpg'); background-size: cover;">
<div class="login-box">
<div class="card">
<!-- Logo -->
<div style="align-items: center;">
<a href="#" style="color: blue;
font-size: 30px;
font-weight: bold;
margin-left: 80px;
margin-top: 20px;
"><b>RedMindGPT</b></a>
</div>
<form action='/validate-user' name='loginForm' method="post" onsubmit="return validateForm()">
<div class="card-body login-card-body">
<p class="login-box-msg">Sign in</p>
<div class="input-group mb-3">
<input type="text" class="form-control" placeholder="Username" name="username" required>
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-user"></span>
</div>
</div>
</div>
<div class="input-group mb-3">
<input type="password" class="form-control" placeholder="Password" name="password" required>
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-lock"></span>
</div>
</div>
</div>
<div class="row" style="align-content: center;">
<div class="col-8">
<div class="icheck-primary">
<input type="checkbox" id="remember">
<label for="remember">
Remember Me
</label>
</div>
</div>
</div>
<div class="row" style="align-content: center;">
<div class="col-4">
<button type="submit" class="btn btn-primary btn-block">Sign In</button>
</div>
<div class="col-4">
<button type="reset" class="btn btn-secondary btn-block">Clear</button>
</div>
</div>
</div>
</form>
</div>
</div>
<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<!-- Bootstrap 4 -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<script src="https://cdn.jsdelivr.net/npm/admin-lte@3.1/dist/js/adminlte.min.js"></script>
<script>
// JavaScript function to validate the login form
function validateForm() {
//alert("Validating form");
var username = document.forms["loginForm"]["username"].value;
var password = document.forms["loginForm"]["password"].value;
if (username == "" || password == "") {
alert("Username and Password must be filled out");
return false;
}
}
</script>
</body>
</html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360<!DOCTYPE html>
<html>
<head>
<title>Knowledge Base</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<!-- Include AdminLTE CSS -->
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/admin-lte@3.1/dist/css/adminlte.min.css">
<!-- Include DataTables CSS -->
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
<!-- Include AdminLTE JS -->
<script src="https://cdn.jsdelivr.net/npm/admin-lte@3.1/dist/js/adminlte.min.js"></script>
<!-- Include DataTables JS -->
<script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.25/js/dataTables.bootstrap4.min.js"></script>
<style>
body {
background-color: transparent !important;
}
.content-wrapper {
background-color: transparent !important;
text-align: center;
}
.wrapper {
background-color: transparent !important;
}
.modal-content {
background-color: #fff;
}
h1 {
text-align: center;
margin-bottom: 30px;
}
/* Adjust table width to full container width */
.card-body {
padding: 0;
}
.table {
width: 100%;
}
.text-wrap {
white-space: normal !important;
word-break: break-word;
}
.center-align {
padding-top: 20px;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
}
.reduced-width {
width: 50%;
/* Adjust the percentage as needed */
}
</style>
</head>
<body>
{% include 'sidepane.html' %}
<div class="wrapper" style="position: relative; top: 0;">
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="container mt-2">
<h1 class="m-0 text-center" style="flex-grow: 1;">Knowledge Base</h1>
<div class="form-group center-align">
<label for="company" class="mr-2">Company Name <span class="text-danger">*</span></label>
<select type="text" id="company" name="company" class="form-control reduced-width" required>
<option value="" selected>Select</option>
</select>
</div>
</div>
</div>
</div>
<section class="content" id="contentSection" style="display: none;">
<div class="container-fluid">
<div class="form-group">
<!-- <label for="company_id">company_id</label>--->
<input type="hidden" id="company_id" name="company_id" class="form-control" required>
</div>
<div class="row">
<div class="col-12 d-flex justify-content-end mb-3">
<button class="btn btn-primary" id="add">Add</button>
</div>
<div class="row mb-2">
<div class="col-12">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="table-responsive">
<div id="message-container">
<table id="knowledgeTable" class="table table-bordered table-striped">
<thead>
<tr>
<th>Sno</th>
<th>Document Name</th>
<th>Document Description</th>
<th>Document Version</th>
<th>VectorDB Flag</th>
<th>View</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>NewAge eWMS BusinessRequirementsDocument_V1.9 - Inbound
</td>
<td>GRN Inbound</td>
<td>1.9</td>
<td>Yes</td>
<td>
<button class="btn btn-primary viewButton">View</button>
</td>
</tr>
<tr>
<td>2</td>
<td>NewAge eWMS BusinessRequirementsDocument_V2.3 - Inbound
</td>
<td>GRN Inbound</td>
<td>2.3</td>
<td>No</td>
<td>
<button class="btn btn-primary viewButton">View</button>
</td>
</tr>
<tr>
<td>3</td>
<td>NewAge eWMS BusinessRequirementsDocument_V1.9 - Outbound
</td>
<td>GRN Outbound</td>
<td>1.9</td>
<td>Yes</td>
<td>
<button class="btn btn-primary viewButton">View</button>
</td>
</tr>
<tr>
<td>4</td>
<td class="text-wrap">NewAge eWMS
BusinessRequirementsDocument_V2.2 - Outbound</td>
<td>ASN Outbound</td>
<td>2.2</td>
<td>No</td>
<td>
<button class="btn btn-primary viewButton">View</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addModalLabel">Add Document</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<!-- <label for="company_id">company_id</label>--->
<input type="hidden" id="company_id" name="company_id" class="form-control" required>
</div>
<form id="documentForm">
<div class="form-group">
<label for="uploadFile">Upload File<span class="text-danger">*</span></label>
<input type="file" class="form-control-file" id="uploadFile" name="uploadFile" required accept=".pdf,.doc,.docx">
<small class="form-text text-muted">Accepted formats: .pdf, .doc, .docx</small>
</div>
<div class="form-group">
<label for="documentName">Document Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="documentName" name="documentName" required>
</div>
<div class="form-group">
<label for="documentDescription">Document Description<span class="text-danger">*</span></label>
<textarea class="form-control" id="documentDescription" name="documentDescription"
rows="3" required></textarea>
</div>
<div class="form-group">
<label for="department">Department<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="department" name="department" required>
</div>
<div class="form-group">
<label for="version">Version<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="version" name="version" required>
</div>
<div class="form-group">
<label for="lastUpdated">Last Updated<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="lastUpdated" name="lastUpdated" required>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" id="save" onclick="save_file()" class="btn btn-primary">Save</button>
</div>
</div>
</div>
</div>
</div>
<!-- JavaScript to handle modal display -->
<script>
document.addEventListener("DOMContentLoaded", function () {
now = new Date().toISOString().substr(0, 10);
document.getElementById('lastUpdated').value = now
// clearFormFields();
});
document.addEventListener('DOMContentLoaded', function () {
fetchCompanies();
const companySelect = document.getElementById('company');
const documentForm = document.getElementById('documentForm');
companySelect.addEventListener('change', async function () {
const selectedCompanyName = companySelect.options[companySelect.selectedIndex].text;
console.log(`Selected Company Name: ${selectedCompanyName}`);
if (selectedCompanyName !== "Select") {
try {
const response = await fetch(`/api/company_id?company_name=${encodeURIComponent(selectedCompanyName)}`);
if (!response.ok) {
contentSection.style.display='none';
const messageContainer = document.getElementById('message-container');
if (messageContainer) {
messageContainer.innerHTML = "<div class='alert alert-danger'>Document details do not exist for this company. Please fill in the details.</div>";
}
throw new Error('Network response was not ok');
}
const data = await response.json();
console.log(`Company ID: ${data.company_id}`);
const companyId = data.company_id;
document.getElementById('company_id').value = companyId;
if (companyId) {
contentSection.style.display = 'block';
}
} catch (error) {
console.error('Error fetching company ID or data documents:', error);
documentForm.style.display = 'none';
}
} else {
//clearFormFields();
documentForm.style.display = 'block';
}
});
});
function clearFormFields() {
document.getElementById('uploadFile').value = "";
document.getElementById('documentName').value = "";
document.getElementById('documentDescription').value = "";
document.getElementById('department').value = "";
document.getElementById('version').value = "";
//document.getElementById('lastUpdated').value = "";
}
$(document).ready(function () {
// Show modal function
$('#add').on('click', function () {
clearFormFields();
$('#addModal').modal('show');
});
$('.modal-footer .btn-secondary').on('click', function () {
$('#addModal').modal('hide');
});
// Your save file function here
// async function save_file() {
// alert('Save button clicked');
// // Your save file logic goes here
// }
});
function save_file() {
const uploadFile = document.getElementById("uploadFile").files[0];
const documentName = document.getElementById("documentName").value;
const documentDescription = document.getElementById("documentDescription").value;
const department = document.getElementById("department").value;
const version = document.getElementById("version").value;
const lastUpdated = document.getElementById("lastUpdated").value;
const company_id = document.getElementById("company_id").value;
const formData = new FormData();
formData.append("uploadFile", uploadFile);
formData.append("documentName", documentName);
formData.append("documentDescription", documentDescription);
formData.append("department", department);
formData.append("version", version);
formData.append("lastUpdated", lastUpdated);
formData.append("company_id", company_id);
fetch('/upload_document', {
method: 'POST',
body: formData
})
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.text();
})
.then(data => {
alert('Document saved successfully');
// $('#addModal').modal('hide');
})
.catch(error => console.error('Error:', error));
}
async function fetchCompanies() {
try {
const response = await fetch('/api/companies');
if (!response.ok) {
throw new Error('Network response was not ok');
}
const data = await response.json();
displayCompanies(data.companies);
} catch (error) {
console.error('Error fetching companies:', error);
}
}
function displayCompanies(companies) {
const companySelect = document.getElementById('company');
companySelect.innerHTML = '<option value="" selected>Select</option>'; // Reset the dropdown
companies.forEach(company => {
const option = document.createElement('option');
option.value = company.name;
option.textContent = company.name;
companySelect.appendChild(option);
});
}
</script>
</body>
</html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224<!DOCTYPE html>
<html>
<head>
<title>Prompt Template</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<!-- Include AdminLTE CSS -->
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/admin-lte@3.1/dist/css/adminlte.min.css">
<!-- Include DataTables CSS -->
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
<style>
.header-row {
display: flex;
justify-content: space-between;
align-items: center;
}
h2 {
text-align: center;
}
.table-container {
width: 100%;
overflow-x: auto;
}
.wrapper {
display: flex;
flex-direction: column;
height: 100vh;
}
.content-wrapper {
flex: 1;
overflow-y: auto;
}
.content-header {
padding: 1rem;
}
.footer {
text-align: right;
padding: 10px;
}
th,
td {
white-space: nowrap;
}
th:nth-child(1),
td:nth-child(1) {
/* Sno column */
width: 3%;
}
th:nth-child(2),
td:nth-child(2) {
/* API Name column */
width: 20%;
}
th:nth-child(3),
td:nth-child(3) {
/* API Endpoint column */
width: 40%;
}
th:nth-child(4),
td:nth-child(4) {
/* Auth/Bearer token column */
width: 20%;
}
th:nth-child(5),
td:nth-child(5) {
/* View column */
width: 15%;
}
</style>
</head>
<body>
{% include 'sidepane.html' %}
<div class="wrapper">
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-12">
<div class="header-row">
<h2 class="m-0 text-center" style="flex-grow: 1;">Prompt Template</h2>
<button class="btn btn-primary" id="add">Add</button>
</div>
</div>
</div>
</div>
</div>
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body table-container">
<table id="knowledgeTable" class="table table-bordered table-striped">
<thead>
<tr>
<th>Sno</th>
<th>Scenario</th>
<th>Sample Prompt</th>
<th>Comments</th>
<th>View</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Creating new database in mysql</td>
<td>Need DB step for mysql with DB name = wwp, table name = customer_master with column name = name as datatype = string. (sample prompt).</td>
<td>It didn't create database instead its showed how to make connection to database and create table.</td>
<td><button class="btn btn-primary viewButton">View</button></td>
</tr>
<tr>
<td>2</td>
<td>Creating data table with columns</td>
<td>Since you are an EXPERT in PHP, i want a code for an entity/configuration of table name called customer_Master. this table should be created inside database wwp which is in file database_connection.php. now, in that table customer_master i want to add columns. the column names and datatypes are given below:</td>
<td>Expected response but adminlte theme was missing.</td>
<td><button class="btn btn-primary viewButton">View</button></td>
</tr>
<tr>
<td>3</td>
<td>Creating home page with adminlte theme.</td>
<td>I have created a new file named admintle_theme.php. I want this file filled with "ADMINLTE" theme. it should have a login/signup functionality and home button along with dashboard.
example: https://adminlte.io/themes/v3/index3.html
use this example for theme/html page. recreate it exactly like that
.image.png
</td>
<td>It created a html page but lacked side bar, nav bar present in url.
</td>
<td><button class="btn btn-primary viewButton">View</button></td>
</tr>
<tr>
<td>4</td>
<td>Including side bar menu in customer master</td>
<td>I want the side bar menu from admintle_theme to be present in customer_configuration.php</td>
<td>It gave expected results.
</td>
<td><button class="btn btn-primary viewButton">View</button></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addModalLabel">Add Prompt</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="addPromptForm">
<div class="form-group">
<label for="APIName">Scenario <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="APIName" name="APIName" required>
</div>
<div class="form-group">
<label for="APIEndpoint">Sample Prompt <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="APIEndpoint" name="APIEndpoint" required>
</div>
<div class="form-group">
<label for="Auth_Bearer">Comments <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="Auth_Bearer" name="Auth_Bearer" required>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" id="save" onclick="save_file()" class="btn btn-primary">Save</button>
</div>
</div>
</div>
</div>
<!-- Include DataTables JS and your custom script -->
<script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.25/js/dataTables.bootstrap4.min.js"></script>
<script>
$(document).ready(function () {
// Initialize DataTable
$('#knowledgeTable').DataTable();
// Show modal function
$('#add').on('click', function () {
$('#addModal').modal('show');
});
// Your save file function here
function save_file() {
alert('Save button clicked');
// Your save file logic goes here
}
});
</script>
</body>
</html>1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495<!-- sidepane.html -->
<!-- This file represents the sidepane component of a web application. It contains the navigation menu and sidebar. -->
<nav class="main-header navbar navbar-expand navbar-white navbar-light" style="text-align: center;"> <div class="container-fluid d-flex justify-content-center align-items-center"> <img src="../static/img/redmindlogo3.jpg" alt="Logo" style="width: 80px; height: auto; margin-right: 10px;">
<h2 style="text-align: center; margin-bottom: 0;">Redmind GPT</h2> </div> <!-- Left navbar links --> <ul class="navbar-nav"> <li class="nav-item"> <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a> </li> </ul></nav>
<!-- Main Sidebar Container --><aside class="main-sidebar sidebar-dark-primary elevation-4" style="width: 200px;"> <!-- Sidebar --> <div class="sidebar"> <!-- Sidebar Menu --> <nav class="mt-2"> <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false"> <!-- Navigation Links --> <li class="nav-item"> <a href="#" class="nav-link"> <i class="nav-icon fas fa-home"></i> <p>Dashboard</p> </a> </li> <li class="nav-item"> <a href="{{ url_for('company_profile') }}" class="nav-link"> <i class="nav-icon fas fa-users"></i> <p>Company Profile</p> </a> </li> <li class="nav-item"> <a href="{{ url_for('knowledgebase') }}" class="nav-link"> <i class="nav-icon fas fa-cogs"></i> <p>KnowledgeBase</p> </a> </li> <li class="nav-item"> <a href="{{ url_for('data_connectors') }}" class="nav-link"> <i class="nav-icon fas fa-home"></i> <p>Data Connectors</p> </a> </li> <li class="nav-item"> <a href="{{ url_for('API_connectors') }}" class="nav-link"> <i class="nav-icon fas fa-users"></i> <p>API Connectors</p> </a> </li> <li class="nav-item"> <a href="{{url_for('prompt_template')}}" class="nav-link"> <i class="nav-icon fas fa-cogs"></i> <p>Prompt Templates</p> </a> </li> <!--<li class="nav-item"> <a href="#" class="nav-link"> <i class="nav-icon fas fa-cogs"></i> <p>LLM Settings</p> </a> <ul class="nav nav-treeview"> <li class="nav-item"> <a href="#" class="nav-link"> <i class="far fa-circle nav-icon"></i> <p>Sublink 1</p> </a> </li> <li class="nav-item"> <a href="#" class="nav-link"> <i class="far fa-circle nav-icon"></i> <p>Sublink 2</p> </a> </li> <!-- Add more sublinks here --> </ul> </li> -->
<!-- Add more navigation links here --> </ul> </nav> <!-- /.sidebar-menu --> </div> <!-- /.sidebar --></aside>
<!-- AdminLTE JS --><script src="https://cdnjs.cloudflare.com/ajax/libs/admin-lte/3.1.0/js/adminlte.min.js"></script>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228<!DOCTYPE html>
<html>
<head>
<title>API Connectors</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<!-- Include AdminLTE CSS -->
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/admin-lte@3.1/dist/css/adminlte.min.css">
<!-- Include DataTables CSS -->
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
<style>
.header-row {
display: flex;
justify-content: space-between;
align-items: center;
}
h2 {
text-align: center;
}
.table-container {
width: 100%;
overflow-x: auto;
}
.wrapper {
display: flex;
flex-direction: column;
height: 100vh;
}
.content-wrapper {
flex: 1;
overflow-y: auto;
}
.content-header {
padding: 1rem;
}
.footer {
text-align: right;
padding: 10px;
}
th,
td {
white-space: nowrap;
}
th:nth-child(1),
td:nth-child(1) {
/* Sno column */
width: 5%;
}
th:nth-child(2),
td:nth-child(2) {
/* API Name column */
width: 20%;
}
th:nth-child(3),
td:nth-child(3) {
/* API Endpoint column */
width: 40%;
}
th:nth-child(4),
td:nth-child(4) {
/* Auth/Bearer token column */
width: 20%;
}
th:nth-child(5),
td:nth-child(5) {
/* View column */
width: 15%;
}
</style>
</head>
<body>
{% include 'sidepane.html' %}
<div class="wrapper">
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-12">
<div class="header-row">
<h2 class="m-0 text-center" style="flex-grow: 1;">API Connectors</h2>
<button class="btn btn-primary" id="add">Add</button>
</div>
</div>
</div>
</div>
</div>
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body table-container">
<table id="knowledgeTable" class="table table-bordered table-striped">
<thead>
<tr>
<th>Sno</th>
<th>API Name</th>
<th>API Endpoint</th>
<th>View</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Warehouse</td>
<td>http://193.203.162.39:9090/nxt-wms/userWarehouse/fetchWarehouseForUserId
</td>
<td><button class="btn btn-primary viewButton">View</button></td>
</tr>
<tr>
<td>2</td>
<td>customer</td>
<td>http://193.203.162.39:9090/nxt-wms/userCustomer/fetchCustomerForUserId
</td>
<td><button class="btn btn-primary viewButton">View</button></td>
</tr>
<tr>
<td>3</td>
<td>SKU</td>
<td>http://193.203.162.39:9090/nxt-wms/sku/autoComplete?</td>
<td><button class="btn btn-primary viewButton">View</button></td>
</tr>
<tr>
<td>4</td>
<td>ASN</td>
<td>http://193.203.162.39:9090/nxt-wms/trnHeader</td>
<td><button class="btn btn-primary viewButton">View</button></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addModalLabel">Add Document</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label for="APIName">API Name <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="APIName" name="APIName" required>
</div>
<div class="form-group">
<label for="APIEndpoint">API Endpoint <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="APIEndpoint" name="APIEndpoint" required>
</div>
<div class="form-group">
<label for="Auth_Bearer">Auth/Bearer token <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="Auth_Bearer" name="Auth_Bearer" required>
</div>
<div class="form-group">
<label for="Inputjson">Input parameter <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="Inputjson" name="Inputjson" required>
</div>
<div class="form-group">
<label for="OutputJson">Output Json <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="OutputJson" name="OutputJson" required>
</div>
<div class="form-group">
<label for="Description">Description <span class="text-danger">*</span></label>
<textarea class="form-control" id="Description" name="Description" rows="3"
required></textarea>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" id="save" onclick="save_file()" class="btn btn-primary">Save</button>
</div>
</div>
</div>
</div>
<!-- Include DataTables JS and your custom script -->
<script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.25/js/dataTables.bootstrap4.min.js"></script>
<script>
$(document).ready(function () {
// Initialize DataTable
$('#knowledgeTable').DataTable();
// Show modal function
$('#add').on('click', function () {
$('#addModal').modal('show');
});
// Your save file function here
async function save_file() {
alert('Save button clicked');
// Your save file logic goes here
}
});
</script>
</body>
</html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081# jinja2 html page with chatbot functionality using adminlte3 theme
<html>
<body>
<form id="myform">
<div class="content-wrapper">
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>Chatbot</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active">Chatbot</li>
</ol>
</div>
</div>
</div>
</section>
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-md-8 offset-md-2">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title">Chat with our AI</h3>
</div>
<div class="card-body">
<div id="chat-container">
<div class="chat-messages">
<!-- Chat messages will be dynamically added here -->
</div>
<div class="chat-input">
<input type="text" id="user_question" placeholder="Type your message...">
<button id="send-button" onclick="clickform()">Send</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</form>
<script>
const chatContainer = document.getElementById('chat-container');
const userInput = document.getElementById('user_question');
const sendButton = document.getElementById('send-button');
function clickform() {
alert('Please enter');
var formElement = document.getElementById('myForm');
var user_question = document.getElementById('user_question').value;
alert(user_question);
//var data = new FormData(formElement);
//alert(data);
fetch('/chat_with_agent', {
method: 'POST',
//body: data,
})
.then(resp => resp.text()) // or, resp.json(), etc.
.then(data => {
//document.getElementById("responseArea").innerHTML = data;
alert(data);
const chatMessage = document.createElement('div');
chatMessage.classList.add('chat-message');
chatMessage.innerHTML = '<strong>You:</strong> ${user_question}<br><strong>AI:</strong> ${data}';
chatContainer.appendChild(chatMessage);
userInput.value = '';
userInput.focus();
})
.catch(error => {
console.error(error);
});
}
</script>
</body></html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Company Profile</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<!-- Include AdminLTE CSS -->
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/admin-lte@3.1/dist/css/adminlte.min.css">
<!-- Include DataTables CSS -->
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<link href="https://cdn.jsdelivr.net/npm/@ttskch/select2-bootstrap4-theme@1.4.0/dist/select2-bootstrap4.min.css"
rel="stylesheet" />
<style>
.container {
margin-top: 10px;
margin-left: 420px;
align-items: center;
max-width: 600px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
position: relative;
z-index: 1;
}
.container::before {
content: '';
position: absolute;
top: 50%;
left: 40%;
background: url('..\static\img\redmindlogo3.jpg') no-repeat center center;
background-size: contain;
opacity: 0.1;
width: 100%;
height: 90%;
z-index: -1;
}
.form-group {
margin-bottom: 5px;
}
.form-group label {
font-weight: bold;
margin-bottom: 5px;
display: block;
}
.form-group input .form-group select {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
text-align: center;
}
.form-group select.select2-container--bootstrap4 .select2-selection--multiple {
height: auto;
/* Adjust height to fit content */
}
.btn-primary {
margin-right: 10px;
color: black;
font-size: 16px;
font-weight: bold;
}
h3 {
text-align: center;
margin-bottom: 10px;
}
.btn-container {
text-align: center;
margin-top: 10px;
color: white;
}
footer {
position: absolute;
bottom: 0;
width: 100%;
color: black;
text-align: right;
padding-right: 245px;
padding-top: 0px;
background-color: #f8f9fa;
border: none !important;
}
#llm_tools {
text-align: center;
font-weight: bold;
}
</style>
</head>
<body>
{% include 'sidepane.html' %}
<div class="container mt-4">
<h3>Company Profile</h3>
<form id="companyProfileForm" class="needs-validation" novalidate action="/submit_company_profile"
method="post">
<div class="form-group">
<label for="company_name">Company Name <span class="text-danger">*</span></label>
<input type="text" id="company_name" name="company_name" class="form-control" required>
<div class="invalid-feedback">
Please enter the company name.
</div>
</div>
<div class="form-group">
<label for="company_code">Company Code <span class="text-danger">*</span></label>
<input type="text" id="company_code" name="company_code" class="form-control" required>
<div class="invalid-feedback">
Please enter the company code.
</div>
</div>
<div class="form-group">
<label for="domain">Domain/Business <span class="text-danger">*</span></label>
<input type="text" id="domain" name="domain" class="form-control" required>
<div class="invalid-feedback">
Please enter the domain/business.
</div>
</div>
<div class="form-group">
<label for="llm_tools">LLM Tools <span class="text-danger">*</span></label>
<select type='text' id="llm_tools" name="llm_tools" class="form-control" multiple required>
<option value="Database">Database</option>
<option value="Static Documents">Static Documents</option>
<option value="API">API</option>
</select>
<div class="invalid-feedback">
Please select at least one LLM tool.
</div>
</div>
<div class="btn-container">
<button type="submit" class="btn btn-primary">Save</button>
<button type="reset" class="btn btn-primary">Clear</button>
</div>
</form>
</div>
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<script>
$(document).ready(function () {
// Initialize Select2 for multi-select dropdown
$('#llm_tools').select2({
theme: 'bootstrap4',
placeholder: 'Select',
allowClear: true
});
$('#companyProfileForm').on('submit', function (event) {
event.preventDefault(); // Prevent default form submission
// Gather form data
var formData = $(this).serialize();
$.ajax({
type: "POST",
url: "/submit_company_profile",
data: formData,
success: function (response) {
alert(response.message); // Show success message
setTimeout(function () {
window.location.href = '/company_profile'; // Redirect to the desired page after a delay
}, 2000); // Delay for 2 seconds (2000 milliseconds)
},
error: function (xhr) {
alert("An error occurred: " + xhr.responseJSON.detail); // Show error message
}
});
});
});
</script>
</body>
</html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Dashboard</title>
<!-- AdminLTE CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/admin-lte/3.1.0/css/adminlte.min.css">
</head>
<body class="hold-transition sidebar-mini">
<div class="wrapper">
<!-- Main Sidebar -->
<aside class="main-sidebar sidebar-dark-primary elevation-4">
<!-- Sidebar -->
<div class="sidebar">
<!-- Sidebar Menu -->
<nav class="mt-2">
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
<!-- Navigation Links -->
<li class="nav-item">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-home"></i>
<p>Dashboard</p>
</a>
</li>
<li class="nav-item">
<a href="{{ url_for('company_profile') }}" class="nav-link">
<i class="nav-icon fas fa-cogs"></i>
<p>Company Profile</p>
</a>
</li>
<li class="nav-item">
<a href="{{ url_for('knowledgebase') }}" class="nav-link">
<i class="nav-icon fas fa-cogs"></i>
<p>KnowledgeBase</p>
</a>
</li>
<li class="nav-item">
<a href="{{ url_for('data_connectors') }}" class="nav-link">
<i class="nav-icon fas fa-home"></i>
<p>Data Connectors</p>
</a>
</li>
<li class="nav-item">
<a href="{{ url_for('API_connectors') }}" class="nav-link">
<i class="nav-icon fas fa-users"></i>
<p>API Connectors</p>
</a>
</li>
<li class="nav-item">
<a href="{{url_for('prompt_template')}}" class="nav-link">
<i class="nav-icon fas fa-cogs"></i>
<p>Prompt Templates</p>
</a>
</li>
<!-- <li class="nav-item">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-cogs"></i>
<p>LLM Settings</p>
</a>
</li>-->
<li class="nav-item">
<a href="{{ url_for('chatbot') }}" class="nav-link">
<i class="nav-icon fas fa-cogs"></i>
<p>Chat</p>
</a>
</li>
<!-- Add more navigation links here -->
</ul>
</nav>
<!-- /.sidebar-menu -->
</div>
<!-- /.sidebar -->
</aside>
<!-- Content Wrapper -->
<div class="content-wrapper">
<!-- Main content -->
<section class="content">
<!-- Project Information -->
<div class="container-fluid">
<h3 style="text-align: center; margin-bottom:40px;">RedMindGPT</h>
</div>
</section>
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-lg-4 col-6">
<div class="small-box bg-info">
<div class="inner">
<h3>4 </h3>
<h4> KnowledgeBase</h4>
</div>
<div class="icon">
<i class="ion ion-bag"></i>
</div>
</div>
</div>
<div class="col-lg-4 col-6">
<div class="small-box bg-success">
<div class="inner">
<h3>1</h3>
<h4>Data connectors</h4>
</div>
<div class="icon">
<i class="ion ion-stats-bars"></i>
</div>
</div>
</div>
<div class="col-lg-4 col-6">
<div class="small-box bg-warning">
<div class="inner">
<h3>4 </h3>
<h4>API Connectors</h4>
</div>
<div class="icon">
<i class="ion ion-person-add"></i>
</div>
</div>
</div>
<div class="col-lg-4 col-6">
<div class="small-box bg-warning">
<div class="inner">
<h3>5 </h3>
<h4>Prompt_Templates</h4>
</div>
<div class="icon">
<i class="ion ion-person-add"></i>
</div>
</div>
</div>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
</div>
<!-- ./wrapper -->
<!-- AdminLTE JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/admin-lte/3.1.0/js/adminlte.min.js"></script>
</body>
</html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Data Connectors</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/admin-lte@3.1/dist/css/adminlte.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
<style>
html,
body {
height: 90%;
margin: 0;
display: flex;
flex-direction: column;
}
body {
display: flex;
flex-direction: column;
min-height: 90%;
}
.main-content {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
padding: 20px;
}
.container {
margin-top: 50px;
margin-left: 420px;
max-width: 600px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
background-color: #fff;
position: relative;
z-index: 1;
}
.form-group {
margin-bottom: 20px;
}
.form-group label {
font-weight: bold;
margin-top: 5px;
margin-bottom: 5px;
display: block;
}
.form-group input,
.form-group select,
.form-group textarea {
width: 100%;
height: auto;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
}
.btn-primary {
margin-right: 10px;
color: black;
font-size: 16px;
font-weight: bold;
}
h2 {
text-align: center;
margin-bottom: 20px;
}
.btn-container {
text-align: center;
margin-top: 30px;
margin-bottom: 0px;
color: white;
}
#selectedTables,
#labelselected {
display: none;
}
#saveBtn1 {
display: none;
margin: 0 auto;
}
footer {
position: relative;
margin-top: auto;
width: 100%;
color: black;
text-align: right;
padding-right: 245px;
padding-top: 20px;
background-color: #f8f9fa;
border: none !important;
}
</style>
</head>
<body>
{% include 'sidepane.html' %}
<div class="main-content">
<div id="message-container"></div>
<div class="container mt-2">
<h2>Data Connectors</h2>
<div class="form-group">
<label for="company">Company Name <span class="text-danger">*</span></label>
<select type="text" id="company" name="company" class="form-control" required>
<option value="" selected>Select</option>
</select>
</div>
<form id="databaseconnectorForm" class="needs-validation" novalidate action="/save_data_connectors"
method="post" style="display:none;">
<div class="form-group">
<!-- <label for="company_id">company_id</label>--->
<input type="hidden" id="company_id" name="company_id" class="form-control" required>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="database">Database Type<span class="text-danger">*</span></label>
<select type="text" id="database" name="database" class="form-control" required>
<option value="" selected>Select</option>
<option value="Postgress">Postgres</option>
<option value="mysql">Mysql</option>
</select>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="server">Server IP <span class="text-danger">*</span></label>
<input type="text" id="server" name="server" class="form-control" required>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="port">Port <span class="text-danger">*</span></label>
<input type="text" id="port" name="port" class="form-control" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="databaseName">Database Name <span class="text-danger">*</span></label>
<input type="text" id="databaseName" name="databaseName" class="form-control" required>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="username">UserName <span class="text-danger">*</span></label>
<input type="text" id="username" name="username" class="form-control" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="password">Password <span class="text-danger">*</span></label>
<input type="password" id="password" name="password" class="form-control" required>
</div>
</div>
</div>
<div class="btn-container">
<button type="button" id="connectBtn" class="btn btn-primary">Connect</button>
<button type="reset" class="btn btn-primary">Clear</button>
</div>
<div id="schema-table-section" style="display: none;">
<div class="form-group">
<div class="row">
<div class="col">
<label for="schemas">Available Schemas <span class="text-danger">*</span></label>
<select type="text" id="schemas" name="schemas" class="form-control" required>
<option value="" selected>Select</option>
<option value="schema1">Lookup</option>
<option value="schema2">Public</option>
<option value="schema3" selected>tenant_default</option>
</select>
</div>
<div class="col">
<label for="tables">Available Tables <span class="text-danger">*</span></label>
<select type="text" id="tables" name="tables" class="form-control" multiple required>
<option disabled>Select</option>
<option value="customer_master">customer_master</option>
<option value="efs_company_master">efs_company_master</option>
<option value="efs_group_company_master">efs_group_company_master</option>
<option value="efs_region_master">efs_region_master</option>
<option value="party_address_detail">party_address_detail</option>
<option value="wms_warehouse_master">wms_warehouse_master</option>
</select>
</div>
</div>
</div>
<div class="btn-container">
<button type="button" id="saveBtn" class="btn btn-primary">Save</button>
</div>
<div class="form-group">
<label for="selectedTables" id="labelselected">Selected Tables:</label>
<textarea type="text" id="selectedTables" name="selectedTables" class="form-control" rows="5"
readonly style="display:none;"></textarea>
</div>
<div class="btn-container">
<button type="submit" id="saveBtn1" class="btn btn-primary">Save Tables</button>
</div>
</div>
</form>
</div>
</div>
<footer>
<p></p>
</footer>
<script>
document.addEventListener('DOMContentLoaded', function () {
fetchCompanies();
const companySelect = document.getElementById('company');
const databaseconnectorForm = document.getElementById('databaseconnectorForm');
companySelect.addEventListener('change', async function () {
const selectedCompanyName = companySelect.options[companySelect.selectedIndex].text;
console.log(`Selected Company Name: ${selectedCompanyName}`);
if (selectedCompanyName !== "Select") {
try {
const response = await fetch(`/api/company_id?company_name=${encodeURIComponent(selectedCompanyName)}`);
if (!response.ok) {
throw new Error('Network response was not ok');
}
const data = await response.json();
console.log(`Company ID: ${data.company_id}`);
const companyId = data.company_id;
document.getElementById('company_id').value = companyId;
if (companyId) {
try {
const connectorsResponse = await fetch(`/api/check_data_connectors?company_id=${companyId}&company_name=${selectedCompanyName}`);
if (!connectorsResponse.ok) {
throw new Error('data connector Network response was not ok');
}
const connectorsData = await connectorsResponse.json();
//setMultiSelectValues(document.getElementById('database'), connectorsData.databasetype); // Ensure this is an array
//setMultiSelectValues(document.getElementById('databaseName'), connectorsData.database_name); // Ensure this is an array
document.getElementById('database').value = connectorsData.databasetype;
document.getElementById('server').value = connectorsData.serverip;
document.getElementById('port').value = connectorsData.port;
document.getElementById('databaseName').value = connectorsData.database_name;
document.getElementById('username').value = connectorsData.username;
document.getElementById('password').value = connectorsData.password;
document.getElementById('tables').value = connectorsData.dbtablename;
databaseconnectorForm.style.display = 'block';
} catch (error) {
document.getElementById('database').value = " ";
document.getElementById('server').value = " ";
document.getElementById('port').value = " ";
document.getElementById('databaseName').value = " ";
document.getElementById('username').value = " ";
document.getElementById('password').value = " ";
document.getElementById('tables').value = " ";
console.error('Error fetching data from data connectors:', error);
("Company name does not exist. Please fill in the details.");
// Optionally, you can insert a message into the DOM
const messageContainer = document.getElementById('message-container');
if (messageContainer) {
messageContainer.innerHTML = "<div class='alert alert-danger'>Database details does not exist for this Company name.. Please fill in the details.</div>";
}
databaseconnectorForm.style.display = 'block';
}
} else {
console.log(`Company ID does not exist, you can create and save data: ${data.company_id}`);
databaseconnectorForm.style.display = 'none';
}
} catch (error) {
console.error('Error fetching company ID or data connectors:', error);
databaseconnectorForm.style.display = 'none';
}
} else {
databaseconnectorForm.style.display = 'none';
}
});
document.getElementById("connectBtn").addEventListener("click", function (event) {
var database = document.getElementById("database").value;
var server = document.getElementById("server").value;
var port = document.getElementById("port").value;
var databaseName = document.getElementById("databaseName").value;
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
if (!database || !server || !port || !databaseName || !username || !password) {
alert("Please fill in all required fields.");
return;
}
document.getElementById("schema-table-section").style.display = "block";
});
document.getElementById("saveBtn").addEventListener("click", function (event) {
var tables = Array.from(document.getElementById("tables").selectedOptions).map(option => option.value);
if (tables.length === 0) {
alert("Please select at least one table.");
return;
}
var selectedTables = document.getElementById("selectedTables");
selectedTables.value = tables.join(", ");
selectedTables.style.display = "block";
document.getElementById("labelselected").style.display = "block";
document.getElementById("saveBtn1").style.display = "block";
});
});
async function fetchCompanies() {
try {
const response = await fetch('/api/companies');
if (!response.ok) {
throw new Error('Network response was not ok');
}
const data = await response.json();
displayCompanies(data.companies);
} catch (error) {
console.error('Error fetching companies:', error);
}
}
function displayCompanies(companies) {
const companySelect = document.getElementById('company');
companySelect.innerHTML = '<option value="" selected>Select</option>'; // Reset the dropdown
companies.forEach(company => {
const option = document.createElement('option');
option.value = company.name;
option.textContent = company.name;
companySelect.appendChild(option);
});
}
function setMultiSelectValues(selectElement, values) {
// Ensure values is an array
if (!Array.isArray(values)) {
values = [values];
}
Array.from(selectElement.options).forEach(option => {
option.selected = values.includes(option.value);
});
}
</script>
</body>
</html>1234567891011121314151617181920212223242526<!-- footer.html -->
<!--
This is the HTML code for the footer section of a web page.
It displays the version number and copyright information.
HTML Structure:
- The footer element has a class of "main-footer".
- Inside the footer, there is a div element with classes "float-right" and "d-none d-sm-block".
- Inside the div, there is a bold tag (<b>) displaying the version number.
- After the div, there is a strong tag (<strong>) displaying the copyright information.
- The copyright information includes the year and a link to the company's website.
Example Usage:
<footer class="main-footer">
<div class="float-right d-none d-sm-block">
<b>Version</b> 3.0.5
</div>
<strong>© 2023 <a href="https://yourcompany.com">Your Company</a>.</strong> All rights reserved.
</footer>
-->
<footer class="main-footer" style="position: absolute; bottom: 0; width: 100%; color: black; text-align: right; padding-right:245px ;">
<div class="container-fluid">
<a href="https://redmindtechnologies.com" target="_blank" style="color: black; text-decoration: none;">Visit Redmind Technologies at https://redmindtechnologies.com</a>
</div>
</footer>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103<!--
This is the login page template for the RedMindGPT application.
It contains a login form where users can enter their username and password to sign in.
The form includes validation to ensure that both fields are filled out before submission.
The page also includes styling using CSS and utilizes the AdminLTE and Font Awesome libraries for additional design elements.
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
/* CSS styles for the login page */
.login-box-msg {
color: grey;
font-size: larger;
font-weight: bold;
}
.remember-me {
text-align: center;
}
</style>
<title>RedMindGPT</title>
<!-- AdminLTE CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/admin-lte@3.1/dist/css/adminlte.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
</head>
<body class="hold-transition login-page" style="background-image: url('static/img/AI.jpg'); background-size: cover;">
<div class="login-box">
<div class="card">
<!-- Logo -->
<div style="align-items: center;">
<a href="#" style="color: blue;
font-size: 30px;
font-weight: bold;
margin-left: 80px;
margin-top: 20px;
"><b>RedMindGPT</b></a>
</div>
<form action='/validate-user' name='loginForm' method="post" onsubmit="return validateForm()">
<div class="card-body login-card-body">
<p class="login-box-msg">Sign in</p>
<div class="input-group mb-3">
<input type="text" class="form-control" placeholder="Username" name="username" required>
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-user"></span>
</div>
</div>
</div>
<div class="input-group mb-3">
<input type="password" class="form-control" placeholder="Password" name="password" required>
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-lock"></span>
</div>
</div>
</div>
<div class="row" style="align-content: center;">
<div class="col-8">
<div class="icheck-primary">
<input type="checkbox" id="remember">
<label for="remember">
Remember Me
</label>
</div>
</div>
</div>
<div class="row" style="align-content: center;">
<div class="col-4">
<button type="submit" class="btn btn-primary btn-block">Sign In</button>
</div>
<div class="col-4">
<button type="reset" class="btn btn-secondary btn-block">Clear</button>
</div>
</div>
</div>
</form>
</div>
</div>
<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<!-- Bootstrap 4 -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<script src="https://cdn.jsdelivr.net/npm/admin-lte@3.1/dist/js/adminlte.min.js"></script>
<script>
// JavaScript function to validate the login form
function validateForm() {
//alert("Validating form");
var username = document.forms["loginForm"]["username"].value;
var password = document.forms["loginForm"]["password"].value;
if (username == "" || password == "") {
alert("Username and Password must be filled out");
return false;
}
}
</script>
</body>
</html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360<!DOCTYPE html>
<html>
<head>
<title>Knowledge Base</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<!-- Include AdminLTE CSS -->
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/admin-lte@3.1/dist/css/adminlte.min.css">
<!-- Include DataTables CSS -->
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
<!-- Include AdminLTE JS -->
<script src="https://cdn.jsdelivr.net/npm/admin-lte@3.1/dist/js/adminlte.min.js"></script>
<!-- Include DataTables JS -->
<script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.25/js/dataTables.bootstrap4.min.js"></script>
<style>
body {
background-color: transparent !important;
}
.content-wrapper {
background-color: transparent !important;
text-align: center;
}
.wrapper {
background-color: transparent !important;
}
.modal-content {
background-color: #fff;
}
h1 {
text-align: center;
margin-bottom: 30px;
}
/* Adjust table width to full container width */
.card-body {
padding: 0;
}
.table {
width: 100%;
}
.text-wrap {
white-space: normal !important;
word-break: break-word;
}
.center-align {
padding-top: 20px;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
}
.reduced-width {
width: 50%;
/* Adjust the percentage as needed */
}
</style>
</head>
<body>
{% include 'sidepane.html' %}
<div class="wrapper" style="position: relative; top: 0;">
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="container mt-2">
<h1 class="m-0 text-center" style="flex-grow: 1;">Knowledge Base</h1>
<div class="form-group center-align">
<label for="company" class="mr-2">Company Name <span class="text-danger">*</span></label>
<select type="text" id="company" name="company" class="form-control reduced-width" required>
<option value="" selected>Select</option>
</select>
</div>
</div>
</div>
</div>
<section class="content" id="contentSection" style="display: none;">
<div class="container-fluid">
<div class="form-group">
<!-- <label for="company_id">company_id</label>--->
<input type="hidden" id="company_id" name="company_id" class="form-control" required>
</div>
<div class="row">
<div class="col-12 d-flex justify-content-end mb-3">
<button class="btn btn-primary" id="add">Add</button>
</div>
<div class="row mb-2">
<div class="col-12">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="table-responsive">
<div id="message-container">
<table id="knowledgeTable" class="table table-bordered table-striped">
<thead>
<tr>
<th>Sno</th>
<th>Document Name</th>
<th>Document Description</th>
<th>Document Version</th>
<th>VectorDB Flag</th>
<th>View</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>NewAge eWMS BusinessRequirementsDocument_V1.9 - Inbound
</td>
<td>GRN Inbound</td>
<td>1.9</td>
<td>Yes</td>
<td>
<button class="btn btn-primary viewButton">View</button>
</td>
</tr>
<tr>
<td>2</td>
<td>NewAge eWMS BusinessRequirementsDocument_V2.3 - Inbound
</td>
<td>GRN Inbound</td>
<td>2.3</td>
<td>No</td>
<td>
<button class="btn btn-primary viewButton">View</button>
</td>
</tr>
<tr>
<td>3</td>
<td>NewAge eWMS BusinessRequirementsDocument_V1.9 - Outbound
</td>
<td>GRN Outbound</td>
<td>1.9</td>
<td>Yes</td>
<td>
<button class="btn btn-primary viewButton">View</button>
</td>
</tr>
<tr>
<td>4</td>
<td class="text-wrap">NewAge eWMS
BusinessRequirementsDocument_V2.2 - Outbound</td>
<td>ASN Outbound</td>
<td>2.2</td>
<td>No</td>
<td>
<button class="btn btn-primary viewButton">View</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addModalLabel">Add Document</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<!-- <label for="company_id">company_id</label>--->
<input type="hidden" id="company_id" name="company_id" class="form-control" required>
</div>
<form id="documentForm">
<div class="form-group">
<label for="uploadFile">Upload File<span class="text-danger">*</span></label>
<input type="file" class="form-control-file" id="uploadFile" name="uploadFile" required accept=".pdf,.doc,.docx">
<small class="form-text text-muted">Accepted formats: .pdf, .doc, .docx</small>
</div>
<div class="form-group">
<label for="documentName">Document Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="documentName" name="documentName" required>
</div>
<div class="form-group">
<label for="documentDescription">Document Description<span class="text-danger">*</span></label>
<textarea class="form-control" id="documentDescription" name="documentDescription"
rows="3" required></textarea>
</div>
<div class="form-group">
<label for="department">Department<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="department" name="department" required>
</div>
<div class="form-group">
<label for="version">Version<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="version" name="version" required>
</div>
<div class="form-group">
<label for="lastUpdated">Last Updated<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="lastUpdated" name="lastUpdated" required>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" id="save" onclick="save_file()" class="btn btn-primary">Save</button>
</div>
</div>
</div>
</div>
</div>
<!-- JavaScript to handle modal display -->
<script>
document.addEventListener("DOMContentLoaded", function () {
now = new Date().toISOString().substr(0, 10);
document.getElementById('lastUpdated').value = now
// clearFormFields();
});
document.addEventListener('DOMContentLoaded', function () {
fetchCompanies();
const companySelect = document.getElementById('company');
const documentForm = document.getElementById('documentForm');
companySelect.addEventListener('change', async function () {
const selectedCompanyName = companySelect.options[companySelect.selectedIndex].text;
console.log(`Selected Company Name: ${selectedCompanyName}`);
if (selectedCompanyName !== "Select") {
try {
const response = await fetch(`/api/company_id?company_name=${encodeURIComponent(selectedCompanyName)}`);
if (!response.ok) {
contentSection.style.display='none';
const messageContainer = document.getElementById('message-container');
if (messageContainer) {
messageContainer.innerHTML = "<div class='alert alert-danger'>Document details do not exist for this company. Please fill in the details.</div>";
}
throw new Error('Network response was not ok');
}
const data = await response.json();
console.log(`Company ID: ${data.company_id}`);
const companyId = data.company_id;
document.getElementById('company_id').value = companyId;
if (companyId) {
contentSection.style.display = 'block';
}
} catch (error) {
console.error('Error fetching company ID or data documents:', error);
documentForm.style.display = 'none';
}
} else {
//clearFormFields();
documentForm.style.display = 'block';
}
});
});
function clearFormFields() {
document.getElementById('uploadFile').value = "";
document.getElementById('documentName').value = "";
document.getElementById('documentDescription').value = "";
document.getElementById('department').value = "";
document.getElementById('version').value = "";
//document.getElementById('lastUpdated').value = "";
}
$(document).ready(function () {
// Show modal function
$('#add').on('click', function () {
clearFormFields();
$('#addModal').modal('show');
});
$('.modal-footer .btn-secondary').on('click', function () {
$('#addModal').modal('hide');
});
// Your save file function here
// async function save_file() {
// alert('Save button clicked');
// // Your save file logic goes here
// }
});
function save_file() {
const uploadFile = document.getElementById("uploadFile").files[0];
const documentName = document.getElementById("documentName").value;
const documentDescription = document.getElementById("documentDescription").value;
const department = document.getElementById("department").value;
const version = document.getElementById("version").value;
const lastUpdated = document.getElementById("lastUpdated").value;
const company_id = document.getElementById("company_id").value;
const formData = new FormData();
formData.append("uploadFile", uploadFile);
formData.append("documentName", documentName);
formData.append("documentDescription", documentDescription);
formData.append("department", department);
formData.append("version", version);
formData.append("lastUpdated", lastUpdated);
formData.append("company_id", company_id);
fetch('/upload_document', {
method: 'POST',
body: formData
})
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.text();
})
.then(data => {
alert('Document saved successfully');
// $('#addModal').modal('hide');
})
.catch(error => console.error('Error:', error));
}
async function fetchCompanies() {
try {
const response = await fetch('/api/companies');
if (!response.ok) {
throw new Error('Network response was not ok');
}
const data = await response.json();
displayCompanies(data.companies);
} catch (error) {
console.error('Error fetching companies:', error);
}
}
function displayCompanies(companies) {
const companySelect = document.getElementById('company');
companySelect.innerHTML = '<option value="" selected>Select</option>'; // Reset the dropdown
companies.forEach(company => {
const option = document.createElement('option');
option.value = company.name;
option.textContent = company.name;
companySelect.appendChild(option);
});
}
</script>
</body>
</html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224<!DOCTYPE html>
<html>
<head>
<title>Prompt Template</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<!-- Include AdminLTE CSS -->
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/admin-lte@3.1/dist/css/adminlte.min.css">
<!-- Include DataTables CSS -->
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
<style>
.header-row {
display: flex;
justify-content: space-between;
align-items: center;
}
h2 {
text-align: center;
}
.table-container {
width: 100%;
overflow-x: auto;
}
.wrapper {
display: flex;
flex-direction: column;
height: 100vh;
}
.content-wrapper {
flex: 1;
overflow-y: auto;
}
.content-header {
padding: 1rem;
}
.footer {
text-align: right;
padding: 10px;
}
th,
td {
white-space: nowrap;
}
th:nth-child(1),
td:nth-child(1) {
/* Sno column */
width: 3%;
}
th:nth-child(2),
td:nth-child(2) {
/* API Name column */
width: 20%;
}
th:nth-child(3),
td:nth-child(3) {
/* API Endpoint column */
width: 40%;
}
th:nth-child(4),
td:nth-child(4) {
/* Auth/Bearer token column */
width: 20%;
}
th:nth-child(5),
td:nth-child(5) {
/* View column */
width: 15%;
}
</style>
</head>
<body>
{% include 'sidepane.html' %}
<div class="wrapper">
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-12">
<div class="header-row">
<h2 class="m-0 text-center" style="flex-grow: 1;">Prompt Template</h2>
<button class="btn btn-primary" id="add">Add</button>
</div>
</div>
</div>
</div>
</div>
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body table-container">
<table id="knowledgeTable" class="table table-bordered table-striped">
<thead>
<tr>
<th>Sno</th>
<th>Scenario</th>
<th>Sample Prompt</th>
<th>Comments</th>
<th>View</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Creating new database in mysql</td>
<td>Need DB step for mysql with DB name = wwp, table name = customer_master with column name = name as datatype = string. (sample prompt).</td>
<td>It didn't create database instead its showed how to make connection to database and create table.</td>
<td><button class="btn btn-primary viewButton">View</button></td>
</tr>
<tr>
<td>2</td>
<td>Creating data table with columns</td>
<td>Since you are an EXPERT in PHP, i want a code for an entity/configuration of table name called customer_Master. this table should be created inside database wwp which is in file database_connection.php. now, in that table customer_master i want to add columns. the column names and datatypes are given below:</td>
<td>Expected response but adminlte theme was missing.</td>
<td><button class="btn btn-primary viewButton">View</button></td>
</tr>
<tr>
<td>3</td>
<td>Creating home page with adminlte theme.</td>
<td>I have created a new file named admintle_theme.php. I want this file filled with "ADMINLTE" theme. it should have a login/signup functionality and home button along with dashboard.
example: https://adminlte.io/themes/v3/index3.html
use this example for theme/html page. recreate it exactly like that
.image.png
</td>
<td>It created a html page but lacked side bar, nav bar present in url.
</td>
<td><button class="btn btn-primary viewButton">View</button></td>
</tr>
<tr>
<td>4</td>
<td>Including side bar menu in customer master</td>
<td>I want the side bar menu from admintle_theme to be present in customer_configuration.php</td>
<td>It gave expected results.
</td>
<td><button class="btn btn-primary viewButton">View</button></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addModalLabel">Add Prompt</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="addPromptForm">
<div class="form-group">
<label for="APIName">Scenario <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="APIName" name="APIName" required>
</div>
<div class="form-group">
<label for="APIEndpoint">Sample Prompt <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="APIEndpoint" name="APIEndpoint" required>
</div>
<div class="form-group">
<label for="Auth_Bearer">Comments <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="Auth_Bearer" name="Auth_Bearer" required>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" id="save" onclick="save_file()" class="btn btn-primary">Save</button>
</div>
</div>
</div>
</div>
<!-- Include DataTables JS and your custom script -->
<script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.25/js/dataTables.bootstrap4.min.js"></script>
<script>
$(document).ready(function () {
// Initialize DataTable
$('#knowledgeTable').DataTable();
// Show modal function
$('#add').on('click', function () {
$('#addModal').modal('show');
});
// Your save file function here
function save_file() {
alert('Save button clicked');
// Your save file logic goes here
}
});
</script>
</body>
</html>1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495<!-- sidepane.html -->
<!-- This file represents the sidepane component of a web application. It contains the navigation menu and sidebar. -->
<nav class="main-header navbar navbar-expand navbar-white navbar-light" style="text-align: center;">
<div class="container-fluid d-flex justify-content-center align-items-center">
<img src="..\static\img\redmindlogo3.jpg" alt="Logo" style="width: 80px; height: auto; margin-right: 10px;">
<h2 style="text-align: center; margin-bottom: 0;">Redmind GPT</h2>
</div>
<!-- Left navbar links -->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
</li>
</ul>
</nav>
<!-- Main Sidebar Container -->
<aside class="main-sidebar sidebar-dark-primary elevation-4" style="width: 200px;">
<!-- Sidebar -->
<div class="sidebar">
<!-- Sidebar Menu -->
<nav class="mt-2">
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
<!-- Navigation Links -->
<li class="nav-item">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-home"></i>
<p>Dashboard</p>
</a>
</li>
<li class="nav-item">
<a href="{{ url_for('company_profile') }}" class="nav-link">
<i class="nav-icon fas fa-users"></i>
<p>Company Profile</p>
</a>
</li>
<li class="nav-item">
<a href="{{ url_for('knowledgebase') }}" class="nav-link">
<i class="nav-icon fas fa-cogs"></i>
<p>KnowledgeBase</p>
</a>
</li>
<li class="nav-item">
<a href="{{ url_for('data_connectors') }}" class="nav-link">
<i class="nav-icon fas fa-home"></i>
<p>Data Connectors</p>
</a>
</li>
<li class="nav-item">
<a href="{{ url_for('API_connectors') }}" class="nav-link">
<i class="nav-icon fas fa-users"></i>
<p>API Connectors</p>
</a>
</li>
<li class="nav-item">
<a href="{{url_for('prompt_template')}}" class="nav-link">
<i class="nav-icon fas fa-cogs"></i>
<p>Prompt Templates</p>
</a>
</li>
<!--<li class="nav-item">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-cogs"></i>
<p>LLM Settings</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="#" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Sublink 1</p>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Sublink 2</p>
</a>
</li>
<!-- Add more sublinks here -->
</ul>
</li> -->
<!-- Add more navigation links here -->
</ul>
</nav>
<!-- /.sidebar-menu -->
</div>
<!-- /.sidebar -->
</aside>
<!-- AdminLTE JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/admin-lte/3.1.0/js/adminlte.min.js"></script>templates/API_connectors.htmlDeleted-228
templates/chatbot.htmlDeleted-81
templates/company_profile.htmlDeleted-190
templates/dashboard.htmlDeleted-156
templates/data_connectors.htmlDeleted-368
templates/footer.htmlDeleted-26
templates/index.htmlDeleted-103
templates/knowledgebase.htmlDeleted-360
templates/prompt_template.htmlDeleted-224
templates/redmindlogo2.jpgDeleted
templates/redmindlogo3.jpgDeleted
templates/sidepane.htmlDeleted-95
templates/templates/API_connectors.htmlDeleted-228
templates/templates/chatbot.htmlDeleted-81
templates/templates/company_profile.htmlDeleted-185
templates/templates/dashboard.htmlDeleted-156
templates/templates/data_connectors.htmlDeleted-368
templates/templates/footer.htmlDeleted-26
templates/templates/index.htmlDeleted-103
templates/templates/knowledgebase.htmlDeleted-360
templates/templates/prompt_template.htmlDeleted-224
templates/templates/redmindlogo2.jpgDeleted
templates/templates/redmindlogo3.jpgDeleted
templates/templates/sidepane.htmlDeleted-95