feat(#I17SD0): 网站设置增加默认应用配置功能

#Issue
link https://gitee.com/LongbowEnterprise/dashboard/issues?id=I17SD0
This commit is contained in:
Argo Zhang 2020-01-03 16:05:28 +08:00
parent 4390e3e7db
commit 22809d7984
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
4 changed files with 29 additions and 1 deletions

View File

@ -22,7 +22,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// <param name="value"></param>
/// <returns></returns>
[HttpPost]
[ButtonAuthorize(Url = "~/Admin/Settings", Auth = "saveTitle,saveFooter,saveTheme,saveUISettings")]
[ButtonAuthorize(Url = "~/Admin/Settings", Auth = "saveTitle,saveFooter,saveTheme,saveUISettings,clearCache,clearAllCache,loginSettings,lockScreen,defaultApp")]
public bool Post([FromBody]BootstrapDict value) => DictHelper.SaveSettings(value);
/// <summary>

View File

@ -18,6 +18,7 @@ namespace Bootstrap.Admin.Models
{
Themes = DictHelper.RetrieveThemes();
AutoLockScreen = EnableAutoLockScreen ? "" : "lockScreen";
DefaultApp = DictHelper.RetrieveDefaultApp() ? "" : "defaultApp";
}
/// <summary>
@ -29,5 +30,10 @@ namespace Bootstrap.Admin.Models
/// 获得 是否开启自动锁屏
/// </summary>
public string AutoLockScreen { get; }
/// <summary>
/// 获得 是否开启自动锁屏
/// </summary>
public string DefaultApp { get; }
}
}

View File

@ -143,6 +143,22 @@
</div>
</div>
</div>
<div class="card" asp-auth="defaultApp">
<div class="card-header">默认应用设置</div>
<div class="card-body">
<div class="form-inline">
<div class="row">
<div class="form-group col-6">
<label class="control-label" for="defaultApp">默认应用</label>
<input id="defaultApp" hidden type="checkbox" data-default-val="@Model.DefaultApp" data-toggle="toggle" data-width="120" data-onstyle="success" data-on="开启" data-off="关闭" />
</div>
</div>
</div>
<div class="modal-footer text-right">
<button data-method="saveDefaultApp" class="btn btn-secondary" type="button"><i class="fa fa-save"></i><span>保存</span></button>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<div class="d-flex align-items-center">

View File

@ -76,6 +76,12 @@ $(function () {
}
});
break;
case 'saveDefaultApp':
var defaultApp = $('#defaultApp').prop('checked') ? "1" : "0";
$.bc({
url: Settings.url, data: { name: '默认应用程序', code: defaultApp, category: '系统设置' }, title: '保存默认应用程序设置', method: "post"
});
break;
}
});