Aravind08 commited on
Commit
c532f8a
·
1 Parent(s): ba95f6e

update the table template

Browse files
redmindgen.log CHANGED
The diff for this file is too large to render. See raw diff
 
templates/API_connectors.html CHANGED
@@ -16,6 +16,18 @@
16
  </head>
17
 
18
  <body>
 
 
 
 
 
 
 
 
 
 
 
 
19
  {% include 'sidepane.html' %}
20
 
21
  <div class="wrapper">
@@ -24,7 +36,7 @@
24
  <div class="content-header">
25
  <div class="container-fluid">
26
  <div class="container mt-2">
27
- <div class="form-group left-align"id="company-select">
28
  <h4 id="selectedCompany" style="margin-left: 300px;"></h4>
29
 
30
  <!-- <div class="col-12 d-flex justify-content-end mb-3">
@@ -46,7 +58,7 @@
46
  <input type="hidden" id="company_id" name="company_id" class="form-control" required>
47
  </div>
48
  </div>
49
-
50
 
51
  <!-- Main content -->
52
  <section class="content">
@@ -54,7 +66,8 @@
54
  <div class="row">
55
  <div class="col-12">
56
  <div class="card">
57
- <div class="card-body table-container">
 
58
  <table id="apiTable" class="table table-bordered table-striped">
59
  <thead>
60
  <tr>
@@ -185,22 +198,22 @@
185
  // });
186
 
187
  });
188
- var table = $('#apiTable').DataTable();
189
- const role = sessionStorage.getItem('userRole');
190
- console.log('Current role:', role); // Debug statement to check the role
191
- const company_name=sessionStorage.getItem('company_name');
192
- console.log("company_name",company_name);
193
- // document.getElementById('company_name').textContent = company_name;
194
- const passedCompanyName = sessionStorage.getItem('company_name')
195
- document.getElementById('selectedCompany').innerText = `Company Name: ${passedCompanyName}`;
196
- const company_id = sessionStorage.getItem('company_id');
197
- document.getElementById("company_id").value = company_id;
 
 
198
 
199
- data_get_from_db(company_id);
200
 
201
-
202
- const companySelect = document.getElementById('company');
203
- const documentForm = document.getElementById('documentForm');
204
 
205
 
206
  function moveToNextInput(inputs, currentIndex) {
@@ -214,20 +227,20 @@
214
  }
215
 
216
 
217
- function displayErrorMessage(message) {
218
- const messageContainer = document.getElementById('message-container');
219
- if (messageContainer) {
220
- messageContainer.innerHTML = `<div class='alert alert-danger'>${message}</div>`;
221
- }
222
  }
 
 
223
 
224
-
225
 
226
 
