Spaces:
Runtime error
Runtime error
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Company Profile</title> | |
| <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script> | |
| <!-- Include AdminLTE CSS --> | |
| <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/adminlte.min.css"> | |
| <!-- Include DataTables CSS --> | |
| <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css"> | |
| <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css" rel="stylesheet" /> | |
| <link href="https://cdn.jsdelivr.net/npm/@ttskch/[email protected]/dist/select2-bootstrap4.min.css" | |
| rel="stylesheet" /> | |
| <style> | |
| .container { | |
| margin-top: 10px; | |
| margin-left: 420px; | |
| align-items: center; | |
| max-width: 600px; | |
| padding: 10px; | |
| border: 1px solid #ccc; | |
| border-radius: 5px; | |
| position: relative; | |
| z-index: 1; | |
| } | |
| .container::before { | |
| content: ''; | |
| position: absolute; | |
| top: 50%; | |
| left: 40%; | |
| background: url('..\static\img\redmindlogo3.jpg') no-repeat center center; | |
| background-size: contain; | |
| opacity: 0.1; | |
| width: 100%; | |
| height: 90%; | |
| z-index: -1; | |
| } | |
| .form-group { | |
| margin-bottom: 5px; | |
| } | |
| .form-group label { | |
| font-weight: bold; | |
| margin-bottom: 5px; | |
| display: block; | |
| } | |
| .form-group input .form-group select { | |
| width: 100%; | |
| padding: 10px; | |
| border: 1px solid #ccc; | |
| border-radius: 4px; | |
| text-align: center; | |
| } | |
| .form-group select.select2-container--bootstrap4 .select2-selection--multiple { | |
| height: auto; | |
| /* Adjust height to fit content */ | |
| } | |
| .btn-primary { | |
| margin-right: 10px; | |
| color: black; | |
| font-size: 16px; | |
| font-weight: bold; | |
| } | |
| h3 { | |
| text-align: center; | |
| margin-bottom: 10px; | |
| } | |
| .btn-container { | |
| text-align: center; | |
| margin-top: 10px; | |
| color: white; | |
| } | |
| footer { | |
| position: absolute; | |
| bottom: 0; | |
| width: 100%; | |
| color: black; | |
| text-align: right; | |
| padding-right: 245px; | |
| padding-top: 0px; | |
| background-color: #f8f9fa; | |
| border: none ; | |
| } | |
| #llm_tools { | |
| text-align: center; | |
| font-weight: bold; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| {% include 'sidepane.html' %} | |
| <div class="container mt-4"> | |
| <h3>Company Profile</h3> | |
| <form id="companyProfileForm" class="needs-validation" novalidate action="/submit_company_profile" | |
| method="post"> | |
| <div class="form-group"> | |
| <label for="company_name">Company Name <span class="text-danger">*</span></label> | |
| <input type="text" id="company_name" name="company_name" class="form-control" required> | |
| <div class="invalid-feedback"> | |
| Please enter the company name. | |
| </div> | |
| </div> | |
| <div class="form-group"> | |
| <label for="company_code">Company Code <span class="text-danger">*</span></label> | |
| <input type="text" id="company_code" name="company_code" class="form-control" required> | |
| <div class="invalid-feedback"> | |
| Please enter the company code. | |
| </div> | |
| </div> | |
| <div class="form-group"> | |
| <label for="domain">Domain/Business <span class="text-danger">*</span></label> | |
| <input type="text" id="domain" name="domain" class="form-control" required> | |
| <div class="invalid-feedback"> | |
| Please enter the domain/business. | |
| </div> | |
| </div> | |
| <div class="form-group"> | |
| <label for="llm_tools">LLM Tools <span class="text-danger">*</span></label> | |
| <select type='text' id="llm_tools" name="llm_tools" class="form-control" multiple required> | |
| <option value="Database">Database</option> | |
| <option value="Static Documents">Static Documents</option> | |
| <option value="API">API</option> | |
| </select> | |
| <div class="invalid-feedback"> | |
| Please select at least one LLM tool. | |
| </div> | |
| </div> | |
| <div class="btn-container"> | |
| <button type="submit" class="btn btn-primary">Save</button> | |
| <button type="reset" class="btn btn-primary">Clear</button> | |
| </div> | |
| </form> | |
| </div> | |
| <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js"></script> | |
| <script> | |
| $(document).ready(function () { | |
| // Initialize Select2 for multi-select dropdown | |
| $('#llm_tools').select2({ | |
| theme: 'bootstrap4', | |
| placeholder: 'Select', | |
| allowClear: true | |
| }); | |
| $('#companyProfileForm').on('submit', function (event) { | |
| event.preventDefault(); // Prevent default form submission | |
| // Gather form data | |
| var formData = $(this).serialize(); | |
| $.ajax({ | |
| type: "POST", | |
| url: "/submit_company_profile", | |
| data: formData, | |
| success: function (response) { | |
| alert(response.message); // Show success message | |
| setTimeout(function () { | |
| window.location.href = '/company_profile'; // Redirect to the desired page after a delay | |
| }, 2000); // Delay for 2 seconds (2000 milliseconds) | |
| }, | |
| error: function (xhr) { | |
| alert("An error occurred: " + xhr.responseJSON.detail); // Show error message | |
| } | |
| }); | |
| }); | |
| }); | |
| </script> | |
| </body> | |
| </html> |