Skip to content

Commit

Permalink
Going to /settings will open the Settings in full page mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jelveh committed Oct 22, 2024
1 parent c6bc42f commit 6f702c3
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 7 deletions.
4 changes: 4 additions & 0 deletions src/backend/src/routers/_default.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@ router.all('*', async function(req, res, next) {
if(path.startsWith('/action/') || path.startsWith('/@')){
path = '/';
}
// /settings
else if(path.startsWith('/settings')){
path = '/';
}
// /app/
else if(path.startsWith('/app/')){
app_name = path.replace('/app/', '');
Expand Down
5 changes: 3 additions & 2 deletions src/gui/src/UI/Settings/UIWindowSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async function UIWindowSettings(options){
h += `<div class="settings-container">`;
h += `<div class="settings">`;
// sidebar toggle
h += `<button class="sidebar-toggle hidden-lg hidden-xl"><div class="sidebar-toggle-button"><span></span><span></span><span></span></div></button>`;
h += `<button class="sidebar-toggle hidden-lg hidden-xl hidden-md"><div class="sidebar-toggle-button"><span></span><span></span><span></span></div></button>`;
// sidebar
h += `<div class="settings-sidebar disable-user-select disable-context-menu">`;
// sidebar items
Expand Down Expand Up @@ -93,7 +93,8 @@ async function UIWindowSettings(options){
width: 'initial',
height: '100%',
overflow: 'auto'
}
},
...options?.window_options??{}
});
const $el_window = $(el_window);
tabs.forEach((tab, i) => {
Expand Down
12 changes: 11 additions & 1 deletion src/gui/src/UI/UIDesktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,17 @@ async function UIDesktop(options){
window.app_query_params[key] = value;
}
}

//--------------------------------------------------------------------------------------
// /settings will open settings in fullpage mode
//--------------------------------------------------------------------------------------
else if(window.url_paths[0]?.toLocaleLowerCase() === 'settings'){
// open settings
UIWindowSettings({
window_options:{
is_fullpage: true,
}
});
}
// ---------------------------------------------
// Run apps from insta-login URL
// ---------------------------------------------
Expand Down
7 changes: 5 additions & 2 deletions src/gui/src/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3599,6 +3599,7 @@ fieldset[name=number-code] {
flex-direction: row;
-webkit-font-smoothing: antialiased;
flex-grow: 1;
position: relative;
}

.settings-sidebar {
Expand Down Expand Up @@ -3639,6 +3640,8 @@ fieldset[name=number-code] {

.settings-content {
display: none;
max-width: 800px;
margin: auto;
}

.settings-content[data-settings="about"] {
Expand Down Expand Up @@ -4134,13 +4137,13 @@ fieldset[name=number-code] {
}

.sidebar-toggle{
position: fixed;
position: absolute;
z-index: 9999999999;
top: 32px;
left: 2px;
border: 0;
padding-top: 5px;
padding-bottom: 5px;
top: 3px;
}
.sidebar-toggle .sidebar-toggle-button {
height: 20px;
Expand Down
1 change: 0 additions & 1 deletion src/gui/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ window.gui = async function(options){

// 🚀 Launch the GUI 🚀
window.initgui(options);

}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/gui/src/services/SettingsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ export class SettingsService extends Service {
#tabs = [];
async _init () {
;[
AboutTab,
UsageTab,
AccountTab,
SecurityTab,
PersonalizationTab,
LanguageTag,
ClockTab,
AboutTab,
].forEach(tab => {
this.register_tab(tab);
});
Expand Down

0 comments on commit 6f702c3

Please sign in to comment.