Commit f929280d authored by Jason's avatar Jason

編輯鑰匙

parent 97e7473f
......@@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Active" xml:space="preserve">
<value>啟用</value>
</data>
<data name="Add User" xml:space="preserve">
<value>新增使用者</value>
</data>
......@@ -183,6 +186,12 @@
<data name="Format" xml:space="preserve">
<value>格式</value>
</data>
<data name="ID" xml:space="preserve">
<value>編號</value>
</data>
<data name="Inactive" xml:space="preserve">
<value>未啟用</value>
</data>
<data name="Keys List" xml:space="preserve">
<value>鑰匙列表</value>
</data>
......
......@@ -117,9 +117,15 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AddToken Vault" xml:space="preserve">
<data name="Add Token Vault" xml:space="preserve">
<value>新增代碼庫</value>
</data>
<data name="Back to List" xml:space="preserve">
<value>返回列表</value>
</data>
<data name="Basic" xml:space="preserve">
<value>基本資料</value>
</data>
<data name="Choose department" xml:space="preserve">
<value>選擇部門</value>
</data>
......@@ -144,6 +150,9 @@
<data name="Number of users" xml:space="preserve">
<value>使用者數量</value>
</data>
<data name="Send out" xml:space="preserve">
<value>送出</value>
</data>
<data name="Serial number" xml:space="preserve">
<value>編號</value>
</data>
......
......@@ -132,6 +132,9 @@
<data name="Description" xml:space="preserve">
<value>描述</value>
</data>
<data name="ID" xml:space="preserve">
<value>編號</value>
</data>
<data name="Manage" xml:space="preserve">
<value>管理</value>
</data>
......
......@@ -175,7 +175,6 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\Controllers\" />
<Folder Include="wwwroot\lib\fonts\bootstrap\" />
</ItemGroup>
......
......@@ -57,7 +57,7 @@
<table class="table table-striped TBL_keysList">
<thead>
<tr>
<th style=" border-left: solid 0.1px #d9d9d9;">@Localizer["Serial number"]</th>
<th style=" border-left: solid 0.1px #d9d9d9;">@Localizer["ID"]</th>
<th>@Localizer["Name"]</th>
<th>@Localizer["Encryption"]</th>
<th>@Localizer["Last Update"]</th>
......@@ -86,7 +86,7 @@
<a data-toggle="modal" data-target="#editProject" title="Modify">
<a class="reviseKeyBtn" data-keyId="@k.id" data-toggle="modal" data-target="#editProject" title="Revise">
<a class="reviseKeyBtn" data-keyid="@k.id" data-keyname="@k.name" data-active="@k.active" data-toggle="modal" data-target="#editProject" title="Revise">
<i class="fa-solid fa-pen-to-square"></i>
</a>
......@@ -190,8 +190,8 @@
</div> -->
<!--</div>--> <!-- End of iOS Adv-->
<div class="SubmitBlock">
<button id="CreateKey" type="button" class="btn btn-mainblue-solid btnSubmit">新增</button>
<button type="button" class="btn btn-mainblue-hollow btnReset" data-dismiss="modal">取消</button>
<button id="CreateKey" type="button" class="btn btn-mainblue-solid btnSubmit">@Localizer["Send out"]</button>
<button type="button" class="btn btn-mainblue-hollow btnReset" data-dismiss="modal">@Localizer["Cancel"]</button>
</div>
</form>
</div> <!--END of div "modal-body"-->
......@@ -223,62 +223,35 @@
<div class="modal-body" style="padding-top:35px">
<form class="form-horizontal0">
<div class="form-group">
<label class="control-label" for="projectid">@Localizer["Name"]:</label>
<div>
<input type="text" class="form-control input-sm" id="key_name">
<input type="text" class="form-control input-sm" id="edit_key_id" disabled>
</div>
</div>
<div class="form-group">
<label class="control-label" for="projectid">@Localizer["active"]:</label>
<label class="control-label" for="projectid">@Localizer["Name"]:</label>
<div>
<input type="text" class="form-control input-sm" id="key_name">
<input type="text" class="form-control input-sm" id="edit_key_name">
</div>
</div>
<!--<div class="form-group">
<label class="control-label" for="projectType">類型:</label>
<div>
<select id="projectType" class="form-control" onchange="showAppAdv()">
<option value=0>請選擇類型</option>
<option value=1>Android</option>
<option value=2>iOS</option>
</select>
<div class="form-group">
<label class="control-label" for=""></label>
<div class="form-check form-check-inline">
<label class="form-check-label" for="uniqueY">
@Localizer["啟用"]
</label>
<input class="form-check-input" type="checkbox" name="active" value="1">
</div>
</div>-->
<!--End of 類型:-->
<!-- Andorid Adv-->
<!--<div id="andoridAdvID" class="andoridAdv">
<div class="form-group">
<label class="control-label" for="packageName">套件名稱:</label>
<div>
<input type="text" class="form-control input-sm" id="packageName" placeholder="例如 com.example">
</div>
</div>
<div class="form-group">
<label class="control-label" for="packageName">SHA-1指紋憑證:</label>
<div>
<input type="text" class="form-control input-sm" id="fingerPrint" placeholder="例如: AA:BB:CC:DD:EE:00:11:22:33:44:FF:GG:HH:II:JJ:55:66:77:88:99">
</div>
</div>-->
<!--End of app id:-->
<!--</div>--> <!-- End of Andorid Adv-->
<!-- iOS Adv-->
<!--<div id="iOSAdvID" class="iOSAdv">
</div>
<div class="form-group">
<label class="control-label" for="bundleID">繫結識別碼:</label>
<div>
<input type="text" class="form-control input-sm" id="bundleID" placeholder="例如 com.example.MyApp">
</div>
</div>-->
<!--End of app id:-->
<!-- <div class="description col-sm-12 text-center">
當您新增一個App後,系統會自動產生一組API金鑰,可至App列表中檢視
</div> -->
<!--</div>--> <!-- End of iOS Adv-->
<div class="SubmitBlock">
<button id="CreateKey" type="button" class="btn btn-mainblue-solid btnSubmit">新增</button>
<button type="button" class="btn btn-mainblue-hollow btnReset" data-dismiss="modal">取消</button>
<button id="edit_key_submit" type="button" class="btn btn-mainblue-solid btnSubmit">@Localizer["Send out"]</button>
<button type="button" class="btn btn-mainblue-hollow btnReset" data-dismiss="modal">@Localizer["Cancel"]</button>
</div>
</form>
</div> <!--END of div "modal-body"-->
......@@ -292,6 +265,44 @@
</div><!-- END of Modal-->
<!--END of New App Popup Form-->
<div class="modal fade " id="deleteProject" role="dialog" tabindex="-1" aria-modal="true">
<div class="modal-dialog modal-sm modalforMemberGo">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4>
刪除專案
</h4>
</div> <!--END of div "modal-header"-->
<div class="modal-body" style="padding-top:35px; padding-bottom: 35px">
<form>
<p>
是否確定要刪除專案?
</p>
<div class="SubmitBlock SubmitBlock_sm">
<button id="confirmBtn" type="submit" class="btn btn-mainblue-solid" style="margin-right: 10px; width: 80px">@Localizer["Confirm"]</button>
<button type="button" class="btn btn-mainblue-hollow" data-dismiss="modal" style="margin-right: 10px; width: 80px">@Localizer["Cancel"]</button>
</div>
</form>
</div> <!--END of div "modal-body"-->
<div class="modal-footer">
<!--
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
-->
</div> <!--END of div "modal-footer"-->
</div><!-- END of Modal content-->
</div><!-- END of div "modal-dialog modal-lg" -->
</div>
@section Scripts{
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script nonce="KUY8VewuvyUYVEIvEFue4vwyiuf">
......@@ -318,9 +329,9 @@
console.log('selectKeyId=' + selectKeyId);
});
//刪除鑰匙
$("#confirmBtn").on("click", function (e) {
// 確認按鈕被點擊時的處理程式碼
e.preventDefault(); // 防止點擊後刷新頁面(如果該鏈接是 <a> 標籤)
var data = {
keyId: selectKeyId
......@@ -375,6 +386,50 @@
});
//打開編輯鑰匙modal
$(".reviseKeyBtn").on("click", function (e) {
$('#edit_key_id').val($(this).data('keyid'));
$('#edit_key_name').val($(this).data('keyname'));
var active = $(this).data('active');
console.log('active=' + active);
$('input[name="active"][value="' + active + '"]').prop('checked', true);
$('#editApp').modal();
});
//送出編輯鑰匙
$("#edit_key_submit").on("click", function (e) {
$.ajax({
url: "/Key/EditKey",
type: 'POST', // 或 'GET',根據實際需求
data: {
keyId: $('#edit_key_id').val(),
name: $('#edit_key_name').val(),
active:$('#editApp input[name="active"]:checked').val()
},
success: function (response) {
// API 呼叫成功的處理程式碼
showAlert(response.isSuccess, response.message)
if (response.isSuccess) {
$('#editApp').modal('hide');
setTimeout(function () {
location.reload();
}, 2000);
}
},
error: function (xhr, status, error) {
// API 呼叫失敗的處理程式碼
showAlert(false, error.responseText)
}
});
});
......
......@@ -25,12 +25,12 @@
<form class="forms-sample" method="post" asp-action="CreateTokenVault" autocomplete="off">
<div id="errorMsg" asp-validation-summary="All" class="text-danger"></div>
<p class="form-title card-description">Basic</p>
<p class="form-title card-description">@Localizer["Basic"]</p>
<div class="row">
<div class="col-md-6 form-group required">
<select id="selectDepartmentList" class="form-control" asp-for="merchant_id" asp-items="ViewBag.DepartmentsList">
<option value="">Choose department</option>
<option value="">@Localizer["Choose department"]</option>
</select>
</div>
......@@ -39,13 +39,13 @@
</div>
<div class="row">
<div class="col-md-4 form-group required">
<label asp-for="name" class="col-form-label" for=""></label>
<label asp-for="name" class="col-form-label" for="">@Localizer["Name"]</label>
<input asp-for="name" type="text" class="form-control" id="">
<span asp-validation-for="name" class="text-danger"></span>
</div>
<div class="col-md-4 form-group required">
<label asp-for="description" class="col-form-label" for=""></label>
<label asp-for="description" class="col-form-label" for="">@Localizer["Description"]</label>
<input asp-for="description" type="text" class="form-control" id="">
<span asp-validation-for="description" class="text-danger"></span>
</div>
......@@ -55,8 +55,8 @@
<button type="submit" class="btn btn-primary mr-2">Submit</button>
<a type="button" class="btn btn-light" asp-action="List">Back to List</a>
<button type="submit" class="btn btn-primary mr-2">@Localizer["Send out"]</button>
<a type="button" class="btn btn-light" asp-action="List">@Localizer["Back to List"]</a>
</form>
</div>
</div>
......
......@@ -58,7 +58,7 @@
<table class="table table-striped ">
<thead>
<tr class="">
<th>@Localizer["Serial number"]</th>
<th>@Localizer["ID"]</th>
<th> @Localizer["Name"]</th>
<th> @Localizer["Description"]</th>
<th> @Localizer["Tpye"]</th>
......
@using Microsoft.AspNetCore.Mvc.Localization
@inject IViewLocalizer Localizer
@model List<backstage.Models.TokenVault.Permission>
@{
ViewData["Title"] = @Localizer["Permission Management"];
......
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