Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 36 additions & 4 deletions application/single_app/admin_settings_nav.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,18 +395,50 @@
"icon": "bi-database",
"tabs": [
{
"id": "data-management",
"label": "Backup, Migrate & Restore",
"icon": "bi-database-check",
# Schedule, storage and encryption are cards nested inside the

Check warning on line 398 in application/single_app/admin_settings_nav.py

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains secret or sensitive data source marker. Recommendation%3A Pair this source with any nearby network, logging, serialization, or process execution sink before approving.
# backup card, so they stay with it.
"id": "backup",
"label": "Backup",
"icon": "bi-archive",
"sections": [
{"id": "data-management-readiness-section", "label": "Start Here", "icon": "bi-compass"},
{"id": "data-management-backup-section", "label": "Backup", "icon": "bi-archive"},
{"id": "data-management-schedule-section", "label": "Schedule", "icon": "bi-calendar-event"},
{"id": "data-management-storage-section", "label": "Storage", "icon": "bi-hdd"},
{"id": "data-management-encryption-section", "label": "Encryption", "icon": "bi-key"},
],
},
{
"id": "migrate",
"label": "Migrate",
"icon": "bi-arrow-left-right",
"sections": [
{"id": "data-management-migration-section", "label": "Migration", "icon": "bi-arrow-left-right"},
{"id": "data-management-cosmos-editor-section", "label": "Cosmos Editor", "icon": "bi-database-exclamation"},
],
},
{
"id": "restore",
"label": "Restore",
"icon": "bi-box-seam",
"sections": [
{"id": "data-management-backup-inventory-section", "label": "Backup Inventory & Restore", "icon": "bi-box-seam"},
],
},
{
# A direct database editor. It is a repair tool that belongs

Check warning on line 428 in application/single_app/admin_settings_nav.py

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains AI, plugin, agent, or workspace boundary marker. Recommendation%3A Check whether prompts, chat history, uploaded documents, embeddings, citations, settings, or identity can cross a new boundary.
# with the backup and restore tooling it shares a module with.

Check warning on line 429 in application/single_app/admin_settings_nav.py

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains AI, plugin, agent, or workspace boundary marker. Recommendation%3A Check whether prompts, chat history, uploaded documents, embeddings, citations, settings, or identity can cross a new boundary.
"id": "cosmos-editor",

Check warning on line 430 in application/single_app/admin_settings_nav.py

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains secret or sensitive data source marker. Recommendation%3A Pair this source with any nearby network, logging, serialization, or process execution sink before approving.
"label": "Cosmos Editor",

Check warning on line 431 in application/single_app/admin_settings_nav.py

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains secret or sensitive data source marker. Recommendation%3A Pair this source with any nearby network, logging, serialization, or process execution sink before approving.
"icon": "bi-database-exclamation",
"sections": [
{"id": "data-management-cosmos-editor-section", "label": "Cosmos Editor", "icon": "bi-database-exclamation"},

Check warning on line 434 in application/single_app/admin_settings_nav.py

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains secret or sensitive data source marker. Recommendation%3A Pair this source with any nearby network, logging, serialization, or process execution sink before approving.
],
},
{
"id": "jobs",
"label": "Jobs",
"icon": "bi-clock-history",
"sections": [
{"id": "data-management-jobs-section", "label": "Jobs", "icon": "bi-clock-history"},
],
},
Expand Down
2 changes: 1 addition & 1 deletion application/single_app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
EXECUTOR_TYPE = 'thread'
EXECUTOR_MAX_WORKERS = 30
SESSION_TYPE = 'filesystem'
VERSION = "0.260.015"
VERSION = "0.260.016"
IS_DEVELOPMENT = is_development_env_enabled()

SESSION_COOKIE_SAMESITE = os.getenv('SESSION_COOKIE_SAMESITE', 'Lax')
Expand Down
44 changes: 44 additions & 0 deletions application/single_app/static/js/admin/admin_sidebar_nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,19 @@
}
} else {
console.log('initAdminSidebarNav - Found existing active tab, preserving current state:', activeTab.getAttribute('data-tab'));
syncAdminGroupSharedRegions(activeTab.getAttribute('data-tab'));
}

// Clicking a tab button directly does not go through showAdminTab, so the
// shared regions are synced from Bootstrap's own event as well.
document.querySelectorAll('button.nav-link[data-bs-target^="#"]').forEach(button => {
button.addEventListener('shown.bs.tab', event => {
const target = event.target.getAttribute('data-bs-target');
if (target) {
syncAdminGroupSharedRegions(target.slice(1));
}
});
});
}

function setupAdminGroupToggles() {
Expand Down Expand Up @@ -297,12 +309,43 @@
'workspaces': 'workspace-types',
'search-extract': 'web-research',
'ai-models': 'model-endpoints',
'data-management': 'backup',
};

function resolveAdminTabId(tabId) {
return LEGACY_TAB_REDIRECTS[tabId] || tabId;
}

/**
* Some groups share one set of controls across all of their tabs, such as the
* single save button that serves every Backup & Recovery tab. Those controls
* cannot be duplicated into each pane without repeating element ids, and they
* cannot sit in one pane because the other tabs would lose them, so they live
* outside the panes and are revealed only while their group is active.
*/
function syncAdminGroupSharedRegions(tabId) {
const regions = document.querySelectorAll('[data-admin-group-shared]');
if (!regions.length) {
return;
}

// Only one of the two navigations is rendered at a time, so resolve the
// owning group from whichever is present. Looking only at the top tab strip
// would leave the region hidden for good in the sidebar layout.

Check warning on line 334 in application/single_app/static/js/admin/admin_sidebar_nav.js

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Moderate - Changed line contains obfuscation, dynamic loading, or hidden payload marker. Recommendation%3A Confirm the changed code is not hiding behavior, decoding payloads, or bypassing normal review.
const tabButton = document.querySelector(`.admin-tab-item[data-admin-group] button[data-bs-target="#${tabId}"]`);
let owner = tabButton ? tabButton.closest('[data-admin-group]') : null;
if (!owner) {
const sidebarLink = document.querySelector(`.admin-nav-tab[data-tab="${tabId}"]`);
owner = sidebarLink ? sidebarLink.closest('[data-admin-group]') : null;
}
const activeGroup = owner ? owner.getAttribute('data-admin-group') : null;

regions.forEach(region => {
const ownerGroup = region.getAttribute('data-admin-group-shared');
region.hidden = ownerGroup !== activeGroup;

Check warning on line 345 in application/single_app/static/js/admin/admin_sidebar_nav.js

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Moderate - Changed line contains obfuscation, dynamic loading, or hidden payload marker. Recommendation%3A Confirm the changed code is not hiding behavior, decoding payloads, or bypassing normal review.
});
}

function showAdminTab(requestedTabId) {
const tabId = resolveAdminTabId(requestedTabId);

Expand Down Expand Up @@ -333,6 +376,7 @@

// Update the hash in URL for deep linking
window.location.hash = tabId;
syncAdminGroupSharedRegions(tabId);
if (typeof window.updateAdminSettingsSaveButtonState === 'function') {
window.updateAdminSettingsSaveButtonState();
}
Expand Down
Loading
Loading