Skip to content

Commit

Permalink
perf: add face acl failed msg
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeEirc committed Dec 18, 2024
1 parent eac9a70 commit 2f8f00d
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 29 deletions.
23 changes: 17 additions & 6 deletions locale/en_US/LC_MESSAGES/koko.po
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,18 @@ msgstr ""
#. lang.T
#: pkg/handler/asset.go:223
msgid ""
"Face verification is not supported yet. Please use the WebTerminal to "
"connect the asset."
"Face ACL is not supported yet. Please use the WebTerminal to connect the "
"asset."
msgstr ""

#. lang.T
#. lang.T
#: pkg/handler/asset.go:238 pkg/handler/asset.go:255
#: pkg/handler/asset.go:238 pkg/handler/asset.go:247
msgid "Unknown error code: %s, detail: %s"
msgstr ""

#. lang.T
#: pkg/handler/asset.go:258
msgid "get connect token err"
msgstr ""

Expand Down Expand Up @@ -233,12 +238,18 @@ msgstr ""
#. lang.T
#. lang.T
#. lang.T
#: pkg/handler/direct_handler.go:433 pkg/handler/direct_handler.go:439
#: pkg/handler/direct_handler.go:445
msgid ""
"Face verification is not supported yet. Please use the WebTerminal to "
"connect the asset."
msgstr ""

#. lang.T
#. lang.T
#. lang.T
#: pkg/handler/direct_handler.go:433 pkg/handler/direct_handler.go:439
#: pkg/handler/direct_handler.go:445 pkg/handler/direct_handler.go:460
#: pkg/handler/direct_handler.go:476 pkg/handler/dispatch.go:139
#: pkg/handler/direct_handler.go:460 pkg/handler/direct_handler.go:476
#: pkg/handler/dispatch.go:139
msgid "Node: [ ID.Name(Asset amount) ]"
msgstr ""

Expand Down
29 changes: 22 additions & 7 deletions locale/ja_JP/LC_MESSAGES/koko.po
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,20 @@ msgstr "は拒否されました"
#: pkg/handler/asset.go:223
#, fuzzy
msgid ""
"Face verification is not supported yet. Please use the WebTerminal to "
"connect the asset."
"Face ACL is not supported yet. Please use the WebTerminal to connect the "
"asset."
msgstr ""
"顔認証はまだサポートされていません。資産に接続するにはWebTerminalをご利用ください"
"該端末は顔認証アクセスルールをサポートしていません。資産に接続するにはWebTerminalをご利用くだ"
"さい"

#. lang.T
#. lang.T
#: pkg/handler/asset.go:238 pkg/handler/asset.go:255
#: pkg/handler/asset.go:238 pkg/handler/asset.go:247
msgid "Unknown error code: %s, detail: %s"
msgstr "不明なエラーコード: %s, 詳細: %s"

#. lang.T
#: pkg/handler/asset.go:258
msgid "get connect token err"
msgstr "接続トークン取得エラー"

Expand Down Expand Up @@ -245,12 +251,21 @@ msgstr "一致したユーザー名 %s が見つかりません"
#. lang.T
#. lang.T
#. lang.T
#: pkg/handler/direct_handler.go:433 pkg/handler/direct_handler.go:439
#: pkg/handler/direct_handler.go:445
#, fuzzy
msgid ""
"Face verification is not supported yet. Please use the WebTerminal to "
"connect the asset."
msgstr ""
"顔認証はまだサポートされていません。資産に接続するにはWebTerminalをご利用くだ"
"さい"

#. lang.T
#. lang.T
#. lang.T
#: pkg/handler/direct_handler.go:433 pkg/handler/direct_handler.go:439
#: pkg/handler/direct_handler.go:445 pkg/handler/direct_handler.go:460
#: pkg/handler/direct_handler.go:476 pkg/handler/dispatch.go:139
#: pkg/handler/direct_handler.go:460 pkg/handler/direct_handler.go:476
#: pkg/handler/dispatch.go:139
msgid "Node: [ ID.Name(Asset amount) ]"
msgstr "ノード: [ID.Name(アセット量)]"

Expand Down
26 changes: 19 additions & 7 deletions locale/zh_CN/LC_MESSAGES/koko.po
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,18 @@ msgstr "本次登录已拒绝,原因是访问控制策略的限制"
#: pkg/handler/asset.go:223
#, fuzzy
msgid ""
"Face verification is not supported yet. Please use the WebTerminal to "
"connect the asset."
msgstr "该终端不支持人脸识别认证,请使用web终端登录"
"Face ACL is not supported yet. Please use the WebTerminal to connect the "
"asset."
msgstr "该终端不支持人脸访问规则,请使用web终端登录"

#. lang.T
#. lang.T
#: pkg/handler/asset.go:238 pkg/handler/asset.go:255
#: pkg/handler/asset.go:238 pkg/handler/asset.go:247
msgid "Unknown error code: %s, detail: %s"
msgstr "未知错误代码:%s,详情:%s"

#. lang.T
#: pkg/handler/asset.go:258
msgid "get connect token err"
msgstr "获取 connect token 错误"