227
  async function data_get_from_db(companyId) {
228
  if (companyId) {
229
  try {
230
- console.log('comp_id',companyId)
231
  const Response = await fetch(`/api/get_api_connectors?company_id=${companyId}`);
232
  console.log("responce from api :==> ", Response)
233
  const connectorsResponse = await Response.json();
@@ -274,67 +287,65 @@
274
  var companyId = $(button).data('kid-id');
275
  const modalTitle = document.getElementById('addModalLabel');
276
  modalTitle.textContent = 'View API Details';
277
- if(companyId)
278
- {
279
- $.getJSON(`/api/viewapiconnectors/${companyId}`, function (company) {
280
-
281
- $('#APIName').val(company.api_name).attr('readonly', 'readonly');
282
- $('#APIEndpoint').val(company.api_endpoint).attr('readonly', 'readonly');
283
- $('#Auth_Bearer').val(company.auth_token).attr('readonly', 'readonly');
284
- $('#Inputjson').val(company.input_param).attr('readonly', 'readonly');
285
- $('#OutputJson').val(company.output_json).attr('readonly', 'readonly');
286
- $('#Description').val(company.description).attr('readonly', 'readonly');
287
- $('#save').hide();
288
- $('#saveupdate').hide();
289
- $('#addModal').modal('show');
290
- }).fail(function () {
291
- alert("Error retrieving API details.");
292
- });
293
  }
294
- }
295
  // Edit knowledge base details
296
  function editCompany(button) {
297
  var companyId = $(button).data('kid-id');
298
  const modalTitle = document.getElementById('addModalLabel');
299
  modalTitle.textContent = 'Edit API Details';
300
- if(companyId)
301
- {
302
- // Fetch company details by ID
303
- $.getJSON(`/api/viewapiconnectors/${companyId}`, function (company) {
304
-
305
- $('#APIName').val(company.api_name);
306
- $('#APIEndpoint').val(company.api_endpoint);
307
- $('#Auth_Bearer').val(company.auth_token);
308
- $('#Inputjson').val(company.input_param);
309
- $('#OutputJson').val(company.output_json);
310
- $('#Description').val(company.description);
311
-
312
- // Show/hide appropriate elements
313
- $('#uploadFile').show(); // Hide the file upload field
314
- $('#save').hide(); // Hide the default save button
315
- $('#saveupdate').show(); // Show the update button
316
-
317
- // Ensure fields are editable
318
- $('#APIName').removeAttr('readonly');
319
- $('#APIEndpoint').removeAttr('readonly');
320
- $('#Auth_Bearer').removeAttr('readonly');
321
- $('#Inputjson').removeAttr('readonly');
322
- $('#OutputJson').removeAttr('readonly');
323
- $('#Description').removeAttr('readonly');
324
-
325
-
326
- // Show the modal
327
- $('#addModal').modal('show');
328
-
329
- // Set up the click event for the update button
330
- $('#saveupdate').off('click').on('click', function () {
331
- saveupdate(companyId); // Pass the company ID for updating
 
 
332
  });
333
- }).fail(function () {
334
- alert("Error in retrieving API details.");
335
- });
336
  }
337
- }
338
 
339
  function saveupdate(companyId, filename) {
340
  const formData = new FormData();
@@ -517,7 +528,7 @@
517
  document.getElementById('Description').value = "";
518
  }
519
 
520
-
521
  </script>
522
  </body>
523
 
 
16
  </head>
17
 
18
  <body>
19
+ <style>
20
+ #add {
21
+ position: absolute;
22
+ right: 1%;
23
+ top: 7%;
24
+ }
25
+
26
+ #apiTable_filter {
27
+ margin-right: 60px;
28
+ margin-top: -18px;
29
+ }
30
+ </style>
31
  {% include 'sidepane.html' %}
32
 
33
  <div class="wrapper">
 
36
  <div class="content-header">
37
  <div class="container-fluid">
38
  <div class="container mt-2">
39
+ <div class="form-group left-align" id="company-select">
40
  <h4 id="selectedCompany" style="margin-left: 300px;"></h4>
41
 
42
  <!-- <div class="col-12 d-flex justify-content-end mb-3">
 
58
  <input type="hidden" id="company_id" name="company_id" class="form-control" required>
59
  </div>
60
  </div>
61
+
62
 
63
  <!-- Main content -->
64
  <section class="content">
 
66
  <div class="row">
67
  <div class="col-12">
68
  <div class="card">
69
+ <button class="btn btn-primary me-3" id="add">Add</button>
70
+ <div class="card-body table-container pt-5">
71
  <table id="apiTable" class="table table-bordered table-striped">
72
  <thead>
73
  <tr>
 
198
  // });
199
 
200
  });
201
+ var table = $('#apiTable').DataTable();
202
+ const role = sessionStorage.getItem('userRole');
203
+ console.log('Current role:', role); // Debug statement to check the role
204
+ const company_name = sessionStorage.getItem('company_name');
205
+ console.log("company_name", company_name);
206
+ // document.getElementById('company_name').textContent = company_name;
207
+ const passedCompanyName = sessionStorage.getItem('company_name')
208
+ document.getElementById('selectedCompany').innerText = `Company Name: ${passedCompanyName}`;
209
+ const company_id = sessionStorage.getItem('company_id');
210
+ document.getElementById("company_id").value = company_id;
211
+
212
+ data_get_from_db(company_id);
213
 
 
214
 
