Skip to content

Commit

Permalink
fix #252 使用title属性替换selectpicker的默认选择项
Browse files Browse the repository at this point in the history
  • Loading branch information
hhyo committed Jun 5, 2019
1 parent 1a523b5 commit 9da79d3
Show file tree
Hide file tree
Showing 12 changed files with 91 additions and 118 deletions.
34 changes: 18 additions & 16 deletions sql/templates/binlog2sql.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<h5 class="control-label text-bold">选择实例</h5>
<div class="form-group">
<select id="instance_name" name="instance_name"
class="selectpicker show-tick form-control bs-select-hidden" data-live-search="true"
data-placeholder="请选择实例:" required>
<option value="is-empty" disabled="" selected="selected">请选择实例:</option>
class="selectpicker show-tick form-control bs-select-hidden"
title="请选择实例:"
data-live-search="true" required>
{% for instance_name in instances %}
<option value="{{ instance_name }}">{{ instance_name }}</option>
{% endfor %}
Expand Down Expand Up @@ -60,17 +60,19 @@ <h5 class="control-label text-bold">解析范围控制:</h5>
onkeyup="if(event.keyCode !=37 && event.keyCode != 39)value=value.replace(/\D/g,'')">
</div>
<div class="form-group">
<select id="start_file" class="selectpicker form-control" required>
<option value="is-empty" disabled="">起始解析文件:</option>
<select id="start_file" class="selectpicker form-control"
title="起始解析文件:"
required>
</select>
</div>
<div class="form-group">
<input type="number" class="form-control" id="start_pos" placeholder="起始解析位置(可选)"
onkeyup="if(event.keyCode !=37 && event.keyCode != 39)value=value.replace(/\D/g,'')">
</div>
<div class="form-group">
<select id="end_file" class="selectpicker form-control" required>
<option value="is-empty" disabled="">终止解析文件(可选):</option>
<select id="end_file" class="selectpicker form-control"
title="终止解析文件(可选):"
required>
</select>
</div>
<div class="form-group">
Expand All @@ -96,19 +98,22 @@ <h5 class="control-label text-bold">对象过滤:</h5>
</div>
<div class="form-group">
<select id="only_schemas" class="selectpicker form-control "
data-live-search="true" required>
<option value="is-empty" disabled="" selected="selected">数据库过滤(可选):</option>
data-live-search="true"
title="数据库过滤(可选):"
required>
</select>
</div>
<div class="form-group">
<select id="only_tables" class="selectpicker form-control "
data-live-search="true" multiple="multiple" required>
<option value="is-empty" disabled="" selected>表过滤(可选):</option>
data-live-search="true"
title="表过滤(可选):"
multiple="multiple" required>
</select>
</div>
<select id="sql_type" class="selectpicker form-control "
data-live-search="true" multiple="multiple" required>
<option value="is-empty" disabled="">类型过滤(可选):</option>
data-live-search="true"
title="类型过滤(可选):"
multiple="multiple" required>
<option value="INSERT">INSERT</option>
<option value="UPDATE">UPDATE</option>
<option value="DELETE">DELETE</option>
Expand Down Expand Up @@ -172,7 +177,6 @@ <h5 class="control-label text-bold" style="color: red">
var name = "<option value=\"" + result[i] + "\">" + result[i] + "</option>";
$("#only_schemas").append(name);
}
$("#only_schemas").prepend("<option value=\"is-empty\" disabled=\"\" selected=\"selected\">数据库过滤(可选):</option>");
$('#only_schemas').selectpicker('render');
$('#only_schemas').selectpicker('refresh');
} else {
Expand Down Expand Up @@ -200,10 +204,8 @@ <h5 class="control-label text-bold" style="color: red">
$("#start_file").append(name);
$("#end_file").append(name);
}
$("#start_file").prepend("<option value=\"is-empty\" disabled=\"\" selected=\"selected\">起始解析文件:</option>");
$('#start_file').selectpicker('render');
$('#start_file').selectpicker('refresh');
$("#end_file").prepend("<option value=\"is-empty\" disabled=\"\" selected=\"selected\">终止解析文件(可选):</option>");
$('#end_file').selectpicker('render');
$('#end_file').selectpicker('refresh');
} else {
Expand Down
5 changes: 2 additions & 3 deletions sql/templates/dbdiagnostic.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,15 @@
<div class="form-inline pull-right">
<div class="form-group ">
<select id=instance_name class="form-control selectpicker" name="instance_name_list"
title="请选择实例:"
data-live-search="true">
<option value="is-empty" disabled="" selected="selected">请选择实例</option>
{% for instance_name in instances %}
<option value="{{ instance_name }}">{{ instance_name }}</option>
{% endfor %}
</select>
</div>
<div id="command-div" class="form-group">
<select id="command" class="form-control selectpicker" name="command_type">
<option value="is-empty" disabled="">command类型</option>
<select id="command" class="form-control selectpicker" name="command_type" title="command类型">
<option value="All">All</option>
<option value="Query" selected="selected">Query</option>
<option value="Not Sleep">Not Sleep</option>
Expand Down
2 changes: 1 addition & 1 deletion sql/templates/groupmgmt.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ <h4 class="modal-title" id="myModalLabel">新增关联对象</h4>
<div class="form-group">
<select id="object_type" name="object_type"
class="selectpicker show-tick form-control bs-select-hidden"
data-name="关联对象类型" data-placeholder="请选择关联对象类型:" data-live-search="true" required>
data-name="关联对象类型" title="请选择关联对象类型:" data-live-search="true" required>
<option value="is-empty" disabled="" selected="selected">请选择关联对象类型:</option>
<option value=0>用户</option>
<option value=1>实例</option>
Expand Down
6 changes: 2 additions & 4 deletions sql/templates/instance.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
<!-- 自定义操作按钮-->
<div id="toolbar" class="form-inline pull-left">
<div class="form-group">
<select id="type" class="form-control selectpicker">
<option value="" selected="selected">实例类型</option>
<select id="type" class="form-control selectpicker" title="实例类型">
<option value="master">MASTER</option>
<option value="slave">SLAVE</option>
</select>
</div>
<div class="form-group">
<select id="db_type" class="form-control selectpicker">
<option value="" selected="selected">数据库类型</option>
<select id="db_type" class="form-control selectpicker" title="数据库类型">
<option value="mysql">MySQL</option>
<option value="mssql">MsSQL</option>
<option value="redis">Redis</option>
Expand Down
2 changes: 1 addition & 1 deletion sql/templates/param.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
</div>
<div class="form-group ">
<select id=instance class="form-control selectpicker" name="instance_list"
title="请选择实例:"
data-live-search="true">
<option value="is-empty" disabled="" selected="selected">请选择实例</option>
{% for ins in instances %}
<option value="{{ ins.id }}">{{ ins.instance_name }}</option>
{% endfor %}
Expand Down
28 changes: 13 additions & 15 deletions sql/templates/queryapplylist.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ <h4 class="modal-title" id="myModalLabel">申请数据库查询权限</h4>
<div class="form-group">
<select id="group_name" name="group_name"
class="selectpicker show-tick form-control bs-select-hidden"
data-name="组" data-placeholder="请选择组:" data-live-search="true" required>
<option value="is-empty" disabled="" selected="selected">请选择组:</option>
title="请选择组:"
data-live-search="true" required>
{% for group in group_list %}
<option value="{{ group.group_name }}">{{ group.group_name }}</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<select id="instance_name" name="instance_name"
class="selectpicker show-tick form-control bs-select-hidden" data-live-search="true"
data-placeholder="请选择实例:" required>
<option value="is-empty" disabled="" selected="selected">请选择实例:</option>
class="selectpicker show-tick form-control bs-select-hidden"
title="请选择实例:"
data-live-search="true" required>
// TODO 使用models中的choices 渲染
<optgroup id="optgroup-mysql" label="MySQL"></optgroup>
<optgroup id="optgroup-mssql" label="MsSQL"></optgroup>
Expand All @@ -55,35 +55,34 @@ <h4 class="modal-title" id="myModalLabel">申请数据库查询权限</h4>
</div>
<div class="form-group">
<select id="priv_type" name="db_name" data-live-search="true"
class="form-control selectpicker show-tick bs-select-hidden ">
<option value="is-empty" disabled="" selected="selected">权限级别:</option>
title="权限级别:"
class="form-control selectpicker show-tick bs-select-hidden">
</select>
</div>
<div id="db_name_div" class="form-group">
<select id="db_name" name="db_name" data-live-search="true"
title="请选择数据库:"
class="form-control selectpicker show-tick bs-select-hidden ">
<option value="is-empty" disabled="" selected="selected">请选择数据库:</option>
</select>
</div>
<div id="db_name_multiple_div" class="form-group" style="display: none">
<select id="db_name_multiple" name="db_name" data-live-search="true" multiple="multiple"
title="请选择数据库:" required
class="form-control selectpicker show-tick bs-select-hidden ">
<option value="is-empty" disabled="" selected="selected">请选择数据库:</option>
</select>
</div>

<div id="table_div" class="form-group">
<select id="table_name" name="table_name"
class="form-control selectpicker show-tick bs-select-hidden" data-live-search="true"
multiple='multiple' data-max-options="999" data-name="请选择表" data-placeholder="请选择表:"
required>
<option value="is-empty" disabled="" selected="selected">请选择表:</option>
multiple='multiple' data-max-options="999"
title="请选择表:" required>
</select>
</div>
<div class="form-group">
<select id="valid_date" name="valid_date"
title="请选择授权时间:"
class="form-control selectpicker show-tick bs-select-hidden ">
<option value="is-empty" disabled="" selected="selected">请选择授权时间:</option>
<option value="day">一天</option>
<option value="week">一周</option>
<option value="month">一月</option>
Expand All @@ -92,8 +91,8 @@ <h4 class="modal-title" id="myModalLabel">申请数据库查询权限</h4>
</div>
<div class="form-group">
<select id="limit_num" name="limit_num"
title="请选择查询限制行数:"
class="form-control selectpicker show-tick bs-select-hidden ">
<option value="is-empty" disabled="" selected="selected">请选择查询限制行数:</option>
<option value=100>100</option>
<option value=500>500</option>
<option value=1000>1000</option>
Expand Down Expand Up @@ -405,7 +404,6 @@ <h4 class="modal-title text-danger">工单日志</h4>
$("#db_name").append(name);
$("#db_name_multiple").append(name);
}
$('#db_name').prepend("<option value=\"is-empty\" disabled=\"\" selected=\"selected\">请选择数据库:</option>");
$('#db_name').selectpicker('render');
$('#db_name').selectpicker('refresh');
$('#db_name_multiple').selectpicker('render');
Expand Down
2 changes: 0 additions & 2 deletions sql/templates/schemasync.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ <h5 class="control-label text-bold" style="color: red">
$("#db_name").append(name);
}
$("#db_name").prepend("<option value=\"all\">全部</option>");
$("#db_name").prepend("<option value=\"is-empty\" disabled=\"\" selected=\"selected\">请选择源数据库:</option>");
$('#db_name').selectpicker('render');
$('#db_name').selectpicker('refresh');
} else {
Expand Down Expand Up @@ -145,7 +144,6 @@ <h5 class="control-label text-bold" style="color: red">
$("#target_db_name").append(name);
}
$("#target_db_name").prepend("<option value=\"all\">全部</option>");
$("#target_db_name").prepend("<option value=\"is-empty\" disabled=\"\" selected=\"selected\">请选择目标数据库:</option>");
$('#target_db_name').selectpicker('render');
$('#target_db_name').selectpicker('refresh');
} else {
Expand Down
7 changes: 4 additions & 3 deletions sql/templates/slowquery.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@
<div class="form-inline pull-right">
<div class="form-group">
<select id=instance_name class="form-control selectpicker" name="instances"
title="请选择实例:"
data-live-search="true">
<option value="is-empty" disabled="" selected="selected">请选择实例</option>
{% for instance_name in instances %}
<option value="{{ instance_name }}">{{ instance_name }}</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<select id=db_name class="form-control selectpicker" name="db_name_list" data-live-search="true">
<option value="is-empty" disabled="" selected="selected">请选择数据库</option>
<select id=db_name class="form-control selectpicker" name="db_name_list"
title="请选择数据库:"
data-live-search="true">
</select>
</div>
<div class="form-group daterange" style="display: inline-block">
Expand Down
Loading

0 comments on commit 9da79d3

Please sign in to comment.