Expand Down Expand Up @@ -252,12 +257,19 @@ msgstr "未发现匹配的用户名 %s"
#. lang.T
#. lang.T
#. lang.T
#: pkg/handler/direct_handler.go:433 pkg/handler/direct_handler.go:439
#: pkg/handler/direct_handler.go:445
#, fuzzy
msgid ""
"Face verification is not supported yet. Please use the WebTerminal to "
"connect the asset."
msgstr "该终端不支持人脸识别认证,请使用web终端登录"

#. lang.T
#. lang.T
#. lang.T
#: pkg/handler/direct_handler.go:433 pkg/handler/direct_handler.go:439
#: pkg/handler/direct_handler.go:445 pkg/handler/direct_handler.go:460
#: pkg/handler/direct_handler.go:476 pkg/handler/dispatch.go:139
#: pkg/handler/direct_handler.go:460 pkg/handler/direct_handler.go:476
#: pkg/handler/dispatch.go:139
msgid "Node: [ ID.Name(Asset amount) ]"
msgstr "节点:[ ID.名称(资产数量) ]"

Expand Down
24 changes: 18 additions & 6 deletions locale/zh_Hant/LC_MESSAGES/koko.po
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,18 @@ msgstr "本次登入已拒絕,原因是訪問控制策略的限制"
#: pkg/handler/asset.go:223
#, fuzzy
msgid ""
"Face verification is not supported yet. Please use the WebTerminal to "
"connect the asset."
"Face ACL is not supported yet. Please use the WebTerminal to connect the "
"asset."
msgstr "該終端不支持人臉識別認證,請使用網頁終端登錄"

#. lang.T
#. lang.T
#: pkg/handler/asset.go:238 pkg/handler/asset.go:255
#: pkg/handler/asset.go:238 pkg/handler/asset.go:247
msgid "Unknown error code: %s, detail: %s"
msgstr "未知錯誤碼:%s,詳情:%s"

#. lang.T
#: pkg/handler/asset.go:258
msgid "get connect token err"
msgstr "獲取 connect token 錯誤"

Expand Down Expand Up @@ -252,12 +257,19 @@ msgstr "未發現匹配的使用者名稱 %s"
#. lang.T
#. lang.T
#. lang.T
#: pkg/handler/direct_handler.go:433 pkg/handler/direct_handler.go:439
#: pkg/handler/direct_handler.go:445
#, fuzzy
msgid ""
"Face verification is not supported yet. Please use the WebTerminal to "
"connect the asset."
msgstr "該終端不支持人臉識別認證,請使用網頁終端登錄"

#. lang.T
#. lang.T
#. lang.T
#: pkg/handler/direct_handler.go:433 pkg/handler/direct_handler.go:439
#: pkg/handler/direct_handler.go:445 pkg/handler/direct_handler.go:460
#: pkg/handler/direct_handler.go:476 pkg/handler/dispatch.go:139
#: pkg/handler/direct_handler.go:460 pkg/handler/direct_handler.go:476
#: pkg/handler/dispatch.go:139
msgid "Node: [ ID.Name(Asset amount) ]"
msgstr "節點:[ ID.名稱(資產數量) ]"

Expand Down
7 changes: 5 additions & 2 deletions pkg/handler/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,10 @@ func (u *UserSelectHandler) proxyAsset(asset model.PermAsset) {
utils.IgnoreErrWriteString(u.h.term, lang.T("ACL reject"))
utils.IgnoreErrWriteString(u.h.term, utils.CharNewLine)
return
case model.ACLFaceVerify:
case model.ACLFaceVerify, model.ACLFaceOnline, model.ACLFaceOnlineNotSupported:
// todo: 需要人脸验证 后续需要发站内信通知用户,并且等待用户人脸验证通过
logger.Errorf("Create connect token and auth info failed: %s %s", tokenInfo.Code, tokenInfo.Detail)
msg := lang.T("Face verification is not supported yet. Please use the WebTerminal to connect the asset.")
msg := lang.T("Face ACL is not supported yet. Please use the WebTerminal to connect the asset.")
utils.IgnoreErrWriteString(u.h.term, msg)
utils.IgnoreErrWriteString(u.h.term, utils.CharNewLine)
return
Expand All @@ -244,6 +244,9 @@ func (u *UserSelectHandler) proxyAsset(asset model.PermAsset) {
}
tokenInfo = reviewHandler.tokenInfo
default:
msg := lang.T("Unknown error code: %s, detail: %s")
utils.IgnoreErrWriteString(u.h.term, fmt.Sprintf(msg, tokenInfo.Code, tokenInfo.Detail))
utils.IgnoreErrWriteString(u.h.term, utils.CharNewLine)
logger.Errorf("Create connect token and auth info failed: %s %s", tokenInfo.Code, tokenInfo.Detail)
return
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/jms-sdk-go/model/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ const (
ACLReview = "acl_review"
ACLReject = "acl_reject"

ACLFaceVerify = "acl_face_verify"
ACLFaceVerify = "acl_face_verify"
ACLFaceOnline = "acl_face_online"
ACLFaceOnlineNotSupported = "acl_face_online_not_supported"
)

type ConnectOptions struct {
Expand Down

0 comments on commit 2f8f00d

Please sign in to comment.