"research/object_detection/protos/losses_pb2.py" did not exist on "9ed87d1efb8ac7e89d8d3f18c3792b4deac2d1d8"
plugson_menu_tip.html 15.1 KB
Newer Older
1
2
<div class="box box-primary" id="control">
    <div class="box-header">
longpanda's avatar
longpanda committed
3
        <div class="col-sm-9" style="padding-top:8px;">
4
5
6
            <i class="fa fa-commenting">&nbsp;&nbsp;</i>
            <h1 class="box-title" style="font-weight:bold;" id="id_h1_page_title"></h1>
        </div>
longpanda's avatar
longpanda committed
7
8
9
        <div class="col-sm-1" style="padding-top:2px;">
          <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>
        </div>
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
        <div class="col-sm-2" style="font-size:16px;padding-top:8px;">
            <a id="id_a_official_doc" target="_blank" href="https://www.ventoy.net/en/plugin_menutip.html"><span class="fa fa-link"></span><span id="id_span_official_doc">官网文档</span></a>
        </div>
    </div>
    <legend></legend>
    
    <div class="box-body">
      <div class="nav-tabs-custom">
        <ul class="nav nav-tabs" id="id_tab_menu_tip">
            <li class=""><a href="#tab_0" data-toggle="tab" aria-expanded="false" style="font-weight:bold" >menu_tip</a></li>
            <li class=""><a href="#tab_1" data-toggle="tab" aria-expanded="false"  style="font-weight:bold">menu_tip_legacy</a></li>
            <li class=""><a href="#tab_2" data-toggle="tab" aria-expanded="false"  style="font-weight:bold">menu_tip_uefi</a></li>
            <li class=""><a href="#tab_3" data-toggle="tab" aria-expanded="false"  style="font-weight:bold">menu_tip_ia32</a></li>
            <li class=""><a href="#tab_4" data-toggle="tab" aria-expanded="false"  style="font-weight:bold">menu_tip_aa64</a></li>
            <li class=""><a href="#tab_5" data-toggle="tab" aria-expanded="false"  style="font-weight:bold">menu_tip_mips</a></li>
        </ul>
      </div>

      <div class="box box-primary box-solid">
        <div class="box-header with-border">
          <h3 class="box-title" style="font-size: 14px;font-weight: bold;">Menu Tips
            <span id="id_span_desc_cn"> —— 菜单提示信息</span></h3>
          <div class="box-tools pull-right">
            <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
          </div><!-- /.box-tools -->
        </div><!-- /.box-header -->
        <div class="box-body no-padding">
          <table id="id_tip_tbl" class="table table-bordered">
            <thead>
              <tr>
                <th style="width: 2%;">#</th>
                <th id="id_th_tip_type" style="width: 5%;"></th>
                <th id="id_th_tip_path" style="width: 35%;"></th>
                <th id="id_th_status" style="width: 5%;"></th>
                <th id="id_th_tip_tip" style="width: 40%;"></th>
                <th id="id_th_operation" style="width: 5%;"></th>
              </tr>
            </thead>
            <tbody>
            </tbody>
          </table>
        </div>
      </div>
      <br/><br/>

      <div class="box box-primary box-solid">
        <div class="box-header with-border">
          <h3 class="box-title" style="font-size: 14px;font-weight: bold;">Tip Style
            <span id="id_span_desc_cn"> —— 提示信息显示位置</span></h3>
          <div class="box-tools pull-right">
            <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
          </div><!-- /.box-tools -->
        </div><!-- /.box-header -->
        <div class="box-body no-padding">
          <table id="id_tip_style" class="table table-bordered">
            <thead>
              <tr>
                <th id="id_th_tip_opt" style="width: 10%;"></th>
                <th id="id_th_tip_set" style="width: 20%;"></th>
                <th id="id_th_tip_notes" style="width: 70%;"></th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td>left</td>
                <td>
                    <input type="text" class="form-control" id="id_tip_text_left"/>
                </td>
                <td>
                  <span id="id_span_desc_cn">提示信息显示的 X 坐标百分比(相对于左上角)</span>
                  <span id="id_span_desc_en">X position of the tip message. (Percentage form relative to the upper left corner)</span>
                </td>
              </tr>
              <tr>
                <td>top</td>
                <td>
                    <input type="text" class="form-control" id="id_tip_text_top"/>
                </td>
                <td>
                  <span id="id_span_desc_cn">提示信息显示的 Y 坐标百分比(相对于左上角)</span>
                  <span id="id_span_desc_en">Y position of the tip message. (Percentage form relative to the upper left corner)</span>
                </td>
              </tr>
              <tr>
                <td>color</td>
                <td>
                    <input type="text" class="form-control" id="id_tip_text_color"/>
                </td>
                <td>
                  <span id="id_span_desc_cn">提示信息的颜色。可以是 <code>blue/red/green/...</code> 等这种格式,也可以设置为 <code>#00ff00</code> 这种格式。</span>
                  <span id="id_span_desc_en">Color of the tip message. Can be in <code>blue/red/green/...</code> or <code>#00ff00</code> format.</span>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>


    </div>
