Spaces:
Runtime error
Runtime error
Upload 24 files
Browse files- templates/API_connectors.html +228 -0
- templates/chatbot.html +81 -0
- templates/company_profile.html +185 -0
- templates/dashboard.html +156 -0
- templates/data_connectors.html +368 -0
- templates/footer.html +26 -0
- templates/index.html +103 -0
- templates/knowledgebase.html +360 -0
- templates/prompt_template.html +224 -0
- templates/redmindlogo2.jpg +0 -0
- templates/redmindlogo3.jpg +0 -0
- templates/sidepane.html +95 -0
- templates/templates/API_connectors.html +228 -0
- templates/templates/chatbot.html +81 -0
- templates/templates/company_profile.html +185 -0
- templates/templates/dashboard.html +156 -0
- templates/templates/data_connectors.html +368 -0
- templates/templates/footer.html +26 -0
- templates/templates/index.html +103 -0
- templates/templates/knowledgebase.html +360 -0
- templates/templates/prompt_template.html +224 -0
- templates/templates/redmindlogo2.jpg +0 -0
- templates/templates/redmindlogo3.jpg +0 -0
- templates/templates/sidepane.html +95 -0
templates/API_connectors.html
ADDED
@@ -0,0 +1,228 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html>
|
3 |
+
|
4 |
+
<head>
|
5 |
+
<title>API Connectors</title>
|
6 |
+
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
7 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
|
8 |
+
<!-- Include AdminLTE CSS -->
|
9 |
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/adminlte.min.css">
|
10 |
+
<!-- Include DataTables CSS -->
|
11 |
+
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
|
12 |
+
<style>
|
13 |
+
.header-row {
|
14 |
+
display: flex;
|
15 |
+
justify-content: space-between;
|
16 |
+
align-items: center;
|
17 |
+
}
|
18 |
+
|
19 |
+
h2 {
|
20 |
+
text-align: center;
|
21 |
+
}
|
22 |
+
|
23 |
+
.table-container {
|
24 |
+
width: 100%;
|
25 |
+
overflow-x: auto;
|
26 |
+
}
|
27 |
+
|
28 |
+
.wrapper {
|
29 |
+
display: flex;
|
30 |
+
flex-direction: column;
|
31 |
+
height: 100vh;
|
32 |
+
}
|
33 |
+
|
34 |
+
.content-wrapper {
|
35 |
+
flex: 1;
|
36 |
+
overflow-y: auto;
|
37 |
+
}
|
38 |
+
|
39 |
+
.content-header {
|
40 |
+
padding: 1rem;
|
41 |
+
}
|
42 |
+
|
43 |
+
.footer {
|
44 |
+
text-align: right;
|
45 |
+
padding: 10px;
|
46 |
+
}
|
47 |
+
|
48 |
+
th,
|
49 |
+
td {
|
50 |
+
white-space: nowrap;
|
51 |
+
}
|
52 |
+
|
53 |
+
th:nth-child(1),
|
54 |
+
td:nth-child(1) {
|
55 |
+
/* Sno column */
|
56 |
+
width: 5%;
|
57 |
+
}
|
58 |
+
|
59 |
+
th:nth-child(2),
|
60 |
+
td:nth-child(2) {
|
61 |
+
/* API Name column */
|
62 |
+
width: 20%;
|
63 |
+
}
|
64 |
+
|
65 |
+
th:nth-child(3),
|
66 |
+
td:nth-child(3) {
|
67 |
+
/* API Endpoint column */
|
68 |
+
width: 40%;
|
69 |
+
}
|
70 |
+
|
71 |
+
th:nth-child(4),
|
72 |
+
td:nth-child(4) {
|
73 |
+
/* Auth/Bearer token column */
|
74 |
+
width: 20%;
|
75 |
+
}
|
76 |
+
|
77 |
+
th:nth-child(5),
|
78 |
+
td:nth-child(5) {
|
79 |
+
/* View column */
|
80 |
+
width: 15%;
|
81 |
+
}
|
82 |
+
</style>
|
83 |
+
</head>
|
84 |
+
|
85 |
+
<body>
|
86 |
+
{% include 'sidepane.html' %}
|
87 |
+
|
88 |
+
<div class="wrapper">
|
89 |
+
<div class="content-wrapper">
|
90 |
+
<!-- Content Header (Page header) -->
|
91 |
+
<div class="content-header">
|
92 |
+
<div class="container-fluid">
|
93 |
+
<div class="row mb-2">
|
94 |
+
<div class="col-12">
|
95 |
+
<div class="header-row">
|
96 |
+
<h2 class="m-0 text-center" style="flex-grow: 1;">API Connectors</h2>
|
97 |
+
<button class="btn btn-primary" id="add">Add</button>
|
98 |
+
</div>
|
99 |
+
</div>
|
100 |
+
</div>
|
101 |
+
</div>
|
102 |
+
</div>
|
103 |
+
<!-- Main content -->
|
104 |
+
<section class="content">
|
105 |
+
<div class="container-fluid">
|
106 |
+
<div class="row">
|
107 |
+
<div class="col-12">
|
108 |
+
<div class="card">
|
109 |
+
<div class="card-body table-container">
|
110 |
+
<table id="knowledgeTable" class="table table-bordered table-striped">
|
111 |
+
<thead>
|
112 |
+
<tr>
|
113 |
+
<th>Sno</th>
|
114 |
+
<th>API Name</th>
|
115 |
+
<th>API Endpoint</th>
|
116 |
+
<th>View</th>
|
117 |
+
</tr>
|
118 |
+
</thead>
|
119 |
+
<tbody>
|
120 |
+
<tr>
|
121 |
+
<td>1</td>
|
122 |
+
<td>Warehouse</td>
|
123 |
+
<td>http://193.203.162.39:9090/nxt-wms/userWarehouse/fetchWarehouseForUserId
|
124 |
+
</td>
|
125 |
+
<td><button class="btn btn-primary viewButton">View</button></td>
|
126 |
+
</tr>
|
127 |
+
<tr>
|
128 |
+
<td>2</td>
|
129 |
+
<td>customer</td>
|
130 |
+
<td>http://193.203.162.39:9090/nxt-wms/userCustomer/fetchCustomerForUserId
|
131 |
+
</td>
|
132 |
+
<td><button class="btn btn-primary viewButton">View</button></td>
|
133 |
+
</tr>
|
134 |
+
<tr>
|
135 |
+
<td>3</td>
|
136 |
+
<td>SKU</td>
|
137 |
+
<td>http://193.203.162.39:9090/nxt-wms/sku/autoComplete?</td>
|
138 |
+
<td><button class="btn btn-primary viewButton">View</button></td>
|
139 |
+
</tr>
|
140 |
+
<tr>
|
141 |
+
<td>4</td>
|
142 |
+
<td>ASN</td>
|
143 |
+
<td>http://193.203.162.39:9090/nxt-wms/trnHeader</td>
|
144 |
+
<td><button class="btn btn-primary viewButton">View</button></td>
|
145 |
+
</tr>
|
146 |
+
</tbody>
|
147 |
+
</table>
|
148 |
+
</div>
|
149 |
+
</div>
|
150 |
+
</div>
|
151 |
+
</div>
|
152 |
+
</div>
|
153 |
+
</section>
|
154 |
+
</div>
|
155 |
+
|
156 |
+
</div>
|
157 |
+
|
158 |
+
<!-- Modal -->
|
159 |
+
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel"
|
160 |
+
aria-hidden="true">
|
161 |
+
<div class="modal-dialog" role="document">
|
162 |
+
<div class="modal-content">
|
163 |
+
<div class="modal-header">
|
164 |
+
<h5 class="modal-title" id="addModalLabel">Add Document</h5>
|
165 |
+
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
166 |
+
<span aria-hidden="true">×</span>
|
167 |
+
</button>
|
168 |
+
</div>
|
169 |
+
<div class="modal-body">
|
170 |
+
<form>
|
171 |
+
<div class="form-group">
|
172 |
+
<label for="APIName">API Name <span class="text-danger">*</span></label>
|
173 |
+
<input type="text" class="form-control" id="APIName" name="APIName" required>
|
174 |
+
</div>
|
175 |
+
<div class="form-group">
|
176 |
+
<label for="APIEndpoint">API Endpoint <span class="text-danger">*</span></label>
|
177 |
+
<input type="text" class="form-control" id="APIEndpoint" name="APIEndpoint" required>
|
178 |
+
</div>
|
179 |
+
<div class="form-group">
|
180 |
+
<label for="Auth_Bearer">Auth/Bearer token <span class="text-danger">*</span></label>
|
181 |
+
<input type="text" class="form-control" id="Auth_Bearer" name="Auth_Bearer" required>
|
182 |
+
</div>
|
183 |
+
<div class="form-group">
|
184 |
+
<label for="Inputjson">Input parameter <span class="text-danger">*</span></label>
|
185 |
+
<input type="text" class="form-control" id="Inputjson" name="Inputjson" required>
|
186 |
+
</div>
|
187 |
+
<div class="form-group">
|
188 |
+
<label for="OutputJson">Output Json <span class="text-danger">*</span></label>
|
189 |
+
<input type="text" class="form-control" id="OutputJson" name="OutputJson" required>
|
190 |
+
</div>
|
191 |
+
<div class="form-group">
|
192 |
+
<label for="Description">Description <span class="text-danger">*</span></label>
|
193 |
+
<textarea class="form-control" id="Description" name="Description" rows="3"
|
194 |
+
required></textarea>
|
195 |
+
</div>
|
196 |
+
</form>
|
197 |
+
</div>
|
198 |
+
<div class="modal-footer">
|
199 |
+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
200 |
+
<button type="button" id="save" onclick="save_file()" class="btn btn-primary">Save</button>
|
201 |
+
</div>
|
202 |
+
</div>
|
203 |
+
</div>
|
204 |
+
</div>
|
205 |
+
|
206 |
+
<!-- Include DataTables JS and your custom script -->
|
207 |
+
<script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
|
208 |
+
<script src="https://cdn.datatables.net/1.10.25/js/dataTables.bootstrap4.min.js"></script>
|
209 |
+
<script>
|
210 |
+
$(document).ready(function () {
|
211 |
+
// Initialize DataTable
|
212 |
+
$('#knowledgeTable').DataTable();
|
213 |
+
|
214 |
+
// Show modal function
|
215 |
+
$('#add').on('click', function () {
|
216 |
+
$('#addModal').modal('show');
|
217 |
+
});
|
218 |
+
|
219 |
+
// Your save file function here
|
220 |
+
async function save_file() {
|
221 |
+
alert('Save button clicked');
|
222 |
+
// Your save file logic goes here
|
223 |
+
}
|
224 |
+
});
|
225 |
+
</script>
|
226 |
+
</body>
|
227 |
+
|
228 |
+
</html>
|
templates/chatbot.html
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# jinja2 html page with chatbot functionality using adminlte3 theme
|
2 |
+
<html>
|
3 |
+
<body>
|
4 |
+
<form id="myform">
|
5 |
+
<div class="content-wrapper">
|
6 |
+
<section class="content-header">
|
7 |
+
<div class="container-fluid">
|
8 |
+
<div class="row mb-2">
|
9 |
+
<div class="col-sm-6">
|
10 |
+
<h1>Chatbot</h1>
|
11 |
+
</div>
|
12 |
+
<div class="col-sm-6">
|
13 |
+
<ol class="breadcrumb float-sm-right">
|
14 |
+
<li class="breadcrumb-item"><a href="#">Home</a></li>
|
15 |
+
<li class="breadcrumb-item active">Chatbot</li>
|
16 |
+
</ol>
|
17 |
+
</div>
|
18 |
+
</div>
|
19 |
+
</div>
|
20 |
+
</section>
|
21 |
+
|
22 |
+
<section class="content">
|
23 |
+
<div class="container-fluid">
|
24 |
+
<div class="row">
|
25 |
+
<div class="col-md-8 offset-md-2">
|
26 |
+
<div class="card card-primary">
|
27 |
+
<div class="card-header">
|
28 |
+
<h3 class="card-title">Chat with our AI</h3>
|
29 |
+
</div>
|
30 |
+
<div class="card-body">
|
31 |
+
<div id="chat-container">
|
32 |
+
<div class="chat-messages">
|
33 |
+
<!-- Chat messages will be dynamically added here -->
|
34 |
+
</div>
|
35 |
+
<div class="chat-input">
|
36 |
+
<input type="text" id="user_question" placeholder="Type your message...">
|
37 |
+
<button id="send-button" onclick="clickform()">Send</button>
|
38 |
+
</div>
|
39 |
+
</div>
|
40 |
+
</div>
|
41 |
+
</div>
|
42 |
+
</div>
|
43 |
+
</div>
|
44 |
+
</div>
|
45 |
+
</section>
|
46 |
+
</div>
|
47 |
+
</form>
|
48 |
+
<script>
|
49 |
+
const chatContainer = document.getElementById('chat-container');
|
50 |
+
const userInput = document.getElementById('user_question');
|
51 |
+
const sendButton = document.getElementById('send-button');
|
52 |
+
|
53 |
+
function clickform() {
|
54 |
+
alert('Please enter');
|
55 |
+
var formElement = document.getElementById('myForm');
|
56 |
+
var user_question = document.getElementById('user_question').value;
|
57 |
+
alert(user_question);
|
58 |
+
//var data = new FormData(formElement);
|
59 |
+
//alert(data);
|
60 |
+
fetch('/chat_with_agent', {
|
61 |
+
method: 'POST',
|
62 |
+
//body: data,
|
63 |
+
})
|
64 |
+
.then(resp => resp.text()) // or, resp.json(), etc.
|
65 |
+
.then(data => {
|
66 |
+
//document.getElementById("responseArea").innerHTML = data;
|
67 |
+
alert(data);
|
68 |
+
const chatMessage = document.createElement('div');
|
69 |
+
chatMessage.classList.add('chat-message');
|
70 |
+
chatMessage.innerHTML = '<strong>You:</strong> ${user_question}<br><strong>AI:</strong> ${data}';
|
71 |
+
chatContainer.appendChild(chatMessage);
|
72 |
+
|
73 |
+
userInput.value = '';
|
74 |
+
userInput.focus();
|
75 |
+
})
|
76 |
+
.catch(error => {
|
77 |
+
console.error(error);
|
78 |
+
});
|
79 |
+
}
|
80 |
+
</script>
|
81 |
+
</body></html>
|
templates/company_profile.html
ADDED
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
|
4 |
+
<head>
|
5 |
+
<meta charset="UTF-8">
|
6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7 |
+
<title>Company Profile</title>
|
8 |
+
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
9 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
|
10 |
+
<!-- Include AdminLTE CSS -->
|
11 |
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/adminlte.min.css">
|
12 |
+
<!-- Include DataTables CSS -->
|
13 |
+
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
|
14 |
+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css" rel="stylesheet" />
|
15 |
+
<link href="https://cdn.jsdelivr.net/npm/@ttskch/[email protected]/dist/select2-bootstrap4.min.css"
|
16 |
+
rel="stylesheet" />
|
17 |
+
|
18 |
+
<style>
|
19 |
+
.container {
|
20 |
+
margin-top: 10px;
|
21 |
+
margin-left: 420px;
|
22 |
+
align-items: center;
|
23 |
+
max-width: 600px;
|
24 |
+
padding: 10px;
|
25 |
+
border: 1px solid #ccc;
|
26 |
+
border-radius: 5px;
|
27 |
+
position: relative;
|
28 |
+
z-index: 1;
|
29 |
+
}
|
30 |
+
|
31 |
+
.container::before {
|
32 |
+
content: '';
|
33 |
+
position: absolute;
|
34 |
+
top: 50%;
|
35 |
+
left: 40%;
|
36 |
+
background: url('..\static\img\redmindlogo3.jpg') no-repeat center center;
|
37 |
+
background-size: contain;
|
38 |
+
opacity: 0.1;
|
39 |
+
width: 100%;
|
40 |
+
height: 90%;
|
41 |
+
z-index: -1;
|
42 |
+
}
|
43 |
+
|
44 |
+
.form-group {
|
45 |
+
margin-bottom: 5px;
|
46 |
+
}
|
47 |
+
|
48 |
+
.form-group label {
|
49 |
+
font-weight: bold;
|
50 |
+
margin-bottom: 5px;
|
51 |
+
display: block;
|
52 |
+
}
|
53 |
+
|
54 |
+
.form-group input .form-group select {
|
55 |
+
width: 100%;
|
56 |
+
padding: 10px;
|
57 |
+
border: 1px solid #ccc;
|
58 |
+
border-radius: 4px;
|
59 |
+
text-align: center;
|
60 |
+
}
|
61 |
+
|
62 |
+
.form-group select.select2-container--bootstrap4 .select2-selection--multiple {
|
63 |
+
height: auto;
|
64 |
+
/* Adjust height to fit content */
|
65 |
+
}
|
66 |
+
|
67 |
+
.btn-primary {
|
68 |
+
margin-right: 10px;
|
69 |
+
color: black;
|
70 |
+
font-size: 16px;
|
71 |
+
font-weight: bold;
|
72 |
+
}
|
73 |
+
|
74 |
+
h3 {
|
75 |
+
text-align: center;
|
76 |
+
margin-bottom: 10px;
|
77 |
+
}
|
78 |
+
|
79 |
+
.btn-container {
|
80 |
+
text-align: center;
|
81 |
+
margin-top: 10px;
|
82 |
+
color: white;
|
83 |
+
}
|
84 |
+
|
85 |
+
footer {
|
86 |
+
position: absolute;
|
87 |
+
bottom: 0;
|
88 |
+
width: 100%;
|
89 |
+
color: black;
|
90 |
+
text-align: right;
|
91 |
+
padding-right: 245px;
|
92 |
+
padding-top: 0px;
|
93 |
+
background-color: #f8f9fa;
|
94 |
+
border: none !important;
|
95 |
+
}
|
96 |
+
|
97 |
+
#llm_tools {
|
98 |
+
text-align: center;
|
99 |
+
font-weight: bold;
|
100 |
+
}
|
101 |
+
</style>
|
102 |
+
</head>
|
103 |
+
|
104 |
+
<body>
|
105 |
+
{% include 'sidepane.html' %}
|
106 |
+
<div class="container mt-4">
|
107 |
+
<h3>Company Profile</h3>
|
108 |
+
<form id="companyProfileForm" class="needs-validation" novalidate action="/submit_company_profile"
|
109 |
+
method="post">
|
110 |
+
<div class="form-group">
|
111 |
+
<label for="company_name">Company Name <span class="text-danger">*</span></label>
|
112 |
+
<input type="text" id="company_name" name="company_name" class="form-control" required>
|
113 |
+
<div class="invalid-feedback">
|
114 |
+
Please enter the company name.
|
115 |
+
</div>
|
116 |
+
</div>
|
117 |
+
<div class="form-group">
|
118 |
+
<label for="company_code">Company Code <span class="text-danger">*</span></label>
|
119 |
+
<input type="text" id="company_code" name="company_code" class="form-control" required>
|
120 |
+
<div class="invalid-feedback">
|
121 |
+
Please enter the company code.
|
122 |
+
</div>
|
123 |
+
</div>
|
124 |
+
<div class="form-group">
|
125 |
+
<label for="domain">Domain/Business <span class="text-danger">*</span></label>
|
126 |
+
<input type="text" id="domain" name="domain" class="form-control" required>
|
127 |
+
<div class="invalid-feedback">
|
128 |
+
Please enter the domain/business.
|
129 |
+
</div>
|
130 |
+
</div>
|
131 |
+
<div class="form-group">
|
132 |
+
<label for="llm_tools">LLM Tools <span class="text-danger">*</span></label>
|
133 |
+
<select type='text' id="llm_tools" name="llm_tools" class="form-control" multiple required>
|
134 |
+
<option value="Database">Database</option>
|
135 |
+
<option value="Static Documents">Static Documents</option>
|
136 |
+
<option value="API">API</option>
|
137 |
+
</select>
|
138 |
+
<div class="invalid-feedback">
|
139 |
+
Please select at least one LLM tool.
|
140 |
+
</div>
|
141 |
+
</div>
|
142 |
+
<div class="btn-container">
|
143 |
+
<button type="submit" class="btn btn-primary">Save</button>
|
144 |
+
<button type="reset" class="btn btn-primary">Clear</button>
|
145 |
+
</div>
|
146 |
+
</form>
|
147 |
+
</div>
|
148 |
+
|
149 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js"></script>
|
150 |
+
<script>
|
151 |
+
$(document).ready(function () {
|
152 |
+
// Initialize Select2 for multi-select dropdown
|
153 |
+
$('#llm_tools').select2({
|
154 |
+
theme: 'bootstrap4',
|
155 |
+
placeholder: 'Select',
|
156 |
+
allowClear: true
|
157 |
+
});
|
158 |
+
|
159 |
+
$('#companyProfileForm').on('submit', function (event) {
|
160 |
+
event.preventDefault(); // Prevent default form submission
|
161 |
+
|
162 |
+
// Gather form data
|
163 |
+
var formData = $(this).serialize();
|
164 |
+
|
165 |
+
$.ajax({
|
166 |
+
type: "POST",
|
167 |
+
url: "/submit_company_profile",
|
168 |
+
data: formData,
|
169 |
+
success: function (response) {
|
170 |
+
alert(response.message); // Show success message
|
171 |
+
setTimeout(function () {
|
172 |
+
window.location.href = '/company_profile'; // Redirect to the desired page after a delay
|
173 |
+
}, 2000); // Delay for 2 seconds (2000 milliseconds)
|
174 |
+
},
|
175 |
+
error: function (xhr) {
|
176 |
+
alert("An error occurred: " + xhr.responseJSON.detail); // Show error message
|
177 |
+
}
|
178 |
+
});
|
179 |
+
});
|
180 |
+
});
|
181 |
+
</script>
|
182 |
+
|
183 |
+
</body>
|
184 |
+
|
185 |
+
</html>
|
templates/dashboard.html
ADDED
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html>
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<title>Dashboard</title>
|
6 |
+
<!-- AdminLTE CSS -->
|
7 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/admin-lte/3.1.0/css/adminlte.min.css">
|
8 |
+
</head>
|
9 |
+
|
10 |
+
<body class="hold-transition sidebar-mini">
|
11 |
+
<div class="wrapper">
|
12 |
+
<!-- Main Sidebar -->
|
13 |
+
<aside class="main-sidebar sidebar-dark-primary elevation-4">
|
14 |
+
<!-- Sidebar -->
|
15 |
+
<div class="sidebar">
|
16 |
+
<!-- Sidebar Menu -->
|
17 |
+
<nav class="mt-2">
|
18 |
+
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
|
19 |
+
<!-- Navigation Links -->
|
20 |
+
<li class="nav-item">
|
21 |
+
<a href="#" class="nav-link">
|
22 |
+
<i class="nav-icon fas fa-home"></i>
|
23 |
+
<p>Dashboard</p>
|
24 |
+
</a>
|
25 |
+
</li>
|
26 |
+
<li class="nav-item">
|
27 |
+
<a href="{{ url_for('company_profile') }}" class="nav-link">
|
28 |
+
<i class="nav-icon fas fa-cogs"></i>
|
29 |
+
<p>Company Profile</p>
|
30 |
+
</a>
|
31 |
+
</li>
|
32 |
+
<li class="nav-item">
|
33 |
+
<a href="{{ url_for('knowledgebase') }}" class="nav-link">
|
34 |
+
<i class="nav-icon fas fa-cogs"></i>
|
35 |
+
<p>KnowledgeBase</p>
|
36 |
+
</a>
|
37 |
+
</li>
|
38 |
+
<li class="nav-item">
|
39 |
+
<a href="{{ url_for('data_connectors') }}" class="nav-link">
|
40 |
+
<i class="nav-icon fas fa-home"></i>
|
41 |
+
<p>Data Connectors</p>
|
42 |
+
</a>
|
43 |
+
</li>
|
44 |
+
<li class="nav-item">
|
45 |
+
<a href="{{ url_for('API_connectors') }}" class="nav-link">
|
46 |
+
<i class="nav-icon fas fa-users"></i>
|
47 |
+
<p>API Connectors</p>
|
48 |
+
</a>
|
49 |
+
</li>
|
50 |
+
<li class="nav-item">
|
51 |
+
<a href="{{url_for('prompt_template')}}" class="nav-link">
|
52 |
+
<i class="nav-icon fas fa-cogs"></i>
|
53 |
+
<p>Prompt Templates</p>
|
54 |
+
</a>
|
55 |
+
</li>
|
56 |
+
<!-- <li class="nav-item">
|
57 |
+
<a href="#" class="nav-link">
|
58 |
+
<i class="nav-icon fas fa-cogs"></i>
|
59 |
+
<p>LLM Settings</p>
|
60 |
+
</a>
|
61 |
+
|
62 |
+
</li>-->
|
63 |
+
<li class="nav-item">
|
64 |
+
<a href="{{ url_for('chatbot') }}" class="nav-link">
|
65 |
+
<i class="nav-icon fas fa-cogs"></i>
|
66 |
+
<p>Chat</p>
|
67 |
+
</a>
|
68 |
+
</li>
|
69 |
+
|
70 |
+
<!-- Add more navigation links here -->
|
71 |
+
</ul>
|
72 |
+
</nav>
|
73 |
+
<!-- /.sidebar-menu -->
|
74 |
+
</div>
|
75 |
+
<!-- /.sidebar -->
|
76 |
+
</aside>
|
77 |
+
|
78 |
+
<!-- Content Wrapper -->
|
79 |
+
<div class="content-wrapper">
|
80 |
+
<!-- Main content -->
|
81 |
+
<section class="content">
|
82 |
+
<!-- Project Information -->
|
83 |
+
<div class="container-fluid">
|
84 |
+
<h3 style="text-align: center; margin-bottom:40px;">RedMindGPT</h>
|
85 |
+
</div>
|
86 |
+
</section>
|
87 |
+
<section class="content">
|
88 |
+
<div class="container-fluid">
|
89 |
+
|
90 |
+
<div class="row">
|
91 |
+
<div class="col-lg-4 col-6">
|
92 |
+
|
93 |
+
<div class="small-box bg-info">
|
94 |
+
<div class="inner">
|
95 |
+
<h3>4 </h3>
|
96 |
+
<h4> KnowledgeBase</h4>
|
97 |
+
</div>
|
98 |
+
<div class="icon">
|
99 |
+
<i class="ion ion-bag"></i>
|
100 |
+
</div>
|
101 |
+
</div>
|
102 |
+
</div>
|
103 |
+
|
104 |
+
<div class="col-lg-4 col-6">
|
105 |
+
|
106 |
+
<div class="small-box bg-success">
|
107 |
+
<div class="inner">
|
108 |
+
<h3>1</h3>
|
109 |
+
<h4>Data connectors</h4>
|
110 |
+
</div>
|
111 |
+
<div class="icon">
|
112 |
+
<i class="ion ion-stats-bars"></i>
|
113 |
+
</div>
|
114 |
+
|
115 |
+
</div>
|
116 |
+
</div>
|
117 |
+
|
118 |
+
<div class="col-lg-4 col-6">
|
119 |
+
|
120 |
+
<div class="small-box bg-warning">
|
121 |
+
<div class="inner">
|
122 |
+
<h3>4 </h3>
|
123 |
+
<h4>API Connectors</h4>
|
124 |
+
</div>
|
125 |
+
<div class="icon">
|
126 |
+
<i class="ion ion-person-add"></i>
|
127 |
+
</div>
|
128 |
+
|
129 |
+
</div>
|
130 |
+
</div>
|
131 |
+
|
132 |
+
<div class="col-lg-4 col-6">
|
133 |
+
|
134 |
+
<div class="small-box bg-warning">
|
135 |
+
<div class="inner">
|
136 |
+
<h3>5 </h3>
|
137 |
+
<h4>Prompt_Templates</h4>
|
138 |
+
</div>
|
139 |
+
<div class="icon">
|
140 |
+
<i class="ion ion-person-add"></i>
|
141 |
+
</div>
|
142 |
+
|
143 |
+
</div>
|
144 |
+
</div>
|
145 |
+
<!-- /.content -->
|
146 |
+
</div>
|
147 |
+
<!-- /.content-wrapper -->
|
148 |
+
</div>
|
149 |
+
<!-- ./wrapper -->
|
150 |
+
|
151 |
+
<!-- AdminLTE JS -->
|
152 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/admin-lte/3.1.0/js/adminlte.min.js"></script>
|
153 |
+
|
154 |
+
</body>
|
155 |
+
|
156 |
+
</html>
|
templates/data_connectors.html
ADDED
@@ -0,0 +1,368 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
|
4 |
+
<head>
|
5 |
+
<meta charset="UTF-8">
|
6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7 |
+
<title>Data Connectors</title>
|
8 |
+
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
9 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
|
10 |
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/adminlte.min.css">
|
11 |
+
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
|
12 |
+
|
13 |
+
<style>
|
14 |
+
html,
|
15 |
+
body {
|
16 |
+
height: 90%;
|
17 |
+
margin: 0;
|
18 |
+
display: flex;
|
19 |
+
flex-direction: column;
|
20 |
+
}
|
21 |
+
|
22 |
+
body {
|
23 |
+
display: flex;
|
24 |
+
flex-direction: column;
|
25 |
+
min-height: 90%;
|
26 |
+
}
|
27 |
+
|
28 |
+
.main-content {
|
29 |
+
flex: 1;
|
30 |
+
display: flex;
|
31 |
+
flex-direction: column;
|
32 |
+
align-items: center;
|
33 |
+
justify-content: flex-start;
|
34 |
+
padding: 20px;
|
35 |
+
}
|
36 |
+
|
37 |
+
.container {
|
38 |
+
margin-top: 50px;
|
39 |
+
margin-left: 420px;
|
40 |
+
max-width: 600px;
|
41 |
+
padding: 10px;
|
42 |
+
border: 1px solid #ccc;
|
43 |
+
border-radius: 5px;
|
44 |
+
background-color: #fff;
|
45 |
+
position: relative;
|
46 |
+
z-index: 1;
|
47 |
+
}
|
48 |
+
|
49 |
+
.form-group {
|
50 |
+
margin-bottom: 20px;
|
51 |
+
}
|
52 |
+
|
53 |
+
.form-group label {
|
54 |
+
font-weight: bold;
|
55 |
+
margin-top: 5px;
|
56 |
+
margin-bottom: 5px;
|
57 |
+
display: block;
|
58 |
+
}
|
59 |
+
|
60 |
+
.form-group input,
|
61 |
+
.form-group select,
|
62 |
+
.form-group textarea {
|
63 |
+
width: 100%;
|
64 |
+
height: auto;
|
65 |
+
padding: 10px;
|
66 |
+
border: 1px solid #ccc;
|
67 |
+
border-radius: 4px;
|
68 |
+
}
|
69 |
+
|
70 |
+
.btn-primary {
|
71 |
+
margin-right: 10px;
|
72 |
+
color: black;
|
73 |
+
font-size: 16px;
|
74 |
+
font-weight: bold;
|
75 |
+
}
|
76 |
+
|
77 |
+
h2 {
|
78 |
+
text-align: center;
|
79 |
+
margin-bottom: 20px;
|
80 |
+
}
|
81 |
+
|
82 |
+
.btn-container {
|
83 |
+
text-align: center;
|
84 |
+
margin-top: 30px;
|
85 |
+
margin-bottom: 0px;
|
86 |
+
color: white;
|
87 |
+
}
|
88 |
+
|
89 |
+
#selectedTables,
|
90 |
+
#labelselected {
|
91 |
+
display: none;
|
92 |
+
}
|
93 |
+
|
94 |
+
#saveBtn1 {
|
95 |
+
display: none;
|
96 |
+
margin: 0 auto;
|
97 |
+
}
|
98 |
+
|
99 |
+
footer {
|
100 |
+
position: relative;
|
101 |
+
margin-top: auto;
|
102 |
+
width: 100%;
|
103 |
+
color: black;
|
104 |
+
text-align: right;
|
105 |
+
padding-right: 245px;
|
106 |
+
padding-top: 20px;
|
107 |
+
background-color: #f8f9fa;
|
108 |
+
border: none !important;
|
109 |
+
}
|
110 |
+
</style>
|
111 |
+
</head>
|
112 |
+
|
113 |
+
<body>
|
114 |
+
{% include 'sidepane.html' %}
|
115 |
+
<div class="main-content">
|
116 |
+
<div id="message-container"></div>
|
117 |
+
<div class="container mt-2">
|
118 |
+
<h2>Data Connectors</h2>
|
119 |
+
<div class="form-group">
|
120 |
+
<label for="company">Company Name <span class="text-danger">*</span></label>
|
121 |
+
<select type="text" id="company" name="company" class="form-control" required>
|
122 |
+
<option value="" selected>Select</option>
|
123 |
+
</select>
|
124 |
+
</div>
|
125 |
+
<form id="databaseconnectorForm" class="needs-validation" novalidate action="/save_data_connectors"
|
126 |
+
method="post" style="display:none;">
|
127 |
+
<div class="form-group">
|
128 |
+
<!-- <label for="company_id">company_id</label>--->
|
129 |
+
<input type="hidden" id="company_id" name="company_id" class="form-control" required>
|
130 |
+
</div>
|
131 |
+
<div class="row">
|
132 |
+
<div class="col-md-6">
|
133 |
+
<div class="form-group">
|
134 |
+
<label for="database">Database Type<span class="text-danger">*</span></label>
|
135 |
+
<select type="text" id="database" name="database" class="form-control" required>
|
136 |
+
<option value="" selected>Select</option>
|
137 |
+
<option value="Postgress">Postgres</option>
|
138 |
+
<option value="mysql">Mysql</option>
|
139 |
+
</select>
|
140 |
+
</div>
|
141 |
+
</div>
|
142 |
+
<div class="col-md-6">
|
143 |
+
<div class="form-group">
|
144 |
+
<label for="server">Server IP <span class="text-danger">*</span></label>
|
145 |
+
<input type="text" id="server" name="server" class="form-control" required>
|
146 |
+
</div>
|
147 |
+
</div>
|
148 |
+
</div>
|
149 |
+
<div class="row">
|
150 |
+
<div class="col-md-6">
|
151 |
+
<div class="form-group">
|
152 |
+
<label for="port">Port <span class="text-danger">*</span></label>
|
153 |
+
<input type="text" id="port" name="port" class="form-control" required>
|
154 |
+
</div>
|
155 |
+
</div>
|
156 |
+
<div class="col-md-6">
|
157 |
+
<div class="form-group">
|
158 |
+
<label for="databaseName">Database Name <span class="text-danger">*</span></label>
|
159 |
+
<input type="text" id="databaseName" name="databaseName" class="form-control" required>
|
160 |
+
</div>
|
161 |
+
</div>
|
162 |
+
</div>
|
163 |
+
<div class="row">
|
164 |
+
<div class="col-md-6">
|
165 |
+
<div class="form-group">
|
166 |
+
<label for="username">UserName <span class="text-danger">*</span></label>
|
167 |
+
<input type="text" id="username" name="username" class="form-control" required>
|
168 |
+
</div>
|
169 |
+
</div>
|
170 |
+
<div class="col-md-6">
|
171 |
+
<div class="form-group">
|
172 |
+
<label for="password">Password <span class="text-danger">*</span></label>
|
173 |
+
<input type="password" id="password" name="password" class="form-control" required>
|
174 |
+
</div>
|
175 |
+
</div>
|
176 |
+
</div>
|
177 |
+
<div class="btn-container">
|
178 |
+
<button type="button" id="connectBtn" class="btn btn-primary">Connect</button>
|
179 |
+
<button type="reset" class="btn btn-primary">Clear</button>
|
180 |
+
</div>
|
181 |
+
<div id="schema-table-section" style="display: none;">
|
182 |
+
<div class="form-group">
|
183 |
+
<div class="row">
|
184 |
+
<div class="col">
|
185 |
+
<label for="schemas">Available Schemas <span class="text-danger">*</span></label>
|
186 |
+
<select type="text" id="schemas" name="schemas" class="form-control" required>
|
187 |
+
<option value="" selected>Select</option>
|
188 |
+
<option value="schema1">Lookup</option>
|
189 |
+
<option value="schema2">Public</option>
|
190 |
+
<option value="schema3" selected>tenant_default</option>
|
191 |
+
</select>
|
192 |
+
</div>
|
193 |
+
<div class="col">
|
194 |
+
<label for="tables">Available Tables <span class="text-danger">*</span></label>
|
195 |
+
<select type="text" id="tables" name="tables" class="form-control" multiple required>
|
196 |
+
<option disabled>Select</option>
|
197 |
+
<option value="customer_master">customer_master</option>
|
198 |
+
<option value="efs_company_master">efs_company_master</option>
|
199 |
+
<option value="efs_group_company_master">efs_group_company_master</option>
|
200 |
+
<option value="efs_region_master">efs_region_master</option>
|
201 |
+
<option value="party_address_detail">party_address_detail</option>
|
202 |
+
<option value="wms_warehouse_master">wms_warehouse_master</option>
|
203 |
+
</select>
|
204 |
+
</div>
|
205 |
+
</div>
|
206 |
+
</div>
|
207 |
+
|
208 |
+
<div class="btn-container">
|
209 |
+
<button type="button" id="saveBtn" class="btn btn-primary">Save</button>
|
210 |
+
</div>
|
211 |
+
<div class="form-group">
|
212 |
+
<label for="selectedTables" id="labelselected">Selected Tables:</label>
|
213 |
+
<textarea type="text" id="selectedTables" name="selectedTables" class="form-control" rows="5"
|
214 |
+
readonly style="display:none;"></textarea>
|
215 |
+
</div>
|
216 |
+
<div class="btn-container">
|
217 |
+
<button type="submit" id="saveBtn1" class="btn btn-primary">Save Tables</button>
|
218 |
+
</div>
|
219 |
+
</div>
|
220 |
+
</form>
|
221 |
+
</div>
|
222 |
+
</div>
|
223 |
+
<footer>
|
224 |
+
<p></p>
|
225 |
+
</footer>
|
226 |
+
<script>
|
227 |
+
|
228 |
+
document.addEventListener('DOMContentLoaded', function () {
|
229 |
+
fetchCompanies();
|
230 |
+
|
231 |
+
const companySelect = document.getElementById('company');
|
232 |
+
const databaseconnectorForm = document.getElementById('databaseconnectorForm');
|
233 |
+
|
234 |
+
companySelect.addEventListener('change', async function () {
|
235 |
+
const selectedCompanyName = companySelect.options[companySelect.selectedIndex].text;
|
236 |
+
console.log(`Selected Company Name: ${selectedCompanyName}`);
|
237 |
+
|
238 |
+
if (selectedCompanyName !== "Select") {
|
239 |
+
try {
|
240 |
+
const response = await fetch(`/api/company_id?company_name=${encodeURIComponent(selectedCompanyName)}`);
|
241 |
+
if (!response.ok) {
|
242 |
+
throw new Error('Network response was not ok');
|
243 |
+
}
|
244 |
+
const data = await response.json();
|
245 |
+
console.log(`Company ID: ${data.company_id}`);
|
246 |
+
const companyId = data.company_id;
|
247 |
+
document.getElementById('company_id').value = companyId;
|
248 |
+
|
249 |
+
if (companyId) {
|
250 |
+
try {
|
251 |
+
const connectorsResponse = await fetch(`/api/check_data_connectors?company_id=${companyId}&company_name=${selectedCompanyName}`);
|
252 |
+
if (!connectorsResponse.ok) {
|
253 |
+
throw new Error('data connector Network response was not ok');
|
254 |
+
}
|
255 |
+
const connectorsData = await connectorsResponse.json();
|
256 |
+
//setMultiSelectValues(document.getElementById('database'), connectorsData.databasetype); // Ensure this is an array
|
257 |
+
//setMultiSelectValues(document.getElementById('databaseName'), connectorsData.database_name); // Ensure this is an array
|
258 |
+
document.getElementById('database').value = connectorsData.databasetype;
|
259 |
+
document.getElementById('server').value = connectorsData.serverip;
|
260 |
+
document.getElementById('port').value = connectorsData.port;
|
261 |
+
document.getElementById('databaseName').value = connectorsData.database_name;
|
262 |
+
document.getElementById('username').value = connectorsData.username;
|
263 |
+
document.getElementById('password').value = connectorsData.password;
|
264 |
+
document.getElementById('tables').value = connectorsData.dbtablename;
|
265 |
+
databaseconnectorForm.style.display = 'block';
|
266 |
+
|
267 |
+
} catch (error) {
|
268 |
+
document.getElementById('database').value = " ";
|
269 |
+
document.getElementById('server').value = " ";
|
270 |
+
document.getElementById('port').value = " ";
|
271 |
+
document.getElementById('databaseName').value = " ";
|
272 |
+
document.getElementById('username').value = " ";
|
273 |
+
document.getElementById('password').value = " ";
|
274 |
+
document.getElementById('tables').value = " ";
|
275 |
+
console.error('Error fetching data from data connectors:', error);
|
276 |
+
("Company name does not exist. Please fill in the details.");
|
277 |
+
|
278 |
+
// Optionally, you can insert a message into the DOM
|
279 |
+
const messageContainer = document.getElementById('message-container');
|
280 |
+
if (messageContainer) {
|
281 |
+
messageContainer.innerHTML = "<div class='alert alert-danger'>Database details does not exist for this Company name.. Please fill in the details.</div>";
|
282 |
+
}
|
283 |
+
|
284 |
+
databaseconnectorForm.style.display = 'block';
|
285 |
+
}
|
286 |
+
} else {
|
287 |
+
console.log(`Company ID does not exist, you can create and save data: ${data.company_id}`);
|
288 |
+
databaseconnectorForm.style.display = 'none';
|
289 |
+
}
|
290 |
+
|
291 |
+
} catch (error) {
|
292 |
+
|
293 |
+
console.error('Error fetching company ID or data connectors:', error);
|
294 |
+
databaseconnectorForm.style.display = 'none';
|
295 |
+
}
|
296 |
+
} else {
|
297 |
+
databaseconnectorForm.style.display = 'none';
|
298 |
+
}
|
299 |
+
});
|
300 |
+
|
301 |
+
document.getElementById("connectBtn").addEventListener("click", function (event) {
|
302 |
+
var database = document.getElementById("database").value;
|
303 |
+
var server = document.getElementById("server").value;
|
304 |
+
var port = document.getElementById("port").value;
|
305 |
+
var databaseName = document.getElementById("databaseName").value;
|
306 |
+
var username = document.getElementById("username").value;
|
307 |
+
var password = document.getElementById("password").value;
|
308 |
+
|
309 |
+
if (!database || !server || !port || !databaseName || !username || !password) {
|
310 |
+
alert("Please fill in all required fields.");
|
311 |
+
return;
|
312 |
+
}
|
313 |
+
|
314 |
+
document.getElementById("schema-table-section").style.display = "block";
|
315 |
+
});
|
316 |
+
|
317 |
+
document.getElementById("saveBtn").addEventListener("click", function (event) {
|
318 |
+
var tables = Array.from(document.getElementById("tables").selectedOptions).map(option => option.value);
|
319 |
+
if (tables.length === 0) {
|
320 |
+
alert("Please select at least one table.");
|
321 |
+
return;
|
322 |
+
}
|
323 |
+
|
324 |
+
var selectedTables = document.getElementById("selectedTables");
|
325 |
+
selectedTables.value = tables.join(", ");
|
326 |
+
selectedTables.style.display = "block";
|
327 |
+
document.getElementById("labelselected").style.display = "block";
|
328 |
+
document.getElementById("saveBtn1").style.display = "block";
|
329 |
+
});
|
330 |
+
});
|
331 |
+
|
332 |
+
async function fetchCompanies() {
|
333 |
+
try {
|
334 |
+
const response = await fetch('/api/companies');
|
335 |
+
if (!response.ok) {
|
336 |
+
throw new Error('Network response was not ok');
|
337 |
+
}
|
338 |
+
const data = await response.json();
|
339 |
+
displayCompanies(data.companies);
|
340 |
+
} catch (error) {
|
341 |
+
console.error('Error fetching companies:', error);
|
342 |
+
}
|
343 |
+
}
|
344 |
+
|
345 |
+
function displayCompanies(companies) {
|
346 |
+
const companySelect = document.getElementById('company');
|
347 |
+
companySelect.innerHTML = '<option value="" selected>Select</option>'; // Reset the dropdown
|
348 |
+
companies.forEach(company => {
|
349 |
+
const option = document.createElement('option');
|
350 |
+
option.value = company.name;
|
351 |
+
option.textContent = company.name;
|
352 |
+
companySelect.appendChild(option);
|
353 |
+
});
|
354 |
+
}
|
355 |
+
|
356 |
+
function setMultiSelectValues(selectElement, values) {
|
357 |
+
// Ensure values is an array
|
358 |
+
if (!Array.isArray(values)) {
|
359 |
+
values = [values];
|
360 |
+
}
|
361 |
+
Array.from(selectElement.options).forEach(option => {
|
362 |
+
option.selected = values.includes(option.value);
|
363 |
+
});
|
364 |
+
}
|
365 |
+
</script>
|
366 |
+
</body>
|
367 |
+
|
368 |
+
</html>
|
templates/footer.html
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!-- footer.html -->
|
2 |
+
|
3 |
+
<!--
|
4 |
+
This is the HTML code for the footer section of a web page.
|
5 |
+
It displays the version number and copyright information.
|
6 |
+
|
7 |
+
HTML Structure:
|
8 |
+
- The footer element has a class of "main-footer".
|
9 |
+
- Inside the footer, there is a div element with classes "float-right" and "d-none d-sm-block".
|
10 |
+
- Inside the div, there is a bold tag (<b>) displaying the version number.
|
11 |
+
- After the div, there is a strong tag (<strong>) displaying the copyright information.
|
12 |
+
- The copyright information includes the year and a link to the company's website.
|
13 |
+
|
14 |
+
Example Usage:
|
15 |
+
<footer class="main-footer">
|
16 |
+
<div class="float-right d-none d-sm-block">
|
17 |
+
<b>Version</b> 3.0.5
|
18 |
+
</div>
|
19 |
+
<strong>© 2023 <a href="https://yourcompany.com">Your Company</a>.</strong> All rights reserved.
|
20 |
+
</footer>
|
21 |
+
-->
|
22 |
+
<footer class="main-footer" style="position: absolute; bottom: 0; width: 100%; color: black; text-align: right; padding-right:245px ;">
|
23 |
+
<div class="container-fluid">
|
24 |
+
<a href="https://redmindtechnologies.com" target="_blank" style="color: black; text-decoration: none;">Visit Redmind Technologies at https://redmindtechnologies.com</a>
|
25 |
+
</div>
|
26 |
+
</footer>
|
templates/index.html
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--
|
2 |
+
This is the login page template for the RedMindGPT application.
|
3 |
+
It contains a login form where users can enter their username and password to sign in.
|
4 |
+
The form includes validation to ensure that both fields are filled out before submission.
|
5 |
+
The page also includes styling using CSS and utilizes the AdminLTE and Font Awesome libraries for additional design elements.
|
6 |
+
-->
|
7 |
+
|
8 |
+
<!DOCTYPE html>
|
9 |
+
<html lang="en">
|
10 |
+
<head>
|
11 |
+
<meta charset="UTF-8">
|
12 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
13 |
+
<style>
|
14 |
+
/* CSS styles for the login page */
|
15 |
+
.login-box-msg {
|
16 |
+
color: grey;
|
17 |
+
font-size: larger;
|
18 |
+
font-weight: bold;
|
19 |
+
}
|
20 |
+
|
21 |
+
.remember-me {
|
22 |
+
text-align: center;
|
23 |
+
}
|
24 |
+
</style>
|
25 |
+
<title>RedMindGPT</title>
|
26 |
+
<!-- AdminLTE CSS -->
|
27 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/adminlte.min.css">
|
28 |
+
<!-- Font Awesome -->
|
29 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
30 |
+
</head>
|
31 |
+
<body class="hold-transition login-page" style="background-image: url('static/img/AI.jpg'); background-size: cover;">
|
32 |
+
<div class="login-box">
|
33 |
+
<div class="card">
|
34 |
+
<!-- Logo -->
|
35 |
+
<div style="align-items: center;">
|
36 |
+
<a href="#" style="color: blue;
|
37 |
+
font-size: 30px;
|
38 |
+
font-weight: bold;
|
39 |
+
margin-left: 80px;
|
40 |
+
margin-top: 20px;
|
41 |
+
"><b>RedMindGPT</b></a>
|
42 |
+
</div>
|
43 |
+
<form action='/validate-user' name='loginForm' method="post" onsubmit="return validateForm()">
|
44 |
+
<div class="card-body login-card-body">
|
45 |
+
<p class="login-box-msg">Sign in</p>
|
46 |
+
<div class="input-group mb-3">
|
47 |
+
<input type="text" class="form-control" placeholder="Username" name="username" required>
|
48 |
+
<div class="input-group-append">
|
49 |
+
<div class="input-group-text">
|
50 |
+
<span class="fas fa-user"></span>
|
51 |
+
</div>
|
52 |
+
</div>
|
53 |
+
</div>
|
54 |
+
<div class="input-group mb-3">
|
55 |
+
<input type="password" class="form-control" placeholder="Password" name="password" required>
|
56 |
+
<div class="input-group-append">
|
57 |
+
<div class="input-group-text">
|
58 |
+
<span class="fas fa-lock"></span>
|
59 |
+
</div>
|
60 |
+
</div>
|
61 |
+
</div>
|
62 |
+
<div class="row" style="align-content: center;">
|
63 |
+
<div class="col-8">
|
64 |
+
<div class="icheck-primary">
|
65 |
+
<input type="checkbox" id="remember">
|
66 |
+
<label for="remember">
|
67 |
+
Remember Me
|
68 |
+
</label>
|
69 |
+
</div>
|
70 |
+
</div>
|
71 |
+
</div>
|
72 |
+
<div class="row" style="align-content: center;">
|
73 |
+
<div class="col-4">
|
74 |
+
<button type="submit" class="btn btn-primary btn-block">Sign In</button>
|
75 |
+
</div>
|
76 |
+
<div class="col-4">
|
77 |
+
<button type="reset" class="btn btn-secondary btn-block">Clear</button>
|
78 |
+
</div>
|
79 |
+
</div>
|
80 |
+
</div>
|
81 |
+
</form>
|
82 |
+
</div>
|
83 |
+
</div>
|
84 |
+
<!-- jQuery -->
|
85 |
+
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
86 |
+
<!-- Bootstrap 4 -->
|
87 |
+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.bundle.min.js"></script>
|
88 |
+
<!-- AdminLTE App -->
|
89 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/adminlte.min.js"></script>
|
90 |
+
<script>
|
91 |
+
// JavaScript function to validate the login form
|
92 |
+
function validateForm() {
|
93 |
+
//alert("Validating form");
|
94 |
+
var username = document.forms["loginForm"]["username"].value;
|
95 |
+
var password = document.forms["loginForm"]["password"].value;
|
96 |
+
if (username == "" || password == "") {
|
97 |
+
alert("Username and Password must be filled out");
|
98 |
+
return false;
|
99 |
+
}
|
100 |
+
}
|
101 |
+
</script>
|
102 |
+
</body>
|
103 |
+
</html>
|
templates/knowledgebase.html
ADDED
@@ -0,0 +1,360 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html>
|
3 |
+
|
4 |
+
<head>
|
5 |
+
<title>Knowledge Base</title>
|
6 |
+
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
7 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
|
8 |
+
<!-- Include AdminLTE CSS -->
|
9 |
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/adminlte.min.css">
|
10 |
+
<!-- Include DataTables CSS -->
|
11 |
+
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
|
12 |
+
<!-- Include AdminLTE JS -->
|
13 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/adminlte.min.js"></script>
|
14 |
+
<!-- Include DataTables JS -->
|
15 |
+
<script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
|
16 |
+
<script src="https://cdn.datatables.net/1.10.25/js/dataTables.bootstrap4.min.js"></script>
|
17 |
+
<style>
|
18 |
+
body {
|
19 |
+
background-color: transparent !important;
|
20 |
+
}
|
21 |
+
|
22 |
+
.content-wrapper {
|
23 |
+
background-color: transparent !important;
|
24 |
+
text-align: center;
|
25 |
+
}
|
26 |
+
|
27 |
+
.wrapper {
|
28 |
+
background-color: transparent !important;
|
29 |
+
}
|
30 |
+
|
31 |
+
.modal-content {
|
32 |
+
background-color: #fff;
|
33 |
+
}
|
34 |
+
|
35 |
+
h1 {
|
36 |
+
text-align: center;
|
37 |
+
margin-bottom: 30px;
|
38 |
+
}
|
39 |
+
|
40 |
+
/* Adjust table width to full container width */
|
41 |
+
.card-body {
|
42 |
+
padding: 0;
|
43 |
+
}
|
44 |
+
|
45 |
+
.table {
|
46 |
+
width: 100%;
|
47 |
+
}
|
48 |
+
|
49 |
+
.text-wrap {
|
50 |
+
white-space: normal !important;
|
51 |
+
word-break: break-word;
|
52 |
+
}
|
53 |
+
|
54 |
+
.center-align {
|
55 |
+
padding-top: 20px;
|
56 |
+
display: flex;
|
57 |
+
justify-content: center;
|
58 |
+
align-items: center;
|
59 |
+
width: 100%;
|
60 |
+
}
|
61 |
+
|
62 |
+
.reduced-width {
|
63 |
+
width: 50%;
|
64 |
+
/* Adjust the percentage as needed */
|
65 |
+
}
|
66 |
+
</style>
|
67 |
+
</head>
|
68 |
+
|
69 |
+
<body>
|
70 |
+
{% include 'sidepane.html' %}
|
71 |
+
|
72 |
+
|
73 |
+
<div class="wrapper" style="position: relative; top: 0;">
|
74 |
+
<div class="content-wrapper">
|
75 |
+
<div class="content-header">
|
76 |
+
<div class="container-fluid">
|
77 |
+
<div class="container mt-2">
|
78 |
+
<h1 class="m-0 text-center" style="flex-grow: 1;">Knowledge Base</h1>
|
79 |
+
<div class="form-group center-align">
|
80 |
+
<label for="company" class="mr-2">Company Name <span class="text-danger">*</span></label>
|
81 |
+
<select type="text" id="company" name="company" class="form-control reduced-width" required>
|
82 |
+
<option value="" selected>Select</option>
|
83 |
+
</select>
|
84 |
+
</div>
|
85 |
+
</div>
|
86 |
+
</div>
|
87 |
+
</div>
|
88 |
+
<section class="content" id="contentSection" style="display: none;">
|
89 |
+
<div class="container-fluid">
|
90 |
+
<div class="form-group">
|
91 |
+
<!-- <label for="company_id">company_id</label>--->
|
92 |
+
<input type="hidden" id="company_id" name="company_id" class="form-control" required>
|
93 |
+
</div>
|
94 |
+
<div class="row">
|
95 |
+
<div class="col-12 d-flex justify-content-end mb-3">
|
96 |
+
<button class="btn btn-primary" id="add">Add</button>
|
97 |
+
</div>
|
98 |
+
<div class="row mb-2">
|
99 |
+
<div class="col-12">
|
100 |
+
<div class="col-12">
|
101 |
+
<div class="card">
|
102 |
+
<div class="card-body">
|
103 |
+
<div class="table-responsive">
|
104 |
+
<div id="message-container">
|
105 |
+
<table id="knowledgeTable" class="table table-bordered table-striped">
|
106 |
+
<thead>
|
107 |
+
<tr>
|
108 |
+
<th>Sno</th>
|
109 |
+
<th>Document Name</th>
|
110 |
+
<th>Document Description</th>
|
111 |
+
<th>Document Version</th>
|
112 |
+
<th>VectorDB Flag</th>
|
113 |
+
<th>View</th>
|
114 |
+
</tr>
|
115 |
+
</thead>
|
116 |
+
<tbody>
|
117 |
+
<tr>
|
118 |
+
<td>1</td>
|
119 |
+
<td>NewAge eWMS BusinessRequirementsDocument_V1.9 - Inbound
|
120 |
+
</td>
|
121 |
+
<td>GRN Inbound</td>
|
122 |
+
<td>1.9</td>
|
123 |
+
<td>Yes</td>
|
124 |
+
<td>
|
125 |
+
<button class="btn btn-primary viewButton">View</button>
|
126 |
+
</td>
|
127 |
+
</tr>
|
128 |
+
<tr>
|
129 |
+
<td>2</td>
|
130 |
+
<td>NewAge eWMS BusinessRequirementsDocument_V2.3 - Inbound
|
131 |
+
</td>
|
132 |
+
<td>GRN Inbound</td>
|
133 |
+
<td>2.3</td>
|
134 |
+
<td>No</td>
|
135 |
+
<td>
|
136 |
+
<button class="btn btn-primary viewButton">View</button>
|
137 |
+
</td>
|
138 |
+
</tr>
|
139 |
+
<tr>
|
140 |
+
<td>3</td>
|
141 |
+
<td>NewAge eWMS BusinessRequirementsDocument_V1.9 - Outbound
|
142 |
+
</td>
|
143 |
+
<td>GRN Outbound</td>
|
144 |
+
<td>1.9</td>
|
145 |
+
<td>Yes</td>
|
146 |
+
<td>
|
147 |
+
<button class="btn btn-primary viewButton">View</button>
|
148 |
+
</td>
|
149 |
+
</tr>
|
150 |
+
<tr>
|
151 |
+
<td>4</td>
|
152 |
+
<td class="text-wrap">NewAge eWMS
|
153 |
+
BusinessRequirementsDocument_V2.2 - Outbound</td>
|
154 |
+
<td>ASN Outbound</td>
|
155 |
+
<td>2.2</td>
|
156 |
+
<td>No</td>
|
157 |
+
<td>
|
158 |
+
<button class="btn btn-primary viewButton">View</button>
|
159 |
+
</td>
|
160 |
+
</tr>
|
161 |
+
</tbody>
|
162 |
+
</table>
|
163 |
+
</div>
|
164 |
+
</div>
|
165 |
+
</div>
|
166 |
+
</div>
|
167 |
+
</div>
|
168 |
+
</div>
|
169 |
+
</div>
|
170 |
+
</section>
|
171 |
+
</div>
|
172 |
+
|
173 |
+
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel"
|
174 |
+
aria-hidden="true">
|
175 |
+
<div class="modal-dialog" role="document">
|
176 |
+
<div class="modal-content">
|
177 |
+
<div class="modal-header">
|
178 |
+
<h5 class="modal-title" id="addModalLabel">Add Document</h5>
|
179 |
+
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
180 |
+
<span aria-hidden="true">×</span>
|
181 |
+
</button>
|
182 |
+
</div>
|
183 |
+
<div class="modal-body">
|
184 |
+
<div class="form-group">
|
185 |
+
<!-- <label for="company_id">company_id</label>--->
|
186 |
+
<input type="hidden" id="company_id" name="company_id" class="form-control" required>
|
187 |
+
</div>
|
188 |
+
<form id="documentForm">
|
189 |
+
<div class="form-group">
|
190 |
+
<label for="uploadFile">Upload File<span class="text-danger">*</span></label>
|
191 |
+
<input type="file" class="form-control-file" id="uploadFile" name="uploadFile" required accept=".pdf,.doc,.docx">
|
192 |
+
<small class="form-text text-muted">Accepted formats: .pdf, .doc, .docx</small>
|
193 |
+
</div>
|
194 |
+
<div class="form-group">
|
195 |
+
<label for="documentName">Document Name<span class="text-danger">*</span></label>
|
196 |
+
<input type="text" class="form-control" id="documentName" name="documentName" required>
|
197 |
+
</div>
|
198 |
+
<div class="form-group">
|
199 |
+
<label for="documentDescription">Document Description<span class="text-danger">*</span></label>
|
200 |
+
<textarea class="form-control" id="documentDescription" name="documentDescription"
|
201 |
+
rows="3" required></textarea>
|
202 |
+
</div>
|
203 |
+
<div class="form-group">
|
204 |
+
<label for="department">Department<span class="text-danger">*</span></label>
|
205 |
+
<input type="text" class="form-control" id="department" name="department" required>
|
206 |
+
</div>
|
207 |
+
<div class="form-group">
|
208 |
+
<label for="version">Version<span class="text-danger">*</span></label>
|
209 |
+
<input type="text" class="form-control" id="version" name="version" required>
|
210 |
+
</div>
|
211 |
+
<div class="form-group">
|
212 |
+
<label for="lastUpdated">Last Updated<span class="text-danger">*</span></label>
|
213 |
+
<input type="text" class="form-control" id="lastUpdated" name="lastUpdated" required>
|
214 |
+
</div>
|
215 |
+
</form>
|
216 |
+
</div>
|
217 |
+
<div class="modal-footer">
|
218 |
+
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
219 |
+
<button type="button" id="save" onclick="save_file()" class="btn btn-primary">Save</button>
|
220 |
+
</div>
|
221 |
+
</div>
|
222 |
+
</div>
|
223 |
+
</div>
|
224 |
+
</div>
|
225 |
+
<!-- JavaScript to handle modal display -->
|
226 |
+
<script>
|
227 |
+
document.addEventListener("DOMContentLoaded", function () {
|
228 |
+
now = new Date().toISOString().substr(0, 10);
|
229 |
+
document.getElementById('lastUpdated').value = now
|
230 |
+
// clearFormFields();
|
231 |
+
});
|
232 |
+
document.addEventListener('DOMContentLoaded', function () {
|
233 |
+
|
234 |
+
fetchCompanies();
|
235 |
+
|
236 |
+
const companySelect = document.getElementById('company');
|
237 |
+
const documentForm = document.getElementById('documentForm');
|
238 |
+
|
239 |
+
companySelect.addEventListener('change', async function () {
|
240 |
+
const selectedCompanyName = companySelect.options[companySelect.selectedIndex].text;
|
241 |
+
console.log(`Selected Company Name: ${selectedCompanyName}`);
|
242 |
+
|
243 |
+
if (selectedCompanyName !== "Select") {
|
244 |
+
|
245 |
+
try {
|
246 |
+
const response = await fetch(`/api/company_id?company_name=${encodeURIComponent(selectedCompanyName)}`);
|
247 |
+
if (!response.ok) {
|
248 |
+
contentSection.style.display='none';
|
249 |
+
const messageContainer = document.getElementById('message-container');
|
250 |
+
if (messageContainer) {
|
251 |
+
messageContainer.innerHTML = "<div class='alert alert-danger'>Document details do not exist for this company. Please fill in the details.</div>";
|
252 |
+
}
|
253 |
+
throw new Error('Network response was not ok');
|
254 |
+
}
|
255 |
+
const data = await response.json();
|
256 |
+
console.log(`Company ID: ${data.company_id}`);
|
257 |
+
const companyId = data.company_id;
|
258 |
+
document.getElementById('company_id').value = companyId;
|
259 |
+
|
260 |
+
if (companyId) {
|
261 |
+
contentSection.style.display = 'block';
|
262 |
+
}
|
263 |
+
|
264 |
+
|
265 |
+
} catch (error) {
|
266 |
+
console.error('Error fetching company ID or data documents:', error);
|
267 |
+
documentForm.style.display = 'none';
|
268 |
+
}
|
269 |
+
} else {
|
270 |
+
//clearFormFields();
|
271 |
+
documentForm.style.display = 'block';
|
272 |
+
}
|
273 |
+
});
|
274 |
+
});
|
275 |
+
function clearFormFields() {
|
276 |
+
document.getElementById('uploadFile').value = "";
|
277 |
+
document.getElementById('documentName').value = "";
|
278 |
+
document.getElementById('documentDescription').value = "";
|
279 |
+
document.getElementById('department').value = "";
|
280 |
+
document.getElementById('version').value = "";
|
281 |
+
//document.getElementById('lastUpdated').value = "";
|
282 |
+
}
|
283 |
+
|
284 |
+
|
285 |
+
$(document).ready(function () {
|
286 |
+
// Show modal function
|
287 |
+
$('#add').on('click', function () {
|
288 |
+
clearFormFields();
|
289 |
+
$('#addModal').modal('show');
|
290 |
+
});
|
291 |
+
$('.modal-footer .btn-secondary').on('click', function () {
|
292 |
+
$('#addModal').modal('hide');
|
293 |
+
});
|
294 |
+
// Your save file function here
|
295 |
+
// async function save_file() {
|
296 |
+
// alert('Save button clicked');
|
297 |
+
// // Your save file logic goes here
|
298 |
+
// }
|
299 |
+
});
|
300 |
+
function save_file() {
|
301 |
+
const uploadFile = document.getElementById("uploadFile").files[0];
|
302 |
+
const documentName = document.getElementById("documentName").value;
|
303 |
+
const documentDescription = document.getElementById("documentDescription").value;
|
304 |
+
const department = document.getElementById("department").value;
|
305 |
+
const version = document.getElementById("version").value;
|
306 |
+
const lastUpdated = document.getElementById("lastUpdated").value;
|
307 |
+
const company_id = document.getElementById("company_id").value;
|
308 |
+
|
309 |
+
const formData = new FormData();
|
310 |
+
formData.append("uploadFile", uploadFile);
|
311 |
+
formData.append("documentName", documentName);
|
312 |
+
formData.append("documentDescription", documentDescription);
|
313 |
+
formData.append("department", department);
|
314 |
+
formData.append("version", version);
|
315 |
+
formData.append("lastUpdated", lastUpdated);
|
316 |
+
formData.append("company_id", company_id);
|
317 |
+
|
318 |
+
fetch('/upload_document', {
|
319 |
+
method: 'POST',
|
320 |
+
body: formData
|
321 |
+
})
|
322 |
+
.then(response => {
|
323 |
+
if (!response.ok) {
|
324 |
+
throw new Error('Network response was not ok');
|
325 |
+
}
|
326 |
+
return response.text();
|
327 |
+
})
|
328 |
+
.then(data => {
|
329 |
+
alert('Document saved successfully');
|
330 |
+
// $('#addModal').modal('hide');
|
331 |
+
})
|
332 |
+
.catch(error => console.error('Error:', error));
|
333 |
+
}
|
334 |
+
async function fetchCompanies() {
|
335 |
+
try {
|
336 |
+
const response = await fetch('/api/companies');
|
337 |
+
if (!response.ok) {
|
338 |
+
throw new Error('Network response was not ok');
|
339 |
+
}
|
340 |
+
const data = await response.json();
|
341 |
+
displayCompanies(data.companies);
|
342 |
+
} catch (error) {
|
343 |
+
console.error('Error fetching companies:', error);
|
344 |
+
}
|
345 |
+
}
|
346 |
+
|
347 |
+
function displayCompanies(companies) {
|
348 |
+
const companySelect = document.getElementById('company');
|
349 |
+
companySelect.innerHTML = '<option value="" selected>Select</option>'; // Reset the dropdown
|
350 |
+
companies.forEach(company => {
|
351 |
+
const option = document.createElement('option');
|
352 |
+
option.value = company.name;
|
353 |
+
option.textContent = company.name;
|
354 |
+
companySelect.appendChild(option);
|
355 |
+
});
|
356 |
+
}
|
357 |
+
</script>
|
358 |
+
</body>
|
359 |
+
|
360 |
+
</html>
|
templates/prompt_template.html
ADDED
@@ -0,0 +1,224 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html>
|
3 |
+
|
4 |
+
<head>
|
5 |
+
<title>Prompt Template</title>
|
6 |
+
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
7 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
|
8 |
+
<!-- Include AdminLTE CSS -->
|
9 |
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/adminlte.min.css">
|
10 |
+
<!-- Include DataTables CSS -->
|
11 |
+
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
|
12 |
+
<style>
|
13 |
+
.header-row {
|
14 |
+
display: flex;
|
15 |
+
justify-content: space-between;
|
16 |
+
align-items: center;
|
17 |
+
}
|
18 |
+
|
19 |
+
h2 {
|
20 |
+
text-align: center;
|
21 |
+
}
|
22 |
+
|
23 |
+
.table-container {
|
24 |
+
width: 100%;
|
25 |
+
overflow-x: auto;
|
26 |
+
}
|
27 |
+
|
28 |
+
.wrapper {
|
29 |
+
display: flex;
|
30 |
+
flex-direction: column;
|
31 |
+
height: 100vh;
|
32 |
+
}
|
33 |
+
|
34 |
+
.content-wrapper {
|
35 |
+
flex: 1;
|
36 |
+
overflow-y: auto;
|
37 |
+
}
|
38 |
+
|
39 |
+
.content-header {
|
40 |
+
padding: 1rem;
|
41 |
+
}
|
42 |
+
|
43 |
+
.footer {
|
44 |
+
text-align: right;
|
45 |
+
padding: 10px;
|
46 |
+
}
|
47 |
+
|
48 |
+
th,
|
49 |
+
td {
|
50 |
+
white-space: nowrap;
|
51 |
+
}
|
52 |
+
|
53 |
+
th:nth-child(1),
|
54 |
+
td:nth-child(1) {
|
55 |
+
/* Sno column */
|
56 |
+
width: 3%;
|
57 |
+
}
|
58 |
+
|
59 |
+
th:nth-child(2),
|
60 |
+
td:nth-child(2) {
|
61 |
+
/* API Name column */
|
62 |
+
width: 20%;
|
63 |
+
}
|
64 |
+
|
65 |
+
th:nth-child(3),
|
66 |
+
td:nth-child(3) {
|
67 |
+
/* API Endpoint column */
|
68 |
+
width: 40%;
|
69 |
+
}
|
70 |
+
|
71 |
+
th:nth-child(4),
|
72 |
+
td:nth-child(4) {
|
73 |
+
/* Auth/Bearer token column */
|
74 |
+
width: 20%;
|
75 |
+
}
|
76 |
+
|
77 |
+
th:nth-child(5),
|
78 |
+
td:nth-child(5) {
|
79 |
+
/* View column */
|
80 |
+
width: 15%;
|
81 |
+
}
|
82 |
+
</style>
|
83 |
+
</head>
|
84 |
+
|
85 |
+
<body>
|
86 |
+
{% include 'sidepane.html' %}
|
87 |
+
|
88 |
+
<div class="wrapper">
|
89 |
+
<div class="content-wrapper">
|
90 |
+
<!-- Content Header (Page header) -->
|
91 |
+
<div class="content-header">
|
92 |
+
<div class="container-fluid">
|
93 |
+
<div class="row mb-2">
|
94 |
+
<div class="col-12">
|
95 |
+
<div class="header-row">
|
96 |
+
<h2 class="m-0 text-center" style="flex-grow: 1;">Prompt Template</h2>
|
97 |
+
<button class="btn btn-primary" id="add">Add</button>
|
98 |
+
</div>
|
99 |
+
</div>
|
100 |
+
</div>
|
101 |
+
</div>
|
102 |
+
</div>
|
103 |
+
<!-- Main content -->
|
104 |
+
<section class="content">
|
105 |
+
<div class="container-fluid">
|
106 |
+
<div class="row">
|
107 |
+
<div class="col-12">
|
108 |
+
<div class="card">
|
109 |
+
<div class="card-body table-container">
|
110 |
+
<table id="knowledgeTable" class="table table-bordered table-striped">
|
111 |
+
<thead>
|
112 |
+
<tr>
|
113 |
+
<th>Sno</th>
|
114 |
+
<th>Scenario</th>
|
115 |
+
<th>Sample Prompt</th>
|
116 |
+
<th>Comments</th>
|
117 |
+
<th>View</th>
|
118 |
+
</tr>
|
119 |
+
</thead>
|
120 |
+
<tbody>
|
121 |
+
<tr>
|
122 |
+
<td>1</td>
|
123 |
+
<td>Creating new database in mysql</td>
|
124 |
+
<td>Need DB step for mysql with DB name = wwp, table name = customer_master with column name = name as datatype = string. (sample prompt).</td>
|
125 |
+
<td>It didn't create database instead its showed how to make connection to database and create table.</td>
|
126 |
+
<td><button class="btn btn-primary viewButton">View</button></td>
|
127 |
+
</tr>
|
128 |
+
<tr>
|
129 |
+
<td>2</td>
|
130 |
+
<td>Creating data table with columns</td>
|
131 |
+
<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>
|
132 |
+
<td>Expected response but adminlte theme was missing.</td>
|
133 |
+
<td><button class="btn btn-primary viewButton">View</button></td>
|
134 |
+
</tr>
|
135 |
+
<tr>
|
136 |
+
<td>3</td>
|
137 |
+
<td>Creating home page with adminlte theme.</td>
|
138 |
+
<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.
|
139 |
+
|
140 |
+
example: https://adminlte.io/themes/v3/index3.html
|
141 |
+
|
142 |
+
use this example for theme/html page. recreate it exactly like that
|
143 |
+
.image.png
|
144 |
+
</td>
|
145 |
+
<td>It created a html page but lacked side bar, nav bar present in url.
|
146 |
+
</td>
|
147 |
+
<td><button class="btn btn-primary viewButton">View</button></td>
|
148 |
+
</tr>
|
149 |
+
<tr>
|
150 |
+
<td>4</td>
|
151 |
+
<td>Including side bar menu in customer master</td>
|
152 |
+
<td>I want the side bar menu from admintle_theme to be present in customer_configuration.php</td>
|
153 |
+
<td>It gave expected results.
|
154 |
+
</td>
|
155 |
+
<td><button class="btn btn-primary viewButton">View</button></td>
|
156 |
+
</tr>
|
157 |
+
</tbody>
|
158 |
+
</table>
|
159 |
+
</div>
|
160 |
+
</div>
|
161 |
+
</div>
|
162 |
+
</div>
|
163 |
+
</div>
|
164 |
+
</section>
|
165 |
+
</div>
|
166 |
+
|
167 |
+
</div>
|
168 |
+
|
169 |
+
<!-- Modal -->
|
170 |
+
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel"
|
171 |
+
aria-hidden="true">
|
172 |
+
<div class="modal-dialog" role="document">
|
173 |
+
<div class="modal-content">
|
174 |
+
<div class="modal-header">
|
175 |
+
<h5 class="modal-title" id="addModalLabel">Add Prompt</h5>
|
176 |
+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
177 |
+
</div>
|
178 |
+
<div class="modal-body">
|
179 |
+
<form id="addPromptForm">
|
180 |
+
<div class="form-group">
|
181 |
+
<label for="APIName">Scenario <span class="text-danger">*</span></label>
|
182 |
+
<input type="text" class="form-control" id="APIName" name="APIName" required>
|
183 |
+
</div>
|
184 |
+
<div class="form-group">
|
185 |
+
<label for="APIEndpoint">Sample Prompt <span class="text-danger">*</span></label>
|
186 |
+
<input type="text" class="form-control" id="APIEndpoint" name="APIEndpoint" required>
|
187 |
+
</div>
|
188 |
+
<div class="form-group">
|
189 |
+
<label for="Auth_Bearer">Comments <span class="text-danger">*</span></label>
|
190 |
+
<input type="text" class="form-control" id="Auth_Bearer" name="Auth_Bearer" required>
|
191 |
+
</div>
|
192 |
+
</form>
|
193 |
+
</div>
|
194 |
+
<div class="modal-footer">
|
195 |
+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
196 |
+
<button type="button" id="save" onclick="save_file()" class="btn btn-primary">Save</button>
|
197 |
+
</div>
|
198 |
+
</div>
|
199 |
+
</div>
|
200 |
+
</div>
|
201 |
+
|
202 |
+
<!-- Include DataTables JS and your custom script -->
|
203 |
+
<script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
|
204 |
+
<script src="https://cdn.datatables.net/1.10.25/js/dataTables.bootstrap4.min.js"></script>
|
205 |
+
<script>
|
206 |
+
$(document).ready(function () {
|
207 |
+
// Initialize DataTable
|
208 |
+
$('#knowledgeTable').DataTable();
|
209 |
+
|
210 |
+
// Show modal function
|
211 |
+
$('#add').on('click', function () {
|
212 |
+
$('#addModal').modal('show');
|
213 |
+
});
|
214 |
+
|
215 |
+
// Your save file function here
|
216 |
+
function save_file() {
|
217 |
+
alert('Save button clicked');
|
218 |
+
// Your save file logic goes here
|
219 |
+
}
|
220 |
+
});
|
221 |
+
</script>
|
222 |
+
</body>
|
223 |
+
|
224 |
+
</html>
|
templates/redmindlogo2.jpg
ADDED
![]() |
templates/redmindlogo3.jpg
ADDED
![]() |
templates/sidepane.html
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!-- sidepane.html -->
|
2 |
+
|
3 |
+
<!-- This file represents the sidepane component of a web application. It contains the navigation menu and sidebar. -->
|
4 |
+
|
5 |
+
<nav class="main-header navbar navbar-expand navbar-white navbar-light" style="text-align: center;">
|
6 |
+
<div class="container-fluid d-flex justify-content-center align-items-center">
|
7 |
+
<img src="..\static\img\redmindlogo3.jpg" alt="Logo" style="width: 80px; height: auto; margin-right: 10px;">
|
8 |
+
|
9 |
+
<h2 style="text-align: center; margin-bottom: 0;">Redmind GPT</h2>
|
10 |
+
</div>
|
11 |
+
<!-- Left navbar links -->
|
12 |
+
<ul class="navbar-nav">
|
13 |
+
<li class="nav-item">
|
14 |
+
<a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
|
15 |
+
</li>
|
16 |
+
</ul>
|
17 |
+
</nav>
|
18 |
+
|
19 |
+
<!-- Main Sidebar Container -->
|
20 |
+
<aside class="main-sidebar sidebar-dark-primary elevation-4" style="width: 200px;">
|
21 |
+
<!-- Sidebar -->
|
22 |
+
<div class="sidebar">
|
23 |
+
<!-- Sidebar Menu -->
|
24 |
+
<nav class="mt-2">
|
25 |
+
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
|
26 |
+
<!-- Navigation Links -->
|
27 |
+
<li class="nav-item">
|
28 |
+
<a href="#" class="nav-link">
|
29 |
+
<i class="nav-icon fas fa-home"></i>
|
30 |
+
<p>Dashboard</p>
|
31 |
+
</a>
|
32 |
+
</li>
|
33 |
+
<li class="nav-item">
|
34 |
+
<a href="{{ url_for('company_profile') }}" class="nav-link">
|
35 |
+
<i class="nav-icon fas fa-users"></i>
|
36 |
+
<p>Company Profile</p>
|
37 |
+
</a>
|
38 |
+
</li>
|
39 |
+
<li class="nav-item">
|
40 |
+
<a href="{{ url_for('knowledgebase') }}" class="nav-link">
|
41 |
+
<i class="nav-icon fas fa-cogs"></i>
|
42 |
+
<p>KnowledgeBase</p>
|
43 |
+
</a>
|
44 |
+
</li>
|
45 |
+
<li class="nav-item">
|
46 |
+
<a href="{{ url_for('data_connectors') }}" class="nav-link">
|
47 |
+
<i class="nav-icon fas fa-home"></i>
|
48 |
+
<p>Data Connectors</p>
|
49 |
+
</a>
|
50 |
+
</li>
|
51 |
+
<li class="nav-item">
|
52 |
+
<a href="{{ url_for('API_connectors') }}" class="nav-link">
|
53 |
+
<i class="nav-icon fas fa-users"></i>
|
54 |
+
<p>API Connectors</p>
|
55 |
+
</a>
|
56 |
+
</li>
|
57 |
+
<li class="nav-item">
|
58 |
+
<a href="{{url_for('prompt_template')}}" class="nav-link">
|
59 |
+
<i class="nav-icon fas fa-cogs"></i>
|
60 |
+
<p>Prompt Templates</p>
|
61 |
+
</a>
|
62 |
+
</li>
|
63 |
+
<!--<li class="nav-item">
|
64 |
+
<a href="#" class="nav-link">
|
65 |
+
<i class="nav-icon fas fa-cogs"></i>
|
66 |
+
<p>LLM Settings</p>
|
67 |
+
</a>
|
68 |
+
<ul class="nav nav-treeview">
|
69 |
+
<li class="nav-item">
|
70 |
+
<a href="#" class="nav-link">
|
71 |
+
<i class="far fa-circle nav-icon"></i>
|
72 |
+
<p>Sublink 1</p>
|
73 |
+
</a>
|
74 |
+
</li>
|
75 |
+
<li class="nav-item">
|
76 |
+
<a href="#" class="nav-link">
|
77 |
+
<i class="far fa-circle nav-icon"></i>
|
78 |
+
<p>Sublink 2</p>
|
79 |
+
</a>
|
80 |
+
</li>
|
81 |
+
<!-- Add more sublinks here -->
|
82 |
+
</ul>
|
83 |
+
</li> -->
|
84 |
+
|
85 |
+
<!-- Add more navigation links here -->
|
86 |
+
</ul>
|
87 |
+
</nav>
|
88 |
+
<!-- /.sidebar-menu -->
|
89 |
+
</div>
|
90 |
+
<!-- /.sidebar -->
|
91 |
+
</aside>
|
92 |
+
|
93 |
+
|
94 |
+
<!-- AdminLTE JS -->
|
95 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/admin-lte/3.1.0/js/adminlte.min.js"></script>
|
templates/templates/API_connectors.html
ADDED
@@ -0,0 +1,228 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html>
|
3 |
+
|
4 |
+
<head>
|
5 |
+
<title>API Connectors</title>
|
6 |
+
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
7 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
|
8 |
+
<!-- Include AdminLTE CSS -->
|
9 |
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/adminlte.min.css">
|
10 |
+
<!-- Include DataTables CSS -->
|
11 |
+
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
|
12 |
+
<style>
|
13 |
+
.header-row {
|
14 |
+
display: flex;
|
15 |
+
justify-content: space-between;
|
16 |
+
align-items: center;
|
17 |
+
}
|
18 |
+
|
19 |
+
h2 {
|
20 |
+
text-align: center;
|
21 |
+
}
|
22 |
+
|
23 |
+
.table-container {
|
24 |
+
width: 100%;
|
25 |
+
overflow-x: auto;
|
26 |
+
}
|
27 |
+
|
28 |
+
.wrapper {
|
29 |
+
display: flex;
|
30 |
+
flex-direction: column;
|
31 |
+
height: 100vh;
|
32 |
+
}
|
33 |
+
|
34 |
+
.content-wrapper {
|
35 |
+
flex: 1;
|
36 |
+
overflow-y: auto;
|
37 |
+
}
|
38 |
+
|
39 |
+
.content-header {
|
40 |
+
padding: 1rem;
|
41 |
+
}
|
42 |
+
|
43 |
+
.footer {
|
44 |
+
text-align: right;
|
45 |
+
padding: 10px;
|
46 |
+
}
|
47 |
+
|
48 |
+
th,
|
49 |
+
td {
|
50 |
+
white-space: nowrap;
|
51 |
+
}
|
52 |
+
|
53 |
+
th:nth-child(1),
|
54 |
+
td:nth-child(1) {
|
55 |
+
/* Sno column */
|
56 |
+
width: 5%;
|
57 |
+
}
|
58 |
+
|
59 |
+
th:nth-child(2),
|
60 |
+
td:nth-child(2) {
|
61 |
+
/* API Name column */
|
62 |
+
width: 20%;
|
63 |
+
}
|
64 |
+
|
65 |
+
th:nth-child(3),
|
66 |
+
td:nth-child(3) {
|
67 |
+
/* API Endpoint column */
|
68 |
+
width: 40%;
|
69 |
+
}
|
70 |
+
|
71 |
+
th:nth-child(4),
|
72 |
+
td:nth-child(4) {
|
73 |
+
/* Auth/Bearer token column */
|
74 |
+
width: 20%;
|
75 |
+
}
|
76 |
+
|
77 |
+
th:nth-child(5),
|
78 |
+
td:nth-child(5) {
|
79 |
+
/* View column */
|
80 |
+
width: 15%;
|
81 |
+
}
|
82 |
+
</style>
|
83 |
+
</head>
|
84 |
+
|
85 |
+
<body>
|
86 |
+
{% include 'sidepane.html' %}
|
87 |
+
|
88 |
+
<div class="wrapper">
|
89 |
+
<div class="content-wrapper">
|
90 |
+
<!-- Content Header (Page header) -->
|
91 |
+
<div class="content-header">
|
92 |
+
<div class="container-fluid">
|
93 |
+
<div class="row mb-2">
|
94 |
+
<div class="col-12">
|
95 |
+
<div class="header-row">
|
96 |
+
<h2 class="m-0 text-center" style="flex-grow: 1;">API Connectors</h2>
|
97 |
+
<button class="btn btn-primary" id="add">Add</button>
|
98 |
+
</div>
|
99 |
+
</div>
|
100 |
+
</div>
|
101 |
+
</div>
|
102 |
+
</div>
|
103 |
+
<!-- Main content -->
|
104 |
+
<section class="content">
|
105 |
+
<div class="container-fluid">
|
106 |
+
<div class="row">
|
107 |
+
<div class="col-12">
|
108 |
+
<div class="card">
|
109 |
+
<div class="card-body table-container">
|
110 |
+
<table id="knowledgeTable" class="table table-bordered table-striped">
|
111 |
+
<thead>
|
112 |
+
<tr>
|
113 |
+
<th>Sno</th>
|
114 |
+
<th>API Name</th>
|
115 |
+
<th>API Endpoint</th>
|
116 |
+
<th>View</th>
|
117 |
+
</tr>
|
118 |
+
</thead>
|
119 |
+
<tbody>
|
120 |
+
<tr>
|
121 |
+
<td>1</td>
|
122 |
+
<td>Warehouse</td>
|
123 |
+
<td>http://193.203.162.39:9090/nxt-wms/userWarehouse/fetchWarehouseForUserId
|
124 |
+
</td>
|
125 |
+
<td><button class="btn btn-primary viewButton">View</button></td>
|
126 |
+
</tr>
|
127 |
+
<tr>
|
128 |
+
<td>2</td>
|
129 |
+
<td>customer</td>
|
130 |
+
<td>http://193.203.162.39:9090/nxt-wms/userCustomer/fetchCustomerForUserId
|
131 |
+
</td>
|
132 |
+
<td><button class="btn btn-primary viewButton">View</button></td>
|
133 |
+
</tr>
|
134 |
+
<tr>
|
135 |
+
<td>3</td>
|
136 |
+
<td>SKU</td>
|
137 |
+
<td>http://193.203.162.39:9090/nxt-wms/sku/autoComplete?</td>
|
138 |
+
<td><button class="btn btn-primary viewButton">View</button></td>
|
139 |
+
</tr>
|
140 |
+
<tr>
|
141 |
+
<td>4</td>
|
142 |
+
<td>ASN</td>
|
143 |
+
<td>http://193.203.162.39:9090/nxt-wms/trnHeader</td>
|
144 |
+
<td><button class="btn btn-primary viewButton">View</button></td>
|
145 |
+
</tr>
|
146 |
+
</tbody>
|
147 |
+
</table>
|
148 |
+
</div>
|
149 |
+
</div>
|
150 |
+
</div>
|
151 |
+
</div>
|
152 |
+
</div>
|
153 |
+
</section>
|
154 |
+
</div>
|
155 |
+
|
156 |
+
</div>
|
157 |
+
|
158 |
+
<!-- Modal -->
|
159 |
+
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel"
|
160 |
+
aria-hidden="true">
|
161 |
+
<div class="modal-dialog" role="document">
|
162 |
+
<div class="modal-content">
|
163 |
+
<div class="modal-header">
|
164 |
+
<h5 class="modal-title" id="addModalLabel">Add Document</h5>
|
165 |
+
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
166 |
+
<span aria-hidden="true">×</span>
|
167 |
+
</button>
|
168 |
+
</div>
|
169 |
+
<div class="modal-body">
|
170 |
+
<form>
|
171 |
+
<div class="form-group">
|
172 |
+
<label for="APIName">API Name <span class="text-danger">*</span></label>
|
173 |
+
<input type="text" class="form-control" id="APIName" name="APIName" required>
|
174 |
+
</div>
|
175 |
+
<div class="form-group">
|
176 |
+
<label for="APIEndpoint">API Endpoint <span class="text-danger">*</span></label>
|
177 |
+
<input type="text" class="form-control" id="APIEndpoint" name="APIEndpoint" required>
|
178 |
+
</div>
|
179 |
+
<div class="form-group">
|
180 |
+
<label for="Auth_Bearer">Auth/Bearer token <span class="text-danger">*</span></label>
|
181 |
+
<input type="text" class="form-control" id="Auth_Bearer" name="Auth_Bearer" required>
|
182 |
+
</div>
|
183 |
+
<div class="form-group">
|
184 |
+
<label for="Inputjson">Input parameter <span class="text-danger">*</span></label>
|
185 |
+
<input type="text" class="form-control" id="Inputjson" name="Inputjson" required>
|
186 |
+
</div>
|
187 |
+
<div class="form-group">
|
188 |
+
<label for="OutputJson">Output Json <span class="text-danger">*</span></label>
|
189 |
+
<input type="text" class="form-control" id="OutputJson" name="OutputJson" required>
|
190 |
+
</div>
|
191 |
+
<div class="form-group">
|
192 |
+
<label for="Description">Description <span class="text-danger">*</span></label>
|
193 |
+
<textarea class="form-control" id="Description" name="Description" rows="3"
|
194 |
+
required></textarea>
|
195 |
+
</div>
|
196 |
+
</form>
|
197 |
+
</div>
|
198 |
+
<div class="modal-footer">
|
199 |
+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
200 |
+
<button type="button" id="save" onclick="save_file()" class="btn btn-primary">Save</button>
|
201 |
+
</div>
|
202 |
+
</div>
|
203 |
+
</div>
|
204 |
+
</div>
|
205 |
+
|
206 |
+
<!-- Include DataTables JS and your custom script -->
|
207 |
+
<script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
|
208 |
+
<script src="https://cdn.datatables.net/1.10.25/js/dataTables.bootstrap4.min.js"></script>
|
209 |
+
<script>
|
210 |
+
$(document).ready(function () {
|
211 |
+
// Initialize DataTable
|
212 |
+
$('#knowledgeTable').DataTable();
|
213 |
+
|
214 |
+
// Show modal function
|
215 |
+
$('#add').on('click', function () {
|
216 |
+
$('#addModal').modal('show');
|
217 |
+
});
|
218 |
+
|
219 |
+
// Your save file function here
|
220 |
+
async function save_file() {
|
221 |
+
alert('Save button clicked');
|
222 |
+
// Your save file logic goes here
|
223 |
+
}
|
224 |
+
});
|
225 |
+
</script>
|
226 |
+
</body>
|
227 |
+
|
228 |
+
</html>
|
templates/templates/chatbot.html
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# jinja2 html page with chatbot functionality using adminlte3 theme
|
2 |
+
<html>
|
3 |
+
<body>
|
4 |
+
<form id="myform">
|
5 |
+
<div class="content-wrapper">
|
6 |
+
<section class="content-header">
|
7 |
+
<div class="container-fluid">
|
8 |
+
<div class="row mb-2">
|
9 |
+
<div class="col-sm-6">
|
10 |
+
<h1>Chatbot</h1>
|
11 |
+
</div>
|
12 |
+
<div class="col-sm-6">
|
13 |
+
<ol class="breadcrumb float-sm-right">
|
14 |
+
<li class="breadcrumb-item"><a href="#">Home</a></li>
|
15 |
+
<li class="breadcrumb-item active">Chatbot</li>
|
16 |
+
</ol>
|
17 |
+
</div>
|
18 |
+
</div>
|
19 |
+
</div>
|
20 |
+
</section>
|
21 |
+
|
22 |
+
<section class="content">
|
23 |
+
<div class="container-fluid">
|
24 |
+
<div class="row">
|
25 |
+
<div class="col-md-8 offset-md-2">
|
26 |
+
<div class="card card-primary">
|
27 |
+
<div class="card-header">
|
28 |
+
<h3 class="card-title">Chat with our AI</h3>
|
29 |
+
</div>
|
30 |
+
<div class="card-body">
|
31 |
+
<div id="chat-container">
|
32 |
+
<div class="chat-messages">
|
33 |
+
<!-- Chat messages will be dynamically added here -->
|
34 |
+
</div>
|
35 |
+
<div class="chat-input">
|
36 |
+
<input type="text" id="user_question" placeholder="Type your message...">
|
37 |
+
<button id="send-button" onclick="clickform()">Send</button>
|
38 |
+
</div>
|
39 |
+
</div>
|
40 |
+
</div>
|
41 |
+
</div>
|
42 |
+
</div>
|
43 |
+
</div>
|
44 |
+
</div>
|
45 |
+
</section>
|
46 |
+
</div>
|
47 |
+
</form>
|
48 |
+
<script>
|
49 |
+
const chatContainer = document.getElementById('chat-container');
|
50 |
+
const userInput = document.getElementById('user_question');
|
51 |
+
const sendButton = document.getElementById('send-button');
|
52 |
+
|
53 |
+
function clickform() {
|
54 |
+
alert('Please enter');
|
55 |
+
var formElement = document.getElementById('myForm');
|
56 |
+
var user_question = document.getElementById('user_question').value;
|
57 |
+
alert(user_question);
|
58 |
+
//var data = new FormData(formElement);
|
59 |
+
//alert(data);
|
60 |
+
fetch('/chat_with_agent', {
|
61 |
+
method: 'POST',
|
62 |
+
//body: data,
|
63 |
+
})
|
64 |
+
.then(resp => resp.text()) // or, resp.json(), etc.
|
65 |
+
.then(data => {
|
66 |
+
//document.getElementById("responseArea").innerHTML = data;
|
67 |
+
alert(data);
|
68 |
+
const chatMessage = document.createElement('div');
|
69 |
+
chatMessage.classList.add('chat-message');
|
70 |
+
chatMessage.innerHTML = '<strong>You:</strong> ${user_question}<br><strong>AI:</strong> ${data}';
|
71 |
+
chatContainer.appendChild(chatMessage);
|
72 |
+
|
73 |
+
userInput.value = '';
|
74 |
+
userInput.focus();
|
75 |
+
})
|
76 |
+
.catch(error => {
|
77 |
+
console.error(error);
|
78 |
+
});
|
79 |
+
}
|
80 |
+
</script>
|
81 |
+
</body></html>
|
templates/templates/company_profile.html
ADDED
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
|
4 |
+
<head>
|
5 |
+
<meta charset="UTF-8">
|
6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7 |
+
<title>Company Profile</title>
|
8 |
+
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
9 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
|
10 |
+
<!-- Include AdminLTE CSS -->
|
11 |
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/adminlte.min.css">
|
12 |
+
<!-- Include DataTables CSS -->
|
13 |
+
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
|
14 |
+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css" rel="stylesheet" />
|
15 |
+
<link href="https://cdn.jsdelivr.net/npm/@ttskch/[email protected]/dist/select2-bootstrap4.min.css"
|
16 |
+
rel="stylesheet" />
|
17 |
+
|
18 |
+
<style>
|
19 |
+
.container {
|
20 |
+
margin-top: 10px;
|
21 |
+
margin-left: 420px;
|
22 |
+
align-items: center;
|
23 |
+
max-width: 600px;
|
24 |
+
padding: 10px;
|
25 |
+
border: 1px solid #ccc;
|
26 |
+
border-radius: 5px;
|
27 |
+
position: relative;
|
28 |
+
z-index: 1;
|
29 |
+
}
|
30 |
+
|
31 |
+
.container::before {
|
32 |
+
content: '';
|
33 |
+
position: absolute;
|
34 |
+
top: 50%;
|
35 |
+
left: 40%;
|
36 |
+
background: url('..\static\img\redmindlogo3.jpg') no-repeat center center;
|
37 |
+
background-size: contain;
|
38 |
+
opacity: 0.1;
|
39 |
+
width: 100%;
|
40 |
+
height: 90%;
|
41 |
+
z-index: -1;
|
42 |
+
}
|
43 |
+
|
44 |
+
.form-group {
|
45 |
+
margin-bottom: 5px;
|
46 |
+
}
|
47 |
+
|
48 |
+
.form-group label {
|
49 |
+
font-weight: bold;
|
50 |
+
margin-bottom: 5px;
|
51 |
+
display: block;
|
52 |
+
}
|
53 |
+
|
54 |
+
.form-group input .form-group select {
|
55 |
+
width: 100%;
|
56 |
+
padding: 10px;
|
57 |
+
border: 1px solid #ccc;
|
58 |
+
border-radius: 4px;
|
59 |
+
text-align: center;
|
60 |
+
}
|
61 |
+
|
62 |
+
.form-group select.select2-container--bootstrap4 .select2-selection--multiple {
|
63 |
+
height: auto;
|
64 |
+
/* Adjust height to fit content */
|
65 |
+
}
|
66 |
+
|
67 |
+
.btn-primary {
|
68 |
+
margin-right: 10px;
|
69 |
+
color: black;
|
70 |
+
font-size: 16px;
|
71 |
+
font-weight: bold;
|
72 |
+
}
|
73 |
+
|
74 |
+
h3 {
|
75 |
+
text-align: center;
|
76 |
+
margin-bottom: 10px;
|
77 |
+
}
|
78 |
+
|
79 |
+
.btn-container {
|
80 |
+
text-align: center;
|
81 |
+
margin-top: 10px;
|
82 |
+
color: white;
|
83 |
+
}
|
84 |
+
|
85 |
+
footer {
|
86 |
+
position: absolute;
|
87 |
+
bottom: 0;
|
88 |
+
width: 100%;
|
89 |
+
color: black;
|
90 |
+
text-align: right;
|
91 |
+
padding-right: 245px;
|
92 |
+
padding-top: 0px;
|
93 |
+
background-color: #f8f9fa;
|
94 |
+
border: none !important;
|
95 |
+
}
|
96 |
+
|
97 |
+
#llm_tools {
|
98 |
+
text-align: center;
|
99 |
+
font-weight: bold;
|
100 |
+
}
|
101 |
+
</style>
|
102 |
+
</head>
|
103 |
+
|
104 |
+
<body>
|
105 |
+
{% include 'sidepane.html' %}
|
106 |
+
<div class="container mt-4">
|
107 |
+
<h3>Company Profile</h3>
|
108 |
+
<form id="companyProfileForm" class="needs-validation" novalidate action="/submit_company_profile"
|
109 |
+
method="post">
|
110 |
+
<div class="form-group">
|
111 |
+
<label for="company_name">Company Name <span class="text-danger">*</span></label>
|
112 |
+
<input type="text" id="company_name" name="company_name" class="form-control" required>
|
113 |
+
<div class="invalid-feedback">
|
114 |
+
Please enter the company name.
|
115 |
+
</div>
|
116 |
+
</div>
|
117 |
+
<div class="form-group">
|
118 |
+
<label for="company_code">Company Code <span class="text-danger">*</span></label>
|
119 |
+
<input type="text" id="company_code" name="company_code" class="form-control" required>
|
120 |
+
<div class="invalid-feedback">
|
121 |
+
Please enter the company code.
|
122 |
+
</div>
|
123 |
+
</div>
|
124 |
+
<div class="form-group">
|
125 |
+
<label for="domain">Domain/Business <span class="text-danger">*</span></label>
|
126 |
+
<input type="text" id="domain" name="domain" class="form-control" required>
|
127 |
+
<div class="invalid-feedback">
|
128 |
+
Please enter the domain/business.
|
129 |
+
</div>
|
130 |
+
</div>
|
131 |
+
<div class="form-group">
|
132 |
+
<label for="llm_tools">LLM Tools <span class="text-danger">*</span></label>
|
133 |
+
<select type='text' id="llm_tools" name="llm_tools" class="form-control" multiple required>
|
134 |
+
<option value="Database">Database</option>
|
135 |
+
<option value="Static Documents">Static Documents</option>
|
136 |
+
<option value="API">API</option>
|
137 |
+
</select>
|
138 |
+
<div class="invalid-feedback">
|
139 |
+
Please select at least one LLM tool.
|
140 |
+
</div>
|
141 |
+
</div>
|
142 |
+
<div class="btn-container">
|
143 |
+
<button type="submit" class="btn btn-primary">Save</button>
|
144 |
+
<button type="reset" class="btn btn-primary">Clear</button>
|
145 |
+
</div>
|
146 |
+
</form>
|
147 |
+
</div>
|
148 |
+
|
149 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js"></script>
|
150 |
+
<script>
|
151 |
+
$(document).ready(function () {
|
152 |
+
// Initialize Select2 for multi-select dropdown
|
153 |
+
$('#llm_tools').select2({
|
154 |
+
theme: 'bootstrap4',
|
155 |
+
placeholder: 'Select',
|
156 |
+
allowClear: true
|
157 |
+
});
|
158 |
+
|
159 |
+
$('#companyProfileForm').on('submit', function (event) {
|
160 |
+
event.preventDefault(); // Prevent default form submission
|
161 |
+
|
162 |
+
// Gather form data
|
163 |
+
var formData = $(this).serialize();
|
164 |
+
|
165 |
+
$.ajax({
|
166 |
+
type: "POST",
|
167 |
+
url: "/submit_company_profile",
|
168 |
+
data: formData,
|
169 |
+
success: function (response) {
|
170 |
+
alert(response.message); // Show success message
|
171 |
+
setTimeout(function () {
|
172 |
+
window.location.href = '/company_profile'; // Redirect to the desired page after a delay
|
173 |
+
}, 2000); // Delay for 2 seconds (2000 milliseconds)
|
174 |
+
},
|
175 |
+
error: function (xhr) {
|
176 |
+
alert("An error occurred: " + xhr.responseJSON.detail); // Show error message
|
177 |
+
}
|
178 |
+
});
|
179 |
+
});
|
180 |
+
});
|
181 |
+
</script>
|
182 |
+
|
183 |
+
</body>
|
184 |
+
|
185 |
+
</html>
|
templates/templates/dashboard.html
ADDED
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html>
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<title>Dashboard</title>
|
6 |
+
<!-- AdminLTE CSS -->
|
7 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/admin-lte/3.1.0/css/adminlte.min.css">
|
8 |
+
</head>
|
9 |
+
|
10 |
+
<body class="hold-transition sidebar-mini">
|
11 |
+
<div class="wrapper">
|
12 |
+
<!-- Main Sidebar -->
|
13 |
+
<aside class="main-sidebar sidebar-dark-primary elevation-4">
|
14 |
+
<!-- Sidebar -->
|
15 |
+
<div class="sidebar">
|
16 |
+
<!-- Sidebar Menu -->
|
17 |
+
<nav class="mt-2">
|
18 |
+
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
|
19 |
+
<!-- Navigation Links -->
|
20 |
+
<li class="nav-item">
|
21 |
+
<a href="#" class="nav-link">
|
22 |
+
<i class="nav-icon fas fa-home"></i>
|
23 |
+
<p>Dashboard</p>
|
24 |
+
</a>
|
25 |
+
</li>
|
26 |
+
<li class="nav-item">
|
27 |
+
<a href="{{ url_for('company_profile') }}" class="nav-link">
|
28 |
+
<i class="nav-icon fas fa-cogs"></i>
|
29 |
+
<p>Company Profile</p>
|
30 |
+
</a>
|
31 |
+
</li>
|
32 |
+
<li class="nav-item">
|
33 |
+
<a href="{{ url_for('knowledgebase') }}" class="nav-link">
|
34 |
+
<i class="nav-icon fas fa-cogs"></i>
|
35 |
+
<p>KnowledgeBase</p>
|
36 |
+
</a>
|
37 |
+
</li>
|
38 |
+
<li class="nav-item">
|
39 |
+
<a href="{{ url_for('data_connectors') }}" class="nav-link">
|
40 |
+
<i class="nav-icon fas fa-home"></i>
|
41 |
+
<p>Data Connectors</p>
|
42 |
+
</a>
|
43 |
+
</li>
|
44 |
+
<li class="nav-item">
|
45 |
+
<a href="{{ url_for('API_connectors') }}" class="nav-link">
|
46 |
+
<i class="nav-icon fas fa-users"></i>
|
47 |
+
<p>API Connectors</p>
|
48 |
+
</a>
|
49 |
+
</li>
|
50 |
+
<li class="nav-item">
|
51 |
+
<a href="{{url_for('prompt_template')}}" class="nav-link">
|
52 |
+
<i class="nav-icon fas fa-cogs"></i>
|
53 |
+
<p>Prompt Templates</p>
|
54 |
+
</a>
|
55 |
+
</li>
|
56 |
+
<!-- <li class="nav-item">
|
57 |
+
<a href="#" class="nav-link">
|
58 |
+
<i class="nav-icon fas fa-cogs"></i>
|
59 |
+
<p>LLM Settings</p>
|
60 |
+
</a>
|
61 |
+
|
62 |
+
</li>-->
|
63 |
+
<li class="nav-item">
|
64 |
+
<a href="{{ url_for('chatbot') }}" class="nav-link">
|
65 |
+
<i class="nav-icon fas fa-cogs"></i>
|
66 |
+
<p>Chat</p>
|
67 |
+
</a>
|
68 |
+
</li>
|
69 |
+
|
70 |
+
<!-- Add more navigation links here -->
|
71 |
+
</ul>
|
72 |
+
</nav>
|
73 |
+
<!-- /.sidebar-menu -->
|
74 |
+
</div>
|
75 |
+
<!-- /.sidebar -->
|
76 |
+
</aside>
|
77 |
+
|
78 |
+
<!-- Content Wrapper -->
|
79 |
+
<div class="content-wrapper">
|
80 |
+
<!-- Main content -->
|
81 |
+
<section class="content">
|
82 |
+
<!-- Project Information -->
|
83 |
+
<div class="container-fluid">
|
84 |
+
<h3 style="text-align: center; margin-bottom:40px;">RedMindGPT</h>
|
85 |
+
</div>
|
86 |
+
</section>
|
87 |
+
<section class="content">
|
88 |
+
<div class="container-fluid">
|
89 |
+
|
90 |
+
<div class="row">
|
91 |
+
<div class="col-lg-4 col-6">
|
92 |
+
|
93 |
+
<div class="small-box bg-info">
|
94 |
+
<div class="inner">
|
95 |
+
<h3>4 </h3>
|
96 |
+
<h4> KnowledgeBase</h4>
|
97 |
+
</div>
|
98 |
+
<div class="icon">
|
99 |
+
<i class="ion ion-bag"></i>
|
100 |
+
</div>
|
101 |
+
</div>
|
102 |
+
</div>
|
103 |
+
|
104 |
+
<div class="col-lg-4 col-6">
|
105 |
+
|
106 |
+
<div class="small-box bg-success">
|
107 |
+
<div class="inner">
|
108 |
+
<h3>1</h3>
|
109 |
+
<h4>Data connectors</h4>
|
110 |
+
</div>
|
111 |
+
<div class="icon">
|
112 |
+
<i class="ion ion-stats-bars"></i>
|
113 |
+
</div>
|
114 |
+
|
115 |
+
</div>
|
116 |
+
</div>
|
117 |
+
|
118 |
+
<div class="col-lg-4 col-6">
|
119 |
+
|
120 |
+
<div class="small-box bg-warning">
|
121 |
+
<div class="inner">
|
122 |
+
<h3>4 </h3>
|
123 |
+
<h4>API Connectors</h4>
|
124 |
+
</div>
|
125 |
+
<div class="icon">
|
126 |
+
<i class="ion ion-person-add"></i>
|
127 |
+
</div>
|
128 |
+
|
129 |
+
</div>
|
130 |
+
</div>
|
131 |
+
|
132 |
+
<div class="col-lg-4 col-6">
|
133 |
+
|
134 |
+
<div class="small-box bg-warning">
|
135 |
+
<div class="inner">
|
136 |
+
<h3>5 </h3>
|
137 |
+
<h4>Prompt_Templates</h4>
|
138 |
+
</div>
|
139 |
+
<div class="icon">
|
140 |
+
<i class="ion ion-person-add"></i>
|
141 |
+
</div>
|
142 |
+
|
143 |
+
</div>
|
144 |
+
</div>
|
145 |
+
<!-- /.content -->
|
146 |
+
</div>
|
147 |
+
<!-- /.content-wrapper -->
|
148 |
+
</div>
|
149 |
+
<!-- ./wrapper -->
|
150 |
+
|
151 |
+
<!-- AdminLTE JS -->
|
152 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/admin-lte/3.1.0/js/adminlte.min.js"></script>
|
153 |
+
|
154 |
+
</body>
|
155 |
+
|
156 |
+
</html>
|
templates/templates/data_connectors.html
ADDED
@@ -0,0 +1,368 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
|
4 |
+
<head>
|
5 |
+
<meta charset="UTF-8">
|
6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7 |
+
<title>Data Connectors</title>
|
8 |
+
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
9 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
|
10 |
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/adminlte.min.css">
|
11 |
+
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
|
12 |
+
|
13 |
+
<style>
|
14 |
+
html,
|
15 |
+
body {
|
16 |
+
height: 90%;
|
17 |
+
margin: 0;
|
18 |
+
display: flex;
|
19 |
+
flex-direction: column;
|
20 |
+
}
|
21 |
+
|
22 |
+
body {
|
23 |
+
display: flex;
|
24 |
+
flex-direction: column;
|
25 |
+
min-height: 90%;
|
26 |
+
}
|
27 |
+
|
28 |
+
.main-content {
|
29 |
+
flex: 1;
|
30 |
+
display: flex;
|
31 |
+
flex-direction: column;
|
32 |
+
align-items: center;
|
33 |
+
justify-content: flex-start;
|
34 |
+
padding: 20px;
|
35 |
+
}
|
36 |
+
|
37 |
+
.container {
|
38 |
+
margin-top: 50px;
|
39 |
+
margin-left: 420px;
|
40 |
+
max-width: 600px;
|
41 |
+
padding: 10px;
|
42 |
+
border: 1px solid #ccc;
|
43 |
+
border-radius: 5px;
|
44 |
+
background-color: #fff;
|
45 |
+
position: relative;
|
46 |
+
z-index: 1;
|
47 |
+
}
|
48 |
+
|
49 |
+
.form-group {
|
50 |
+
margin-bottom: 20px;
|
51 |
+
}
|
52 |
+
|
53 |
+
.form-group label {
|
54 |
+
font-weight: bold;
|
55 |
+
margin-top: 5px;
|
56 |
+
margin-bottom: 5px;
|
57 |
+
display: block;
|
58 |
+
}
|
59 |
+
|
60 |
+
.form-group input,
|
61 |
+
.form-group select,
|
62 |
+
.form-group textarea {
|
63 |
+
width: 100%;
|
64 |
+
height: auto;
|
65 |
+
padding: 10px;
|
66 |
+
border: 1px solid #ccc;
|
67 |
+
border-radius: 4px;
|
68 |
+
}
|
69 |
+
|
70 |
+
.btn-primary {
|
71 |
+
margin-right: 10px;
|
72 |
+
color: black;
|
73 |
+
font-size: 16px;
|
74 |
+
font-weight: bold;
|
75 |
+
}
|
76 |
+
|
77 |
+
h2 {
|
78 |
+
text-align: center;
|
79 |
+
margin-bottom: 20px;
|
80 |
+
}
|
81 |
+
|
82 |
+
.btn-container {
|
83 |
+
text-align: center;
|
84 |
+
margin-top: 30px;
|
85 |
+
margin-bottom: 0px;
|
86 |
+
color: white;
|
87 |
+
}
|
88 |
+
|
89 |
+
#selectedTables,
|
90 |
+
#labelselected {
|
91 |
+
display: none;
|
92 |
+
}
|
93 |
+
|
94 |
+
#saveBtn1 {
|
95 |
+
display: none;
|
96 |
+
margin: 0 auto;
|
97 |
+
}
|
98 |
+
|
99 |
+
footer {
|
100 |
+
position: relative;
|
101 |
+
margin-top: auto;
|
102 |
+
width: 100%;
|
103 |
+
color: black;
|
104 |
+
text-align: right;
|
105 |
+
padding-right: 245px;
|
106 |
+
padding-top: 20px;
|
107 |
+
background-color: #f8f9fa;
|
108 |
+
border: none !important;
|
109 |
+
}
|
110 |
+
</style>
|
111 |
+
</head>
|
112 |
+
|
113 |
+
<body>
|
114 |
+
{% include 'sidepane.html' %}
|
115 |
+
<div class="main-content">
|
116 |
+
<div id="message-container"></div>
|
117 |
+
<div class="container mt-2">
|
118 |
+
<h2>Data Connectors</h2>
|
119 |
+
<div class="form-group">
|
120 |
+
<label for="company">Company Name <span class="text-danger">*</span></label>
|
121 |
+
<select type="text" id="company" name="company" class="form-control" required>
|
122 |
+
<option value="" selected>Select</option>
|
123 |
+
</select>
|
124 |
+
</div>
|
125 |
+
<form id="databaseconnectorForm" class="needs-validation" novalidate action="/save_data_connectors"
|
126 |
+
method="post" style="display:none;">
|
127 |
+
<div class="form-group">
|
128 |
+
<!-- <label for="company_id">company_id</label>--->
|
129 |
+
<input type="hidden" id="company_id" name="company_id" class="form-control" required>
|
130 |
+
</div>
|
131 |
+
<div class="row">
|
132 |
+
<div class="col-md-6">
|
133 |
+
<div class="form-group">
|
134 |
+
<label for="database">Database Type<span class="text-danger">*</span></label>
|
135 |
+
<select type="text" id="database" name="database" class="form-control" required>
|
136 |
+
<option value="" selected>Select</option>
|
137 |
+
<option value="Postgress">Postgres</option>
|
138 |
+
<option value="mysql">Mysql</option>
|
139 |
+
</select>
|
140 |
+
</div>
|
141 |
+
</div>
|
142 |
+
<div class="col-md-6">
|
143 |
+
<div class="form-group">
|
144 |
+
<label for="server">Server IP <span class="text-danger">*</span></label>
|
145 |
+
<input type="text" id="server" name="server" class="form-control" required>
|
146 |
+
</div>
|
147 |
+
</div>
|
148 |
+
</div>
|
149 |
+
<div class="row">
|
150 |
+
<div class="col-md-6">
|
151 |
+
<div class="form-group">
|
152 |
+
<label for="port">Port <span class="text-danger">*</span></label>
|
153 |
+
<input type="text" id="port" name="port" class="form-control" required>
|
154 |
+
</div>
|
155 |
+
</div>
|
156 |
+
<div class="col-md-6">
|
157 |
+
<div class="form-group">
|
158 |
+
<label for="databaseName">Database Name <span class="text-danger">*</span></label>
|
159 |
+
<input type="text" id="databaseName" name="databaseName" class="form-control" required>
|
160 |
+
</div>
|
161 |
+
</div>
|
162 |
+
</div>
|
163 |
+
<div class="row">
|
164 |
+
<div class="col-md-6">
|
165 |
+
<div class="form-group">
|
166 |
+
<label for="username">UserName <span class="text-danger">*</span></label>
|
167 |
+
<input type="text" id="username" name="username" class="form-control" required>
|
168 |
+
</div>
|
169 |
+
</div>
|
170 |
+
<div class="col-md-6">
|
171 |
+
<div class="form-group">
|
172 |
+
<label for="password">Password <span class="text-danger">*</span></label>
|
173 |
+
<input type="password" id="password" name="password" class="form-control" required>
|
174 |
+
</div>
|
175 |
+
</div>
|
176 |
+
</div>
|
177 |
+
<div class="btn-container">
|
178 |
+
<button type="button" id="connectBtn" class="btn btn-primary">Connect</button>
|
179 |
+
<button type="reset" class="btn btn-primary">Clear</button>
|
180 |
+
</div>
|
181 |
+
<div id="schema-table-section" style="display: none;">
|
182 |
+
<div class="form-group">
|
183 |
+
<div class="row">
|
184 |
+
<div class="col">
|
185 |
+
<label for="schemas">Available Schemas <span class="text-danger">*</span></label>
|
186 |
+
<select type="text" id="schemas" name="schemas" class="form-control" required>
|
187 |
+
<option value="" selected>Select</option>
|
188 |
+
<option value="schema1">Lookup</option>
|
189 |
+
<option value="schema2">Public</option>
|
190 |
+
<option value="schema3" selected>tenant_default</option>
|
191 |
+
</select>
|
192 |
+
</div>
|
193 |
+
<div class="col">
|
194 |
+
<label for="tables">Available Tables <span class="text-danger">*</span></label>
|
195 |
+
<select type="text" id="tables" name="tables" class="form-control" multiple required>
|
196 |
+
<option disabled>Select</option>
|
197 |
+
<option value="customer_master">customer_master</option>
|
198 |
+
<option value="efs_company_master">efs_company_master</option>
|
199 |
+
<option value="efs_group_company_master">efs_group_company_master</option>
|
200 |
+
<option value="efs_region_master">efs_region_master</option>
|
201 |
+
<option value="party_address_detail">party_address_detail</option>
|
202 |
+
<option value="wms_warehouse_master">wms_warehouse_master</option>
|
203 |
+
</select>
|
204 |
+
</div>
|
205 |
+
</div>
|
206 |
+
</div>
|
207 |
+
|
208 |
+
<div class="btn-container">
|
209 |
+
<button type="button" id="saveBtn" class="btn btn-primary">Save</button>
|
210 |
+
</div>
|
211 |
+
<div class="form-group">
|
212 |
+
<label for="selectedTables" id="labelselected">Selected Tables:</label>
|
213 |
+
<textarea type="text" id="selectedTables" name="selectedTables" class="form-control" rows="5"
|
214 |
+
readonly style="display:none;"></textarea>
|
215 |
+
</div>
|
216 |
+
<div class="btn-container">
|
217 |
+
<button type="submit" id="saveBtn1" class="btn btn-primary">Save Tables</button>
|
218 |
+
</div>
|
219 |
+
</div>
|
220 |
+
</form>
|
221 |
+
</div>
|
222 |
+
</div>
|
223 |
+
<footer>
|
224 |
+
<p></p>
|
225 |
+
</footer>
|
226 |
+
<script>
|
227 |
+
|
228 |
+
document.addEventListener('DOMContentLoaded', function () {
|
229 |
+
fetchCompanies();
|
230 |
+
|
231 |
+
const companySelect = document.getElementById('company');
|
232 |
+
const databaseconnectorForm = document.getElementById('databaseconnectorForm');
|
233 |
+
|
234 |
+
companySelect.addEventListener('change', async function () {
|
235 |
+
const selectedCompanyName = companySelect.options[companySelect.selectedIndex].text;
|
236 |
+
console.log(`Selected Company Name: ${selectedCompanyName}`);
|
237 |
+
|
238 |
+
if (selectedCompanyName !== "Select") {
|
239 |
+
try {
|
240 |
+
const response = await fetch(`/api/company_id?company_name=${encodeURIComponent(selectedCompanyName)}`);
|
241 |
+
if (!response.ok) {
|
242 |
+
throw new Error('Network response was not ok');
|
243 |
+
}
|
244 |
+
const data = await response.json();
|
245 |
+
console.log(`Company ID: ${data.company_id}`);
|
246 |
+
const companyId = data.company_id;
|
247 |
+
document.getElementById('company_id').value = companyId;
|
248 |
+
|
249 |
+
if (companyId) {
|
250 |
+
try {
|
251 |
+
const connectorsResponse = await fetch(`/api/check_data_connectors?company_id=${companyId}&company_name=${selectedCompanyName}`);
|
252 |
+
if (!connectorsResponse.ok) {
|
253 |
+
throw new Error('data connector Network response was not ok');
|
254 |
+
}
|
255 |
+
const connectorsData = await connectorsResponse.json();
|
256 |
+
//setMultiSelectValues(document.getElementById('database'), connectorsData.databasetype); // Ensure this is an array
|
257 |
+
//setMultiSelectValues(document.getElementById('databaseName'), connectorsData.database_name); // Ensure this is an array
|
258 |
+
document.getElementById('database').value = connectorsData.databasetype;
|
259 |
+
document.getElementById('server').value = connectorsData.serverip;
|
260 |
+
document.getElementById('port').value = connectorsData.port;
|
261 |
+
document.getElementById('databaseName').value = connectorsData.database_name;
|
262 |
+
document.getElementById('username').value = connectorsData.username;
|
263 |
+
document.getElementById('password').value = connectorsData.password;
|
264 |
+
document.getElementById('tables').value = connectorsData.dbtablename;
|
265 |
+
databaseconnectorForm.style.display = 'block';
|
266 |
+
|
267 |
+
} catch (error) {
|
268 |
+
document.getElementById('database').value = " ";
|
269 |
+
document.getElementById('server').value = " ";
|
270 |
+
document.getElementById('port').value = " ";
|
271 |
+
document.getElementById('databaseName').value = " ";
|
272 |
+
document.getElementById('username').value = " ";
|
273 |
+
document.getElementById('password').value = " ";
|
274 |
+
document.getElementById('tables').value = " ";
|
275 |
+
console.error('Error fetching data from data connectors:', error);
|
276 |
+
("Company name does not exist. Please fill in the details.");
|
277 |
+
|
278 |
+
// Optionally, you can insert a message into the DOM
|
279 |
+
const messageContainer = document.getElementById('message-container');
|
280 |
+
if (messageContainer) {
|
281 |
+
messageContainer.innerHTML = "<div class='alert alert-danger'>Database details does not exist for this Company name.. Please fill in the details.</div>";
|
282 |
+
}
|
283 |
+
|
284 |
+
databaseconnectorForm.style.display = 'block';
|
285 |
+
}
|
286 |
+
} else {
|
287 |
+
console.log(`Company ID does not exist, you can create and save data: ${data.company_id}`);
|
288 |
+
databaseconnectorForm.style.display = 'none';
|
289 |
+
}
|
290 |
+
|
291 |
+
} catch (error) {
|
292 |
+
|
293 |
+
console.error('Error fetching company ID or data connectors:', error);
|
294 |
+
databaseconnectorForm.style.display = 'none';
|
295 |
+
}
|
296 |
+
} else {
|
297 |
+
databaseconnectorForm.style.display = 'none';
|
298 |
+
}
|
299 |
+
});
|
300 |
+
|
301 |
+
document.getElementById("connectBtn").addEventListener("click", function (event) {
|
302 |
+
var database = document.getElementById("database").value;
|
303 |
+
var server = document.getElementById("server").value;
|
304 |
+
var port = document.getElementById("port").value;
|
305 |
+
var databaseName = document.getElementById("databaseName").value;
|
306 |
+
var username = document.getElementById("username").value;
|
307 |
+
var password = document.getElementById("password").value;
|
308 |
+
|
309 |
+
if (!database || !server || !port || !databaseName || !username || !password) {
|
310 |
+
alert("Please fill in all required fields.");
|
311 |
+
return;
|
312 |
+
}
|
313 |
+
|
314 |
+
document.getElementById("schema-table-section").style.display = "block";
|
315 |
+
});
|
316 |
+
|
317 |
+
document.getElementById("saveBtn").addEventListener("click", function (event) {
|
318 |
+
var tables = Array.from(document.getElementById("tables").selectedOptions).map(option => option.value);
|
319 |
+
if (tables.length === 0) {
|
320 |
+
alert("Please select at least one table.");
|
321 |
+
return;
|
322 |
+
}
|
323 |
+
|
324 |
+
var selectedTables = document.getElementById("selectedTables");
|
325 |
+
selectedTables.value = tables.join(", ");
|
326 |
+
selectedTables.style.display = "block";
|
327 |
+
document.getElementById("labelselected").style.display = "block";
|
328 |
+
document.getElementById("saveBtn1").style.display = "block";
|
329 |
+
});
|
330 |
+
});
|
331 |
+
|
332 |
+
async function fetchCompanies() {
|
333 |
+
try {
|
334 |
+
const response = await fetch('/api/companies');
|
335 |
+
if (!response.ok) {
|
336 |
+
throw new Error('Network response was not ok');
|
337 |
+
}
|
338 |
+
const data = await response.json();
|
339 |
+
displayCompanies(data.companies);
|
340 |
+
} catch (error) {
|
341 |
+
console.error('Error fetching companies:', error);
|
342 |
+
}
|
343 |
+
}
|
344 |
+
|
345 |
+
function displayCompanies(companies) {
|
346 |
+
const companySelect = document.getElementById('company');
|
347 |
+
companySelect.innerHTML = '<option value="" selected>Select</option>'; // Reset the dropdown
|
348 |
+
companies.forEach(company => {
|
349 |
+
const option = document.createElement('option');
|
350 |
+
option.value = company.name;
|
351 |
+
option.textContent = company.name;
|
352 |
+
companySelect.appendChild(option);
|
353 |
+
});
|
354 |
+
}
|
355 |
+
|
356 |
+
function setMultiSelectValues(selectElement, values) {
|
357 |
+
// Ensure values is an array
|
358 |
+
if (!Array.isArray(values)) {
|
359 |
+
values = [values];
|
360 |
+
}
|
361 |
+
Array.from(selectElement.options).forEach(option => {
|
362 |
+
option.selected = values.includes(option.value);
|
363 |
+
});
|
364 |
+
}
|
365 |
+
</script>
|
366 |
+
</body>
|
367 |
+
|
368 |
+
</html>
|
templates/templates/footer.html
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!-- footer.html -->
|
2 |
+
|
3 |
+
<!--
|
4 |
+
This is the HTML code for the footer section of a web page.
|
5 |
+
It displays the version number and copyright information.
|
6 |
+
|
7 |
+
HTML Structure:
|
8 |
+
- The footer element has a class of "main-footer".
|
9 |
+
- Inside the footer, there is a div element with classes "float-right" and "d-none d-sm-block".
|
10 |
+
- Inside the div, there is a bold tag (<b>) displaying the version number.
|
11 |
+
- After the div, there is a strong tag (<strong>) displaying the copyright information.
|
12 |
+
- The copyright information includes the year and a link to the company's website.
|
13 |
+
|
14 |
+
Example Usage:
|
15 |
+
<footer class="main-footer">
|
16 |
+
<div class="float-right d-none d-sm-block">
|
17 |
+
<b>Version</b> 3.0.5
|
18 |
+
</div>
|
19 |
+
<strong>© 2023 <a href="https://yourcompany.com">Your Company</a>.</strong> All rights reserved.
|
20 |
+
</footer>
|
21 |
+
-->
|
22 |
+
<footer class="main-footer" style="position: absolute; bottom: 0; width: 100%; color: black; text-align: right; padding-right:245px ;">
|
23 |
+
<div class="container-fluid">
|
24 |
+
<a href="https://redmindtechnologies.com" target="_blank" style="color: black; text-decoration: none;">Visit Redmind Technologies at https://redmindtechnologies.com</a>
|
25 |
+
</div>
|
26 |
+
</footer>
|
templates/templates/index.html
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--
|
2 |
+
This is the login page template for the RedMindGPT application.
|
3 |
+
It contains a login form where users can enter their username and password to sign in.
|
4 |
+
The form includes validation to ensure that both fields are filled out before submission.
|
5 |
+
The page also includes styling using CSS and utilizes the AdminLTE and Font Awesome libraries for additional design elements.
|
6 |
+
-->
|
7 |
+
|
8 |
+
<!DOCTYPE html>
|
9 |
+
<html lang="en">
|
10 |
+
<head>
|
11 |
+
<meta charset="UTF-8">
|
12 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
13 |
+
<style>
|
14 |
+
/* CSS styles for the login page */
|
15 |
+
.login-box-msg {
|
16 |
+
color: grey;
|
17 |
+
font-size: larger;
|
18 |
+
font-weight: bold;
|
19 |
+
}
|
20 |
+
|
21 |
+
.remember-me {
|
22 |
+
text-align: center;
|
23 |
+
}
|
24 |
+
</style>
|
25 |
+
<title>RedMindGPT</title>
|
26 |
+
<!-- AdminLTE CSS -->
|
27 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/adminlte.min.css">
|
28 |
+
<!-- Font Awesome -->
|
29 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
30 |
+
</head>
|
31 |
+
<body class="hold-transition login-page" style="background-image: url('static/img/AI.jpg'); background-size: cover;">
|
32 |
+
<div class="login-box">
|
33 |
+
<div class="card">
|
34 |
+
<!-- Logo -->
|
35 |
+
<div style="align-items: center;">
|
36 |
+
<a href="#" style="color: blue;
|
37 |
+
font-size: 30px;
|
38 |
+
font-weight: bold;
|
39 |
+
margin-left: 80px;
|
40 |
+
margin-top: 20px;
|
41 |
+
"><b>RedMindGPT</b></a>
|
42 |
+
</div>
|
43 |
+
<form action='/validate-user' name='loginForm' method="post" onsubmit="return validateForm()">
|
44 |
+
<div class="card-body login-card-body">
|
45 |
+
<p class="login-box-msg">Sign in</p>
|
46 |
+
<div class="input-group mb-3">
|
47 |
+
<input type="text" class="form-control" placeholder="Username" name="username" required>
|
48 |
+
<div class="input-group-append">
|
49 |
+
<div class="input-group-text">
|
50 |
+
<span class="fas fa-user"></span>
|
51 |
+
</div>
|
52 |
+
</div>
|
53 |
+
</div>
|
54 |
+
<div class="input-group mb-3">
|
55 |
+
<input type="password" class="form-control" placeholder="Password" name="password" required>
|
56 |
+
<div class="input-group-append">
|
57 |
+
<div class="input-group-text">
|
58 |
+
<span class="fas fa-lock"></span>
|
59 |
+
</div>
|
60 |
+
</div>
|
61 |
+
</div>
|
62 |
+
<div class="row" style="align-content: center;">
|
63 |
+
<div class="col-8">
|
64 |
+
<div class="icheck-primary">
|
65 |
+
<input type="checkbox" id="remember">
|
66 |
+
<label for="remember">
|
67 |
+
Remember Me
|
68 |
+
</label>
|
69 |
+
</div>
|
70 |
+
</div>
|
71 |
+
</div>
|
72 |
+
<div class="row" style="align-content: center;">
|
73 |
+
<div class="col-4">
|
74 |
+
<button type="submit" class="btn btn-primary btn-block">Sign In</button>
|
75 |
+
</div>
|
76 |
+
<div class="col-4">
|
77 |
+
<button type="reset" class="btn btn-secondary btn-block">Clear</button>
|
78 |
+
</div>
|
79 |
+
</div>
|
80 |
+
</div>
|
81 |
+
</form>
|
82 |
+
</div>
|
83 |
+
</div>
|
84 |
+
<!-- jQuery -->
|
85 |
+
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
86 |
+
<!-- Bootstrap 4 -->
|
87 |
+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.bundle.min.js"></script>
|
88 |
+
<!-- AdminLTE App -->
|
89 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/adminlte.min.js"></script>
|
90 |
+
<script>
|
91 |
+
// JavaScript function to validate the login form
|
92 |
+
function validateForm() {
|
93 |
+
//alert("Validating form");
|
94 |
+
var username = document.forms["loginForm"]["username"].value;
|
95 |
+
var password = document.forms["loginForm"]["password"].value;
|
96 |
+
if (username == "" || password == "") {
|
97 |
+
alert("Username and Password must be filled out");
|
98 |
+
return false;
|
99 |
+
}
|
100 |
+
}
|
101 |
+
</script>
|
102 |
+
</body>
|
103 |
+
</html>
|
templates/templates/knowledgebase.html
ADDED
@@ -0,0 +1,360 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html>
|
3 |
+
|
4 |
+
<head>
|
5 |
+
<title>Knowledge Base</title>
|
6 |
+
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
7 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
|
8 |
+
<!-- Include AdminLTE CSS -->
|
9 |
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/adminlte.min.css">
|
10 |
+
<!-- Include DataTables CSS -->
|
11 |
+
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
|
12 |
+
<!-- Include AdminLTE JS -->
|
13 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/adminlte.min.js"></script>
|
14 |
+
<!-- Include DataTables JS -->
|
15 |
+
<script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
|
16 |
+
<script src="https://cdn.datatables.net/1.10.25/js/dataTables.bootstrap4.min.js"></script>
|
17 |
+
<style>
|
18 |
+
body {
|
19 |
+
background-color: transparent !important;
|
20 |
+
}
|
21 |
+
|
22 |
+
.content-wrapper {
|
23 |
+
background-color: transparent !important;
|
24 |
+
text-align: center;
|
25 |
+
}
|
26 |
+
|
27 |
+
.wrapper {
|
28 |
+
background-color: transparent !important;
|
29 |
+
}
|
30 |
+
|
31 |
+
.modal-content {
|
32 |
+
background-color: #fff;
|
33 |
+
}
|
34 |
+
|
35 |
+
h1 {
|
36 |
+
text-align: center;
|
37 |
+
margin-bottom: 30px;
|
38 |
+
}
|
39 |
+
|
40 |
+
/* Adjust table width to full container width */
|
41 |
+
.card-body {
|
42 |
+
padding: 0;
|
43 |
+
}
|
44 |
+
|
45 |
+
.table {
|
46 |
+
width: 100%;
|
47 |
+
}
|
48 |
+
|
49 |
+
.text-wrap {
|
50 |
+
white-space: normal !important;
|
51 |
+
word-break: break-word;
|
52 |
+
}
|
53 |
+
|
54 |
+
.center-align {
|
55 |
+
padding-top: 20px;
|
56 |
+
display: flex;
|
57 |
+
justify-content: center;
|
58 |
+
align-items: center;
|
59 |
+
width: 100%;
|
60 |
+
}
|
61 |
+
|
62 |
+
.reduced-width {
|
63 |
+
width: 50%;
|
64 |
+
/* Adjust the percentage as needed */
|
65 |
+
}
|
66 |
+
</style>
|
67 |
+
</head>
|
68 |
+
|
69 |
+
<body>
|
70 |
+
{% include 'sidepane.html' %}
|
71 |
+
|
72 |
+
|
73 |
+
<div class="wrapper" style="position: relative; top: 0;">
|
74 |
+
<div class="content-wrapper">
|
75 |
+
<div class="content-header">
|
76 |
+
<div class="container-fluid">
|
77 |
+
<div class="container mt-2">
|
78 |
+
<h1 class="m-0 text-center" style="flex-grow: 1;">Knowledge Base</h1>
|
79 |
+
<div class="form-group center-align">
|
80 |
+
<label for="company" class="mr-2">Company Name <span class="text-danger">*</span></label>
|
81 |
+
<select type="text" id="company" name="company" class="form-control reduced-width" required>
|
82 |
+
<option value="" selected>Select</option>
|
83 |
+
</select>
|
84 |
+
</div>
|
85 |
+
</div>
|
86 |
+
</div>
|
87 |
+
</div>
|
88 |
+
<section class="content" id="contentSection" style="display: none;">
|
89 |
+
<div class="container-fluid">
|
90 |
+
<div class="form-group">
|
91 |
+
<!-- <label for="company_id">company_id</label>--->
|
92 |
+
<input type="hidden" id="company_id" name="company_id" class="form-control" required>
|
93 |
+
</div>
|
94 |
+
<div class="row">
|
95 |
+
<div class="col-12 d-flex justify-content-end mb-3">
|
96 |
+
<button class="btn btn-primary" id="add">Add</button>
|
97 |
+
</div>
|
98 |
+
<div class="row mb-2">
|
99 |
+
<div class="col-12">
|
100 |
+
<div class="col-12">
|
101 |
+
<div class="card">
|
102 |
+
<div class="card-body">
|
103 |
+
<div class="table-responsive">
|
104 |
+
<div id="message-container">
|
105 |
+
<table id="knowledgeTable" class="table table-bordered table-striped">
|
106 |
+
<thead>
|
107 |
+
<tr>
|
108 |
+
<th>Sno</th>
|
109 |
+
<th>Document Name</th>
|
110 |
+
<th>Document Description</th>
|
111 |
+
<th>Document Version</th>
|
112 |
+
<th>VectorDB Flag</th>
|
113 |
+
<th>View</th>
|
114 |
+
</tr>
|
115 |
+
</thead>
|
116 |
+
<tbody>
|
117 |
+
<tr>
|
118 |
+
<td>1</td>
|
119 |
+
<td>NewAge eWMS BusinessRequirementsDocument_V1.9 - Inbound
|
120 |
+
</td>
|
121 |
+
<td>GRN Inbound</td>
|
122 |
+
<td>1.9</td>
|
123 |
+
<td>Yes</td>
|
124 |
+
<td>
|
125 |
+
<button class="btn btn-primary viewButton">View</button>
|
126 |
+
</td>
|
127 |
+
</tr>
|
128 |
+
<tr>
|
129 |
+
<td>2</td>
|
130 |
+
<td>NewAge eWMS BusinessRequirementsDocument_V2.3 - Inbound
|
131 |
+
</td>
|
132 |
+
<td>GRN Inbound</td>
|
133 |
+
<td>2.3</td>
|
134 |
+
<td>No</td>
|
135 |
+
<td>
|
136 |
+
<button class="btn btn-primary viewButton">View</button>
|
137 |
+
</td>
|
138 |
+
</tr>
|
139 |
+
<tr>
|
140 |
+
<td>3</td>
|
141 |
+
<td>NewAge eWMS BusinessRequirementsDocument_V1.9 - Outbound
|
142 |
+
</td>
|
143 |
+
<td>GRN Outbound</td>
|
144 |
+
<td>1.9</td>
|
145 |
+
<td>Yes</td>
|
146 |
+
<td>
|
147 |
+
<button class="btn btn-primary viewButton">View</button>
|
148 |
+
</td>
|
149 |
+
</tr>
|
150 |
+
<tr>
|
151 |
+
<td>4</td>
|
152 |
+
<td class="text-wrap">NewAge eWMS
|
153 |
+
BusinessRequirementsDocument_V2.2 - Outbound</td>
|
154 |
+
<td>ASN Outbound</td>
|
155 |
+
<td>2.2</td>
|
156 |
+
<td>No</td>
|
157 |
+
<td>
|
158 |
+
<button class="btn btn-primary viewButton">View</button>
|
159 |
+
</td>
|
160 |
+
</tr>
|
161 |
+
</tbody>
|
162 |
+
</table>
|
163 |
+
</div>
|
164 |
+
</div>
|
165 |
+
</div>
|
166 |
+
</div>
|
167 |
+
</div>
|
168 |
+
</div>
|
169 |
+
</div>
|
170 |
+
</section>
|
171 |
+
</div>
|
172 |
+
|
173 |
+
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel"
|
174 |
+
aria-hidden="true">
|
175 |
+
<div class="modal-dialog" role="document">
|
176 |
+
<div class="modal-content">
|
177 |
+
<div class="modal-header">
|
178 |
+
<h5 class="modal-title" id="addModalLabel">Add Document</h5>
|
179 |
+
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
180 |
+
<span aria-hidden="true">×</span>
|
181 |
+
</button>
|
182 |
+
</div>
|
183 |
+
<div class="modal-body">
|
184 |
+
<div class="form-group">
|
185 |
+
<!-- <label for="company_id">company_id</label>--->
|
186 |
+
<input type="hidden" id="company_id" name="company_id" class="form-control" required>
|
187 |
+
</div>
|
188 |
+
<form id="documentForm">
|
189 |
+
<div class="form-group">
|
190 |
+
<label for="uploadFile">Upload File<span class="text-danger">*</span></label>
|
191 |
+
<input type="file" class="form-control-file" id="uploadFile" name="uploadFile" required accept=".pdf,.doc,.docx">
|
192 |
+
<small class="form-text text-muted">Accepted formats: .pdf, .doc, .docx</small>
|
193 |
+
</div>
|
194 |
+
<div class="form-group">
|
195 |
+
<label for="documentName">Document Name<span class="text-danger">*</span></label>
|
196 |
+
<input type="text" class="form-control" id="documentName" name="documentName" required>
|
197 |
+
</div>
|
198 |
+
<div class="form-group">
|
199 |
+
<label for="documentDescription">Document Description<span class="text-danger">*</span></label>
|
200 |
+
<textarea class="form-control" id="documentDescription" name="documentDescription"
|
201 |
+
rows="3" required></textarea>
|
202 |
+
</div>
|
203 |
+
<div class="form-group">
|
204 |
+
<label for="department">Department<span class="text-danger">*</span></label>
|
205 |
+
<input type="text" class="form-control" id="department" name="department" required>
|
206 |
+
</div>
|
207 |
+
<div class="form-group">
|
208 |
+
<label for="version">Version<span class="text-danger">*</span></label>
|
209 |
+
<input type="text" class="form-control" id="version" name="version" required>
|
210 |
+
</div>
|
211 |
+
<div class="form-group">
|
212 |
+
<label for="lastUpdated">Last Updated<span class="text-danger">*</span></label>
|
213 |
+
<input type="text" class="form-control" id="lastUpdated" name="lastUpdated" required>
|
214 |
+
</div>
|
215 |
+
</form>
|
216 |
+
</div>
|
217 |
+
<div class="modal-footer">
|
218 |
+
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
219 |
+
<button type="button" id="save" onclick="save_file()" class="btn btn-primary">Save</button>
|
220 |
+
</div>
|
221 |
+
</div>
|
222 |
+
</div>
|
223 |
+
</div>
|
224 |
+
</div>
|
225 |
+
<!-- JavaScript to handle modal display -->
|
226 |
+
<script>
|
227 |
+
document.addEventListener("DOMContentLoaded", function () {
|
228 |
+
now = new Date().toISOString().substr(0, 10);
|
229 |
+
document.getElementById('lastUpdated').value = now
|
230 |
+
// clearFormFields();
|
231 |
+
});
|
232 |
+
document.addEventListener('DOMContentLoaded', function () {
|
233 |
+
|
234 |
+
fetchCompanies();
|
235 |
+
|
236 |
+
const companySelect = document.getElementById('company');
|
237 |
+
const documentForm = document.getElementById('documentForm');
|
238 |
+
|
239 |
+
companySelect.addEventListener('change', async function () {
|
240 |
+
const selectedCompanyName = companySelect.options[companySelect.selectedIndex].text;
|
241 |
+
console.log(`Selected Company Name: ${selectedCompanyName}`);
|
242 |
+
|
243 |
+
if (selectedCompanyName !== "Select") {
|
244 |
+
|
245 |
+
try {
|
246 |
+
const response = await fetch(`/api/company_id?company_name=${encodeURIComponent(selectedCompanyName)}`);
|
247 |
+
if (!response.ok) {
|
248 |
+
contentSection.style.display='none';
|
249 |
+
const messageContainer = document.getElementById('message-container');
|
250 |
+
if (messageContainer) {
|
251 |
+
messageContainer.innerHTML = "<div class='alert alert-danger'>Document details do not exist for this company. Please fill in the details.</div>";
|
252 |
+
}
|
253 |
+
throw new Error('Network response was not ok');
|
254 |
+
}
|
255 |
+
const data = await response.json();
|
256 |
+
console.log(`Company ID: ${data.company_id}`);
|
257 |
+
const companyId = data.company_id;
|
258 |
+
document.getElementById('company_id').value = companyId;
|
259 |
+
|
260 |
+
if (companyId) {
|
261 |
+
contentSection.style.display = 'block';
|
262 |
+
}
|
263 |
+
|
264 |
+
|
265 |
+
} catch (error) {
|
266 |
+
console.error('Error fetching company ID or data documents:', error);
|
267 |
+
documentForm.style.display = 'none';
|
268 |
+
}
|
269 |
+
} else {
|
270 |
+
//clearFormFields();
|
271 |
+
documentForm.style.display = 'block';
|
272 |
+
}
|
273 |
+
});
|
274 |
+
});
|
275 |
+
function clearFormFields() {
|
276 |
+
document.getElementById('uploadFile').value = "";
|
277 |
+
document.getElementById('documentName').value = "";
|
278 |
+
document.getElementById('documentDescription').value = "";
|
279 |
+
document.getElementById('department').value = "";
|
280 |
+
document.getElementById('version').value = "";
|
281 |
+
//document.getElementById('lastUpdated').value = "";
|
282 |
+
}
|
283 |
+
|
284 |
+
|
285 |
+
$(document).ready(function () {
|
286 |
+
// Show modal function
|
287 |
+
$('#add').on('click', function () {
|
288 |
+
clearFormFields();
|
289 |
+
$('#addModal').modal('show');
|
290 |
+
});
|
291 |
+
$('.modal-footer .btn-secondary').on('click', function () {
|
292 |
+
$('#addModal').modal('hide');
|
293 |
+
});
|
294 |
+
// Your save file function here
|
295 |
+
// async function save_file() {
|
296 |
+
// alert('Save button clicked');
|
297 |
+
// // Your save file logic goes here
|
298 |
+
// }
|
299 |
+
});
|
300 |
+
function save_file() {
|
301 |
+
const uploadFile = document.getElementById("uploadFile").files[0];
|
302 |
+
const documentName = document.getElementById("documentName").value;
|
303 |
+
const documentDescription = document.getElementById("documentDescription").value;
|
304 |
+
const department = document.getElementById("department").value;
|
305 |
+
const version = document.getElementById("version").value;
|
306 |
+
const lastUpdated = document.getElementById("lastUpdated").value;
|
307 |
+
const company_id = document.getElementById("company_id").value;
|
308 |
+
|
309 |
+
const formData = new FormData();
|
310 |
+
formData.append("uploadFile", uploadFile);
|
311 |
+
formData.append("documentName", documentName);
|
312 |
+
formData.append("documentDescription", documentDescription);
|
313 |
+
formData.append("department", department);
|
314 |
+
formData.append("version", version);
|
315 |
+
formData.append("lastUpdated", lastUpdated);
|
316 |
+
formData.append("company_id", company_id);
|
317 |
+
|
318 |
+
fetch('/upload_document', {
|
319 |
+
method: 'POST',
|
320 |
+
body: formData
|
321 |
+
})
|
322 |
+
.then(response => {
|
323 |
+
if (!response.ok) {
|
324 |
+
throw new Error('Network response was not ok');
|
325 |
+
}
|
326 |
+
return response.text();
|
327 |
+
})
|
328 |
+
.then(data => {
|
329 |
+
alert('Document saved successfully');
|
330 |
+
// $('#addModal').modal('hide');
|
331 |
+
})
|
332 |
+
.catch(error => console.error('Error:', error));
|
333 |
+
}
|
334 |
+
async function fetchCompanies() {
|
335 |
+
try {
|
336 |
+
const response = await fetch('/api/companies');
|
337 |
+
if (!response.ok) {
|
338 |
+
throw new Error('Network response was not ok');
|
339 |
+
}
|
340 |
+
const data = await response.json();
|
341 |
+
displayCompanies(data.companies);
|
342 |
+
} catch (error) {
|
343 |
+
console.error('Error fetching companies:', error);
|
344 |
+
}
|
345 |
+
}
|
346 |
+
|
347 |
+
function displayCompanies(companies) {
|
348 |
+
const companySelect = document.getElementById('company');
|
349 |
+
companySelect.innerHTML = '<option value="" selected>Select</option>'; // Reset the dropdown
|
350 |
+
companies.forEach(company => {
|
351 |
+
const option = document.createElement('option');
|
352 |
+
option.value = company.name;
|
353 |
+
option.textContent = company.name;
|
354 |
+
companySelect.appendChild(option);
|
355 |
+
});
|
356 |
+
}
|
357 |
+
</script>
|
358 |
+
</body>
|
359 |
+
|
360 |
+
</html>
|
templates/templates/prompt_template.html
ADDED
@@ -0,0 +1,224 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html>
|
3 |
+
|
4 |
+
<head>
|
5 |
+
<title>Prompt Template</title>
|
6 |
+
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
7 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
|
8 |
+
<!-- Include AdminLTE CSS -->
|
9 |
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/adminlte.min.css">
|
10 |
+
<!-- Include DataTables CSS -->
|
11 |
+
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
|
12 |
+
<style>
|
13 |
+
.header-row {
|
14 |
+
display: flex;
|
15 |
+
justify-content: space-between;
|
16 |
+
align-items: center;
|
17 |
+
}
|
18 |
+
|
19 |
+
h2 {
|
20 |
+
text-align: center;
|
21 |
+
}
|
22 |
+
|
23 |
+
.table-container {
|
24 |
+
width: 100%;
|
25 |
+
overflow-x: auto;
|
26 |
+
}
|
27 |
+
|
28 |
+
.wrapper {
|
29 |
+
display: flex;
|
30 |
+
flex-direction: column;
|
31 |
+
height: 100vh;
|
32 |
+
}
|
33 |
+
|
34 |
+
.content-wrapper {
|
35 |
+
flex: 1;
|
36 |
+
overflow-y: auto;
|
37 |
+
}
|
38 |
+
|
39 |
+
.content-header {
|
40 |
+
padding: 1rem;
|
41 |
+
}
|
42 |
+
|
43 |
+
.footer {
|
44 |
+
text-align: right;
|
45 |
+
padding: 10px;
|
46 |
+
}
|
47 |
+
|
48 |
+
th,
|
49 |
+
td {
|
50 |
+
white-space: nowrap;
|
51 |
+
}
|
52 |
+
|
53 |
+
th:nth-child(1),
|
54 |
+
td:nth-child(1) {
|
55 |
+
/* Sno column */
|
56 |
+
width: 3%;
|
57 |
+
}
|
58 |
+
|
59 |
+
th:nth-child(2),
|
60 |
+
td:nth-child(2) {
|
61 |
+
/* API Name column */
|
62 |
+
width: 20%;
|
63 |
+
}
|
64 |
+
|
65 |
+
th:nth-child(3),
|
66 |
+
td:nth-child(3) {
|
67 |
+
/* API Endpoint column */
|
68 |
+
width: 40%;
|
69 |
+
}
|
70 |
+
|
71 |
+
th:nth-child(4),
|
72 |
+
td:nth-child(4) {
|
73 |
+
/* Auth/Bearer token column */
|
74 |
+
width: 20%;
|
75 |
+
}
|
76 |
+
|
77 |
+
th:nth-child(5),
|
78 |
+
td:nth-child(5) {
|
79 |
+
/* View column */
|
80 |
+
width: 15%;
|
81 |
+
}
|
82 |
+
</style>
|
83 |
+
</head>
|
84 |
+
|
85 |
+
<body>
|
86 |
+
{% include 'sidepane.html' %}
|
87 |
+
|
88 |
+
<div class="wrapper">
|
89 |
+
<div class="content-wrapper">
|
90 |
+
<!-- Content Header (Page header) -->
|
91 |
+
<div class="content-header">
|
92 |
+
<div class="container-fluid">
|
93 |
+
<div class="row mb-2">
|
94 |
+
<div class="col-12">
|
95 |
+
<div class="header-row">
|
96 |
+
<h2 class="m-0 text-center" style="flex-grow: 1;">Prompt Template</h2>
|
97 |
+
<button class="btn btn-primary" id="add">Add</button>
|
98 |
+
</div>
|
99 |
+
</div>
|
100 |
+
</div>
|
101 |
+
</div>
|
102 |
+
</div>
|
103 |
+
<!-- Main content -->
|
104 |
+
<section class="content">
|
105 |
+
<div class="container-fluid">
|
106 |
+
<div class="row">
|
107 |
+
<div class="col-12">
|
108 |
+
<div class="card">
|
109 |
+
<div class="card-body table-container">
|
110 |
+
<table id="knowledgeTable" class="table table-bordered table-striped">
|
111 |
+
<thead>
|
112 |
+
<tr>
|
113 |
+
<th>Sno</th>
|
114 |
+
<th>Scenario</th>
|
115 |
+
<th>Sample Prompt</th>
|
116 |
+
<th>Comments</th>
|
117 |
+
<th>View</th>
|
118 |
+
</tr>
|
119 |
+
</thead>
|
120 |
+
<tbody>
|
121 |
+
<tr>
|
122 |
+
<td>1</td>
|
123 |
+
<td>Creating new database in mysql</td>
|
124 |
+
<td>Need DB step for mysql with DB name = wwp, table name = customer_master with column name = name as datatype = string. (sample prompt).</td>
|
125 |
+
<td>It didn't create database instead its showed how to make connection to database and create table.</td>
|
126 |
+
<td><button class="btn btn-primary viewButton">View</button></td>
|
127 |
+
</tr>
|
128 |
+
<tr>
|
129 |
+
<td>2</td>
|
130 |
+
<td>Creating data table with columns</td>
|
131 |
+
<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>
|
132 |
+
<td>Expected response but adminlte theme was missing.</td>
|
133 |
+
<td><button class="btn btn-primary viewButton">View</button></td>
|
134 |
+
</tr>
|
135 |
+
<tr>
|
136 |
+
<td>3</td>
|
137 |
+
<td>Creating home page with adminlte theme.</td>
|
138 |
+
<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.
|
139 |
+
|
140 |
+
example: https://adminlte.io/themes/v3/index3.html
|
141 |
+
|
142 |
+
use this example for theme/html page. recreate it exactly like that
|
143 |
+
.image.png
|
144 |
+
</td>
|
145 |
+
<td>It created a html page but lacked side bar, nav bar present in url.
|
146 |
+
</td>
|
147 |
+
<td><button class="btn btn-primary viewButton">View</button></td>
|
148 |
+
</tr>
|
149 |
+
<tr>
|
150 |
+
<td>4</td>
|
151 |
+
<td>Including side bar menu in customer master</td>
|
152 |
+
<td>I want the side bar menu from admintle_theme to be present in customer_configuration.php</td>
|
153 |
+
<td>It gave expected results.
|
154 |
+
</td>
|
155 |
+
<td><button class="btn btn-primary viewButton">View</button></td>
|
156 |
+
</tr>
|
157 |
+
</tbody>
|
158 |
+
</table>
|
159 |
+
</div>
|
160 |
+
</div>
|
161 |
+
</div>
|
162 |
+
</div>
|
163 |
+
</div>
|
164 |
+
</section>
|
165 |
+
</div>
|
166 |
+
|
167 |
+
</div>
|
168 |
+
|
169 |
+
<!-- Modal -->
|
170 |
+
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel"
|
171 |
+
aria-hidden="true">
|
172 |
+
<div class="modal-dialog" role="document">
|
173 |
+
<div class="modal-content">
|
174 |
+
<div class="modal-header">
|
175 |
+
<h5 class="modal-title" id="addModalLabel">Add Prompt</h5>
|
176 |
+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
177 |
+
</div>
|
178 |
+
<div class="modal-body">
|
179 |
+
<form id="addPromptForm">
|
180 |
+
<div class="form-group">
|
181 |
+
<label for="APIName">Scenario <span class="text-danger">*</span></label>
|
182 |
+
<input type="text" class="form-control" id="APIName" name="APIName" required>
|
183 |
+
</div>
|
184 |
+
<div class="form-group">
|
185 |
+
<label for="APIEndpoint">Sample Prompt <span class="text-danger">*</span></label>
|
186 |
+
<input type="text" class="form-control" id="APIEndpoint" name="APIEndpoint" required>
|
187 |
+
</div>
|
188 |
+
<div class="form-group">
|
189 |
+
<label for="Auth_Bearer">Comments <span class="text-danger">*</span></label>
|
190 |
+
<input type="text" class="form-control" id="Auth_Bearer" name="Auth_Bearer" required>
|
191 |
+
</div>
|
192 |
+
</form>
|
193 |
+
</div>
|
194 |
+
<div class="modal-footer">
|
195 |
+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
196 |
+
<button type="button" id="save" onclick="save_file()" class="btn btn-primary">Save</button>
|
197 |
+
</div>
|
198 |
+
</div>
|
199 |
+
</div>
|
200 |
+
</div>
|
201 |
+
|
202 |
+
<!-- Include DataTables JS and your custom script -->
|
203 |
+
<script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
|
204 |
+
<script src="https://cdn.datatables.net/1.10.25/js/dataTables.bootstrap4.min.js"></script>
|
205 |
+
<script>
|
206 |
+
$(document).ready(function () {
|
207 |
+
// Initialize DataTable
|
208 |
+
$('#knowledgeTable').DataTable();
|
209 |
+
|
210 |
+
// Show modal function
|
211 |
+
$('#add').on('click', function () {
|
212 |
+
$('#addModal').modal('show');
|
213 |
+
});
|
214 |
+
|
215 |
+
// Your save file function here
|
216 |
+
function save_file() {
|
217 |
+
alert('Save button clicked');
|
218 |
+
// Your save file logic goes here
|
219 |
+
}
|
220 |
+
});
|
221 |
+
</script>
|
222 |
+
</body>
|
223 |
+
|
224 |
+
</html>
|
templates/templates/redmindlogo2.jpg
ADDED
![]() |
templates/templates/redmindlogo3.jpg
ADDED
![]() |
templates/templates/sidepane.html
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!-- sidepane.html -->
|
2 |
+
|
3 |
+
<!-- This file represents the sidepane component of a web application. It contains the navigation menu and sidebar. -->
|
4 |
+
|
5 |
+
<nav class="main-header navbar navbar-expand navbar-white navbar-light" style="text-align: center;">
|
6 |
+
<div class="container-fluid d-flex justify-content-center align-items-center">
|
7 |
+
<img src="..\static\img\redmindlogo3.jpg" alt="Logo" style="width: 80px; height: auto; margin-right: 10px;">
|
8 |
+
|
9 |
+
<h2 style="text-align: center; margin-bottom: 0;">Redmind GPT</h2>
|
10 |
+
</div>
|
11 |
+
<!-- Left navbar links -->
|
12 |
+
<ul class="navbar-nav">
|
13 |
+
<li class="nav-item">
|
14 |
+
<a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
|
15 |
+
</li>
|
16 |
+
</ul>
|
17 |
+
</nav>
|
18 |
+
|
19 |
+
<!-- Main Sidebar Container -->
|
20 |
+
<aside class="main-sidebar sidebar-dark-primary elevation-4" style="width: 200px;">
|
21 |
+
<!-- Sidebar -->
|
22 |
+
<div class="sidebar">
|
23 |
+
<!-- Sidebar Menu -->
|
24 |
+
<nav class="mt-2">
|
25 |
+
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
|
26 |
+
<!-- Navigation Links -->
|
27 |
+
<li class="nav-item">
|
28 |
+
<a href="#" class="nav-link">
|
29 |
+
<i class="nav-icon fas fa-home"></i>
|
30 |
+
<p>Dashboard</p>
|
31 |
+
</a>
|
32 |
+
</li>
|
33 |
+
<li class="nav-item">
|
34 |
+
<a href="{{ url_for('company_profile') }}" class="nav-link">
|
35 |
+
<i class="nav-icon fas fa-users"></i>
|
36 |
+
<p>Company Profile</p>
|
37 |
+
</a>
|
38 |
+
</li>
|
39 |
+
<li class="nav-item">
|
40 |
+
<a href="{{ url_for('knowledgebase') }}" class="nav-link">
|
41 |
+
<i class="nav-icon fas fa-cogs"></i>
|
42 |
+
<p>KnowledgeBase</p>
|
43 |
+
</a>
|
44 |
+
</li>
|
45 |
+
<li class="nav-item">
|
46 |
+
<a href="{{ url_for('data_connectors') }}" class="nav-link">
|
47 |
+
<i class="nav-icon fas fa-home"></i>
|
48 |
+
<p>Data Connectors</p>
|
49 |
+
</a>
|
50 |
+
</li>
|
51 |
+
<li class="nav-item">
|
52 |
+
<a href="{{ url_for('API_connectors') }}" class="nav-link">
|
53 |
+
<i class="nav-icon fas fa-users"></i>
|
54 |
+
<p>API Connectors</p>
|
55 |
+
</a>
|
56 |
+
</li>
|
57 |
+
<li class="nav-item">
|
58 |
+
<a href="{{url_for('prompt_template')}}" class="nav-link">
|
59 |
+
<i class="nav-icon fas fa-cogs"></i>
|
60 |
+
<p>Prompt Templates</p>
|
61 |
+
</a>
|
62 |
+
</li>
|
63 |
+
<!--<li class="nav-item">
|
64 |
+
<a href="#" class="nav-link">
|
65 |
+
<i class="nav-icon fas fa-cogs"></i>
|
66 |
+
<p>LLM Settings</p>
|
67 |
+
</a>
|
68 |
+
<ul class="nav nav-treeview">
|
69 |
+
<li class="nav-item">
|
70 |
+
<a href="#" class="nav-link">
|
71 |
+
<i class="far fa-circle nav-icon"></i>
|
72 |
+
<p>Sublink 1</p>
|
73 |
+
</a>
|
74 |
+
</li>
|
75 |
+
<li class="nav-item">
|
76 |
+
<a href="#" class="nav-link">
|
77 |
+
<i class="far fa-circle nav-icon"></i>
|
78 |
+
<p>Sublink 2</p>
|
79 |
+
</a>
|
80 |
+
</li>
|
81 |
+
<!-- Add more sublinks here -->
|
82 |
+
</ul>
|
83 |
+
</li> -->
|
84 |
+
|
85 |
+
<!-- Add more navigation links here -->
|
86 |
+
</ul>
|
87 |
+
</nav>
|
88 |
+
<!-- /.sidebar-menu -->
|
89 |
+
</div>
|
90 |
+
<!-- /.sidebar -->
|
91 |
+
</aside>
|
92 |
+
|
93 |
+
|
94 |
+
<!-- AdminLTE JS -->
|
95 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/admin-lte/3.1.0/js/adminlte.min.js"></script>
|