MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / main

Function main

Scripts/Settings.py:7973–8025  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7971 state.authStatus = auth;
7972 state.recoveryQuestions = auth.security_questions || [];
7973 if (auth.config) {
7974 state.config = auth.config;
7975 applyWallpaper(state.config);
7976 }
7977 var profileList = document.getElementById('loginProfilesList'); if (profileList) profileList.innerHTML = (auth.profiles || []).map(function(name){ return '<option value="' + escapeHtml(name) + '"></option>'; }).join('');
7978 state.authRequired = !!auth.enabled && !auth.authenticated;
7979 state.authenticated = !!auth.authenticated;
7980 var otpField = document.getElementById('loginOtpField'); if (otpField) otpField.classList.toggle('hidden', !auth.totp_enabled);
7981 if (state.authRequired) {
7982 applyTranslations();
7983 populateRecoveryQuestions();
7984 hideLoading();
7985 return;
7986 }
7987 await bootApp();
7988 } catch (err) {
7989 handleError(err);
7990 }
7991 }
7992
7993
7994 function bindUi() {
7995 var batteryBtn = document.getElementById('batteryLabel'); if (batteryBtn) renderBatteryStatus();
7996 var alertsBtn = document.getElementById('notificationsBtn'); if (alertsBtn) alertsBtn.addEventListener('click', async function(){ try { var data=await apiGet('/api/notifications'); renderNotificationsPanel((data.notifications && data.notifications.items) || []); } catch(err){ handleError(err); } });
7997 var mobileBatteryBtn=document.getElementById('mobileBatteryLabel'); if(mobileBatteryBtn) mobileBatteryBtn.addEventListener('click', function(){ setActiveApp('system'); });
7998 window.addEventListener('resize', function(){ if(window.innerWidth<=760 && state.sidebarHidden) applySidebarVisibility(false); });
7999 var hideSidebarBtn = document.getElementById('hideSidebarBtn'); if (hideSidebarBtn) hideSidebarBtn.addEventListener('click', function(){ applySidebarVisibility(true); saveUiPrefs(); });
8000 var showSidebarBtn = document.getElementById('showSidebarBtn'); if (showSidebarBtn) showSidebarBtn.addEventListener('click', function(){ applySidebarVisibility(false); saveUiPrefs(); });
8001 var backBtn = document.getElementById('backNavBtn'); if (backBtn) backBtn.addEventListener('click', function(){ if (state.lastApp) setActiveApp(state.lastApp); });
8002 document.getElementById('refreshSystemBtn').addEventListener('click', async function(){
8003 try { var fresh=await Promise.all([apiGet('/api/info'),apiGet('/api/status')]); state.info=fresh[0]; state.status=fresh[1]; renderSystem(); renderBatteryStatus(); } catch (err) { handleError(err); }
8004 });
8005 document.getElementById('filesRefreshBtn').addEventListener('click', function(){ loadFiles(state.filesPath).catch(handleError); });
8006 document.getElementById('filesNewFolderBtn').addEventListener('click', async function(){
8007 var name = window.prompt(t('Folder name'));
8008 if (!name) return;
8009 try {
8010 await apiPost('/api/fs/mkdir', { path: state.filesPath.replace(/\/$/, '') + '/' + name });
8011 await loadFiles(state.filesPath);
8012 } catch (err) { handleError(err); }
8013 });
8014 document.getElementById('filesNewFileBtn').addEventListener('click', async function(){
8015 var name = window.prompt(t('File name'));
8016 if (!name) return;
8017 try {
8018 await apiPost('/api/fs/newfile', { path: state.filesPath.replace(/\/$/, '') + '/' + name, content: '' });
8019 await loadFiles(state.filesPath);
8020 } catch (err) { handleError(err); }
8021 });
8022 document.getElementById('filesPasteBtn').addEventListener('click', pasteClipboard);
8023 document.getElementById('editorSaveBtn').addEventListener('click', saveEditor);
8024 document.getElementById('terminalRefreshBtn').addEventListener('click', function(){ refreshJobs().catch(handleError); });
8025 document.getElementById('terminalSessionsBtn').addEventListener('click', function(){
8026 document.getElementById('sessionsOverlay').classList.remove('hidden');
8027 renderSessionsOverlay();
8028 });

Callers 1

Settings.pyFile · 0.70

Calls 15

printFunction · 0.85
inputFunction · 0.85
run_settings_menuFunction · 0.70
_Function · 0.70
show_aboutFunction · 0.70
update_dedsec_source_1Function · 0.70
update_dedsec_source_2Function · 0.70
update_packages_modulesFunction · 0.70
save_projectFunction · 0.70
change_promptFunction · 0.70
github_account_menuFunction · 0.70

Tested by

no test coverage detected