Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
TokenVaultManagement
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jasonwai
TokenVaultManagement
Commits
0754f3d0
Commit
0754f3d0
authored
Jun 17, 2023
by
DESKTOP-KIP9E0Q\jason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. fix add mask bug
2. delete key modal ui problem
parent
af852a90
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
252 additions
and
56 deletions
+252
-56
TokenVaultController .cs
...Management/backstage/Controllers/TokenVaultController .cs
+47
-20
CreateTokenVault.zh.resx
...stage/Resources/Views/TokenVault/CreateTokenVault.zh.resx
+159
-0
List.zh.resx
...agement/backstage/Resources/Views/TokenVault/List.zh.resx
+2
-2
ListKeys.cshtml
...oken Vault Management/backstage/Views/Key/ListKeys.cshtml
+9
-5
CreateTokenVault.cshtml
...gement/backstage/Views/TokenVault/CreateTokenVault.cshtml
+13
-11
List.cshtml
...n Vault Management/backstage/Views/TokenVault/List.cshtml
+14
-16
ListFields.cshtml
...t Management/backstage/Views/TokenVault/ListFields.cshtml
+8
-2
No files found.
Merchant Token Vault Management/backstage/Controllers/TokenVaultController .cs
View file @
0754f3d0
...
...
@@ -53,13 +53,14 @@ namespace backstage.Controllers
}
[
Authorize
(
Policy
=
"AdminOnly"
)]
[
HttpGet
]
public
async
Task
<
IActionResult
>
List
(
int
merchantId
)
{
var
TokenVaultResponse
=
new
TokenVaultResponse
();
string
msg
=
string
.
Empty
;
ViewBag
.
Merchant_id
=
merchantId
;
logger
.
Info
(
"merchantId="
+
merchantId
);
#
region
取得部門列表
var
DepartmentsResponse
=
new
DepartmentsResponse
();
...
...
@@ -98,7 +99,7 @@ namespace backstage.Controllers
}
[
Authorize
(
Policy
=
"AdminOnly"
)]
[
HttpGet
]
public
async
Task
<
IActionResult
>
ListFields
([
FromQuery
]
int
Merchant_id
,
int
vault_id
)
{
...
...
@@ -168,7 +169,7 @@ namespace backstage.Controllers
}
return
View
();
}
[
Authorize
(
Policy
=
"AdminOnly"
)]
[
HttpGet
]
public
async
Task
<
IActionResult
>
ListUsers
(
int
Merchant_id
,
int
vault_id
,
int
field_id
)
{
...
...
@@ -1043,7 +1044,7 @@ namespace backstage.Controllers
var
result
=
new
ResultModel
();
string
msg
;
//判斷非null就是編輯 反之新增
var
mask_id
=
(
form
.
ContainsKey
(
"mask_id"
)
&&
Convert
.
ToInt32
(
form
[
"mask_id"
])
!=
0
)
?
Convert
.
ToInt32
(
form
[
"mask_id"
])
:
(
int
?)
null
;
var
mask_id
=
form
.
ContainsKey
(
"mask_id"
)
&&
int
.
TryParse
(
form
[
"mask_id"
],
out
int
id
)
?
id
:
(
int
?)
null
;
try
{
...
...
@@ -1098,7 +1099,7 @@ namespace backstage.Controllers
setting
=
System
.
Text
.
Json
.
JsonSerializer
.
Serialize
(
setting
),
//編輯功能 mask_id要帶上
id
=
(
form
.
ContainsKey
(
"mask_id"
)
&&
Convert
.
ToInt32
(
form
[
"mask_id"
])
!=
0
)
?
Convert
.
ToInt32
(
form
[
"mask_id"
])
:
(
int
?)
null
id
=
mask_id
}
};
...
...
@@ -1122,22 +1123,45 @@ namespace backstage.Controllers
{
if
(
Response
.
failInfo
==
null
)
{
switch
(
_currentLanguage
)
if
(
mask_id
==
null
)
{
switch
(
_currentLanguage
)
{
case
"en"
:
msg
=
"Create mask success."
;
break
;
case
"zh"
:
msg
=
"新增遮罩成功"
;
break
;
default
:
msg
=
"新增遮罩成功"
;
break
;
}
result
.
IsSuccess
=
true
;
result
.
Message
=
msg
;
}
else
{
switch
(
_currentLanguage
)
{
case
"en"
:
msg
=
"Creat
e mask success."
;
break
;
case
"zh"
:
msg
=
"新增
遮罩成功"
;
break
;
default
:
msg
=
"新增
遮罩成功"
;
break
;
case
"en"
:
msg
=
"Revis
e mask success."
;
break
;
case
"zh"
:
msg
=
"編輯
遮罩成功"
;
break
;
default
:
msg
=
"編輯
遮罩成功"
;
break
;
}
result
.
IsSuccess
=
true
;
result
.
Message
=
msg
;
}
result
.
IsSuccess
=
true
;
result
.
Message
=
msg
;
return
result
;
}
...
...
@@ -1157,6 +1181,11 @@ namespace backstage.Controllers
}
else
{
result
.
IsSuccess
=
false
;
result
.
Message
=
apiResult
.
Message
;
return
result
;
}
}
catch
(
Exception
e
)
...
...
@@ -1168,9 +1197,7 @@ namespace backstage.Controllers
}
result
.
IsSuccess
=
false
;
result
.
Message
=
"Create fail."
;
return
result
;
//return View();
}
...
...
Merchant Token Vault Management/backstage/Resources/Views/TokenVault/CreateTokenVault.zh.resx
0 → 100644
View file @
0754f3d0
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema
id=
"root"
xmlns=
""
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:msdata=
"urn:schemas-microsoft-com:xml-msdata"
>
<xsd:import
namespace=
"http://www.w3.org/XML/1998/namespace"
/>
<xsd:element
name=
"root"
msdata:IsDataSet=
"true"
>
<xsd:complexType>
<xsd:choice
maxOccurs=
"unbounded"
>
<xsd:element
name=
"metadata"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"value"
type=
"xsd:string"
minOccurs=
"0"
/>
</xsd:sequence>
<xsd:attribute
name=
"name"
use=
"required"
type=
"xsd:string"
/>
<xsd:attribute
name=
"type"
type=
"xsd:string"
/>
<xsd:attribute
name=
"mimetype"
type=
"xsd:string"
/>
<xsd:attribute
ref=
"xml:space"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"assembly"
>
<xsd:complexType>
<xsd:attribute
name=
"alias"
type=
"xsd:string"
/>
<xsd:attribute
name=
"name"
type=
"xsd:string"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"data"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"value"
type=
"xsd:string"
minOccurs=
"0"
msdata:Ordinal=
"1"
/>
<xsd:element
name=
"comment"
type=
"xsd:string"
minOccurs=
"0"
msdata:Ordinal=
"2"
/>
</xsd:sequence>
<xsd:attribute
name=
"name"
type=
"xsd:string"
use=
"required"
msdata:Ordinal=
"1"
/>
<xsd:attribute
name=
"type"
type=
"xsd:string"
msdata:Ordinal=
"3"
/>
<xsd:attribute
name=
"mimetype"
type=
"xsd:string"
msdata:Ordinal=
"4"
/>
<xsd:attribute
ref=
"xml:space"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"resheader"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"value"
type=
"xsd:string"
minOccurs=
"0"
msdata:Ordinal=
"1"
/>
</xsd:sequence>
<xsd:attribute
name=
"name"
type=
"xsd:string"
use=
"required"
/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader
name=
"resmimetype"
>
<value>
text/microsoft-resx
</value>
</resheader>
<resheader
name=
"version"
>
<value>
2.0
</value>
</resheader>
<resheader
name=
"reader"
>
<value>
System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</value>
</resheader>
<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"
>
<value>
新增代碼庫
</value>
</data>
<data
name=
"Choose department"
xml:space=
"preserve"
>
<value>
選擇部門
</value>
</data>
<data
name=
"Creation Date"
xml:space=
"preserve"
>
<value>
建立日期
</value>
</data>
<data
name=
"Data Token Vault"
xml:space=
"preserve"
>
<value>
資料代碼保險庫
</value>
</data>
<data
name=
"Description"
xml:space=
"preserve"
>
<value>
描述
</value>
</data>
<data
name=
"Manage"
xml:space=
"preserve"
>
<value>
管理
</value>
</data>
<data
name=
"Name"
xml:space=
"preserve"
>
<value>
名稱
</value>
</data>
<data
name=
"Number of codes"
xml:space=
"preserve"
>
<value>
代碼數量
</value>
</data>
<data
name=
"Number of users"
xml:space=
"preserve"
>
<value>
使用者數量
</value>
</data>
<data
name=
"Serial number"
xml:space=
"preserve"
>
<value>
編號
</value>
</data>
<data
name=
"Status"
xml:space=
"preserve"
>
<value>
狀態
</value>
</data>
<data
name=
"Token Vault List"
xml:space=
"preserve"
>
<value>
代碼化保險庫列管理
</value>
</data>
<data
name=
"Tpye"
xml:space=
"preserve"
>
<value>
種類
</value>
</data>
</root>
\ No newline at end of file
Merchant Token Vault Management/backstage/Resources/Views/TokenVault/List.zh.resx
View file @
0754f3d0
...
...
@@ -120,8 +120,8 @@
<data
name=
"Choose department"
xml:space=
"preserve"
>
<value>
選擇部門
</value>
</data>
<data
name=
"Create
Departmen
t"
xml:space=
"preserve"
>
<value>
新增
部門
</value>
<data
name=
"Create
Token Vaul
t"
xml:space=
"preserve"
>
<value>
新增
代碼庫
</value>
</data>
<data
name=
"Creation Date"
xml:space=
"preserve"
>
<value>
建立日期
</value>
...
...
Merchant Token Vault Management/backstage/Views/Key/ListKeys.cshtml
View file @
0754f3d0
...
...
@@ -13,7 +13,9 @@
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<style>
</style>
}
<div class="page-header">
...
...
@@ -100,7 +102,7 @@
</div>
</div>
<div class="modal fade " id="deleteProject" role="dialog" tabindex="-1" aria-modal="true" >
<div class="modal-dialog modal-
sm
modalforMemberGo">
<div class="modal-dialog modal-
md
modalforMemberGo">
<!-- Modal content-->
<div class="modal-content">
...
...
@@ -118,10 +120,12 @@
@Localizer["Confirm"]?
</p>
<div class="SubmitBlock SubmitBlock_sm">
<button id="confirmBtn" class="btn btn-mainblue-solid" style="margin-right: 10px; width: 80px">@Localizer["Submit"]</button>
<button type="button" class="btn btn-mainblue-hollow" data-dismiss="modal" style="margin-right: 10px; width: 80px">@Localizer["Cancel"]</button>
<div class="SubmitBlock SubmitBlock_sm button-container">
<button id="confirmBtn" class="btn btn-mainblue-solid same-size-button">@Localizer["Submit"]</button>
<button type="button" class="btn btn-mainblue-hollow same-size-button" data-dismiss="modal">@Localizer["Cancel"]</button>
</div>
</form>
</div> <!--END of div "modal-body"-->
...
...
Merchant Token Vault Management/backstage/Views/TokenVault/CreateTokenVault.cshtml
View file @
0754f3d0
@model backstage.Models.TokenVault.TokenVaultForCreate
@using Microsoft.AspNetCore.Mvc.Localization
@inject IViewLocalizer Localizer
@model backstage.Models.TokenVault.TokenVaultForCreate
@{
ViewData["Title"] =
"新增TokenVault"
;
ViewData["Title"] =
@Localizer["Add Token Vault"]
;
}
<!-- partial -->
<div class="page-header">
<h3 class="page-title">
新增TokenVault
</h3>
<h3 class="page-title">
@Localizer["Add Token Vault"]
</h3>
<input id="msg" hidden value="@TempData["msg"]" />
@if (TempData["isSuccess"] != null)
{
<input id="isSuccess" hidden value="@TempData["isSuccess"].ToString()" />
}
<div class="floating-msg" id="msgDiv"></div>
<div class="floating-msg" id="msgDiv"></div>
</div>
<div class="row">
<div class="col-12 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<h4 class="card-title">
新增TokenVault
</h4>
<h4 class="card-title">
@Localizer["Add Token Vault"]
</h4>
<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>
<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>
</select>
</div>
</div>
<div class="row">
...
...
@@ -44,11 +46,11 @@
<div class="col-md-4 form-group required">
<label asp-for="description" class="col-form-label" for=""></label>
<input asp-for="description" type="text" class="form-control" id="">
<input asp-for="description" type="text" class="form-control" id="">
<span asp-validation-for="description" class="text-danger"></span>
</div>
</div>
...
...
Merchant Token Vault Management/backstage/Views/TokenVault/List.cshtml
View file @
0754f3d0
...
...
@@ -14,7 +14,7 @@
<input id="msg" hidden value="@TempData["msg"]" />
@if (TempData["isSuccess"] != null)
{
<input id="isSuccess" hidden value="@TempData["isSuccess"].ToString()" />
<input id="isSuccess" hidden value="@TempData["isSuccess"].ToString()" />
}
<div class="floating-msg" id="msgDiv"></div>
</div>
...
...
@@ -43,7 +43,7 @@
</select>
</div>
<div class="col-md-auto">
<a type="button" class="btn btn-info float-right mb-2 @disabledClass" asp-action="CreateTokenVault"> @Localizer["Create
Departmen
t"]</a>
<a type="button" class="btn btn-info float-right mb-2 @disabledClass" asp-action="CreateTokenVault"> @Localizer["Create
Token Vaul
t"]</a>
</div>
</div>
<div class="row">
...
...
@@ -117,26 +117,21 @@
// 在頁面載入時檢查 localStorage 是否有選單值
var selectedOption = localStorage.getItem('selectedOption');
console.log('selectedOption=' + selectedOption);
if (selectedOption) {
// 觸發 AJAX 請求並填入資料
loadData(selectedOption);
$('#selectDepartmentList').val(selectedOption);
}
// 在選單變更時保存選擇的值至 localStorage
$('#selectDepartmentList').change(function () {
var selectedOption = $(this).val();
localStorage.setItem('selectedOption', selectedOption);
});
var selectedValue = $('#selectDepartmentList').val();
console.log('selectedValue=' + selectedValue);
if (selectedValue != 0) {
selectedOption = $('#selectDepartmentList').val();
console.log('selectedOption=' + selectedOption);
if (selectedOption != 0) {
// 使用 AJAX 傳遞選擇的值
$.ajax({
url: '/TokenVault/ListTokenVaultAjax', // 替換為適當的控制器方法路徑
type: 'POST', // 或 'GET',根據實際需求
data: { merchantId: selected
Value
},
data: { merchantId: selected
Option
},
success: function (response) {
$('#tbody').empty();
$('#tbody').append(response);
...
...
@@ -151,23 +146,26 @@
}
// 當選擇下拉選單時觸發事件
$('#selectDepartmentList').change(function () {
var selectedValue = $(this).val(); // 獲取選擇的值
loadData(selectedValue);
var selectedOption = parseInt($(this).val()); // 獲取選擇的值
localStorage.setItem('selectedOption', selectedOption);
loadData(selectedOption);
console.log('localStorage.setItem=' + selectedOption)
});
// 定義 AJAX 請求函式,將選單值傳遞至後端並填入 tbody
function loadData(selectedOption) {
console.log('loadData,selectedOption=' + selectedOption);
// 使用 AJAX 傳遞選擇的值
$.ajax({
url: '/TokenVault/ListTokenVaultAjax', // 替換為適當的控制器方法路徑
type: 'POST', // 或 'GET',根據實際需求
data:
JSON.stringify({ merchantId: selectedOption })
,
data:
{ merchantId: selectedOption }
,
success: function (response) {
$('#tbody').empty();
$('#tbody').append(response);
// 在成功取得回應後的處理邏輯
//
console.log(response);
console.log(response);
},
error: function (xhr, status, error) {
// 在發生錯誤時的處理邏輯
...
...
Merchant Token Vault Management/backstage/Views/TokenVault/ListFields.cshtml
View file @
0754f3d0
...
...
@@ -36,6 +36,11 @@
}
}
</script>
<style>
.label-space {
margin-right: 30px; /* 根据需要调整间距大小 */
}
</style>
}}
<div class="page-header">
<h3 class="page-title">@Localizer["Field List Management"]</h3>
...
...
@@ -61,7 +66,7 @@
@Localizer["Token Vault List"]
</a>
</li>
<li class="breadcrumb-item ">@Localizer["Field List Management"]</li>
</ul>
</div>
...
...
@@ -167,8 +172,9 @@
<input name="format_exp" type="text" class="form-control">
</div>
<div class="form-group required">
<label class="
control-label
">@Localizer["Enable"]</label>
<label class="
form-check-label label-space
">@Localizer["Enable"]</label>
<input name="enabled" type="checkbox" class="form-check-input" checked>
</div>
</div>
<div class="modal-footer">
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment