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
9 changes: 8 additions & 1 deletion webui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,14 @@
<div class="card-title" slot="headline" data-i18n="title_kernel">Kernel</div>
<div id="kernel-info"></div>
</div>
<div class="module-list content-padding" id="kpm-embed-list"></div>
<div class="switch-card content-padding patch-only">
<label>
<div data-i18n="label_flash_to_device">Flash to device</div>
<md-switch selected id="flash-to-device"></md-switch>
</label>
<md-ripple></md-ripple>
</div>
<div class="module-list content-padding patch-only" id="kpm-embed-list"></div>
<div class="trailing-btn content-padding" id="patch-options">
<md-filled-button class="patch-only" id="embed" data-i18n="button_embed_kpm">Embed KPM</md-filled-button>
<md-filled-button class="patch-only" id="start" data-i18n="button_start">Start</md-filled-button>
Expand Down
4 changes: 3 additions & 1 deletion webui/page/patch.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ async function embedKPM() {
function patch(type) {
const terminal = document.querySelector('#patch-terminal');
const pageContent = terminal.closest('.page-content');
const flashToDevice = document.getElementById('flash-to-device');

const onOutput = (data) => {
terminal.innerHTML += `<div>${data}</div>`;
pageContent.scrollTo({ top: pageContent.scrollHeight, behavior: 'smooth' });
Expand All @@ -348,7 +350,7 @@ function patch(type) {
args.push(
`${modDir}/patch/boot_patch.sh`,
bootDev,
'true'
flashToDevice.selected ? 'true' : 'false'
);

// New kpm
Expand Down
1 change: 1 addition & 0 deletions webui/public/locales/strings/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<string name="label_show_system_app">Show system app</string>
<string name="label_system_default">System Default</string>
<string name="label_trigger_event">Trigger Event</string>
<string name="label_flash_to_device">Flash to Device</string>
<!-- Status -->
<string name="status_not_installed">Not installed</string>
<string name="status_working">Working 😋</string>
Expand Down
1 change: 1 addition & 0 deletions webui/public/locales/strings/zh-CN.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<string name="label_show_system_app">显示系统应用</string>
<string name="label_system_default">系统默认</string>
<string name="label_trigger_event">触发事件</string>
<string name="label_flash_to_device">直接安装</string>
<!-- Status -->
<string name="status_not_installed">未安装</string>
<string name="status_working">工作中 😋</string>
Expand Down
18 changes: 18 additions & 0 deletions webui/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,24 @@ body {
transition: all 0.2s ease;
}

.switch-card {
width: 100%;
border-radius: 20px;
background-color: var(--md-sys-color-tonal-surface);
word-wrap: break-word;
position: relative;
}

.switch-card label {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
padding: 20px;
box-sizing: border-box;
font-size: 1.1em;
}

.search-hidden {
display: none !important;
}
Expand Down