215
+ const companySelect = document.getElementById('company');
216
+ const documentForm = document.getElementById('documentForm');
 
217
 
218
 
219
  function moveToNextInput(inputs, currentIndex) {
 
227
  }
228
 
229
 
230
+ function displayErrorMessage(message) {
231
+ const messageContainer = document.getElementById('message-container');
232
+ if (messageContainer) {
233
+ messageContainer.innerHTML = `<div class='alert alert-danger'>${message}</div>`;
 
234
  }
235
+ }
236
+
237
 
 
238
 
239
 
240
  async function data_get_from_db(companyId) {
241
  if (companyId) {
242
  try {
243
+ console.log('comp_id', companyId)
244
  const Response = await fetch(`/api/get_api_connectors?company_id=${companyId}`);
245
  console.log("responce from api :==> ", Response)
246
  const connectorsResponse = await Response.json();
 
287
  var companyId = $(button).data('kid-id');
288
  const modalTitle = document.getElementById('addModalLabel');
289
  modalTitle.textContent = 'View API Details';
290
+ if (companyId) {
291
+ $.getJSON(`/api/viewapiconnectors/${companyId}`, function (company) {
292
+
293
+ $('#APIName').val(company.api_name).attr('readonly', 'readonly');
294
+ $('#APIEndpoint').val(company.api_endpoint).attr('readonly', 'readonly');
295
+ $('#Auth_Bearer').val(company.auth_token).attr('readonly', 'readonly');
296
+ $('#Inputjson').val(company.input_param).attr('readonly', 'readonly');
297
+ $('#OutputJson').val(company.output_json).attr('readonly', 'readonly');
298
+ $('#Description').val(company.description).attr('readonly', 'readonly');
299
+ $('#save').hide();
300
+ $('#saveupdate').hide();
301
+ $('#addModal').modal('show');
302
+ }).fail(function () {
303
+ alert("Error retrieving API details.");
304
+ });
305
+ }
306
  }
 
307
  // Edit knowledge base details
308
  function editCompany(button) {
309
  var companyId = $(button).data('kid-id');
310
  const modalTitle = document.getElementById('addModalLabel');
311
  modalTitle.textContent = 'Edit API Details';
312
+ if (companyId) {
313
+ // Fetch company details by ID
314
+ $.getJSON(`/api/viewapiconnectors/${companyId}`, function (company) {
315
+
316
+ $('#APIName').val(company.api_name);
317
+ $('#APIEndpoint').val(company.api_endpoint);
318
+ $('#Auth_Bearer').val(company.auth_token);
319
+ $('#Inputjson').val(company.input_param);
320
+ $('#OutputJson').val(company.output_json);
321
+ $('#Description').val(company.description);
322
+
323
+ // Show/hide appropriate elements
324
+ $('#uploadFile').show(); // Hide the file upload field
325
+ $('#save').hide(); // Hide the default save button
326
+ $('#saveupdate').show(); // Show the update button
327
+
328
+ // Ensure fields are editable
329
+ $('#APIName').removeAttr('readonly');
330
+ $('#APIEndpoint').removeAttr('readonly');
331
+ $('#Auth_Bearer').removeAttr('readonly');
332
+ $('#Inputjson').removeAttr('readonly');
333
+ $('#OutputJson').removeAttr('readonly');
334
+ $('#Description').removeAttr('readonly');
335
+
336
+
337
+ // Show the modal
338
+ $('#addModal').modal('show');
339
+
340
+ // Set up the click event for the update button
341
+ $('#saveupdate').off('click').on('click', function () {
342
+ saveupdate(companyId); // Pass the company ID for updating
343
+ });
344
+ }).fail(function () {
345
+ alert("Error in retrieving API details.");
346
  });
347
+ }
 
 
348
  }
 
349
 
350
  function saveupdate(companyId, filename) {
351
  const formData = new FormData();
 
528
  document.getElementById('Description').value = "";
529
  }
530
 
531
+
532
  </script>
533
  </body>
534
 
templates/company_profile.html CHANGED
@@ -18,6 +18,16 @@
18
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" />
19
 
20
  </head>
 
 
 
 
 
 
 
 
 
 
21
 
22
  <body>
23
  {% include 'sidepane.html' %}
@@ -49,6 +59,7 @@
49
  <div class="card-body table-container">
50
  <div class="dataTables_wrapper">
51
  <div class="row">
 
52
  <div class="dataTables_length">
53
  <label
54
  style="display: inline-block;margin-right:800px; margin-bottom: -40px;">Show
 
18
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" />
19
 
20
  </head>
21
+ <style>
22
+ #add{
23
+ position: absolute;
24
+ right: 0%;
25
+ }
26
+ #companyTable_filter{
27
+ margin-right: 70px;
28
+ margin-top: -25px;
29
+ }
30
+ </style>
31
 
