Commit 3dc65fb0 authored by gdlcf88's avatar gdlcf88

Add clear all button in keys list page.

parent 772e86dd
@page
@using EasyAbp.CacheManagement.Authorization
@using Microsoft.AspNetCore.Authorization
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@inherits EasyAbp.CacheManagement.Web.Pages.CacheManagementPage
@model EasyAbp.CacheManagement.Web.Pages.CacheManagement.CacheItems.CacheItem.KeyListModel
@inject IAuthorizationService Authorization
@inject IPageLayout PageLayout
@{
PageLayout.Content.Title = L["CacheItemData"].Value;
......@@ -29,6 +32,12 @@
<abp-card-title>@L["CacheItemData"] - @Model.CacheItem.DisplayName</abp-card-title>
</abp-column>
<abp-column size-md="_6" class="text-right">
@if (await Authorization.IsGrantedAsync(CacheManagementPermissions.CacheItems.ClearCache))
{
<abp-button id="ClearAllCacheButton"
text="@L["ClearAllCache"].Value"
button-type="Danger"/>
}
</abp-column>
</abp-row>
</abp-card-header>
......
......@@ -48,4 +48,16 @@ $(function () {
{ data: "cacheKey" },
]
}));
$('#ClearAllCacheButton').click(function (e) {
e.preventDefault();
abp.message.confirm(l('ClearAllCacheConfirmationMessage'), l('ClearAllCache'))
.done(function (accepted) {
if (accepted) {
service.clear({ cacheItemId: cacheItemId}).done(function () {
abp.notify.info(l('SuccessCleared'));
})
}
});
});
});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment