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
5fbf8e49
Commit
5fbf8e49
authored
Jun 20, 2023
by
Jason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
編輯部門
parent
2aa70272
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
506 additions
and
86 deletions
+506
-86
TokenVaultController .cs
...Management/backstage/Controllers/TokenVaultController .cs
+2
-0
UserController.cs
... Vault Management/backstage/Controllers/UserController.cs
+221
-8
Department.cs
...ken Vault Management/backstage/Models/Users/Department.cs
+6
-6
Index.zh.resx
...t Management/backstage/Resources/Views/Home/Index.zh.resx
+3
-3
ListKeys.zh.resx
...Management/backstage/Resources/Views/Key/ListKeys.zh.resx
+6
-0
_layout.zh.resx
...nagement/backstage/Resources/Views/Shared/_layout.zh.resx
+1
-1
ListUsers.zh.resx
...nagement/backstage/Resources/Views/User/ListUsers.zh.resx
+6
-0
Index.cshtml
... Token Vault Management/backstage/Views/Home/Index.cshtml
+3
-3
_Layout.cshtml
...en Vault Management/backstage/Views/Shared/_Layout.cshtml
+1
-1
ListUsers.cshtml
...lt Management/backstage/Views/TokenVault/ListUsers.cshtml
+187
-33
GetDepartment.cshtml
...ault Management/backstage/Views/User/GetDepartment.cshtml
+18
-9
ListUsers.cshtml
...en Vault Management/backstage/Views/User/ListUsers.cshtml
+18
-8
style.css
...nt Token Vault Management/backstage/wwwroot/css/style.css
+0
-3
site.js
Merchant Token Vault Management/backstage/wwwroot/js/site.js
+34
-11
No files found.
Merchant Token Vault Management/backstage/Controllers/TokenVaultController .cs
View file @
5fbf8e49
...
...
@@ -254,6 +254,7 @@ namespace backstage.Controllers
/// <summary>
/// ajax權限增加使用者
/// /tokenvault/Permission
/// </summary>
/// <param name="merchant_id"></param>
/// <param name="vault_id"></param>
...
...
@@ -614,6 +615,7 @@ namespace backstage.Controllers
/// <summary>
/// 欄位添加使用者 ajax
/// /tokenvault/ListFields
/// </summary>
/// <param name="requestData"></param>
/// <returns></returns>
...
...
Merchant Token Vault Management/backstage/Controllers/UserController.cs
View file @
5fbf8e49
...
...
@@ -1212,6 +1212,101 @@ namespace backstage.Controllers
}
[
Authorize
(
Policy
=
"AdminOnly"
)]
[
HttpPost
]
public
async
Task
<
IActionResult
>
EditDepartment
(
Department
department
)
{
var
url
=
_config
[
"IP"
]
+
"/merchant/mod"
;
string
msg
;
if
(
string
.
IsNullOrEmpty
(
department
.
name
))
{
switch
(
_currentLanguage
)
{
case
"en"
:
msg
=
"can't be empty."
;
break
;
case
"zh"
:
msg
=
"部門名稱不能為空"
;
break
;
default
:
msg
=
"部門名稱不能為空"
;
break
;
}
ModelState
.
AddModelError
(
"name"
,
msg
);
}
if
(
string
.
IsNullOrEmpty
(
department
.
phone
))
{
department
.
phone
=
"null"
;
}
var
httpMethod
=
HttpMethod
.
Post
;
// 取得使用者的 "token" Claim 值
string
token
=
User
.
FindFirstValue
(
"token"
);
var
data
=
new
{
name
=
department
.
name
,
address
=
"null"
,
countryid
=
"Taiwan"
,
postcode
=
"123"
,
phone
=
"null"
,
name_en
=
"null"
,
VATID_verify
=
"1"
,
enabled
=
1
};
var
parameters
=
new
Dictionary
<
string
,
string
>
{
{
"token"
,
token
},
{
"merchant"
,
JsonConvert
.
SerializeObject
(
data
)},
{
"uid"
,
department
.
merchant_id
.
ToString
()}
};
var
apiResult
=
await
_callApi
.
CallAPI
(
url
,
parameters
,
httpMethod
);
if
(
apiResult
.
IsSuccess
)
{
var
userAddResponse
=
JsonConvert
.
DeserializeObject
<
UserAddResponse
>(
apiResult
.
Data
.
ToString
());
if
(
userAddResponse
.
r
==
0
)
{
switch
(
_currentLanguage
)
{
case
"en"
:
msg
=
"Edit department success."
;
break
;
case
"zh"
:
msg
=
"編輯部門成功"
;
break
;
default
:
msg
=
"編輯部門成功"
;
break
;
}
TempData
[
"IsSuccess"
]
=
true
;
TempData
[
"msg"
]
=
msg
;
return
RedirectToAction
(
"ListDepartments"
);
}
else
{
TempData
[
"IsSuccess"
]
=
false
;
TempData
[
"msg"
]
=
JsonConvert
.
SerializeObject
(
userAddResponse
.
m
);
return
RedirectToAction
(
"ListDepartments"
);
}
}
return
RedirectToAction
(
"ListDepartments"
);
}
/// <summary>
/// enable做兩件事情,user加入admin,並且enable=true,
...
...
@@ -1308,8 +1403,22 @@ namespace backstage.Controllers
if
(
Response
.
r
==
0
)
{
switch
(
_currentLanguage
)
{
case
"en"
:
msg
=
"Set permission success."
;
break
;
case
"zh"
:
msg
=
"權限調整成功"
;
break
;
default
:
msg
=
"權限調整成功"
;
break
;
}
result
.
IsSuccess
=
true
;
result
.
Message
=
"權限調整成功"
;
result
.
Message
=
msg
;
return
result
;
}
...
...
@@ -1331,8 +1440,23 @@ namespace backstage.Controllers
}
else
{
switch
(
_currentLanguage
)
{
case
"en"
:
msg
=
"Not admin."
;
break
;
case
"zh"
:
msg
=
"非admin"
;
break
;
default
:
msg
=
"非admin"
;
break
;
}
result
.
IsSuccess
=
false
;
result
.
Message
=
"非admin"
;
result
.
Message
=
msg
;
return
result
;
return
result
;
}
}
...
...
@@ -1355,9 +1479,24 @@ namespace backstage.Controllers
if
(
Response
.
r
==
0
)
{
switch
(
_currentLanguage
)
{
case
"en"
:
msg
=
"Set permission success."
;
break
;
case
"zh"
:
msg
=
"權限調整成功"
;
break
;
default
:
msg
=
"權限調整成功"
;
break
;
}
result
.
IsSuccess
=
true
;
result
.
Message
=
"權限調整成功"
;
result
.
Message
=
msg
;
return
result
;
}
else
...
...
@@ -1435,9 +1574,25 @@ namespace backstage.Controllers
var
existUser
=
UserResponse
.
Users
.
Where
(
u
=>
u
.
uid
==
uid
).
FirstOrDefault
();
if
(
existUser
==
null
)
{
switch
(
_currentLanguage
)
{
case
"en"
:
msg
=
"user_id is not exist."
;
break
;
case
"zh"
:
msg
=
"user_id不存在"
;
break
;
default
:
msg
=
"user_id不存在"
;
break
;
}
result
.
IsSuccess
=
false
;
result
.
Message
=
"user_id不存在"
;
result
.
Message
=
msg
;
return
result
;
}
...
...
@@ -1463,29 +1618,87 @@ namespace backstage.Controllers
var
response
=
JsonConvert
.
DeserializeObject
<
Response
>(
apiResult
.
Data
.
ToString
());
if
(
response
.
r
==
0
)
{
switch
(
_currentLanguage
)
{
case
"en"
:
msg
=
"Set permission success."
;
break
;
case
"zh"
:
msg
=
"權限調整成功"
;
break
;
default
:
msg
=
"權限調整成功"
;
break
;
}
result
.
IsSuccess
=
true
;
result
.
Message
=
"權限調整成功"
;
result
.
Message
=
msg
;
return
result
;
}
}
switch
(
_currentLanguage
)
{
case
"en"
:
msg
=
"Errors occoured."
;
break
;
case
"zh"
:
msg
=
"發生錯誤"
;
break
;
default
:
msg
=
"發生錯誤"
;
break
;
}
result
.
IsSuccess
=
false
;
result
.
Message
=
"發生錯誤"
;
result
.
Message
=
msg
;
return
result
;
}
switch
(
_currentLanguage
)
{
case
"en"
:
msg
=
"Errors occoured."
;
break
;
case
"zh"
:
msg
=
"發生錯誤"
;
break
;
default
:
msg
=
"發生錯誤"
;
break
;
}
result
.
IsSuccess
=
false
;
result
.
Message
=
"發生錯誤"
;
result
.
Message
=
msg
;
return
result
;
}
switch
(
_currentLanguage
)
{
case
"en"
:
msg
=
"Errors occoured."
;
break
;
case
"zh"
:
msg
=
"發生錯誤"
;
break
;
default
:
msg
=
"發生錯誤"
;
break
;
}
result
.
IsSuccess
=
false
;
result
.
Message
=
"發生錯誤"
;
result
.
Message
=
msg
;
return
result
;
#
endregion
...
...
Merchant Token Vault Management/backstage/Models/Users/Department.cs
View file @
5fbf8e49
...
...
@@ -11,21 +11,21 @@ namespace backstage.Models.Users
//public int Id { get; set; }
public
int
merchant_id
{
get
;
set
;
}
public
string
address
{
get
;
set
;
}
public
string
country_id
{
get
;
set
;
}
public
string
postcode
{
get
;
set
;
}
public
string
address
{
get
;
set
;
}
=
"null"
;
public
string
country_id
{
get
;
set
;
}
=
"Taiwan"
;
public
string
postcode
{
get
;
set
;
}
=
"123"
;
public
string
phone
{
get
;
set
;
}
public
string
fax
{
get
;
set
;
}
public
string
vatid
{
get
;
set
;
}
public
string
name
{
get
;
set
;
}
public
string
name_en
{
get
;
set
;
}
public
int
enabled
{
get
;
set
;
}
public
int
enabled
{
get
;
set
;
}
=
1
;
public
DateTime
creation_date
{
get
;
set
;
}
public
DateTime
vatid
_verify
{
get
;
set
;
}
public
DateTime
VATID
_verify
{
get
;
set
;
}
public
DateTime
deposit_book_verify
{
get
;
set
;
}
public
DateTime
vatdeposit_book_verify
{
get
;
set
;
}
public
DateTime
user_natid_verify
{
get
;
set
;
}
public
DateTime
enabled_transaction
{
get
;
set
;
}
public
string
merchant_type
{
get
;
set
;
}
public
string
merchant_level
{
get
;
set
;
}
...
...
Merchant Token Vault Management/backstage/Resources/Views/Home/Index.zh.resx
View file @
5fbf8e49
...
...
@@ -117,13 +117,13 @@
<resheader
name=
"writer"
>
<value>
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</value>
</resheader>
<data
name=
"Modify the number of Token Vault Entry this month"
xml:space=
"preserve"
>
<data
name=
"Modify the number of Token Vault Entry
s
this month"
xml:space=
"preserve"
>
<value>
本月修改代碼化保險庫入口數量
</value>
</data>
<data
name=
"Number of departments"
xml:space=
"preserve"
>
<value>
部門數量
</value>
</data>
<data
name=
"Number of new Token Vault Entry added this month"
xml:space=
"preserve"
>
<data
name=
"Number of new Token Vault Entry
s
added this month"
xml:space=
"preserve"
>
<value>
本月新增代碼化保險庫入口數量
</value>
</data>
<data
name=
"Number of Token Vaults"
xml:space=
"preserve"
>
...
...
@@ -132,7 +132,7 @@
<data
name=
"Statistic"
xml:space=
"preserve"
>
<value>
數據統計
</value>
</data>
<data
name=
"Total number of Token Vault Entry"
xml:space=
"preserve"
>
<data
name=
"Total number of Token Vault Entry
s
"
xml:space=
"preserve"
>
<value>
代碼化保險庫入口總數量
</value>
</data>
</root>
\ No newline at end of file
Merchant Token Vault Management/backstage/Resources/Views/Key/ListKeys.zh.resx
View file @
5fbf8e49
...
...
@@ -135,6 +135,9 @@
<data
name=
"Allow update"
xml:space=
"preserve"
>
<value>
允許更新
</value>
</data>
<data
name=
"Cancel"
xml:space=
"preserve"
>
<value>
取消
</value>
</data>
<data
name=
"Choose department"
xml:space=
"preserve"
>
<value>
選擇部門
</value>
</data>
...
...
@@ -222,6 +225,9 @@
<data
name=
"Select user"
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>
...
...
Merchant Token Vault Management/backstage/Resources/Views/Shared/_layout.zh.resx
View file @
5fbf8e49
...
...
@@ -135,7 +135,7 @@
<data
name=
"Setting Backup"
xml:space=
"preserve"
>
<value>
設定備份
</value>
</data>
<data
name=
"Token Vault"
xml:space=
"preserve"
>
<data
name=
"Token Vault
s
"
xml:space=
"preserve"
>
<value>
Token Vault管理
</value>
</data>
<data
name=
"User List"
xml:space=
"preserve"
>
...
...
Merchant Token Vault Management/backstage/Resources/Views/User/ListUsers.zh.resx
View file @
5fbf8e49
...
...
@@ -135,9 +135,15 @@
<data
name=
"enabled"
xml:space=
"preserve"
>
<value>
啟用
</value>
</data>
<data
name=
"Failed"
xml:space=
"preserve"
>
<value>
錯誤
</value>
</data>
<data
name=
"name"
xml:space=
"preserve"
>
<value>
名稱
</value>
</data>
<data
name=
"Success"
xml:space=
"preserve"
>
<value>
成功
</value>
</data>
<data
name=
"User count"
xml:space=
"preserve"
>
<value>
使用者數量
</value>
</data>
...
...
Merchant Token Vault Management/backstage/Views/Home/Index.cshtml
View file @
5fbf8e49
...
...
@@ -44,7 +44,7 @@
<div class="col-lg-4 col-md-6 grid-margin stretch-card dashboard-card">
<div class="card">
<div class="card-body">
<h4 class="card-title">Token Vault Entry <br>@Localizer["Total number of Token Vault Entry"]</h4>
<h4 class="card-title">Token Vault Entry <br>@Localizer["Total number of Token Vault Entry
s
"]</h4>
<div class="card-content text-center">
<img src="~/images/admin-vault-data.svg" class="img-fuild">
<p class="number text-center">200</p>
...
...
@@ -56,7 +56,7 @@
<div class="col-lg-4 col-md-6 grid-margin stretch-card dashboard-card">
<div class="card">
<div class="card-body">
<h4 class="card-title">Token V
ualt Entry<br />@Localizer["Number of new Token Vault Entry
added this month"]</h4>
<h4 class="card-title">Token V
ault Entry<br />@Localizer["Number of new Token Vault Entrys
added this month"]</h4>
<div class="card-content text-center">
<img src="~/images/admin-vault-add.svg" class="img-fuild">
<p class="number text-center">10</p>
...
...
@@ -68,7 +68,7 @@
<div class="col-lg-4 col-md-6 grid-margin stretch-card dashboard-card">
<div class="card">
<div class="card-body">
<h4 class="card-title">Token V
ualt Entry<br />@Localizer["Modify the number of Token Vault Entry
this month"]</h4>
<h4 class="card-title">Token V
ault Entry<br />@Localizer["Modify the number of Token Vault Entrys
this month"]</h4>
<div class="card-content text-center">
<img src="~/images/admin-vault-edit.svg" class="img-fuild">
<p class="number text-center">7</p>
...
...
Merchant Token Vault Management/backstage/Views/Shared/_Layout.cshtml
View file @
5fbf8e49
...
...
@@ -206,7 +206,7 @@
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"@Url.Action("
List
",
"
TokenVault
")"
>
<span
class=
"menu-title"
>
@Localizer["Token Vault"]
</span>
<span
class=
"menu-title"
>
@Localizer["Token Vault
s
"]
</span>
<i
class=
"mdi mdi-database menu-icon"
></i>
</a>
</li>
...
...
Merchant Token Vault Management/backstage/Views/TokenVault/ListUsers.cshtml
View file @
5fbf8e49
This diff is collapsed.
Click to expand it.
Merchant Token Vault Management/backstage/Views/User/GetDepartment.cshtml
View file @
5fbf8e49
...
...
@@ -13,16 +13,16 @@
{
<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">Modify Department</h4>
<div>
<form class="forms-sample" method="post" asp-action="
Create
Department" autocomplete="off">
<form class="forms-sample" method="post" asp-action="
Edit
Department" autocomplete="off">
<div id="errorMsg" asp-validation-summary="All" class="text-danger"></div>
<p class="form-title card-description">Basic</p>
<div class="row">
...
...
@@ -55,7 +55,7 @@
<button type="submit" class="btn btn-primary mr-2">Submit</button>
<button type="submit" class="btn btn-primary mr-2"
id="submitButton"
>Submit</button>
<a type="button" class="btn btn-light" asp-action="ListDepartments">Back to list</a>
</form>
</div>
...
...
@@ -67,15 +67,24 @@
@section Scripts{
<script nonce="KUY8VewuvyUYVEIvEFue4vwyiuf">
var msg = '@TempData["msg"]';
var msg = '@TempData["msg"]';
var IsSuccess = '@TempData["IsSuccess"]';
console.log(IsSuccess + msg);
if (msg != '') {
showAlert(IsSuccess, msg);
}
}
$('#submitButton').click(function (e) {
// 先阻止表單的默認提交行為
e.preventDefault();
// 啟用所有的輸入框
$('input').prop('disabled', false);
// 最後再手動提交表單
$(this).closest('form').submit();
});
</script>
...
...
Merchant Token Vault Management/backstage/Views/User/ListUsers.cshtml
View file @
5fbf8e49
...
...
@@ -15,6 +15,15 @@
<div class="floating-msg" id="msgDiv"></div>
</div>
@section header
{
<script>
var localizationStrings = {
success: '@Localizer["成功"]',
error: '@Localizer["錯誤"]'
};
</script>
}
<div class="row">
<div class="col-lg-12 grid-margin stretch-card">
<div class="card">
...
...
@@ -30,12 +39,12 @@
<th>uid</th>
<th>@Localizer["name"]</th>
@*<th>name_en</th>*@
<th>@Localizer["username"]</th>
<th>@Localizer["Email"]</th>
<th>@Localizer["username"]</th>
<th>@Localizer["Email"]</th>
@*<th>locked</th>*@
<th>@Localizer["creation_date"]</th>
<th>@Localizer["enabled"]</th>
<th>@Localizer["Admin"]</th>
<th>@Localizer["creation_date"]</th>
<th>@Localizer["enabled"]</th>
<th>@Localizer["Admin"]</th>
@*<th>birthdate</th>
<th>marital_status</th>
<th>gender</th>
...
...
@@ -85,14 +94,14 @@
<td>
@if (i.uid == 1)
{
<input type="checkbox" data-uid="@i.uid" class="toggleButton isAdmin" @(i.isAdmin ? "checked" : "") disabled>
<input type="checkbox" data-uid="@i.uid" class="toggleButton isAdmin" @(i.isAdmin ? "checked" : "") disabled>
}
else
{
<input type="checkbox" data-uid="@i.uid" class="toggleButton isAdmin" @(i.isAdmin ? "checked" : "")>
<input type="checkbox" data-uid="@i.uid" class="toggleButton isAdmin" @(i.isAdmin ? "checked" : "")>
}
</td>
@*@if (i.isAdmin)
{ <td>是</td>}
...
...
@@ -126,6 +135,7 @@
@section Scripts{
<script nonce="KUY8VewuvyUYVEIvEFue4vwyiuf">
var msg = '@TempData["msg"]';
var IsSuccess = '@TempData["IsSuccess"]';
console.log(IsSuccess + msg);
...
...
Merchant Token Vault Management/backstage/wwwroot/css/style.css
View file @
5fbf8e49
...
...
@@ -19289,8 +19289,6 @@ tbody {
}
<<<<<<<<<
Temporary
merge
branch
1
/*版本號樣式*/
.versionNo
{
...
...
@@ -19299,7 +19297,6 @@ tbody {
padding
:
20px
16px
10px
16px
}
=========
.floating-msg
{
position
:
fixed
;
top
:
80px
;
...
...
Merchant Token Vault Management/backstage/wwwroot/js/site.js
View file @
5fbf8e49
//========show alert通知訊息============
function
showAlert
(
status
,
msg
)
{
console
.
log
(
'showAlert='
+
status
)
color
=
'alert-success'
;
var
color
=
'alert-success'
;
if
(
status
!==
'True'
&&
status
!==
true
)
{
color
=
'alert-danger'
;
status
=
'Error
!
'
;
status
=
'Error
!
'
;
}
else
{
status
=
'Success
!
'
;
status
=
'Success
!
'
;
}
$
.
doTimeout
(
'alert'
);
$
(
'#msgDiv'
).
html
(
'<div class="alert '
+
color
+
' alert-dismissible">'
+
var
newAlert
=
$
(
'<div class="alert '
+
color
+
' alert-dismissible">'
+
'<button type="button" class="close" data-dismiss="alert">×</button>'
+
' <strong>'
+
status
+
'</strong> '
+
msg
+
'</div>'
);
$
(
"#msgDiv"
).
show
();
$
.
doTimeout
(
'alert'
,
4000
,
function
()
{
$
(
"#msgDiv"
).
slideUp
(
200
,
function
()
{
$
(
"#msgDiv"
).
append
(
newAlert
);
newAlert
.
slideDown
(
200
);
setTimeout
(
function
()
{
newAlert
.
slideUp
(
200
,
function
()
{
$
(
this
).
alert
(
'close'
);
$
(
this
).
remove
();
});
})
},
4000
);
}
//function showAlert(status, msg) {
// console.log('showAlert=' + status)
// color = 'alert-success';
// if (status !== 'True' && status !== true) {
// color = 'alert-danger';
// status = 'Error!';
// }
// else {
// status = 'Success!';
// }
// $.doTimeout('alert');
// $('#msgDiv').append('<div class="alert ' + color + ' alert-dismissible">' +
// '<button type="button" class="close" data-dismiss="alert">×</button>' +
// ' <strong>' + status + '</strong> ' + msg + '</div>');
// $("#msgDiv").show();
// $.doTimeout('alert', 4000, function () {
// $("#msgDiv").slideUp(200, function () {
// $(this).alert('close');
// });
// })
//}
//========END show alert通知訊息============
...
...
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