</div>
<script type="text/javascript">
    
  function VtoyPageLanguageChange(newlang) {
    VtoyCommonChangeLanguage(newlang);
    $('h1[id=id_h1_page_title]').text(g_vtoy_cur_language.STR_PLUG_TIP);

    $("span[id=id_span_file_exist]").each(function(){
        $(this).text(g_vtoy_cur_language.STR_FILE_EXIST);
    });
    $("span[id=id_span_file_nonexist]").each(function(){
        $(this).text(g_vtoy_cur_language.STR_FILE_NONEXIST);
    });
    $("span[id=id_span_file_fuzzy]").each(function(){
        $(this).text(g_vtoy_cur_language.STR_FILE_FUZZY);
    });

    $("span[id=id_span_dir_exist]").each(function(){
        $(this).text(g_vtoy_cur_language.STR_DIR_EXIST);
    });
    
    $("span[id=id_span_dir_nonexist]").each(function(){
        $(this).text(g_vtoy_cur_language.STR_DIR_NONEXIST);
    });

    

    if (newlang === 'en') {
      $('#id_th_tip_path').text('Absolute Path');
      $('#id_th_tip_tip').text('Tip');
      $('#id_th_tip_type').text('Type');
      $("th[id=id_th_tip_opt]").text('Option');
      $("th[id=id_th_tip_set]").text('Setting');
      $("th[id=id_th_tip_notes]").text('Notes');

      $("span[id=id_span_desc_cn]").each(function(){
          $(this).hide();
      });
      $("span[id=id_span_desc_en]").each(function(){
          $(this).show();
      });
    } else {
      $('#id_th_tip_path').text('绝对路径');
      $('#id_th_tip_tip').text('提示');
      $('#id_th_tip_type').text('类型');
      $("th[id=id_th_tip_opt]").text('选项');
      $("th[id=id_th_tip_set]").text('设置');
      $("th[id=id_th_tip_notes]").text('说明');
      $("span[id=id_span_desc_en]").each(function(){
          $(this).hide();
      });
      $("span[id=id_span_desc_cn]").each(function(){
          $(this).show();
      });
    }
  }
  
  function FillTipTable(data) {
    var addbtn = ventoy_get_xslg_addbtn('TipAddBtn');
    var delbtn = ventoy_get_xslg_delbtn('TipDelBtn');

    var td1, td2, td3, td4, td5, td6;
    var $tbl = $("#id_tip_tbl tbody");
    $tbl.empty();

    for (var i = 0; i < data.length; i++) {
      var $tr;
      td1 = '<td>' + (i + 1) + '</td>';
      td2 = (data[i].type === 0) ? '<td>image</td>' : '<td>dir</td>';
      td3 = '<td>' + data[i].path + '</td>';
      td4 = '<td>' + ventoy_get_status_line(data[i].type, data[i].valid) + '</td>';
      td5 = '<td>' + data[i].tip + '</td>';
      td6 = '<td>' + delbtn + '</td>';

      $tr = $('<tr>' + td1 + td2 + td3 + td4 + td5 + td6 + '</tr>');

      $tr.data('path', data[i].path);
      $tr.data('index', i);
      $tbl.append($tr);
    }

    $tbl.append('<tr><td></td><td></td><td></td><td></td><td></td><td>' + addbtn + '</td></tr>');
  }

  function VtoyFillCurrentPageItem(data) {

    $('input:text[id=id_tip_text_left]').val(data.left);
    $('input:text[id=id_tip_text_top]').val(data.top);
    $('input:text[id=id_tip_text_color]').val(data.color);

200
    FillTipTable(data.tips);
201
202
203
204
205
206
207
208
209
210
211
212
  }


  function OnClickMultiModeTab() {
    var href = $(this).attr('href');
    var index = parseInt(href.substr(5, 1));

    if (index < 0 || index >= g_vtoy_data_default_index || current_tab_index === index) {
      return;
    }
    
    current_tab_index = index;
213
    VtoyFillCurrentPageItem(m_data_tip[index]);
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
  }

  //Main process
  var m_data_tip;
  var current_tab_index = 0;
  callVtoySync({method : 'get_tip'}, function(data) {
    m_data_tip = data;
  });
  

  function AddTipEntry(root, type, valid, extra) {
    var list = m_data_tip[current_tab_index].tips;
    var data = {
      "path": root.substr(g_current_dir.length),
      "tip": extra,
      "type": type,
      "valid": valid
    };

    for (var i = 0; i < list.length; i++) {
      if (list[i].path === data.path) {
        Message.error(g_vtoy_cur_language.STR_DUPLICATE_PATH);
        return;
      }
    }

    callVtoy({
      method : 'tip_add',
      index: current_tab_index,
      path: data.path,
      tip: data.tip,
      type: type
    }, function(e) {
247
248
249
250
251
252
253
      if (e.result === 'success') {
        list.push(data);
        FillTipTable(list);
        Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);
      } else if (e.result === 'duplicate') {
        Message.error(g_vtoy_cur_language.STR_DUPLICATE_PATH);
      }
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
    });
  }

  function OnAddImageTip(root, valid, extra) {
    AddTipEntry(root, 0, valid, extra);
  }

  function OnAddDirTip(root, extra) {
    AddTipEntry(root, 1, 1, extra);
  }

  function OnAddTipBtnClick(sel)  {
    if (sel === 0) {
      var tip1 = (g_current_os === 'windows') ? '\\ISO\\Windows11.iso' : "/ISO/Ubuntu-20.04-desktop-amd64.iso";
      var tip2 = (g_current_os === 'windows') ? '\\ISO\\Windows**.iso' : "/ISO/Ubuntu-*****-desktop-amd64.iso";
      var para = {
          "title": g_vtoy_cur_language.STR_SET_TIP,
          "fuzzy": 1,
          "tip1": g_current_dir + tip1,
          "tip2": g_current_dir + tip2,
          "tip3": '',
          "extra": true,
          "extra_title": g_vtoy_cur_language.STR_TIP
      };
      VtoySelectFilePath(OnAddImageTip, para);
    } else {
      var tip = (g_current_os === 'windows') ? '\\ISO\\Windows' : "/ISO/Linux";
      var para = {
          "title": g_vtoy_cur_language.STR_SET_TIP,
          "tip": g_current_dir + tip,
          "tip3": '',
          "extra": true,
          "extra_title": g_vtoy_cur_language.STR_TIP
      };
      VtoySelectDirPath(OnAddDirTip, para);
    }
  }

  $("#id_tip_tbl").on('click', '.TipAddBtn', function() {
    var para = [
      {
        "selected": true,
        "tip": g_vtoy_cur_language.STR_SET_TIP_FOR_FILE
      },
      {
        "selected": false,
        "tip": g_vtoy_cur_language.STR_SET_TIP_FOR_DIR
      }
    ];

    VtoySelectType(OnAddTipBtnClick, para);
  });

  $("#id_tip_tbl").on('click', '.TipDelBtn', function() {
    var $tr = $(this).closest('tr');
		var path = $tr.data('path');
    var index = $tr.data('index');

    callVtoySync({
        method : 'tip_del',
        index: current_tab_index,
        path: path
    }, function(data) {
      m_data_tip[current_tab_index].tips.splice(index, 1);
      FillTipTable(m_data_tip[current_tab_index].tips);
      Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);
    });
  });

  function VtoySaveCurrentPage() {
    var left = $('input:text[id=id_tip_text_left]').val();
    var top = $('input:text[id=id_tip_text_top]').val();
    var color = $('input:text[id=id_tip_text_color]').val();

    callVtoy({
      method : 'save_tip',
      index: current_tab_index,
      left: left,      
      top: top,
      color: color
    }, function(e) {
      Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);
    });
  }

  $('input:text[id=id_tip_text_left]').change(function() {
    var value = $('input:text[id=id_tip_text_left]').val();
341
    if (ventoy_check_percent(value)) {      
342
      VtoySaveCurrentPage();
343
      m_data_tip[current_tab_index].left = value;
344
345
346
347
348
349
350
351
352
    } else {
      Message.error(g_vtoy_cur_language.STR_INVALID_PERCENT);
      $('input:text[id=id_tip_text_left]').val(m_data_tip[current_tab_index].left);
    }
  });
  $('input:text[id=id_tip_text_top]').change(function() {
    var value = $('input:text[id=id_tip_text_top]').val();
    if (ventoy_check_percent(value)) {
      VtoySaveCurrentPage();
353
      m_data_tip[current_tab_index].top = value;
354
355
356
357
358
359
360
361
362
363
    } else {
      Message.error(g_vtoy_cur_language.STR_INVALID_PERCENT);
      $('input:text[id=id_tip_text_top]').val(m_data_tip[current_tab_index].top);
    }
  });
  $('input:text[id=id_tip_text_color]').change(function() {
    var value = $('input:text[id=id_tip_text_color]').val();
    if (value.length > 0) {
      if (ventoy_check_color(value)) {
        VtoySaveCurrentPage();
364
        m_data_tip[current_tab_index].color = value;
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
      } else {
        Message.error(g_vtoy_cur_language.STR_INVALID_COLOR);
        $('input:text[id=id_tip_text_color]').val(m_data_tip[current_tab_index].color);
      }
    } else {
      $('input:text[id=id_tip_text_color]').val(m_data_tip[current_tab_index].color);
    }
  });


  $('#id_tab_menu_tip a[href="#tab_0"]').click(OnClickMultiModeTab);
  $('#id_tab_menu_tip a[href="#tab_1"]').click(OnClickMultiModeTab);
  $('#id_tab_menu_tip a[href="#tab_2"]').click(OnClickMultiModeTab);
  $('#id_tab_menu_tip a[href="#tab_3"]').click(OnClickMultiModeTab);
  $('#id_tab_menu_tip a[href="#tab_4"]').click(OnClickMultiModeTab);
  $('#id_tab_menu_tip a[href="#tab_5"]').click(OnClickMultiModeTab);

