Files
Backend-Api/ServiceHost/Areas/AdminNew/Pages/Company/AndroidApk/Index.cshtml
2025-12-23 04:17:52 +03:30

190 lines
6.6 KiB
Plaintext

@page
@model ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk.IndexModel
@{
ViewData["Title"] = "File Upload";
<style>
.lineDiv {
width: 100%;
height: 2px;
background-image: linear-gradient(to right, #ffffff, #e5e5e5, #cbcbcb, #b2b2b2, #9a9a9a, #9a9a9a, #9a9a9a, #9a9a9a, #b2b2b2, #cbcbcb, #e5e5e5, #ffffff);
margin: 10px;
}
</style>
}
<h1>Upload APK File</h1>
<div class="card">
<div class="card-body">
<form asp-page-handler="Upload" id="1" method="post" enctype="multipart/form-data">
<div class="form-group">
<label asp-for="File" class="form-label">Choose APK file:</label>
<input asp-for="File" type="file" class="form-control" required accept=".apk">
<small class="form-text text-muted">Please select a valid APK file.</small>
<span asp-validation-for="File" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="VersionName" class="form-label">Version Name:</label>
<input asp-for="VersionName" type="text" class="form-control" placeholder="e.g. 1.0.0" required>
<small class="form-text text-muted">Enter the version name (e.g. 1.0.0, 2.1.3).</small>
<span asp-validation-for="VersionName" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="VersionCode" class="form-label">Version Code:</label>
<input asp-for="VersionCode" type="text" class="form-control" placeholder="e.g. 100" required>
<small class="form-text text-muted">Enter the version code (numeric value).</small>
<span asp-validation-for="VersionCode" class="text-danger"></span>
</div>
<div style="margin-top:12px;">
<label asp-for="SelectedApkType">نوع اپلیکیشن:</label>
<select asp-for="SelectedApkType" asp-items="Html.GetEnumSelectList<CompanyManagment.App.Contracts.AndroidApkVersion.ApkType>()"></select>
</div>
<div style="margin-top:12px;">
<label asp-for="IsForce">
<input asp-for="IsForce" type="checkbox">
آپدیت اجباری (Force Update)
</label>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Upload APK</button>
</div>
</form>
</div>
</div>
<form asp-page-handler="ShiftDate" id="8" method="post">
<button type="submit">افزودن شیفت دیت</button>
</form>
<form asp-page-handler="ShiftDateNew" id="9" method="post">
<button type="submit">ست شیفت 1 </button>
</form>
<form asp-page-handler="ShiftDateNew2" id="10" method="post">
<button type="submit">ست شیفت 2 </button>
</form>
<form style="margin:30px" asp-page-handler="PaymentGateWay" id="11" method="post">
<button type="submit">درگاه پرداخت تستی </button>
</form>
<div class="lineDiv"></div>
<div class="row m-t-20">
<div class="col-md-4 visible-md visible-lg"></div>
<div class="col-6 col-md-2">
<form asp-page-handler="UploadFrontEnd" id="12" method="post">
<button type="submit"
class="btn btn-danger"
onclick="return confirm('آیا از انتشار نسخه جدید فرانت مطمئن هستید؟');">
🚀 Deploy Next UI
</button>
</form>
</div>
<div class="col-6 col-md-2">
<button type="button" class="btn btn-outline-secondary"
data-bs-toggle="modal"
data-bs-target="#logModal">
مشاهده لاگ Deploy
</button>
</div>
<div class="col-md-4 visible-md visible-lg"></div>
</div>
<div class="lineDiv"></div>
<div class="modal fade" id="logModal" tabindex="-1">
<div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Deploy Log</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<pre id="logContent"
style="background: #111;
color: #0f0;
padding: 15px;
font-size: 13px;
text-align: left;
direction: ltr;">
</pre>
</div>
</div>
</div>
</div>
<form style="margin:20px" asp-page-handler="ContractingPartyToWorkshop" id="13" method="post">
<button class="btn btn-outline-secondary" type="submit"> افزودن آی دی طرف حساب به کارگاه </button>
</form>
@if (ViewData["message"] != null)
{
<p>@ViewData["message"]</p>
}
<script>
document.getElementById('logModal')
.addEventListener('show.bs.modal', function () {
fetch('?handler=Log')
.then(r => r.text())
.then(t => {
document.getElementById('logContent').textContent = t;
});
});
</script>
@* <script>
$(document).ready(function () {
$('#fileUploadForm').submit(function(e) {
e.preventDefault(); // Prevent the default form submission
// Create FormData object
var formData = new FormData();
var fileInput = $('#FormFile')[0]; // Use the first element of the jQuery object
// Check if a file was selected
if (fileInput.files.length === 0) {
alert("Please select a file!");
return;
}
// Append the file to the FormData object
formData.append('file', fileInput.files[0]);
$.ajax({
dataType: 'json',
type: 'POST',
processData: false, // Prevent jQuery from automatically transforming the data into a query string
contentType: false, // Tell jQuery not to set the content type
url: `@Url.Page("./index", "Upload")`,
headers: {
"RequestVerificationToken": `@Html.AntiForgeryToken()`
},
data: formData,
success: function(response) {
alert("File uploaded successfully!");
},
error: function(err) {
console.log(err);
}
});
});
});
</script> *@