32
  <body>
33
  {% include 'sidepane.html' %}
 
59
  <div class="card-body table-container">
60
  <div class="dataTables_wrapper">
61
  <div class="row">
62
+ <button class="btn btn-primary me-3" id="add">Add</button>
63
  <div class="dataTables_length">
64
  <label
65
  style="display: inline-block;margin-right:800px; margin-bottom: -40px;">Show
templates/dashboard.html CHANGED
@@ -20,12 +20,12 @@
20
  <div class="wrapper">
21
  <section class="main-header">
22
  <div class="container-fluid">
23
- <div id="company-block" class="form-group left-align" style="display: none;">
24
- <label for="company" class="ml-3" style="display: inline-block; margin-right: 10px;">
25
  Select the Company Name to view the details <span class="text-danger">*</span>
26
  </label>
27
  <select type="text" id="company" name="company" class="ml-3 form-control"
28
- style="display: inline-block; width: 20%;" required>
29
  <option value="" selected>Select</option>
30
  </select>
31
  </div>
@@ -113,7 +113,7 @@
113
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/adminlte.min.js"></script>
114
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
115
  <script>
116
- document.getElementById("add").style.display = "none";
117
 
118
  // function updateCompanyName(newCompanyName) {
119
  // sessionStorage.setItem('company_name', newCompanyName);
 
20
  <div class="wrapper">
21
  <section class="main-header">
22
  <div class="container-fluid">
23
+ <div id="company-block" class="form-group" style="display: none;">
24
+ <label for="company" class="ml-3" style="display: inline-block; margin-right: 0px;">
25
  Select the Company Name to view the details <span class="text-danger">*</span>
26
  </label>
27
  <select type="text" id="company" name="company" class="ml-3 form-control"
28
+ style="display: inline-block; width: 25%;" required>
29
  <option value="" selected>Select</option>
30
  </select>
31
  </div>
 
113
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/adminlte.min.js"></script>
114
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
115
  <script>
116
+
117
 
118
  // function updateCompanyName(newCompanyName) {
119
  // sessionStorage.setItem('company_name', newCompanyName);
templates/knowledgebase.html CHANGED
@@ -16,8 +16,21 @@
16
  <script src="https://cdn.datatables.net/1.10.25/js/dataTables.bootstrap4.min.js"></script>
17
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" />
18
  <link rel="stylesheet" href="/static/css/knowledgebase.css">
19
-
20
  </head>
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
  <body>
23
  {% include 'sidepane.html' %}
@@ -50,9 +63,11 @@
50
  <div class="row" style="margin-top: 50px;">
51
  <div class="col-12">
52
  <div class="card">
 
53
  <div id="message-container">
54
- <div class="card-body table-container">
55
  <table id="knowledgeTable" class="table table-bordered table-striped">
 
56
  <thead>
57
  <tr>
58
 
@@ -85,8 +100,8 @@
85
  <div class="modal-content">
86
  <div class="modal-header">
87
  <h5 class="modal-title" id="addModalLabel">Add Document Details</h5>
88
- <button type="button" class="btn-close" data-dismiss="modal">
89
- <span aria-hidden="true" data-backdrop="static" data-keyboard="false"></span>
90
  </button>
91
  </div>
