Spaces:
Running
Running
Update templates/dashboard.html
Browse files123456789101112131415161718192021222324252627282930313233343536372 unmodified lines4041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151166 unmodified lines12312412512612712811 unmodified lines14014114214314414535 unmodified lines1811821831841851861879 unmodified lines19719819920020120220326 unmodified lines230231232233234235236237!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>Dashboard</title><!-- AdminLTE CSS --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/admin-lte/3.1.0/css/adminlte.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" /><style>html, body {height: 100%;margin: 0;display: flex;flex-direction: column;}.wrapper {flex: 1; /* This allows the content to grow and push the footer down */padding: 10px;margin-left: -35px;}</style></head><body>{% include 'sidepane.html' %}<div class="wrapper"><section class="main-header" style="border-bottom: none;border-top: none;"><div class="container-fluid"><div id="company-block" class="form-group left-align" style="display: none;"><label for="company" class="ml-3" style="display: inline-block; margin-right: 10px;">Select the Company Nameto view the details <span class="text-danger">*</span></label><select type="text" id="company" name="company" class="ml-3 form-control"style="display: inline-block; width: 20%;" required>2 unmodified lines</div><div class="row"><div class="col-lg-4 col-6"><div class="small-box bg-info"><div class="inner margin-left:10px;"><h3 id="knowledgeBaseCount">{{table_count_of_each_table.knowledge_base}}</h3><h4>KnowledgeBase</h4></div><div class="icon"><i class="ion ion-bag"></i></div></div></div><div class="col-lg-4 col-6"><div class="small-box bg-success"><div class="inner"><h3 id="dataConnectorsCount">{{table_count_of_each_table.data_connectors}}</h3><h4>Data connectors</h4></div><div class="icon"><i class="ion ion-stats-bars"></i></div></div></div><div class="col-lg-4 col-6"><div class="small-box bg-warning"><div class="inner"><h3 id="apiConnectorsCount">{{table_count_of_each_table.api_connectors}}</h3><h4>API Connectors</h4></div><div class="icon"><i class="ion ion-person-add"></i></div></div></div><div class="col-lg-4 col-6"><div class="small-box bg-warning"><div class="inner"><h3 id="promptTemplatesCount">{{table_count_of_each_table.prompt_templates}}</h3><h4>Prompt_Templates</h4></div><div class="icon"><i class="ion ion-person-add"></i></div></div></div></div></div></section></div><input type="hidden" id="userRole" name="userRole" value={{role}}><input type="hidden" id="company_id" name="company_id" value={{company_id}}><input type="hidden" id="username" name="username" value={{username}}><input type="hidden" id="company_name" name="company_name" value={{company_name}}><footer>{% include 'footer.html' %}</footer><script src="https://cdn.jsdelivr.net/npm/admin-lte@3.1/dist/js/adminlte.min.js"></script><script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script><script>window.addEventListener('pageshow', function (event) {if (event.persisted || (window.performance && window.performance.navigation.type === 2)) {window.location.reload();}});document.addEventListener('DOMContentLoaded', function () {var role1 = document.getElementById("userRole").value;var company_id1 = document.getElementById("company_id").value;6 unmodified linessessionStorage.setItem('company_id', company_id1);sessionStorage.setItem('company_name',company_name1);sessionStorage.setItem('username',username1);if (!role1) {var roleFromInput = sessionStorage.getItem('userRole');sessionStorage.setItem('userRole', roleFromInput);11 unmodified linesdocument.getElementById('company').addEventListener('change', async function () {const selectedCompany = this.value;sessionStorage.setItem("company_name",selectedCompany);if (selectedCompany!== "Select") {try {const response = await fetch(`/api/company_id?company_name=${encodeURIComponent(selectedCompany)}`);35 unmodified lines}});function updateRecordCounts(counts) {// Update the counts displayed in the dashboarddocument.getElementById('knowledgeBaseCount').textContent = counts.knowledge_base || 0;9 unmodified linesdocument.getElementById('promptTemplatesCount').textContent = 0;}async function fetchCompanies() {try {const response = await fetch('/api/companies');26 unmodified linesdocument.getElementById('Description').value = "";}</script></body></html>1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061072 unmodified lines1101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152166 unmodified lines22322422522622722822923023123223323423523623723811 unmodified lines25025125225325425525625735 unmodified lines2932942952962972989 unmodified lines30830931031131231326 unmodified lines340341342343344345346347<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Dashboard</title><!-- CSS --><link rel="stylesheet" type="text/css" href="../static/assets/css/style.css" /><link rel="stylesheet" type="text/css" href="../static/assets/css/dashboard.css" /><link rel="stylesheet" type="text/css" href="../static/assets/css/perfect-scrollbar.css" /><style>html,body {height: 100%;margin: 0;display: flex;flex-direction: column;font-family: Arial, sans-serif;}.wrapper {flex: 1;padding: 10px;margin-left: 100px; /* Default sidebar width */transition: margin-left 0.3s ease;}.main-header {border-bottom: none;border-top: none;}.card {margin-bottom: 15px;border-radius: 8px;overflow: hidden;transition: background-color 0.3s ease;}.card-body {padding: 15px;}.feature-icon {display: inline-flex;align-items: center;justify-content: center;width: 50px;height: 50px;background: rgba(255, 255, 255, 0.1);border-radius: 50%;}.media-body {text-align: right;}.fs-30 {font-size: 1.875rem;}.fs-48 {font-size: 3rem;}/* Responsive Styles */@media (max-width: 992px) {.wrapper {margin-left: 0;}.main-header {padding: 15px;}}@media (max-width: 768px) {.feature-icon {width: 40px;height: 40px;}.fs-30 {font-size: 1.5rem;}.fs-48 {font-size: 2.5rem;}}</style></head><body>{% set company_name = company_name %}{% include 'sidepane.html' %}<div class="wrapper"><section class="main-header"><div class="container-fluid"><div id="company-block" class="form-group left-align" style="display: none;"><label for="company" class="ml-3" style="display: inline-block; margin-right: 10px;">Select the Company Name to view the details <span class="text-danger">*</span></label><select type="text" id="company" name="company" class="ml-3 form-control"style="display: inline-block; width: 20%;" required>2 unmodified lines</div><div class="row"><div class="col-xl-6 col-xxl-6 col-sm-6"><div class="card bg-primary"><div class="card-body"><div class="media align-items-center"><span class="p-3 mr-3 feature-icon rounded"><img src="../static/logos/calendar-silhouette.svg" /></span><div class="media-body"><p class="fs-30 text-white mb-2">KnowledgeBase</p><span id="knowledgeBaseCount" class="fs-48 text-white font-w600">{{table_count_of_each_table.knowledge_base}}</span></div></div></div></div></div><div class="col-xl-6 col-xxl-6 col-sm-6"><div class="card bg-info"><div class="card-body"><div class="media align-items-center"><span class="p-3 mr-3 feature-icon rounded"><img src="../static/logos/calendar-silhouette.svg" /></span><div class="media-body"><p class="fs-30 text-white mb-2">Data connectors</p><span id="dataConnectorsCount" class="fs-48 text-white font-w600">{{table_count_of_each_table.data_connectors}}</span></div></div></div></div></div></div><div class="row"><div class="col-xl-6 col-xxl-6 col-sm-6"><div class="card bg-success"><div class="card-body"><div class="media align-items-center"><span class="p-3 mr-3 feature-icon rounded"><img src="../static/logos/email.svg" /></span><div class="media-body"><p class="fs-30 text-white mb-2">API Connectors</p><span id="apiConnectorsCount" class="fs-48 text-white font-w600">{{table_count_of_each_table.api_connectors}}</span></div></div></div></div></div><div class="col-xl-6 col-xxl-6 col-sm-6"><div class="card bg-secondary"><div class="card-body"><div class="media align-items-center"><span class="p-3 mr-3 feature-icon rounded"><img src="../static/logos/dots.svg" /></span><div class="media-body"><p class="fs-30 text-white mb-2">Prompt_Templates</p><span id="promptTemplatesCount" class="fs-48 text-white font-w600">{{table_count_of_each_table.prompt_templates}}</span></div></div></div></div></div></div></div></section><input type="hidden" id="userRole" name="userRole" value={{role}}><input type="hidden" id="company_id" name="company_id" value={{company_id}}><input type="hidden" id="username" name="username" value={{username}}><input type="hidden" id="company_name" name="company_name" value={{company_name}}></div>{% include 'footer.html' %}<script src="https://cdn.jsdelivr.net/npm/admin-lte@3.1/dist/js/adminlte.min.js"></script><script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script><script>document.getElementById("add").style.display = "none";// function updateCompanyName(newCompanyName) {// sessionStorage.setItem('company_name', newCompanyName);// document.getElementById('selectedCompany').innerText = `Company name: ${newCompanyName}`;// const sidePaneCompanyName = document.querySelector('.sidebar .company-name');// if (sidePaneCompanyName) {// sidePaneCompanyName.innerText = newCompanyName;// }// }function updateSidepane(companyName) {const sidepaneCompanyElement = document.getElementById('selectedCompany');if (sidepaneCompanyElement) {sidepaneCompanyElement.innerText = `Company Name: ${companyName}`;}}window.addEventListener('pageshow', function (event) {if (event.persisted || (window.performance && window.performance.navigation.type === 2)) {window.location.reload();}});document.addEventListener('DOMContentLoaded', function () {var role1 = document.getElementById("userRole").value;var company_id1 = document.getElementById("company_id").value;6 unmodified linessessionStorage.setItem('company_id', company_id1);sessionStorage.setItem('company_name',company_name1);sessionStorage.setItem('username',username1);const companyName = sessionStorage.getItem('company_name');if (companyName) {updateSidepane(companyName);}else{document.getElementById(selectedCompany).value="Select a company";}if (!role1) {var roleFromInput = sessionStorage.getItem('userRole');sessionStorage.setItem('userRole', roleFromInput);11 unmodified linesdocument.getElementById('company').addEventListener('change', async function () {const selectedCompany = this.value;sessionStorage.setItem("company_name",selectedCompany);// Update the sidepane immediatelyupdateSidepane(selectedCompany);if (selectedCompany!== "Select") {try {const response = await fetch(`/api/company_id?company_name=${encodeURIComponent(selectedCompany)}`);35 unmodified lines}});function updateRecordCounts(counts) {// Update the counts displayed in the dashboarddocument.getElementById('knowledgeBaseCount').textContent = counts.knowledge_base || 0;9 unmodified linesdocument.getElementById('promptTemplatesCount').textContent = 0;}async function fetchCompanies() {try {const response = await fetch('/api/companies');26 unmodified linesdocument.getElementById('Description').value = "";}</script></body></html>
templates/dashboard.html+174-64