fix(install): 修正 MySQL 安装页面默认选项的操作系统判断
- 根据运行环境自动判断是否为 Linux 操作系统 - 设置 MySQL 类型选择框默认选中对应操作系统选项 - 优化安装页面用户体验,避免手动选择错误的数据库类型 - 更新视图逻辑实现动态默认选项的渲染
This commit is contained in:
@@ -37,10 +37,20 @@
|
|||||||
</div>
|
</div>
|
||||||
@if (ViewBag.sqltype == "mysql")
|
@if (ViewBag.sqltype == "mysql")
|
||||||
{
|
{
|
||||||
|
var isLinux = System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Linux);
|
||||||
|
var defaultMysqlType = isLinux ? "linux" : "windows";
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<select class="form-control" name="mysqltype" id="mysqltype">
|
<select class="form-control" name="mysqltype" id="mysqltype">
|
||||||
<option value="windows">Windows 下 Mysql(数据库表不区分大小写)</option>
|
@if (defaultMysqlType == "windows")
|
||||||
<option value="linux">Linux 下 Mysql(数据库表区分大小写)</option>
|
{
|
||||||
|
<option value="windows" selected>Windows 下 Mysql(数据库表不区分大小写)</option>
|
||||||
|
<option value="linux">Linux 下 Mysql(数据库表区分大小写)</option>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<option value="windows">Windows 下 Mysql(数据库表不区分大小写)</option>
|
||||||
|
<option value="linux" selected>Linux 下 Mysql(数据库表区分大小写)</option>
|
||||||
|
}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user