92
  <div class="modal-body">
 
16
  <script src="https://cdn.datatables.net/1.10.25/js/dataTables.bootstrap4.min.js"></script>
17
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" />
18
  <link rel="stylesheet" href="/static/css/knowledgebase.css">
19
+
20
  </head>
21
+ <style>
22
+ #add {
23
+ position: absolute;
24
+ right: 1%;
25
+ top: 8%;
26
+ margin-top:-2px;
27
+ }
28
+
29
+ #knowledgeTable_filter {
30
+ margin-right: 60px;
31
+ margin-top: -16px;
32
+ }
33
+ </style>
34
 
35
  <body>
36
  {% include 'sidepane.html' %}
 
63
  <div class="row" style="margin-top: 50px;">
64
  <div class="col-12">
65
  <div class="card">
66
+ <button class="btn btn-primary me-3" id="add">Add</button>
67
  <div id="message-container">
68
+ <div class="card-body table-container pt-5" >
69
  <table id="knowledgeTable" class="table table-bordered table-striped">
70
+
71
  <thead>
72
  <tr>
73
 
 
100
  <div class="modal-content">
101
  <div class="modal-header">
102
  <h5 class="modal-title" id="addModalLabel">Add Document Details</h5>
103
+ <button type="button" class="btn-close" data-dismiss="modal" style="background-color: transparent;all: unset;font-size: 25px;">
104
+ <span aria-hidden="true" data-backdrop="static" data-keyboard="false">&times;</span>
105
  </button>
106
  </div>
107
  <div class="modal-body">
templates/prompt_template.html CHANGED
@@ -16,6 +16,17 @@
16
  </head>
17
 
18
  <body>
 
 
 
 
 
 
 
 
 
 
 
19
  {% include 'sidepane.html' %}
20
 
21
  <div class="wrapper">
@@ -61,6 +72,7 @@
61
  <div class="col-12">
62
  <div class="card">
63
  <div class="card-body table-container">
 
64
  <table id="promptTable" class="table table-bordered table-striped">
65
  <thead>
66
  <tr>
 
16
  </head>
17
 
18
  <body>
19
+ <style>
20
+ #add {
21
+ position: absolute;
22
+ right: 1%;
23
+ }
24
+
25
+ #promptTable_filter {
26
+ margin-right: 60px;
27
+ margin-top: -20px;
28
+ }
29
+ </style>
30
  {% include 'sidepane.html' %}
31
 
32
  <div class="wrapper">
 
72
  <div class="col-12">
73
  <div class="card">
74
  <div class="card-body table-container">
75
+ <button class="btn btn-primary me-3" id="add">Add</button>F
76
  <table id="promptTable" class="table table-bordered table-striped">
77
  <thead>
78
  <tr>
templates/sidepane.html CHANGED
@@ -30,7 +30,6 @@
30
 
31
  <!-- Buttons Section -->
32
  <div>
33
- <button class="btn btn-primary me-3" id="add">Add</button>
34
  <button class="btn btn-primary" onclick="logout()">Logout</button>
35
  </div>
36
  </div>
@@ -68,7 +67,7 @@
68
  <li class="nav-item">
69
  <div class="sidebar-header">
70
  <i class="nav-icon fas fa-building"></i>
71
- <span class="menu-text" id="selectedCompany">Select a company</span>
72
  <!-- Initial text as fallback -->
73
  <!-- <span class="menu-text" id="selectedCompany">{{company_name}}</span> -->
74
  </div>
 
30
 
31
  <!-- Buttons Section -->
32
  <div>
 
33
  <button class="btn btn-primary" onclick="logout()">Logout</button>
34
  </div>
35
  </div>
 
67
  <li class="nav-item">
68
  <div class="sidebar-header">
69
  <i class="nav-icon fas fa-building"></i>
70
+ <span class="menu-text" id="selectedCompany" style="margin-left: -6px;">Select a company</span>
71
  <!-- Initial text as fallback -->
72
  <!-- <span class="menu-text" id="selectedCompany">{{company_name}}</span> -->
73
  </div>