1 <div class=
"box box-primary" id=
"control">
2 <div class=
"box-header">
3 <div class=
"col-sm-9" style=
"padding-top:8px;">
4 <i class=
"fa fa-file-image-o"> </i>
5 <h1 class=
"box-title" style=
"font-weight:bold;" id=
"id_h1_page_title">主题插件
</h1>
7 <div class=
"col-sm-1" style=
"padding-top:2px;">
8 <button id=
"id_btn_reset" class=
"btn btn-sm btn-danger btn-del"><i class=
"fa fa-trash"></i><span id=
"id_btn_span_reset">Reset
</span></button>
10 <div class=
"col-sm-2" style=
"font-size:16px;padding-top:8px;">
11 <a id=
"id_a_official_doc" target=
"_blank" href=
"https://www.ventoy.net/cn/plugin_theme.html"><span class=
"fa fa-link"></span><span id=
"id_span_official_doc">官网文档
</span></a>
16 <div class=
"box-body">
18 <div class=
"nav-tabs-custom">
19 <ul class=
"nav nav-tabs" id=
"id_tab_theme">
20 <li class=
""><a href=
"#tab_0" data-toggle=
"tab" aria-expanded=
"false" style=
"font-weight:bold" >theme
</a></li>
21 <li class=
""><a href=
"#tab_1" data-toggle=
"tab" aria-expanded=
"false" style=
"font-weight:bold">theme_legacy
</a></li>
22 <li class=
""><a href=
"#tab_2" data-toggle=
"tab" aria-expanded=
"false" style=
"font-weight:bold">theme_uefi
</a></li>
23 <li class=
""><a href=
"#tab_3" data-toggle=
"tab" aria-expanded=
"false" style=
"font-weight:bold">theme_ia32
</a></li>
24 <li class=
""><a href=
"#tab_4" data-toggle=
"tab" aria-expanded=
"false" style=
"font-weight:bold">theme_aa64
</a></li>
25 <li class=
""><a href=
"#tab_5" data-toggle=
"tab" aria-expanded=
"false" style=
"font-weight:bold">theme_mips
</a></li>
29 <div class=
"box box-primary box-solid">
30 <div class=
"box-header with-border">
31 <h3 class=
"box-title" style=
"font-size: 14px;font-weight: bold;">file
32 <span id=
"id_span_desc_cn"> —— 主题配置文件
</span></h3>
33 <div class=
"box-tools pull-right">
34 <button class=
"btn btn-box-tool" data-widget=
"collapse"><i class=
"fa fa-minus"></i></button>
35 </div><!-- /.box-tools -->
36 </div><!-- /.box-header -->
37 <div class=
"box-body no-padding">
38 <table class=
"table table-bordered no-padding" id=
"theme_file_table">
39 <tr style=
"font-weight:bold;">
40 <td class=
"td_ctrl_col" id=
"td_title_setting">选项设置
</td>
42 <table id=
"id_theme_tbl_file" class=
"table table-bordered">
45 <th style=
"width: 5%">#
</th>
46 <th id=
"id_th_file_path">文件路径
</th>
47 <th style=
"width: 10%" id=
"id_th_default">默认
</th>
48 <th style=
"width: 10%" id=
"id_th_status">状态
</th>
49 <th style=
"width: 10%" id=
"id_th_operation">操作
</th>
58 <tr id=
"tr_title_desc_cn">
59 <td class=
"td_ctrl_col">选项说明
</td>
61 theme.txt 文件的全路径。可以设置
1个或者多个。当设置为多个时,启动之后还可以通过
<code>F5 Tools --> Theme Select
</code> 菜单进行切换。
64 <tr id=
"tr_title_desc_en">
65 <td class=
"td_ctrl_col">Option Description
</td>
67 The theme.txt file path. You can add one or more files. You can switch between themes with
<code>F5 Tools --> Theme Select
</code> menu if you set more than one themes.
71 </div><!-- /.box-body -->
75 <div class=
"box box-primary box-solid">
76 <div class=
"box-header with-border">
77 <h3 class=
"box-title" style=
"font-size: 14px;font-weight: bold;">display_mode
78 <span id=
"id_span_desc_cn"> —— 屏幕显示模式
</span></h3>
79 <div class=
"box-tools pull-right">
80 <button class=
"btn btn-box-tool" data-widget=
"collapse"><i class=
"fa fa-minus"></i></button>
81 </div><!-- /.box-tools -->
82 </div><!-- /.box-header -->
83 <div class=
"box-body no-padding">
84 <table class=
"table table-bordered no-padding">
85 <tr style=
"font-weight:bold;">
86 <td class=
"td_ctrl_col" id=
"td_title_setting">选项设置
</td>
88 <select id=
"id_theme_sel_dismode" name=
"name_theme_sel_dismode" class=
"form-control" >
89 <option title=
"GUI" selected
>GUI
</option>
90 <option title=
"CLI">CLI
</option>
91 <option title=
"serial">serial
</option>
92 <option title=
"serial_console">serial_console
</option>
95 <tr id=
"tr_title_desc_cn">
96 <td class=
"td_ctrl_col">选项说明
</td>
98 菜单显示模式,可以设置为 默认为 GUI 模式。GUI和CLI 分别对应图形模式和文本模式。
<br/>
99 在有极个别的机器上Ventoy的背景菜单无法显示,或者显示后菜单移动极其缓慢,这种情况可以默认设置为文本模式。
<br/>
100 不过,不管GUI还是CLI都是基于VGA显示设备的,如果你的机器上只有串口,你可以设置为
<code>serial
</code> <br/>
101 当然,如果既有串口也有VGA设备,则也可以设置为
<code>serial_console
</code> <br/>
102 <span style='color:red;font-weight:bold;'
>注意:如果菜单名称(文件名)里有中文的话,在文本或serial模式下是无法显示的。
</span>
105 <tr id=
"tr_title_desc_en">
106 <td class=
"td_ctrl_col">Option Description
</td>
108 Boot menu display mode, default is
<code>GUI
</code>.
<code>GUI
</code> or
<code>CLI
</code> corresponding to the GUI mode and TEXT mode respectively.
<br/>
109 On very few machines Ventoy's menu can't be shown or the cursor moves extremely slow. In this case you can set the default mode to "CLI".
<br/>
110 However, both "GUI" and "CLI" need a VGA device, if your machine only has serial, you can use
<code>serial
</code><br/>
111 Also you can use
<code>serial_console
</code> if you have both serial and VGA device.
<br/>
112 <span style='color:red;font-weight:bold;'
>Attention: Unicode characters will NOT be displayed normally in CLI or serial mode.
</span>
116 </div><!-- /.box-body -->
120 <div class=
"box box-primary box-solid">
121 <div class=
"box-header with-border">
122 <h3 class=
"box-title" style=
"font-size: 14px;font-weight: bold;">gfxmode
123 <span id=
"id_span_desc_cn"> —— 屏幕分辨率
</span></h3>
124 <div class=
"box-tools pull-right">
125 <button class=
"btn btn-box-tool" data-widget=
"collapse"><i class=
"fa fa-minus"></i></button>
126 </div><!-- /.box-tools -->
127 </div><!-- /.box-header -->
128 <div class=
"box-body no-padding">
129 <table class=
"table table-bordered no-padding">
130 <tr style=
"font-weight:bold;">
131 <td class=
"td_ctrl_col" id=
"td_title_setting">选项设置
</td>
133 <select id=
"id_theme_sel_gfxmode" name=
"name_theme_sel_gfxmode" class=
"form-control">
134 <option title=
"1920x1080">1920x1080
</option>
135 <option title=
"1680x1050">1680x1050
</option>
136 <option title=
"1600x900">1600x900
</option>
137 <option title=
"1440x900">1440x900
</option>
138 <option title=
"1280x1024">1280x1024
</option>
139 <option title=
"1280x960">1280x960
</option>
140 <option title=
"1024x768" selected
>1024x768
</option>
141 <option title=
"800x600">800x600
</option>
144 <tr id=
"tr_title_desc_cn">
145 <td class=
"td_ctrl_col">选项说明
</td>
147 默认使用的屏幕分辨率,默认为 "
1024x768"。只有在上面的
<code>display_mode
</code> 选项设置为
<code>GUI
</code> 时才有效。
150 <tr id=
"tr_title_desc_en">
151 <td class=
"td_ctrl_col">Option Description
</td>
153 Default screen resolution, default is "
1024x768". Only take effect when
<code>display_mode
</code> option is
<code>GUI
</code>.
157 </div><!-- /.box-body -->
161 <div class=
"box box-primary box-solid">
162 <div class=
"box-header with-border">
163 <h3 class=
"box-title" style=
"font-size: 14px;font-weight: bold;">fonts
164 <span id=
"id_span_desc_cn"> —— 字体文件
</span></h3>
165 <div class=
"box-tools pull-right">
166 <button class=
"btn btn-box-tool" data-widget=
"collapse"><i class=
"fa fa-minus"></i></button>
167 </div><!-- /.box-tools -->
168 </div><!-- /.box-header -->
169 <div class=
"box-body no-padding">
170 <table class=
"table table-bordered no-padding">
171 <tr style=
"font-weight:bold;">
172 <td class=
"td_ctrl_col" id=
"td_title_setting">选项设置
</td>
174 <table id=
"id_theme_tbl_fonts" class=
"table table-bordered">
177 <th style=
"width: 5%">#
</th>
178 <th id=
"id_th_file_path">文件路径
</th>
179 <th style=
"width: 10%" id=
"id_th_status">状态
</th>
180 <th style=
"width: 10%" id=
"id_th_operation">操作
</th>
188 <tr id=
"tr_title_desc_cn">
189 <td class=
"td_ctrl_col">选项说明
</td>
191 字体文件的全路径。Ventoy在启动时会依次加载这些字体文件。
194 <tr id=
"tr_title_desc_en">
195 <td class=
"td_ctrl_col">Option Description
</td>
197 Full path of fonts file. Ventoy will load each of them when boot.
201 </div><!-- /.box-body -->
208 <script type=
"text/javascript">
209 function VtoyPageLanguageChange(newlang) {
210 VtoyCommonChangeLanguage(newlang);
212 $('h1[id=id_h1_page_title]').text(g_vtoy_cur_language.STR_PLUG_THEME);
214 $("span[id=id_span_file_exist]").each(function(){
215 $(this).text(g_vtoy_cur_language.STR_FILE_EXIST);
217 $("span[id=id_span_file_nonexist]").each(function(){
218 $(this).text(g_vtoy_cur_language.STR_FILE_NONEXIST);
221 $("th[id=id_th_default]").text(g_vtoy_cur_language.STR_DEFAULT);
223 $("span[id=id_span_random_sel]").text(g_vtoy_cur_language.STR_RANDOM_SEL);
224 $("span[id=id_span_default_sel]").text(g_vtoy_cur_language.STR_DEFAULT_SEL);
227 function VtoyGetCurrentPageItem(data) {
230 data.gfxmode = $('select[id=id_theme_sel_gfxmode').val();
232 mode = $('select[id=id_theme_sel_dismode').val();
233 if (mode === 'serial_console') {
234 data.display_mode =
3;
235 } else if (mode === 'serial') {
236 data.display_mode =
2;
237 } else if (mode === 'CLI') {
238 data.display_mode =
1;
240 data.display_mode =
0;
244 function VtoySaveCurrentPage() {
245 VtoyGetCurrentPageItem(m_data_theme[current_tab_index]);
246 var data = m_data_theme[current_tab_index];
249 method : 'save_theme',
250 index: current_tab_index,
251 display_mode: data.display_mode,
252 gfxmode: data.gfxmode,
253 default_file: data.default_file
255 Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);
260 function FillThemeFileTable(list, default_file) {
262 var exist = '
<span id=
"id_span_file_exist" style=
"line-height: 1.5;" class=
"label pull-left bg-green">' + g_vtoy_cur_language.STR_FILE_EXIST + '
</span>';
263 var nonexist = '
<span id=
"id_span_file_nonexist" style=
"line-height: 1.5;" class=
"label pull-left bg-red">' + g_vtoy_cur_language.STR_FILE_NONEXIST + '
</span>';
264 var addbtn = ventoy_get_xslg_addbtn('ThemeFileAddBtn');
265 var delbtn = ventoy_get_xslg_delbtn('ThemeFileDelBtn');
267 var default_random = '
<label class=
"radio-inline"><input type=
"radio" id=
"id_theme_file_radio0" name=
"id_theme_file_radio" data-type=
"0" value=
"0"/><span id=
"id_span_random_sel">' + g_vtoy_cur_language.STR_RANDOM_SEL + '
</span></label>';
268 var td1, td2, td3, td4, td5;
269 var $tbl = $("#id_theme_tbl_file tbody");
272 for (var i =
0; i < list.length; i++) {
274 td1 = '
<td>' + (i +
1) + '
</td>';
275 td2 = '
<td>' + list[i].path + '
</td>';
278 var sel = '
<label class=
"radio-inline"><input type=
"radio" id=
"id_theme_file_radio'+ id + '" name=
"id_theme_file_radio" data-type=
"'+
279 id + '" value=
"'+ id +'"/><span id=
"id_span_default_sel">' + g_vtoy_cur_language.STR_DEFAULT_SEL + '
</span></label>';
281 td3 = '
<td>' + sel + '
</td>';
283 if (list[i].valid ===
1) {
284 td4 = '
<td style=
"vertical-align: middle;">' + exist + '
</td>';
286 td4 = '
<td style=
"vertical-align: middle;">' + nonexist + '
</td>';
289 td5 = '
<td>' + delbtn + '
</td>';
290 $tr = $('
<tr>' + td1 + td2 + td3 + td4 + td5 + '
</tr>');
292 $tr.data('path', list[i].path);
293 $tr.data('index', i);
297 $tbl.append('
<tr><td></td><td></td><td>' + default_random + '
</td><td></td><td>' + addbtn + '
</td></tr>');
299 var selid = 'input[type=radio][id=id_theme_file_radio' + default_file + ']';
300 $(selid)[
0].checked = true;
302 $('input[type=radio]').each(function(){
303 var id = $(this).attr('id');
304 if (typeof(id) != 'undefined' && id.startsWith('id_theme_file')) {
305 $(this).change(function() {
306 m_data_theme[current_tab_index].default_file =parseInt(id.substr(id.length -
1));
307 VtoySaveCurrentPage();
312 if (list.length
>=
2) {
313 $("th[id=id_th_default]").show();
314 $('#id_theme_tbl_file tr').find('td:eq(
2)').show();
316 $("th[id=id_th_default]").hide();
317 $('#id_theme_tbl_file tr').find('td:eq(
2)').hide();
322 function FillThemeFontTable(list) {
323 var exist = '
<span id=
"id_span_file_exist" style=
"line-height: 1.5;" class=
"label pull-left bg-green">' + g_vtoy_cur_language.STR_FILE_EXIST + '
</span>';
324 var nonexist = '
<span id=
"id_span_file_nonexist" style=
"line-height: 1.5;" class=
"label pull-left bg-red">' + g_vtoy_cur_language.STR_FILE_NONEXIST + '
</span>';
325 var addbtn = ventoy_get_xslg_addbtn('ThemeFontAddBtn');
326 var delbtn = ventoy_get_xslg_delbtn('ThemeFontDelBtn');
327 var td1, td2, td3, td4;
328 var $tbl = $("#id_theme_tbl_fonts tbody");
331 for (var i =
0; i < list.length; i++) {
333 td1 = '
<td>' + (i +
1) + '
</td>';
334 td2 = '
<td>' + list[i].path + '
</td>';
336 if (list[i].valid ===
1) {
337 td3 = '
<td style=
"vertical-align: middle;">' + exist + '
</td>';
339 td3 = '
<td style=
"vertical-align: middle;">' + nonexist + '
</td>';
342 td4 = '
<td>' + delbtn + '
</td>';
344 $tr = $('
<tr>' + td1 + td2 + td3 + td4 + '
</tr>');
346 $tr.data('path', list[i].path);
347 $tr.data('index', i);
352 $tbl.append('
<tr><td></td><td></td><td></td><td>' + addbtn + '
</td></tr>');
355 function VtoyFillCurrentPageItem(data) {
356 $('select[id=id_theme_sel_gfxmode').val(data.gfxmode);
358 if (data.display_mode ===
3) {
359 $('select[id=id_theme_sel_dismode').val('serial_console');
360 } else if (data.display_mode ===
2) {
361 $('select[id=id_theme_sel_dismode').val('serial');
362 } else if (data.display_mode ===
1) {
363 $('select[id=id_theme_sel_dismode').val('CLI');
365 $('select[id=id_theme_sel_dismode').val('GUI');
368 FillThemeFileTable(data.filelist, data.default_file);
369 FillThemeFontTable(data.fontslist);
374 function OnClickMultiModeTab() {
375 var href = $(this).attr('href');
376 var index = parseInt(href.substr(
5,
1));
378 if (index <
0 || index
>= g_vtoy_data_default_index || current_tab_index === index) {
382 current_tab_index = index;
383 VtoyFillCurrentPageItem(m_data_theme[index]);
387 function OnAddThemeFile(root, valid, extra) {
388 var list = m_data_theme[current_tab_index].filelist;
390 "path": root.substr(g_current_dir.length),
394 for (var i =
0; i < list.length; i++) {
395 if (list[i].path === data.path) {
396 Message.error(g_vtoy_cur_language.STR_DUPLICATE_PATH);
402 method : 'theme_add_file',
403 index: current_tab_index,
406 if (e.result === 'success') {
408 FillThemeFileTable(list, m_data_theme[current_tab_index].default_file);
409 Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);
410 } else if (e.result === 'duplicate') {
411 Message.error(g_vtoy_cur_language.STR_DUPLICATE_PATH);
416 function OnAddThemeFont(root, valid, extra) {
417 var list = m_data_theme[current_tab_index].fontslist;
419 "path": root.substr(g_current_dir.length),
423 for (var i =
0; i < list.length; i++) {
424 if (list[i].path === data.path) {
425 Message.error(g_vtoy_cur_language.STR_DUPLICATE_PATH);
431 method : 'theme_add_font',
432 index: current_tab_index,
435 if (e.result === 'success') {
437 FillThemeFontTable(list);
438 Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);
439 } else if (e.result === 'duplicate') {
440 Message.error(g_vtoy_cur_language.STR_DUPLICATE_PATH);
449 var current_tab_index =
0;
450 callVtoySync({method : 'get_theme'}, function(data) {
454 $("#theme_file_table").on('click', '.ThemeFileAddBtn', function() {
455 var tip = (g_current_os === 'windows') ? '\\ventoy\\themes\\test\\theme.txt' : "/ventoy/themes/test/theme.txt";
457 "title": g_vtoy_cur_language.STR_ADD_THEME,
459 "tip1": g_current_dir + tip,
466 VtoySelectFilePath(OnAddThemeFile, para);
469 $("#theme_file_table").on('click', '.ThemeFileDelBtn', function() {
470 var $tr = $(this).closest('tr');
471 var path = $tr.data('path');
472 var index = $tr.data('index');
475 method : 'theme_del_file',
476 index: current_tab_index,
479 m_data_theme[current_tab_index].filelist.splice(index,
1);
480 FillThemeFileTable(m_data_theme[current_tab_index].filelist, m_data_theme[current_tab_index].default_file);
481 Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);
485 $("#id_theme_tbl_fonts").on('click', '.ThemeFontAddBtn', function() {
486 var tip = (g_current_os === 'windows') ? '\\ventoy\\themes\\blur\\Hack-
12.pf2' : "/ventoy/themes/blur/Hack-
12.pf2";
488 "title": g_vtoy_cur_language.STR_ADD_FONT,
490 "tip1": g_current_dir + tip,
497 VtoySelectFilePath(OnAddThemeFont, para);
500 $("#id_theme_tbl_fonts").on('click', '.ThemeFontDelBtn', function() {
501 var $tr = $(this).closest('tr');
502 var path = $tr.data('path');
503 var index = $tr.data('index');
506 method : 'theme_del_font',
507 index: current_tab_index,
510 m_data_theme[current_tab_index].fontslist.splice(index,
1);
511 FillThemeFontTable(m_data_theme[current_tab_index].fontslist);
512 Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);
516 $('select[id=id_theme_sel_gfxmode]').change(VtoySaveCurrentPage);
517 $('select[id=id_theme_sel_dismode]').change(VtoySaveCurrentPage);
519 $('#id_tab_theme a[
href="#tab_0"]').click(OnClickMultiModeTab);
520 $('#id_tab_theme a[
href="#tab_1"]').click(OnClickMultiModeTab);
521 $('#id_tab_theme a[
href="#tab_2"]').click(OnClickMultiModeTab);
522 $('#id_tab_theme a[
href="#tab_3"]').click(OnClickMultiModeTab);
523 $('#id_tab_theme a[
href="#tab_4"]').click(OnClickMultiModeTab);
524 $('#id_tab_theme a[
href="#tab_5"]').click(OnClickMultiModeTab);
526 function UpdateTabTitleIcon(data) {
527 CommonUpdateTabTitleIcon(data.exist_theme, '#id_tab_theme a[
href="#tab_', 'theme');
529 $('#id_btn_reset').click(function() {
530 Modal.confirm({msg:GetResetTabConfigTipMsg(current_tab_index, 'theme')}).on(function(e) {
533 method : 'theme_del_file',
534 index: current_tab_index,
541 method : 'theme_del_font',
542 index: current_tab_index,
548 m_data_theme[current_tab_index].filelist.length =
0;
549 m_data_theme[current_tab_index].fontslist.length =
0;
550 VtoyFillCurrentPageItem(m_data_theme[g_vtoy_data_default_index]);
551 VtoySaveCurrentPage();
556 $('#id_tab_theme a[
href="#tab_0"]').tab('show');
557 VtoyFillCurrentPageItem(m_data_theme[
0]);
558 VtoyPageLanguageChange(g_current_language);