Spaces:
Sleeping
Sleeping
Update templates/sidepane.html
Browse files- templates/sidepane.html +172 -31
templates/sidepane.html
CHANGED
|
@@ -1,36 +1,143 @@
|
|
| 1 |
-
<!-- sidepane.html -->
|
| 2 |
-
|
| 3 |
<!-- This file represents the sidepane component of a web application. It contains the navigation menu and sidebar. -->
|
| 4 |
-
<!DOCTYPE html>
|
| 5 |
-
<html lang="en">
|
| 6 |
|
| 7 |
<head>
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
<img src="/static/img/redmindlogo3.jpg" alt="Logo" style="width: 80px; height: auto; margin-right: 10px;">
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
</div>
|
| 18 |
-
<!-- Left navbar links -->
|
| 19 |
-
<!-- <ul class="navbar-nav">
|
| 20 |
-
<li class="nav-item">
|
| 21 |
-
<a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
|
| 22 |
-
</li>
|
| 23 |
-
</ul> -->
|
| 24 |
</nav>
|
| 25 |
-
|
| 26 |
-
<!-- Main Sidebar Container -->
|
| 27 |
-
<aside class="main-sidebar sidebar-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
<input type="hidden" id="userRole" name="userRole" value={{role}}>
|
| 35 |
<input type="hidden" id="company_id" name="company_id" value={{company_id}}>
|
| 36 |
<div class="form-group"style="display: none;">
|
|
@@ -44,13 +151,21 @@
|
|
| 44 |
Please select at least one LLM tool.
|
| 45 |
</div>
|
| 46 |
</div>
|
| 47 |
-
|
| 48 |
<li class="nav-item">
|
| 49 |
<a href="{{url_for('dashboard')}}" class="nav-link">
|
| 50 |
<i class="nav-icon fas fa-home"></i>
|
| 51 |
<p>Dashboard</p>
|
| 52 |
</a>
|
| 53 |
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
<li class="nav-item" >
|
| 55 |
<a href="{{ url_for('company_profile') }}" class="nav-link">
|
| 56 |
<i class="nav-icon fas fa-users"></i>
|
|
@@ -111,8 +226,24 @@
|
|
| 111 |
<!-- /.sidebar -->
|
| 112 |
</aside>
|
| 113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
<!-- AdminLTE JS -->
|
|
|
|
| 116 |
<script >
|
| 117 |
|
| 118 |
function logout() {
|
|
@@ -134,9 +265,9 @@ document.addEventListener("DOMContentLoaded", function() {
|
|
| 134 |
if (siderole==='admin') {
|
| 135 |
console.log("Company ID inside sidepane:", sidecompanyId);
|
| 136 |
console.log("Role inside sidepane:",siderole);
|
| 137 |
-
|
| 138 |
|
| 139 |
-
console.log("inside admin
|
| 140 |
updateLinkVisibility(siderole);
|
| 141 |
|
| 142 |
}
|
|
@@ -156,7 +287,7 @@ document.addEventListener("DOMContentLoaded", function() {
|
|
| 156 |
}
|
| 157 |
}
|
| 158 |
async function editCompany(sidecompanyId,siderole) {
|
| 159 |
-
console.log("inside edit ", sidecompanyId);
|
| 160 |
console.log("inside edit role role",siderole);
|
| 161 |
$.getJSON(`/api/getcompanydetails/${sidecompanyId}`, function (company) {
|
| 162 |
// Set the value of #llm_tools and trigger change event
|
|
@@ -194,13 +325,23 @@ document.addEventListener("DOMContentLoaded", function() {
|
|
| 194 |
dataConnectors: data_connectors_link.style.display
|
| 195 |
|
| 196 |
}));
|
|
|
|
| 197 |
}
|
| 198 |
-
|
| 199 |
}).fail(function () {
|
| 200 |
alert("Error retrieving company details.");
|
| 201 |
});
|
| 202 |
|
| 203 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
</script>
|
|
|
|
| 205 |
</head>
|
| 206 |
-
</html>
|
|
|
|
| 1 |
+
<!-- sidepane.html -->
|
|
|
|
| 2 |
<!-- This file represents the sidepane component of a web application. It contains the navigation menu and sidebar. -->
|
| 3 |
+
<!-- <!DOCTYPE html>
|
| 4 |
+
<html lang="en"> -->
|
| 5 |
|
| 6 |
<head>
|
| 7 |
|
| 8 |
+
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
| 9 |
+
<!-- Include Bootstrap JS -->
|
| 10 |
+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.bundle.min.js"></script>
|
|
|
|
| 11 |
|
| 12 |
+
<style>
|
| 13 |
+
|
| 14 |
+
/* Sidebar Styles */
|
| 15 |
+
.main-sidebar {
|
| 16 |
+
background: #222; /* Dark background for sidebar */
|
| 17 |
+
color: #fff;
|
| 18 |
+
width: 250px; /* Default width */
|
| 19 |
+
height: 600px !important;
|
| 20 |
+
position: fixed;
|
| 21 |
+
top: 0;
|
| 22 |
+
left: 0;
|
| 23 |
+
transition: all 0.3s ease;
|
| 24 |
+
/* Ensure sidebar content scrolls if needed */
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
.main-sidebar.toggled {
|
| 28 |
+
width: 60px; /* Minimized width */
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
.sidebar-header {
|
| 32 |
+
text-align: center;
|
| 33 |
+
padding: 15px;
|
| 34 |
+
background: #333; /* Dark background for header */
|
| 35 |
+
color: #fff;
|
| 36 |
+
border-radius: 5px;
|
| 37 |
+
margin-bottom: 15px;
|
| 38 |
+
display: flex;
|
| 39 |
+
align-items: center;
|
| 40 |
+
justify-content: center;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
.sidebar-header i {
|
| 44 |
+
font-size: 1.5rem;
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
.sidebar-header .menu-text {
|
| 48 |
+
font-size: 14px;
|
| 49 |
+
font-weight: bold;
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
/* Navigation Menu */
|
| 53 |
+
.nav-link {
|
| 54 |
+
display: flex;
|
| 55 |
+
align-items: center;
|
| 56 |
+
color: #fff;
|
| 57 |
+
padding: 10px;
|
| 58 |
+
border-radius: 5px;
|
| 59 |
+
transition: background-color 0.3s ease;
|
| 60 |
+
text-decoration: none;
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
.nav-link:hover {
|
| 64 |
+
background-color: #F8BE12; /* Highlight color on hover */
|
| 65 |
+
color: #fff;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
.menu-text {
|
| 69 |
+
margin-left: 10px;
|
| 70 |
+
font-weight: bold;
|
| 71 |
+
color: #fff;
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
/* Sidebar Icon Sizes */
|
| 75 |
+
.nav-icon {
|
| 76 |
+
font-size: 20px;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
/* Hide menu text when sidebar is collapsed */
|
| 80 |
+
.main-sidebar.toggled .menu-text {
|
| 81 |
+
display: none;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
/* Content Wrapper */
|
| 85 |
+
#content-wrapper {
|
| 86 |
+
margin-left: 250px;
|
| 87 |
+
padding: 15px;
|
| 88 |
+
height: 700px !important;
|
| 89 |
+
transition: margin-left 0.3s ease;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
#content-wrapper.toggled {
|
| 93 |
+
margin-left: 60px;
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
/* Responsive Design */
|
| 97 |
+
@media (max-width: 991px) {
|
| 98 |
+
.main-sidebar {
|
| 99 |
+
width: 60px; /* Default to minimized on small screens */
|
| 100 |
+
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
#content-wrapper {
|
| 104 |
+
margin-left: 60px;
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
.main-sidebar.toggled + #content-wrapper {
|
| 108 |
+
margin-left: 0;
|
| 109 |
+
}
|
| 110 |
+
}
|
| 111 |
+
</style>
|
| 112 |
+
|
| 113 |
+
<nav class="main-header navbar navbar-expand navbar-light bg-white shadow-sm" style="padding: 15px; ">
|
| 114 |
+
<div class="container-fluid d-flex justify-content-between align-items-center">
|
| 115 |
+
<!-- Toggle Sidebar Button -->
|
| 116 |
+
<button class="btn btn-outline-secondary" id="sidebarToggle" style="margin-right: 15px;">
|
| 117 |
+
<i class="fas fa-bars"></i>
|
| 118 |
+
</button>
|
| 119 |
+
|
| 120 |
+
<!-- Logo and Title Section -->
|
| 121 |
+
<div class="d-flex align-items-center">
|
| 122 |
+
<img src="/static/img/redmindlogo3.jpg" alt="Logo" style="width: 70px; height: auto; margin-right: 15px;">
|
| 123 |
+
<h3 class="m-0" style="font-weight: 500;">Redmind GPT - {{title}}</h3>
|
| 124 |
+
</div>
|
| 125 |
|
| 126 |
+
<!-- Buttons Section -->
|
| 127 |
+
<div>
|
| 128 |
+
<button class="btn btn-primary me-3" id="add">Add</button>
|
| 129 |
+
<button class="btn btn-primary" onclick="logout()">Logout</button>
|
| 130 |
+
</div>
|
| 131 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
</nav>
|
| 133 |
+
<div id="wrapper">
|
| 134 |
+
<!-- Main Sidebar Container -->
|
| 135 |
+
<aside class="main-sidebar sidebar-custom elevation-4" id="sidebarPanel">
|
| 136 |
+
<!-- Sidebar -->
|
| 137 |
+
<div class="sidebar">
|
| 138 |
+
<!-- Sidebar Menu -->
|
| 139 |
+
<nav class="mt-2">
|
| 140 |
+
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false" id="sidebarMenu">
|
|
|
|
| 141 |
<input type="hidden" id="userRole" name="userRole" value={{role}}>
|
| 142 |
<input type="hidden" id="company_id" name="company_id" value={{company_id}}>
|
| 143 |
<div class="form-group"style="display: none;">
|
|
|
|
| 151 |
Please select at least one LLM tool.
|
| 152 |
</div>
|
| 153 |
</div>
|
| 154 |
+
|
| 155 |
<li class="nav-item">
|
| 156 |
<a href="{{url_for('dashboard')}}" class="nav-link">
|
| 157 |
<i class="nav-icon fas fa-home"></i>
|
| 158 |
<p>Dashboard</p>
|
| 159 |
</a>
|
| 160 |
</li>
|
| 161 |
+
<li class="nav-item">
|
| 162 |
+
<div class="sidebar-header">
|
| 163 |
+
<i class="nav-icon fas fa-building"></i>
|
| 164 |
+
<span class="menu-text" id="selectedCompany">Select a company</span> <!-- Initial text as fallback -->
|
| 165 |
+
<!-- <span class="menu-text" id="selectedCompany">{{company_name}}</span> -->
|
| 166 |
+
</div>
|
| 167 |
+
</li>
|
| 168 |
+
|
| 169 |
<li class="nav-item" >
|
| 170 |
<a href="{{ url_for('company_profile') }}" class="nav-link">
|
| 171 |
<i class="nav-icon fas fa-users"></i>
|
|
|
|
| 226 |
<!-- /.sidebar -->
|
| 227 |
</aside>
|
| 228 |
|
| 229 |
+
|
| 230 |
+
<input type="hidden" id="userRole" name="userRole" value={{role}}>
|
| 231 |
+
<input type="hidden" id="company_id" name="company_id" value={{company_id}}>
|
| 232 |
+
<div class="form-group"style="display: none;">
|
| 233 |
+
<label for="llm_tools" >LLM Tools<span class="text-danger">*</span></label>
|
| 234 |
+
<select class="form-control" id="llm_tools" name="llm_tools" multiple required style="display: none;">
|
| 235 |
+
<option value="Database">Database</option>
|
| 236 |
+
<option value="Static Documents">Static Documents</option>
|
| 237 |
+
<option value="API">API</option>
|
| 238 |
+
</select>
|
| 239 |
+
<div class="invalid-feedback">
|
| 240 |
+
Please select at least one LLM tool.
|
| 241 |
+
</div>
|
| 242 |
+
</div>
|
| 243 |
+
</div>
|
| 244 |
|
| 245 |
<!-- AdminLTE JS -->
|
| 246 |
+
|
| 247 |
<script >
|
| 248 |
|
| 249 |
function logout() {
|
|
|
|
| 265 |
if (siderole==='admin') {
|
| 266 |
console.log("Company ID inside sidepane:", sidecompanyId);
|
| 267 |
console.log("Role inside sidepane:",siderole);
|
| 268 |
+
editCompany(sidecompanyId,siderole);
|
| 269 |
|
| 270 |
+
console.log("inside admin after edit");
|
| 271 |
updateLinkVisibility(siderole);
|
| 272 |
|
| 273 |
}
|
|
|
|
| 287 |
}
|
| 288 |
}
|
| 289 |
async function editCompany(sidecompanyId,siderole) {
|
| 290 |
+
console.log("inside edit company id", sidecompanyId);
|
| 291 |
console.log("inside edit role role",siderole);
|
| 292 |
$.getJSON(`/api/getcompanydetails/${sidecompanyId}`, function (company) {
|
| 293 |
// Set the value of #llm_tools and trigger change event
|
|
|
|
| 325 |
dataConnectors: data_connectors_link.style.display
|
| 326 |
|
| 327 |
}));
|
| 328 |
+
updateLinkVisibility(siderole);
|
| 329 |
}
|
| 330 |
+
|
| 331 |
}).fail(function () {
|
| 332 |
alert("Error retrieving company details.");
|
| 333 |
});
|
| 334 |
|
| 335 |
}
|
| 336 |
+
document.getElementById('sidebarToggle').addEventListener('click', function() {
|
| 337 |
+
const sidebar = document.getElementById('sidebarPanel');
|
| 338 |
+
const contentWrapper = document.getElementById('content-wrapper');
|
| 339 |
+
|
| 340 |
+
// Toggle sidebar width and content margin
|
| 341 |
+
sidebar.classList.toggle('toggled');
|
| 342 |
+
contentWrapper.classList.toggle('toggled');
|
| 343 |
+
});
|
| 344 |
</script>
|
| 345 |
+
|
| 346 |
</head>
|
| 347 |
+
<!-- </html> -->
|