longpanda's avatar
longpanda committed
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
  function UpdateTabTitleIcon(data) {
    CommonUpdateTabTitleIcon(data.exist_menu_tip, '#id_tab_menu_tip a[href="#tab_', 'menu_tip');
  }
  $('#id_btn_reset').click(function() { 
    Modal.confirm({msg:GetResetTabConfigTipMsg(current_tab_index, 'menu_tip')}).on(function(e) {
        if (e) {            
            callVtoySync({
                method : 'tip_del',
                index: current_tab_index,
                path: g_del_all_path
            }, function(data) {
                
            });
            
            m_data_tip[current_tab_index].left = m_data_tip[g_vtoy_data_default_index].left;
            m_data_tip[current_tab_index].top = m_data_tip[g_vtoy_data_default_index].top;
            m_data_tip[current_tab_index].color = m_data_tip[g_vtoy_data_default_index].color;
            m_data_tip[current_tab_index].tips.length = 0;            
            VtoyFillCurrentPageItem(m_data_tip[g_vtoy_data_default_index]);
            VtoySaveCurrentPage();
        }
    });
  });
  
406
407
408
409
410
  $('#id_tab_menu_tip a[href="#tab_0"]').tab('show');
  VtoyFillCurrentPageItem(m_data_tip[0]);
  VtoyPageLanguageChange(g_current_language);

</script>