#445 Transilerate in admin panel
This commit is contained in:
parent
8e08e6d1b0
commit
f7e17b8a6d
@ -329,6 +329,8 @@
|
||||
|
||||
<p><a role="button" onclick="rebuildRebuildWordCounts(@Model.PageInformation.PoetOrCat.Poet.Id)" class="actionlink" title="شمارش واژگان">شمارش واژگان</a></p>
|
||||
|
||||
<p><a role="button" onclick="transilerate()" class="actionlink" title="برگردان تاجیکی">برگردان تاجیکی</a></p>
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
@ -356,6 +356,27 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return new OkObjectResult(false);
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostTransilerateAsync()
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient())
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/transilerate", null);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
return BadRequest(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
|
||||
}
|
||||
return new OkObjectResult(true);
|
||||
}
|
||||
}
|
||||
return new OkObjectResult(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public async Task<IActionResult> OnPostCleanCacheAsync(int id)
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient())
|
||||
|
||||
@ -199,6 +199,27 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function transilerate() {
|
||||
if (!confirm('آیا از شروع برگردان تاجیکی اطمینان دارید؟'))
|
||||
return;
|
||||
|
||||
var url = '?handler=Transilerate';
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
error: function () {
|
||||
alert('خطا رخ داد.')
|
||||
},
|
||||
success: function () {
|
||||
alert('فرایند شروع شد.')
|
||||
},
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function rebuildRebuildWordCounts(poetId) {
|
||||
if (!confirm('آیا از شمارش واژگان برای شاعر جاری با کد '+poetId.toString() + ' اطمینان دارید؟'))
|
||||
return;
|
||||
|
||||
@ -4078,6 +4078,18 @@
|
||||
<member name="M:RMuseum.Migrations.TajikVerse.BuildTargetModel(Microsoft.EntityFrameworkCore.ModelBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="T:RMuseum.Migrations.NewTajikFields">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:RMuseum.Migrations.NewTajikFields.Up(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:RMuseum.Migrations.NewTajikFields.Down(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:RMuseum.Migrations.NewTajikFields.BuildTargetModel(Microsoft.EntityFrameworkCore.ModelBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="T:RMuseum.Models.Accounting.DonationExpenditure">
|
||||
<summary>
|
||||
donation expenditures
|
||||
|
||||
Loading…
Reference in New Issue
Block a user