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
0b3bfced
Commit
0b3bfced
authored
Jun 12, 2023
by
Jason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加mask tooltip
parent
42459e72
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
101 additions
and
44 deletions
+101
-44
TokenVaultController .cs
...Management/backstage/Controllers/TokenVaultController .cs
+43
-7
UserController.cs
... Vault Management/backstage/Controllers/UserController.cs
+1
-6
User.cs
...ant Token Vault Management/backstage/Models/Users/User.cs
+1
-0
ListUsers.cshtml
...lt Management/backstage/Views/TokenVault/ListUsers.cshtml
+46
-31
style.css
...nt Token Vault Management/backstage/wwwroot/css/style.css
+10
-0
No files found.
Merchant Token Vault Management/backstage/Controllers/TokenVaultController .cs
View file @
0b3bfced
...
...
@@ -52,13 +52,6 @@ namespace backstage.Controllers
{
var
TokenVaultResponse
=
new
TokenVaultResponse
();
// 確認使用者是否已經登入
if
(!
User
.
Identity
.
IsAuthenticated
)
{
return
RedirectToAction
(
"Login"
,
"User"
);
}
ViewBag
.
Merchant_id
=
merchantId
;
#
region
取得部門列表
...
...
@@ -183,6 +176,7 @@ namespace backstage.Controllers
ViewBag
.
field_id
=
field_id
;
var
DepartmentsResponse
=
new
DepartmentsResponse
();
var
url
=
_config
[
"IP"
]
+
"/v2/vault/get"
;
var
httpMethod
=
HttpMethod
.
Post
;
// 取得使用者的 "token" Claim 值
...
...
@@ -246,6 +240,48 @@ namespace backstage.Controllers
}
#
endregion
#
region
處理遮罩
tooltip
url
=
_config
[
"IP"
]
+
"/v2/vault/get"
;
httpMethod
=
HttpMethod
.
Post
;
parameters
=
new
Dictionary
<
string
,
string
>
{
{
"Merchant_id"
,
Merchant_id
.
ToString
()
},
{
"id"
,
vault_id
.
ToString
()
},
{
"info"
,
"MASKS"
}
};
apiResult
=
await
_callApi
.
CallAPI
(
url
,
parameters
,
httpMethod
);
if
(
apiResult
.
IsSuccess
)
{
FieldsResponse
=
JsonConvert
.
DeserializeObject
<
FieldsResponse
>(
apiResult
.
Data
.
ToString
());
foreach
(
var
u
in
field
.
users
)
{
if
(
u
.
masks
.
Count
>
0
)
{
var
maskTextList
=
new
List
<
string
>();
var
existField
=
FieldsResponse
.
fields
.
FirstOrDefault
(
f
=>
f
.
id
==
field_id
);
foreach
(
var
maskId
in
u
.
masks
)
{
var
matchingMask
=
existField
.
masks
.
FirstOrDefault
(
m
=>
m
.
id
==
maskId
);
if
(
matchingMask
!=
null
)
{
string
maskText
=
$"[
{
matchingMask
.
id
}
] -
{
matchingMask
.
name
}
-
{
matchingMask
.
setting
}
"
;
maskTextList
.
Add
(
maskText
);
}
}
u
.
masksSettingText
=
string
.
Join
(
", "
,
maskTextList
);
}
}
}
#
endregion
...
...
Merchant Token Vault Management/backstage/Controllers/UserController.cs
View file @
0b3bfced
...
...
@@ -741,12 +741,7 @@ namespace backstage.Controllers
{
var
DepartmentsResponse
=
new
DepartmentsResponse
();
var
url
=
_config
[
"IP"
]
+
"/merchant/list"
;
// 確認使用者是否已經登入
if
(!
User
.
Identity
.
IsAuthenticated
)
{
return
RedirectToAction
(
"Login"
,
"User"
);
}
var
httpMethod
=
HttpMethod
.
Post
;
...
...
Merchant Token Vault Management/backstage/Models/Users/User.cs
View file @
0b3bfced
...
...
@@ -38,6 +38,7 @@ namespace backstage.Models.Users
//=========Fields=========
public
List
<
int
>
masks
{
get
;
set
;}
public
string
masksText
{
get
;
set
;
}
public
string
masksSettingText
{
get
;
set
;
}
public
int
allow_decrypt
{
get
;
set
;
}
public
int
allow_new
{
get
;
set
;
}
public
int
allow_update
{
get
;
set
;
}
...
...
Merchant Token Vault Management/backstage/Views/TokenVault/ListUsers.cshtml
View file @
0b3bfced
...
...
@@ -7,6 +7,13 @@
string disabledClass = isAdmin ? "" : "disabled";
}
@section header{
<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>
}
<div class="page-header">
<h3 class="page-title">欄位Users列表管理</h3>
<input id="msg" hidden value="@TempData["msg"]" />
...
...
@@ -61,7 +68,9 @@
<td>@i.id</td>
<td>@i.name</td>
<td>@i.username</td>
<td>@i.masksText</td>
<td class="custom-tooltip" data-tooltip="@i.masksSettingText">@i.masksText</td>
<td>
@if (i.allow_decrypt == 1)
{<span>✔</span>}
...
...
@@ -127,7 +136,7 @@
</div>
@section Scripts{
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script nonce="KUY8VewuvyUYVEIvEFue4vwyiuf">
$('document').ready(function () {
var msg = '@TempData["msg"]';
...
...
@@ -136,7 +145,13 @@
if (msg != '') {
showAlert(IsSuccess, msg);
}
$(".custom-tooltip").tooltip({
items: "[data-tooltip]",
content: function () {
return $(this).attr("data-tooltip");
},
tooltipClass: "custom-tooltip-width"
});
$("#confirmBtn").on("click", function () {
// 確認按鈕被點擊時的處理程式碼
...
...
Merchant Token Vault Management/backstage/wwwroot/css/style.css
View file @
0b3bfced
...
...
@@ -19315,3 +19315,13 @@ tbody {
font-size
:
0.825rem
;
padding
:
20px
16px
10px
16px
}
.custom-tooltip-width
{
width
:
auto
!important
;
max-width
:
none
!important
;
white-space
:
nowrap
;
}
.custom-tooltip
{
cursor
:
pointer
!important
;
}
\ No newline at end of file
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