Skip to content

Commit

Permalink
Merge pull request #521 from fzlzjerry/main
Browse files Browse the repository at this point in the history
feat: enhance BIOS interface and functionality
  • Loading branch information
NB-Group authored Jan 15, 2025
2 parents 0483194 + da5befb commit e41008b
Show file tree
Hide file tree
Showing 5 changed files with 313 additions and 122 deletions.
21 changes: 17 additions & 4 deletions apps/style/bios.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ body {


* {
font-family: 'dos';
font-family: 'dos', monospace;
padding: 0px;
margin: 0px;
border: 0px;
Expand Down Expand Up @@ -74,7 +74,9 @@ a {
}

.option {
border: none;
color: #0100a2;
background-color: #aaaaaa;
padding: 0 10px;
}

.page {
Expand All @@ -83,6 +85,7 @@ a {
border: 3.5px solid #000;
height: 100%;
display: none;
overflow-y: auto;
}

.page.show {
Expand All @@ -99,10 +102,12 @@ a {
color: #000000;
}

#mainPage>.table {
#mainPage>.table,
#advancedPage>.table,
#bootPage>.table,
#securityPage>.table {
display: grid;
grid-template-columns: auto auto;
grid-template-rows: auto auto;
gap: 10px;
width: fit-content;
}
Expand Down Expand Up @@ -142,3 +147,11 @@ a {
#confirm>*:last-child {
align-self: flex-end;
}

.submenu {
padding-left: 20px;
display: grid;
grid-template-columns: auto auto;
gap: 5px;
margin-bottom: 15px;
}
68 changes: 66 additions & 2 deletions bios.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
</nav>
<nav class="pages" style="padding-left: 15px;">
<a class="tab tab0" id="main" click="tab = 0; changePage(0)" ontouchstart="changePage(0)">Main</a>
<a class="tab tab1" id="exit" click="tab = 1; changePage(1)" ontouchstart="changePage(1)">Exit</a>
<a class="tab tab1" id="advanced" click="tab = 1; changePage(1)" ontouchstart="changePage(1)">Advanced</a>
<a class="tab tab2" id="boot" click="tab = 2; changePage(2)" ontouchstart="changePage(2)">Boot</a>
<a class="tab tab3" id="security" click="tab = 3; changePage(3)" ontouchstart="changePage(3)">Security</a>
<a class="tab tab4" id="exit" click="tab = 4; changePage(4)" ontouchstart="changePage(4)">Exit</a>
</nav>
</head>
<div id="mainPage" class="page page0">
Expand All @@ -41,9 +44,70 @@
<div id="time">[11:45:14]</div>
<div>System Date: </div>
<div id="date">[11/4/5141]</div>
<div>BIOS Version: </div>
<div>Win12 BIOS v1.0.0</div>
<div>Processor: </div>
<div>The Wandering Earth (R) NB (R) Quantum Chip 550W @ 8192</div>
<div>Memory Size: </div>
<div>100 GB</div>
</div>
</div>
<div id="exitPage" class="page page1">
<div id="advancedPage" class="page page1">
<div class="table">
<div>CPU Configuration</div>
<div class="submenu">
<div>Intel Hyper-Threading: </div>
<div class="option">[Enabled]</div>
<div>Intel Turbo Boost: </div>
<div class="option">[Enabled]</div>
<div>CPU Core Ratio: </div>
<div class="option">[Auto]</div>
</div>
<div>Memory Configuration</div>
<div class="submenu">
<div>Memory Frequency: </div>
<div class="option">[Auto]</div>
<div>Memory Timing Mode: </div>
<div class="option">[Auto]</div>
<div>XMP Profile: </div>
<div class="option">[Disabled]</div>
</div>
</div>
</div>
<div id="bootPage" class="page page2">
<div class="table">
<div>Boot Configuration</div>
<div class="submenu">
<div>Fast Boot: </div>
<div class="option">[Enabled]</div>
<div>Boot Mode: </div>
<div class="option">[UEFI]</div>
<div>Boot Priority Order:</div>
<div class="submenu">
<div>1. Windows Boot Manager</div>
<div>2. SATA HDD</div>
<div>3. USB Device</div>
<div>4. Network Boot</div>
</div>
</div>
</div>
</div>
<div id="securityPage" class="page page3">
<div class="table">
<div>Security Configuration</div>
<div class="submenu">
<div>Administrator Password: </div>
<div class="option">[Not Set]</div>
<div>User Password: </div>
<div class="option">[Not Set]</div>
<div>Secure Boot: </div>
<div class="option">[Enabled]</div>
<div>TPM State: </div>
<div class="option">[Enabled]</div>
</div>
</div>
</div>
<div id="exitPage" class="page page4">
<div class="container">
<div click="BIOS_confirm(' Save configuration changes and exit now? ','toBoot()')" ontouchstart="BIOS_confirm(' Save configuration changes and exit now? ','toBoot()')" class="exit" id="e1">Exit Saving Changes</div>
<div click="BIOS_confirm(' Discard changes and exit setup? ','toBoot()');" ontouchstart="BIOS_confirm(' Discard changes and exit setup? ','toBoot()');" class="exit" id="e2">Exit Discarding Changes</div>
Expand Down
63 changes: 40 additions & 23 deletions desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -2136,34 +2136,51 @@ let apps = {
shownotice('duplication file name');
return;
}
name_1 = name_.split('.');

if (type == 'file') {
if (name_1[1] == 'txt') {
icon_ = 'icon/files/txt.png';
if (command == '')
command = 'openapp(\'notepad\')';
}
else if (name_1[1] == 'png' || name_1[1] == 'jpg' | name_1[1] == 'bmp') {
icon_ = 'icon/files/picture.png';
}
else {
icon_ = 'icon/files/none.png';
}
//这边可以适配更多的文件类型
if (icon != '') {

// 检查是否是文件夹
if (type === 'folder') {
if (icon !== '') {
icon_ = icon;
} else {
icon_ = 'icon/folder.png';
}
try {
tmp.file.push({ name: name_, ico: icon_, command: command });
tmp.folder[name_] = { folder: {}, file: [] };
} catch {
tmp = { folder: {}, file: [] };
tmp.folder[name_] = { folder: {}, file: [] };
}
catch {
tmp.push(file);
tmp.file.push({ name: name_, ico: icon_, command: command });
return;
}

// 处理文件
const name_1 = name_.split('.');
if (name_1.length < 2) {
icon_ = 'icon/files/none.png';
}
else if (name_1[1] === 'txt') {
icon_ = 'icon/files/txt.png';
if (command === '') {
command = 'openapp(\'notepad\')';
}
}
else if (['png', 'jpg', 'bmp'].includes(name_1[1])) {
icon_ = 'icon/files/picture.png';
}
else {
tmp.folder[name_] = { folder: {}, file: [] };
icon_ = 'icon/files/none.png';
}

if (icon !== '') {
icon_ = icon;
}

try {
tmp.file.push({ name: name_, ico: icon_, command: command });
}
catch {
tmp = { folder: {}, file: [] };
tmp.file = [{ name: name_, ico: icon_, command: command }];
}
apps.explorer.goto(path);
apps.explorer.rename(path + '/' + name_);
Expand Down Expand Up @@ -2214,13 +2231,13 @@ let apps = {
pathl.forEach(name => {
tmp = tmp['folder'][name];
});
tmp_file = tmp['file'];
let tmp_file = tmp['file'];
for (var i = 0; i < tmp_file.length; i++) {
if (tmp_file[i]['name'] == name) {
tmp_file.splice(i, 1);
}
}
tmp_files = tmp['folder'];
let tmp_files = tmp['folder'];
delete tmp_files[name];
apps.explorer.goto(pathl.join('/'));
apps.explorer.history.forEach(item => {
Expand Down
Loading

0 comments on commit e41008b

Please sign in to comment.