mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 00:34:28 +08:00
generate API token in frontend page
This commit is contained in:
+16
-4
@@ -264,7 +264,13 @@ var UserData = &cli.Command{
|
|||||||
Name: "type",
|
Name: "type",
|
||||||
Aliases: []string{"t"},
|
Aliases: []string{"t"},
|
||||||
Required: false,
|
Required: false,
|
||||||
Usage: "Specific token type, supports \"normal\" and \"mcp\", default is \"normal\"",
|
Usage: "Specific token type, supports \"api\" and \"mcp\", default is \"api\"",
|
||||||
|
},
|
||||||
|
&cli.Int64Flag{
|
||||||
|
Name: "expiresInSeconds",
|
||||||
|
Aliases: []string{"e"},
|
||||||
|
Required: true,
|
||||||
|
Usage: "Token expiration time in seconds (0 - 4294967295, 0 means no expiration).",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -722,17 +728,23 @@ func createNewUserToken(c *core.CliContext) error {
|
|||||||
|
|
||||||
username := c.String("username")
|
username := c.String("username")
|
||||||
tokenType := c.String("type")
|
tokenType := c.String("type")
|
||||||
|
expiresInSeconds := c.Int64("expiresInSeconds")
|
||||||
|
|
||||||
if tokenType == "" {
|
if tokenType == "" {
|
||||||
tokenType = "normal"
|
tokenType = "api"
|
||||||
}
|
}
|
||||||
|
|
||||||
if tokenType != "normal" && tokenType != "mcp" {
|
if tokenType != "api" && tokenType != "mcp" {
|
||||||
log.CliErrorf(c, "[user_data.createNewUserToken] token type is invalid")
|
log.CliErrorf(c, "[user_data.createNewUserToken] token type is invalid")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
token, tokenString, err := clis.UserData.CreateNewUserToken(c, username, tokenType)
|
if expiresInSeconds < 0 || expiresInSeconds > 4294967295 {
|
||||||
|
log.CliErrorf(c, "[user_data.createNewUserToken] expiresInSeconds is out of range (0 - 4294967295)")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
token, tokenString, err := clis.UserData.CreateNewUserToken(c, username, tokenType, expiresInSeconds)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.CliErrorf(c, "[user_data.createNewUserToken] error occurs when creating user token")
|
log.CliErrorf(c, "[user_data.createNewUserToken] error occurs when creating user token")
|
||||||
|
|||||||
@@ -318,6 +318,7 @@ func startWebServer(c *core.CliContext) error {
|
|||||||
{
|
{
|
||||||
// Tokens
|
// Tokens
|
||||||
apiV1Route.GET("/tokens/list.json", bindApi(api.Tokens.TokenListHandler))
|
apiV1Route.GET("/tokens/list.json", bindApi(api.Tokens.TokenListHandler))
|
||||||
|
apiV1Route.POST("/tokens/generate/api.json", bindApi(api.Tokens.TokenGenerateAPIHandler))
|
||||||
apiV1Route.POST("/tokens/generate/mcp.json", bindApi(api.Tokens.TokenGenerateMCPHandler))
|
apiV1Route.POST("/tokens/generate/mcp.json", bindApi(api.Tokens.TokenGenerateMCPHandler))
|
||||||
apiV1Route.POST("/tokens/revoke.json", bindApi(api.Tokens.TokenRevokeHandler))
|
apiV1Route.POST("/tokens/revoke.json", bindApi(api.Tokens.TokenRevokeHandler))
|
||||||
apiV1Route.POST("/tokens/revoke_all.json", bindApi(api.Tokens.TokenRevokeAllHandler))
|
apiV1Route.POST("/tokens/revoke_all.json", bindApi(api.Tokens.TokenRevokeAllHandler))
|
||||||
|
|||||||
@@ -263,6 +263,9 @@ email_verify_token_expired_time = 3600
|
|||||||
# Password reset token expired seconds (60 - 4294967295), default is 3600 (60 minutes)
|
# Password reset token expired seconds (60 - 4294967295), default is 3600 (60 minutes)
|
||||||
password_reset_token_expired_time = 3600
|
password_reset_token_expired_time = 3600
|
||||||
|
|
||||||
|
# Set to true to enable API token generation
|
||||||
|
enable_generate_api_token = false
|
||||||
|
|
||||||
# Maximum count of password / token check failures (0 - 4294967295) per IP per minute (use the above duplicate checker), default is 5, set to 0 to disable
|
# Maximum count of password / token check failures (0 - 4294967295) per IP per minute (use the above duplicate checker), default is 5, set to 0 to disable
|
||||||
max_failures_per_ip_per_minute = 5
|
max_failures_per_ip_per_minute = 5
|
||||||
|
|
||||||
@@ -382,6 +385,7 @@ max_user_avatar_size = 1048576
|
|||||||
# 14: Create Transactions from AI Image Recognition
|
# 14: Create Transactions from AI Image Recognition
|
||||||
# 15: OAuth 2.0 Login
|
# 15: OAuth 2.0 Login
|
||||||
# 16: Unlink Third-party Login
|
# 16: Unlink Third-party Login
|
||||||
|
# 17: Generate API Token
|
||||||
default_feature_restrictions =
|
default_feature_restrictions =
|
||||||
|
|
||||||
[data]
|
[data]
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ func (a *ServerSettingsApi) ServerSettingsJavascriptHandler(c *core.WebContext)
|
|||||||
a.appendBooleanSetting(builder, "o", config.EnableOAuth2Login)
|
a.appendBooleanSetting(builder, "o", config.EnableOAuth2Login)
|
||||||
a.appendBooleanSetting(builder, "r", config.EnableInternalAuth && config.EnableUserRegister)
|
a.appendBooleanSetting(builder, "r", config.EnableInternalAuth && config.EnableUserRegister)
|
||||||
a.appendBooleanSetting(builder, "f", config.EnableInternalAuth && config.EnableUserForgetPassword)
|
a.appendBooleanSetting(builder, "f", config.EnableInternalAuth && config.EnableUserForgetPassword)
|
||||||
|
a.appendBooleanSetting(builder, "t", config.EnableGenerateAPIToken)
|
||||||
a.appendBooleanSetting(builder, "v", config.EnableUserVerifyEmail)
|
a.appendBooleanSetting(builder, "v", config.EnableUserVerifyEmail)
|
||||||
a.appendBooleanSetting(builder, "p", config.EnableTransactionPictures)
|
a.appendBooleanSetting(builder, "p", config.EnableTransactionPictures)
|
||||||
a.appendBooleanSetting(builder, "s", config.EnableScheduledTransaction)
|
a.appendBooleanSetting(builder, "s", config.EnableScheduledTransaction)
|
||||||
|
|||||||
+50
-2
@@ -69,7 +69,9 @@ func (a *TokensApi) TokenListHandler(c *core.WebContext) (any, *errs.Error) {
|
|||||||
tokenResp.IsCurrent = true
|
tokenResp.IsCurrent = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if token.TokenType == core.USER_TOKEN_TYPE_MCP && token.UserAgent != services.TokenUserAgentCreatedViaCli {
|
if token.TokenType == core.USER_TOKEN_TYPE_API && token.UserAgent != services.TokenUserAgentCreatedViaCli {
|
||||||
|
tokenResp.UserAgent = services.TokenUserAgentForAPI
|
||||||
|
} else if token.TokenType == core.USER_TOKEN_TYPE_MCP && token.UserAgent != services.TokenUserAgentCreatedViaCli {
|
||||||
tokenResp.UserAgent = services.TokenUserAgentForMCP
|
tokenResp.UserAgent = services.TokenUserAgentForMCP
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,6 +83,52 @@ func (a *TokensApi) TokenListHandler(c *core.WebContext) (any, *errs.Error) {
|
|||||||
return tokenResps, nil
|
return tokenResps, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TokenGenerateAPIHandler generates a new API token for current user
|
||||||
|
func (a *TokensApi) TokenGenerateAPIHandler(c *core.WebContext) (any, *errs.Error) {
|
||||||
|
if !a.CurrentConfig().EnableGenerateAPIToken {
|
||||||
|
return nil, errs.ErrNotAllowedToGenerateAPIToken
|
||||||
|
}
|
||||||
|
|
||||||
|
var generateAPITokenReq models.TokenGenerateAPIRequest
|
||||||
|
err := c.ShouldBindJSON(&generateAPITokenReq)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Warnf(c, "[tokens.TokenGenerateAPIHandler] parse request failed, because %s", err.Error())
|
||||||
|
return nil, errs.NewIncompleteOrIncorrectSubmissionError(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
uid := c.GetCurrentUid()
|
||||||
|
user, err := a.users.GetUserById(c, uid)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Warnf(c, "[tokens.TokenGenerateAPIHandler] failed to get user \"uid:%d\" info, because %s", uid, err.Error())
|
||||||
|
return nil, errs.ErrUserNotFound
|
||||||
|
}
|
||||||
|
|
||||||
|
if user.FeatureRestriction.Contains(core.USER_FEATURE_RESTRICTION_TYPE_GENERATE_API_TOKEN) {
|
||||||
|
return false, errs.ErrNotPermittedToPerformThisAction
|
||||||
|
}
|
||||||
|
|
||||||
|
if !a.users.IsPasswordEqualsUserPassword(generateAPITokenReq.Password, user) {
|
||||||
|
return nil, errs.ErrUserPasswordWrong
|
||||||
|
}
|
||||||
|
|
||||||
|
token, claims, err := a.tokens.CreateAPIToken(c, user, generateAPITokenReq.ExpiredInSeconds)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Errorf(c, "[tokens.TokenGenerateAPIHandler] failed to create api token for user \"uid:%d\", because %s", user.Uid, err.Error())
|
||||||
|
return nil, errs.Or(err, errs.ErrTokenGenerating)
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Infof(c, "[tokens.TokenGenerateAPIHandler] user \"uid:%d\" has generated api token, new token will be expired at %d", user.Uid, claims.ExpiresAt)
|
||||||
|
|
||||||
|
generateAPITokenResp := &models.TokenGenerateAPIResponse{
|
||||||
|
Token: token,
|
||||||
|
}
|
||||||
|
|
||||||
|
return generateAPITokenResp, nil
|
||||||
|
}
|
||||||
|
|
||||||
// TokenGenerateMCPHandler generates a new MCP token for current user
|
// TokenGenerateMCPHandler generates a new MCP token for current user
|
||||||
func (a *TokensApi) TokenGenerateMCPHandler(c *core.WebContext) (any, *errs.Error) {
|
func (a *TokensApi) TokenGenerateMCPHandler(c *core.WebContext) (any, *errs.Error) {
|
||||||
if !a.CurrentConfig().EnableMCPServer {
|
if !a.CurrentConfig().EnableMCPServer {
|
||||||
@@ -111,7 +159,7 @@ func (a *TokensApi) TokenGenerateMCPHandler(c *core.WebContext) (any, *errs.Erro
|
|||||||
return nil, errs.ErrUserPasswordWrong
|
return nil, errs.ErrUserPasswordWrong
|
||||||
}
|
}
|
||||||
|
|
||||||
token, claims, err := a.tokens.CreateMCPToken(c, user)
|
token, claims, err := a.tokens.CreateMCPToken(c, user, generateMCPTokenReq.ExpiredInSeconds)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf(c, "[tokens.TokenGenerateMCPHandler] failed to create mcp token for user \"uid:%d\", because %s", user.Uid, err.Error())
|
log.Errorf(c, "[tokens.TokenGenerateMCPHandler] failed to create mcp token for user \"uid:%d\", because %s", user.Uid, err.Error())
|
||||||
|
|||||||
+13
-5
@@ -405,7 +405,7 @@ func (l *UserDataCli) ListUserTokens(c *core.CliContext, username string) ([]*mo
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CreateNewUserToken returns a new token for the specified user
|
// CreateNewUserToken returns a new token for the specified user
|
||||||
func (l *UserDataCli) CreateNewUserToken(c *core.CliContext, username string, tokenType string) (*models.TokenRecord, string, error) {
|
func (l *UserDataCli) CreateNewUserToken(c *core.CliContext, username string, tokenType string, expiresInSeconds int64) (*models.TokenRecord, string, error) {
|
||||||
if username == "" {
|
if username == "" {
|
||||||
log.CliErrorf(c, "[user_data.CreateNewUserToken] user name is empty")
|
log.CliErrorf(c, "[user_data.CreateNewUserToken] user name is empty")
|
||||||
return nil, "", errs.ErrUsernameIsEmpty
|
return nil, "", errs.ErrUsernameIsEmpty
|
||||||
@@ -421,7 +421,17 @@ func (l *UserDataCli) CreateNewUserToken(c *core.CliContext, username string, to
|
|||||||
var token string
|
var token string
|
||||||
var tokenRecord *models.TokenRecord
|
var tokenRecord *models.TokenRecord
|
||||||
|
|
||||||
if tokenType == "mcp" {
|
if tokenType == "api" {
|
||||||
|
if !l.CurrentConfig().EnableGenerateAPIToken {
|
||||||
|
return nil, "", errs.ErrNotAllowedToGenerateAPIToken
|
||||||
|
}
|
||||||
|
|
||||||
|
if user.FeatureRestriction.Contains(core.USER_FEATURE_RESTRICTION_TYPE_GENERATE_API_TOKEN) {
|
||||||
|
return nil, "", errs.ErrNotPermittedToPerformThisAction
|
||||||
|
}
|
||||||
|
|
||||||
|
token, tokenRecord, err = l.tokens.CreateAPITokenViaCli(c, user, expiresInSeconds)
|
||||||
|
} else if tokenType == "mcp" {
|
||||||
if !l.CurrentConfig().EnableMCPServer {
|
if !l.CurrentConfig().EnableMCPServer {
|
||||||
return nil, "", errs.ErrMCPServerNotEnabled
|
return nil, "", errs.ErrMCPServerNotEnabled
|
||||||
}
|
}
|
||||||
@@ -430,9 +440,7 @@ func (l *UserDataCli) CreateNewUserToken(c *core.CliContext, username string, to
|
|||||||
return nil, "", errs.ErrNotPermittedToPerformThisAction
|
return nil, "", errs.ErrNotPermittedToPerformThisAction
|
||||||
}
|
}
|
||||||
|
|
||||||
token, tokenRecord, err = l.tokens.CreateMCPTokenViaCli(c, user)
|
token, tokenRecord, err = l.tokens.CreateMCPTokenViaCli(c, user, expiresInSeconds)
|
||||||
} else if tokenType == "normal" {
|
|
||||||
token, tokenRecord, err = l.tokens.CreateTokenViaCli(c, user)
|
|
||||||
} else {
|
} else {
|
||||||
return nil, "", errs.ErrParameterInvalid
|
return nil, "", errs.ErrParameterInvalid
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,11 @@ func (c *CliContext) Int(name string) int {
|
|||||||
return c.command.Int(name)
|
return c.command.Int(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Int64 returns the long integer value of parameter
|
||||||
|
func (c *CliContext) Int64(name string) int64 {
|
||||||
|
return c.command.Int64(name)
|
||||||
|
}
|
||||||
|
|
||||||
// String returns the string value of parameter
|
// String returns the string value of parameter
|
||||||
func (c *CliContext) String(name string) string {
|
func (c *CliContext) String(name string) string {
|
||||||
return c.command.String(name)
|
return c.command.String(name)
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ const (
|
|||||||
USER_TOKEN_TYPE_MCP TokenType = 5
|
USER_TOKEN_TYPE_MCP TokenType = 5
|
||||||
USER_TOKEN_TYPE_OAUTH2_CALLBACK_REQUIRE_VERIFY TokenType = 6
|
USER_TOKEN_TYPE_OAUTH2_CALLBACK_REQUIRE_VERIFY TokenType = 6
|
||||||
USER_TOKEN_TYPE_OAUTH2_CALLBACK TokenType = 7
|
USER_TOKEN_TYPE_OAUTH2_CALLBACK TokenType = 7
|
||||||
|
USER_TOKEN_TYPE_API TokenType = 8
|
||||||
)
|
)
|
||||||
|
|
||||||
// UserTokenClaims represents user token
|
// UserTokenClaims represents user token
|
||||||
|
|||||||
@@ -92,10 +92,11 @@ const (
|
|||||||
USER_FEATURE_RESTRICTION_TYPE_CREATE_TRANSACTION_FROM_AI_IMAGE_RECOGNITION UserFeatureRestrictionType = 14
|
USER_FEATURE_RESTRICTION_TYPE_CREATE_TRANSACTION_FROM_AI_IMAGE_RECOGNITION UserFeatureRestrictionType = 14
|
||||||
USER_FEATURE_RESTRICTION_TYPE_OAUTH2_LOGIN UserFeatureRestrictionType = 15
|
USER_FEATURE_RESTRICTION_TYPE_OAUTH2_LOGIN UserFeatureRestrictionType = 15
|
||||||
USER_FEATURE_RESTRICTION_TYPE_UNLINK_THIRD_PARTY_LOGIN UserFeatureRestrictionType = 16
|
USER_FEATURE_RESTRICTION_TYPE_UNLINK_THIRD_PARTY_LOGIN UserFeatureRestrictionType = 16
|
||||||
|
USER_FEATURE_RESTRICTION_TYPE_GENERATE_API_TOKEN UserFeatureRestrictionType = 17
|
||||||
)
|
)
|
||||||
|
|
||||||
const userFeatureRestrictionTypeMinValue UserFeatureRestrictionType = USER_FEATURE_RESTRICTION_TYPE_UPDATE_PASSWORD
|
const userFeatureRestrictionTypeMinValue UserFeatureRestrictionType = USER_FEATURE_RESTRICTION_TYPE_UPDATE_PASSWORD
|
||||||
const userFeatureRestrictionTypeMaxValue UserFeatureRestrictionType = USER_FEATURE_RESTRICTION_TYPE_UNLINK_THIRD_PARTY_LOGIN
|
const userFeatureRestrictionTypeMaxValue UserFeatureRestrictionType = USER_FEATURE_RESTRICTION_TYPE_GENERATE_API_TOKEN
|
||||||
|
|
||||||
// String returns a textual representation of the restriction type of user features
|
// String returns a textual representation of the restriction type of user features
|
||||||
func (t UserFeatureRestrictionType) String() string {
|
func (t UserFeatureRestrictionType) String() string {
|
||||||
@@ -132,6 +133,8 @@ func (t UserFeatureRestrictionType) String() string {
|
|||||||
return "OAuth 2.0 Login"
|
return "OAuth 2.0 Login"
|
||||||
case USER_FEATURE_RESTRICTION_TYPE_UNLINK_THIRD_PARTY_LOGIN:
|
case USER_FEATURE_RESTRICTION_TYPE_UNLINK_THIRD_PARTY_LOGIN:
|
||||||
return "Unlink Third-Party Login"
|
return "Unlink Third-Party Login"
|
||||||
|
case USER_FEATURE_RESTRICTION_TYPE_GENERATE_API_TOKEN:
|
||||||
|
return "Generate API Token"
|
||||||
default:
|
default:
|
||||||
return fmt.Sprintf("Invalid(%d)", int(t))
|
return fmt.Sprintf("Invalid(%d)", int(t))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,4 +21,5 @@ var (
|
|||||||
ErrTokenIsEmpty = NewNormalError(NormalSubcategoryToken, 12, http.StatusBadRequest, "token is empty")
|
ErrTokenIsEmpty = NewNormalError(NormalSubcategoryToken, 12, http.StatusBadRequest, "token is empty")
|
||||||
ErrEmailVerifyTokenIsInvalidOrExpired = NewNormalError(NormalSubcategoryToken, 13, http.StatusBadRequest, "email verify token is invalid or expired")
|
ErrEmailVerifyTokenIsInvalidOrExpired = NewNormalError(NormalSubcategoryToken, 13, http.StatusBadRequest, "email verify token is invalid or expired")
|
||||||
ErrPasswordResetTokenIsInvalidOrExpired = NewNormalError(NormalSubcategoryToken, 14, http.StatusBadRequest, "password reset token is invalid or expired")
|
ErrPasswordResetTokenIsInvalidOrExpired = NewNormalError(NormalSubcategoryToken, 14, http.StatusBadRequest, "password reset token is invalid or expired")
|
||||||
|
ErrNotAllowedToGenerateAPIToken = NewNormalError(NormalSubcategoryToken, 15, http.StatusForbidden, "not allowed to generate api token")
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ func jwtAuthorization(c *core.WebContext, source TokenSourceType) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if claims.Type != core.USER_TOKEN_TYPE_NORMAL {
|
if claims.Type != core.USER_TOKEN_TYPE_NORMAL && claims.Type != core.USER_TOKEN_TYPE_API {
|
||||||
log.Warnf(c, "[authorization.jwtAuthorization] user \"uid:%d\" token type (%d) is invalid", claims.Uid, claims.Type)
|
log.Warnf(c, "[authorization.jwtAuthorization] user \"uid:%d\" token type (%d) is invalid", claims.Uid, claims.Type)
|
||||||
utils.PrintJsonErrorResult(c, errs.ErrCurrentInvalidTokenType)
|
utils.PrintJsonErrorResult(c, errs.ErrCurrentInvalidTokenType)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -25,9 +25,16 @@ type OAuth2CallbackTokenContext struct {
|
|||||||
ExternalEmail string `json:"externalEmail"`
|
ExternalEmail string `json:"externalEmail"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TokenGenerateAPIRequest represents all parameters of api token generation request
|
||||||
|
type TokenGenerateAPIRequest struct {
|
||||||
|
ExpiredInSeconds int64 `json:"expiresInSeconds" binding:"omitempty,min=0,max=4294967295"`
|
||||||
|
Password string `json:"password" binding:"omitempty,min=6,max=128"`
|
||||||
|
}
|
||||||
|
|
||||||
// TokenGenerateMCPRequest represents all parameters of mcp token generation request
|
// TokenGenerateMCPRequest represents all parameters of mcp token generation request
|
||||||
type TokenGenerateMCPRequest struct {
|
type TokenGenerateMCPRequest struct {
|
||||||
Password string `json:"password" binding:"omitempty,min=6,max=128"`
|
ExpiredInSeconds int64 `json:"expiresInSeconds" binding:"omitempty,min=0,max=4294967295"`
|
||||||
|
Password string `json:"password" binding:"omitempty,min=6,max=128"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// TokenRevokeRequest represents all parameters of token revoking request
|
// TokenRevokeRequest represents all parameters of token revoking request
|
||||||
@@ -35,6 +42,11 @@ type TokenRevokeRequest struct {
|
|||||||
TokenId string `json:"tokenId" binding:"required,notBlank"`
|
TokenId string `json:"tokenId" binding:"required,notBlank"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TokenGenerateAPIResponse represents all response parameters of generated api token
|
||||||
|
type TokenGenerateAPIResponse struct {
|
||||||
|
Token string `json:"token"`
|
||||||
|
}
|
||||||
|
|
||||||
// TokenGenerateMCPResponse represents all response parameters of generated mcp token
|
// TokenGenerateMCPResponse represents all response parameters of generated mcp token
|
||||||
type TokenGenerateMCPResponse struct {
|
type TokenGenerateMCPResponse struct {
|
||||||
Token string `json:"token"`
|
Token string `json:"token"`
|
||||||
|
|||||||
+50
-11
@@ -23,6 +23,9 @@ import (
|
|||||||
// TokenUserAgentCreatedViaCli is the user agent of token created via cli
|
// TokenUserAgentCreatedViaCli is the user agent of token created via cli
|
||||||
const TokenUserAgentCreatedViaCli = "ezbookkeeping Cli"
|
const TokenUserAgentCreatedViaCli = "ezbookkeeping Cli"
|
||||||
|
|
||||||
|
// TokenUserAgentForAPI is the user agent for API token
|
||||||
|
const TokenUserAgentForAPI = "ezbookkeeping API"
|
||||||
|
|
||||||
// TokenUserAgentForMCP is the user agent for MCP token
|
// TokenUserAgentForMCP is the user agent for MCP token
|
||||||
const TokenUserAgentForMCP = "ezbookkeeping MCP"
|
const TokenUserAgentForMCP = "ezbookkeeping MCP"
|
||||||
|
|
||||||
@@ -67,7 +70,7 @@ func (s *TokenService) GetAllUnexpiredNormalAndMCPTokensByUid(c core.Context, ui
|
|||||||
now := time.Now().Unix()
|
now := time.Now().Unix()
|
||||||
|
|
||||||
var tokenRecords []*models.TokenRecord
|
var tokenRecords []*models.TokenRecord
|
||||||
err := s.TokenDB(uid).NewSession(c).Cols("uid", "user_token_id", "token_type", "user_agent", "created_unix_time", "expired_unix_time", "last_seen_unix_time").Where("uid=? AND (token_type=? OR token_type=?) AND expired_unix_time>?", uid, core.USER_TOKEN_TYPE_NORMAL, core.USER_TOKEN_TYPE_MCP, now).Find(&tokenRecords)
|
err := s.TokenDB(uid).NewSession(c).Cols("uid", "user_token_id", "token_type", "user_agent", "created_unix_time", "expired_unix_time", "last_seen_unix_time").Where("uid=? AND (token_type=? OR token_type=? OR token_type=?) AND expired_unix_time>?", uid, core.USER_TOKEN_TYPE_NORMAL, core.USER_TOKEN_TYPE_MCP, core.USER_TOKEN_TYPE_API, now).Find(&tokenRecords)
|
||||||
|
|
||||||
return tokenRecords, err
|
return tokenRecords, err
|
||||||
}
|
}
|
||||||
@@ -77,12 +80,6 @@ func (s *TokenService) ParseToken(c core.Context, token string) (*jwt.Token, *co
|
|||||||
return s.parseToken(c, token)
|
return s.parseToken(c, token)
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateTokenViaCli generates a new normal token and saves to database
|
|
||||||
func (s *TokenService) CreateTokenViaCli(c *core.CliContext, user *models.User) (string, *models.TokenRecord, error) {
|
|
||||||
token, _, tokenRecord, err := s.createToken(c, user, core.USER_TOKEN_TYPE_NORMAL, TokenUserAgentCreatedViaCli, "", s.CurrentConfig().TokenExpiredTimeDuration)
|
|
||||||
return token, tokenRecord, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// CreateToken generates a new normal token and saves to database
|
// CreateToken generates a new normal token and saves to database
|
||||||
func (s *TokenService) CreateToken(c *core.WebContext, user *models.User) (string, *core.UserTokenClaims, error) {
|
func (s *TokenService) CreateToken(c *core.WebContext, user *models.User) (string, *core.UserTokenClaims, error) {
|
||||||
token, claims, _, err := s.createToken(c, user, core.USER_TOKEN_TYPE_NORMAL, s.getUserAgent(c), "", s.CurrentConfig().TokenExpiredTimeDuration)
|
token, claims, _, err := s.createToken(c, user, core.USER_TOKEN_TYPE_NORMAL, s.getUserAgent(c), "", s.CurrentConfig().TokenExpiredTimeDuration)
|
||||||
@@ -119,16 +116,58 @@ func (s *TokenService) CreatePasswordResetTokenWithoutUserAgent(c core.Context,
|
|||||||
return token, claims, err
|
return token, claims, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CreateAPIToken generates a new API token and saves to database
|
||||||
|
func (s *TokenService) CreateAPIToken(c *core.WebContext, user *models.User, expiresInSeconds int64) (string, *core.UserTokenClaims, error) {
|
||||||
|
var tokenExpiredTimeDuration time.Duration
|
||||||
|
|
||||||
|
if expiresInSeconds > 0 {
|
||||||
|
tokenExpiredTimeDuration = time.Duration(expiresInSeconds) * time.Second
|
||||||
|
} else {
|
||||||
|
tokenExpiredTimeDuration = time.Unix(tokenMaxExpiredAtUnixTime, 0).Sub(time.Now())
|
||||||
|
}
|
||||||
|
|
||||||
|
token, claims, _, err := s.createToken(c, user, core.USER_TOKEN_TYPE_API, s.getUserAgent(c), "", tokenExpiredTimeDuration)
|
||||||
|
return token, claims, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateAPITokenViaCli generates a new API token and saves to database
|
||||||
|
func (s *TokenService) CreateAPITokenViaCli(c *core.CliContext, user *models.User, expiresInSeconds int64) (string, *models.TokenRecord, error) {
|
||||||
|
var tokenExpiredTimeDuration time.Duration
|
||||||
|
|
||||||
|
if expiresInSeconds > 0 {
|
||||||
|
tokenExpiredTimeDuration = time.Duration(expiresInSeconds) * time.Second
|
||||||
|
} else {
|
||||||
|
tokenExpiredTimeDuration = time.Unix(tokenMaxExpiredAtUnixTime, 0).Sub(time.Now())
|
||||||
|
}
|
||||||
|
|
||||||
|
token, _, tokenRecord, err := s.createToken(c, user, core.USER_TOKEN_TYPE_API, TokenUserAgentCreatedViaCli, "", tokenExpiredTimeDuration)
|
||||||
|
return token, tokenRecord, err
|
||||||
|
}
|
||||||
|
|
||||||
// CreateMCPToken generates a new MCP token and saves to database
|
// CreateMCPToken generates a new MCP token and saves to database
|
||||||
func (s *TokenService) CreateMCPToken(c *core.WebContext, user *models.User) (string, *core.UserTokenClaims, error) {
|
func (s *TokenService) CreateMCPToken(c *core.WebContext, user *models.User, expiresInSeconds int64) (string, *core.UserTokenClaims, error) {
|
||||||
tokenExpiredTimeDuration := time.Unix(tokenMaxExpiredAtUnixTime, 0).Sub(time.Now())
|
var tokenExpiredTimeDuration time.Duration
|
||||||
|
|
||||||
|
if expiresInSeconds > 0 {
|
||||||
|
tokenExpiredTimeDuration = time.Duration(expiresInSeconds) * time.Second
|
||||||
|
} else {
|
||||||
|
tokenExpiredTimeDuration = time.Unix(tokenMaxExpiredAtUnixTime, 0).Sub(time.Now())
|
||||||
|
}
|
||||||
|
|
||||||
token, claims, _, err := s.createToken(c, user, core.USER_TOKEN_TYPE_MCP, s.getUserAgent(c), "", tokenExpiredTimeDuration)
|
token, claims, _, err := s.createToken(c, user, core.USER_TOKEN_TYPE_MCP, s.getUserAgent(c), "", tokenExpiredTimeDuration)
|
||||||
return token, claims, err
|
return token, claims, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateMCPTokenViaCli generates a new MCP token and saves to database
|
// CreateMCPTokenViaCli generates a new MCP token and saves to database
|
||||||
func (s *TokenService) CreateMCPTokenViaCli(c *core.CliContext, user *models.User) (string, *models.TokenRecord, error) {
|
func (s *TokenService) CreateMCPTokenViaCli(c *core.CliContext, user *models.User, expiresInSeconds int64) (string, *models.TokenRecord, error) {
|
||||||
tokenExpiredTimeDuration := time.Unix(tokenMaxExpiredAtUnixTime, 0).Sub(time.Now())
|
var tokenExpiredTimeDuration time.Duration
|
||||||
|
|
||||||
|
if expiresInSeconds > 0 {
|
||||||
|
tokenExpiredTimeDuration = time.Duration(expiresInSeconds) * time.Second
|
||||||
|
} else {
|
||||||
|
tokenExpiredTimeDuration = time.Unix(tokenMaxExpiredAtUnixTime, 0).Sub(time.Now())
|
||||||
|
}
|
||||||
|
|
||||||
token, _, tokenRecord, err := s.createToken(c, user, core.USER_TOKEN_TYPE_MCP, TokenUserAgentCreatedViaCli, "", tokenExpiredTimeDuration)
|
token, _, tokenRecord, err := s.createToken(c, user, core.USER_TOKEN_TYPE_MCP, TokenUserAgentCreatedViaCli, "", tokenExpiredTimeDuration)
|
||||||
return token, tokenRecord, err
|
return token, tokenRecord, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -357,6 +357,7 @@ type Config struct {
|
|||||||
EmailVerifyTokenExpiredTimeDuration time.Duration
|
EmailVerifyTokenExpiredTimeDuration time.Duration
|
||||||
PasswordResetTokenExpiredTime uint32
|
PasswordResetTokenExpiredTime uint32
|
||||||
PasswordResetTokenExpiredTimeDuration time.Duration
|
PasswordResetTokenExpiredTimeDuration time.Duration
|
||||||
|
EnableGenerateAPIToken bool
|
||||||
MaxFailuresPerIpPerMinute uint32
|
MaxFailuresPerIpPerMinute uint32
|
||||||
MaxFailuresPerUserPerMinute uint32
|
MaxFailuresPerUserPerMinute uint32
|
||||||
|
|
||||||
@@ -977,6 +978,8 @@ func loadSecurityConfiguration(config *Config, configFile *ini.File, sectionName
|
|||||||
|
|
||||||
config.PasswordResetTokenExpiredTimeDuration = time.Duration(config.PasswordResetTokenExpiredTime) * time.Second
|
config.PasswordResetTokenExpiredTimeDuration = time.Duration(config.PasswordResetTokenExpiredTime) * time.Second
|
||||||
|
|
||||||
|
config.EnableGenerateAPIToken = getConfigItemBoolValue(configFile, sectionName, "enable_generate_api_token", false)
|
||||||
|
|
||||||
config.MaxFailuresPerIpPerMinute = getConfigItemUint32Value(configFile, sectionName, "max_failures_per_ip_per_minute", defaultMaxFailuresPerIpPerMinute)
|
config.MaxFailuresPerIpPerMinute = getConfigItemUint32Value(configFile, sectionName, "max_failures_per_ip_per_minute", defaultMaxFailuresPerIpPerMinute)
|
||||||
config.MaxFailuresPerUserPerMinute = getConfigItemUint32Value(configFile, sectionName, "max_failures_per_user_per_minute", defaultMaxFailuresPerUserPerMinute)
|
config.MaxFailuresPerUserPerMinute = getConfigItemUint32Value(configFile, sectionName, "max_failures_per_user_per_minute", defaultMaxFailuresPerUserPerMinute)
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ export function isUserForgetPasswordEnabled(): boolean {
|
|||||||
return getServerSetting('f') === 1;
|
return getServerSetting('f') === 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function isGenerateAPITokenEnabled(): boolean {
|
||||||
|
return getServerSetting('t') === 1;
|
||||||
|
}
|
||||||
|
|
||||||
export function isUserVerifyEmailEnabled(): boolean {
|
export function isUserVerifyEmailEnabled(): boolean {
|
||||||
return getServerSetting('v') === 1;
|
return getServerSetting('v') === 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,8 +112,10 @@ import type {
|
|||||||
TransactionTemplateInfoResponse
|
TransactionTemplateInfoResponse
|
||||||
} from '@/models/transaction_template.ts';
|
} from '@/models/transaction_template.ts';
|
||||||
import type {
|
import type {
|
||||||
|
TokenGenerateAPIRequest,
|
||||||
TokenGenerateMCPRequest,
|
TokenGenerateMCPRequest,
|
||||||
TokenRevokeRequest,
|
TokenRevokeRequest,
|
||||||
|
TokenGenerateAPIResponse,
|
||||||
TokenGenerateMCPResponse,
|
TokenGenerateMCPResponse,
|
||||||
TokenRefreshResponse,
|
TokenRefreshResponse,
|
||||||
TokenInfoResponse
|
TokenInfoResponse
|
||||||
@@ -345,6 +347,9 @@ export default {
|
|||||||
getTokens: (): ApiResponsePromise<TokenInfoResponse[]> => {
|
getTokens: (): ApiResponsePromise<TokenInfoResponse[]> => {
|
||||||
return axios.get<ApiResponse<TokenInfoResponse[]>>('v1/tokens/list.json');
|
return axios.get<ApiResponse<TokenInfoResponse[]>>('v1/tokens/list.json');
|
||||||
},
|
},
|
||||||
|
generateAPIToken: (req: TokenGenerateAPIRequest): ApiResponsePromise<TokenGenerateAPIResponse> => {
|
||||||
|
return axios.post<ApiResponse<TokenGenerateAPIResponse>>('v1/tokens/generate/api.json', req);
|
||||||
|
},
|
||||||
generateMCPToken: (req: TokenGenerateMCPRequest): ApiResponsePromise<TokenGenerateMCPResponse> => {
|
generateMCPToken: (req: TokenGenerateMCPRequest): ApiResponsePromise<TokenGenerateMCPResponse> => {
|
||||||
return axios.post<ApiResponse<TokenGenerateMCPResponse>>('v1/tokens/generate/mcp.json', req);
|
return axios.post<ApiResponse<TokenGenerateMCPResponse>>('v1/tokens/generate/mcp.json', req);
|
||||||
},
|
},
|
||||||
|
|||||||
+26
-20
@@ -1,9 +1,10 @@
|
|||||||
import uaParser from 'ua-parser-js';
|
import uaParser from 'ua-parser-js';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
TOKEN_TYPE_MCP,
|
|
||||||
TOKEN_CLI_USER_AGENT,
|
|
||||||
type TokenInfoResponse,
|
type TokenInfoResponse,
|
||||||
|
TOKEN_TYPE_API,
|
||||||
|
TOKEN_TYPE_MCP,
|
||||||
|
SessionDeviceType,
|
||||||
SessionInfo
|
SessionInfo
|
||||||
} from '@/models/token.ts';
|
} from '@/models/token.ts';
|
||||||
|
|
||||||
@@ -43,10 +44,6 @@ function parseUserAgent(ua: string): UserAgentInfo {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function isSessionUserAgentCreatedByCli(ua: string): boolean {
|
|
||||||
return ua === TOKEN_CLI_USER_AGENT;
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseDeviceInfo(uaInfo: UserAgentInfo): string {
|
function parseDeviceInfo(uaInfo: UserAgentInfo): string {
|
||||||
if (!uaInfo) {
|
if (!uaInfo) {
|
||||||
return '';
|
return '';
|
||||||
@@ -86,30 +83,39 @@ function parseDeviceInfo(uaInfo: UserAgentInfo): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function parseSessionInfo(token: TokenInfoResponse): SessionInfo {
|
export function parseSessionInfo(token: TokenInfoResponse): SessionInfo {
|
||||||
|
const isCreateForAPI = token.tokenType === TOKEN_TYPE_API;
|
||||||
const isCreateForMCP = token.tokenType === TOKEN_TYPE_MCP;
|
const isCreateForMCP = token.tokenType === TOKEN_TYPE_MCP;
|
||||||
const isCreatedByCli = isSessionUserAgentCreatedByCli(token.userAgent);
|
|
||||||
const uaInfo = parseUserAgent(token.userAgent);
|
const uaInfo = parseUserAgent(token.userAgent);
|
||||||
let deviceType = '';
|
let deviceType: SessionDeviceType = SessionDeviceType.Default;
|
||||||
|
let deviceName: string = 'Other Device';
|
||||||
|
|
||||||
if (isCreateForMCP) {
|
if (isCreateForAPI) {
|
||||||
deviceType = 'mcp';
|
deviceType = SessionDeviceType.Api;
|
||||||
} else if (isCreatedByCli) {
|
deviceName = 'API Token';
|
||||||
deviceType = 'cli';
|
} else if (isCreateForMCP) {
|
||||||
|
deviceType = SessionDeviceType.MCP;
|
||||||
|
deviceName = 'MCP Token';
|
||||||
} else {
|
} else {
|
||||||
if (uaInfo && uaInfo.device) {
|
if (uaInfo && uaInfo.device) {
|
||||||
if (uaInfo.device.type === 'mobile') {
|
if (uaInfo.device.type === 'mobile') {
|
||||||
deviceType = 'phone';
|
deviceType = SessionDeviceType.Phone;
|
||||||
} else if (uaInfo.device.type === 'wearable') {
|
} else if (uaInfo.device.type === 'wearable') {
|
||||||
deviceType = 'wearable';
|
deviceType = SessionDeviceType.Wearable;
|
||||||
} else if (uaInfo.device.type === 'tablet') {
|
} else if (uaInfo.device.type === 'tablet') {
|
||||||
deviceType = 'tablet';
|
deviceType = SessionDeviceType.Tablet;
|
||||||
} else if (uaInfo.device.type === 'smarttv') {
|
} else if (uaInfo.device.type === 'smarttv') {
|
||||||
deviceType = 'tv';
|
deviceType = SessionDeviceType.TV;
|
||||||
} else {
|
} else {
|
||||||
deviceType = 'default';
|
deviceType = SessionDeviceType.Default;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
deviceType = 'default';
|
deviceType = SessionDeviceType.Default;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (token.isCurrent) {
|
||||||
|
deviceName = 'Current';
|
||||||
|
} else {
|
||||||
|
deviceName = 'Other Device';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,8 +123,8 @@ export function parseSessionInfo(token: TokenInfoResponse): SessionInfo {
|
|||||||
token.tokenId,
|
token.tokenId,
|
||||||
token.isCurrent,
|
token.isCurrent,
|
||||||
deviceType,
|
deviceType,
|
||||||
isCreateForMCP || isCreatedByCli ? token.userAgent : parseDeviceInfo(uaInfo),
|
isCreateForAPI || isCreateForMCP ? token.userAgent : parseDeviceInfo(uaInfo),
|
||||||
isCreatedByCli,
|
deviceName,
|
||||||
token.lastSeen
|
token.lastSeen
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+16
-3
@@ -107,6 +107,10 @@
|
|||||||
"EndYY": "GJ {EndYY}"
|
"EndYY": "GJ {EndYY}"
|
||||||
},
|
},
|
||||||
"misc": {
|
"misc": {
|
||||||
|
"nHour": "{n} Hour",
|
||||||
|
"nHours": "{n} Hours",
|
||||||
|
"nDay": "{n} Day",
|
||||||
|
"nDays": "{n} Days",
|
||||||
"multiTextJoinSeparator": ", ",
|
"multiTextJoinSeparator": ", ",
|
||||||
"loginWithCustomProvider": "Log in with {name}",
|
"loginWithCustomProvider": "Log in with {name}",
|
||||||
"hoursBehindDefaultTimezone": "{hours} Stunde(n) hinter der Standardzeitzone",
|
"hoursBehindDefaultTimezone": "{hours} Stunde(n) hinter der Standardzeitzone",
|
||||||
@@ -1105,6 +1109,7 @@
|
|||||||
"token is empty": "Token ist leer",
|
"token is empty": "Token ist leer",
|
||||||
"email verify token is invalid or expired": "E-Mail-Verifizierungstoken ist ungültig oder abgelaufen",
|
"email verify token is invalid or expired": "E-Mail-Verifizierungstoken ist ungültig oder abgelaufen",
|
||||||
"password reset token is invalid or expired": "Passwort-Zurücksetzungstoken ist ungültig oder abgelaufen",
|
"password reset token is invalid or expired": "Passwort-Zurücksetzungstoken ist ungültig oder abgelaufen",
|
||||||
|
"not allowed to generate api token": "Not allowed to generate API token",
|
||||||
"passcode is invalid": "Passcode ist ungültig",
|
"passcode is invalid": "Passcode ist ungültig",
|
||||||
"two-factor backup code is invalid": "Zwei-Faktor-Backup-Code ist ungültig",
|
"two-factor backup code is invalid": "Zwei-Faktor-Backup-Code ist ungültig",
|
||||||
"two-factor is not enabled": "Zwei-Faktor-Authentifizierung ist nicht aktiviert",
|
"two-factor is not enabled": "Zwei-Faktor-Authentifizierung ist nicht aktiviert",
|
||||||
@@ -1307,7 +1312,8 @@
|
|||||||
"page": "Seitenindex",
|
"page": "Seitenindex",
|
||||||
"count": "Anzahl",
|
"count": "Anzahl",
|
||||||
"templateType": "Vorlagentyp",
|
"templateType": "Vorlagentyp",
|
||||||
"comment": "Beschreibung"
|
"comment": "Beschreibung",
|
||||||
|
"expiredInSeconds": "Expiration Time (Seconds)"
|
||||||
},
|
},
|
||||||
"parameterizedError": {
|
"parameterizedError": {
|
||||||
"parameter invalid": "{parameter} ist ungültig",
|
"parameter invalid": "{parameter} ist ungültig",
|
||||||
@@ -2261,8 +2267,15 @@
|
|||||||
"Show Hidden Transaction Templates": "Versteckte Transaktionsvorlagen anzeigen",
|
"Show Hidden Transaction Templates": "Versteckte Transaktionsvorlagen anzeigen",
|
||||||
"Hide Hidden Transaction Templates": "Versteckte Transaktionsvorlagen ausblenden",
|
"Hide Hidden Transaction Templates": "Versteckte Transaktionsvorlagen ausblenden",
|
||||||
"Template name cannot be blank": "Vorlagenname darf nicht leer sein",
|
"Template name cannot be blank": "Vorlagenname darf nicht leer sein",
|
||||||
"Generate MCP token": "Generate MCP token",
|
"Generate Token": "Generate Token",
|
||||||
"Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
"Token Type": "Token Type",
|
||||||
|
"Expiration Time (Seconds)": "Expiration Time (Seconds)",
|
||||||
|
"Custom Expiration Time (Seconds)": "Custom Expiration Time (Seconds)",
|
||||||
|
"No Expiration": "No Expiration",
|
||||||
|
"API Token": "API Token",
|
||||||
|
"MCP Token": "MCP Token",
|
||||||
|
"Your token does not expire, please keep it secure.": "Your token does not expire, please keep it secure.",
|
||||||
|
"When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
||||||
"Unable to generate token": "Unable to generate token",
|
"Unable to generate token": "Unable to generate token",
|
||||||
"Are you sure you want to logout from this session?": "Sind Sie sicher, dass Sie sich von dieser Sitzung abmelden möchten?",
|
"Are you sure you want to logout from this session?": "Sind Sie sicher, dass Sie sich von dieser Sitzung abmelden möchten?",
|
||||||
"Unable to logout from this session": "Abmeldung von dieser Sitzung nicht möglich",
|
"Unable to logout from this session": "Abmeldung von dieser Sitzung nicht möglich",
|
||||||
|
|||||||
+16
-3
@@ -107,6 +107,10 @@
|
|||||||
"EndYY": "FY {EndYY}"
|
"EndYY": "FY {EndYY}"
|
||||||
},
|
},
|
||||||
"misc": {
|
"misc": {
|
||||||
|
"nHour": "{n} Hour",
|
||||||
|
"nHours": "{n} Hours",
|
||||||
|
"nDay": "{n} Day",
|
||||||
|
"nDays": "{n} Days",
|
||||||
"multiTextJoinSeparator": ", ",
|
"multiTextJoinSeparator": ", ",
|
||||||
"loginWithCustomProvider": "Log in with {name}",
|
"loginWithCustomProvider": "Log in with {name}",
|
||||||
"hoursBehindDefaultTimezone": "{hours} hour(s) behind default timezone",
|
"hoursBehindDefaultTimezone": "{hours} hour(s) behind default timezone",
|
||||||
@@ -1105,6 +1109,7 @@
|
|||||||
"token is empty": "Token is empty",
|
"token is empty": "Token is empty",
|
||||||
"email verify token is invalid or expired": "Email verify token is invalid or expired",
|
"email verify token is invalid or expired": "Email verify token is invalid or expired",
|
||||||
"password reset token is invalid or expired": "Password reset token is invalid or expired",
|
"password reset token is invalid or expired": "Password reset token is invalid or expired",
|
||||||
|
"not allowed to generate api token": "Not allowed to generate API token",
|
||||||
"passcode is invalid": "Passcode is invalid",
|
"passcode is invalid": "Passcode is invalid",
|
||||||
"two-factor backup code is invalid": "Two-factor backup code is invalid",
|
"two-factor backup code is invalid": "Two-factor backup code is invalid",
|
||||||
"two-factor is not enabled": "Two-factor is not enabled",
|
"two-factor is not enabled": "Two-factor is not enabled",
|
||||||
@@ -1307,7 +1312,8 @@
|
|||||||
"page": "Page Index",
|
"page": "Page Index",
|
||||||
"count": "Count",
|
"count": "Count",
|
||||||
"templateType": "Template Type",
|
"templateType": "Template Type",
|
||||||
"comment": "Description"
|
"comment": "Description",
|
||||||
|
"expiredInSeconds": "Expiration Time (Seconds)"
|
||||||
},
|
},
|
||||||
"parameterizedError": {
|
"parameterizedError": {
|
||||||
"parameter invalid": "{parameter} is invalid",
|
"parameter invalid": "{parameter} is invalid",
|
||||||
@@ -2261,8 +2267,15 @@
|
|||||||
"Show Hidden Transaction Templates": "Show Hidden Transaction Templates",
|
"Show Hidden Transaction Templates": "Show Hidden Transaction Templates",
|
||||||
"Hide Hidden Transaction Templates": "Hide Hidden Transaction Templates",
|
"Hide Hidden Transaction Templates": "Hide Hidden Transaction Templates",
|
||||||
"Template name cannot be blank": "Template name cannot be blank",
|
"Template name cannot be blank": "Template name cannot be blank",
|
||||||
"Generate MCP token": "Generate MCP token",
|
"Generate Token": "Generate Token",
|
||||||
"Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
"Token Type": "Token Type",
|
||||||
|
"Expiration Time (Seconds)": "Expiration Time (Seconds)",
|
||||||
|
"Custom Expiration Time (Seconds)": "Custom Expiration Time (Seconds)",
|
||||||
|
"No Expiration": "No Expiration",
|
||||||
|
"API Token": "API Token",
|
||||||
|
"MCP Token": "MCP Token",
|
||||||
|
"Your token does not expire, please keep it secure.": "Your token does not expire, please keep it secure.",
|
||||||
|
"When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
||||||
"Unable to generate token": "Unable to generate token",
|
"Unable to generate token": "Unable to generate token",
|
||||||
"Are you sure you want to logout from this session?": "Are you sure you want to logout from this session?",
|
"Are you sure you want to logout from this session?": "Are you sure you want to logout from this session?",
|
||||||
"Unable to logout from this session": "Unable to logout from this session",
|
"Unable to logout from this session": "Unable to logout from this session",
|
||||||
|
|||||||
+16
-3
@@ -107,6 +107,10 @@
|
|||||||
"EndYY": "Ejercicio {EndYY}"
|
"EndYY": "Ejercicio {EndYY}"
|
||||||
},
|
},
|
||||||
"misc": {
|
"misc": {
|
||||||
|
"nHour": "{n} Hour",
|
||||||
|
"nHours": "{n} Hours",
|
||||||
|
"nDay": "{n} Day",
|
||||||
|
"nDays": "{n} Days",
|
||||||
"multiTextJoinSeparator": ", ",
|
"multiTextJoinSeparator": ", ",
|
||||||
"loginWithCustomProvider": "Log in with {name}",
|
"loginWithCustomProvider": "Log in with {name}",
|
||||||
"hoursBehindDefaultTimezone": "{hours} hora(s) de retraso en la zona horaria predeterminada",
|
"hoursBehindDefaultTimezone": "{hours} hora(s) de retraso en la zona horaria predeterminada",
|
||||||
@@ -1105,6 +1109,7 @@
|
|||||||
"token is empty": "El token está vacío.",
|
"token is empty": "El token está vacío.",
|
||||||
"email verify token is invalid or expired": "El token de verificación de correo electrónico no es válido o ha caducado",
|
"email verify token is invalid or expired": "El token de verificación de correo electrónico no es válido o ha caducado",
|
||||||
"password reset token is invalid or expired": "El token de restablecimiento de contraseña no es válido o ha caducado",
|
"password reset token is invalid or expired": "El token de restablecimiento de contraseña no es válido o ha caducado",
|
||||||
|
"not allowed to generate api token": "Not allowed to generate API token",
|
||||||
"passcode is invalid": "El código de acceso no es válido",
|
"passcode is invalid": "El código de acceso no es válido",
|
||||||
"two-factor backup code is invalid": "El código de respaldo de dos factores no es válido",
|
"two-factor backup code is invalid": "El código de respaldo de dos factores no es válido",
|
||||||
"two-factor is not enabled": "El doble factor no está habilitado",
|
"two-factor is not enabled": "El doble factor no está habilitado",
|
||||||
@@ -1307,7 +1312,8 @@
|
|||||||
"page": "Índice de páginas",
|
"page": "Índice de páginas",
|
||||||
"count": "Contar",
|
"count": "Contar",
|
||||||
"templateType": "Tipo de plantilla",
|
"templateType": "Tipo de plantilla",
|
||||||
"comment": "Descripción"
|
"comment": "Descripción",
|
||||||
|
"expiredInSeconds": "Expiration Time (Seconds)"
|
||||||
},
|
},
|
||||||
"parameterizedError": {
|
"parameterizedError": {
|
||||||
"parameter invalid": "{parameter} no es válido",
|
"parameter invalid": "{parameter} no es válido",
|
||||||
@@ -2261,8 +2267,15 @@
|
|||||||
"Show Hidden Transaction Templates": "Mostrar plantillas de transacciones ocultas",
|
"Show Hidden Transaction Templates": "Mostrar plantillas de transacciones ocultas",
|
||||||
"Hide Hidden Transaction Templates": "Ocultar plantillas de transacciones ocultas",
|
"Hide Hidden Transaction Templates": "Ocultar plantillas de transacciones ocultas",
|
||||||
"Template name cannot be blank": "El nombre de la plantilla no puede estar en blanco",
|
"Template name cannot be blank": "El nombre de la plantilla no puede estar en blanco",
|
||||||
"Generate MCP token": "Generate MCP token",
|
"Generate Token": "Generate Token",
|
||||||
"Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
"Token Type": "Token Type",
|
||||||
|
"Expiration Time (Seconds)": "Expiration Time (Seconds)",
|
||||||
|
"Custom Expiration Time (Seconds)": "Custom Expiration Time (Seconds)",
|
||||||
|
"No Expiration": "No Expiration",
|
||||||
|
"API Token": "API Token",
|
||||||
|
"MCP Token": "MCP Token",
|
||||||
|
"Your token does not expire, please keep it secure.": "Your token does not expire, please keep it secure.",
|
||||||
|
"When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
||||||
"Unable to generate token": "Unable to generate token",
|
"Unable to generate token": "Unable to generate token",
|
||||||
"Are you sure you want to logout from this session?": "¿Está seguro de que desea cerrar sesión en esta sesión?",
|
"Are you sure you want to logout from this session?": "¿Está seguro de que desea cerrar sesión en esta sesión?",
|
||||||
"Unable to logout from this session": "No se puede cerrar sesión en esta sesión",
|
"Unable to logout from this session": "No se puede cerrar sesión en esta sesión",
|
||||||
|
|||||||
+16
-3
@@ -107,6 +107,10 @@
|
|||||||
"EndYY": "Exercice {EndYY}"
|
"EndYY": "Exercice {EndYY}"
|
||||||
},
|
},
|
||||||
"misc": {
|
"misc": {
|
||||||
|
"nHour": "{n} Hour",
|
||||||
|
"nHours": "{n} Hours",
|
||||||
|
"nDay": "{n} Day",
|
||||||
|
"nDays": "{n} Days",
|
||||||
"multiTextJoinSeparator": ", ",
|
"multiTextJoinSeparator": ", ",
|
||||||
"loginWithCustomProvider": "Log in with {name}",
|
"loginWithCustomProvider": "Log in with {name}",
|
||||||
"hoursBehindDefaultTimezone": "{hours} heure(s) de retard sur le fuseau horaire par défaut",
|
"hoursBehindDefaultTimezone": "{hours} heure(s) de retard sur le fuseau horaire par défaut",
|
||||||
@@ -1105,6 +1109,7 @@
|
|||||||
"token is empty": "Le token est vide",
|
"token is empty": "Le token est vide",
|
||||||
"email verify token is invalid or expired": "Le token de vérification d'email est invalide ou expiré",
|
"email verify token is invalid or expired": "Le token de vérification d'email est invalide ou expiré",
|
||||||
"password reset token is invalid or expired": "Le token de réinitialisation de mot de passe est invalide ou expiré",
|
"password reset token is invalid or expired": "Le token de réinitialisation de mot de passe est invalide ou expiré",
|
||||||
|
"not allowed to generate api token": "Not allowed to generate API token",
|
||||||
"passcode is invalid": "Le code d'accès est invalide",
|
"passcode is invalid": "Le code d'accès est invalide",
|
||||||
"two-factor backup code is invalid": "Le code de sauvegarde à deux facteurs est invalide",
|
"two-factor backup code is invalid": "Le code de sauvegarde à deux facteurs est invalide",
|
||||||
"two-factor is not enabled": "L'authentification à deux facteurs n'est pas activée",
|
"two-factor is not enabled": "L'authentification à deux facteurs n'est pas activée",
|
||||||
@@ -1307,7 +1312,8 @@
|
|||||||
"page": "Index de page",
|
"page": "Index de page",
|
||||||
"count": "Nombre",
|
"count": "Nombre",
|
||||||
"templateType": "Type de modèle",
|
"templateType": "Type de modèle",
|
||||||
"comment": "Description"
|
"comment": "Description",
|
||||||
|
"expiredInSeconds": "Expiration Time (Seconds)"
|
||||||
},
|
},
|
||||||
"parameterizedError": {
|
"parameterizedError": {
|
||||||
"parameter invalid": "{parameter} est invalide",
|
"parameter invalid": "{parameter} est invalide",
|
||||||
@@ -2261,8 +2267,15 @@
|
|||||||
"Show Hidden Transaction Templates": "Afficher les modèles de transaction masqués",
|
"Show Hidden Transaction Templates": "Afficher les modèles de transaction masqués",
|
||||||
"Hide Hidden Transaction Templates": "Masquer les modèles de transaction masqués",
|
"Hide Hidden Transaction Templates": "Masquer les modèles de transaction masqués",
|
||||||
"Template name cannot be blank": "Le nom du modèle ne peut pas être vide",
|
"Template name cannot be blank": "Le nom du modèle ne peut pas être vide",
|
||||||
"Generate MCP token": "Générer un jeton MCP",
|
"Generate Token": "Generate Token",
|
||||||
"Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
"Token Type": "Token Type",
|
||||||
|
"Expiration Time (Seconds)": "Expiration Time (Seconds)",
|
||||||
|
"Custom Expiration Time (Seconds)": "Custom Expiration Time (Seconds)",
|
||||||
|
"No Expiration": "No Expiration",
|
||||||
|
"API Token": "API Token",
|
||||||
|
"MCP Token": "MCP Token",
|
||||||
|
"Your token does not expire, please keep it secure.": "Your token does not expire, please keep it secure.",
|
||||||
|
"When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
||||||
"Unable to generate token": "Impossible de générer le jeton",
|
"Unable to generate token": "Impossible de générer le jeton",
|
||||||
"Are you sure you want to logout from this session?": "Êtes-vous sûr de vouloir vous déconnecter de cette session ?",
|
"Are you sure you want to logout from this session?": "Êtes-vous sûr de vouloir vous déconnecter de cette session ?",
|
||||||
"Unable to logout from this session": "Impossible de se déconnecter de cette session",
|
"Unable to logout from this session": "Impossible de se déconnecter de cette session",
|
||||||
|
|||||||
+16
-3
@@ -107,6 +107,10 @@
|
|||||||
"EndYY": "AF {EndYY}"
|
"EndYY": "AF {EndYY}"
|
||||||
},
|
},
|
||||||
"misc": {
|
"misc": {
|
||||||
|
"nHour": "{n} Hour",
|
||||||
|
"nHours": "{n} Hours",
|
||||||
|
"nDay": "{n} Day",
|
||||||
|
"nDays": "{n} Days",
|
||||||
"multiTextJoinSeparator": ", ",
|
"multiTextJoinSeparator": ", ",
|
||||||
"loginWithCustomProvider": "Log in with {name}",
|
"loginWithCustomProvider": "Log in with {name}",
|
||||||
"hoursBehindDefaultTimezone": "Indietro di {hours} ore rispetto al fuso orario standard",
|
"hoursBehindDefaultTimezone": "Indietro di {hours} ore rispetto al fuso orario standard",
|
||||||
@@ -1105,6 +1109,7 @@
|
|||||||
"token is empty": "Token vuoto",
|
"token is empty": "Token vuoto",
|
||||||
"email verify token is invalid or expired": "Il token di verifica email non è valido o è scaduto",
|
"email verify token is invalid or expired": "Il token di verifica email non è valido o è scaduto",
|
||||||
"password reset token is invalid or expired": "Il token di reimpostazione della password non è valido o è scaduto",
|
"password reset token is invalid or expired": "Il token di reimpostazione della password non è valido o è scaduto",
|
||||||
|
"not allowed to generate api token": "Not allowed to generate API token",
|
||||||
"passcode is invalid": "Passcode non valido",
|
"passcode is invalid": "Passcode non valido",
|
||||||
"two-factor backup code is invalid": "Codice di backup a due fattori non valido",
|
"two-factor backup code is invalid": "Codice di backup a due fattori non valido",
|
||||||
"two-factor is not enabled": "L'autenticazione a due fattori non è abilitata",
|
"two-factor is not enabled": "L'autenticazione a due fattori non è abilitata",
|
||||||
@@ -1307,7 +1312,8 @@
|
|||||||
"page": "Indice pagina",
|
"page": "Indice pagina",
|
||||||
"count": "Conteggio",
|
"count": "Conteggio",
|
||||||
"templateType": "Tipo modello",
|
"templateType": "Tipo modello",
|
||||||
"comment": "Descrizione"
|
"comment": "Descrizione",
|
||||||
|
"expiredInSeconds": "Expiration Time (Seconds)"
|
||||||
},
|
},
|
||||||
"parameterizedError": {
|
"parameterizedError": {
|
||||||
"parameter invalid": "{parameter} non è valido",
|
"parameter invalid": "{parameter} non è valido",
|
||||||
@@ -2261,8 +2267,15 @@
|
|||||||
"Show Hidden Transaction Templates": "Mostra modelli transazione nascosti",
|
"Show Hidden Transaction Templates": "Mostra modelli transazione nascosti",
|
||||||
"Hide Hidden Transaction Templates": "Nascondi modelli transazione nascosti",
|
"Hide Hidden Transaction Templates": "Nascondi modelli transazione nascosti",
|
||||||
"Template name cannot be blank": "Il nome del modello non può essere vuoto",
|
"Template name cannot be blank": "Il nome del modello non può essere vuoto",
|
||||||
"Generate MCP token": "Generate MCP token",
|
"Generate Token": "Generate Token",
|
||||||
"Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
"Token Type": "Token Type",
|
||||||
|
"Expiration Time (Seconds)": "Expiration Time (Seconds)",
|
||||||
|
"Custom Expiration Time (Seconds)": "Custom Expiration Time (Seconds)",
|
||||||
|
"No Expiration": "No Expiration",
|
||||||
|
"API Token": "API Token",
|
||||||
|
"MCP Token": "MCP Token",
|
||||||
|
"Your token does not expire, please keep it secure.": "Your token does not expire, please keep it secure.",
|
||||||
|
"When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
||||||
"Unable to generate token": "Unable to generate token",
|
"Unable to generate token": "Unable to generate token",
|
||||||
"Are you sure you want to logout from this session?": "Sei sicuro di voler uscire da questa sessione?",
|
"Are you sure you want to logout from this session?": "Sei sicuro di voler uscire da questa sessione?",
|
||||||
"Unable to logout from this session": "Impossibile uscire da questa sessione",
|
"Unable to logout from this session": "Impossibile uscire da questa sessione",
|
||||||
|
|||||||
+16
-3
@@ -107,6 +107,10 @@
|
|||||||
"EndYY": "{EndYY}年度"
|
"EndYY": "{EndYY}年度"
|
||||||
},
|
},
|
||||||
"misc": {
|
"misc": {
|
||||||
|
"nHour": "{n} Hour",
|
||||||
|
"nHours": "{n} Hours",
|
||||||
|
"nDay": "{n} Day",
|
||||||
|
"nDays": "{n} Days",
|
||||||
"multiTextJoinSeparator": "、",
|
"multiTextJoinSeparator": "、",
|
||||||
"loginWithCustomProvider": "Log in with {name}",
|
"loginWithCustomProvider": "Log in with {name}",
|
||||||
"hoursBehindDefaultTimezone": "デフォルトのタイムゾーンより{hours}時間遅れています",
|
"hoursBehindDefaultTimezone": "デフォルトのタイムゾーンより{hours}時間遅れています",
|
||||||
@@ -1105,6 +1109,7 @@
|
|||||||
"token is empty": "トークンを記入してください",
|
"token is empty": "トークンを記入してください",
|
||||||
"email verify token is invalid or expired": "メール認証トークンが無効または期限切れです",
|
"email verify token is invalid or expired": "メール認証トークンが無効または期限切れです",
|
||||||
"password reset token is invalid or expired": "パスワードリセットトークンが無効または期限切れです",
|
"password reset token is invalid or expired": "パスワードリセットトークンが無効または期限切れです",
|
||||||
|
"not allowed to generate api token": "Not allowed to generate API token",
|
||||||
"passcode is invalid": "パスコードが無効です",
|
"passcode is invalid": "パスコードが無効です",
|
||||||
"two-factor backup code is invalid": "二要素バックアップコードが無効です",
|
"two-factor backup code is invalid": "二要素バックアップコードが無効です",
|
||||||
"two-factor is not enabled": "二要素が有効になっていません",
|
"two-factor is not enabled": "二要素が有効になっていません",
|
||||||
@@ -1307,7 +1312,8 @@
|
|||||||
"page": "ページインデックス",
|
"page": "ページインデックス",
|
||||||
"count": "カウント",
|
"count": "カウント",
|
||||||
"templateType": "テンプレートタイプ",
|
"templateType": "テンプレートタイプ",
|
||||||
"comment": "説明"
|
"comment": "説明",
|
||||||
|
"expiredInSeconds": "Expiration Time (Seconds)"
|
||||||
},
|
},
|
||||||
"parameterizedError": {
|
"parameterizedError": {
|
||||||
"parameter invalid": "{parameter}は無効です",
|
"parameter invalid": "{parameter}は無効です",
|
||||||
@@ -2261,8 +2267,15 @@
|
|||||||
"Show Hidden Transaction Templates": "非表示取引テンプレートを表示します",
|
"Show Hidden Transaction Templates": "非表示取引テンプレートを表示します",
|
||||||
"Hide Hidden Transaction Templates": "非表示取引テンプレートを非表示にします",
|
"Hide Hidden Transaction Templates": "非表示取引テンプレートを非表示にします",
|
||||||
"Template name cannot be blank": "テンプレート名は空欄にできません",
|
"Template name cannot be blank": "テンプレート名は空欄にできません",
|
||||||
"Generate MCP token": "Generate MCP token",
|
"Generate Token": "Generate Token",
|
||||||
"Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
"Token Type": "Token Type",
|
||||||
|
"Expiration Time (Seconds)": "Expiration Time (Seconds)",
|
||||||
|
"Custom Expiration Time (Seconds)": "Custom Expiration Time (Seconds)",
|
||||||
|
"No Expiration": "No Expiration",
|
||||||
|
"API Token": "API Token",
|
||||||
|
"MCP Token": "MCP Token",
|
||||||
|
"Your token does not expire, please keep it secure.": "Your token does not expire, please keep it secure.",
|
||||||
|
"When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
||||||
"Unable to generate token": "Unable to generate token",
|
"Unable to generate token": "Unable to generate token",
|
||||||
"Are you sure you want to logout from this session?": "このセッションからログアウトしますか?",
|
"Are you sure you want to logout from this session?": "このセッションからログアウトしますか?",
|
||||||
"Unable to logout from this session": "このセッションからログアウトできません",
|
"Unable to logout from this session": "このセッションからログアウトできません",
|
||||||
|
|||||||
+16
-3
@@ -107,6 +107,10 @@
|
|||||||
"EndYY": "{EndYY}년도"
|
"EndYY": "{EndYY}년도"
|
||||||
},
|
},
|
||||||
"misc": {
|
"misc": {
|
||||||
|
"nHour": "{n} Hour",
|
||||||
|
"nHours": "{n} Hours",
|
||||||
|
"nDay": "{n} Day",
|
||||||
|
"nDays": "{n} Days",
|
||||||
"multiTextJoinSeparator": ", ",
|
"multiTextJoinSeparator": ", ",
|
||||||
"loginWithCustomProvider": "Log in with {name}",
|
"loginWithCustomProvider": "Log in with {name}",
|
||||||
"hoursBehindDefaultTimezone": "기본 시간대보다 {hours}시간 느립니다",
|
"hoursBehindDefaultTimezone": "기본 시간대보다 {hours}시간 느립니다",
|
||||||
@@ -1105,6 +1109,7 @@
|
|||||||
"token is empty": "토큰이 비어 있습니다",
|
"token is empty": "토큰이 비어 있습니다",
|
||||||
"email verify token is invalid or expired": "이메일 확인 토큰이 유효하지 않거나 만료되었습니다",
|
"email verify token is invalid or expired": "이메일 확인 토큰이 유효하지 않거나 만료되었습니다",
|
||||||
"password reset token is invalid or expired": "비밀번호 재설정 토큰이 유효하지 않거나 만료되었습니다",
|
"password reset token is invalid or expired": "비밀번호 재설정 토큰이 유효하지 않거나 만료되었습니다",
|
||||||
|
"not allowed to generate api token": "Not allowed to generate API token",
|
||||||
"passcode is invalid": "일회용 비밀번호가 유효하지 않습니다",
|
"passcode is invalid": "일회용 비밀번호가 유효하지 않습니다",
|
||||||
"two-factor backup code is invalid": "2단계 백업 코드가 유효하지 않습니다",
|
"two-factor backup code is invalid": "2단계 백업 코드가 유효하지 않습니다",
|
||||||
"two-factor is not enabled": "2단계 인증이 활성화되지 않았습니다",
|
"two-factor is not enabled": "2단계 인증이 활성화되지 않았습니다",
|
||||||
@@ -1307,7 +1312,8 @@
|
|||||||
"page": "페이지 인덱스",
|
"page": "페이지 인덱스",
|
||||||
"count": "개수",
|
"count": "개수",
|
||||||
"templateType": "템플릿 유형",
|
"templateType": "템플릿 유형",
|
||||||
"comment": "설명"
|
"comment": "설명",
|
||||||
|
"expiredInSeconds": "Expiration Time (Seconds)"
|
||||||
},
|
},
|
||||||
"parameterizedError": {
|
"parameterizedError": {
|
||||||
"parameter invalid": "{parameter}가 유효하지 않습니다",
|
"parameter invalid": "{parameter}가 유효하지 않습니다",
|
||||||
@@ -2261,8 +2267,15 @@
|
|||||||
"Show Hidden Transaction Templates": "숨겨진 거래 템플릿 표시",
|
"Show Hidden Transaction Templates": "숨겨진 거래 템플릿 표시",
|
||||||
"Hide Hidden Transaction Templates": "숨겨진 거래 템플릿 숨기기",
|
"Hide Hidden Transaction Templates": "숨겨진 거래 템플릿 숨기기",
|
||||||
"Template name cannot be blank": "템플릿 이름은 비워둘 수 없습니다.",
|
"Template name cannot be blank": "템플릿 이름은 비워둘 수 없습니다.",
|
||||||
"Generate MCP token": "MCP 토큰 생성",
|
"Generate Token": "Generate Token",
|
||||||
"Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
"Token Type": "Token Type",
|
||||||
|
"Expiration Time (Seconds)": "Expiration Time (Seconds)",
|
||||||
|
"Custom Expiration Time (Seconds)": "Custom Expiration Time (Seconds)",
|
||||||
|
"No Expiration": "No Expiration",
|
||||||
|
"API Token": "API Token",
|
||||||
|
"MCP Token": "MCP Token",
|
||||||
|
"Your token does not expire, please keep it secure.": "Your token does not expire, please keep it secure.",
|
||||||
|
"When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
||||||
"Unable to generate token": "토큰을 생성할 수 없습니다.",
|
"Unable to generate token": "토큰을 생성할 수 없습니다.",
|
||||||
"Are you sure you want to logout from this session?": "이 세션에서 로그아웃하시겠습니까?",
|
"Are you sure you want to logout from this session?": "이 세션에서 로그아웃하시겠습니까?",
|
||||||
"Unable to logout from this session": "이 세션에서 로그아웃할 수 없습니다.",
|
"Unable to logout from this session": "이 세션에서 로그아웃할 수 없습니다.",
|
||||||
|
|||||||
+16
-3
@@ -107,6 +107,10 @@
|
|||||||
"EndYY": "Boekjaar {EndYY}"
|
"EndYY": "Boekjaar {EndYY}"
|
||||||
},
|
},
|
||||||
"misc": {
|
"misc": {
|
||||||
|
"nHour": "{n} Hour",
|
||||||
|
"nHours": "{n} Hours",
|
||||||
|
"nDay": "{n} Day",
|
||||||
|
"nDays": "{n} Days",
|
||||||
"multiTextJoinSeparator": ", ",
|
"multiTextJoinSeparator": ", ",
|
||||||
"loginWithCustomProvider": "Log in with {name}",
|
"loginWithCustomProvider": "Log in with {name}",
|
||||||
"hoursBehindDefaultTimezone": "{hours} uur achter standaardtijdzone",
|
"hoursBehindDefaultTimezone": "{hours} uur achter standaardtijdzone",
|
||||||
@@ -1105,6 +1109,7 @@
|
|||||||
"token is empty": "Token is leeg",
|
"token is empty": "Token is leeg",
|
||||||
"email verify token is invalid or expired": "E-mailverificatietoken is ongeldig of verlopen",
|
"email verify token is invalid or expired": "E-mailverificatietoken is ongeldig of verlopen",
|
||||||
"password reset token is invalid or expired": "Wachtwoord-resettoken is ongeldig of verlopen",
|
"password reset token is invalid or expired": "Wachtwoord-resettoken is ongeldig of verlopen",
|
||||||
|
"not allowed to generate api token": "Not allowed to generate API token",
|
||||||
"passcode is invalid": "Verificatiecode is ongeldig",
|
"passcode is invalid": "Verificatiecode is ongeldig",
|
||||||
"two-factor backup code is invalid": "Back-upcode voor twee-stapsverificatie is ongeldig",
|
"two-factor backup code is invalid": "Back-upcode voor twee-stapsverificatie is ongeldig",
|
||||||
"two-factor is not enabled": "Twee-stapsverificatie is niet ingeschakeld",
|
"two-factor is not enabled": "Twee-stapsverificatie is niet ingeschakeld",
|
||||||
@@ -1307,7 +1312,8 @@
|
|||||||
"page": "Paginanummer",
|
"page": "Paginanummer",
|
||||||
"count": "Aantal",
|
"count": "Aantal",
|
||||||
"templateType": "Sjabloontype",
|
"templateType": "Sjabloontype",
|
||||||
"comment": "Beschrijving"
|
"comment": "Beschrijving",
|
||||||
|
"expiredInSeconds": "Expiration Time (Seconds)"
|
||||||
},
|
},
|
||||||
"parameterizedError": {
|
"parameterizedError": {
|
||||||
"parameter invalid": "{parameter} is ongeldig",
|
"parameter invalid": "{parameter} is ongeldig",
|
||||||
@@ -2261,8 +2267,15 @@
|
|||||||
"Show Hidden Transaction Templates": "Verborgen transactiesjablonen tonen",
|
"Show Hidden Transaction Templates": "Verborgen transactiesjablonen tonen",
|
||||||
"Hide Hidden Transaction Templates": "Verborgen transactiesjablonen verbergen",
|
"Hide Hidden Transaction Templates": "Verborgen transactiesjablonen verbergen",
|
||||||
"Template name cannot be blank": "Sjabloonnaam mag niet leeg zijn",
|
"Template name cannot be blank": "Sjabloonnaam mag niet leeg zijn",
|
||||||
"Generate MCP token": "MCP-token genereren",
|
"Generate Token": "Generate Token",
|
||||||
"Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
"Token Type": "Token Type",
|
||||||
|
"Expiration Time (Seconds)": "Expiration Time (Seconds)",
|
||||||
|
"Custom Expiration Time (Seconds)": "Custom Expiration Time (Seconds)",
|
||||||
|
"No Expiration": "No Expiration",
|
||||||
|
"API Token": "API Token",
|
||||||
|
"MCP Token": "MCP Token",
|
||||||
|
"Your token does not expire, please keep it secure.": "Your token does not expire, please keep it secure.",
|
||||||
|
"When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
||||||
"Unable to generate token": "Kan token niet genereren",
|
"Unable to generate token": "Kan token niet genereren",
|
||||||
"Are you sure you want to logout from this session?": "Weet je zeker dat je deze sessie wilt uitloggen?",
|
"Are you sure you want to logout from this session?": "Weet je zeker dat je deze sessie wilt uitloggen?",
|
||||||
"Unable to logout from this session": "Kan niet uitloggen uit deze sessie",
|
"Unable to logout from this session": "Kan niet uitloggen uit deze sessie",
|
||||||
|
|||||||
+16
-3
@@ -107,6 +107,10 @@
|
|||||||
"EndYY": "AF {EndYY}"
|
"EndYY": "AF {EndYY}"
|
||||||
},
|
},
|
||||||
"misc": {
|
"misc": {
|
||||||
|
"nHour": "{n} Hour",
|
||||||
|
"nHours": "{n} Hours",
|
||||||
|
"nDay": "{n} Day",
|
||||||
|
"nDays": "{n} Days",
|
||||||
"multiTextJoinSeparator": ", ",
|
"multiTextJoinSeparator": ", ",
|
||||||
"loginWithCustomProvider": "Log in with {name}",
|
"loginWithCustomProvider": "Log in with {name}",
|
||||||
"hoursBehindDefaultTimezone": "{hours} hora(s) atrás do fuso horário padrão",
|
"hoursBehindDefaultTimezone": "{hours} hora(s) atrás do fuso horário padrão",
|
||||||
@@ -1105,6 +1109,7 @@
|
|||||||
"token is empty": "Token está vazio",
|
"token is empty": "Token está vazio",
|
||||||
"email verify token is invalid or expired": "O token de verificação de e-mail é inválido ou expirado",
|
"email verify token is invalid or expired": "O token de verificação de e-mail é inválido ou expirado",
|
||||||
"password reset token is invalid or expired": "O token de redefinição de senha é inválido ou expirado",
|
"password reset token is invalid or expired": "O token de redefinição de senha é inválido ou expirado",
|
||||||
|
"not allowed to generate api token": "Not allowed to generate API token",
|
||||||
"passcode is invalid": "Código é inválido",
|
"passcode is invalid": "Código é inválido",
|
||||||
"two-factor backup code is invalid": "Código de backup de duas etapas é inválido",
|
"two-factor backup code is invalid": "Código de backup de duas etapas é inválido",
|
||||||
"two-factor is not enabled": "Autenticação em duas etapas não está ativada",
|
"two-factor is not enabled": "Autenticação em duas etapas não está ativada",
|
||||||
@@ -1307,7 +1312,8 @@
|
|||||||
"page": "Índice da Página",
|
"page": "Índice da Página",
|
||||||
"count": "Quantidade",
|
"count": "Quantidade",
|
||||||
"templateType": "Tipo de Modelo",
|
"templateType": "Tipo de Modelo",
|
||||||
"comment": "Descrição"
|
"comment": "Descrição",
|
||||||
|
"expiredInSeconds": "Expiration Time (Seconds)"
|
||||||
},
|
},
|
||||||
"parameterizedError": {
|
"parameterizedError": {
|
||||||
"parameter invalid": "{parameter} é inválido",
|
"parameter invalid": "{parameter} é inválido",
|
||||||
@@ -2261,8 +2267,15 @@
|
|||||||
"Show Hidden Transaction Templates": "Mostrar Modelos de Transação Ocultos",
|
"Show Hidden Transaction Templates": "Mostrar Modelos de Transação Ocultos",
|
||||||
"Hide Hidden Transaction Templates": "Ocultar Modelos de Transação Ocultos",
|
"Hide Hidden Transaction Templates": "Ocultar Modelos de Transação Ocultos",
|
||||||
"Template name cannot be blank": "O nome do modelo não pode estar em branco",
|
"Template name cannot be blank": "O nome do modelo não pode estar em branco",
|
||||||
"Generate MCP token": "Generate MCP token",
|
"Generate Token": "Generate Token",
|
||||||
"Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
"Token Type": "Token Type",
|
||||||
|
"Expiration Time (Seconds)": "Expiration Time (Seconds)",
|
||||||
|
"Custom Expiration Time (Seconds)": "Custom Expiration Time (Seconds)",
|
||||||
|
"No Expiration": "No Expiration",
|
||||||
|
"API Token": "API Token",
|
||||||
|
"MCP Token": "MCP Token",
|
||||||
|
"Your token does not expire, please keep it secure.": "Your token does not expire, please keep it secure.",
|
||||||
|
"When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
||||||
"Unable to generate token": "Unable to generate token",
|
"Unable to generate token": "Unable to generate token",
|
||||||
"Are you sure you want to logout from this session?": "Tem certeza de que deseja sair desta sessão?",
|
"Are you sure you want to logout from this session?": "Tem certeza de que deseja sair desta sessão?",
|
||||||
"Unable to logout from this session": "Não foi possível sair desta sessão",
|
"Unable to logout from this session": "Não foi possível sair desta sessão",
|
||||||
|
|||||||
+16
-3
@@ -107,6 +107,10 @@
|
|||||||
"EndYY": "ФГ {EndYY}"
|
"EndYY": "ФГ {EndYY}"
|
||||||
},
|
},
|
||||||
"misc": {
|
"misc": {
|
||||||
|
"nHour": "{n} Hour",
|
||||||
|
"nHours": "{n} Hours",
|
||||||
|
"nDay": "{n} Day",
|
||||||
|
"nDays": "{n} Days",
|
||||||
"multiTextJoinSeparator": ", ",
|
"multiTextJoinSeparator": ", ",
|
||||||
"loginWithCustomProvider": "Log in with {name}",
|
"loginWithCustomProvider": "Log in with {name}",
|
||||||
"hoursBehindDefaultTimezone": "{hours} час(ов) позади часового пояса по умолчанию",
|
"hoursBehindDefaultTimezone": "{hours} час(ов) позади часового пояса по умолчанию",
|
||||||
@@ -1105,6 +1109,7 @@
|
|||||||
"token is empty": "Токен пуст",
|
"token is empty": "Токен пуст",
|
||||||
"email verify token is invalid or expired": "Токен подтверждения электронной почты недействителен или истек",
|
"email verify token is invalid or expired": "Токен подтверждения электронной почты недействителен или истек",
|
||||||
"password reset token is invalid or expired": "Токен сброса пароля недействителен или истек",
|
"password reset token is invalid or expired": "Токен сброса пароля недействителен или истек",
|
||||||
|
"not allowed to generate api token": "Not allowed to generate API token",
|
||||||
"passcode is invalid": "Код доступа недействителен",
|
"passcode is invalid": "Код доступа недействителен",
|
||||||
"two-factor backup code is invalid": "Резервный код двухфакторной аутентификации недействителен",
|
"two-factor backup code is invalid": "Резервный код двухфакторной аутентификации недействителен",
|
||||||
"two-factor is not enabled": "Двухфакторная аутентификация не включена",
|
"two-factor is not enabled": "Двухфакторная аутентификация не включена",
|
||||||
@@ -1307,7 +1312,8 @@
|
|||||||
"page": "Индекс страницы",
|
"page": "Индекс страницы",
|
||||||
"count": "Количество",
|
"count": "Количество",
|
||||||
"templateType": "Тип шаблона",
|
"templateType": "Тип шаблона",
|
||||||
"comment": "Описание"
|
"comment": "Описание",
|
||||||
|
"expiredInSeconds": "Expiration Time (Seconds)"
|
||||||
},
|
},
|
||||||
"parameterizedError": {
|
"parameterizedError": {
|
||||||
"parameter invalid": "{parameter} недействителен",
|
"parameter invalid": "{parameter} недействителен",
|
||||||
@@ -2261,8 +2267,15 @@
|
|||||||
"Show Hidden Transaction Templates": "Показать скрытые шаблоны транзакций",
|
"Show Hidden Transaction Templates": "Показать скрытые шаблоны транзакций",
|
||||||
"Hide Hidden Transaction Templates": "Скрыть скрытые шаблоны транзакций",
|
"Hide Hidden Transaction Templates": "Скрыть скрытые шаблоны транзакций",
|
||||||
"Template name cannot be blank": "Название шаблона не может быть пустым",
|
"Template name cannot be blank": "Название шаблона не может быть пустым",
|
||||||
"Generate MCP token": "Generate MCP token",
|
"Generate Token": "Generate Token",
|
||||||
"Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
"Token Type": "Token Type",
|
||||||
|
"Expiration Time (Seconds)": "Expiration Time (Seconds)",
|
||||||
|
"Custom Expiration Time (Seconds)": "Custom Expiration Time (Seconds)",
|
||||||
|
"No Expiration": "No Expiration",
|
||||||
|
"API Token": "API Token",
|
||||||
|
"MCP Token": "MCP Token",
|
||||||
|
"Your token does not expire, please keep it secure.": "Your token does not expire, please keep it secure.",
|
||||||
|
"When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
||||||
"Unable to generate token": "Unable to generate token",
|
"Unable to generate token": "Unable to generate token",
|
||||||
"Are you sure you want to logout from this session?": "Вы уверены, что хотите выйти из этой сессии?",
|
"Are you sure you want to logout from this session?": "Вы уверены, что хотите выйти из этой сессии?",
|
||||||
"Unable to logout from this session": "Не удалось выйти из этой сессии",
|
"Unable to logout from this session": "Не удалось выйти из этой сессии",
|
||||||
|
|||||||
+16
-3
@@ -107,6 +107,10 @@
|
|||||||
"EndYY": "ปีงบประมาณ {EndYY}"
|
"EndYY": "ปีงบประมาณ {EndYY}"
|
||||||
},
|
},
|
||||||
"misc": {
|
"misc": {
|
||||||
|
"nHour": "{n} Hour",
|
||||||
|
"nHours": "{n} Hours",
|
||||||
|
"nDay": "{n} Day",
|
||||||
|
"nDays": "{n} Days",
|
||||||
"multiTextJoinSeparator": ", ",
|
"multiTextJoinSeparator": ", ",
|
||||||
"loginWithCustomProvider": "Log in with {name}",
|
"loginWithCustomProvider": "Log in with {name}",
|
||||||
"hoursBehindDefaultTimezone": "ช้ากว่าเขตเวลาเริ่มต้น {hours} ชั่วโมง",
|
"hoursBehindDefaultTimezone": "ช้ากว่าเขตเวลาเริ่มต้น {hours} ชั่วโมง",
|
||||||
@@ -1105,6 +1109,7 @@
|
|||||||
"token is empty": "โทเค็นว่างเปล่า",
|
"token is empty": "โทเค็นว่างเปล่า",
|
||||||
"email verify token is invalid or expired": "โทเค็นยืนยันอีเมลไม่ถูกต้องหรือหมดอายุ",
|
"email verify token is invalid or expired": "โทเค็นยืนยันอีเมลไม่ถูกต้องหรือหมดอายุ",
|
||||||
"password reset token is invalid or expired": "โทเค็นรีเซ็ตรหัสผ่านไม่ถูกต้องหรือหมดอายุ",
|
"password reset token is invalid or expired": "โทเค็นรีเซ็ตรหัสผ่านไม่ถูกต้องหรือหมดอายุ",
|
||||||
|
"not allowed to generate api token": "Not allowed to generate API token",
|
||||||
"passcode is invalid": "รหัสผ่านชั่วคราวไม่ถูกต้อง",
|
"passcode is invalid": "รหัสผ่านชั่วคราวไม่ถูกต้อง",
|
||||||
"two-factor backup code is invalid": "รหัสสำรองสองขั้นตอนไม่ถูกต้อง",
|
"two-factor backup code is invalid": "รหัสสำรองสองขั้นตอนไม่ถูกต้อง",
|
||||||
"two-factor is not enabled": "ยังไม่ได้เปิดใช้งานการยืนยันสองขั้นตอน",
|
"two-factor is not enabled": "ยังไม่ได้เปิดใช้งานการยืนยันสองขั้นตอน",
|
||||||
@@ -1307,7 +1312,8 @@
|
|||||||
"page": "ดัชนีหน้า",
|
"page": "ดัชนีหน้า",
|
||||||
"count": "จำนวน",
|
"count": "จำนวน",
|
||||||
"templateType": "ประเภทแม่แบบ",
|
"templateType": "ประเภทแม่แบบ",
|
||||||
"comment": "คำอธิบาย"
|
"comment": "คำอธิบาย",
|
||||||
|
"expiredInSeconds": "Expiration Time (Seconds)"
|
||||||
},
|
},
|
||||||
"parameterizedError": {
|
"parameterizedError": {
|
||||||
"parameter invalid": "{parameter} ไม่ถูกต้อง",
|
"parameter invalid": "{parameter} ไม่ถูกต้อง",
|
||||||
@@ -2261,8 +2267,15 @@
|
|||||||
"Show Hidden Transaction Templates": "แสดงแม่แบบรายการที่ซ่อนอยู่",
|
"Show Hidden Transaction Templates": "แสดงแม่แบบรายการที่ซ่อนอยู่",
|
||||||
"Hide Hidden Transaction Templates": "ซ่อนแม่แบบรายการที่ซ่อนอยู่",
|
"Hide Hidden Transaction Templates": "ซ่อนแม่แบบรายการที่ซ่อนอยู่",
|
||||||
"Template name cannot be blank": "ชื่อแม่แบบไม่สามารถเว้นว่างได้",
|
"Template name cannot be blank": "ชื่อแม่แบบไม่สามารถเว้นว่างได้",
|
||||||
"Generate MCP token": "สร้างโทเคน MCP",
|
"Generate Token": "Generate Token",
|
||||||
"Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
"Token Type": "Token Type",
|
||||||
|
"Expiration Time (Seconds)": "Expiration Time (Seconds)",
|
||||||
|
"Custom Expiration Time (Seconds)": "Custom Expiration Time (Seconds)",
|
||||||
|
"No Expiration": "No Expiration",
|
||||||
|
"API Token": "API Token",
|
||||||
|
"MCP Token": "MCP Token",
|
||||||
|
"Your token does not expire, please keep it secure.": "Your token does not expire, please keep it secure.",
|
||||||
|
"When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
||||||
"Unable to generate token": "ไม่สามารถสร้างโทเคนได้",
|
"Unable to generate token": "ไม่สามารถสร้างโทเคนได้",
|
||||||
"Are you sure you want to logout from this session?": "คุณแน่ใจหรือว่าต้องการออกจากระบบเซสชันนี้?",
|
"Are you sure you want to logout from this session?": "คุณแน่ใจหรือว่าต้องการออกจากระบบเซสชันนี้?",
|
||||||
"Unable to logout from this session": "ไม่สามารถออกจากระบบเซสชันนี้ได้",
|
"Unable to logout from this session": "ไม่สามารถออกจากระบบเซสชันนี้ได้",
|
||||||
|
|||||||
+16
-3
@@ -107,6 +107,10 @@
|
|||||||
"EndYY": "{EndYY} фінансовий рік"
|
"EndYY": "{EndYY} фінансовий рік"
|
||||||
},
|
},
|
||||||
"misc": {
|
"misc": {
|
||||||
|
"nHour": "{n} Hour",
|
||||||
|
"nHours": "{n} Hours",
|
||||||
|
"nDay": "{n} Day",
|
||||||
|
"nDays": "{n} Days",
|
||||||
"multiTextJoinSeparator": ", ",
|
"multiTextJoinSeparator": ", ",
|
||||||
"loginWithCustomProvider": "Log in with {name}",
|
"loginWithCustomProvider": "Log in with {name}",
|
||||||
"hoursBehindDefaultTimezone": "{hours} год позаду часового поясу за замовчуванням",
|
"hoursBehindDefaultTimezone": "{hours} год позаду часового поясу за замовчуванням",
|
||||||
@@ -1105,6 +1109,7 @@
|
|||||||
"token is empty": "Токен порожній",
|
"token is empty": "Токен порожній",
|
||||||
"email verify token is invalid or expired": "Токен підтвердження електронної пошти недійсний або прострочений",
|
"email verify token is invalid or expired": "Токен підтвердження електронної пошти недійсний або прострочений",
|
||||||
"password reset token is invalid or expired": "Токен скидання пароля недійсний або прострочений",
|
"password reset token is invalid or expired": "Токен скидання пароля недійсний або прострочений",
|
||||||
|
"not allowed to generate api token": "Not allowed to generate API token",
|
||||||
"passcode is invalid": "Код доступу недійсний",
|
"passcode is invalid": "Код доступу недійсний",
|
||||||
"two-factor backup code is invalid": "Резервний код двофакторної автентифікації недійсний",
|
"two-factor backup code is invalid": "Резервний код двофакторної автентифікації недійсний",
|
||||||
"two-factor is not enabled": "Двофакторна автентифікація не увімкнена",
|
"two-factor is not enabled": "Двофакторна автентифікація не увімкнена",
|
||||||
@@ -1307,7 +1312,8 @@
|
|||||||
"page": "Номер сторінки",
|
"page": "Номер сторінки",
|
||||||
"count": "Кількість",
|
"count": "Кількість",
|
||||||
"templateType": "Тип шаблону",
|
"templateType": "Тип шаблону",
|
||||||
"comment": "Опис"
|
"comment": "Опис",
|
||||||
|
"expiredInSeconds": "Expiration Time (Seconds)"
|
||||||
},
|
},
|
||||||
"parameterizedError": {
|
"parameterizedError": {
|
||||||
"parameter invalid": "{parameter} недійсний",
|
"parameter invalid": "{parameter} недійсний",
|
||||||
@@ -2261,8 +2267,15 @@
|
|||||||
"Show Hidden Transaction Templates": "Показати приховані шаблони транзакцій",
|
"Show Hidden Transaction Templates": "Показати приховані шаблони транзакцій",
|
||||||
"Hide Hidden Transaction Templates": "Приховати приховані шаблони транзакцій",
|
"Hide Hidden Transaction Templates": "Приховати приховані шаблони транзакцій",
|
||||||
"Template name cannot be blank": "Назва шаблону не може бути порожньою",
|
"Template name cannot be blank": "Назва шаблону не може бути порожньою",
|
||||||
"Generate MCP token": "Generate MCP token",
|
"Generate Token": "Generate Token",
|
||||||
"Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
"Token Type": "Token Type",
|
||||||
|
"Expiration Time (Seconds)": "Expiration Time (Seconds)",
|
||||||
|
"Custom Expiration Time (Seconds)": "Custom Expiration Time (Seconds)",
|
||||||
|
"No Expiration": "No Expiration",
|
||||||
|
"API Token": "API Token",
|
||||||
|
"MCP Token": "MCP Token",
|
||||||
|
"Your token does not expire, please keep it secure.": "Your token does not expire, please keep it secure.",
|
||||||
|
"When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
||||||
"Unable to generate token": "Unable to generate token",
|
"Unable to generate token": "Unable to generate token",
|
||||||
"Are you sure you want to logout from this session?": "Ви впевнені, що хочете вийти з цієї сесії?",
|
"Are you sure you want to logout from this session?": "Ви впевнені, що хочете вийти з цієї сесії?",
|
||||||
"Unable to logout from this session": "Не вдалося вийти з цієї сесії",
|
"Unable to logout from this session": "Не вдалося вийти з цієї сесії",
|
||||||
|
|||||||
+16
-3
@@ -107,6 +107,10 @@
|
|||||||
"EndYY": "FY {EndYY}"
|
"EndYY": "FY {EndYY}"
|
||||||
},
|
},
|
||||||
"misc": {
|
"misc": {
|
||||||
|
"nHour": "{n} Hour",
|
||||||
|
"nHours": "{n} Hours",
|
||||||
|
"nDay": "{n} Day",
|
||||||
|
"nDays": "{n} Days",
|
||||||
"multiTextJoinSeparator": ", ",
|
"multiTextJoinSeparator": ", ",
|
||||||
"loginWithCustomProvider": "Log in with {name}",
|
"loginWithCustomProvider": "Log in with {name}",
|
||||||
"hoursBehindDefaultTimezone": "{hours} giờ sau múi giờ mặc định",
|
"hoursBehindDefaultTimezone": "{hours} giờ sau múi giờ mặc định",
|
||||||
@@ -1105,6 +1109,7 @@
|
|||||||
"token is empty": "Mã thông báo trống",
|
"token is empty": "Mã thông báo trống",
|
||||||
"email verify token is invalid or expired": "Mã thông báo xác minh email không hợp lệ hoặc đã hết hạn",
|
"email verify token is invalid or expired": "Mã thông báo xác minh email không hợp lệ hoặc đã hết hạn",
|
||||||
"password reset token is invalid or expired": "Mã thông báo đặt lại mật khẩu không hợp lệ hoặc đã hết hạn",
|
"password reset token is invalid or expired": "Mã thông báo đặt lại mật khẩu không hợp lệ hoặc đã hết hạn",
|
||||||
|
"not allowed to generate api token": "Not allowed to generate API token",
|
||||||
"passcode is invalid": "Mã số không hợp lệ",
|
"passcode is invalid": "Mã số không hợp lệ",
|
||||||
"two-factor backup code is invalid": "Mã sao lưu hai yếu tố không hợp lệ",
|
"two-factor backup code is invalid": "Mã sao lưu hai yếu tố không hợp lệ",
|
||||||
"two-factor is not enabled": "Xác thực hai yếu tố chưa được bật",
|
"two-factor is not enabled": "Xác thực hai yếu tố chưa được bật",
|
||||||
@@ -1307,7 +1312,8 @@
|
|||||||
"page": "Chỉ số trang",
|
"page": "Chỉ số trang",
|
||||||
"count": "Số lượng",
|
"count": "Số lượng",
|
||||||
"templateType": "Loại mẫu",
|
"templateType": "Loại mẫu",
|
||||||
"comment": "Mô tả"
|
"comment": "Mô tả",
|
||||||
|
"expiredInSeconds": "Expiration Time (Seconds)"
|
||||||
},
|
},
|
||||||
"parameterizedError": {
|
"parameterizedError": {
|
||||||
"parameter invalid": "{parameter} không hợp lệ",
|
"parameter invalid": "{parameter} không hợp lệ",
|
||||||
@@ -2261,8 +2267,15 @@
|
|||||||
"Show Hidden Transaction Templates": "Hiển thị mẫu giao dịch ẩn",
|
"Show Hidden Transaction Templates": "Hiển thị mẫu giao dịch ẩn",
|
||||||
"Hide Hidden Transaction Templates": "Ẩn mẫu giao dịch ẩn",
|
"Hide Hidden Transaction Templates": "Ẩn mẫu giao dịch ẩn",
|
||||||
"Template name cannot be blank": "Tên mẫu không được để trống",
|
"Template name cannot be blank": "Tên mẫu không được để trống",
|
||||||
"Generate MCP token": "Generate MCP token",
|
"Generate Token": "Generate Token",
|
||||||
"Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
"Token Type": "Token Type",
|
||||||
|
"Expiration Time (Seconds)": "Expiration Time (Seconds)",
|
||||||
|
"Custom Expiration Time (Seconds)": "Custom Expiration Time (Seconds)",
|
||||||
|
"No Expiration": "No Expiration",
|
||||||
|
"API Token": "API Token",
|
||||||
|
"MCP Token": "MCP Token",
|
||||||
|
"Your token does not expire, please keep it secure.": "Your token does not expire, please keep it secure.",
|
||||||
|
"When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "When connecting to third-party apps, be aware that they and any large language models they use can access your private data.",
|
||||||
"Unable to generate token": "Unable to generate token",
|
"Unable to generate token": "Unable to generate token",
|
||||||
"Are you sure you want to logout from this session?": "Bạn có chắc chắn muốn đăng xuất khỏi phiên này không?",
|
"Are you sure you want to logout from this session?": "Bạn có chắc chắn muốn đăng xuất khỏi phiên này không?",
|
||||||
"Unable to logout from this session": "Không thể đăng xuất khỏi phiên này",
|
"Unable to logout from this session": "Không thể đăng xuất khỏi phiên này",
|
||||||
|
|||||||
@@ -107,6 +107,10 @@
|
|||||||
"EndYY": "{EndYY}财年"
|
"EndYY": "{EndYY}财年"
|
||||||
},
|
},
|
||||||
"misc": {
|
"misc": {
|
||||||
|
"nHour": "{n} 小时",
|
||||||
|
"nHours": "{n} 小时",
|
||||||
|
"nDay": "{n} 天",
|
||||||
|
"nDays": "{n} 天",
|
||||||
"multiTextJoinSeparator": "、",
|
"multiTextJoinSeparator": "、",
|
||||||
"loginWithCustomProvider": "使用 {name} 登录",
|
"loginWithCustomProvider": "使用 {name} 登录",
|
||||||
"hoursBehindDefaultTimezone": "比默认时区晚{hours}小时",
|
"hoursBehindDefaultTimezone": "比默认时区晚{hours}小时",
|
||||||
@@ -1105,6 +1109,7 @@
|
|||||||
"token is empty": "认证令牌为空",
|
"token is empty": "认证令牌为空",
|
||||||
"email verify token is invalid or expired": "邮箱验证令牌无效或已过期",
|
"email verify token is invalid or expired": "邮箱验证令牌无效或已过期",
|
||||||
"password reset token is invalid or expired": "密码重置令牌无效或已过期",
|
"password reset token is invalid or expired": "密码重置令牌无效或已过期",
|
||||||
|
"not allowed to generate api token": "不允许生成 API 认证令牌",
|
||||||
"passcode is invalid": "验证码无效",
|
"passcode is invalid": "验证码无效",
|
||||||
"two-factor backup code is invalid": "两步验证备用码无效",
|
"two-factor backup code is invalid": "两步验证备用码无效",
|
||||||
"two-factor is not enabled": "两步验证没有启用",
|
"two-factor is not enabled": "两步验证没有启用",
|
||||||
@@ -1307,7 +1312,8 @@
|
|||||||
"page": "页码索引",
|
"page": "页码索引",
|
||||||
"count": "数量",
|
"count": "数量",
|
||||||
"templateType": "模板类型",
|
"templateType": "模板类型",
|
||||||
"comment": "描述"
|
"comment": "描述",
|
||||||
|
"expiredInSeconds": "过期时间(秒)"
|
||||||
},
|
},
|
||||||
"parameterizedError": {
|
"parameterizedError": {
|
||||||
"parameter invalid": "{parameter}无效",
|
"parameter invalid": "{parameter}无效",
|
||||||
@@ -2261,8 +2267,15 @@
|
|||||||
"Show Hidden Transaction Templates": "显示隐藏的模板",
|
"Show Hidden Transaction Templates": "显示隐藏的模板",
|
||||||
"Hide Hidden Transaction Templates": "不显示隐藏的模板",
|
"Hide Hidden Transaction Templates": "不显示隐藏的模板",
|
||||||
"Template name cannot be blank": "模板名不能为空",
|
"Template name cannot be blank": "模板名不能为空",
|
||||||
"Generate MCP token": "生成 MCP 令牌",
|
"Generate Token": "生成令牌",
|
||||||
"Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "您的 MCP 令牌不会过期,请妥善保管。当连接到第三方应用时,请注意它们及其使用的大语言模型(LLM)可以获取到您的隐私数据。",
|
"Token Type": "令牌类型",
|
||||||
|
"Expiration Time (Seconds)": "过期时间(秒)",
|
||||||
|
"Custom Expiration Time (Seconds)": "自定义过期时间(秒)",
|
||||||
|
"No Expiration": "永不过期",
|
||||||
|
"API Token": "API 令牌",
|
||||||
|
"MCP Token": "MCP 令牌",
|
||||||
|
"Your token does not expire, please keep it secure.": "您的令牌不会过期,请妥善保管。",
|
||||||
|
"When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "当连接到第三方应用时,请注意它们及其使用的大语言模型(LLM)可以获取到您的隐私数据。",
|
||||||
"Unable to generate token": "无法生成令牌",
|
"Unable to generate token": "无法生成令牌",
|
||||||
"Are you sure you want to logout from this session?": "您确定要退出该会话?",
|
"Are you sure you want to logout from this session?": "您确定要退出该会话?",
|
||||||
"Unable to logout from this session": "无法退出该会话",
|
"Unable to logout from this session": "无法退出该会话",
|
||||||
|
|||||||
@@ -107,6 +107,10 @@
|
|||||||
"EndYY": "{EndYY}財政年度"
|
"EndYY": "{EndYY}財政年度"
|
||||||
},
|
},
|
||||||
"misc": {
|
"misc": {
|
||||||
|
"nHour": "{n} 小時",
|
||||||
|
"nHours": "{n} 小時",
|
||||||
|
"nDay": "{n} 天",
|
||||||
|
"nDays": "{n} 天",
|
||||||
"multiTextJoinSeparator": "、",
|
"multiTextJoinSeparator": "、",
|
||||||
"loginWithCustomProvider": "使用 {name} 登入",
|
"loginWithCustomProvider": "使用 {name} 登入",
|
||||||
"hoursBehindDefaultTimezone": "比預設時區晚{hours}小時",
|
"hoursBehindDefaultTimezone": "比預設時區晚{hours}小時",
|
||||||
@@ -1105,6 +1109,7 @@
|
|||||||
"token is empty": "驗證令牌為空",
|
"token is empty": "驗證令牌為空",
|
||||||
"email verify token is invalid or expired": "電子郵件驗證令牌無效或已過期",
|
"email verify token is invalid or expired": "電子郵件驗證令牌無效或已過期",
|
||||||
"password reset token is invalid or expired": "密碼重設令牌無效或已過期",
|
"password reset token is invalid or expired": "密碼重設令牌無效或已過期",
|
||||||
|
"not allowed to generate api token": "不允許產生 API 認證令牌",
|
||||||
"passcode is invalid": "驗證碼無效",
|
"passcode is invalid": "驗證碼無效",
|
||||||
"two-factor backup code is invalid": "二步驟驗證備用碼無效",
|
"two-factor backup code is invalid": "二步驟驗證備用碼無效",
|
||||||
"two-factor is not enabled": "二步驟驗證沒有啟用",
|
"two-factor is not enabled": "二步驟驗證沒有啟用",
|
||||||
@@ -1307,7 +1312,8 @@
|
|||||||
"page": "頁面索引",
|
"page": "頁面索引",
|
||||||
"count": "數量",
|
"count": "數量",
|
||||||
"templateType": "範本類型",
|
"templateType": "範本類型",
|
||||||
"comment": "描述"
|
"comment": "描述",
|
||||||
|
"expiredInSeconds": "到期時間(秒)"
|
||||||
},
|
},
|
||||||
"parameterizedError": {
|
"parameterizedError": {
|
||||||
"parameter invalid": "{parameter}無效",
|
"parameter invalid": "{parameter}無效",
|
||||||
@@ -2261,8 +2267,15 @@
|
|||||||
"Show Hidden Transaction Templates": "顯示隱藏的範本",
|
"Show Hidden Transaction Templates": "顯示隱藏的範本",
|
||||||
"Hide Hidden Transaction Templates": "不顯示隱藏的範本",
|
"Hide Hidden Transaction Templates": "不顯示隱藏的範本",
|
||||||
"Template name cannot be blank": "範本名稱不能為空",
|
"Template name cannot be blank": "範本名稱不能為空",
|
||||||
"Generate MCP token": "產生 MCP 令牌",
|
"Generate Token": "產生令牌",
|
||||||
"Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "您的 MCP 令牌不會過期,請妥善保管。當連接至第三方應用程式時,請留意它們及其使用的大型語言模型(LLM)可以存取您的隱私資料。",
|
"Token Type": "令牌類型",
|
||||||
|
"Expiration Time (Seconds)": "到期時間(秒)",
|
||||||
|
"Custom Expiration Time (Seconds)": "自訂到期時間(秒)",
|
||||||
|
"No Expiration": "永不過期",
|
||||||
|
"API Token": "API 令牌",
|
||||||
|
"MCP Token": "MCP 令牌",
|
||||||
|
"Your token does not expire, please keep it secure.": "您的令牌不會過期,請妥善保管。",
|
||||||
|
"When connecting to third-party apps, be aware that they and any large language models they use can access your private data.": "當連接至第三方應用程式時,請留意它們及其使用的大型語言模型(LLM)可以存取您的隱私資料。",
|
||||||
"Unable to generate token": "無法產生令牌",
|
"Unable to generate token": "無法產生令牌",
|
||||||
"Are you sure you want to logout from this session?": "您確定要登出此會話?",
|
"Are you sure you want to logout from this session?": "您確定要登出此會話?",
|
||||||
"Unable to logout from this session": "無法登出此會話",
|
"Unable to logout from this session": "無法登出此會話",
|
||||||
|
|||||||
+26
-7
@@ -2,11 +2,16 @@ import type { ApplicationCloudSetting } from '@/core/setting.ts';
|
|||||||
|
|
||||||
import type { UserBasicInfo } from './user.ts';
|
import type { UserBasicInfo } from './user.ts';
|
||||||
|
|
||||||
|
export const TOKEN_TYPE_API: number = 8;
|
||||||
export const TOKEN_TYPE_MCP: number = 5;
|
export const TOKEN_TYPE_MCP: number = 5;
|
||||||
|
|
||||||
export const TOKEN_CLI_USER_AGENT: string = 'ezbookkeeping Cli';
|
export interface TokenGenerateAPIRequest {
|
||||||
|
readonly expiresInSeconds: number;
|
||||||
|
readonly password: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface TokenGenerateMCPRequest {
|
export interface TokenGenerateMCPRequest {
|
||||||
|
readonly expiresInSeconds: number;
|
||||||
readonly password: string;
|
readonly password: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -14,6 +19,10 @@ export interface TokenRevokeRequest {
|
|||||||
readonly tokenId: string;
|
readonly tokenId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface TokenGenerateAPIResponse {
|
||||||
|
readonly token: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface TokenGenerateMCPResponse {
|
export interface TokenGenerateMCPResponse {
|
||||||
readonly token: string;
|
readonly token: string;
|
||||||
readonly mcpUrl: string;
|
readonly mcpUrl: string;
|
||||||
@@ -35,24 +44,34 @@ export interface TokenInfoResponse {
|
|||||||
readonly isCurrent: boolean;
|
readonly isCurrent: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum SessionDeviceType {
|
||||||
|
Api = 'api',
|
||||||
|
MCP = 'mcp',
|
||||||
|
Phone = 'phone',
|
||||||
|
Tablet = 'tablet',
|
||||||
|
TV = 'tv',
|
||||||
|
Wearable = 'wearable',
|
||||||
|
Default = 'default'
|
||||||
|
}
|
||||||
|
|
||||||
export class SessionInfo {
|
export class SessionInfo {
|
||||||
public readonly tokenId: string;
|
public readonly tokenId: string;
|
||||||
public readonly isCurrent: boolean;
|
public readonly isCurrent: boolean;
|
||||||
public readonly deviceType: string;
|
public readonly deviceType: SessionDeviceType;
|
||||||
public readonly deviceInfo: string;
|
public readonly deviceInfo: string;
|
||||||
public readonly createdByCli: boolean;
|
public readonly deviceName: string;
|
||||||
public readonly lastSeen: number;
|
public readonly lastSeen: number;
|
||||||
|
|
||||||
protected constructor(tokenId: string, isCurrent: boolean, deviceType: string, deviceInfo: string, createdByCli: boolean, lastSeen: number) {
|
protected constructor(tokenId: string, isCurrent: boolean, deviceType: SessionDeviceType, deviceInfo: string, deviceName: string, lastSeen: number) {
|
||||||
this.tokenId = tokenId;
|
this.tokenId = tokenId;
|
||||||
this.isCurrent = isCurrent;
|
this.isCurrent = isCurrent;
|
||||||
this.deviceType = deviceType;
|
this.deviceType = deviceType;
|
||||||
this.deviceInfo = deviceInfo;
|
this.deviceInfo = deviceInfo;
|
||||||
this.createdByCli = createdByCli;
|
this.deviceName = deviceName;
|
||||||
this.lastSeen = lastSeen;
|
this.lastSeen = lastSeen;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static of(tokenId: string, isCurrent: boolean, deviceType: string, deviceInfo: string, createdByCli: boolean, lastSeen: number): SessionInfo {
|
public static of(tokenId: string, isCurrent: boolean, deviceType: SessionDeviceType, deviceInfo: string, deviceName: string, lastSeen: number): SessionInfo {
|
||||||
return new SessionInfo(tokenId, isCurrent, deviceType, deviceInfo, createdByCli, lastSeen);
|
return new SessionInfo(tokenId, isCurrent, deviceType, deviceInfo, deviceName, lastSeen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+21
-5
@@ -3,7 +3,12 @@ import { defineStore } from 'pinia';
|
|||||||
import { useSettingsStore } from './setting.ts';
|
import { useSettingsStore } from './setting.ts';
|
||||||
import { useUserStore } from './user.ts';
|
import { useUserStore } from './user.ts';
|
||||||
|
|
||||||
import type { TokenGenerateMCPResponse, TokenRefreshResponse, TokenInfoResponse } from '@/models/token.ts';
|
import type {
|
||||||
|
TokenGenerateAPIResponse,
|
||||||
|
TokenGenerateMCPResponse,
|
||||||
|
TokenRefreshResponse,
|
||||||
|
TokenInfoResponse
|
||||||
|
} from '@/models/token.ts';
|
||||||
|
|
||||||
import { isObject } from '@/lib/common.ts';
|
import { isObject } from '@/lib/common.ts';
|
||||||
import { updateCurrentToken } from '@/lib/userstate.ts';
|
import { updateCurrentToken } from '@/lib/userstate.ts';
|
||||||
@@ -69,9 +74,20 @@ export const useTokensStore = defineStore('tokens', () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateMCPToken({ password }: { password: string }): Promise<TokenGenerateMCPResponse> {
|
function generateToken<T extends 'api' | 'mcp'>({ type, expiresInSeconds, password }: { type: T, expiresInSeconds: number, password: string }): Promise<{ 'api': TokenGenerateAPIResponse, 'mcp': TokenGenerateMCPResponse }[T]> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
services.generateMCPToken({ password }).then(response => {
|
let promise = null;
|
||||||
|
|
||||||
|
if (type === 'api') {
|
||||||
|
promise = services.generateAPIToken({ expiresInSeconds, password });
|
||||||
|
} else if (type === 'mcp') {
|
||||||
|
promise = services.generateMCPToken({ expiresInSeconds, password });
|
||||||
|
} else {
|
||||||
|
reject({ message: 'An error occurred' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
promise.then(response => {
|
||||||
const data = response.data;
|
const data = response.data;
|
||||||
|
|
||||||
if (!data || !data.success || !data.result) {
|
if (!data || !data.success || !data.result) {
|
||||||
@@ -79,7 +95,7 @@ export const useTokensStore = defineStore('tokens', () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
resolve(data.result);
|
resolve(data.result as { 'api': TokenGenerateAPIResponse, 'mcp': TokenGenerateMCPResponse }[T]);
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
logger.error('failed to generate token', error);
|
logger.error('failed to generate token', error);
|
||||||
|
|
||||||
@@ -148,7 +164,7 @@ export const useTokensStore = defineStore('tokens', () => {
|
|||||||
// functions
|
// functions
|
||||||
getAllTokens,
|
getAllTokens,
|
||||||
refreshTokenAndRevokeOldToken,
|
refreshTokenAndRevokeOldToken,
|
||||||
generateMCPToken,
|
generateToken,
|
||||||
revokeToken,
|
revokeToken,
|
||||||
revokeAllTokens
|
revokeAllTokens
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,170 +0,0 @@
|
|||||||
<template>
|
|
||||||
<v-dialog width="800" :persistent="true" v-model="showState">
|
|
||||||
<v-card class="pa-2 pa-sm-4 pa-md-4">
|
|
||||||
<template #title>
|
|
||||||
<div class="d-flex align-center justify-center">
|
|
||||||
<h4 class="text-h4">{{ tt('Generate MCP token') }}</h4>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<v-card-text class="py-0 w-100 d-flex justify-center" v-if="generatedToken && serverUrl">
|
|
||||||
<v-switch class="bidirectional-switch" color="secondary"
|
|
||||||
:label="tt('Configuration')"
|
|
||||||
v-model="showConfiguration"
|
|
||||||
@click="showConfiguration = !showConfiguration">
|
|
||||||
<template #prepend>
|
|
||||||
<span>{{ tt('Token') }}</span>
|
|
||||||
</template>
|
|
||||||
</v-switch>
|
|
||||||
</v-card-text>
|
|
||||||
|
|
||||||
<v-card-text class="mt-md-4 w-100 d-flex justify-center">
|
|
||||||
<div class="w-100" v-if="!generatedToken">
|
|
||||||
<v-text-field
|
|
||||||
autocomplete="current-password"
|
|
||||||
type="password"
|
|
||||||
:autofocus="true"
|
|
||||||
:disabled="generating"
|
|
||||||
:label="tt('Current Password')"
|
|
||||||
:placeholder="tt('Current Password')"
|
|
||||||
v-model="currentPassword"
|
|
||||||
@keyup.enter="generateToken"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="w-100 code-container" v-if="generatedToken">
|
|
||||||
<v-textarea class="w-100 always-cursor-text" :readonly="true"
|
|
||||||
:rows="4" :value="generatedToken" v-if="!showConfiguration || !serverUrl" />
|
|
||||||
<v-textarea class="w-100 always-cursor-text" :readonly="true"
|
|
||||||
:rows="15" :value="mcpServerConfiguration" v-if="showConfiguration && serverUrl" />
|
|
||||||
</div>
|
|
||||||
</v-card-text>
|
|
||||||
|
|
||||||
<v-card-text class="w-100">
|
|
||||||
<v-alert type="warning" variant="tonal">
|
|
||||||
{{ tt('Your MCP token does not expire, please keep it secure. When connecting to third-party apps, be aware that they and any large language models they use can access your private data.') }}
|
|
||||||
</v-alert>
|
|
||||||
</v-card-text>
|
|
||||||
|
|
||||||
<v-card-text class="overflow-y-visible">
|
|
||||||
<div ref="buttonContainer" class="w-100 d-flex justify-center gap-4">
|
|
||||||
<v-btn :disabled="generating || !currentPassword" @click="generateToken" v-if="!generatedToken">
|
|
||||||
{{ tt('Generate') }}
|
|
||||||
<v-progress-circular indeterminate size="22" class="ms-2" v-if="generating"></v-progress-circular>
|
|
||||||
</v-btn>
|
|
||||||
<v-btn color="secondary" variant="tonal" :disabled="generating"
|
|
||||||
@click="cancel" v-if="!generatedToken">{{ tt('Cancel') }}</v-btn>
|
|
||||||
<v-btn variant="tonal" @click="copy" v-if="generatedToken">{{ tt('Copy') }}</v-btn>
|
|
||||||
<v-btn color="secondary" variant="tonal" @click="close" v-if="generatedToken">{{ tt('Close') }}</v-btn>
|
|
||||||
</div>
|
|
||||||
</v-card-text>
|
|
||||||
</v-card>
|
|
||||||
</v-dialog>
|
|
||||||
|
|
||||||
<snack-bar ref="snackbar" />
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import SnackBar from '@/components/desktop/SnackBar.vue';
|
|
||||||
|
|
||||||
import { ref, computed, useTemplateRef } from 'vue';
|
|
||||||
|
|
||||||
import { useI18n } from '@/locales/helpers.ts';
|
|
||||||
|
|
||||||
import { useTokensStore } from '@/stores/token.ts';
|
|
||||||
|
|
||||||
import { copyTextToClipboard } from '@/lib/ui/common.ts';
|
|
||||||
|
|
||||||
type SnackBarType = InstanceType<typeof SnackBar>;
|
|
||||||
|
|
||||||
const { tt } = useI18n();
|
|
||||||
|
|
||||||
const tokensStore = useTokensStore();
|
|
||||||
|
|
||||||
const buttonContainer = useTemplateRef<HTMLElement>('buttonContainer');
|
|
||||||
const snackbar = useTemplateRef<SnackBarType>('snackbar');
|
|
||||||
|
|
||||||
let resolveFunc: (() => void) | null = null;
|
|
||||||
let rejectFunc: ((reason?: unknown) => void) | null = null;
|
|
||||||
|
|
||||||
const showState = ref<boolean>(false);
|
|
||||||
const currentPassword = ref<string>('');
|
|
||||||
const generating = ref<boolean>(false);
|
|
||||||
const showConfiguration = ref<boolean>(false);
|
|
||||||
const serverUrl = ref<string>('');
|
|
||||||
const generatedToken = ref<string>('');
|
|
||||||
|
|
||||||
const mcpServerConfiguration = computed<string>(() => {
|
|
||||||
return '{\n' +
|
|
||||||
' "mcpServers": {\n' +
|
|
||||||
' "ezbookkeeping-mcp": {\n' +
|
|
||||||
' "type": "streamable-http",\n' +
|
|
||||||
' "url": "' + serverUrl.value + '",\n' +
|
|
||||||
' "headers": {\n' +
|
|
||||||
' "Authorization": "Bearer ' + generatedToken.value + '"\n' +
|
|
||||||
' }\n' +
|
|
||||||
' }\n' +
|
|
||||||
' }\n' +
|
|
||||||
'}'
|
|
||||||
});
|
|
||||||
|
|
||||||
function open(): Promise<void> {
|
|
||||||
showState.value = true;
|
|
||||||
currentPassword.value = '';
|
|
||||||
generating.value = false;
|
|
||||||
showConfiguration.value = false;
|
|
||||||
serverUrl.value = '';
|
|
||||||
generatedToken.value = '';
|
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
resolveFunc = resolve;
|
|
||||||
rejectFunc = reject;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function generateToken(): void {
|
|
||||||
if (generating.value || !currentPassword.value) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
generating.value = true;
|
|
||||||
|
|
||||||
tokensStore.generateMCPToken({
|
|
||||||
password: currentPassword.value
|
|
||||||
}).then(result => {
|
|
||||||
generating.value = false;
|
|
||||||
currentPassword.value = '';
|
|
||||||
serverUrl.value = result.mcpUrl;
|
|
||||||
generatedToken.value = result.token;
|
|
||||||
}).catch(error => {
|
|
||||||
generating.value = false;
|
|
||||||
|
|
||||||
if (!error.processed) {
|
|
||||||
snackbar.value?.showError(error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function copy(): void {
|
|
||||||
if (showConfiguration.value) {
|
|
||||||
copyTextToClipboard(mcpServerConfiguration.value, buttonContainer.value);
|
|
||||||
} else {
|
|
||||||
copyTextToClipboard(generatedToken.value, buttonContainer.value);
|
|
||||||
}
|
|
||||||
|
|
||||||
snackbar.value?.showMessage('Data copied');
|
|
||||||
}
|
|
||||||
|
|
||||||
function cancel(): void {
|
|
||||||
rejectFunc?.();
|
|
||||||
showState.value = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function close(): void {
|
|
||||||
resolveFunc?.();
|
|
||||||
showState.value = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
defineExpose({
|
|
||||||
open
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@@ -0,0 +1,248 @@
|
|||||||
|
<template>
|
||||||
|
<v-dialog width="800" :persistent="true" v-model="showState">
|
||||||
|
<v-card class="pa-2 pa-sm-4 pa-md-4">
|
||||||
|
<template #title>
|
||||||
|
<div class="d-flex align-center justify-center">
|
||||||
|
<h4 class="text-h4">{{ tt('Generate Token') }}</h4>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<v-card-text class="py-0 w-100 d-flex justify-center" v-if="tokenType === 'mcp' && generatedToken && serverUrl">
|
||||||
|
<v-switch class="bidirectional-switch" color="secondary"
|
||||||
|
:label="tt('Configuration')"
|
||||||
|
v-model="showMCPConfiguration"
|
||||||
|
@click="showMCPConfiguration = !showMCPConfiguration">
|
||||||
|
<template #prepend>
|
||||||
|
<span>{{ tt('Token') }}</span>
|
||||||
|
</template>
|
||||||
|
</v-switch>
|
||||||
|
</v-card-text>
|
||||||
|
|
||||||
|
<v-card-text class="mt-md-4 w-100 d-flex justify-center">
|
||||||
|
<div class="w-100" v-if="!generatedToken">
|
||||||
|
<v-row>
|
||||||
|
<v-col cols="12" md="12">
|
||||||
|
<v-select
|
||||||
|
item-title="name"
|
||||||
|
item-value="value"
|
||||||
|
:disabled="generating"
|
||||||
|
:label="tt('Token Type')"
|
||||||
|
:placeholder="tt('Token Type')"
|
||||||
|
:items="tokenTypeOptions"
|
||||||
|
v-model="tokenType"
|
||||||
|
/>
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="12" :md="tokenExpirationTime >= 0 ? 12 : 6">
|
||||||
|
<v-select
|
||||||
|
item-title="displayName"
|
||||||
|
item-value="value"
|
||||||
|
:disabled="generating"
|
||||||
|
:label="tt('Expiration Time (Seconds)')"
|
||||||
|
:placeholder="tt('Expiration Time (Seconds)')"
|
||||||
|
:items="[
|
||||||
|
{ displayName: tt('No Expiration'), value: 0 },
|
||||||
|
{ displayName: tt('format.misc.nHour', { n: 1 }), value: 3600 },
|
||||||
|
{ displayName: tt('format.misc.nDays', { n: 1 }), value: 86400 },
|
||||||
|
{ displayName: tt('format.misc.nDays', { n: 7 }), value: 604800 },
|
||||||
|
{ displayName: tt('format.misc.nDays', { n: 30 }), value: 2592000 },
|
||||||
|
{ displayName: tt('format.misc.nDays', { n: 90 }), value: 7776000 },
|
||||||
|
{ displayName: tt('format.misc.nDays', { n: 180 }), value: 15552000 },
|
||||||
|
{ displayName: tt('format.misc.nDays', { n: 365 }), value: 31536000 },
|
||||||
|
{ displayName: tt('Custom'), value: -1 }
|
||||||
|
]"
|
||||||
|
v-model="tokenExpirationTime"
|
||||||
|
/>
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="12" md="6" v-if="tokenExpirationTime < 0">
|
||||||
|
<v-text-field
|
||||||
|
type="number"
|
||||||
|
persistent-placeholder
|
||||||
|
:disabled="generating"
|
||||||
|
:label="tt('Custom Expiration Time (Seconds)')"
|
||||||
|
:placeholder="tt('Custom Expiration Time (Seconds)')"
|
||||||
|
v-model.number="tokenCustomExpirationTime"
|
||||||
|
/>
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="12" md="12">
|
||||||
|
<v-text-field
|
||||||
|
autocomplete="current-password"
|
||||||
|
type="password"
|
||||||
|
persistent-placeholder
|
||||||
|
:autofocus="true"
|
||||||
|
:disabled="generating"
|
||||||
|
:label="tt('Current Password')"
|
||||||
|
:placeholder="tt('Current Password')"
|
||||||
|
v-model="currentPassword"
|
||||||
|
@keyup.enter="generateToken"
|
||||||
|
/>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</div>
|
||||||
|
<div class="w-100 code-container" v-if="generatedToken">
|
||||||
|
<v-textarea class="w-100 always-cursor-text" :readonly="true"
|
||||||
|
:rows="4" :value="generatedToken" v-if="!showMCPConfiguration || !serverUrl" />
|
||||||
|
<v-textarea class="w-100 always-cursor-text" :readonly="true"
|
||||||
|
:rows="15" :value="mcpServerConfiguration" v-if="showMCPConfiguration && serverUrl" />
|
||||||
|
</div>
|
||||||
|
</v-card-text>
|
||||||
|
|
||||||
|
<v-card-text class="w-100" v-if="(tokenExpirationTime === 0 || (tokenExpirationTime < 0 && tokenCustomExpirationTime === 0)) || tokenType === 'mcp'">
|
||||||
|
<v-alert type="warning" variant="tonal">
|
||||||
|
<span v-if="tokenExpirationTime === 0 || (tokenExpirationTime < 0 && tokenCustomExpirationTime === 0)">{{ tt('Your token does not expire, please keep it secure.') }}</span>
|
||||||
|
<span v-if="tokenType === 'mcp'">{{ tt('When connecting to third-party apps, be aware that they and any large language models they use can access your private data.') }}</span>
|
||||||
|
</v-alert>
|
||||||
|
</v-card-text>
|
||||||
|
|
||||||
|
<v-card-text class="overflow-y-visible">
|
||||||
|
<div ref="buttonContainer" class="w-100 d-flex justify-center gap-4">
|
||||||
|
<v-btn :disabled="generating || !currentPassword" @click="generateToken" v-if="!generatedToken">
|
||||||
|
{{ tt('Generate') }}
|
||||||
|
<v-progress-circular indeterminate size="22" class="ms-2" v-if="generating"></v-progress-circular>
|
||||||
|
</v-btn>
|
||||||
|
<v-btn color="secondary" variant="tonal" :disabled="generating"
|
||||||
|
@click="cancel" v-if="!generatedToken">{{ tt('Cancel') }}</v-btn>
|
||||||
|
<v-btn variant="tonal" @click="copy" v-if="generatedToken">{{ tt('Copy') }}</v-btn>
|
||||||
|
<v-btn color="secondary" variant="tonal" @click="close" v-if="generatedToken">{{ tt('Close') }}</v-btn>
|
||||||
|
</div>
|
||||||
|
</v-card-text>
|
||||||
|
</v-card>
|
||||||
|
</v-dialog>
|
||||||
|
|
||||||
|
<snack-bar ref="snackbar" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import SnackBar from '@/components/desktop/SnackBar.vue';
|
||||||
|
|
||||||
|
import { ref, computed, useTemplateRef } from 'vue';
|
||||||
|
|
||||||
|
import { useI18n } from '@/locales/helpers.ts';
|
||||||
|
|
||||||
|
import { useTokensStore } from '@/stores/token.ts';
|
||||||
|
|
||||||
|
import { type NameValue } from '@/core/base.ts';
|
||||||
|
import { type TokenGenerateMCPResponse } from '@/models/token.ts';
|
||||||
|
|
||||||
|
import { isGenerateAPITokenEnabled, isMCPServerEnabled } from '@/lib/server_settings.ts';
|
||||||
|
import { copyTextToClipboard } from '@/lib/ui/common.ts';
|
||||||
|
|
||||||
|
type SnackBarType = InstanceType<typeof SnackBar>;
|
||||||
|
|
||||||
|
const { tt } = useI18n();
|
||||||
|
|
||||||
|
const tokensStore = useTokensStore();
|
||||||
|
|
||||||
|
const buttonContainer = useTemplateRef<HTMLElement>('buttonContainer');
|
||||||
|
const snackbar = useTemplateRef<SnackBarType>('snackbar');
|
||||||
|
|
||||||
|
let resolveFunc: (() => void) | null = null;
|
||||||
|
let rejectFunc: ((reason?: unknown) => void) | null = null;
|
||||||
|
|
||||||
|
const showState = ref<boolean>(false);
|
||||||
|
const tokenType = ref<'api' | 'mcp'>(isGenerateAPITokenEnabled() ? 'api' : (isMCPServerEnabled() ? 'mcp' : 'api'));
|
||||||
|
const tokenExpirationTime = ref<number>(86400);
|
||||||
|
const tokenCustomExpirationTime = ref<number>(86400);
|
||||||
|
const currentPassword = ref<string>('');
|
||||||
|
const generating = ref<boolean>(false);
|
||||||
|
const showMCPConfiguration = ref<boolean>(false);
|
||||||
|
const serverUrl = ref<string>('');
|
||||||
|
const generatedToken = ref<string>('');
|
||||||
|
|
||||||
|
const tokenTypeOptions = computed<NameValue[]>(() => {
|
||||||
|
const options: NameValue[] = [];
|
||||||
|
|
||||||
|
if (isGenerateAPITokenEnabled()) {
|
||||||
|
options.push({ name: tt('API Token'), value: 'api' });
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isMCPServerEnabled()) {
|
||||||
|
options.push({ name: tt('MCP Token'), value: 'mcp' });
|
||||||
|
}
|
||||||
|
|
||||||
|
return options;
|
||||||
|
});
|
||||||
|
|
||||||
|
const mcpServerConfiguration = computed<string>(() => {
|
||||||
|
return '{\n' +
|
||||||
|
' "mcpServers": {\n' +
|
||||||
|
' "ezbookkeeping-mcp": {\n' +
|
||||||
|
' "type": "streamable-http",\n' +
|
||||||
|
' "url": "' + serverUrl.value + '",\n' +
|
||||||
|
' "headers": {\n' +
|
||||||
|
' "Authorization": "Bearer ' + generatedToken.value + '"\n' +
|
||||||
|
' }\n' +
|
||||||
|
' }\n' +
|
||||||
|
' }\n' +
|
||||||
|
'}'
|
||||||
|
});
|
||||||
|
|
||||||
|
function open(): Promise<void> {
|
||||||
|
showState.value = true;
|
||||||
|
currentPassword.value = '';
|
||||||
|
tokenType.value = isGenerateAPITokenEnabled() ? 'api' : (isMCPServerEnabled() ? 'mcp' : 'api');
|
||||||
|
tokenExpirationTime.value = 86400;
|
||||||
|
tokenCustomExpirationTime.value = 86400;
|
||||||
|
generating.value = false;
|
||||||
|
showMCPConfiguration.value = false;
|
||||||
|
serverUrl.value = '';
|
||||||
|
generatedToken.value = '';
|
||||||
|
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
resolveFunc = resolve;
|
||||||
|
rejectFunc = reject;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function generateToken(): void {
|
||||||
|
if (generating.value || !currentPassword.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
generating.value = true;
|
||||||
|
|
||||||
|
tokensStore.generateToken({
|
||||||
|
type: tokenType.value,
|
||||||
|
expiresInSeconds: tokenExpirationTime.value >= 0 ? tokenExpirationTime.value : tokenCustomExpirationTime.value,
|
||||||
|
password: currentPassword.value
|
||||||
|
}).then(result => {
|
||||||
|
generating.value = false;
|
||||||
|
currentPassword.value = '';
|
||||||
|
|
||||||
|
if (tokenType.value === 'mcp') {
|
||||||
|
serverUrl.value = (result as TokenGenerateMCPResponse).mcpUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
generatedToken.value = result.token;
|
||||||
|
}).catch(error => {
|
||||||
|
generating.value = false;
|
||||||
|
|
||||||
|
if (!error.processed) {
|
||||||
|
snackbar.value?.showError(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function copy(): void {
|
||||||
|
if (showMCPConfiguration.value) {
|
||||||
|
copyTextToClipboard(mcpServerConfiguration.value, buttonContainer.value);
|
||||||
|
} else {
|
||||||
|
copyTextToClipboard(generatedToken.value, buttonContainer.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
snackbar.value?.showMessage('Data copied');
|
||||||
|
}
|
||||||
|
|
||||||
|
function cancel(): void {
|
||||||
|
rejectFunc?.();
|
||||||
|
showState.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function close(): void {
|
||||||
|
resolveFunc?.();
|
||||||
|
showState.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@@ -132,7 +132,7 @@
|
|||||||
<div class="d-flex align-center">
|
<div class="d-flex align-center">
|
||||||
<span>{{ tt('Device & Sessions') }}</span>
|
<span>{{ tt('Device & Sessions') }}</span>
|
||||||
<v-btn class="ms-3" density="compact" color="default" variant="outlined"
|
<v-btn class="ms-3" density="compact" color="default" variant="outlined"
|
||||||
@click="generateMCPToken" v-if="isMCPServerEnabled()">{{ tt('Generate MCP token') }}</v-btn>
|
@click="generateToken" v-if="isGenerateAPITokenEnabled() || isMCPServerEnabled()">{{ tt('Generate Token') }}</v-btn>
|
||||||
<v-btn density="compact" color="default" variant="text" size="24"
|
<v-btn density="compact" color="default" variant="text" size="24"
|
||||||
class="ms-2" :icon="true" :loading="loadingSession" @click="reloadSessions(false)">
|
class="ms-2" :icon="true" :loading="loadingSession" @click="reloadSessions(false)">
|
||||||
<template #loader>
|
<template #loader>
|
||||||
@@ -171,7 +171,7 @@
|
|||||||
v-for="session in sessions">
|
v-for="session in sessions">
|
||||||
<td class="text-sm">
|
<td class="text-sm">
|
||||||
<v-icon start :icon="session.icon"/>
|
<v-icon start :icon="session.icon"/>
|
||||||
{{ session.deviceType === 'mcp' ? 'MCP' : (tt(session.isCurrent ? 'Current' : 'Other Device')) }}
|
{{ tt(session.deviceName) }}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-sm">{{ session.deviceInfo }}</td>
|
<td class="text-sm">{{ session.deviceInfo }}</td>
|
||||||
<td class="text-sm">{{ session.lastSeenDateTime }}</td>
|
<td class="text-sm">{{ session.lastSeenDateTime }}</td>
|
||||||
@@ -190,7 +190,7 @@
|
|||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
<unlink-third-party-login-dialog ref="unlinkThirdPartyLoginDialog" />
|
<unlink-third-party-login-dialog ref="unlinkThirdPartyLoginDialog" />
|
||||||
<user-generate-m-c-p-token-dialog ref="generateMCPTokenDialog" />
|
<user-generate-token-dialog ref="generateTokenDialog" />
|
||||||
<confirm-dialog ref="confirmDialog"/>
|
<confirm-dialog ref="confirmDialog"/>
|
||||||
<snack-bar ref="snackbar" />
|
<snack-bar ref="snackbar" />
|
||||||
</template>
|
</template>
|
||||||
@@ -198,7 +198,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { VTextField } from 'vuetify/components/VTextField';
|
import { VTextField } from 'vuetify/components/VTextField';
|
||||||
import UnlinkThirdPartyLoginDialog from '@/views/desktop/user/settings/dialogs/UnlinkThirdPartyLoginDialog.vue';
|
import UnlinkThirdPartyLoginDialog from '@/views/desktop/user/settings/dialogs/UnlinkThirdPartyLoginDialog.vue';
|
||||||
import UserGenerateMCPTokenDialog from '@/views/desktop/user/settings/dialogs/UserGenerateMCPTokenDialog.vue';
|
import UserGenerateTokenDialog from '@/views/desktop/user/settings/dialogs/UserGenerateTokenDialog.vue';
|
||||||
import ConfirmDialog from '@/components/desktop/ConfirmDialog.vue';
|
import ConfirmDialog from '@/components/desktop/ConfirmDialog.vue';
|
||||||
import SnackBar from '@/components/desktop/SnackBar.vue';
|
import SnackBar from '@/components/desktop/SnackBar.vue';
|
||||||
|
|
||||||
@@ -213,11 +213,17 @@ import { useTokensStore } from '@/stores/token.ts';
|
|||||||
|
|
||||||
import { itemAndIndex, reversedItemAndIndex } from '@/core/base.ts';
|
import { itemAndIndex, reversedItemAndIndex } from '@/core/base.ts';
|
||||||
import { type UserExternalAuthInfoResponse } from '@/models/user_external_auth.ts';
|
import { type UserExternalAuthInfoResponse } from '@/models/user_external_auth.ts';
|
||||||
import { type TokenInfoResponse, SessionInfo } from '@/models/token.ts';
|
import { type TokenInfoResponse, SessionDeviceType, SessionInfo } from '@/models/token.ts';
|
||||||
|
|
||||||
import { isEquals } from '@/lib/common.ts';
|
import { isEquals } from '@/lib/common.ts';
|
||||||
import { parseSessionInfo } from '@/lib/session.ts';
|
import { parseSessionInfo } from '@/lib/session.ts';
|
||||||
import { isOAuth2Enabled, getOAuth2Provider, getOIDCCustomDisplayNames, isMCPServerEnabled } from '@/lib/server_settings.ts';
|
import {
|
||||||
|
isGenerateAPITokenEnabled,
|
||||||
|
isOAuth2Enabled,
|
||||||
|
getOAuth2Provider,
|
||||||
|
getOIDCCustomDisplayNames,
|
||||||
|
isMCPServerEnabled
|
||||||
|
} from '@/lib/server_settings.ts';
|
||||||
import { generateRandomUUID } from '@/lib/misc.ts';
|
import { generateRandomUUID } from '@/lib/misc.ts';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -228,8 +234,8 @@ import {
|
|||||||
mdiTablet,
|
mdiTablet,
|
||||||
mdiWatch,
|
mdiWatch,
|
||||||
mdiTelevision,
|
mdiTelevision,
|
||||||
mdiCreationOutline,
|
|
||||||
mdiConsole,
|
mdiConsole,
|
||||||
|
mdiCreationOutline,
|
||||||
mdiDevices
|
mdiDevices
|
||||||
} from '@mdi/js';
|
} from '@mdi/js';
|
||||||
|
|
||||||
@@ -267,24 +273,24 @@ class DesktopPageSessionInfo extends SessionInfo {
|
|||||||
public readonly lastSeenDateTime: string;
|
public readonly lastSeenDateTime: string;
|
||||||
|
|
||||||
public constructor(sessionInfo: SessionInfo) {
|
public constructor(sessionInfo: SessionInfo) {
|
||||||
super(sessionInfo.tokenId, sessionInfo.isCurrent, sessionInfo.deviceType, sessionInfo.deviceInfo, sessionInfo.createdByCli, sessionInfo.lastSeen);
|
super(sessionInfo.tokenId, sessionInfo.isCurrent, sessionInfo.deviceType, sessionInfo.deviceInfo, sessionInfo.deviceName, sessionInfo.lastSeen);
|
||||||
this.icon = this.getTokenIcon(sessionInfo.deviceType);
|
this.icon = this.getTokenIcon(sessionInfo.deviceType);
|
||||||
this.lastSeenDateTime = sessionInfo.lastSeen ? formatUnixTimeToLongDateTime(sessionInfo.lastSeen) : '-';
|
this.lastSeenDateTime = sessionInfo.lastSeen ? formatUnixTimeToLongDateTime(sessionInfo.lastSeen) : '-';
|
||||||
}
|
}
|
||||||
|
|
||||||
private getTokenIcon(deviceType: string): string {
|
private getTokenIcon(deviceType: SessionDeviceType): string {
|
||||||
if (deviceType === 'phone') {
|
if (deviceType === SessionDeviceType.Phone) {
|
||||||
return mdiCellphone;
|
return mdiCellphone;
|
||||||
} else if (deviceType === 'wearable') {
|
} else if (deviceType === SessionDeviceType.Wearable) {
|
||||||
return mdiWatch;
|
return mdiWatch;
|
||||||
} else if (deviceType === 'tablet') {
|
} else if (deviceType === SessionDeviceType.Tablet) {
|
||||||
return mdiTablet;
|
return mdiTablet;
|
||||||
} else if (deviceType === 'tv') {
|
} else if (deviceType === SessionDeviceType.TV) {
|
||||||
return mdiTelevision;
|
return mdiTelevision;
|
||||||
} else if (deviceType === 'mcp') {
|
} else if (deviceType === SessionDeviceType.Api) {
|
||||||
return mdiCreationOutline;
|
|
||||||
} else if (deviceType === 'cli') {
|
|
||||||
return mdiConsole;
|
return mdiConsole;
|
||||||
|
} else if (deviceType === SessionDeviceType.MCP) {
|
||||||
|
return mdiCreationOutline;
|
||||||
} else {
|
} else {
|
||||||
return mdiDevices;
|
return mdiDevices;
|
||||||
}
|
}
|
||||||
@@ -292,7 +298,7 @@ class DesktopPageSessionInfo extends SessionInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type UnlinkThirdPartyLoginDialogType = InstanceType<typeof UnlinkThirdPartyLoginDialog>;
|
type UnlinkThirdPartyLoginDialogType = InstanceType<typeof UnlinkThirdPartyLoginDialog>;
|
||||||
type UserGenerateMCPTokenDialogType = InstanceType<typeof UserGenerateMCPTokenDialog>;
|
type UserGenerateTokenDialogType = InstanceType<typeof UserGenerateTokenDialog>;
|
||||||
type ConfirmDialogType = InstanceType<typeof ConfirmDialog>;
|
type ConfirmDialogType = InstanceType<typeof ConfirmDialog>;
|
||||||
type SnackBarType = InstanceType<typeof SnackBar>;
|
type SnackBarType = InstanceType<typeof SnackBar>;
|
||||||
|
|
||||||
@@ -311,7 +317,7 @@ const tokensStore = useTokensStore();
|
|||||||
const newPasswordInput = useTemplateRef<VTextField>('newPasswordInput');
|
const newPasswordInput = useTemplateRef<VTextField>('newPasswordInput');
|
||||||
const confirmPasswordInput = useTemplateRef<VTextField>('confirmPasswordInput');
|
const confirmPasswordInput = useTemplateRef<VTextField>('confirmPasswordInput');
|
||||||
const unlinkThirdPartyLoginDialog = useTemplateRef<UnlinkThirdPartyLoginDialogType>('unlinkThirdPartyLoginDialog');
|
const unlinkThirdPartyLoginDialog = useTemplateRef<UnlinkThirdPartyLoginDialogType>('unlinkThirdPartyLoginDialog');
|
||||||
const generateMCPTokenDialog = useTemplateRef<UserGenerateMCPTokenDialogType>('generateMCPTokenDialog');
|
const generateTokenDialog = useTemplateRef<UserGenerateTokenDialogType>('generateTokenDialog');
|
||||||
const confirmDialog = useTemplateRef<ConfirmDialogType>('confirmDialog');
|
const confirmDialog = useTemplateRef<ConfirmDialogType>('confirmDialog');
|
||||||
const snackbar = useTemplateRef<SnackBarType>('snackbar');
|
const snackbar = useTemplateRef<SnackBarType>('snackbar');
|
||||||
|
|
||||||
@@ -450,8 +456,8 @@ function unlinkExternalAuth(thirdPartyLogin: DesktopPageLinkedThirdPartyLogin):
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateMCPToken(): void {
|
function generateToken(): void {
|
||||||
generateMCPTokenDialog.value?.open().then(() => {
|
generateTokenDialog.value?.open().then(() => {
|
||||||
reloadSessions(true);
|
reloadSessions(true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<f7-list strong inset dividers media-list class="margin-top" v-else-if="!loading">
|
<f7-list strong inset dividers media-list class="margin-top" v-else-if="!loading">
|
||||||
<f7-list-item class="list-item-media-valign-middle" swipeout
|
<f7-list-item class="list-item-media-valign-middle" swipeout
|
||||||
:id="session.domId"
|
:id="session.domId"
|
||||||
:title="session.deviceType === 'mcp' ? 'MCP' : (tt(session.isCurrent ? 'Current' : 'Other Device'))"
|
:title="tt(session.deviceName)"
|
||||||
:text="session.deviceInfo"
|
:text="session.deviceInfo"
|
||||||
:key="session.tokenId"
|
:key="session.tokenId"
|
||||||
v-for="session in sessions">
|
v-for="session in sessions">
|
||||||
@@ -55,7 +55,7 @@ import { useTokensStore } from '@/stores/token.ts';
|
|||||||
|
|
||||||
import { itemAndIndex, reversedItemAndIndex } from '@/core/base.ts';
|
import { itemAndIndex, reversedItemAndIndex } from '@/core/base.ts';
|
||||||
import { TextDirection } from '@/core/text.ts';
|
import { TextDirection } from '@/core/text.ts';
|
||||||
import { type TokenInfoResponse, SessionInfo } from '@/models/token.ts';
|
import { type TokenInfoResponse, SessionDeviceType, SessionInfo } from '@/models/token.ts';
|
||||||
|
|
||||||
import { isEquals } from '@/lib/common.ts';
|
import { isEquals } from '@/lib/common.ts';
|
||||||
import { parseSessionInfo } from '@/lib/session.ts';
|
import { parseSessionInfo } from '@/lib/session.ts';
|
||||||
@@ -66,7 +66,7 @@ class MobilePageSessionInfo extends SessionInfo {
|
|||||||
public readonly lastSeenDateTime: string;
|
public readonly lastSeenDateTime: string;
|
||||||
|
|
||||||
public constructor(sessionInfo: SessionInfo) {
|
public constructor(sessionInfo: SessionInfo) {
|
||||||
super(sessionInfo.tokenId, sessionInfo.isCurrent, sessionInfo.deviceType, sessionInfo.deviceInfo, sessionInfo.createdByCli, sessionInfo.lastSeen);
|
super(sessionInfo.tokenId, sessionInfo.isCurrent, sessionInfo.deviceType, sessionInfo.deviceInfo, sessionInfo.deviceName, sessionInfo.lastSeen);
|
||||||
this.domId = getTokenDomId(sessionInfo.tokenId);
|
this.domId = getTokenDomId(sessionInfo.tokenId);
|
||||||
this.icon = getTokenIcon(sessionInfo.deviceType);
|
this.icon = getTokenIcon(sessionInfo.deviceType);
|
||||||
this.lastSeenDateTime = sessionInfo.lastSeen ? formatUnixTimeToLongDateTime(sessionInfo.lastSeen) : '-';
|
this.lastSeenDateTime = sessionInfo.lastSeen ? formatUnixTimeToLongDateTime(sessionInfo.lastSeen) : '-';
|
||||||
@@ -103,19 +103,19 @@ const sessions = computed<MobilePageSessionInfo[]>(() => {
|
|||||||
return sessions;
|
return sessions;
|
||||||
});
|
});
|
||||||
|
|
||||||
function getTokenIcon(deviceType: string): string {
|
function getTokenIcon(deviceType: SessionDeviceType): string {
|
||||||
if (deviceType === 'phone') {
|
if (deviceType === SessionDeviceType.Phone) {
|
||||||
return 'device_phone_portrait';
|
return 'device_phone_portrait';
|
||||||
} else if (deviceType === 'wearable') {
|
} else if (deviceType === SessionDeviceType.Wearable) {
|
||||||
return 'device_phone_portrait';
|
return 'device_phone_portrait';
|
||||||
} else if (deviceType === 'tablet') {
|
} else if (deviceType === SessionDeviceType.Tablet) {
|
||||||
return 'device_tablet_portrait';
|
return 'device_tablet_portrait';
|
||||||
} else if (deviceType === 'tv') {
|
} else if (deviceType === SessionDeviceType.TV) {
|
||||||
return 'tv';
|
return 'tv';
|
||||||
} else if (deviceType === 'mcp') {
|
} else if (deviceType === SessionDeviceType.Api) {
|
||||||
return 'sparkles';
|
|
||||||
} else if (deviceType === 'cli') {
|
|
||||||
return 'chevron_left_slash_chevron_right';
|
return 'chevron_left_slash_chevron_right';
|
||||||
|
} else if (deviceType === SessionDeviceType.MCP) {
|
||||||
|
return 'sparkles';
|
||||||
} else {
|
} else {
|
||||||
return 'device_desktop';
|
return 'device_desktop';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user