Spaces:
Sleeping
Sleeping
Update templates/knowledgebase.html
Browse files
templates/knowledgebase.html
CHANGED
@@ -655,7 +655,7 @@ async function fetchUpdatedDocuments(company_id) {
|
|
655 |
}
|
656 |
});
|
657 |
}
|
658 |
-
|
659 |
const form = document.getElementById('documentForm');
|
660 |
|
661 |
// Check if the form is valid
|
@@ -674,6 +674,12 @@ async function fetchUpdatedDocuments(company_id) {
|
|
674 |
|
675 |
//const formData = new FormData();
|
676 |
var formData = new FormData($('#documentForm')[0]);
|
|
|
|
|
|
|
|
|
|
|
|
|
677 |
formData.append("uploadFile", uploadFile);
|
678 |
formData.append("documentName", documentName);
|
679 |
formData.append("documentDescription", documentDescription);
|
@@ -691,15 +697,11 @@ console.log("formdata",formData);
|
|
691 |
if (!response.ok) {
|
692 |
throw new Error('Network response was not ok');
|
693 |
}
|
694 |
-
return response.
|
695 |
})
|
696 |
.then(data => {
|
697 |
-
row_id=data.row_id;
|
698 |
var table = $('#knowledgeTable').DataTable();
|
699 |
var rowCount = table.rows().count();
|
700 |
-
`<a href='#' class='btn btn-info btn-sm'data-kid-id='${company.row_id}' data-action="view" onclick='viewCompany(this)''><i class='fas fa-eye'></i></a>`,
|
701 |
-
`<a href='#' class='btn btn-warning btn-sm'data-kid-id='${company.row_id}' data-action="edit" onclick='editCompany(this)'><i class='fas fa-edit'></i></a>`,
|
702 |
-
`<a href='#' class='btn btn-danger btn-sm' data-kid-id='${company.row_id}' onclick='deleteCompany(this)'><i class='fas fa-trash'></i></a>`,
|
703 |
table.row.add([
|
704 |
rowCount + 1,
|
705 |
documentName,
|
|
|
655 |
}
|
656 |
});
|
657 |
}
|
658 |
+
function save_file() {
|
659 |
const form = document.getElementById('documentForm');
|
660 |
|
661 |
// Check if the form is valid
|
|
|
674 |
|
675 |
//const formData = new FormData();
|
676 |
var formData = new FormData($('#documentForm')[0]);
|
677 |
+
const vectorDBFlag = "NO"; // Example value
|
678 |
+
const view = "<a href='#' class='btn btn-info btn-sm'><i class='fas fa-eye'></i></a>";
|
679 |
+
const edit = "<a href='#' class='btn btn-warning btn-sm'><i class='fas fa-edit'></i></a>";
|
680 |
+
const dele= "<a href='#' class='btn btn-danger btn-sm'><i class='fas fa-trash'></i></a>";
|
681 |
+
|
682 |
+
|
683 |
formData.append("uploadFile", uploadFile);
|
684 |
formData.append("documentName", documentName);
|
685 |
formData.append("documentDescription", documentDescription);
|
|
|
697 |
if (!response.ok) {
|
698 |
throw new Error('Network response was not ok');
|
699 |
}
|
700 |
+
return response.text();
|
701 |
})
|
702 |
.then(data => {
|
|
|
703 |
var table = $('#knowledgeTable').DataTable();
|
704 |
var rowCount = table.rows().count();
|
|
|
|
|
|
|
705 |
table.row.add([
|
706 |
rowCount + 1,
|
707 |
documentName,
|