mirror of
https://github.com/casdoor/casdoor.git
synced 2025-08-30 19:50:27 +08:00
Compare commits
23 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8ede4993af | ||
![]() |
d04dd33d8b | ||
![]() |
8cb21253f6 | ||
![]() |
7fc697b711 | ||
![]() |
80e6e7f0a7 | ||
![]() |
d29fc88d68 | ||
![]() |
225e9cf70a | ||
![]() |
c57c6e37dd | ||
![]() |
4d860525bf | ||
![]() |
a64263f812 | ||
![]() |
95ab2472ce | ||
![]() |
54e4747dbc | ||
![]() |
2389d47c34 | ||
![]() |
9c4f0f042e | ||
![]() |
e25e210b06 | ||
![]() |
df61a536c1 | ||
![]() |
47da3cdaa0 | ||
![]() |
8d246f2d98 | ||
![]() |
44cd55e55f | ||
![]() |
6b42d35223 | ||
![]() |
c84150cede | ||
![]() |
de2689ac39 | ||
![]() |
88c0856d17 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -29,4 +29,6 @@ lastupdate.tmp
|
||||
commentsRouter*.go
|
||||
|
||||
# ignore build result
|
||||
casdoor
|
||||
casdoor
|
||||
server_linux_arm64
|
||||
server_linux_amd64
|
||||
|
@@ -124,6 +124,10 @@ p, *, *, GET, /api/get-release, *, *
|
||||
p, *, *, GET, /api/get-default-application, *, *
|
||||
p, *, *, GET, /api/get-prometheus-info, *, *
|
||||
p, *, *, *, /api/metrics, *, *
|
||||
p, *, *, GET, /api/get-subscriptions, *, *
|
||||
p, *, *, GET, /api/get-pricing, *, *
|
||||
p, *, *, GET, /api/get-plan, *, *
|
||||
p, *, *, GET, /api/get-organization-names, *, *
|
||||
`
|
||||
|
||||
sa := stringadapter.NewAdapter(ruleText)
|
||||
|
@@ -189,6 +189,11 @@ func (c *ApiController) Signup() {
|
||||
object.DisableVerificationCode(authForm.Email)
|
||||
object.DisableVerificationCode(checkPhone)
|
||||
|
||||
isSignupFromPricing := authForm.Plan != "" && authForm.Pricing != ""
|
||||
if isSignupFromPricing {
|
||||
object.Subscribe(organization.Name, user.Name, authForm.Plan, authForm.Pricing)
|
||||
}
|
||||
|
||||
record := object.NewRecord(c.Ctx)
|
||||
record.Organization = application.Organization
|
||||
record.User = user.Name
|
||||
|
@@ -118,8 +118,7 @@ func (c *ApiController) GetOrganizationApplications() {
|
||||
}
|
||||
|
||||
if limit == "" || page == "" {
|
||||
var applications []*object.Application
|
||||
applications = object.GetOrganizationApplications(owner, organization)
|
||||
applications := object.GetOrganizationApplications(owner, organization)
|
||||
c.Data["json"] = object.GetMaskedApplications(applications, userId)
|
||||
c.ServeJSON()
|
||||
} else {
|
||||
|
@@ -30,8 +30,7 @@ import (
|
||||
// @Success 200 {array} object.Chat The Response object
|
||||
// @router /get-chats [get]
|
||||
func (c *ApiController) GetChats() {
|
||||
owner := c.Input().Get("owner")
|
||||
owner = "admin"
|
||||
owner := "admin"
|
||||
limit := c.Input().Get("pageSize")
|
||||
page := c.Input().Get("p")
|
||||
field := c.Input().Get("field")
|
||||
|
@@ -148,3 +148,16 @@ func (c *ApiController) GetDefaultApplication() {
|
||||
maskedApplication := object.GetMaskedApplication(application, userId)
|
||||
c.ResponseOk(maskedApplication)
|
||||
}
|
||||
|
||||
// GetOrganizationNames ...
|
||||
// @Title GetOrganizationNames
|
||||
// @Tag Organization API
|
||||
// @Param owner query string true "owner"
|
||||
// @Description get all organization names
|
||||
// @Success 200 {array} object.Organization The Response object
|
||||
// @router /get-organization-names [get]
|
||||
func (c *ApiController) GetOrganizationNames() {
|
||||
owner := c.Input().Get("owner")
|
||||
organizationNames := object.GetOrganizationsByFields(owner, "name")
|
||||
c.ResponseOk(organizationNames)
|
||||
}
|
||||
|
@@ -16,7 +16,6 @@ package controllers
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/beego/beego/utils/pagination"
|
||||
"github.com/casdoor/casdoor/object"
|
||||
@@ -156,15 +155,15 @@ func (c *ApiController) NotifyPayment() {
|
||||
|
||||
body := c.Ctx.Input.RequestBody
|
||||
|
||||
ok := object.NotifyPayment(c.Ctx.Request, body, owner, providerName, productName, paymentName)
|
||||
if ok {
|
||||
_, err := c.Ctx.ResponseWriter.Write([]byte("success"))
|
||||
if err != nil {
|
||||
c.ResponseError(err.Error())
|
||||
return
|
||||
}
|
||||
} else {
|
||||
panic(fmt.Errorf("NotifyPayment() failed: %v", ok))
|
||||
err, errorResponse := object.NotifyPayment(c.Ctx.Request, body, owner, providerName, productName, paymentName)
|
||||
|
||||
_, err2 := c.Ctx.ResponseWriter.Write([]byte(errorResponse))
|
||||
if err2 != nil {
|
||||
panic(err2)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
|
137
controllers/plan.go
Normal file
137
controllers/plan.go
Normal file
@@ -0,0 +1,137 @@
|
||||
// Copyright 2023 The Casdoor Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/beego/beego/utils/pagination"
|
||||
"github.com/casdoor/casdoor/object"
|
||||
"github.com/casdoor/casdoor/util"
|
||||
)
|
||||
|
||||
// GetPlans
|
||||
// @Title GetPlans
|
||||
// @Tag Plan API
|
||||
// @Description get plans
|
||||
// @Param owner query string true "The owner of plans"
|
||||
// @Success 200 {array} object.Plan The Response object
|
||||
// @router /get-plans [get]
|
||||
func (c *ApiController) GetPlans() {
|
||||
owner := c.Input().Get("owner")
|
||||
limit := c.Input().Get("pageSize")
|
||||
page := c.Input().Get("p")
|
||||
field := c.Input().Get("field")
|
||||
value := c.Input().Get("value")
|
||||
sortField := c.Input().Get("sortField")
|
||||
sortOrder := c.Input().Get("sortOrder")
|
||||
if limit == "" || page == "" {
|
||||
c.Data["json"] = object.GetPlans(owner)
|
||||
c.ServeJSON()
|
||||
} else {
|
||||
limit := util.ParseInt(limit)
|
||||
paginator := pagination.SetPaginator(c.Ctx, limit, int64(object.GetPlanCount(owner, field, value)))
|
||||
plan := object.GetPaginatedPlans(owner, paginator.Offset(), limit, field, value, sortField, sortOrder)
|
||||
c.ResponseOk(plan, paginator.Nums())
|
||||
}
|
||||
}
|
||||
|
||||
// GetPlan
|
||||
// @Title GetPlan
|
||||
// @Tag Plan API
|
||||
// @Description get plan
|
||||
// @Param id query string true "The id ( owner/name ) of the plan"
|
||||
// @Param includeOption query bool false "Should include plan's option"
|
||||
// @Success 200 {object} object.Plan The Response object
|
||||
// @router /get-plan [get]
|
||||
func (c *ApiController) GetPlan() {
|
||||
id := c.Input().Get("id")
|
||||
includeOption := c.Input().Get("includeOption") == "true"
|
||||
|
||||
plan := object.GetPlan(id)
|
||||
|
||||
if includeOption {
|
||||
options := object.GetPermissionsByRole(plan.Role)
|
||||
|
||||
for _, option := range options {
|
||||
plan.Options = append(plan.Options, option.DisplayName)
|
||||
}
|
||||
|
||||
c.Data["json"] = plan
|
||||
} else {
|
||||
c.Data["json"] = plan
|
||||
}
|
||||
c.ServeJSON()
|
||||
}
|
||||
|
||||
// UpdatePlan
|
||||
// @Title UpdatePlan
|
||||
// @Tag Plan API
|
||||
// @Description update plan
|
||||
// @Param id query string true "The id ( owner/name ) of the plan"
|
||||
// @Param body body object.Plan true "The details of the plan"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /update-plan [post]
|
||||
func (c *ApiController) UpdatePlan() {
|
||||
id := c.Input().Get("id")
|
||||
|
||||
var plan object.Plan
|
||||
err := json.Unmarshal(c.Ctx.Input.RequestBody, &plan)
|
||||
if err != nil {
|
||||
c.ResponseError(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
c.Data["json"] = wrapActionResponse(object.UpdatePlan(id, &plan))
|
||||
c.ServeJSON()
|
||||
}
|
||||
|
||||
// AddPlan
|
||||
// @Title AddPlan
|
||||
// @Tag Plan API
|
||||
// @Description add plan
|
||||
// @Param body body object.Plan true "The details of the plan"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /add-plan [post]
|
||||
func (c *ApiController) AddPlan() {
|
||||
var plan object.Plan
|
||||
err := json.Unmarshal(c.Ctx.Input.RequestBody, &plan)
|
||||
if err != nil {
|
||||
c.ResponseError(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
c.Data["json"] = wrapActionResponse(object.AddPlan(&plan))
|
||||
c.ServeJSON()
|
||||
}
|
||||
|
||||
// DeletePlan
|
||||
// @Title DeletePlan
|
||||
// @Tag Plan API
|
||||
// @Description delete plan
|
||||
// @Param body body object.Plan true "The details of the plan"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /delete-plan [post]
|
||||
func (c *ApiController) DeletePlan() {
|
||||
var plan object.Plan
|
||||
err := json.Unmarshal(c.Ctx.Input.RequestBody, &plan)
|
||||
if err != nil {
|
||||
c.ResponseError(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
c.Data["json"] = wrapActionResponse(object.DeletePlan(&plan))
|
||||
c.ServeJSON()
|
||||
}
|
125
controllers/pricing.go
Normal file
125
controllers/pricing.go
Normal file
@@ -0,0 +1,125 @@
|
||||
// Copyright 2023 The Casdoor Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/beego/beego/utils/pagination"
|
||||
"github.com/casdoor/casdoor/object"
|
||||
"github.com/casdoor/casdoor/util"
|
||||
)
|
||||
|
||||
// GetPricings
|
||||
// @Title GetPricings
|
||||
// @Tag Pricing API
|
||||
// @Description get pricings
|
||||
// @Param owner query string true "The owner of pricings"
|
||||
// @Success 200 {array} object.Pricing The Response object
|
||||
// @router /get-pricings [get]
|
||||
func (c *ApiController) GetPricings() {
|
||||
owner := c.Input().Get("owner")
|
||||
limit := c.Input().Get("pageSize")
|
||||
page := c.Input().Get("p")
|
||||
field := c.Input().Get("field")
|
||||
value := c.Input().Get("value")
|
||||
sortField := c.Input().Get("sortField")
|
||||
sortOrder := c.Input().Get("sortOrder")
|
||||
if limit == "" || page == "" {
|
||||
c.Data["json"] = object.GetPricings(owner)
|
||||
c.ServeJSON()
|
||||
} else {
|
||||
limit := util.ParseInt(limit)
|
||||
paginator := pagination.SetPaginator(c.Ctx, limit, int64(object.GetPricingCount(owner, field, value)))
|
||||
pricing := object.GetPaginatedPricings(owner, paginator.Offset(), limit, field, value, sortField, sortOrder)
|
||||
c.ResponseOk(pricing, paginator.Nums())
|
||||
}
|
||||
}
|
||||
|
||||
// GetPricing
|
||||
// @Title GetPricing
|
||||
// @Tag Pricing API
|
||||
// @Description get pricing
|
||||
// @Param id query string true "The id ( owner/name ) of the pricing"
|
||||
// @Success 200 {object} object.pricing The Response object
|
||||
// @router /get-pricing [get]
|
||||
func (c *ApiController) GetPricing() {
|
||||
id := c.Input().Get("id")
|
||||
|
||||
pricing := object.GetPricing(id)
|
||||
|
||||
c.Data["json"] = pricing
|
||||
c.ServeJSON()
|
||||
}
|
||||
|
||||
// UpdatePricing
|
||||
// @Title UpdatePricing
|
||||
// @Tag Pricing API
|
||||
// @Description update pricing
|
||||
// @Param id query string true "The id ( owner/name ) of the pricing"
|
||||
// @Param body body object.Pricing true "The details of the pricing"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /update-pricing [post]
|
||||
func (c *ApiController) UpdatePricing() {
|
||||
id := c.Input().Get("id")
|
||||
|
||||
var pricing object.Pricing
|
||||
err := json.Unmarshal(c.Ctx.Input.RequestBody, &pricing)
|
||||
if err != nil {
|
||||
c.ResponseError(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
c.Data["json"] = wrapActionResponse(object.UpdatePricing(id, &pricing))
|
||||
c.ServeJSON()
|
||||
}
|
||||
|
||||
// AddPricing
|
||||
// @Title AddPricing
|
||||
// @Tag Pricing API
|
||||
// @Description add pricing
|
||||
// @Param body body object.Pricing true "The details of the pricing"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /add-pricing [post]
|
||||
func (c *ApiController) AddPricing() {
|
||||
var pricing object.Pricing
|
||||
err := json.Unmarshal(c.Ctx.Input.RequestBody, &pricing)
|
||||
if err != nil {
|
||||
c.ResponseError(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
c.Data["json"] = wrapActionResponse(object.AddPricing(&pricing))
|
||||
c.ServeJSON()
|
||||
}
|
||||
|
||||
// DeletePricing
|
||||
// @Title DeletePricing
|
||||
// @Tag Pricing API
|
||||
// @Description delete pricing
|
||||
// @Param body body object.Pricing true "The details of the pricing"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /delete-pricing [post]
|
||||
func (c *ApiController) DeletePricing() {
|
||||
var pricing object.Pricing
|
||||
err := json.Unmarshal(c.Ctx.Input.RequestBody, &pricing)
|
||||
if err != nil {
|
||||
c.ResponseError(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
c.Data["json"] = wrapActionResponse(object.DeletePricing(&pricing))
|
||||
c.ServeJSON()
|
||||
}
|
125
controllers/subscription.go
Normal file
125
controllers/subscription.go
Normal file
@@ -0,0 +1,125 @@
|
||||
// Copyright 2023 The Casdoor Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/beego/beego/utils/pagination"
|
||||
"github.com/casdoor/casdoor/object"
|
||||
"github.com/casdoor/casdoor/util"
|
||||
)
|
||||
|
||||
// GetSubscriptions
|
||||
// @Title GetSubscriptions
|
||||
// @Tag Subscription API
|
||||
// @Description get subscriptions
|
||||
// @Param owner query string true "The owner of subscriptions"
|
||||
// @Success 200 {array} object.Subscription The Response object
|
||||
// @router /get-subscriptions [get]
|
||||
func (c *ApiController) GetSubscriptions() {
|
||||
owner := c.Input().Get("owner")
|
||||
limit := c.Input().Get("pageSize")
|
||||
page := c.Input().Get("p")
|
||||
field := c.Input().Get("field")
|
||||
value := c.Input().Get("value")
|
||||
sortField := c.Input().Get("sortField")
|
||||
sortOrder := c.Input().Get("sortOrder")
|
||||
if limit == "" || page == "" {
|
||||
c.Data["json"] = object.GetSubscriptions(owner)
|
||||
c.ServeJSON()
|
||||
} else {
|
||||
limit := util.ParseInt(limit)
|
||||
paginator := pagination.SetPaginator(c.Ctx, limit, int64(object.GetSubscriptionCount(owner, field, value)))
|
||||
subscription := object.GetPaginationSubscriptions(owner, paginator.Offset(), limit, field, value, sortField, sortOrder)
|
||||
c.ResponseOk(subscription, paginator.Nums())
|
||||
}
|
||||
}
|
||||
|
||||
// GetSubscription
|
||||
// @Title GetSubscription
|
||||
// @Tag Subscription API
|
||||
// @Description get subscription
|
||||
// @Param id query string true "The id ( owner/name ) of the subscription"
|
||||
// @Success 200 {object} object.subscription The Response object
|
||||
// @router /get-subscription [get]
|
||||
func (c *ApiController) GetSubscription() {
|
||||
id := c.Input().Get("id")
|
||||
|
||||
subscription := object.GetSubscription(id)
|
||||
|
||||
c.Data["json"] = subscription
|
||||
c.ServeJSON()
|
||||
}
|
||||
|
||||
// UpdateSubscription
|
||||
// @Title UpdateSubscription
|
||||
// @Tag Subscription API
|
||||
// @Description update subscription
|
||||
// @Param id query string true "The id ( owner/name ) of the subscription"
|
||||
// @Param body body object.Subscription true "The details of the subscription"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /update-subscription [post]
|
||||
func (c *ApiController) UpdateSubscription() {
|
||||
id := c.Input().Get("id")
|
||||
|
||||
var subscription object.Subscription
|
||||
err := json.Unmarshal(c.Ctx.Input.RequestBody, &subscription)
|
||||
if err != nil {
|
||||
c.ResponseError(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
c.Data["json"] = wrapActionResponse(object.UpdateSubscription(id, &subscription))
|
||||
c.ServeJSON()
|
||||
}
|
||||
|
||||
// AddSubscription
|
||||
// @Title AddSubscription
|
||||
// @Tag Subscription API
|
||||
// @Description add subscription
|
||||
// @Param body body object.Subscription true "The details of the subscription"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /add-subscription [post]
|
||||
func (c *ApiController) AddSubscription() {
|
||||
var subscription object.Subscription
|
||||
err := json.Unmarshal(c.Ctx.Input.RequestBody, &subscription)
|
||||
if err != nil {
|
||||
c.ResponseError(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
c.Data["json"] = wrapActionResponse(object.AddSubscription(&subscription))
|
||||
c.ServeJSON()
|
||||
}
|
||||
|
||||
// DeleteSubscription
|
||||
// @Title DeleteSubscription
|
||||
// @Tag Subscription API
|
||||
// @Description delete subscription
|
||||
// @Param body body object.Subscription true "The details of the subscription"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /delete-subscription [post]
|
||||
func (c *ApiController) DeleteSubscription() {
|
||||
var subscription object.Subscription
|
||||
err := json.Unmarshal(c.Ctx.Input.RequestBody, &subscription)
|
||||
if err != nil {
|
||||
c.ResponseError(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
c.Data["json"] = wrapActionResponse(object.DeleteSubscription(&subscription))
|
||||
c.ServeJSON()
|
||||
}
|
@@ -54,4 +54,7 @@ type AuthForm struct {
|
||||
MfaType string `json:"mfaType"`
|
||||
Passcode string `json:"passcode"`
|
||||
RecoveryCode string `json:"recoveryCode"`
|
||||
|
||||
Plan string `json:"plan"`
|
||||
Pricing string `json:"pricing"`
|
||||
}
|
||||
|
20
go.mod
20
go.mod
@@ -8,8 +8,9 @@ require (
|
||||
github.com/alexedwards/argon2id v0.0.0-20211130144151-3585854a6387
|
||||
github.com/aliyun/alibaba-cloud-sdk-go v1.62.188 // indirect
|
||||
github.com/aws/aws-sdk-go v1.44.4
|
||||
github.com/beego/beego v1.12.11
|
||||
github.com/beego/beego v1.12.12
|
||||
github.com/beevik/etree v1.1.0
|
||||
github.com/casbin/casbin v1.9.1 // indirect
|
||||
github.com/casbin/casbin/v2 v2.30.1
|
||||
github.com/casdoor/go-sms-sender v0.6.1
|
||||
github.com/casdoor/gomail/v2 v2.0.1
|
||||
@@ -18,6 +19,7 @@ require (
|
||||
github.com/dchest/captcha v0.0.0-20200903113550-03f5f0333e1f
|
||||
github.com/denisenkom/go-mssqldb v0.9.0
|
||||
github.com/dlclark/regexp2 v1.9.0 // indirect
|
||||
github.com/elazarl/go-bindata-assetfs v1.0.1 // indirect
|
||||
github.com/fogleman/gg v1.3.0
|
||||
github.com/forestmgy/ldapserver v1.1.0
|
||||
github.com/go-git/go-git/v5 v5.6.0
|
||||
@@ -28,24 +30,27 @@ require (
|
||||
github.com/go-webauthn/webauthn v0.6.0
|
||||
github.com/golang-jwt/jwt/v4 v4.5.0
|
||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/golang/snappy v0.0.4 // indirect
|
||||
github.com/google/uuid v1.3.0
|
||||
github.com/gorilla/mux v1.7.3 // indirect
|
||||
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect
|
||||
github.com/lestrrat-go/jwx v1.2.21
|
||||
github.com/lib/pq v1.8.0
|
||||
github.com/lib/pq v1.10.2
|
||||
github.com/lor00x/goldap v0.0.0-20180618054307-a546dffdd1a3
|
||||
github.com/markbates/goth v1.75.2
|
||||
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect
|
||||
github.com/nyaruka/phonenumbers v1.1.5
|
||||
github.com/pkoukk/tiktoken-go v0.1.1
|
||||
github.com/prometheus/client_golang v1.7.0
|
||||
github.com/prometheus/client_golang v1.11.1
|
||||
github.com/prometheus/client_model v0.2.0
|
||||
github.com/qiangmzsx/string-adapter/v2 v2.1.0
|
||||
github.com/robfig/cron/v3 v3.0.1
|
||||
github.com/russellhaering/gosaml2 v0.6.0
|
||||
github.com/russellhaering/goxmldsig v1.1.1
|
||||
github.com/russellhaering/gosaml2 v0.9.0
|
||||
github.com/russellhaering/goxmldsig v1.2.0
|
||||
github.com/sashabaranov/go-openai v1.9.1
|
||||
github.com/satori/go.uuid v1.2.0
|
||||
github.com/shiena/ansicolor v0.0.0-20200904210342-c7312218db18 // indirect
|
||||
github.com/shirou/gopsutil v3.21.11+incompatible
|
||||
github.com/siddontang/go-log v0.0.0-20190221022429-1e957dd83bed
|
||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
|
||||
@@ -57,10 +62,11 @@ require (
|
||||
github.com/xorm-io/xorm v1.1.6
|
||||
github.com/yusufpapurcu/wmi v1.2.2 // indirect
|
||||
golang.org/x/crypto v0.6.0
|
||||
golang.org/x/net v0.6.0
|
||||
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
|
||||
golang.org/x/net v0.7.0
|
||||
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
gopkg.in/square/go-jose.v2 v2.6.0
|
||||
gopkg.in/yaml.v2 v2.3.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
modernc.org/sqlite v1.10.1-0.20210314190707-798bbeb9bb84
|
||||
)
|
||||
|
72
go.sum
72
go.sum
@@ -73,6 +73,7 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy
|
||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
|
||||
github.com/alexedwards/argon2id v0.0.0-20211130144151-3585854a6387 h1:loy0fjI90vF44BPW4ZYOkE3tDkGTy7yHURusOJimt+I=
|
||||
github.com/alexedwards/argon2id v0.0.0-20211130144151-3585854a6387/go.mod h1:GuR5j/NW7AU7tDAQUDGCtpiPxWIOy/c3kiRDnlwiCHc=
|
||||
github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc=
|
||||
@@ -92,8 +93,8 @@ github.com/aws/aws-sdk-go v1.44.4 h1:ePN0CVJMdiz2vYUcJH96eyxRrtKGSDMgyhP6rah2OgE
|
||||
github.com/aws/aws-sdk-go v1.44.4/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
|
||||
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f h1:ZNv7On9kyUzm7fvRZumSyy/IUiSC7AzL0I1jKKtwooA=
|
||||
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc=
|
||||
github.com/beego/beego v1.12.11 h1:MWKcnpavb7iAIS0m6uuEq6pHKkYvGNw/5umIUKqL7jM=
|
||||
github.com/beego/beego v1.12.11/go.mod h1:QURFL1HldOcCZAxnc1cZ7wrplsYR5dKPHFjmk6WkLAs=
|
||||
github.com/beego/beego v1.12.12 h1:ARY1sNVSS23N0mEQIhSqRDTyyDlx95JY0V3GogBbZbQ=
|
||||
github.com/beego/beego v1.12.12/go.mod h1:QURFL1HldOcCZAxnc1cZ7wrplsYR5dKPHFjmk6WkLAs=
|
||||
github.com/beego/goyaml2 v0.0.0-20130207012346-5545475820dd/go.mod h1:1b+Y/CofkYwXMUU0OhQqGvsY2Bvgr4j6jfT699wyZKQ=
|
||||
github.com/beego/x2j v0.0.0-20131220205130-a0352aadc542/go.mod h1:kSeGC/p1AbBiEp5kat81+DSQrZenVBZXklMLaELspWU=
|
||||
github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs=
|
||||
@@ -106,8 +107,9 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/bradfitz/gomemcache v0.0.0-20180710155616-bc664df96737/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60=
|
||||
github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
|
||||
github.com/casbin/casbin v1.7.0 h1:PuzlE8w0JBg/DhIqnkF1Dewf3z+qmUZMVN07PonvVUQ=
|
||||
github.com/casbin/casbin v1.7.0/go.mod h1:c67qKN6Oum3UF5Q1+BByfFxkwKvhwW57ITjqwtzR1KE=
|
||||
github.com/casbin/casbin v1.9.1 h1:ucjbS5zTrmSLtH4XogqOG920Poe6QatdXtz1FEbApeM=
|
||||
github.com/casbin/casbin v1.9.1/go.mod h1:z8uPsfBJGUsnkagrt3G8QvjgTKFMBJ32UP8HpZllfog=
|
||||
github.com/casbin/casbin/v2 v2.1.0/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
|
||||
github.com/casbin/casbin/v2 v2.28.3/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg=
|
||||
github.com/casbin/casbin/v2 v2.30.1 h1:P5HWadDL7olwUXNdcuKUBk+x75Y2eitFxYTcLNKeKF0=
|
||||
@@ -168,8 +170,9 @@ github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4
|
||||
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||
github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
|
||||
github.com/elastic/go-elasticsearch/v6 v6.8.5/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI=
|
||||
github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk=
|
||||
github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
|
||||
github.com/elazarl/go-bindata-assetfs v1.0.1 h1:m0kkaHRKEu7tUIUFVwhGGGYClXvyl4RE03qmvRTNfbw=
|
||||
github.com/elazarl/go-bindata-assetfs v1.0.1/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
|
||||
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
|
||||
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
|
||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
@@ -205,10 +208,12 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
|
||||
github.com/go-ldap/ldap/v3 v3.3.0 h1:lwx+SJpgOHd8tG6SumBQZXCmNX51zM8B1cfxJ5gv4tQ=
|
||||
github.com/go-ldap/ldap/v3 v3.3.0/go.mod h1:iYS1MdmrmceOJ1QOTnRXrIs7i3kloqtmGQjRvjKpyMg=
|
||||
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
||||
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
|
||||
github.com/go-mysql-org/go-mysql v1.7.0 h1:qE5FTRb3ZeTQmlk3pjE+/m2ravGxxRDrVDTyDe9tvqI=
|
||||
github.com/go-mysql-org/go-mysql v1.7.0/go.mod h1:9cRWLtuXNKhamUPMkrDVzBhaomGvqLRLtBiyjvjc4pk=
|
||||
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
|
||||
@@ -273,8 +278,10 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM=
|
||||
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
|
||||
@@ -292,6 +299,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
||||
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-tpm v0.1.2-0.20190725015402-ae6dd98980d4/go.mod h1:H9HbmUG2YgV/PHITkO7p6wxEEj/v5nlsVWIwumwH2NI=
|
||||
@@ -321,8 +330,9 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8=
|
||||
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
|
||||
github.com/gorilla/mux v1.6.2 h1:Pgr17XVTNXAk3q/r4CpKzC5xBM/qW1uVLV+IhRZpIIk=
|
||||
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
||||
github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw=
|
||||
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
||||
github.com/gorilla/pat v0.0.0-20180118222023-199c85a7f6d1 h1:LqbZZ9sNMWVjeXS4NN5oVvhMjDyLhmA1LG86oSo+IqY=
|
||||
github.com/gorilla/pat v0.0.0-20180118222023-199c85a7f6d1/go.mod h1:YeAe0gNeiNT5hoiZRI4yiOky6jVdNvfO2N6Kav/HmxY=
|
||||
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
|
||||
@@ -356,9 +366,9 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGw
|
||||
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
|
||||
github.com/jmoiron/sqlx v1.3.3/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXLBMCQ=
|
||||
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
|
||||
github.com/jonboulle/clockwork v0.2.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8=
|
||||
github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ=
|
||||
github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8=
|
||||
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
|
||||
github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
@@ -368,6 +378,7 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1
|
||||
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
||||
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
|
||||
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uiaSepXwyf3o52HaUYcV+Tu66S3F5GA=
|
||||
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8=
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
|
||||
@@ -377,6 +388,7 @@ github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF
|
||||
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
@@ -408,8 +420,9 @@ github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmt
|
||||
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lib/pq v1.7.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
github.com/lib/pq v1.8.0 h1:9xohqzkUwzR4Ga4ivdTcawVS89YSDVxXMa3xJX3cGzg=
|
||||
github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8=
|
||||
github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
github.com/lor00x/goldap v0.0.0-20180618054307-a546dffdd1a3 h1:wIONC+HMNRqmWBjuMxhatuSzHaljStc4gjDeKycxy0A=
|
||||
github.com/lor00x/goldap v0.0.0-20180618054307-a546dffdd1a3/go.mod h1:37YR9jabpiIxsb8X9VCIx8qFOjTDIIrIHHODa8C4gz0=
|
||||
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||
@@ -419,8 +432,8 @@ github.com/markbates/goth v1.75.2 h1:C7KloBMMk50JyXaHhzfqWYLW6+bDcSVIvUGHXneLWro
|
||||
github.com/markbates/goth v1.75.2/go.mod h1:X6xdNgpapSENS0O35iTBBcMHoJDQDfI9bJl+APCkYMc=
|
||||
github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A=
|
||||
github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
|
||||
github.com/mattermost/xml-roundtrip-validator v0.0.0-20201208211235-fe770d50d911 h1:erppMjjp69Rertg1zlgRbLJH1u+eCmRPxKjMZ5I8/Ro=
|
||||
github.com/mattermost/xml-roundtrip-validator v0.0.0-20201208211235-fe770d50d911/go.mod h1:qccnGMcpgwcNaBnxqpJpWWUiPNr5H3O8eDgGV9gT5To=
|
||||
github.com/mattermost/xml-roundtrip-validator v0.1.0 h1:RXbVD2UAl7A7nOTR4u7E3ILa4IbtvKBHw64LDsmu9hU=
|
||||
github.com/mattermost/xml-roundtrip-validator v0.1.0/go.mod h1:qccnGMcpgwcNaBnxqpJpWWUiPNr5H3O8eDgGV9gT5To=
|
||||
github.com/mattn/go-ieproxy v0.0.1 h1:qiyop7gCflfhwCzGyeT0gro3sF9AIg9HU98JORTkqfI=
|
||||
github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E=
|
||||
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
|
||||
@@ -445,6 +458,7 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb
|
||||
github.com/mrjones/oauth v0.0.0-20180629183705-f4e24b6d100c h1:3wkDRdxK92dF+c1ke2dtj7ZzemFWBHB9plnJOtlwdFA=
|
||||
github.com/mrjones/oauth v0.0.0-20180629183705-f4e24b6d100c/go.mod h1:skjdDftzkFALcuGzYSklqYd8gvat6F1gZJ4YPVbkZpM=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ=
|
||||
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U=
|
||||
@@ -486,8 +500,10 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
|
||||
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
|
||||
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
|
||||
github.com/prometheus/client_golang v1.7.0 h1:wCi7urQOGBsYcQROHqpUUX4ct84xp40t9R9JX0FuA/U=
|
||||
github.com/prometheus/client_golang v1.7.0/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
|
||||
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
|
||||
github.com/prometheus/client_golang v1.11.1 h1:+4eQaD7vAZ6DsfsxB15hbE0odUjGI5ARs9yskGu1v4s=
|
||||
github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
|
||||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
@@ -496,13 +512,15 @@ github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T
|
||||
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
|
||||
github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||
github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc=
|
||||
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
|
||||
github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ=
|
||||
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
|
||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8=
|
||||
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
|
||||
github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4=
|
||||
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
|
||||
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
|
||||
github.com/qiangmzsx/string-adapter/v2 v2.1.0 h1:q0y8TPa/sTwtriJPRe8gWL++PuZ+XbOUuvKU+hvtTYs=
|
||||
github.com/qiangmzsx/string-adapter/v2 v2.1.0/go.mod h1:PElPB7b7HnGKTsuADAffFpOQXHqjEGJz1+U1a6yR5wA=
|
||||
@@ -518,11 +536,10 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
|
||||
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||
github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
|
||||
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
|
||||
github.com/russellhaering/gosaml2 v0.6.0 h1:OED8FLgczXxXAPlKhnJHQfmEig52tDX2qeXdPtZRIKc=
|
||||
github.com/russellhaering/gosaml2 v0.6.0/go.mod h1:CtzxpPr4+bevsATaqR0rw3aqrNlX274b+3C6vFTLCk8=
|
||||
github.com/russellhaering/goxmldsig v1.1.0/go.mod h1:QK8GhXPB3+AfuCrfo0oRISa9NfzeCpWmxeGnqEpDF9o=
|
||||
github.com/russellhaering/goxmldsig v1.1.1 h1:vI0r2osGF1A9PLvsGdPUAGwEIrKa4Pj5sesSBsebIxM=
|
||||
github.com/russellhaering/goxmldsig v1.1.1/go.mod h1:gM4MDENBQf7M+V824SGfyIUVFWydB7n0KkEubVJl+Tw=
|
||||
github.com/russellhaering/gosaml2 v0.9.0 h1:CNMnH42z/GirrKjdmNrSS6bAAs47F9bPdl4PfRmVOIk=
|
||||
github.com/russellhaering/gosaml2 v0.9.0/go.mod h1:byViER/1YPUa0Puj9ROZblpoq2jsE7h/CJmitzX0geU=
|
||||
github.com/russellhaering/goxmldsig v1.2.0 h1:Y6GTTc9Un5hCxSzVz4UIWQ/zuVwDvzJk80guqzwx6Vg=
|
||||
github.com/russellhaering/goxmldsig v1.2.0/go.mod h1:gM4MDENBQf7M+V824SGfyIUVFWydB7n0KkEubVJl+Tw=
|
||||
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
|
||||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/sashabaranov/go-openai v1.9.1 h1:3N52HkJKo9Zlo/oe1AVv5ZkCOny0ra58/ACvAxkN3MM=
|
||||
@@ -531,8 +548,9 @@ github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
|
||||
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
|
||||
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
|
||||
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
|
||||
github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 h1:X+yvsM2yrEktyI+b2qND5gpH8YhURn0k8OCaeRnkINo=
|
||||
github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg=
|
||||
github.com/shiena/ansicolor v0.0.0-20200904210342-c7312218db18 h1:DAYUYH5869yV94zvCES9F51oYtN5oGlwjxJJz7ZCnik=
|
||||
github.com/shiena/ansicolor v0.0.0-20200904210342-c7312218db18/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg=
|
||||
github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=
|
||||
github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
|
||||
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24 h1:pntxY8Ary0t43dCZ5dqY4YTJCObLY1kIXl0uzMv+7DE=
|
||||
@@ -548,6 +566,7 @@ github.com/siddontang/goredis v0.0.0-20150324035039-760763f78400/go.mod h1:DDcKz
|
||||
github.com/siddontang/rdb v0.0.0-20150307021120-fc89ed2e418d/go.mod h1:AMEsy7v5z92TR1JKMkLLoaOQk++LVnOKL3ScbJ8GNGA=
|
||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
|
||||
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||
github.com/skeema/knownhosts v1.1.0 h1:Wvr9V0MxhjRbl3f9nMnKnFfiWTJmtECJ9Njkea3ysW0=
|
||||
github.com/skeema/knownhosts v1.1.0/go.mod h1:sKFq3RD6/TKZkSWn8boUbDC7Qkgcv+8XXijpFO6roag=
|
||||
@@ -700,8 +719,9 @@ golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHl
|
||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
|
||||
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k=
|
||||
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug=
|
||||
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
||||
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||
@@ -758,8 +778,9 @@ golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfS
|
||||
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
|
||||
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
|
||||
golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
|
||||
golang.org/x/net v0.6.0 h1:L4ZwwTvKW9gr0ZMS1yrHD9GZhIuVjOBBnaKH+SPQK0Q=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
|
||||
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
@@ -817,6 +838,7 @@ golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
@@ -827,6 +849,7 @@ golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210629170331-7dc0b73dc9fb/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
@@ -1005,8 +1028,10 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
|
||||
google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk=
|
||||
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk=
|
||||
@@ -1039,8 +1064,9 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
|
@@ -68,10 +68,10 @@
|
||||
"Missing parameter": "Thiếu tham số",
|
||||
"Please login first": "Vui lòng đăng nhập trước",
|
||||
"The user: %s doesn't exist": "Người dùng: %s không tồn tại",
|
||||
"don't support captchaProvider: ": "Không hỗ trợ captchaProvider:"
|
||||
"don't support captchaProvider: ": "không hỗ trợ captchaProvider: "
|
||||
},
|
||||
"ldap": {
|
||||
"Ldap server exist": "Máy chủ Ldap tồn tại"
|
||||
"Ldap server exist": "Máy chủ LDAP tồn tại"
|
||||
},
|
||||
"link": {
|
||||
"Please link first": "Vui lòng kết nối trước tiên",
|
||||
|
@@ -83,7 +83,7 @@
|
||||
},
|
||||
"organization": {
|
||||
"Only admin can modify the %s.": "仅允许管理员可以修改%s",
|
||||
"The %s is immutable.": "%s是不可变的",
|
||||
"The %s is immutable.": "%s 是不可变的",
|
||||
"Unknown modify rule %s.": "未知的修改规则: %s"
|
||||
},
|
||||
"provider": {
|
||||
@@ -143,7 +143,7 @@
|
||||
"the user does not exist, please sign up first": "用户不存在,请先注册"
|
||||
},
|
||||
"webauthn": {
|
||||
"Found no credentials for this user": "该用户没有WebAuthn凭据",
|
||||
"Found no credentials for this user": "该用户没有 WebAuthn 凭据",
|
||||
"Please call WebAuthnSigninBegin first": "请先调用WebAuthnSigninBegin函数"
|
||||
}
|
||||
}
|
||||
|
@@ -16,6 +16,7 @@ package idp
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
@@ -83,7 +84,7 @@ func (idp *CasdoorIdProvider) GetToken(code string) (*oauth2.Token, error) {
|
||||
|
||||
// check if token is expired
|
||||
if pToken.ExpiresIn <= 0 {
|
||||
return nil, fmt.Errorf("%s", pToken.AccessToken)
|
||||
return nil, errors.New(pToken.AccessToken)
|
||||
}
|
||||
token := &oauth2.Token{
|
||||
AccessToken: pToken.AccessToken,
|
||||
|
@@ -75,7 +75,9 @@ func (idp *WeComIdProvider) GetToken(code string) (*oauth2.Token, error) {
|
||||
ProviderSecret string `json:"provider_secret"`
|
||||
}{idp.Config.ClientID, idp.Config.ClientSecret}
|
||||
data, err := idp.postWithBody(pTokenParams, "https://qyapi.weixin.qq.com/cgi-bin/service/get_provider_token")
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
pToken := &WeComProviderToken{}
|
||||
err = json.Unmarshal(data, pToken)
|
||||
if err != nil {
|
||||
|
1
main.go
1
main.go
@@ -27,7 +27,6 @@ import (
|
||||
"github.com/casdoor/casdoor/object"
|
||||
"github.com/casdoor/casdoor/proxy"
|
||||
"github.com/casdoor/casdoor/routers"
|
||||
_ "github.com/casdoor/casdoor/routers"
|
||||
"github.com/casdoor/casdoor/util"
|
||||
)
|
||||
|
||||
|
@@ -240,6 +240,21 @@ func (a *Adapter) createTable() {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
err = a.Engine.Sync2(new(Subscription))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
err = a.Engine.Sync2(new(Plan))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
err = a.Engine.Sync2(new(Pricing))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func GetSession(owner string, offset, limit int, field, value, sortField, sortOrder string) *xorm.Session {
|
||||
|
@@ -38,7 +38,7 @@ type Application struct {
|
||||
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
|
||||
|
||||
DisplayName string `xorm:"varchar(100)" json:"displayName"`
|
||||
Logo string `xorm:"varchar(100)" json:"logo"`
|
||||
Logo string `xorm:"varchar(200)" json:"logo"`
|
||||
HomepageUrl string `xorm:"varchar(100)" json:"homepageUrl"`
|
||||
Description string `xorm:"varchar(100)" json:"description"`
|
||||
Organization string `xorm:"varchar(100)" json:"organization"`
|
||||
@@ -51,6 +51,7 @@ type Application struct {
|
||||
EnableSamlCompress bool `json:"enableSamlCompress"`
|
||||
EnableWebAuthn bool `json:"enableWebAuthn"`
|
||||
EnableLinkWithEmail bool `json:"enableLinkWithEmail"`
|
||||
OrgChoiceMode string `json:"orgChoiceMode"`
|
||||
SamlReplyUrl string `xorm:"varchar(100)" json:"samlReplyUrl"`
|
||||
Providers []*ProviderItem `xorm:"mediumtext" json:"providers"`
|
||||
SignupItems []*SignupItem `xorm:"varchar(1000)" json:"signupItems"`
|
||||
@@ -145,7 +146,7 @@ func getProviderMap(owner string) map[string]*Provider {
|
||||
m := map[string]*Provider{}
|
||||
for _, provider := range providers {
|
||||
// Get QRCode only once
|
||||
if provider.Type == "WeChat" && provider.DisableSsl == true && provider.Content == "" {
|
||||
if provider.Type == "WeChat" && provider.DisableSsl && provider.Content == "" {
|
||||
provider.Content, _ = idp.GetWechatOfficialAccountQRCode(provider.ClientId2, provider.ClientSecret2)
|
||||
UpdateProvider(provider.Owner+"/"+provider.Name, provider)
|
||||
}
|
||||
|
@@ -248,7 +248,7 @@ func CheckUserPassword(organization string, username string, password string, la
|
||||
enableCaptcha = options[0]
|
||||
}
|
||||
user := GetUserByFields(organization, username)
|
||||
if user == nil || user.IsDeleted == true {
|
||||
if user == nil || user.IsDeleted {
|
||||
return nil, fmt.Sprintf(i18n.Translate(lang, "general:The user: %s doesn't exist"), util.GetId(organization, username))
|
||||
}
|
||||
|
||||
|
@@ -25,10 +25,7 @@ type Migrator_1_235_0_PR_1530 struct{}
|
||||
func (*Migrator_1_235_0_PR_1530) IsMigrationNeeded() bool {
|
||||
exist, _ := adapter.Engine.IsTableExist("casbin_rule")
|
||||
|
||||
if exist {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
return exist
|
||||
}
|
||||
|
||||
func (*Migrator_1_235_0_PR_1530) DoMigration() *migrate.Migration {
|
||||
|
@@ -55,13 +55,8 @@ func isIpAddress(host string) bool {
|
||||
|
||||
// Attempt to parse the host as an IP address (both IPv4 and IPv6)
|
||||
ip := net.ParseIP(hostWithoutPort)
|
||||
if ip != nil {
|
||||
// The host is an IP address
|
||||
return true
|
||||
}
|
||||
|
||||
// The host is not an IP address
|
||||
return false
|
||||
// if host is not nil is an IP address else is not an IP address
|
||||
return ip != nil
|
||||
}
|
||||
|
||||
func getOriginFromHost(host string) (string, string) {
|
||||
|
@@ -90,6 +90,16 @@ func GetOrganizations(owner string) []*Organization {
|
||||
return organizations
|
||||
}
|
||||
|
||||
func GetOrganizationsByFields(owner string, fields ...string) []*Organization {
|
||||
organizations := []*Organization{}
|
||||
err := adapter.Engine.Desc("created_time").Cols(fields...).Find(&organizations, &Organization{Owner: owner})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return organizations
|
||||
}
|
||||
|
||||
func GetPaginationOrganizations(owner string, offset, limit int, field, value, sortField, sortOrder string) []*Organization {
|
||||
organizations := []*Organization{}
|
||||
session := GetSession(owner, offset, limit, field, value, sortField, sortOrder)
|
||||
|
@@ -152,46 +152,47 @@ func DeletePayment(payment *Payment) bool {
|
||||
return affected != 0
|
||||
}
|
||||
|
||||
func notifyPayment(request *http.Request, body []byte, owner string, providerName string, productName string, paymentName string) (*Payment, error) {
|
||||
func notifyPayment(request *http.Request, body []byte, owner string, providerName string, productName string, paymentName string) (*Payment, error, string) {
|
||||
provider := getProvider(owner, providerName)
|
||||
|
||||
pProvider, cert, err := provider.getPaymentProvider()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
payment := getPayment(owner, paymentName)
|
||||
if payment == nil {
|
||||
return nil, fmt.Errorf("the payment: %s does not exist", paymentName)
|
||||
err = fmt.Errorf("the payment: %s does not exist", paymentName)
|
||||
return nil, err, pProvider.GetResponseError(err)
|
||||
}
|
||||
|
||||
product := getProduct(owner, productName)
|
||||
if product == nil {
|
||||
return nil, fmt.Errorf("the product: %s does not exist", productName)
|
||||
}
|
||||
|
||||
provider, err := product.getProvider(providerName)
|
||||
if err != nil {
|
||||
return payment, err
|
||||
}
|
||||
|
||||
pProvider, cert, err := provider.getPaymentProvider()
|
||||
if err != nil {
|
||||
return payment, err
|
||||
err = fmt.Errorf("the product: %s does not exist", productName)
|
||||
return payment, err, pProvider.GetResponseError(err)
|
||||
}
|
||||
|
||||
productDisplayName, paymentName, price, productName, providerName, err := pProvider.Notify(request, body, cert.AuthorityPublicKey)
|
||||
if err != nil {
|
||||
return payment, err
|
||||
return payment, err, pProvider.GetResponseError(err)
|
||||
}
|
||||
|
||||
if productDisplayName != "" && productDisplayName != product.DisplayName {
|
||||
return nil, fmt.Errorf("the payment's product name: %s doesn't equal to the expected product name: %s", productDisplayName, product.DisplayName)
|
||||
err = fmt.Errorf("the payment's product name: %s doesn't equal to the expected product name: %s", productDisplayName, product.DisplayName)
|
||||
return payment, err, pProvider.GetResponseError(err)
|
||||
}
|
||||
|
||||
if price != product.Price {
|
||||
return nil, fmt.Errorf("the payment's price: %f doesn't equal to the expected price: %f", price, product.Price)
|
||||
err = fmt.Errorf("the payment's price: %f doesn't equal to the expected price: %f", price, product.Price)
|
||||
return payment, err, pProvider.GetResponseError(err)
|
||||
}
|
||||
|
||||
return payment, nil
|
||||
err = nil
|
||||
return payment, err, pProvider.GetResponseError(err)
|
||||
}
|
||||
|
||||
func NotifyPayment(request *http.Request, body []byte, owner string, providerName string, productName string, paymentName string) bool {
|
||||
payment, err := notifyPayment(request, body, owner, providerName, productName, paymentName)
|
||||
|
||||
func NotifyPayment(request *http.Request, body []byte, owner string, providerName string, productName string, paymentName string) (error, string) {
|
||||
payment, err, errorResponse := notifyPayment(request, body, owner, providerName, productName, paymentName)
|
||||
if payment != nil {
|
||||
if err != nil {
|
||||
payment.State = "Error"
|
||||
@@ -203,8 +204,7 @@ func NotifyPayment(request *http.Request, body []byte, owner string, providerNam
|
||||
UpdatePayment(payment.GetId(), payment)
|
||||
}
|
||||
|
||||
ok := err == nil
|
||||
return ok
|
||||
return err, errorResponse
|
||||
}
|
||||
|
||||
func invoicePayment(payment *Payment) (string, error) {
|
||||
|
145
object/plan.go
Normal file
145
object/plan.go
Normal file
@@ -0,0 +1,145 @@
|
||||
// Copyright 2023 The Casdoor Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package object
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/casdoor/casdoor/util"
|
||||
"github.com/xorm-io/core"
|
||||
)
|
||||
|
||||
type Plan struct {
|
||||
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
|
||||
Name string `xorm:"varchar(100) notnull pk" json:"name"`
|
||||
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
|
||||
DisplayName string `xorm:"varchar(100)" json:"displayName"`
|
||||
Description string `xorm:"varchar(100)" json:"description"`
|
||||
|
||||
PricePerMonth float64 `json:"pricePerMonth"`
|
||||
PricePerYear float64 `json:"pricePerYear"`
|
||||
Currency string `xorm:"varchar(100)" json:"currency"`
|
||||
IsEnabled bool `json:"isEnabled"`
|
||||
|
||||
Role string `xorm:"varchar(100)" json:"role"`
|
||||
Options []string `xorm:"-" json:"options"`
|
||||
}
|
||||
|
||||
func GetPlanCount(owner, field, value string) int {
|
||||
session := GetSession(owner, -1, -1, field, value, "", "")
|
||||
count, err := session.Count(&Plan{})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return int(count)
|
||||
}
|
||||
|
||||
func GetPlans(owner string) []*Plan {
|
||||
plans := []*Plan{}
|
||||
err := adapter.Engine.Desc("created_time").Find(&plans, &Plan{Owner: owner})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return plans
|
||||
}
|
||||
|
||||
func GetPaginatedPlans(owner string, offset, limit int, field, value, sortField, sortOrder string) []*Plan {
|
||||
plans := []*Plan{}
|
||||
session := GetSession(owner, offset, limit, field, value, sortField, sortOrder)
|
||||
err := session.Find(&plans)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return plans
|
||||
}
|
||||
|
||||
func getPlan(owner, name string) *Plan {
|
||||
if owner == "" || name == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
plan := Plan{Owner: owner, Name: name}
|
||||
existed, err := adapter.Engine.Get(&plan)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if existed {
|
||||
return &plan
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func GetPlan(id string) *Plan {
|
||||
owner, name := util.GetOwnerAndNameFromId(id)
|
||||
return getPlan(owner, name)
|
||||
}
|
||||
|
||||
func UpdatePlan(id string, plan *Plan) bool {
|
||||
owner, name := util.GetOwnerAndNameFromId(id)
|
||||
if getPlan(owner, name) == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
affected, err := adapter.Engine.ID(core.PK{owner, name}).AllCols().Update(plan)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return affected != 0
|
||||
}
|
||||
|
||||
func AddPlan(plan *Plan) bool {
|
||||
affected, err := adapter.Engine.Insert(plan)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return affected != 0
|
||||
}
|
||||
|
||||
func DeletePlan(plan *Plan) bool {
|
||||
affected, err := adapter.Engine.ID(core.PK{plan.Owner, plan.Name}).Delete(plan)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return affected != 0
|
||||
}
|
||||
|
||||
func (plan *Plan) GetId() string {
|
||||
return fmt.Sprintf("%s/%s", plan.Owner, plan.Name)
|
||||
}
|
||||
|
||||
func Subscribe(owner string, user string, plan string, pricing string) *Subscription {
|
||||
selectedPricing := GetPricing(fmt.Sprintf("%s/%s", owner, pricing))
|
||||
|
||||
valid := selectedPricing != nil && selectedPricing.IsEnabled
|
||||
|
||||
if !valid {
|
||||
return nil
|
||||
}
|
||||
|
||||
planBelongToPricing := selectedPricing.HasPlan(owner, plan)
|
||||
|
||||
if planBelongToPricing {
|
||||
newSubscription := NewSubscription(owner, user, plan, selectedPricing.TrialDuration)
|
||||
affected := AddSubscription(newSubscription)
|
||||
|
||||
if affected {
|
||||
return newSubscription
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
147
object/pricing.go
Normal file
147
object/pricing.go
Normal file
@@ -0,0 +1,147 @@
|
||||
// Copyright 2023 The Casdoor Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package object
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/casdoor/casdoor/util"
|
||||
"github.com/xorm-io/core"
|
||||
)
|
||||
|
||||
type Pricing struct {
|
||||
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
|
||||
Name string `xorm:"varchar(100) notnull pk" json:"name"`
|
||||
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
|
||||
DisplayName string `xorm:"varchar(100)" json:"displayName"`
|
||||
Description string `xorm:"varchar(100)" json:"description"`
|
||||
|
||||
Plans []string `xorm:"mediumtext" json:"plans"`
|
||||
IsEnabled bool `json:"isEnabled"`
|
||||
HasTrial bool `json:"hasTrial"`
|
||||
TrialDuration int `json:"trialDuration"`
|
||||
Application string `xorm:"varchar(100)" json:"application"`
|
||||
|
||||
Submitter string `xorm:"varchar(100)" json:"submitter"`
|
||||
Approver string `xorm:"varchar(100)" json:"approver"`
|
||||
ApproveTime string `xorm:"varchar(100)" json:"approveTime"`
|
||||
|
||||
State string `xorm:"varchar(100)" json:"state"`
|
||||
}
|
||||
|
||||
func GetPricingCount(owner, field, value string) int {
|
||||
session := GetSession(owner, -1, -1, field, value, "", "")
|
||||
count, err := session.Count(&Pricing{})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return int(count)
|
||||
}
|
||||
|
||||
func GetPricings(owner string) []*Pricing {
|
||||
pricings := []*Pricing{}
|
||||
err := adapter.Engine.Desc("created_time").Find(&pricings, &Pricing{Owner: owner})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return pricings
|
||||
}
|
||||
|
||||
func GetPaginatedPricings(owner string, offset, limit int, field, value, sortField, sortOrder string) []*Pricing {
|
||||
pricings := []*Pricing{}
|
||||
session := GetSession(owner, offset, limit, field, value, sortField, sortOrder)
|
||||
err := session.Find(&pricings)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return pricings
|
||||
}
|
||||
|
||||
func getPricing(owner, name string) *Pricing {
|
||||
if owner == "" || name == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
pricing := Pricing{Owner: owner, Name: name}
|
||||
existed, err := adapter.Engine.Get(&pricing)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if existed {
|
||||
return &pricing
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func GetPricing(id string) *Pricing {
|
||||
owner, name := util.GetOwnerAndNameFromId(id)
|
||||
return getPricing(owner, name)
|
||||
}
|
||||
|
||||
func UpdatePricing(id string, pricing *Pricing) bool {
|
||||
owner, name := util.GetOwnerAndNameFromId(id)
|
||||
if getPricing(owner, name) == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
affected, err := adapter.Engine.ID(core.PK{owner, name}).AllCols().Update(pricing)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return affected != 0
|
||||
}
|
||||
|
||||
func AddPricing(pricing *Pricing) bool {
|
||||
affected, err := adapter.Engine.Insert(pricing)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return affected != 0
|
||||
}
|
||||
|
||||
func DeletePricing(pricing *Pricing) bool {
|
||||
affected, err := adapter.Engine.ID(core.PK{pricing.Owner, pricing.Name}).Delete(pricing)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return affected != 0
|
||||
}
|
||||
|
||||
func (pricing *Pricing) GetId() string {
|
||||
return fmt.Sprintf("%s/%s", pricing.Owner, pricing.Name)
|
||||
}
|
||||
|
||||
func (pricing *Pricing) HasPlan(owner string, plan string) bool {
|
||||
selectedPlan := GetPlan(fmt.Sprintf("%s/%s", owner, plan))
|
||||
|
||||
if selectedPlan == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
result := false
|
||||
|
||||
for _, pricingPlan := range pricing.Plans {
|
||||
if strings.Contains(pricingPlan, selectedPlan.Name) {
|
||||
result = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
@@ -30,7 +30,7 @@ func TestProduct(t *testing.T) {
|
||||
product := GetProduct("admin/product_123")
|
||||
provider := getProvider(product.Owner, "provider_pay_alipay")
|
||||
cert := getCert(product.Owner, "cert-pay-alipay")
|
||||
pProvider, err := pp.GetPaymentProvider(provider.Type, provider.ClientId, provider.ClientSecret, provider.Host, cert.Certificate, cert.PrivateKey, cert.AuthorityPublicKey, cert.AuthorityRootPublicKey, provider.ClientId2)
|
||||
pProvider, err := pp.GetPaymentProvider(provider.Type, provider.ClientId, provider.ClientSecret, provider.Host, cert.Certificate, provider.ClientSecret2, cert.PrivateKey, cert.AuthorityPublicKey, cert.AuthorityRootPublicKey, provider.ClientId2)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@@ -274,7 +274,7 @@ func (p *Provider) getPaymentProvider() (pp.PaymentProvider, *Cert, error) {
|
||||
}
|
||||
}
|
||||
|
||||
pProvider, err := pp.GetPaymentProvider(p.Type, p.ClientId, p.ClientSecret, p.Host, cert.Certificate, cert.PrivateKey, cert.AuthorityPublicKey, cert.AuthorityRootPublicKey, p.ClientId2)
|
||||
pProvider, err := pp.GetPaymentProvider(p.Type, p.ClientId, p.ClientSecret, p.Host, cert.Certificate, p.ClientSecret2, cert.PrivateKey, cert.AuthorityPublicKey, cert.AuthorityRootPublicKey, p.ClientId2)
|
||||
if err != nil {
|
||||
return nil, cert, err
|
||||
}
|
||||
|
154
object/subscription.go
Normal file
154
object/subscription.go
Normal file
@@ -0,0 +1,154 @@
|
||||
// Copyright 2023 The Casdoor Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package object
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/casdoor/casdoor/util"
|
||||
"github.com/xorm-io/core"
|
||||
)
|
||||
|
||||
const defaultStatus = "Pending"
|
||||
|
||||
type Subscription struct {
|
||||
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
|
||||
Name string `xorm:"varchar(100) notnull pk" json:"name"`
|
||||
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
|
||||
DisplayName string `xorm:"varchar(100)" json:"displayName"`
|
||||
Duration int `json:"duration"`
|
||||
|
||||
Description string `xorm:"varchar(100)" json:"description"`
|
||||
Plan string `xorm:"varchar(100)" json:"plan"`
|
||||
|
||||
StartDate time.Time `json:"startDate"`
|
||||
EndDate time.Time `json:"endDate"`
|
||||
|
||||
User string `xorm:"mediumtext" json:"user"`
|
||||
|
||||
IsEnabled bool `json:"isEnabled"`
|
||||
Submitter string `xorm:"varchar(100)" json:"submitter"`
|
||||
Approver string `xorm:"varchar(100)" json:"approver"`
|
||||
ApproveTime string `xorm:"varchar(100)" json:"approveTime"`
|
||||
|
||||
State string `xorm:"varchar(100)" json:"state"`
|
||||
}
|
||||
|
||||
func NewSubscription(owner string, user string, plan string, duration int) *Subscription {
|
||||
id := util.GenerateId()[:6]
|
||||
return &Subscription{
|
||||
Name: "Subscription_" + id,
|
||||
DisplayName: "New Subscription - " + id,
|
||||
Owner: owner,
|
||||
User: owner + "/" + user,
|
||||
Plan: owner + "/" + plan,
|
||||
CreatedTime: util.GetCurrentTime(),
|
||||
State: defaultStatus,
|
||||
Duration: duration,
|
||||
StartDate: time.Now(),
|
||||
EndDate: time.Now().AddDate(0, 0, duration),
|
||||
}
|
||||
}
|
||||
|
||||
func GetSubscriptionCount(owner, field, value string) int {
|
||||
session := GetSession(owner, -1, -1, field, value, "", "")
|
||||
count, err := session.Count(&Subscription{})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return int(count)
|
||||
}
|
||||
|
||||
func GetSubscriptions(owner string) []*Subscription {
|
||||
subscriptions := []*Subscription{}
|
||||
err := adapter.Engine.Desc("created_time").Find(&subscriptions, &Subscription{Owner: owner})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return subscriptions
|
||||
}
|
||||
|
||||
func GetPaginationSubscriptions(owner string, offset, limit int, field, value, sortField, sortOrder string) []*Subscription {
|
||||
subscriptions := []*Subscription{}
|
||||
session := GetSession(owner, offset, limit, field, value, sortField, sortOrder)
|
||||
err := session.Find(&subscriptions)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return subscriptions
|
||||
}
|
||||
|
||||
func getSubscription(owner string, name string) *Subscription {
|
||||
if owner == "" || name == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
subscription := Subscription{Owner: owner, Name: name}
|
||||
existed, err := adapter.Engine.Get(&subscription)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if existed {
|
||||
return &subscription
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func GetSubscription(id string) *Subscription {
|
||||
owner, name := util.GetOwnerAndNameFromId(id)
|
||||
return getSubscription(owner, name)
|
||||
}
|
||||
|
||||
func UpdateSubscription(id string, subscription *Subscription) bool {
|
||||
owner, name := util.GetOwnerAndNameFromId(id)
|
||||
if getSubscription(owner, name) == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
affected, err := adapter.Engine.ID(core.PK{owner, name}).AllCols().Update(subscription)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return affected != 0
|
||||
}
|
||||
|
||||
func AddSubscription(subscription *Subscription) bool {
|
||||
affected, err := adapter.Engine.Insert(subscription)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return affected != 0
|
||||
}
|
||||
|
||||
func DeleteSubscription(subscription *Subscription) bool {
|
||||
affected, err := adapter.Engine.ID(core.PK{subscription.Owner, subscription.Name}).Delete(&Subscription{})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return affected != 0
|
||||
}
|
||||
|
||||
func (subscription *Subscription) GetId() string {
|
||||
return fmt.Sprintf("%s/%s", subscription.Owner, subscription.Name)
|
||||
}
|
@@ -33,10 +33,10 @@ type VerifyResult struct {
|
||||
}
|
||||
|
||||
const (
|
||||
VerificationSuccess int = 0
|
||||
wrongCodeError = 1
|
||||
noRecordError = 2
|
||||
timeoutError = 3
|
||||
VerificationSuccess = iota
|
||||
wrongCodeError
|
||||
noRecordError
|
||||
timeoutError
|
||||
)
|
||||
|
||||
const (
|
||||
|
@@ -94,3 +94,11 @@ func (pp *AlipayPaymentProvider) Notify(request *http.Request, body []byte, auth
|
||||
func (pp *AlipayPaymentProvider) GetInvoice(paymentName string, personName string, personIdCard string, personEmail string, personPhone string, invoiceType string, invoiceTitle string, invoiceTaxId string) (string, error) {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
func (pp *AlipayPaymentProvider) GetResponseError(err error) string {
|
||||
if err == nil {
|
||||
return "success"
|
||||
} else {
|
||||
return "fail"
|
||||
}
|
||||
}
|
||||
|
8
pp/gc.go
8
pp/gc.go
@@ -329,3 +329,11 @@ func (pp *GcPaymentProvider) GetInvoice(paymentName string, personName string, p
|
||||
|
||||
return invoiceRespInfo.Url, nil
|
||||
}
|
||||
|
||||
func (pp *GcPaymentProvider) GetResponseError(err error) string {
|
||||
if err == nil {
|
||||
return "success"
|
||||
} else {
|
||||
return "fail"
|
||||
}
|
||||
}
|
||||
|
@@ -20,20 +20,21 @@ type PaymentProvider interface {
|
||||
Pay(providerName string, productName string, payerName string, paymentName string, productDisplayName string, price float64, returnUrl string, notifyUrl string) (string, error)
|
||||
Notify(request *http.Request, body []byte, authorityPublicKey string) (string, string, float64, string, string, error)
|
||||
GetInvoice(paymentName string, personName string, personIdCard string, personEmail string, personPhone string, invoiceType string, invoiceTitle string, invoiceTaxId string) (string, error)
|
||||
GetResponseError(err error) string
|
||||
}
|
||||
|
||||
func GetPaymentProvider(typ string, appId string, clientSecret string, host string, appCertificate string, appPrivateKey string, authorityPublicKey string, authorityRootPublicKey string, clientId2 string) (PaymentProvider, error) {
|
||||
func GetPaymentProvider(typ string, clientId string, clientSecret string, host string, appCertificate string, certSerialNo string, appPrivateKey string, authorityPublicKey string, authorityRootPublicKey string, clientId2 string) (PaymentProvider, error) {
|
||||
if typ == "Alipay" {
|
||||
newAlipayPaymentProvider, err := NewAlipayPaymentProvider(appId, appCertificate, appPrivateKey, authorityPublicKey, authorityRootPublicKey)
|
||||
newAlipayPaymentProvider, err := NewAlipayPaymentProvider(clientId, appCertificate, appPrivateKey, authorityPublicKey, authorityRootPublicKey)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return newAlipayPaymentProvider, nil
|
||||
} else if typ == "GC" {
|
||||
return NewGcPaymentProvider(appId, clientSecret, host), nil
|
||||
return NewGcPaymentProvider(clientId, clientSecret, host), nil
|
||||
} else if typ == "WeChat Pay" {
|
||||
// appId, mchId, mchCertSerialNumber, apiV3Key, privateKey
|
||||
newWechatPaymentProvider, err := NewWechatPaymentProvider(clientId2, appId, appCertificate, clientSecret, appPrivateKey)
|
||||
// appId, mchId, mchCert, mchCertSerialNumber, apiV3Key, privateKey
|
||||
newWechatPaymentProvider, err := NewWechatPaymentProvider(clientId2, clientId, appCertificate, certSerialNo, clientSecret, appPrivateKey)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
12
pp/util.go
12
pp/util.go
@@ -23,3 +23,15 @@ func getPriceString(price float64) string {
|
||||
priceString := strings.TrimRight(strings.TrimRight(fmt.Sprintf("%.2f", price), "0"), ".")
|
||||
return priceString
|
||||
}
|
||||
|
||||
func joinAttachString(tokens []string) string {
|
||||
return strings.Join(tokens, "|")
|
||||
}
|
||||
|
||||
func parseAttachString(s string) (string, string, string, error) {
|
||||
tokens := strings.Split(s, "|")
|
||||
if len(tokens) != 3 {
|
||||
return "", "", "", fmt.Errorf("parseAttachString() error: len(tokens) expected 3, got: %d", len(tokens))
|
||||
}
|
||||
return tokens[0], tokens[1], tokens[2], nil
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@ package pp
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
"github.com/casdoor/casdoor/util"
|
||||
@@ -24,12 +24,21 @@ import (
|
||||
"github.com/go-pay/gopay/wechat/v3"
|
||||
)
|
||||
|
||||
type WechatPayNotifyResponse struct {
|
||||
Code string `json:"Code"`
|
||||
Message string `json:"Message"`
|
||||
}
|
||||
|
||||
type WechatPaymentProvider struct {
|
||||
ClientV3 *wechat.ClientV3
|
||||
appId string
|
||||
}
|
||||
|
||||
func NewWechatPaymentProvider(appId string, mchId string, mchCertSerialNumber string, apiV3Key string, privateKey string) (*WechatPaymentProvider, error) {
|
||||
func NewWechatPaymentProvider(appId string, mchId string, cert string, mchCertSerialNumber string, apiV3Key string, privateKey string) (*WechatPaymentProvider, error) {
|
||||
if appId == "" && mchId == "" && cert == "" && mchCertSerialNumber == "" && apiV3Key == "" && privateKey == "" {
|
||||
return &WechatPaymentProvider{}, nil
|
||||
}
|
||||
|
||||
pp := &WechatPaymentProvider{appId: appId}
|
||||
|
||||
clientV3, err := wechat.NewClientV3(mchId, mchCertSerialNumber, apiV3Key, privateKey)
|
||||
@@ -37,11 +46,13 @@ func NewWechatPaymentProvider(appId string, mchId string, mchCertSerialNumber st
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = clientV3.AutoVerifySign()
|
||||
platformCert, serialNo, err := clientV3.GetAndSelectNewestCert()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
pp.ClientV3 = clientV3
|
||||
|
||||
pp.ClientV3 = clientV3.SetPlatformCert([]byte(platformCert), serialNo)
|
||||
|
||||
return pp, nil
|
||||
}
|
||||
|
||||
@@ -50,53 +61,71 @@ func (pp *WechatPaymentProvider) Pay(providerName string, productName string, pa
|
||||
|
||||
bm := gopay.BodyMap{}
|
||||
|
||||
bm.Set("providerName", providerName)
|
||||
bm.Set("productName", productName)
|
||||
|
||||
bm.Set("return_url", returnUrl)
|
||||
bm.Set("attach", joinAttachString([]string{productDisplayName, productName, providerName}))
|
||||
bm.Set("appid", pp.appId)
|
||||
bm.Set("description", productDisplayName)
|
||||
bm.Set("notify_url", notifyUrl)
|
||||
|
||||
bm.Set("body", productDisplayName)
|
||||
bm.Set("out_trade_no", paymentName)
|
||||
bm.Set("total_fee", getPriceString(price))
|
||||
bm.SetBodyMap("amount", func(bm gopay.BodyMap) {
|
||||
bm.Set("total", int(price*100))
|
||||
bm.Set("currency", "CNY")
|
||||
})
|
||||
|
||||
wechatRsp, err := pp.ClientV3.V3TransactionJsapi(context.Background(), bm)
|
||||
wxRsp, err := pp.ClientV3.V3TransactionNative(context.Background(), bm)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
payUrl := fmt.Sprintf("https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect", pp.appId, wechatRsp.Response.PrepayId)
|
||||
return payUrl, nil
|
||||
if wxRsp.Code != wechat.Success {
|
||||
return "", errors.New(wxRsp.Error)
|
||||
}
|
||||
|
||||
return wxRsp.Response.CodeUrl, nil
|
||||
}
|
||||
|
||||
func (pp *WechatPaymentProvider) Notify(request *http.Request, body []byte, authorityPublicKey string) (string, string, float64, string, string, error) {
|
||||
bm, err := wechat.V3ParseNotifyToBodyMap(request)
|
||||
if err != nil {
|
||||
return "", "", 0, "", "", err
|
||||
}
|
||||
|
||||
providerName := bm.Get("providerName")
|
||||
productName := bm.Get("productName")
|
||||
|
||||
productDisplayName := bm.Get("body")
|
||||
paymentName := bm.Get("out_trade_no")
|
||||
price := util.ParseFloat(bm.Get("total_fee"))
|
||||
|
||||
notifyReq, err := wechat.V3ParseNotify(request)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
cert := pp.ClientV3.WxPublicKey()
|
||||
|
||||
err = notifyReq.VerifySignByPK(cert)
|
||||
if err != nil {
|
||||
return "", "", 0, "", "", err
|
||||
}
|
||||
|
||||
apiKey := string(pp.ClientV3.ApiV3Key)
|
||||
result, err := notifyReq.DecryptCipherText(apiKey)
|
||||
if err != nil {
|
||||
return "", "", 0, "", "", err
|
||||
}
|
||||
|
||||
paymentName := result.OutTradeNo
|
||||
price := float64(result.Amount.PayerTotal) / 100
|
||||
|
||||
productDisplayName, productName, providerName, err := parseAttachString(result.Attach)
|
||||
if err != nil {
|
||||
return "", "", 0, "", "", err
|
||||
}
|
||||
|
||||
return productDisplayName, paymentName, price, productName, providerName, nil
|
||||
}
|
||||
|
||||
func (pp *WechatPaymentProvider) GetInvoice(paymentName string, personName string, personIdCard string, personEmail string, personPhone string, invoiceType string, invoiceTitle string, invoiceTaxId string) (string, error) {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
func (pp *WechatPaymentProvider) GetResponseError(err error) string {
|
||||
response := &WechatPayNotifyResponse{
|
||||
Code: "SUCCESS",
|
||||
Message: "",
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
response.Code = "FAIL"
|
||||
response.Message = err.Error()
|
||||
}
|
||||
|
||||
return util.StructToJson(response)
|
||||
}
|
||||
|
@@ -125,7 +125,11 @@ func AuthzFilter(ctx *context.Context) {
|
||||
subOwner, subName := getSubject(ctx)
|
||||
method := ctx.Request.Method
|
||||
urlPath := getUrlPath(ctx.Request.URL.Path)
|
||||
objOwner, objName := getObject(ctx)
|
||||
|
||||
objOwner, objName := "", ""
|
||||
if urlPath != "/api/get-app-login" {
|
||||
objOwner, objName = getObject(ctx)
|
||||
}
|
||||
|
||||
if strings.HasPrefix(urlPath, "/api/notify-payment") {
|
||||
urlPath = "/api/notify-payment"
|
||||
|
@@ -65,6 +65,7 @@ func initAPI() {
|
||||
beego.Router("/api/add-organization", &controllers.ApiController{}, "POST:AddOrganization")
|
||||
beego.Router("/api/delete-organization", &controllers.ApiController{}, "POST:DeleteOrganization")
|
||||
beego.Router("/api/get-default-application", &controllers.ApiController{}, "GET:GetDefaultApplication")
|
||||
beego.Router("/api/get-organization-names", &controllers.ApiController{}, "GET:GetOrganizationNames")
|
||||
|
||||
beego.Router("/api/get-global-users", &controllers.ApiController{}, "GET:GetGlobalUsers")
|
||||
beego.Router("/api/get-users", &controllers.ApiController{}, "GET:GetUsers")
|
||||
@@ -203,6 +204,24 @@ func initAPI() {
|
||||
beego.Router("/api/add-message", &controllers.ApiController{}, "POST:AddMessage")
|
||||
beego.Router("/api/delete-message", &controllers.ApiController{}, "POST:DeleteMessage")
|
||||
|
||||
beego.Router("/api/get-subscriptions", &controllers.ApiController{}, "GET:GetSubscriptions")
|
||||
beego.Router("/api/get-subscription", &controllers.ApiController{}, "GET:GetSubscription")
|
||||
beego.Router("/api/update-subscription", &controllers.ApiController{}, "POST:UpdateSubscription")
|
||||
beego.Router("/api/add-subscription", &controllers.ApiController{}, "POST:AddSubscription")
|
||||
beego.Router("/api/delete-subscription", &controllers.ApiController{}, "POST:DeleteSubscription")
|
||||
|
||||
beego.Router("/api/get-plans", &controllers.ApiController{}, "GET:GetPlans")
|
||||
beego.Router("/api/get-plan", &controllers.ApiController{}, "GET:GetPlan")
|
||||
beego.Router("/api/update-plan", &controllers.ApiController{}, "POST:UpdatePlan")
|
||||
beego.Router("/api/add-plan", &controllers.ApiController{}, "POST:AddPlan")
|
||||
beego.Router("/api/delete-plan", &controllers.ApiController{}, "POST:DeletePlan")
|
||||
|
||||
beego.Router("/api/get-pricings", &controllers.ApiController{}, "GET:GetPricings")
|
||||
beego.Router("/api/get-pricing", &controllers.ApiController{}, "GET:GetPricing")
|
||||
beego.Router("/api/update-pricing", &controllers.ApiController{}, "POST:UpdatePricing")
|
||||
beego.Router("/api/add-pricing", &controllers.ApiController{}, "POST:AddPricing")
|
||||
beego.Router("/api/delete-pricing", &controllers.ApiController{}, "POST:DeletePricing")
|
||||
|
||||
beego.Router("/api/get-products", &controllers.ApiController{}, "GET:GetProducts")
|
||||
beego.Router("/api/get-product", &controllers.ApiController{}, "GET:GetProduct")
|
||||
beego.Router("/api/update-product", &controllers.ApiController{}, "POST:UpdateProduct")
|
||||
|
@@ -15,6 +15,8 @@
|
||||
package routers
|
||||
|
||||
import (
|
||||
"compress/gzip"
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
@@ -28,6 +30,7 @@ import (
|
||||
var (
|
||||
oldStaticBaseUrl = "https://cdn.casbin.org"
|
||||
newStaticBaseUrl = conf.GetConfigString("staticBaseUrl")
|
||||
enableGzip, _ = conf.GetConfigBool("enableGzip")
|
||||
)
|
||||
|
||||
func StaticFilter(ctx *context.Context) {
|
||||
@@ -53,7 +56,7 @@ func StaticFilter(ctx *context.Context) {
|
||||
|
||||
path2 := strings.TrimLeft(path, "web/build/images/")
|
||||
if util.FileExist(path2) {
|
||||
http.ServeFile(ctx.ResponseWriter, ctx.Request, path2)
|
||||
makeGzipResponse(ctx.ResponseWriter, ctx.Request, path2)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -62,7 +65,7 @@ func StaticFilter(ctx *context.Context) {
|
||||
}
|
||||
|
||||
if oldStaticBaseUrl == newStaticBaseUrl {
|
||||
http.ServeFile(ctx.ResponseWriter, ctx.Request, path)
|
||||
makeGzipResponse(ctx.ResponseWriter, ctx.Request, path)
|
||||
} else {
|
||||
serveFileWithReplace(ctx.ResponseWriter, ctx.Request, path, oldStaticBaseUrl, newStaticBaseUrl)
|
||||
}
|
||||
@@ -89,3 +92,24 @@ func serveFileWithReplace(w http.ResponseWriter, r *http.Request, name string, o
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
type gzipResponseWriter struct {
|
||||
io.Writer
|
||||
http.ResponseWriter
|
||||
}
|
||||
|
||||
func (w gzipResponseWriter) Write(b []byte) (int, error) {
|
||||
return w.Writer.Write(b)
|
||||
}
|
||||
|
||||
func makeGzipResponse(w http.ResponseWriter, r *http.Request, path string) {
|
||||
if !enableGzip || !strings.Contains(r.Header.Get("Accept-Encoding"), "gzip") {
|
||||
http.ServeFile(w, r, path)
|
||||
return
|
||||
}
|
||||
w.Header().Set("Content-Encoding", "gzip")
|
||||
gz := gzip.NewWriter(w)
|
||||
defer gz.Close()
|
||||
gzw := gzipResponseWriter{Writer: gz, ResponseWriter: w}
|
||||
http.ServeFile(gzw, r, path)
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -177,6 +177,42 @@ paths:
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/add-plan:
|
||||
post:
|
||||
tags:
|
||||
- Plan API
|
||||
description: add plan
|
||||
operationId: ApiController.AddPlan
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
description: The details of the plan
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/object.Plan'
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/add-pricing:
|
||||
post:
|
||||
tags:
|
||||
- Pricing API
|
||||
description: add pricing
|
||||
operationId: ApiController.AddPricing
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
description: The details of the pricing
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/object.Pricing'
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/add-product:
|
||||
post:
|
||||
tags:
|
||||
@@ -278,6 +314,24 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
/api/add-subscription:
|
||||
post:
|
||||
tags:
|
||||
- Subscription API
|
||||
description: add subscription
|
||||
operationId: ApiController.AddSubscription
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
description: The details of the subscription
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/object.Subscription'
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/add-syncer:
|
||||
post:
|
||||
tags:
|
||||
@@ -552,6 +606,17 @@ paths:
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/delete-mfa/:
|
||||
post:
|
||||
tags:
|
||||
- MFA API
|
||||
description: ': Delete MFA'
|
||||
operationId: ApiController.DeleteMfa
|
||||
responses:
|
||||
"200":
|
||||
description: object
|
||||
schema:
|
||||
$ref: '#/definitions/Response'
|
||||
/api/delete-model:
|
||||
post:
|
||||
tags:
|
||||
@@ -624,6 +689,42 @@ paths:
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/delete-plan:
|
||||
post:
|
||||
tags:
|
||||
- Plan API
|
||||
description: delete plan
|
||||
operationId: ApiController.DeletePlan
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
description: The details of the plan
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/object.Plan'
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/delete-pricing:
|
||||
post:
|
||||
tags:
|
||||
- Pricing API
|
||||
description: delete pricing
|
||||
operationId: ApiController.DeletePricing
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
description: The details of the pricing
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/object.Pricing'
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/delete-product:
|
||||
post:
|
||||
tags:
|
||||
@@ -702,6 +803,24 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
/api/delete-subscription:
|
||||
post:
|
||||
tags:
|
||||
- Subscription API
|
||||
description: delete subscription
|
||||
operationId: ApiController.DeleteSubscription
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
description: The details of the subscription
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/object.Subscription'
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/delete-syncer:
|
||||
post:
|
||||
tags:
|
||||
@@ -995,6 +1114,19 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.User'
|
||||
/api/get-globle-certs:
|
||||
get:
|
||||
tags:
|
||||
- Cert API
|
||||
description: get globle certs
|
||||
operationId: ApiController.GetGlobleCerts
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.Cert'
|
||||
/api/get-ldap:
|
||||
get:
|
||||
tags:
|
||||
@@ -1027,6 +1159,23 @@ paths:
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/object.Message'
|
||||
/api/get-message-answer:
|
||||
get:
|
||||
tags:
|
||||
- Message API
|
||||
description: get message answer
|
||||
operationId: ApiController.GetMessageAnswer
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id ( owner/name ) of the message
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/object.Message'
|
||||
/api/get-messages:
|
||||
get:
|
||||
tags:
|
||||
@@ -1241,6 +1390,82 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.Permission'
|
||||
/api/get-plan:
|
||||
get:
|
||||
tags:
|
||||
- Plan API
|
||||
description: get plan
|
||||
operationId: ApiController.GetPlan
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id ( owner/name ) of the plan
|
||||
required: true
|
||||
type: string
|
||||
- in: query
|
||||
name: includeOption
|
||||
description: Should include plan's option
|
||||
type: boolean
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/object.Plan'
|
||||
/api/get-plans:
|
||||
get:
|
||||
tags:
|
||||
- Plan API
|
||||
description: get plans
|
||||
operationId: ApiController.GetPlans
|
||||
parameters:
|
||||
- in: query
|
||||
name: owner
|
||||
description: The owner of plans
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.Plan'
|
||||
/api/get-pricing:
|
||||
get:
|
||||
tags:
|
||||
- Pricing API
|
||||
description: get pricing
|
||||
operationId: ApiController.GetPricing
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id ( owner/name ) of the pricing
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/object.pricing'
|
||||
/api/get-pricings:
|
||||
get:
|
||||
tags:
|
||||
- Pricing API
|
||||
description: get pricings
|
||||
operationId: ApiController.GetPricings
|
||||
parameters:
|
||||
- in: query
|
||||
name: owner
|
||||
description: The owner of pricings
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.Pricing'
|
||||
/api/get-product:
|
||||
get:
|
||||
tags:
|
||||
@@ -1277,6 +1502,17 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.Product'
|
||||
/api/get-prometheus-info:
|
||||
get:
|
||||
tags:
|
||||
- Prometheus API
|
||||
description: get Prometheus Info
|
||||
operationId: ApiController.GetPrometheusInfo
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/object.PrometheusInfo'
|
||||
/api/get-provider:
|
||||
get:
|
||||
tags:
|
||||
@@ -1466,6 +1702,42 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.User'
|
||||
/api/get-subscription:
|
||||
get:
|
||||
tags:
|
||||
- Subscription API
|
||||
description: get subscription
|
||||
operationId: ApiController.GetSubscription
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id ( owner/name ) of the subscription
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/object.subscription'
|
||||
/api/get-subscriptions:
|
||||
get:
|
||||
tags:
|
||||
- Subscription API
|
||||
description: get subscriptions
|
||||
operationId: ApiController.GetSubscriptions
|
||||
parameters:
|
||||
- in: query
|
||||
name: owner
|
||||
description: The owner of subscriptions
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.Subscription'
|
||||
/api/get-syncer:
|
||||
get:
|
||||
tags:
|
||||
@@ -1975,6 +2247,39 @@ paths:
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/mfa/setup/enable:
|
||||
post:
|
||||
tags:
|
||||
- MFA API
|
||||
description: enable totp
|
||||
operationId: ApiController.MfaSetupEnable
|
||||
responses:
|
||||
"200":
|
||||
description: object
|
||||
schema:
|
||||
$ref: '#/definitions/Response'
|
||||
/api/mfa/setup/initiate:
|
||||
post:
|
||||
tags:
|
||||
- MFA API
|
||||
description: setup MFA
|
||||
operationId: ApiController.MfaSetupInitiate
|
||||
responses:
|
||||
"200":
|
||||
description: Response object
|
||||
schema:
|
||||
$ref: '#/definitions/The'
|
||||
/api/mfa/setup/verify:
|
||||
post:
|
||||
tags:
|
||||
- MFA API
|
||||
description: setup verify totp
|
||||
operationId: ApiController.MfaSetupVerify
|
||||
responses:
|
||||
"200":
|
||||
description: object
|
||||
schema:
|
||||
$ref: '#/definitions/Response'
|
||||
/api/notify-payment:
|
||||
post:
|
||||
tags:
|
||||
@@ -2048,6 +2353,17 @@ paths:
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/set-preferred-mfa:
|
||||
post:
|
||||
tags:
|
||||
- MFA API
|
||||
description: ': Set specific Mfa Preferred'
|
||||
operationId: ApiController.SetPreferredMfa
|
||||
responses:
|
||||
"200":
|
||||
description: object
|
||||
schema:
|
||||
$ref: '#/definitions/Response'
|
||||
/api/signup:
|
||||
post:
|
||||
tags:
|
||||
@@ -2268,6 +2584,52 @@ paths:
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/update-plan:
|
||||
post:
|
||||
tags:
|
||||
- Plan API
|
||||
description: update plan
|
||||
operationId: ApiController.UpdatePlan
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id ( owner/name ) of the plan
|
||||
required: true
|
||||
type: string
|
||||
- in: body
|
||||
name: body
|
||||
description: The details of the plan
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/object.Plan'
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/update-pricing:
|
||||
post:
|
||||
tags:
|
||||
- Pricing API
|
||||
description: update pricing
|
||||
operationId: ApiController.UpdatePricing
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id ( owner/name ) of the pricing
|
||||
required: true
|
||||
type: string
|
||||
- in: body
|
||||
name: body
|
||||
description: The details of the pricing
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/object.Pricing'
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/update-product:
|
||||
post:
|
||||
tags:
|
||||
@@ -2361,6 +2723,29 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
/api/update-subscription:
|
||||
post:
|
||||
tags:
|
||||
- Subscription API
|
||||
description: update subscription
|
||||
operationId: ApiController.UpdateSubscription
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id ( owner/name ) of the subscription
|
||||
required: true
|
||||
type: string
|
||||
- in: body
|
||||
name: body
|
||||
description: The details of the subscription
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/object.Subscription'
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/update-syncer:
|
||||
post:
|
||||
tags:
|
||||
@@ -2555,10 +2940,10 @@ paths:
|
||||
schema:
|
||||
$ref: '#/definitions/Response'
|
||||
definitions:
|
||||
1183.0xc000455050.false:
|
||||
1183.0x1400042eb70.false:
|
||||
title: "false"
|
||||
type: object
|
||||
1217.0xc000455080.false:
|
||||
1217.0x1400042eba0.false:
|
||||
title: "false"
|
||||
type: object
|
||||
LaravelResponse:
|
||||
@@ -2567,6 +2952,9 @@ definitions:
|
||||
Response:
|
||||
title: Response
|
||||
type: object
|
||||
The:
|
||||
title: The
|
||||
type: object
|
||||
controllers.AuthForm:
|
||||
title: AuthForm
|
||||
type: object
|
||||
@@ -2591,9 +2979,9 @@ definitions:
|
||||
type: object
|
||||
properties:
|
||||
data:
|
||||
$ref: '#/definitions/1183.0xc000455050.false'
|
||||
$ref: '#/definitions/1183.0x1400042eb70.false'
|
||||
data2:
|
||||
$ref: '#/definitions/1217.0xc000455080.false'
|
||||
$ref: '#/definitions/1217.0x1400042eba0.false'
|
||||
msg:
|
||||
type: string
|
||||
name:
|
||||
@@ -2799,6 +3187,17 @@ definitions:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
object.GaugeVecInfo:
|
||||
title: GaugeVecInfo
|
||||
type: object
|
||||
properties:
|
||||
method:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
throughput:
|
||||
type: number
|
||||
format: double
|
||||
object.Header:
|
||||
title: Header
|
||||
type: object
|
||||
@@ -2807,6 +3206,19 @@ definitions:
|
||||
type: string
|
||||
value:
|
||||
type: string
|
||||
object.HistogramVecInfo:
|
||||
title: HistogramVecInfo
|
||||
type: object
|
||||
properties:
|
||||
count:
|
||||
type: integer
|
||||
format: int64
|
||||
latency:
|
||||
type: string
|
||||
method:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
object.IntrospectionResponse:
|
||||
title: IntrospectionResponse
|
||||
type: object
|
||||
@@ -2868,8 +3280,30 @@ definitions:
|
||||
type: string
|
||||
owner:
|
||||
type: string
|
||||
replyTo:
|
||||
type: string
|
||||
text:
|
||||
type: string
|
||||
object.MfaProps:
|
||||
title: MfaProps
|
||||
type: object
|
||||
properties:
|
||||
countryCode:
|
||||
type: string
|
||||
id:
|
||||
type: string
|
||||
isPreferred:
|
||||
type: boolean
|
||||
recoveryCodes:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
secret:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
url:
|
||||
type: string
|
||||
object.Model:
|
||||
title: Model
|
||||
type: object
|
||||
@@ -3098,6 +3532,67 @@ definitions:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
object.Plan:
|
||||
title: Plan
|
||||
type: object
|
||||
properties:
|
||||
createdTime:
|
||||
type: string
|
||||
currency:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
displayName:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
owner:
|
||||
type: string
|
||||
pricePerMonth:
|
||||
type: number
|
||||
format: double
|
||||
pricePerYear:
|
||||
type: number
|
||||
format: double
|
||||
role:
|
||||
type: string
|
||||
options:
|
||||
type: array
|
||||
object.Pricing:
|
||||
title: Pricing
|
||||
type: object
|
||||
properties:
|
||||
application:
|
||||
type: string
|
||||
approveTime:
|
||||
type: string
|
||||
approver:
|
||||
type: string
|
||||
createdTime:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
displayName:
|
||||
type: string
|
||||
hasTrial:
|
||||
type: boolean
|
||||
isEnabled:
|
||||
type: boolean
|
||||
name:
|
||||
type: string
|
||||
owner:
|
||||
type: string
|
||||
plans:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
state:
|
||||
type: string
|
||||
submitter:
|
||||
type: string
|
||||
trialDuration:
|
||||
type: integer
|
||||
format: int64
|
||||
object.Product:
|
||||
title: Product
|
||||
type: object
|
||||
@@ -3141,6 +3636,21 @@ definitions:
|
||||
type: string
|
||||
tag:
|
||||
type: string
|
||||
object.PrometheusInfo:
|
||||
title: PrometheusInfo
|
||||
type: object
|
||||
properties:
|
||||
apiLatency:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.HistogramVecInfo'
|
||||
apiThroughput:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.GaugeVecInfo'
|
||||
totalThroughput:
|
||||
type: number
|
||||
format: double
|
||||
object.Provider:
|
||||
title: Provider
|
||||
type: object
|
||||
@@ -3313,6 +3823,43 @@ definitions:
|
||||
type: string
|
||||
visible:
|
||||
type: boolean
|
||||
object.Subscription:
|
||||
title: Subscription
|
||||
type: object
|
||||
properties:
|
||||
approveTime:
|
||||
type: string
|
||||
approver:
|
||||
type: string
|
||||
createdTime:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
displayName:
|
||||
type: string
|
||||
duration:
|
||||
type: integer
|
||||
format: int64
|
||||
endDate:
|
||||
type: string
|
||||
format: datetime
|
||||
isEnabled:
|
||||
type: boolean
|
||||
name:
|
||||
type: string
|
||||
owner:
|
||||
type: string
|
||||
plan:
|
||||
type: string
|
||||
startDate:
|
||||
type: string
|
||||
format: datetime
|
||||
state:
|
||||
type: string
|
||||
submitter:
|
||||
type: string
|
||||
user:
|
||||
type: string
|
||||
object.Syncer:
|
||||
title: Syncer
|
||||
type: object
|
||||
@@ -3612,6 +4159,10 @@ definitions:
|
||||
type: string
|
||||
microsoftonline:
|
||||
type: string
|
||||
multiFactorAuths:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.MfaProps'
|
||||
name:
|
||||
type: string
|
||||
naver:
|
||||
@@ -3778,6 +4329,12 @@ definitions:
|
||||
type: string
|
||||
url:
|
||||
type: string
|
||||
object.pricing:
|
||||
title: pricing
|
||||
type: object
|
||||
object.subscription:
|
||||
title: subscription
|
||||
type: object
|
||||
protocol.CredentialAssertion:
|
||||
title: CredentialAssertion
|
||||
type: object
|
||||
|
@@ -66,13 +66,13 @@ func (db *Database) OnRow(e *canal.RowsEvent) error {
|
||||
for i, row := range e.Rows {
|
||||
for j, item := range row {
|
||||
if i%2 == 0 {
|
||||
if isChar[j] == true {
|
||||
if isChar[j] {
|
||||
oldColumnValue[j] = fmt.Sprintf("%s", item)
|
||||
} else {
|
||||
oldColumnValue[j] = fmt.Sprintf("%d", item)
|
||||
}
|
||||
} else {
|
||||
if isChar[j] == true {
|
||||
if isChar[j] {
|
||||
if item == nil {
|
||||
newColumnValue[j] = nil
|
||||
} else {
|
||||
@@ -103,7 +103,7 @@ func (db *Database) OnRow(e *canal.RowsEvent) error {
|
||||
db.engine.Exec("BEGIN")
|
||||
for _, row := range e.Rows {
|
||||
for j, item := range row {
|
||||
if isChar[j] == true {
|
||||
if isChar[j] {
|
||||
oldColumnValue[j] = fmt.Sprintf("%s", item)
|
||||
} else {
|
||||
oldColumnValue[j] = fmt.Sprintf("%d", item)
|
||||
@@ -128,7 +128,7 @@ func (db *Database) OnRow(e *canal.RowsEvent) error {
|
||||
db.engine.Exec("BEGIN")
|
||||
for _, row := range e.Rows {
|
||||
for j, item := range row {
|
||||
if isChar[j] == true {
|
||||
if isChar[j] {
|
||||
if item == nil {
|
||||
newColumnValue[j] = nil
|
||||
} else {
|
||||
|
@@ -25,7 +25,7 @@ import (
|
||||
var rePhone *regexp.Regexp
|
||||
|
||||
func init() {
|
||||
rePhone, _ = regexp.Compile("(\\d{3})\\d*(\\d{4})")
|
||||
rePhone, _ = regexp.Compile(`(\d{3})\d*(\d{4})`)
|
||||
}
|
||||
|
||||
func IsEmailValid(email string) bool {
|
||||
|
@@ -3,7 +3,7 @@
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@ant-design/cssinjs": "^1.9.0",
|
||||
"@ant-design/cssinjs": "^1.8.1",
|
||||
"@ant-design/icons": "^4.7.0",
|
||||
"@craco/craco": "^6.4.5",
|
||||
"@crowdin/cli": "^3.7.10",
|
||||
@@ -12,7 +12,7 @@
|
||||
"@testing-library/jest-dom": "^4.2.4",
|
||||
"@testing-library/react": "^9.3.2",
|
||||
"@testing-library/user-event": "^7.1.2",
|
||||
"antd": "5.5.0",
|
||||
"antd": "5.2.3",
|
||||
"antd-token-previewer": "^1.1.0-22",
|
||||
"codemirror": "^5.61.1",
|
||||
"copy-to-clipboard": "^3.3.1",
|
||||
|
@@ -44,6 +44,12 @@ import SyncerListPage from "./SyncerListPage";
|
||||
import SyncerEditPage from "./SyncerEditPage";
|
||||
import CertListPage from "./CertListPage";
|
||||
import CertEditPage from "./CertEditPage";
|
||||
import SubscriptionListPage from "./SubscriptionListPage";
|
||||
import SubscriptionEditPage from "./SubscriptionEditPage";
|
||||
import PricingListPage from "./PricingListPage";
|
||||
import PricingEditPage from "./PricingEditPage";
|
||||
import PlanListPage from "./PlanListPage";
|
||||
import PlanEditPage from "./PlanEditPage";
|
||||
import ChatListPage from "./ChatListPage";
|
||||
import ChatEditPage from "./ChatEditPage";
|
||||
import ChatPage from "./ChatPage";
|
||||
@@ -168,6 +174,12 @@ class App extends Component {
|
||||
this.setState({selectedMenuKey: "/result"});
|
||||
} else if (uri.includes("/sysinfo")) {
|
||||
this.setState({selectedMenuKey: "/sysinfo"});
|
||||
} else if (uri.includes("/subscriptions")) {
|
||||
this.setState({selectedMenuKey: "/subscriptions"});
|
||||
} else if (uri.includes("/plans")) {
|
||||
this.setState({selectedMenuKey: "/plans"});
|
||||
} else if (uri.includes("/pricings")) {
|
||||
this.setState({selectedMenuKey: "/pricings"});
|
||||
} else {
|
||||
this.setState({selectedMenuKey: -1});
|
||||
}
|
||||
@@ -335,6 +347,8 @@ class App extends Component {
|
||||
const onClick = (e) => {
|
||||
if (e.key === "/account") {
|
||||
this.props.history.push("/account");
|
||||
} else if (e.key === "/subscription") {
|
||||
this.props.history.push("/subscription");
|
||||
} else if (e.key === "/chat") {
|
||||
this.props.history.push("/chat");
|
||||
} else if (e.key === "/logout") {
|
||||
@@ -444,6 +458,19 @@ class App extends Component {
|
||||
res.push(Setting.getItem(<Link to="/records">{i18next.t("general:Records")}</Link>,
|
||||
"/records"
|
||||
));
|
||||
|
||||
res.push(Setting.getItem(<Link to="/plans">{i18next.t("general:Plans")}</Link>,
|
||||
"/plans"
|
||||
));
|
||||
|
||||
res.push(Setting.getItem(<Link to="/pricings">{i18next.t("general:Pricings")}</Link>,
|
||||
"/pricings"
|
||||
));
|
||||
|
||||
res.push(Setting.getItem(<Link to="/subscriptions">{i18next.t("general:Subscriptions")}</Link>,
|
||||
"/subscriptions"
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
if (Setting.isLocalAdminUser(this.state.account)) {
|
||||
@@ -468,6 +495,7 @@ class App extends Component {
|
||||
));
|
||||
|
||||
if (Conf.EnableExtraPages) {
|
||||
|
||||
res.push(Setting.getItem(<Link to="/products">{i18next.t("general:Products")}</Link>,
|
||||
"/products"
|
||||
));
|
||||
@@ -556,6 +584,12 @@ class App extends Component {
|
||||
<Route exact path="/chat" render={(props) => this.renderLoginIfNotLoggedIn(<ChatPage account={this.state.account} {...props} />)} />
|
||||
<Route exact path="/messages" render={(props) => this.renderLoginIfNotLoggedIn(<MessageListPage account={this.state.account} {...props} />)} />
|
||||
<Route exact path="/messages/:messageName" render={(props) => this.renderLoginIfNotLoggedIn(<MessageEditPage account={this.state.account} {...props} />)} />
|
||||
<Route exact path="/plans" render={(props) => this.renderLoginIfNotLoggedIn(<PlanListPage account={this.state.account} {...props} />)} />
|
||||
<Route exact path="/plan/:organizationName/:planName" render={(props) => this.renderLoginIfNotLoggedIn(<PlanEditPage account={this.state.account} {...props} />)} />
|
||||
<Route exact path="/pricings" render={(props) => this.renderLoginIfNotLoggedIn(<PricingListPage account={this.state.account} {...props} />)} />
|
||||
<Route exact path="/pricing/:organizationName/:pricingName" render={(props) => this.renderLoginIfNotLoggedIn(<PricingEditPage account={this.state.account} {...props} />)} />
|
||||
<Route exact path="/subscriptions" render={(props) => this.renderLoginIfNotLoggedIn(<SubscriptionListPage account={this.state.account} {...props} />)} />
|
||||
<Route exact path="/subscription/:organizationName/:subscriptionName" render={(props) => this.renderLoginIfNotLoggedIn(<SubscriptionEditPage account={this.state.account} {...props} />)} />
|
||||
<Route exact path="/products" render={(props) => this.renderLoginIfNotLoggedIn(<ProductListPage account={this.state.account} {...props} />)} />
|
||||
<Route exact path="/products/:productName" render={(props) => this.renderLoginIfNotLoggedIn(<ProductEditPage account={this.state.account} {...props} />)} />
|
||||
<Route exact path="/products/:productName/buy" render={(props) => this.renderLoginIfNotLoggedIn(<ProductBuyPage account={this.state.account} {...props} />)} />
|
||||
@@ -674,7 +708,8 @@ class App extends Component {
|
||||
window.location.pathname.startsWith("/prompt") ||
|
||||
window.location.pathname.startsWith("/result") ||
|
||||
window.location.pathname.startsWith("/cas") ||
|
||||
window.location.pathname.startsWith("/auto-signup");
|
||||
window.location.pathname.startsWith("/auto-signup") ||
|
||||
window.location.pathname.startsWith("/select-plan");
|
||||
}
|
||||
|
||||
renderPage() {
|
||||
|
@@ -441,6 +441,26 @@ class ApplicationEditPage extends React.Component {
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("application:Org choice mode"), i18next.t("application:Org choice mode - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Select virtual={false} style={{width: "100%"}}
|
||||
options={[
|
||||
{label: i18next.t("general:None"), value: "None"},
|
||||
{label: i18next.t("application:Select"), value: "Select"},
|
||||
{label: i18next.t("application:Input"), value: "Input"},
|
||||
].map((item) => {
|
||||
return Setting.getOption(item.label, item.value);
|
||||
})}
|
||||
value={this.state.application.orgChoiceMode ?? []}
|
||||
onChange={(value => {
|
||||
this.updateApplicationField("orgChoiceMode", value);
|
||||
})} >
|
||||
</Select>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:Signup URL"), i18next.t("general:Signup URL - Tooltip"))} :
|
||||
|
@@ -16,6 +16,8 @@ import React from "react";
|
||||
import {Redirect, Route, Switch} from "react-router-dom";
|
||||
import {Spin} from "antd";
|
||||
import i18next from "i18next";
|
||||
import * as ApplicationBackend from "./backend/ApplicationBackend";
|
||||
import PricingPage from "./pricing/PricingPage";
|
||||
import * as Setting from "./Setting";
|
||||
import * as Conf from "./Conf";
|
||||
import SignupPage from "./auth/SignupPage";
|
||||
@@ -33,6 +35,7 @@ class EntryPage extends React.Component {
|
||||
super(props);
|
||||
this.state = {
|
||||
application: undefined,
|
||||
pricing: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -65,9 +68,23 @@ class EntryPage extends React.Component {
|
||||
this.props.updataThemeData(themeData);
|
||||
};
|
||||
|
||||
const onUpdatePricing = (pricing) => {
|
||||
this.setState({
|
||||
pricing: pricing,
|
||||
});
|
||||
|
||||
ApplicationBackend.getApplication("admin", pricing.application)
|
||||
.then((application) => {
|
||||
const themeData = application !== null ? Setting.getThemeData(application.organizationObj, application) : Conf.ThemeDefault;
|
||||
this.props.updataThemeData(themeData);
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="loginBackground" style={{backgroundImage: Setting.inIframe() || Setting.isMobile() ? null : `url(${this.state.application?.formBackgroundUrl})`}}>
|
||||
<Spin size="large" spinning={this.state.application === undefined} tip={i18next.t("login:Loading")} style={{margin: "0 auto"}} />
|
||||
<div className="loginBackground"
|
||||
style={{backgroundImage: Setting.inIframe() || Setting.isMobile() ? null : `url(${this.state.application?.formBackgroundUrl})`}}>
|
||||
<Spin size="large" spinning={this.state.application === undefined && this.state.pricing === undefined} tip={i18next.t("login:Loading")}
|
||||
style={{margin: "0 auto"}} />
|
||||
<Switch>
|
||||
<Route exact path="/signup" render={(props) => this.renderHomeIfLoggedIn(<SignupPage {...this.props} application={this.state.application} applicationName={authConfig.appName} onUpdateApplication={onUpdateApplication} {...props} />)} />
|
||||
<Route exact path="/signup/:applicationName" render={(props) => this.renderHomeIfLoggedIn(<SignupPage {...this.props} application={this.state.application} onUpdateApplication={onUpdateApplication} {...props} />)} />
|
||||
@@ -85,6 +102,7 @@ class EntryPage extends React.Component {
|
||||
<Route exact path="/result/:applicationName" render={(props) => this.renderHomeIfLoggedIn(<ResultPage {...this.props} application={this.state.application} onUpdateApplication={onUpdateApplication} {...props} />)} />
|
||||
<Route exact path="/cas/:owner/:casApplicationName/logout" render={(props) => this.renderHomeIfLoggedIn(<CasLogout {...this.props} application={this.state.application} onUpdateApplication={onUpdateApplication} {...props} />)} />
|
||||
<Route exact path="/cas/:owner/:casApplicationName/login" render={(props) => {return (<LoginPage {...this.props} application={this.state.application} type={"cas"} mode={"signin"} onUpdateApplication={onUpdateApplication} {...props} />);}} />
|
||||
<Route exact path="/select-plan/:pricingName" render={(props) => this.renderHomeIfLoggedIn(<PricingPage {...this.props} pricing={this.state.pricing} onUpdatePricing={onUpdatePricing} {...props} />)} />
|
||||
</Switch>
|
||||
</div>
|
||||
);
|
||||
|
273
web/src/PlanEditPage.js
Normal file
273
web/src/PlanEditPage.js
Normal file
@@ -0,0 +1,273 @@
|
||||
// Copyright 2023 The Casdoor Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import React from "react";
|
||||
import {Button, Card, Col, Input, InputNumber, Row, Select, Switch} from "antd";
|
||||
import * as OrganizationBackend from "./backend/OrganizationBackend";
|
||||
import * as RoleBackend from "./backend/RoleBackend";
|
||||
import * as PlanBackend from "./backend/PlanBackend";
|
||||
import * as UserBackend from "./backend/UserBackend";
|
||||
import * as Setting from "./Setting";
|
||||
import i18next from "i18next";
|
||||
|
||||
const {Option} = Select;
|
||||
|
||||
class PlanEditPage extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
classes: props,
|
||||
organizationName: props.organizationName !== undefined ? props.organizationName : props.match.params.organizationName,
|
||||
planName: props.match.params.planName,
|
||||
plan: null,
|
||||
organizations: [],
|
||||
users: [],
|
||||
roles: [],
|
||||
providers: [],
|
||||
mode: props.location.mode !== undefined ? props.location.mode : "edit",
|
||||
};
|
||||
}
|
||||
|
||||
UNSAFE_componentWillMount() {
|
||||
this.getPlan();
|
||||
this.getOrganizations();
|
||||
}
|
||||
|
||||
getPlan() {
|
||||
PlanBackend.getPlan(this.state.organizationName, this.state.planName)
|
||||
.then((plan) => {
|
||||
this.setState({
|
||||
plan: plan,
|
||||
});
|
||||
|
||||
this.getUsers(plan.owner);
|
||||
this.getRoles(plan.owner);
|
||||
});
|
||||
}
|
||||
|
||||
getRoles(organizationName) {
|
||||
RoleBackend.getRoles(organizationName)
|
||||
.then((res) => {
|
||||
this.setState({
|
||||
roles: res,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
getUsers(organizationName) {
|
||||
UserBackend.getUsers(organizationName)
|
||||
.then((res) => {
|
||||
this.setState({
|
||||
users: res,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
getOrganizations() {
|
||||
OrganizationBackend.getOrganizations("admin")
|
||||
.then((res) => {
|
||||
this.setState({
|
||||
organizations: (res.msg === undefined) ? res : [],
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
parsePlanField(key, value) {
|
||||
if ([""].includes(key)) {
|
||||
value = Setting.myParseInt(value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
updatePlanField(key, value) {
|
||||
value = this.parsePlanField(key, value);
|
||||
|
||||
const plan = this.state.plan;
|
||||
plan[key] = value;
|
||||
this.setState({
|
||||
plan: plan,
|
||||
});
|
||||
}
|
||||
|
||||
renderPlan() {
|
||||
return (
|
||||
<Card size="small" title={
|
||||
<div>
|
||||
{this.state.mode === "add" ? i18next.t("plan:New Plan") : i18next.t("plan:Edit Plan")}
|
||||
<Button onClick={() => this.submitPlanEdit(false)}>{i18next.t("general:Save")}</Button>
|
||||
<Button style={{marginLeft: "20px"}} type="primary" onClick={() => this.submitPlanEdit(true)}>{i18next.t("general:Save & Exit")}</Button>
|
||||
{this.state.mode === "add" ? <Button style={{marginLeft: "20px"}} onClick={() => this.deletePlan()}>{i18next.t("general:Cancel")}</Button> : null}
|
||||
</div>
|
||||
} style={(Setting.isMobile()) ? {margin: "5px"} : {}} type="inner">
|
||||
<Row style={{marginTop: "10px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:Organization"), i18next.t("general:Organization - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Select virtual={false} style={{width: "100%"}} value={this.state.plan.owner} onChange={(owner => {
|
||||
this.updatePlanField("owner", owner);
|
||||
this.getUsers(owner);
|
||||
this.getRoles(owner);
|
||||
})}
|
||||
options={this.state.organizations.map((organization) => Setting.getOption(organization.name, organization.name))
|
||||
} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:Name"), i18next.t("general:Name - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Input value={this.state.plan.name} onChange={e => {
|
||||
this.updatePlanField("name", e.target.value);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:Display name"), i18next.t("general:Display name - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Input value={this.state.plan.displayName} onChange={e => {
|
||||
this.updatePlanField("displayName", e.target.value);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("role:Sub roles"), i18next.t("plan:Sub roles - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Select virtual={false} style={{width: "100%"}} value={this.state.plan.role} onChange={(value => {this.updatePlanField("role", value);})}
|
||||
options={this.state.roles.map((role) => Setting.getOption(`${role.owner}/${role.name}`, `${role.owner}/${role.name}`))
|
||||
} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:Description"), i18next.t("general:Description - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Input value={this.state.plan.description} onChange={e => {
|
||||
this.updatePlanField("description", e.target.value);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("plan:PricePerMonth"), i18next.t("plan:PricePerMonth - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<InputNumber value={this.state.plan.pricePerMonth} onChange={value => {
|
||||
this.updatePlanField("pricePerMonth", value);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("plan:PricePerYear"), i18next.t("plan:PricePerYear - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<InputNumber value={this.state.plan.pricePerYear} onChange={value => {
|
||||
this.updatePlanField("pricePerYear", value);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("payment:Currency"), i18next.t("payment:Currency - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Select virtual={false} style={{width: "100%"}} value={this.state.plan.currency} onChange={(value => {
|
||||
this.updatePlanField("currency", value);
|
||||
})}>
|
||||
{
|
||||
[
|
||||
{id: "USD", name: "USD"},
|
||||
{id: "CNY", name: "CNY"},
|
||||
].map((item, index) => <Option key={index} value={item.id}>{item.name}</Option>)
|
||||
}
|
||||
</Select>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 19 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:Is enabled"), i18next.t("general:Is enabled - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={1} >
|
||||
<Switch checked={this.state.plan.isEnabled} onChange={checked => {
|
||||
this.updatePlanField("isEnabled", checked);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
submitPlanEdit(willExist) {
|
||||
const plan = Setting.deepCopy(this.state.plan);
|
||||
PlanBackend.updatePlan(this.state.organizationName, this.state.planName, plan)
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
Setting.showMessage("success", i18next.t("general:Successfully saved"));
|
||||
this.setState({
|
||||
planName: this.state.plan.name,
|
||||
});
|
||||
|
||||
if (willExist) {
|
||||
this.props.history.push("/plans");
|
||||
} else {
|
||||
this.props.history.push(`/plan/${this.state.plan.owner}/${this.state.plan.name}`);
|
||||
}
|
||||
} else {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to save")}: ${res.msg}`);
|
||||
this.updatePlanField("name", this.state.planName);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to connect to server")}: ${error}`);
|
||||
});
|
||||
}
|
||||
|
||||
deletePlan() {
|
||||
PlanBackend.deletePlan(this.state.plan)
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
this.props.history.push("/plans");
|
||||
} else {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to delete")}: ${res.msg}`);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to connect to server")}: ${error}`);
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
{
|
||||
this.state.plan !== null ? this.renderPlan() : null
|
||||
}
|
||||
<div style={{marginTop: "20px", marginLeft: "40px"}}>
|
||||
<Button size="large" onClick={() => this.submitPlanEdit(false)}>{i18next.t("general:Save")}</Button>
|
||||
<Button style={{marginLeft: "20px"}} type="primary" size="large" onClick={() => this.submitPlanEdit(true)}>{i18next.t("general:Save & Exit")}</Button>
|
||||
{this.state.mode === "add" ? <Button style={{marginLeft: "20px"}} size="large" onClick={() => this.deletePlan()}>{i18next.t("general:Cancel")}</Button> : null}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default PlanEditPage;
|
236
web/src/PlanListPage.js
Normal file
236
web/src/PlanListPage.js
Normal file
@@ -0,0 +1,236 @@
|
||||
// Copyright 2023 The Casdoor Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import React from "react";
|
||||
import {Link} from "react-router-dom";
|
||||
import {Button, Switch, Table} from "antd";
|
||||
import moment from "moment";
|
||||
import * as Setting from "./Setting";
|
||||
import * as PlanBackend from "./backend/PlanBackend";
|
||||
import i18next from "i18next";
|
||||
import BaseListPage from "./BaseListPage";
|
||||
import PopconfirmModal from "./common/modal/PopconfirmModal";
|
||||
|
||||
class PlanListPage extends BaseListPage {
|
||||
newPlan() {
|
||||
const randomName = Setting.getRandomName();
|
||||
const owner = (this.state.organizationName !== undefined) ? this.state.organizationName : this.props.account.owner;
|
||||
|
||||
return {
|
||||
owner: owner,
|
||||
name: `plan_${randomName}`,
|
||||
createdTime: moment().format(),
|
||||
pricePerMonth: 10,
|
||||
pricePerYear: 100,
|
||||
currency: "USD",
|
||||
displayName: `New Plan - ${randomName}`,
|
||||
};
|
||||
}
|
||||
|
||||
addPlan() {
|
||||
const newPlan = this.newPlan();
|
||||
PlanBackend.addPlan(newPlan)
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
this.props.history.push({pathname: `/plan/${newPlan.owner}/${newPlan.name}`, mode: "add"});
|
||||
Setting.showMessage("success", i18next.t("general:Successfully added"));
|
||||
} else {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to add")}: ${res.msg}`);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to connect to server")}: ${error}`);
|
||||
});
|
||||
}
|
||||
|
||||
deletePlan(i) {
|
||||
PlanBackend.deletePlan(this.state.data[i])
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
Setting.showMessage("success", i18next.t("general:Successfully deleted"));
|
||||
this.setState({
|
||||
data: Setting.deleteRow(this.state.data, i),
|
||||
pagination: {total: this.state.pagination.total - 1},
|
||||
});
|
||||
} else {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to delete")}: ${res.msg}`);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to connect to server")}: ${error}`);
|
||||
});
|
||||
}
|
||||
|
||||
renderTable(plans) {
|
||||
const columns = [
|
||||
{
|
||||
title: i18next.t("general:Name"),
|
||||
dataIndex: "name",
|
||||
key: "name",
|
||||
width: "140px",
|
||||
fixed: "left",
|
||||
sorter: true,
|
||||
...this.getColumnSearchProps("name"),
|
||||
render: (text, record, index) => {
|
||||
return (
|
||||
<Link to={`/plans/${text}`}>
|
||||
{text}
|
||||
</Link>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: i18next.t("general:Organization"),
|
||||
dataIndex: "owner",
|
||||
key: "owner",
|
||||
width: "120px",
|
||||
sorter: true,
|
||||
...this.getColumnSearchProps("owner"),
|
||||
render: (text, record, index) => {
|
||||
return (
|
||||
<Link to={`/organizations/${text}`}>
|
||||
{text}
|
||||
</Link>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: i18next.t("general:Created time"),
|
||||
dataIndex: "createdTime",
|
||||
key: "createdTime",
|
||||
width: "160px",
|
||||
sorter: true,
|
||||
render: (text, record, index) => {
|
||||
return Setting.getFormattedDate(text);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: i18next.t("general:Display name"),
|
||||
dataIndex: "displayName",
|
||||
key: "displayName",
|
||||
width: "170px",
|
||||
sorter: true,
|
||||
...this.getColumnSearchProps("displayName"),
|
||||
},
|
||||
{
|
||||
title: i18next.t("plan:Price per month"),
|
||||
dataIndex: "pricePerMonth",
|
||||
key: "pricePerMonth",
|
||||
width: "130px",
|
||||
...this.getColumnSearchProps("pricePerMonth"),
|
||||
},
|
||||
{
|
||||
title: i18next.t("plan:Price per year"),
|
||||
dataIndex: "pricePerYear",
|
||||
key: "pricePerYear",
|
||||
width: "130px",
|
||||
...this.getColumnSearchProps("pricePerYear"),
|
||||
},
|
||||
{
|
||||
title: i18next.t("plan:Sub role"),
|
||||
dataIndex: "role",
|
||||
key: "role",
|
||||
width: "140px",
|
||||
...this.getColumnSearchProps("role"),
|
||||
},
|
||||
{
|
||||
title: i18next.t("general:Is enabled"),
|
||||
dataIndex: "isEnabled",
|
||||
key: "isEnabled",
|
||||
width: "120px",
|
||||
sorter: true,
|
||||
render: (text, record, index) => {
|
||||
return (
|
||||
<Switch disabled checkedChildren="ON" unCheckedChildren="OFF" checked={text} />
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: i18next.t("general:Action"),
|
||||
dataIndex: "",
|
||||
key: "op",
|
||||
width: "200px",
|
||||
fixed: (Setting.isMobile()) ? "false" : "right",
|
||||
render: (text, record, index) => {
|
||||
return (
|
||||
<div>
|
||||
<Button style={{marginTop: "10px", marginBottom: "10px", marginRight: "10px"}} type="primary" onClick={() => this.props.history.push(`/plan/${record.owner}/${record.name}`)}>{i18next.t("general:Edit")}</Button>
|
||||
<PopconfirmModal
|
||||
title={i18next.t("general:Sure to delete") + `: ${record.name} ?`}
|
||||
onConfirm={() => this.deletePlan(index)}
|
||||
>
|
||||
</PopconfirmModal>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const paginationProps = {
|
||||
total: this.state.pagination.total,
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
showTotal: () => i18next.t("general:{total} in total").replace("{total}", this.state.pagination.total),
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Table scroll={{x: "max-content"}} columns={columns} dataSource={plans} rowKey="name" size="middle" bordered pagination={paginationProps}
|
||||
title={() => (
|
||||
<div>
|
||||
{i18next.t("general:Plans")}
|
||||
<Button type="primary" size="small" onClick={this.addPlan.bind(this)}>{i18next.t("general:Add")}</Button>
|
||||
</div>
|
||||
)}
|
||||
loading={this.state.loading}
|
||||
onChange={this.handleTableChange}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
fetch = (params = {}) => {
|
||||
let field = params.searchedColumn, value = params.searchText;
|
||||
const sortField = params.sortField, sortOrder = params.sortOrder;
|
||||
if (params.type !== undefined && params.type !== null) {
|
||||
field = "type";
|
||||
value = params.type;
|
||||
}
|
||||
this.setState({loading: true});
|
||||
PlanBackend.getPlans("", params.pagination.current, params.pagination.pageSize, field, value, sortField, sortOrder)
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
this.setState({
|
||||
loading: false,
|
||||
data: res.data,
|
||||
pagination: {
|
||||
...params.pagination,
|
||||
total: res.data2,
|
||||
},
|
||||
searchText: params.searchText,
|
||||
searchedColumn: params.searchedColumn,
|
||||
});
|
||||
} else {
|
||||
if (Setting.isResponseDenied(res)) {
|
||||
this.setState({
|
||||
loading: false,
|
||||
isAuthorized: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export default PlanListPage;
|
309
web/src/PricingEditPage.js
Normal file
309
web/src/PricingEditPage.js
Normal file
@@ -0,0 +1,309 @@
|
||||
// Copyright 2023 The Casdoor Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import {CopyOutlined} from "@ant-design/icons";
|
||||
import copy from "copy-to-clipboard";
|
||||
import React from "react";
|
||||
import {Button, Card, Col, Input, InputNumber, Row, Select, Switch} from "antd";
|
||||
import * as ApplicationBackend from "./backend/ApplicationBackend";
|
||||
import * as OrganizationBackend from "./backend/OrganizationBackend";
|
||||
import * as PricingBackend from "./backend/PricingBackend";
|
||||
import * as PlanBackend from "./backend/PlanBackend";
|
||||
import PricingPage from "./pricing/PricingPage";
|
||||
import * as Setting from "./Setting";
|
||||
import i18next from "i18next";
|
||||
|
||||
class PricingEditPage extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
classes: props,
|
||||
organizationName: props.organizationName !== undefined ? props.organizationName : props.match.params.organizationName,
|
||||
pricingName: props.match.params.pricingName,
|
||||
organizations: [],
|
||||
application: null,
|
||||
applications: [],
|
||||
pricing: null,
|
||||
plans: [],
|
||||
mode: props.location.mode !== undefined ? props.location.mode : "edit",
|
||||
};
|
||||
}
|
||||
|
||||
UNSAFE_componentWillMount() {
|
||||
this.getPricing();
|
||||
this.getOrganizations();
|
||||
this.getApplicationsByOrganization(this.state.organizationName);
|
||||
this.getUserApplication();
|
||||
}
|
||||
|
||||
getPricing() {
|
||||
PricingBackend.getPricing(this.state.organizationName, this.state.pricingName)
|
||||
.then((pricing) => {
|
||||
this.setState({
|
||||
pricing: pricing,
|
||||
});
|
||||
this.getPlans(pricing.owner);
|
||||
});
|
||||
}
|
||||
|
||||
getPlans(organizationName) {
|
||||
PlanBackend.getPlans(organizationName)
|
||||
.then((res) => {
|
||||
this.setState({
|
||||
plans: res,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
getOrganizations() {
|
||||
OrganizationBackend.getOrganizations("admin")
|
||||
.then((res) => {
|
||||
this.setState({
|
||||
organizations: (res.msg === undefined) ? res : [],
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
parsePricingField(key, value) {
|
||||
if ([""].includes(key)) {
|
||||
value = Setting.myParseInt(value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
updatePricingField(key, value) {
|
||||
value = this.parsePricingField(key, value);
|
||||
|
||||
const pricing = this.state.pricing;
|
||||
pricing[key] = value;
|
||||
|
||||
this.setState({
|
||||
pricing: pricing,
|
||||
});
|
||||
}
|
||||
|
||||
getApplicationsByOrganization(organizationName) {
|
||||
ApplicationBackend.getApplicationsByOrganization("admin", organizationName)
|
||||
.then((res) => {
|
||||
this.setState({
|
||||
applications: (res.msg === undefined) ? res : [],
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
getUserApplication() {
|
||||
ApplicationBackend.getUserApplication(this.state.organizationName, this.state.userName)
|
||||
.then((application) => {
|
||||
this.setState({
|
||||
application: application,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
renderPricing() {
|
||||
return (
|
||||
<Card size="small" title={
|
||||
<div>
|
||||
{this.state.mode === "add" ? i18next.t("pricing:New Pricing") : i18next.t("pricing:Edit Pricing")}
|
||||
<Button onClick={() => this.submitPricingEdit(false)}>{i18next.t("general:Save")}</Button>
|
||||
<Button style={{marginLeft: "20px"}} type="primary" onClick={() => this.submitPricingEdit(true)}>{i18next.t("general:Save & Exit")}</Button>
|
||||
{this.state.mode === "add" ? <Button style={{marginLeft: "20px"}} onClick={() => this.deletePricing()}>{i18next.t("general:Cancel")}</Button> : null}
|
||||
</div>
|
||||
} style={(Setting.isMobile()) ? {margin: "5px"} : {}} type="inner">
|
||||
<Row style={{marginTop: "10px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:Organization"), i18next.t("general:Organization - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Select virtual={false} style={{width: "100%"}} value={this.state.pricing.owner} onChange={(owner => {
|
||||
this.updatePricingField("owner", owner);
|
||||
this.getApplicationsByOrganization(owner);
|
||||
this.getPlans(owner);
|
||||
})}
|
||||
options={this.state.organizations.map((organization) => Setting.getOption(organization.name, organization.name))
|
||||
} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:Name"), i18next.t("general:Name - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Input value={this.state.pricing.name} onChange={e => {
|
||||
this.updatePricingField("name", e.target.value);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:Display name"), i18next.t("general:Display name - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Input value={this.state.pricing.displayName} onChange={e => {
|
||||
this.updatePricingField("displayName", e.target.value);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:Description"), i18next.t("general:Description - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Input value={this.state.pricing.description} onChange={e => {
|
||||
this.updatePricingField("description", e.target.value);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:Application"), i18next.t("general:Application - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Select virtual={false} style={{width: "100%"}} value={this.state.pricing.application}
|
||||
onChange={(value => {this.updatePricingField("application", value);})}
|
||||
options={this.state.applications.map((application) => Setting.getOption(application.name, application.name))
|
||||
} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("pricing:Sub plans"), i18next.t("pricing:Sub plans - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Select mode="tags" style={{width: "100%"}} value={this.state.pricing.plans}
|
||||
onChange={(value => {
|
||||
this.updatePricingField("plans", value);
|
||||
})}
|
||||
options={this.state.plans.map((plan) => Setting.getOption(`${plan.owner}/${plan.name}`, `${plan.owner}/${plan.name}`))}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 19 : 2}>
|
||||
{Setting.getLabel(i18next.t("pricing:Has trial"), i18next.t("pricing:Has trial - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={1} >
|
||||
<Switch disabled={true} checked={this.state.pricing.hasTrial} onChange={checked => {
|
||||
this.updatePricingField("hasTrial", checked);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("pricing:Trial duration"), i18next.t("pricing:Trial duration - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<InputNumber min={1} value={this.state.pricing.trialDuration} onChange={value => {
|
||||
this.updatePricingField("trialDuration", value);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 19 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:Is enabled"), i18next.t("general:Is enabled - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={1} >
|
||||
<Switch checked={this.state.pricing.isEnabled} onChange={checked => {
|
||||
this.updatePricingField("isEnabled", checked);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:Preview"), i18next.t("general:Preview - Tooltip"))} :
|
||||
</Col>
|
||||
{
|
||||
this.renderPreview()
|
||||
}
|
||||
</Row>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
submitPricingEdit(willExist) {
|
||||
const pricing = Setting.deepCopy(this.state.pricing);
|
||||
PricingBackend.updatePricing(this.state.organizationName, this.state.pricingName, pricing)
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
Setting.showMessage("success", i18next.t("general:Successfully saved"));
|
||||
this.setState({
|
||||
pricingName: this.state.pricing.name,
|
||||
});
|
||||
|
||||
if (willExist) {
|
||||
this.props.history.push("/pricings");
|
||||
} else {
|
||||
this.props.history.push(`/pricing/${this.state.pricing.owner}/${this.state.pricing.name}`);
|
||||
}
|
||||
} else {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to save")}: ${res.msg}`);
|
||||
this.updatePricingField("name", this.state.pricingName);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to connect to server")}: ${error}`);
|
||||
});
|
||||
}
|
||||
|
||||
deletePricing() {
|
||||
PricingBackend.deletePricing(this.state.pricing)
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
this.props.history.push("/pricings");
|
||||
} else {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to delete")}: ${res.msg}`);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to connect to server")}: ${error}`);
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
{
|
||||
this.state.pricing !== null ? this.renderPricing() : null
|
||||
}
|
||||
<div style={{marginTop: "20px", marginLeft: "40px"}}>
|
||||
<Button size="large" onClick={() => this.submitPricingEdit(false)}>{i18next.t("general:Save")}</Button>
|
||||
<Button style={{marginLeft: "20px"}} type="primary" size="large" onClick={() => this.submitPricingEdit(true)}>{i18next.t("general:Save & Exit")}</Button>
|
||||
{this.state.mode === "add" ? <Button style={{marginLeft: "20px"}} size="large" onClick={() => this.deletePricing()}>{i18next.t("general:Cancel")}</Button> : null}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
renderPreview() {
|
||||
const pricingUrl = `/select-plan/${this.state.pricing.name}`;
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Col>
|
||||
<Button style={{marginBottom: "10px", marginTop: Setting.isMobile() ? "15px" : "0"}} type="primary" shape="round" icon={<CopyOutlined />} onClick={() => {
|
||||
copy(`${window.location.origin}${pricingUrl}`);
|
||||
Setting.showMessage("success", i18next.t("pricing:pricing page URL copied to clipboard successfully, please paste it into the incognito window or another browser"));
|
||||
}}
|
||||
>
|
||||
{i18next.t("pricing:Copy pricing page URL")}
|
||||
</Button>
|
||||
</Col>
|
||||
<Col>
|
||||
<PricingPage pricing={this.state.pricing}></PricingPage>
|
||||
</Col>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default PricingEditPage;
|
217
web/src/PricingListPage.js
Normal file
217
web/src/PricingListPage.js
Normal file
@@ -0,0 +1,217 @@
|
||||
// Copyright 2023 The Casdoor Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import React from "react";
|
||||
import {Link} from "react-router-dom";
|
||||
import {Button, Switch, Table} from "antd";
|
||||
import moment from "moment";
|
||||
import * as Setting from "./Setting";
|
||||
import * as PricingBackend from "./backend/PricingBackend";
|
||||
import i18next from "i18next";
|
||||
import BaseListPage from "./BaseListPage";
|
||||
import PopconfirmModal from "./common/modal/PopconfirmModal";
|
||||
|
||||
class PricingListPage extends BaseListPage {
|
||||
newPricing() {
|
||||
const randomName = Setting.getRandomName();
|
||||
const owner = (this.state.organizationName !== undefined) ? this.state.organizationName : this.props.account.owner;
|
||||
|
||||
return {
|
||||
owner: owner,
|
||||
name: `pricing_${randomName}`,
|
||||
createdTime: moment().format(),
|
||||
plans: [],
|
||||
displayName: `New Pricing - ${randomName}`,
|
||||
hasTrial: true,
|
||||
isEnabled: true,
|
||||
trialDuration: 14,
|
||||
};
|
||||
}
|
||||
|
||||
addPricing() {
|
||||
const newPricing = this.newPricing();
|
||||
PricingBackend.addPricing(newPricing)
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
this.props.history.push({pathname: `/pricing/${newPricing.owner}/${newPricing.name}`, mode: "add"});
|
||||
Setting.showMessage("success", i18next.t("general:Successfully added"));
|
||||
} else {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to add")}: ${res.msg}`);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to connect to server")}: ${error}`);
|
||||
});
|
||||
}
|
||||
|
||||
deletePricing(i) {
|
||||
PricingBackend.deletePricing(this.state.data[i])
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
Setting.showMessage("success", i18next.t("general:Successfully deleted"));
|
||||
this.setState({
|
||||
data: Setting.deleteRow(this.state.data, i),
|
||||
pagination: {total: this.state.pagination.total - 1},
|
||||
});
|
||||
} else {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to delete")}: ${res.msg}`);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to connect to server")}: ${error}`);
|
||||
});
|
||||
}
|
||||
|
||||
renderTable(pricings) {
|
||||
const columns = [
|
||||
{
|
||||
title: i18next.t("general:Name"),
|
||||
dataIndex: "name",
|
||||
key: "name",
|
||||
width: "140px",
|
||||
fixed: "left",
|
||||
sorter: true,
|
||||
...this.getColumnSearchProps("name"),
|
||||
render: (text, record, index) => {
|
||||
return (
|
||||
<Link to={`/pricing/${record.owner}/${text}`}>
|
||||
{text}
|
||||
</Link>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: i18next.t("general:Organization"),
|
||||
dataIndex: "owner",
|
||||
key: "owner",
|
||||
width: "120px",
|
||||
sorter: true,
|
||||
...this.getColumnSearchProps("owner"),
|
||||
render: (text, record, index) => {
|
||||
return (
|
||||
<Link to={`/organizations/${text}`}>
|
||||
{text}
|
||||
</Link>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: i18next.t("general:Created time"),
|
||||
dataIndex: "createdTime",
|
||||
key: "createdTime",
|
||||
width: "160px",
|
||||
sorter: true,
|
||||
render: (text, record, index) => {
|
||||
return Setting.getFormattedDate(text);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: i18next.t("general:Display name"),
|
||||
dataIndex: "displayName",
|
||||
key: "displayName",
|
||||
width: "170px",
|
||||
sorter: true,
|
||||
...this.getColumnSearchProps("displayName"),
|
||||
},
|
||||
|
||||
{
|
||||
title: i18next.t("general:Is enabled"),
|
||||
dataIndex: "isEnabled",
|
||||
key: "isEnabled",
|
||||
width: "120px",
|
||||
sorter: true,
|
||||
render: (text, record, index) => {
|
||||
return (
|
||||
<Switch disabled checkedChildren="ON" unCheckedChildren="OFF" checked={text} />
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: i18next.t("general:Action"),
|
||||
dataIndex: "",
|
||||
key: "op",
|
||||
width: "230px",
|
||||
fixed: (Setting.isMobile()) ? "false" : "right",
|
||||
render: (text, record, index) => {
|
||||
return (
|
||||
<div>
|
||||
<Button style={{marginTop: "10px", marginBottom: "10px", marginRight: "10px"}} type="primary" onClick={() => this.props.history.push(`/pricing/${record.owner}/${record.name}`)}>{i18next.t("general:Edit")}</Button>
|
||||
<PopconfirmModal
|
||||
title={i18next.t("general:Sure to delete") + `: ${record.name} ?`}
|
||||
onConfirm={() => this.deletePricing(index)}
|
||||
>
|
||||
</PopconfirmModal>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const paginationProps = {
|
||||
total: this.state.pagination.total,
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
showTotal: () => i18next.t("general:{total} in total").replace("{total}", this.state.pagination.total),
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Table scroll={{x: "max-content"}} columns={columns} dataSource={pricings} rowKey="name" size="middle" bordered pagination={paginationProps}
|
||||
title={() => (
|
||||
<div>
|
||||
{i18next.t("general:Pricings")}
|
||||
<Button type="primary" size="small" onClick={this.addPricing.bind(this)}>{i18next.t("general:Add")}</Button>
|
||||
</div>
|
||||
)}
|
||||
loading={this.state.loading}
|
||||
onChange={this.handleTableChange}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
fetch = (params = {}) => {
|
||||
let field = params.searchedColumn, value = params.searchText;
|
||||
const sortField = params.sortField, sortOrder = params.sortOrder;
|
||||
if (params.type !== undefined && params.type !== null) {
|
||||
field = "type";
|
||||
value = params.type;
|
||||
}
|
||||
this.setState({loading: true});
|
||||
PricingBackend.getPricings("", params.pagination.current, params.pagination.pageSize, field, value, sortField, sortOrder)
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
this.setState({
|
||||
loading: false,
|
||||
data: res.data,
|
||||
pagination: {
|
||||
...params.pagination,
|
||||
total: res.data2,
|
||||
},
|
||||
searchText: params.searchText,
|
||||
searchedColumn: params.searchedColumn,
|
||||
});
|
||||
} else {
|
||||
if (Setting.isResponseDenied(res)) {
|
||||
this.setState({
|
||||
loading: false,
|
||||
isAuthorized: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export default PricingListPage;
|
@@ -856,7 +856,7 @@ class ProviderEditPage extends React.Component {
|
||||
this.state.provider.type === "WeChat Pay" ? (
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel("cert", "cert")} :
|
||||
{Setting.getLabel(i18next.t("general:Cert"), i18next.t("general:Cert - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Input value={this.state.provider.cert} onChange={e => {
|
||||
|
@@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
import React from "react";
|
||||
import {Button, Table, Upload} from "antd";
|
||||
import {Button, Image, Table, Upload} from "antd";
|
||||
import {UploadOutlined} from "@ant-design/icons";
|
||||
import copy from "copy-to-clipboard";
|
||||
import * as Setting from "./Setting";
|
||||
@@ -61,7 +61,9 @@ class ResourceListPage extends BaseListPage {
|
||||
.then(res => {
|
||||
if (res.status === "ok") {
|
||||
Setting.showMessage("success", i18next.t("application:File uploaded successfully"));
|
||||
window.location.reload();
|
||||
|
||||
const {pagination} = this.state;
|
||||
this.fetch({pagination});
|
||||
} else {
|
||||
Setting.showMessage("error", res.msg);
|
||||
}
|
||||
@@ -88,7 +90,6 @@ class ResourceListPage extends BaseListPage {
|
||||
dataIndex: "provider",
|
||||
key: "provider",
|
||||
width: "150px",
|
||||
fixed: "left",
|
||||
sorter: true,
|
||||
...this.getColumnSearchProps("provider"),
|
||||
render: (text, record, index) => {
|
||||
@@ -99,6 +100,21 @@ class ResourceListPage extends BaseListPage {
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: i18next.t("general:Organization"),
|
||||
dataIndex: "owner",
|
||||
key: "owner",
|
||||
width: "120px",
|
||||
sorter: true,
|
||||
...this.getColumnSearchProps("owner"),
|
||||
render: (text, record, index) => {
|
||||
return (
|
||||
<Link to={`/organizations/${text}`}>
|
||||
{text}
|
||||
</Link>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: i18next.t("general:Application"),
|
||||
dataIndex: "application",
|
||||
@@ -201,12 +217,16 @@ class ResourceListPage extends BaseListPage {
|
||||
dataIndex: "preview",
|
||||
key: "preview",
|
||||
width: "100px",
|
||||
fixed: (Setting.isMobile()) ? "false" : "right",
|
||||
render: (text, record, index) => {
|
||||
if (record.fileType === "image") {
|
||||
const errorImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==";
|
||||
return (
|
||||
<a target="_blank" rel="noreferrer" href={record.url}>
|
||||
<img src={record.url} alt={record.name} width={200} />
|
||||
</a>
|
||||
<Image
|
||||
width={200}
|
||||
src={record.url}
|
||||
fallback={errorImage}
|
||||
/>
|
||||
);
|
||||
} else if (record.fileType === "video") {
|
||||
return (
|
||||
@@ -222,10 +242,11 @@ class ResourceListPage extends BaseListPage {
|
||||
dataIndex: "url",
|
||||
key: "url",
|
||||
width: "120px",
|
||||
fixed: (Setting.isMobile()) ? "false" : "right",
|
||||
render: (text, record, index) => {
|
||||
return (
|
||||
<div>
|
||||
<Button type="normal" onClick={() => {
|
||||
<Button onClick={() => {
|
||||
copy(record.url);
|
||||
Setting.showMessage("success", i18next.t("provider:Link copied to clipboard successfully"));
|
||||
}}
|
||||
@@ -288,7 +309,7 @@ class ResourceListPage extends BaseListPage {
|
||||
const field = params.searchedColumn, value = params.searchText;
|
||||
const sortField = params.sortField, sortOrder = params.sortOrder;
|
||||
this.setState({loading: true});
|
||||
ResourceBackend.getResources("admin", this.props.account.name, params.pagination.current, params.pagination.pageSize, field, value, sortField, sortOrder)
|
||||
ResourceBackend.getResources(Setting.isAdminUser(this.props.account) ? "" : this.props.account.owner, this.props.account.name, params.pagination.current, params.pagination.pageSize, field, value, sortField, sortOrder)
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
this.setState({
|
||||
|
@@ -24,6 +24,7 @@ import {authConfig} from "./auth/Auth";
|
||||
import {Helmet} from "react-helmet";
|
||||
import * as Conf from "./Conf";
|
||||
import * as phoneNumber from "libphonenumber-js";
|
||||
import moment from "moment";
|
||||
|
||||
const {Option} = Select;
|
||||
|
||||
@@ -592,9 +593,8 @@ export function getFormattedDate(date) {
|
||||
return null;
|
||||
}
|
||||
|
||||
date = date.replace("T", " ");
|
||||
date = date.replace("+08:00", " ");
|
||||
return date;
|
||||
const m = moment(date).local();
|
||||
return m.format("YYYY-MM-DD HH:mm:ss");
|
||||
}
|
||||
|
||||
export function getFormattedDateShort(date) {
|
||||
|
333
web/src/SubscriptionEditPage.js
Normal file
333
web/src/SubscriptionEditPage.js
Normal file
@@ -0,0 +1,333 @@
|
||||
// Copyright 2023 The Casdoor Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import moment from "moment";
|
||||
import React from "react";
|
||||
import {Button, Card, Col, DatePicker, Input, InputNumber, Row, Select, Switch} from "antd";
|
||||
import * as OrganizationBackend from "./backend/OrganizationBackend";
|
||||
import * as PlanBackend from "./backend/PlanBackend";
|
||||
import * as SubscriptionBackend from "./backend/SubscriptionBackend";
|
||||
import * as UserBackend from "./backend/UserBackend";
|
||||
import * as Setting from "./Setting";
|
||||
import i18next from "i18next";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
class SubscriptionEditPage extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
classes: props,
|
||||
organizationName: props.organizationName !== undefined ? props.organizationName : props.match.params.organizationName,
|
||||
subscriptionName: props.match.params.subscriptionName,
|
||||
subscription: null,
|
||||
organizations: [],
|
||||
users: [],
|
||||
planes: [],
|
||||
providers: [],
|
||||
mode: props.location.mode !== undefined ? props.location.mode : "edit",
|
||||
};
|
||||
}
|
||||
|
||||
UNSAFE_componentWillMount() {
|
||||
this.getSubscription();
|
||||
this.getOrganizations();
|
||||
}
|
||||
|
||||
getSubscription() {
|
||||
SubscriptionBackend.getSubscription(this.state.organizationName, this.state.subscriptionName)
|
||||
.then((subscription) => {
|
||||
this.setState({
|
||||
subscription: subscription,
|
||||
});
|
||||
|
||||
this.getUsers(subscription.owner);
|
||||
this.getPlanes(subscription.owner);
|
||||
});
|
||||
}
|
||||
|
||||
getPlanes(organizationName) {
|
||||
PlanBackend.getPlans(organizationName)
|
||||
.then((res) => {
|
||||
this.setState({
|
||||
planes: res,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
getUsers(organizationName) {
|
||||
UserBackend.getUsers(organizationName)
|
||||
.then((res) => {
|
||||
this.setState({
|
||||
users: res,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
getOrganizations() {
|
||||
OrganizationBackend.getOrganizations("admin")
|
||||
.then((res) => {
|
||||
this.setState({
|
||||
organizations: (res.msg === undefined) ? res : [],
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
parseSubscriptionField(key, value) {
|
||||
if ([""].includes(key)) {
|
||||
value = Setting.myParseInt(value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
updateSubscriptionField(key, value) {
|
||||
value = this.parseSubscriptionField(key, value);
|
||||
|
||||
const subscription = this.state.subscription;
|
||||
subscription[key] = value;
|
||||
this.setState({
|
||||
subscription: subscription,
|
||||
});
|
||||
}
|
||||
|
||||
renderSubscription() {
|
||||
return (
|
||||
<Card size="small" title={
|
||||
<div>
|
||||
{this.state.mode === "add" ? i18next.t("subscription:New Subscription") : i18next.t("subscription:Edit Subscription")}
|
||||
<Button onClick={() => this.submitSubscriptionEdit(false)}>{i18next.t("general:Save")}</Button>
|
||||
<Button style={{marginLeft: "20px"}} type="primary" onClick={() => this.submitSubscriptionEdit(true)}>{i18next.t("general:Save & Exit")}</Button>
|
||||
{this.state.mode === "add" ? <Button style={{marginLeft: "20px"}} onClick={() => this.deleteSubscription()}>{i18next.t("general:Cancel")}</Button> : null}
|
||||
</div>
|
||||
} style={(Setting.isMobile()) ? {margin: "5px"} : {}} type="inner">
|
||||
<Row style={{marginTop: "10px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:Organization"), i18next.t("general:Organization - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Select virtual={false} style={{width: "100%"}} value={this.state.subscription.owner} onChange={(owner => {
|
||||
this.updateSubscriptionField("owner", owner);
|
||||
this.getUsers(owner);
|
||||
this.getPlanes(owner);
|
||||
})}
|
||||
options={this.state.organizations.map((organization) => Setting.getOption(organization.name, organization.name))
|
||||
} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:Name"), i18next.t("general:Name - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Input value={this.state.subscription.name} onChange={e => {
|
||||
this.updateSubscriptionField("name", e.target.value);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:Display name"), i18next.t("general:Display name - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Input value={this.state.subscription.displayName} onChange={e => {
|
||||
this.updateSubscriptionField("displayName", e.target.value);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("subscription:Duration"), i18next.t("subscription:Duration - Tooltip"))}
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<InputNumber value={this.state.subscription.duration} onChange={value => {
|
||||
this.updateSubscriptionField("duration", value);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("subscription:Start Date"), i18next.t("subscription:Start Date - Tooltip"))}
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<DatePicker value={dayjs(this.state.subscription.startDate)} onChange={value => {
|
||||
this.updateSubscriptionField("startDate", value);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("subscription:End Date"), i18next.t("subscription:End Date - Tooltip"))}
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<DatePicker value={dayjs(this.state.subscription.endDate)} onChange={value => {
|
||||
this.updateSubscriptionField("endDate", value);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("subscription:Sub users"), i18next.t("subscription:Sub users - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Select style={{width: "100%"}} value={this.state.subscription.user}
|
||||
onChange={(value => {this.updateSubscriptionField("user", value);})}
|
||||
options={this.state.users.map((user) => Setting.getOption(`${user.owner}/${user.name}`, `${user.owner}/${user.name}`))}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("subscription:Sub plan"), i18next.t("subscription:Sub plan - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Select virtual={false} style={{width: "100%"}} value={this.state.subscription.plan} onChange={(value => {this.updateSubscriptionField("plan", value);})}
|
||||
options={this.state.planes.map((plan) => Setting.getOption(`${plan.owner}/${plan.name}`, `${plan.owner}/${plan.name}`))
|
||||
} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:Description"), i18next.t("general:Description - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Input value={this.state.subscription.description} onChange={e => {
|
||||
this.updateSubscriptionField("description", e.target.value);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 19 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:Is enabled"), i18next.t("general:Is enabled - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={1} >
|
||||
<Switch checked={this.state.subscription.isEnabled} onChange={checked => {
|
||||
this.updateSubscriptionField("isEnabled", checked);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:Submitter"), i18next.t("general:Submitter - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Input disabled={true} value={this.state.subscription.submitter} onChange={e => {
|
||||
this.updateSubscriptionField("submitter", e.target.value);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:Approver"), i18next.t("general:Approver - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Input disabled={true} value={this.state.subscription.approver} onChange={e => {
|
||||
this.updateSubscriptionField("approver", e.target.value);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:Approve time"), i18next.t("general:Approve time - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Input disabled={true} value={Setting.getFormattedDate(this.state.subscription.approveTime)} onChange={e => {
|
||||
this.updatePermissionField("approveTime", e.target.value);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:State"), i18next.t("general:State - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Select virtual={false} disabled={!Setting.isLocalAdminUser(this.props.account)} style={{width: "100%"}} value={this.state.subscription.state} onChange={(value => {
|
||||
if (this.state.subscription.state !== value) {
|
||||
if (value === "Approved") {
|
||||
this.updateSubscriptionField("approver", this.props.account.name);
|
||||
this.updateSubscriptionField("approveTime", moment().format());
|
||||
} else {
|
||||
this.updateSubscriptionField("approver", "");
|
||||
this.updateSubscriptionField("approveTime", "");
|
||||
}
|
||||
}
|
||||
|
||||
this.updateSubscriptionField("state", value);
|
||||
})}
|
||||
options={[
|
||||
{value: "Approved", name: i18next.t("subscription:Approved")},
|
||||
{value: "Pending", name: i18next.t("subscription:Pending")},
|
||||
].map((item) => Setting.getOption(item.name, item.value))}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
submitSubscriptionEdit(willExist) {
|
||||
const subscription = Setting.deepCopy(this.state.subscription);
|
||||
SubscriptionBackend.updateSubscription(this.state.organizationName, this.state.subscriptionName, subscription)
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
Setting.showMessage("success", i18next.t("general:Successfully saved"));
|
||||
this.setState({
|
||||
subscriptionName: this.state.subscription.name,
|
||||
});
|
||||
|
||||
if (willExist) {
|
||||
this.props.history.push("/subscriptions");
|
||||
} else {
|
||||
this.props.history.push(`/subscription/${this.state.subscription.owner}/${this.state.subscription.name}`);
|
||||
}
|
||||
} else {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to save")}: ${res.msg}`);
|
||||
this.updateSubscriptionField("name", this.state.subscriptionName);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to connect to server")}: ${error}`);
|
||||
});
|
||||
}
|
||||
|
||||
deleteSubscription() {
|
||||
SubscriptionBackend.deleteSubscription(this.state.subscription)
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
this.props.history.push("/subscriptions");
|
||||
} else {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to delete")}: ${res.msg}`);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to connect to server")}: ${error}`);
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
{
|
||||
this.state.subscription !== null ? this.renderSubscription() : null
|
||||
}
|
||||
<div style={{marginTop: "20px", marginLeft: "40px"}}>
|
||||
<Button size="large" onClick={() => this.submitSubscriptionEdit(false)}>{i18next.t("general:Save")}</Button>
|
||||
<Button style={{marginLeft: "20px"}} type="primary" size="large" onClick={() => this.submitSubscriptionEdit(true)}>{i18next.t("general:Save & Exit")}</Button>
|
||||
{this.state.mode === "add" ? <Button style={{marginLeft: "20px"}} size="large" onClick={() => this.deleteSubscription()}>{i18next.t("general:Cancel")}</Button> : null}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SubscriptionEditPage;
|
239
web/src/SubscriptionListPage.js
Normal file
239
web/src/SubscriptionListPage.js
Normal file
@@ -0,0 +1,239 @@
|
||||
// Copyright 2023 The Casdoor Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import React from "react";
|
||||
import {Link} from "react-router-dom";
|
||||
import {Button, Table} from "antd";
|
||||
import moment from "moment";
|
||||
import * as Setting from "./Setting";
|
||||
import * as SubscriptionBackend from "./backend/SubscriptionBackend";
|
||||
import i18next from "i18next";
|
||||
import BaseListPage from "./BaseListPage";
|
||||
import PopconfirmModal from "./common/modal/PopconfirmModal";
|
||||
|
||||
class SubscriptionListPage extends BaseListPage {
|
||||
newSubscription() {
|
||||
const randomName = Setting.getRandomName();
|
||||
const owner = (this.state.organizationName !== undefined) ? this.state.organizationName : this.props.account.owner;
|
||||
const defaultDuration = 365;
|
||||
|
||||
return {
|
||||
owner: owner,
|
||||
name: `subscription_${randomName}`,
|
||||
createdTime: moment().format(),
|
||||
startDate: moment().format(),
|
||||
endDate: moment().add(defaultDuration, "d").format(),
|
||||
displayName: `New Subscription - ${randomName}`,
|
||||
tag: "",
|
||||
users: [],
|
||||
expireInDays: defaultDuration,
|
||||
submitter: this.props.account.name,
|
||||
approver: "",
|
||||
approveTime: "",
|
||||
state: "Pending",
|
||||
};
|
||||
}
|
||||
|
||||
addSubscription() {
|
||||
const newSubscription = this.newSubscription();
|
||||
SubscriptionBackend.addSubscription(newSubscription)
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
this.props.history.push({pathname: `/subscription/${newSubscription.owner}/${newSubscription.name}`, mode: "add"});
|
||||
Setting.showMessage("success", i18next.t("general:Successfully added"));
|
||||
} else {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to add")}: ${res.msg}`);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to connect to server")}: ${error}`);
|
||||
});
|
||||
}
|
||||
|
||||
deleteSubscription(i) {
|
||||
SubscriptionBackend.deleteSubscription(this.state.data[i])
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
Setting.showMessage("success", i18next.t("general:Successfully deleted"));
|
||||
this.setState({
|
||||
data: Setting.deleteRow(this.state.data, i),
|
||||
pagination: {total: this.state.pagination.total - 1},
|
||||
});
|
||||
} else {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to delete")}: ${res.msg}`);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
Setting.showMessage("error", `${i18next.t("general:Failed to connect to server")}: ${error}`);
|
||||
});
|
||||
}
|
||||
|
||||
renderTable(subscriptions) {
|
||||
const columns = [
|
||||
{
|
||||
title: i18next.t("general:Name"),
|
||||
dataIndex: "name",
|
||||
key: "name",
|
||||
width: "140px",
|
||||
fixed: "left",
|
||||
sorter: true,
|
||||
...this.getColumnSearchProps("name"),
|
||||
render: (text, record, index) => {
|
||||
return (
|
||||
<Link to={`/subscriptions/${text}`}>
|
||||
{text}
|
||||
</Link>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: i18next.t("general:Organization"),
|
||||
dataIndex: "owner",
|
||||
key: "owner",
|
||||
width: "120px",
|
||||
sorter: true,
|
||||
...this.getColumnSearchProps("owner"),
|
||||
render: (text, record, index) => {
|
||||
return (
|
||||
<Link to={`/organizations/${text}`}>
|
||||
{text}
|
||||
</Link>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: i18next.t("general:Created time"),
|
||||
dataIndex: "createdTime",
|
||||
key: "createdTime",
|
||||
width: "160px",
|
||||
sorter: true,
|
||||
render: (text, record, index) => {
|
||||
return Setting.getFormattedDate(text);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: i18next.t("general:Display name"),
|
||||
dataIndex: "displayName",
|
||||
key: "displayName",
|
||||
width: "170px",
|
||||
sorter: true,
|
||||
...this.getColumnSearchProps("displayName"),
|
||||
},
|
||||
{
|
||||
title: i18next.t("subscription:Duration"),
|
||||
dataIndex: "duration",
|
||||
key: "duration",
|
||||
width: "140px",
|
||||
...this.getColumnSearchProps("duration"),
|
||||
},
|
||||
{
|
||||
title: i18next.t("subscription:Sub plane"),
|
||||
dataIndex: "plan",
|
||||
key: "plan",
|
||||
width: "140px",
|
||||
...this.getColumnSearchProps("plan"),
|
||||
},
|
||||
{
|
||||
title: i18next.t("subscription:Sub user"),
|
||||
dataIndex: "user",
|
||||
key: "user",
|
||||
width: "140px",
|
||||
...this.getColumnSearchProps("user"),
|
||||
},
|
||||
{
|
||||
title: i18next.t("general:State"),
|
||||
dataIndex: "state",
|
||||
key: "state",
|
||||
width: "120px",
|
||||
sorter: true,
|
||||
...this.getColumnSearchProps("state"),
|
||||
},
|
||||
{
|
||||
title: i18next.t("general:Action"),
|
||||
dataIndex: "",
|
||||
key: "op",
|
||||
width: "230px",
|
||||
fixed: (Setting.isMobile()) ? "false" : "right",
|
||||
render: (text, record, index) => {
|
||||
return (
|
||||
<div>
|
||||
<Button style={{marginTop: "10px", marginBottom: "10px", marginRight: "10px"}} type="primary" onClick={() => this.props.history.push(`/subscription/${record.owner}/${record.name}`)}>{i18next.t("general:Edit")}</Button>
|
||||
<PopconfirmModal
|
||||
title={i18next.t("general:Sure to delete") + `: ${record.name} ?`}
|
||||
onConfirm={() => this.deleteSubscription(index)}
|
||||
>
|
||||
</PopconfirmModal>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const paginationProps = {
|
||||
total: this.state.pagination.total,
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
showTotal: () => i18next.t("general:{total} in total").replace("{total}", this.state.pagination.total),
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Table scroll={{x: "max-content"}} columns={columns} dataSource={subscriptions} rowKey="name" size="middle" bordered pagination={paginationProps}
|
||||
title={() => (
|
||||
<div>
|
||||
{i18next.t("general:Subscriptions")}
|
||||
<Button type="primary" size="small" onClick={this.addSubscription.bind(this)}>{i18next.t("general:Add")}</Button>
|
||||
</div>
|
||||
)}
|
||||
loading={this.state.loading}
|
||||
onChange={this.handleTableChange}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
fetch = (params = {}) => {
|
||||
let field = params.searchedColumn, value = params.searchText;
|
||||
const sortField = params.sortField, sortOrder = params.sortOrder;
|
||||
if (params.type !== undefined && params.type !== null) {
|
||||
field = "type";
|
||||
value = params.type;
|
||||
}
|
||||
this.setState({loading: true});
|
||||
SubscriptionBackend.getSubscriptions("", params.pagination.current, params.pagination.pageSize, field, value, sortField, sortOrder)
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
this.setState({
|
||||
loading: false,
|
||||
data: res.data,
|
||||
pagination: {
|
||||
...params.pagination,
|
||||
total: res.data2,
|
||||
},
|
||||
searchText: params.searchText,
|
||||
searchedColumn: params.searchedColumn,
|
||||
});
|
||||
} else {
|
||||
if (Setting.isResponseDenied(res)) {
|
||||
this.setState({
|
||||
loading: false,
|
||||
isAuthorized: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export default SubscriptionListPage;
|
@@ -259,7 +259,7 @@ class WebhookEditPage extends React.Component {
|
||||
}} >
|
||||
{
|
||||
(
|
||||
["signup", "login", "logout", "add-user", "update-user", "delete-user", "add-organization", "update-organization", "delete-organization", "add-application", "update-application", "delete-application", "add-provider", "update-provider", "delete-provider"].map((option, index) => {
|
||||
["signup", "login", "logout", "add-user", "update-user", "delete-user", "add-organization", "update-organization", "delete-organization", "add-application", "update-application", "delete-application", "add-provider", "update-provider", "delete-provider", "update-subscription"].map((option, index) => {
|
||||
return (
|
||||
<Option key={option} value={option}>{option}</Option>
|
||||
);
|
||||
|
@@ -14,8 +14,9 @@
|
||||
|
||||
import React from "react";
|
||||
import {Button, Checkbox, Col, Form, Input, Result, Row, Spin, Tabs} from "antd";
|
||||
import {LockOutlined, UserOutlined} from "@ant-design/icons";
|
||||
import {ArrowLeftOutlined, LockOutlined, UserOutlined} from "@ant-design/icons";
|
||||
import * as UserWebauthnBackend from "../backend/UserWebauthnBackend";
|
||||
import OrganizationSelect from "../common/select/OrganizationSelect";
|
||||
import * as Conf from "../Conf";
|
||||
import * as AuthBackend from "./AuthBackend";
|
||||
import * as OrganizationBackend from "../backend/OrganizationBackend";
|
||||
@@ -57,6 +58,7 @@ class LoginPage extends React.Component {
|
||||
redirectUrl: "",
|
||||
isTermsOfUseVisible: false,
|
||||
termsOfUseContent: "",
|
||||
orgChoiceMode: new URLSearchParams(props.location?.search).get("orgChoiceMode") ?? null,
|
||||
};
|
||||
|
||||
if (this.state.type === "cas" && props.match?.params.casApplicationName !== undefined) {
|
||||
@@ -438,6 +440,7 @@ class LoginPage extends React.Component {
|
||||
<Form
|
||||
name="normal_login"
|
||||
initialValues={{
|
||||
|
||||
organization: application.organization,
|
||||
application: application.name,
|
||||
autoSignin: true,
|
||||
@@ -814,6 +817,102 @@ class LoginPage extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
renderLoginPanel(application) {
|
||||
const orgChoiceMode = application.orgChoiceMode;
|
||||
|
||||
if (this.isOrganizationChoiceBoxVisible(orgChoiceMode)) {
|
||||
return this.renderOrganizationChoiceBox(orgChoiceMode);
|
||||
}
|
||||
|
||||
if (this.state.getVerifyTotp !== undefined) {
|
||||
return this.state.getVerifyTotp();
|
||||
} else {
|
||||
return (
|
||||
<React.Fragment>
|
||||
{this.renderSignedInBox()}
|
||||
{this.renderForm(application)}
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
renderOrganizationChoiceBox(orgChoiceMode) {
|
||||
const renderChoiceBox = () => {
|
||||
switch (orgChoiceMode) {
|
||||
case "None":
|
||||
return null;
|
||||
case "Select":
|
||||
return (
|
||||
<div>
|
||||
<p style={{fontSize: "large"}}>
|
||||
{i18next.t("login:Please select an organization to sign in")}
|
||||
</p>
|
||||
<OrganizationSelect style={{width: "70%"}}
|
||||
onSelect={(value) => {
|
||||
Setting.goToLink(`/login/${value}?orgChoiceMode=None`);
|
||||
}} />
|
||||
</div>
|
||||
);
|
||||
case "Input":
|
||||
return (
|
||||
<div>
|
||||
<p style={{fontSize: "large"}}>
|
||||
{i18next.t("login:Please type an organization to sign in")}
|
||||
</p>
|
||||
<Form
|
||||
name="basic"
|
||||
onFinish={(values) => {Setting.goToLink(`/login/${values.organizationName}?orgChoiceMode=None`);}}
|
||||
>
|
||||
<Form.Item
|
||||
name="organizationName"
|
||||
rules={[{required: true, message: i18next.t("login:Please input your organization name!")}]}
|
||||
>
|
||||
<Input style={{width: "70%"}} onPressEnter={(e) => {
|
||||
Setting.goToLink(`/login/${e.target.value}?orgChoiceMode=None`);
|
||||
}} />
|
||||
</Form.Item>
|
||||
<Button type="primary" htmlType="submit">
|
||||
{i18next.t("general:Confirm")}
|
||||
</Button>
|
||||
</Form>
|
||||
</div>
|
||||
);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div style={{height: 300, width: 300}}>
|
||||
{renderChoiceBox()}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
isOrganizationChoiceBoxVisible(orgChoiceMode) {
|
||||
if (this.state.orgChoiceMode === "None") {
|
||||
return false;
|
||||
}
|
||||
|
||||
const path = this.props.match?.path;
|
||||
if (path === "/login" || path === "/login/:owner") {
|
||||
return orgChoiceMode === "Select" || orgChoiceMode === "Input";
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
renderBackButton() {
|
||||
if (this.state.orgChoiceMode === "None") {
|
||||
return (
|
||||
<Button type="text" size="large" icon={<ArrowLeftOutlined />}
|
||||
style={{top: "65px", left: "15px", position: "absolute"}}
|
||||
onClick={() => history.back()}>
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const application = this.getApplicationObj();
|
||||
if (application === undefined) {
|
||||
@@ -862,10 +961,13 @@ class LoginPage extends React.Component {
|
||||
{
|
||||
Setting.renderLogo(application)
|
||||
}
|
||||
{
|
||||
this.renderBackButton()
|
||||
}
|
||||
<LanguageSelect languages={application.organizationObj.languages} style={{top: "55px", right: "5px", position: "absolute"}} />
|
||||
{this.state.getVerifyTotp !== undefined ? null : this.renderSignedInBox()}
|
||||
{this.state.getVerifyTotp !== undefined ? null : this.renderForm(application)}
|
||||
{this.state.getVerifyTotp !== undefined ? this.state.getVerifyTotp() : null}
|
||||
{
|
||||
this.renderLoginPanel(application)
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -78,6 +78,7 @@ function CheckPasswordForm({user, onSuccess, onFail}) {
|
||||
|
||||
export function MfaVerifyForm({mfaProps, application, user, onSuccess, onFail}) {
|
||||
const [form] = Form.useForm();
|
||||
mfaProps = mfaProps ?? {type: ""};
|
||||
|
||||
const onFinish = ({passcode}) => {
|
||||
const data = {passcode, type: mfaProps.type, ...user};
|
||||
@@ -97,9 +98,9 @@ export function MfaVerifyForm({mfaProps, application, user, onSuccess, onFail})
|
||||
});
|
||||
};
|
||||
|
||||
if (mfaProps?.type === SmsMfaType) {
|
||||
if (mfaProps.type === SmsMfaType) {
|
||||
return <MfaSmsVerifyForm onFinish={onFinish} application={application} />;
|
||||
} else if (mfaProps?.type === TotpMfaType) {
|
||||
} else if (mfaProps.type === TotpMfaType) {
|
||||
return <MfaTotpVerifyForm onFinish={onFinish} mfaProps={mfaProps} />;
|
||||
} else {
|
||||
return <div></div>;
|
||||
@@ -160,7 +161,7 @@ class MfaSetupPage extends React.Component {
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps, prevState, snapshot) {
|
||||
if (prevState.isAuthenticated === true && this.state.mfaProps === null) {
|
||||
if (this.state.isAuthenticated === true && this.state.mfaProps === null) {
|
||||
MfaBackend.MfaSetupInitiate({
|
||||
type: this.state.type,
|
||||
...this.getUser(),
|
||||
|
@@ -254,9 +254,10 @@ class PromptPage extends React.Component {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!Setting.hasPromptPage(application)) {
|
||||
if (!Setting.hasPromptPage(application) && this.state.promptType !== "mfa") {
|
||||
return (
|
||||
<Result
|
||||
style={{display: "flex", flex: "1 1 0%", justifyContent: "center", flexDirection: "column"}}
|
||||
status="error"
|
||||
title={i18next.t("application:Sign Up Error")}
|
||||
subTitle={i18next.t("application:You are unexpected to see this prompt page")}
|
||||
|
@@ -165,6 +165,11 @@ class SignupPage extends React.Component {
|
||||
|
||||
onFinish(values) {
|
||||
const application = this.getApplicationObj();
|
||||
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
values["plan"] = params.get("plan");
|
||||
values["pricing"] = params.get("pricing");
|
||||
|
||||
AuthBackend.signup(values)
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
|
@@ -80,13 +80,46 @@ export function getCasParameters(params) {
|
||||
};
|
||||
}
|
||||
|
||||
function getRawGetParameter(key) {
|
||||
const fullUrl = window.location.href;
|
||||
const token = fullUrl.split(`${key}=`)[1];
|
||||
if (!token) {
|
||||
return "";
|
||||
}
|
||||
|
||||
let res = token.split("&")[0];
|
||||
if (!res) {
|
||||
return "";
|
||||
}
|
||||
|
||||
res = decodeURIComponent(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
export function getOAuthGetParameters(params) {
|
||||
const queries = (params !== undefined) ? params : new URLSearchParams(window.location.search);
|
||||
const clientId = getRefinedValue(queries.get("client_id"));
|
||||
const responseType = getRefinedValue(queries.get("response_type"));
|
||||
const redirectUri = getRefinedValue(queries.get("redirect_uri"));
|
||||
const scope = getRefinedValue(queries.get("scope"));
|
||||
const state = getRefinedValue(queries.get("state"));
|
||||
|
||||
let redirectUri = getRawGetParameter("redirect_uri");
|
||||
if (redirectUri === "") {
|
||||
redirectUri = getRefinedValue(queries.get("redirect_uri"));
|
||||
}
|
||||
|
||||
let scope = getRefinedValue(queries.get("scope"));
|
||||
if (redirectUri.includes("#") && scope === "") {
|
||||
scope = getRawGetParameter("scope");
|
||||
}
|
||||
|
||||
let state = getRefinedValue(queries.get("state"));
|
||||
if (state.startsWith("/auth/oauth2/login.php?wantsurl=")) {
|
||||
// state contains URL param encoding for Moodle, URLSearchParams automatically decoded it, so here encode it again
|
||||
state = encodeURIComponent(state);
|
||||
}
|
||||
if (redirectUri.includes("#") && state === "") {
|
||||
state = getRawGetParameter("state");
|
||||
}
|
||||
|
||||
const nonce = getRefinedValue(queries.get("nonce"));
|
||||
const challengeMethod = getRefinedValue(queries.get("code_challenge_method"));
|
||||
const codeChallenge = getRefinedValue(queries.get("code_challenge"));
|
||||
|
@@ -79,3 +79,13 @@ export function getDefaultApplication(owner, name) {
|
||||
},
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function getOrganizationNames(owner) {
|
||||
return fetch(`${Setting.ServerUrl}/api/get-organization-names?owner=${owner}`, {
|
||||
method: "GET",
|
||||
credentials: "include",
|
||||
headers: {
|
||||
"Accept-Language": Setting.getAcceptLanguage(),
|
||||
},
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
81
web/src/backend/PlanBackend.js
Normal file
81
web/src/backend/PlanBackend.js
Normal file
@@ -0,0 +1,81 @@
|
||||
// Copyright 2023 The Casdoor Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import * as Setting from "../Setting";
|
||||
|
||||
export function getPlans(owner, page = "", pageSize = "", field = "", value = "", sortField = "", sortOrder = "") {
|
||||
return fetch(`${Setting.ServerUrl}/api/get-plans?owner=${owner}&p=${page}&pageSize=${pageSize}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`, {
|
||||
method: "GET",
|
||||
credentials: "include",
|
||||
headers: {
|
||||
"Accept-Language": Setting.getAcceptLanguage(),
|
||||
},
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function getPlanById(id, includeOption = false) {
|
||||
return fetch(`${Setting.ServerUrl}/api/get-plan?id=${id}&includeOption=${includeOption}`, {
|
||||
method: "GET",
|
||||
credentials: "include",
|
||||
headers: {
|
||||
"Accept-Language": Setting.getAcceptLanguage(),
|
||||
},
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function getPlan(owner, name) {
|
||||
return fetch(`${Setting.ServerUrl}/api/get-plan?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
method: "GET",
|
||||
credentials: "include",
|
||||
headers: {
|
||||
"Accept-Language": Setting.getAcceptLanguage(),
|
||||
},
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function updatePlan(owner, name, plan) {
|
||||
const newPlan = Setting.deepCopy(plan);
|
||||
return fetch(`${Setting.ServerUrl}/api/update-plan?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newPlan),
|
||||
headers: {
|
||||
"Accept-Language": Setting.getAcceptLanguage(),
|
||||
},
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function addPlan(plan) {
|
||||
const newPlan = Setting.deepCopy(plan);
|
||||
return fetch(`${Setting.ServerUrl}/api/add-plan`, {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newPlan),
|
||||
headers: {
|
||||
"Accept-Language": Setting.getAcceptLanguage(),
|
||||
},
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function deletePlan(plan) {
|
||||
const newPlan = Setting.deepCopy(plan);
|
||||
return fetch(`${Setting.ServerUrl}/api/delete-plan`, {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newPlan),
|
||||
headers: {
|
||||
"Accept-Language": Setting.getAcceptLanguage(),
|
||||
},
|
||||
}).then(res => res.json());
|
||||
}
|
71
web/src/backend/PricingBackend.js
Normal file
71
web/src/backend/PricingBackend.js
Normal file
@@ -0,0 +1,71 @@
|
||||
// Copyright 2023 The Casdoor Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import * as Setting from "../Setting";
|
||||
|
||||
export function getPricings(owner, page = "", pageSize = "", field = "", value = "", sortField = "", sortOrder = "") {
|
||||
return fetch(`${Setting.ServerUrl}/api/get-pricings?owner=${owner}&p=${page}&pageSize=${pageSize}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`, {
|
||||
method: "GET",
|
||||
credentials: "include",
|
||||
headers: {
|
||||
"Accept-Language": Setting.getAcceptLanguage(),
|
||||
},
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function getPricing(owner, name) {
|
||||
return fetch(`${Setting.ServerUrl}/api/get-pricing?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
method: "GET",
|
||||
credentials: "include",
|
||||
headers: {
|
||||
"Accept-Language": Setting.getAcceptLanguage(),
|
||||
},
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function updatePricing(owner, name, pricing) {
|
||||
const newPricing = Setting.deepCopy(pricing);
|
||||
return fetch(`${Setting.ServerUrl}/api/update-pricing?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newPricing),
|
||||
headers: {
|
||||
"Accept-Language": Setting.getAcceptLanguage(),
|
||||
},
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function addPricing(pricing) {
|
||||
const newPricing = Setting.deepCopy(pricing);
|
||||
return fetch(`${Setting.ServerUrl}/api/add-pricing`, {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newPricing),
|
||||
headers: {
|
||||
"Accept-Language": Setting.getAcceptLanguage(),
|
||||
},
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function deletePricing(pricing) {
|
||||
const newPricing = Setting.deepCopy(pricing);
|
||||
return fetch(`${Setting.ServerUrl}/api/delete-pricing`, {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newPricing),
|
||||
headers: {
|
||||
"Accept-Language": Setting.getAcceptLanguage(),
|
||||
},
|
||||
}).then(res => res.json());
|
||||
}
|
71
web/src/backend/SubscriptionBackend.js
Normal file
71
web/src/backend/SubscriptionBackend.js
Normal file
@@ -0,0 +1,71 @@
|
||||
// Copyright 2023 The Casdoor Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import * as Setting from "../Setting";
|
||||
|
||||
export function getSubscriptions(owner, page = "", pageSize = "", field = "", value = "", sortField = "", sortOrder = "") {
|
||||
return fetch(`${Setting.ServerUrl}/api/get-subscriptions?owner=${owner}&p=${page}&pageSize=${pageSize}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`, {
|
||||
method: "GET",
|
||||
credentials: "include",
|
||||
headers: {
|
||||
"Accept-Language": Setting.getAcceptLanguage(),
|
||||
},
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function getSubscription(owner, name) {
|
||||
return fetch(`${Setting.ServerUrl}/api/get-subscription?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
method: "GET",
|
||||
credentials: "include",
|
||||
headers: {
|
||||
"Accept-Language": Setting.getAcceptLanguage(),
|
||||
},
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function updateSubscription(owner, name, subscription) {
|
||||
const newSubscription = Setting.deepCopy(subscription);
|
||||
return fetch(`${Setting.ServerUrl}/api/update-subscription?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newSubscription),
|
||||
headers: {
|
||||
"Accept-Language": Setting.getAcceptLanguage(),
|
||||
},
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function addSubscription(subscription) {
|
||||
const newSubscription = Setting.deepCopy(subscription);
|
||||
return fetch(`${Setting.ServerUrl}/api/add-subscription`, {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newSubscription),
|
||||
headers: {
|
||||
"Accept-Language": Setting.getAcceptLanguage(),
|
||||
},
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function deleteSubscription(subscription) {
|
||||
const newSubscription = Setting.deepCopy(subscription);
|
||||
return fetch(`${Setting.ServerUrl}/api/delete-subscription`, {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newSubscription),
|
||||
headers: {
|
||||
"Accept-Language": Setting.getAcceptLanguage(),
|
||||
},
|
||||
}).then(res => res.json());
|
||||
}
|
@@ -17,10 +17,17 @@ import * as Setting from "../../Setting";
|
||||
import React from "react";
|
||||
|
||||
export const CountryCodeSelect = (props) => {
|
||||
const {onChange, style, disabled, value} = props;
|
||||
const {onChange, style, disabled} = props;
|
||||
const countryCodes = props.countryCodes ?? [];
|
||||
const [value, setValue] = React.useState("");
|
||||
|
||||
React.useEffect(() => {
|
||||
const initValue = countryCodes.length > 0 ? countryCodes[0] : "";
|
||||
handleOnChange(initValue);
|
||||
}, []);
|
||||
|
||||
const handleOnChange = (value) => {
|
||||
setValue(value);
|
||||
onChange?.(value);
|
||||
};
|
||||
|
||||
|
63
web/src/common/select/OrganizationSelect.js
Normal file
63
web/src/common/select/OrganizationSelect.js
Normal file
@@ -0,0 +1,63 @@
|
||||
// Copyright 2023 The Casdoor Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import React from "react";
|
||||
import {Select} from "antd";
|
||||
import i18next from "i18next";
|
||||
import * as OrganizationBackend from "../../backend/OrganizationBackend";
|
||||
import * as Setting from "../../Setting";
|
||||
|
||||
function OrganizationSelect(props) {
|
||||
const {onChange} = props;
|
||||
const [organizations, setOrganizations] = React.useState([]);
|
||||
const [value, setValue] = React.useState("");
|
||||
|
||||
React.useEffect(() => {
|
||||
if (props.organizations === undefined) {
|
||||
getOrganizations();
|
||||
}
|
||||
const initValue = organizations.length > 0 ? organizations[0] : "";
|
||||
handleOnChange(initValue);
|
||||
}, []);
|
||||
|
||||
const getOrganizations = () => {
|
||||
OrganizationBackend.getOrganizationNames("admin")
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
setOrganizations(res.data);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const handleOnChange = (value) => {
|
||||
setValue(value);
|
||||
onChange?.(value);
|
||||
};
|
||||
|
||||
return (
|
||||
<Select
|
||||
options={organizations.map((organization) => Setting.getOption(organization.name, organization.name))}
|
||||
virtual={false}
|
||||
showSearch
|
||||
placeholder={i18next.t("login:Please select an organization")}
|
||||
value={value}
|
||||
onChange={handleOnChange}
|
||||
filterOption={(input, option) => (option?.text ?? "").toLowerCase().includes(input.toLowerCase())}
|
||||
{...props}
|
||||
>
|
||||
</Select>
|
||||
);
|
||||
}
|
||||
|
||||
export default OrganizationSelect;
|
@@ -56,14 +56,16 @@
|
||||
"Grant types": "Grant-Typen",
|
||||
"Grant types - Tooltip": "Wählen Sie aus, welche Grant-Typen im OAuth-Protokoll zulässig sind",
|
||||
"Incremental": "Incremental",
|
||||
"Input": "Input",
|
||||
"Left": "Links",
|
||||
"Logged in successfully": "Erfolgreich eingeloggt",
|
||||
"Logged out successfully": "Erfolgreich ausgeloggt",
|
||||
"New Application": "Neue Anwendung",
|
||||
"No verification": "No verification",
|
||||
"None": "kein(e)",
|
||||
"Normal": "Normal",
|
||||
"Only signup": "Only signup",
|
||||
"Org choice mode": "Org choice mode",
|
||||
"Org choice mode - Tooltip": "Org choice mode - Tooltip",
|
||||
"Please input your application!": "Bitte geben Sie Ihre Anwendung ein!",
|
||||
"Please input your organization!": "Bitte geben Sie Ihre Organisation ein!",
|
||||
"Please select a HTML file": "Bitte wählen Sie eine HTML-Datei aus",
|
||||
@@ -82,6 +84,7 @@
|
||||
"SAML metadata - Tooltip": "Die Metadaten des SAML-Protokolls",
|
||||
"SAML metadata URL copied to clipboard successfully": "SAML-Metadaten URL erfolgreich in die Zwischenablage kopiert",
|
||||
"SAML reply URL": "SAML Reply-URL",
|
||||
"Select": "Select",
|
||||
"Side panel HTML": "Sidepanel-HTML",
|
||||
"Side panel HTML - Edit": "Sidepanel HTML - Bearbeiten",
|
||||
"Side panel HTML - Tooltip": "Passen Sie den HTML-Code für das Sidepanel der Login-Seite an",
|
||||
@@ -167,8 +170,13 @@
|
||||
"Affiliation URL": "Affiliation-URL",
|
||||
"Affiliation URL - Tooltip": "Die Homepage-URL für die Zugehörigkeit",
|
||||
"Application": "Applikation",
|
||||
"Application - Tooltip": "Application - Tooltip",
|
||||
"Applications": "Anwendungen",
|
||||
"Applications that require authentication": "Anwendungen, die eine Authentifizierung erfordern",
|
||||
"Approve time": "Approve time",
|
||||
"Approve time - Tooltip": "Approve time - Tooltip",
|
||||
"Approver": "Approver",
|
||||
"Approver - Tooltip": "Approver - Tooltip",
|
||||
"Avatar": "Avatar",
|
||||
"Avatar - Tooltip": "Öffentliches Avatarbild für den Benutzer",
|
||||
"Back": "Back",
|
||||
@@ -182,6 +190,7 @@
|
||||
"Click to Upload": "Klicken Sie zum Hochladen",
|
||||
"Client IP": "Client-IP",
|
||||
"Close": "Schließen",
|
||||
"Confirm": "Confirm",
|
||||
"Created time": "Erstellte Zeit",
|
||||
"Default application": "Standard Anwendung",
|
||||
"Default application - Tooltip": "Standard-Anwendung für Benutzer, die direkt von der Organisationsseite registriert wurden",
|
||||
@@ -226,6 +235,8 @@
|
||||
"Last name": "Nachname",
|
||||
"Logo": "Logo",
|
||||
"Logo - Tooltip": "Symbole, die die Anwendung der Außenwelt präsentiert",
|
||||
"MFA items": "MFA items",
|
||||
"MFA items - Tooltip": "MFA items - Tooltip",
|
||||
"Master password": "Hauptpasswort",
|
||||
"Master password - Tooltip": "Kann zum Einloggen aller Benutzer unter dieser Organisation verwendet werden, was es Administratoren bequem macht, sich als dieser Benutzer einzuloggen, um technische Probleme zu lösen",
|
||||
"Menu": "Menü",
|
||||
@@ -236,6 +247,7 @@
|
||||
"Models": "Modelle",
|
||||
"Name": "Name",
|
||||
"Name - Tooltip": "Eindeutige, auf Strings basierende ID",
|
||||
"None": "None",
|
||||
"OAuth providers": "OAuth-Provider",
|
||||
"OK": "OK",
|
||||
"Organization": "Organisation",
|
||||
@@ -253,8 +265,10 @@
|
||||
"Phone": "Telefon",
|
||||
"Phone - Tooltip": "Telefonnummer",
|
||||
"Phone or email": "Phone or email",
|
||||
"Plans": "Pläne",
|
||||
"Preview": "Vorschau",
|
||||
"Preview - Tooltip": "Vorschau der konfigurierten Effekte",
|
||||
"Pricings": "Preise",
|
||||
"Products": "Produkte",
|
||||
"Provider": "Provider",
|
||||
"Provider - Tooltip": "Zahlungsprovider, die konfiguriert werden müssen, inkl. PayPal, Alipay, WeChat Pay usw.",
|
||||
@@ -281,6 +295,9 @@
|
||||
"Sorry, you do not have permission to access this page or logged in status invalid.": "Es tut uns leid, aber Sie haben keine Berechtigung, auf diese Seite zuzugreifen, oder Sie sind nicht angemeldet.",
|
||||
"State": "Bundesland / Staat",
|
||||
"State - Tooltip": "Bundesland",
|
||||
"Submitter": "Submitter",
|
||||
"Submitter - Tooltip": "Submitter - Tooltip",
|
||||
"Subscriptions": "Abonnements",
|
||||
"Successfully added": "Erfolgreich hinzugefügt",
|
||||
"Successfully deleted": "Erfolgreich gelöscht",
|
||||
"Successfully saved": "Erfolgreich gespeichert",
|
||||
@@ -351,8 +368,12 @@
|
||||
"Or sign in with another account": "Oder mit einem anderen Konto anmelden",
|
||||
"Please input your Email or Phone!": "Bitte geben Sie Ihre E-Mail oder Telefonnummer ein!",
|
||||
"Please input your code!": "Bitte geben Sie Ihren Code ein!",
|
||||
"Please input your organization name!": "Please input your organization name!",
|
||||
"Please input your password!": "Bitte geben Sie Ihr Passwort ein!",
|
||||
"Please input your password, at least 6 characters!": "Bitte geben Sie Ihr Passwort ein, es muss mindestens 6 Zeichen lang sein!",
|
||||
"Please select an organization": "Please select an organization",
|
||||
"Please select an organization to sign in": "Please select an organization to sign in",
|
||||
"Please type an organization to sign in": "Please type an organization to sign in",
|
||||
"Redirecting, please wait.": "Umleitung, bitte warten.",
|
||||
"Sign In": "Anmelden",
|
||||
"Sign in with WebAuthn": "Melden Sie sich mit WebAuthn an",
|
||||
@@ -423,6 +444,8 @@
|
||||
"Is profile public - Tooltip": "Nach der Schließung können nur globale Administratoren oder Benutzer in der gleichen Organisation auf die Profilseite des Benutzers zugreifen",
|
||||
"Modify rule": "Regel ändern",
|
||||
"New Organization": "Neue Organisation",
|
||||
"Optional": "Optional",
|
||||
"Required": "Required",
|
||||
"Soft deletion": "Softe Löschung",
|
||||
"Soft deletion - Tooltip": "Wenn aktiviert, werden gelöschte Benutzer nicht vollständig aus der Datenbank entfernt. Stattdessen werden sie als gelöscht markiert",
|
||||
"Tags": "Tags",
|
||||
@@ -503,6 +526,34 @@
|
||||
"TreeNode": "TreeNode",
|
||||
"Write": "Schreib"
|
||||
},
|
||||
"plan": {
|
||||
"Edit Plan": "Edit Plan",
|
||||
"New Plan": "New Plan",
|
||||
"PerMonth": "pro Monat",
|
||||
"Price per month": "Price per month",
|
||||
"Price per year": "Price per year",
|
||||
"PricePerMonth": "Preis pro Monat",
|
||||
"PricePerMonth - Tooltip": "PricePerMonth - Tooltip",
|
||||
"PricePerYear": "Preis pro Jahr",
|
||||
"PricePerYear - Tooltip": "PricePerYear - Tooltip",
|
||||
"Sub role": "Sub role",
|
||||
"Sub roles - Tooltip": "Rolle im aktuellen Plan enthalten"
|
||||
},
|
||||
"pricing": {
|
||||
"Copy pricing page URL": "Preisseite URL kopieren",
|
||||
"Edit Pricing": "Edit Pricing",
|
||||
"Free": "Kostenlos",
|
||||
"Getting started": "Loslegen",
|
||||
"Has trial": "Testphase verfügbar",
|
||||
"Has trial - Tooltip": "Verfügbarkeit der Testphase nach Auswahl eines Plans",
|
||||
"New Pricing": "New Pricing",
|
||||
"Sub plans": "Zusatzpläne",
|
||||
"Sub plans - Tooltip": "Sub plans - Tooltip",
|
||||
"Trial duration": "Testphase Dauer",
|
||||
"Trial duration - Tooltip": "Dauer der Testphase",
|
||||
"days trial available!": "Tage Testphase verfügbar!",
|
||||
"pricing page URL copied to clipboard successfully, please paste it into the incognito window or another browser": "Preisseite URL erfolgreich in die Zwischenablage kopiert. Bitte fügen Sie sie in ein Inkognito-Fenster oder einen anderen Browser ein."
|
||||
},
|
||||
"product": {
|
||||
"Alipay": "Alipay",
|
||||
"Buy": "Kaufen",
|
||||
@@ -720,6 +771,24 @@
|
||||
"Your confirmed password is inconsistent with the password!": "Dein bestätigtes Passwort stimmt nicht mit dem Passwort überein!",
|
||||
"sign in now": "Jetzt anmelden"
|
||||
},
|
||||
"subscription": {
|
||||
"Approved": "Approved",
|
||||
"Duration": "Laufzeit",
|
||||
"Duration - Tooltip": "Laufzeit des Abonnements",
|
||||
"Edit Subscription": "Edit Subscription",
|
||||
"End Date": "Enddatum",
|
||||
"End Date - Tooltip": "Enddatum",
|
||||
"New Subscription": "New Subscription",
|
||||
"Pending": "Pending",
|
||||
"Start Date": "Startdatum",
|
||||
"Start Date - Tooltip": "Startdatum",
|
||||
"Sub plan": "Abonnementplan",
|
||||
"Sub plan - Tooltip": "Abonnementplan",
|
||||
"Sub plane": "Sub plane",
|
||||
"Sub user": "Sub user",
|
||||
"Sub users": "Abonnenten",
|
||||
"Sub users - Tooltip": "Abonnenten"
|
||||
},
|
||||
"syncer": {
|
||||
"Affiliation table": "Zuordnungstabelle",
|
||||
"Affiliation table - Tooltip": "Datenbanktabellenname der Arbeitseinheit",
|
||||
|
@@ -56,14 +56,16 @@
|
||||
"Grant types": "Grant types",
|
||||
"Grant types - Tooltip": "Select which grant types are allowed in the OAuth protocol",
|
||||
"Incremental": "Incremental",
|
||||
"Input": "Input",
|
||||
"Left": "Left",
|
||||
"Logged in successfully": "Logged in successfully",
|
||||
"Logged out successfully": "Logged out successfully",
|
||||
"New Application": "New Application",
|
||||
"No verification": "No verification",
|
||||
"None": "None",
|
||||
"Normal": "Normal",
|
||||
"Only signup": "Only signup",
|
||||
"Org choice mode": "Org choice mode",
|
||||
"Org choice mode - Tooltip": "Org choice mode - Tooltip",
|
||||
"Please input your application!": "Please input your application!",
|
||||
"Please input your organization!": "Please input your organization!",
|
||||
"Please select a HTML file": "Please select a HTML file",
|
||||
@@ -82,6 +84,7 @@
|
||||
"SAML metadata - Tooltip": "The metadata of SAML protocol",
|
||||
"SAML metadata URL copied to clipboard successfully": "SAML metadata URL copied to clipboard successfully",
|
||||
"SAML reply URL": "SAML reply URL",
|
||||
"Select": "Select",
|
||||
"Side panel HTML": "Side panel HTML",
|
||||
"Side panel HTML - Edit": "Side panel HTML - Edit",
|
||||
"Side panel HTML - Tooltip": "Customize the HTML code for the side panel of the login page",
|
||||
@@ -167,8 +170,13 @@
|
||||
"Affiliation URL": "Affiliation URL",
|
||||
"Affiliation URL - Tooltip": "The homepage URL for the affiliation",
|
||||
"Application": "Application",
|
||||
"Application - Tooltip": "Application - Tooltip",
|
||||
"Applications": "Applications",
|
||||
"Applications that require authentication": "Applications that require authentication",
|
||||
"Approve time": "Approve time",
|
||||
"Approve time - Tooltip": "Approve time - Tooltip",
|
||||
"Approver": "Approver",
|
||||
"Approver - Tooltip": "Approver - Tooltip",
|
||||
"Avatar": "Avatar",
|
||||
"Avatar - Tooltip": "Public avatar image for the user",
|
||||
"Back": "Back",
|
||||
@@ -182,6 +190,7 @@
|
||||
"Click to Upload": "Click to Upload",
|
||||
"Client IP": "Client IP",
|
||||
"Close": "Close",
|
||||
"Confirm": "Confirm",
|
||||
"Created time": "Created time",
|
||||
"Default application": "Default application",
|
||||
"Default application - Tooltip": "Default application for users registered directly from the organization page",
|
||||
@@ -226,6 +235,8 @@
|
||||
"Last name": "Last name",
|
||||
"Logo": "Logo",
|
||||
"Logo - Tooltip": "Icons that the application presents to the outside world",
|
||||
"MFA items": "MFA items",
|
||||
"MFA items - Tooltip": "MFA items - Tooltip",
|
||||
"Master password": "Master password",
|
||||
"Master password - Tooltip": "Can be used to log in to all users under this organization, making it convenient for administrators to log in as this user to solve technical issues",
|
||||
"Menu": "Menu",
|
||||
@@ -236,6 +247,7 @@
|
||||
"Models": "Models",
|
||||
"Name": "Name",
|
||||
"Name - Tooltip": "Unique, string-based ID",
|
||||
"None": "None",
|
||||
"OAuth providers": "OAuth providers",
|
||||
"OK": "OK",
|
||||
"Organization": "Organization",
|
||||
@@ -253,8 +265,10 @@
|
||||
"Phone": "Phone",
|
||||
"Phone - Tooltip": "Phone number",
|
||||
"Phone or email": "Phone or email",
|
||||
"Plans": "Plans",
|
||||
"Preview": "Preview",
|
||||
"Preview - Tooltip": "Preview the configured effects",
|
||||
"Pricings": "Pricings",
|
||||
"Products": "Products",
|
||||
"Provider": "Provider",
|
||||
"Provider - Tooltip": "Payment providers to be configured, including PayPal, Alipay, WeChat Pay, etc.",
|
||||
@@ -281,6 +295,9 @@
|
||||
"Sorry, you do not have permission to access this page or logged in status invalid.": "Sorry, you do not have permission to access this page or logged in status invalid.",
|
||||
"State": "State",
|
||||
"State - Tooltip": "State",
|
||||
"Submitter": "Submitter",
|
||||
"Submitter - Tooltip": "Submitter - Tooltip",
|
||||
"Subscriptions": "Subscriptions",
|
||||
"Successfully added": "Successfully added",
|
||||
"Successfully deleted": "Successfully deleted",
|
||||
"Successfully saved": "Successfully saved",
|
||||
@@ -351,8 +368,12 @@
|
||||
"Or sign in with another account": "Or sign in with another account",
|
||||
"Please input your Email or Phone!": "Please input your Email or Phone!",
|
||||
"Please input your code!": "Please input your code!",
|
||||
"Please input your organization name!": "Please input your organization name!",
|
||||
"Please input your password!": "Please input your password!",
|
||||
"Please input your password, at least 6 characters!": "Please input your password, at least 6 characters!",
|
||||
"Please select an organization": "Please select an organization",
|
||||
"Please select an organization to sign in": "Please select an organization to sign in",
|
||||
"Please type an organization to sign in": "Please type an organization to sign in",
|
||||
"Redirecting, please wait.": "Redirecting, please wait.",
|
||||
"Sign In": "Sign In",
|
||||
"Sign in with WebAuthn": "Sign in with WebAuthn",
|
||||
@@ -423,6 +444,8 @@
|
||||
"Is profile public - Tooltip": "After being closed, only global administrators or users in the same organization can access the user's profile page",
|
||||
"Modify rule": "Modify rule",
|
||||
"New Organization": "New Organization",
|
||||
"Optional": "Optional",
|
||||
"Required": "Required",
|
||||
"Soft deletion": "Soft deletion",
|
||||
"Soft deletion - Tooltip": "When enabled, deleting users will not completely remove them from the database. Instead, they will be marked as deleted",
|
||||
"Tags": "Tags",
|
||||
@@ -503,6 +526,34 @@
|
||||
"TreeNode": "TreeNode",
|
||||
"Write": "Write"
|
||||
},
|
||||
"plan": {
|
||||
"Edit Plan": "Edit Plan",
|
||||
"New Plan": "New Plan",
|
||||
"PerMonth": "per month",
|
||||
"Price per month": "Price per month",
|
||||
"Price per year": "Price per year",
|
||||
"PricePerMonth": "Price per month",
|
||||
"PricePerMonth - Tooltip": "PricePerMonth - Tooltip",
|
||||
"PricePerYear": "Price per year",
|
||||
"PricePerYear - Tooltip": "PricePerYear - Tooltip",
|
||||
"Sub role": "Sub role",
|
||||
"Sub roles - Tooltip": "Role included in the current plane"
|
||||
},
|
||||
"pricing": {
|
||||
"Copy pricing page URL": "Copy pricing page URL",
|
||||
"Edit Pricing": "Edit Pricing",
|
||||
"Free": "Free",
|
||||
"Getting started": "Getting started",
|
||||
"Has trial": "Has trial",
|
||||
"Has trial - Tooltip": "Availability of the trial period after choosing a plan",
|
||||
"New Pricing": "New Pricing",
|
||||
"Sub plans": "Sub plans",
|
||||
"Sub plans - Tooltip": "Sub plans - Tooltip",
|
||||
"Trial duration": "Trial duration",
|
||||
"Trial duration - Tooltip": "Trial duration period",
|
||||
"days trial available!": "days trial available!",
|
||||
"pricing page URL copied to clipboard successfully, please paste it into the incognito window or another browser": "pricing page URL copied to clipboard successfully, please paste it into the incognito window or another browser"
|
||||
},
|
||||
"product": {
|
||||
"Alipay": "Alipay",
|
||||
"Buy": "Buy",
|
||||
@@ -720,6 +771,24 @@
|
||||
"Your confirmed password is inconsistent with the password!": "Your confirmed password is inconsistent with the password!",
|
||||
"sign in now": "sign in now"
|
||||
},
|
||||
"subscription": {
|
||||
"Approved": "Approved",
|
||||
"Duration": "Duration",
|
||||
"Duration - Tooltip": "Subscription duration",
|
||||
"Edit Subscription": "Edit Subscription",
|
||||
"End Date": "End Date",
|
||||
"End Date - Tooltip": "End Date",
|
||||
"New Subscription": "New Subscription",
|
||||
"Pending": "Pending",
|
||||
"Start Date": "Start Date",
|
||||
"Start Date - Tooltip": "Start Date",
|
||||
"Sub plan": "Sub plan",
|
||||
"Sub plan - Tooltip": "Sub plan",
|
||||
"Sub plane": "Sub plane",
|
||||
"Sub user": "Sub user",
|
||||
"Sub users": "Sub users",
|
||||
"Sub users - Tooltip": "Sub users"
|
||||
},
|
||||
"syncer": {
|
||||
"Affiliation table": "Affiliation table",
|
||||
"Affiliation table - Tooltip": "Database table name of the work unit",
|
||||
|
@@ -56,14 +56,16 @@
|
||||
"Grant types": "Tipos de subvenciones",
|
||||
"Grant types - Tooltip": "Selecciona cuáles tipos de subvenciones están permitidas en el protocolo OAuth",
|
||||
"Incremental": "Incremental",
|
||||
"Input": "Input",
|
||||
"Left": "Izquierda",
|
||||
"Logged in successfully": "Acceso satisfactorio",
|
||||
"Logged out successfully": "Cerró sesión exitosamente",
|
||||
"New Application": "Nueva aplicación",
|
||||
"No verification": "No verification",
|
||||
"None": "Ninguno",
|
||||
"Normal": "Normal",
|
||||
"Only signup": "Only signup",
|
||||
"Org choice mode": "Org choice mode",
|
||||
"Org choice mode - Tooltip": "Org choice mode - Tooltip",
|
||||
"Please input your application!": "¡Por favor, ingrese su solicitud!",
|
||||
"Please input your organization!": "¡Por favor, ingrese su organización!",
|
||||
"Please select a HTML file": "Por favor, seleccione un archivo HTML",
|
||||
@@ -82,6 +84,7 @@
|
||||
"SAML metadata - Tooltip": "Los metadatos del protocolo SAML",
|
||||
"SAML metadata URL copied to clipboard successfully": "La URL de metadatos de SAML se ha copiado correctamente en el portapapeles",
|
||||
"SAML reply URL": "URL de respuesta SAML",
|
||||
"Select": "Select",
|
||||
"Side panel HTML": "Panel lateral HTML",
|
||||
"Side panel HTML - Edit": "Panel lateral HTML - Editar",
|
||||
"Side panel HTML - Tooltip": "Personaliza el código HTML del panel lateral de la página de inicio de sesión",
|
||||
@@ -167,8 +170,13 @@
|
||||
"Affiliation URL": "URL de afiliación",
|
||||
"Affiliation URL - Tooltip": "La URL de la página de inicio para la afiliación",
|
||||
"Application": "Aplicación",
|
||||
"Application - Tooltip": "Application - Tooltip",
|
||||
"Applications": "Aplicaciones",
|
||||
"Applications that require authentication": "Aplicaciones que requieren autenticación",
|
||||
"Approve time": "Approve time",
|
||||
"Approve time - Tooltip": "Approve time - Tooltip",
|
||||
"Approver": "Approver",
|
||||
"Approver - Tooltip": "Approver - Tooltip",
|
||||
"Avatar": "Avatar",
|
||||
"Avatar - Tooltip": "Imagen de avatar pública para el usuario",
|
||||
"Back": "Back",
|
||||
@@ -182,6 +190,7 @@
|
||||
"Click to Upload": "Haz clic para cargar",
|
||||
"Client IP": "Dirección IP del cliente",
|
||||
"Close": "Cerca",
|
||||
"Confirm": "Confirm",
|
||||
"Created time": "Tiempo creado",
|
||||
"Default application": "Aplicación predeterminada",
|
||||
"Default application - Tooltip": "Aplicación predeterminada para usuarios registrados directamente desde la página de la organización",
|
||||
@@ -226,6 +235,8 @@
|
||||
"Last name": "Apellido",
|
||||
"Logo": "Logotipo",
|
||||
"Logo - Tooltip": "Iconos que la aplicación presenta al mundo exterior",
|
||||
"MFA items": "MFA items",
|
||||
"MFA items - Tooltip": "MFA items - Tooltip",
|
||||
"Master password": "Contraseña maestra",
|
||||
"Master password - Tooltip": "Se puede usar para iniciar sesión en todos los usuarios de esta organización, lo que hace conveniente que los administradores inicien sesión como este usuario para resolver problemas técnicos",
|
||||
"Menu": "Menú",
|
||||
@@ -236,6 +247,7 @@
|
||||
"Models": "Modelos",
|
||||
"Name": "Nombre",
|
||||
"Name - Tooltip": "ID único basado en cadenas",
|
||||
"None": "None",
|
||||
"OAuth providers": "Proveedores de OAuth",
|
||||
"OK": "Vale",
|
||||
"Organization": "Organización",
|
||||
@@ -253,8 +265,10 @@
|
||||
"Phone": "Teléfono",
|
||||
"Phone - Tooltip": "Número de teléfono",
|
||||
"Phone or email": "Phone or email",
|
||||
"Plans": "Planes",
|
||||
"Preview": "Avance",
|
||||
"Preview - Tooltip": "Vista previa de los efectos configurados",
|
||||
"Pricings": "Precios",
|
||||
"Products": "Productos",
|
||||
"Provider": "Proveedor",
|
||||
"Provider - Tooltip": "Proveedores de pago a configurar, incluyendo PayPal, Alipay, WeChat Pay, etc.",
|
||||
@@ -281,6 +295,9 @@
|
||||
"Sorry, you do not have permission to access this page or logged in status invalid.": "Lo siento, no tiene permiso para acceder a esta página o su estado de inicio de sesión es inválido.",
|
||||
"State": "Estado",
|
||||
"State - Tooltip": "Estado",
|
||||
"Submitter": "Submitter",
|
||||
"Submitter - Tooltip": "Submitter - Tooltip",
|
||||
"Subscriptions": "Suscripciones",
|
||||
"Successfully added": "Éxito al agregar",
|
||||
"Successfully deleted": "Éxito en la eliminación",
|
||||
"Successfully saved": "Guardado exitosamente",
|
||||
@@ -351,8 +368,12 @@
|
||||
"Or sign in with another account": "O inicia sesión con otra cuenta",
|
||||
"Please input your Email or Phone!": "¡Por favor introduzca su correo electrónico o teléfono!",
|
||||
"Please input your code!": "¡Por favor ingrese su código!",
|
||||
"Please input your organization name!": "Please input your organization name!",
|
||||
"Please input your password!": "¡Ingrese su contraseña, por favor!",
|
||||
"Please input your password, at least 6 characters!": "Por favor ingrese su contraseña, ¡de al menos 6 caracteres!",
|
||||
"Please select an organization": "Please select an organization",
|
||||
"Please select an organization to sign in": "Please select an organization to sign in",
|
||||
"Please type an organization to sign in": "Please type an organization to sign in",
|
||||
"Redirecting, please wait.": "Redirigiendo, por favor espera.",
|
||||
"Sign In": "Iniciar sesión",
|
||||
"Sign in with WebAuthn": "Iniciar sesión con WebAuthn",
|
||||
@@ -423,6 +444,8 @@
|
||||
"Is profile public - Tooltip": "Después de estar cerrado, solo los administradores globales o usuarios de la misma organización pueden acceder a la página de perfil del usuario",
|
||||
"Modify rule": "Modificar regla",
|
||||
"New Organization": "Nueva organización",
|
||||
"Optional": "Optional",
|
||||
"Required": "Required",
|
||||
"Soft deletion": "Eliminación suave",
|
||||
"Soft deletion - Tooltip": "Cuando se habilita, la eliminación de usuarios no los eliminará por completo de la base de datos. En su lugar, se marcarán como eliminados",
|
||||
"Tags": "Etiquetas",
|
||||
@@ -503,6 +526,34 @@
|
||||
"TreeNode": "Nodo del árbol",
|
||||
"Write": "Escribir"
|
||||
},
|
||||
"plan": {
|
||||
"Edit Plan": "Edit Plan",
|
||||
"New Plan": "New Plan",
|
||||
"PerMonth": "por mes",
|
||||
"Price per month": "Price per month",
|
||||
"Price per year": "Price per year",
|
||||
"PricePerMonth": "Precio por mes",
|
||||
"PricePerMonth - Tooltip": "PricePerMonth - Tooltip",
|
||||
"PricePerYear": "Precio por año",
|
||||
"PricePerYear - Tooltip": "PricePerYear - Tooltip",
|
||||
"Sub role": "Sub role",
|
||||
"Sub roles - Tooltip": "Rol incluido en el plan actual"
|
||||
},
|
||||
"pricing": {
|
||||
"Copy pricing page URL": "Copiar URL de la página de precios",
|
||||
"Edit Pricing": "Edit Pricing",
|
||||
"Free": "Gratis",
|
||||
"Getting started": "Empezar",
|
||||
"Has trial": "Tiene período de prueba",
|
||||
"Has trial - Tooltip": "Disponibilidad del período de prueba después de elegir un plan",
|
||||
"New Pricing": "New Pricing",
|
||||
"Sub plans": "Planes adicionales",
|
||||
"Sub plans - Tooltip": "Sub plans - Tooltip",
|
||||
"Trial duration": "Duración del período de prueba",
|
||||
"Trial duration - Tooltip": "Duración del período de prueba",
|
||||
"days trial available!": "días de prueba disponibles",
|
||||
"pricing page URL copied to clipboard successfully, please paste it into the incognito window or another browser": "URL de la página de precios copiada correctamente al portapapeles, péguela en una ventana de incógnito u otro navegador"
|
||||
},
|
||||
"product": {
|
||||
"Alipay": "Alipay",
|
||||
"Buy": "Comprar",
|
||||
@@ -720,6 +771,24 @@
|
||||
"Your confirmed password is inconsistent with the password!": "¡Su contraseña confirmada no es coherente con la contraseña!",
|
||||
"sign in now": "Inicie sesión ahora"
|
||||
},
|
||||
"subscription": {
|
||||
"Approved": "Approved",
|
||||
"Duration": "Duración",
|
||||
"Duration - Tooltip": "Duración de la suscripción",
|
||||
"Edit Subscription": "Edit Subscription",
|
||||
"End Date": "Fecha de finalización",
|
||||
"End Date - Tooltip": "Fecha de finalización",
|
||||
"New Subscription": "New Subscription",
|
||||
"Pending": "Pending",
|
||||
"Start Date": "Fecha de inicio",
|
||||
"Start Date - Tooltip": "Fecha de inicio",
|
||||
"Sub plan": "Plan de suscripción",
|
||||
"Sub plan - Tooltip": "Plan de suscripción",
|
||||
"Sub plane": "Sub plane",
|
||||
"Sub user": "Sub user",
|
||||
"Sub users": "Usuarios de la suscripción",
|
||||
"Sub users - Tooltip": "Usuarios de la suscripción"
|
||||
},
|
||||
"syncer": {
|
||||
"Affiliation table": "Tabla de afiliación",
|
||||
"Affiliation table - Tooltip": "Nombre de la tabla de base de datos de la unidad de trabajo",
|
||||
|
@@ -56,14 +56,16 @@
|
||||
"Grant types": "Types de subventions",
|
||||
"Grant types - Tooltip": "Sélectionnez les types d'autorisations autorisés dans le protocole OAuth",
|
||||
"Incremental": "Incremental",
|
||||
"Input": "Input",
|
||||
"Left": "gauche",
|
||||
"Logged in successfully": "Connecté avec succès",
|
||||
"Logged out successfully": "Déconnecté avec succès",
|
||||
"New Application": "Nouvelle application",
|
||||
"No verification": "No verification",
|
||||
"None": "Aucun",
|
||||
"Normal": "Normal",
|
||||
"Only signup": "Only signup",
|
||||
"Org choice mode": "Org choice mode",
|
||||
"Org choice mode - Tooltip": "Org choice mode - Tooltip",
|
||||
"Please input your application!": "Veuillez saisir votre demande d'application !",
|
||||
"Please input your organization!": "S'il vous plaît saisir votre organisation !",
|
||||
"Please select a HTML file": "S'il vous plaît sélectionnez un fichier HTML",
|
||||
@@ -82,6 +84,7 @@
|
||||
"SAML metadata - Tooltip": "Les métadonnées du protocole SAML",
|
||||
"SAML metadata URL copied to clipboard successfully": "URL des métadonnées SAML copiée dans le presse-papiers avec succès",
|
||||
"SAML reply URL": "URL de réponse SAML",
|
||||
"Select": "Select",
|
||||
"Side panel HTML": "Panneau latéral HTML",
|
||||
"Side panel HTML - Edit": "Panneau latéral HTML - Modifier",
|
||||
"Side panel HTML - Tooltip": "Personnalisez le code HTML du panneau latéral de la page de connexion",
|
||||
@@ -167,8 +170,13 @@
|
||||
"Affiliation URL": "URL d'affiliation",
|
||||
"Affiliation URL - Tooltip": "La URL de la page d'accueil pour l'affiliation",
|
||||
"Application": "Application",
|
||||
"Application - Tooltip": "Application - Tooltip",
|
||||
"Applications": "Applications",
|
||||
"Applications that require authentication": "Applications qui nécessitent une authentification",
|
||||
"Approve time": "Approve time",
|
||||
"Approve time - Tooltip": "Approve time - Tooltip",
|
||||
"Approver": "Approver",
|
||||
"Approver - Tooltip": "Approver - Tooltip",
|
||||
"Avatar": "Avatar",
|
||||
"Avatar - Tooltip": "Image d'avatar public pour l'utilisateur",
|
||||
"Back": "Back",
|
||||
@@ -182,6 +190,7 @@
|
||||
"Click to Upload": "Cliquez pour télécharger",
|
||||
"Client IP": "Adresse IP du client",
|
||||
"Close": "Fermer",
|
||||
"Confirm": "Confirm",
|
||||
"Created time": "Temps créé",
|
||||
"Default application": "Application par défaut",
|
||||
"Default application - Tooltip": "Application par défaut pour les utilisateurs enregistrés directement depuis la page de l'organisation",
|
||||
@@ -226,6 +235,8 @@
|
||||
"Last name": "Nom de famille",
|
||||
"Logo": "Logo",
|
||||
"Logo - Tooltip": "Icônes que l'application présente au monde extérieur",
|
||||
"MFA items": "MFA items",
|
||||
"MFA items - Tooltip": "MFA items - Tooltip",
|
||||
"Master password": "Mot de passe principal",
|
||||
"Master password - Tooltip": "Peut être utilisé pour se connecter à tous les utilisateurs sous cette organisation, ce qui facilite la connexion des administrateurs en tant que cet utilisateur pour résoudre les problèmes techniques",
|
||||
"Menu": "Menu",
|
||||
@@ -236,6 +247,7 @@
|
||||
"Models": "Modèles",
|
||||
"Name": "Nom",
|
||||
"Name - Tooltip": "Identifiant unique à base de chaîne",
|
||||
"None": "None",
|
||||
"OAuth providers": "Fournisseurs OAuth",
|
||||
"OK": "D'accord",
|
||||
"Organization": "Organisation",
|
||||
@@ -253,8 +265,10 @@
|
||||
"Phone": "Téléphone",
|
||||
"Phone - Tooltip": "Numéro de téléphone",
|
||||
"Phone or email": "Phone or email",
|
||||
"Plans": "Plans",
|
||||
"Preview": "Aperçu",
|
||||
"Preview - Tooltip": "Prévisualisez les effets configurés",
|
||||
"Pricings": "Tarifs",
|
||||
"Products": "Produits",
|
||||
"Provider": "Fournisseur",
|
||||
"Provider - Tooltip": "Les fournisseurs de paiement doivent être configurés, y compris PayPal, Alipay, WeChat Pay, etc.",
|
||||
@@ -281,6 +295,9 @@
|
||||
"Sorry, you do not have permission to access this page or logged in status invalid.": "Désolé, vous n'avez pas la permission d'accéder à cette page ou votre statut de connexion est invalide.",
|
||||
"State": "État",
|
||||
"State - Tooltip": "État",
|
||||
"Submitter": "Submitter",
|
||||
"Submitter - Tooltip": "Submitter - Tooltip",
|
||||
"Subscriptions": "Abonnements",
|
||||
"Successfully added": "Ajouté avec succès",
|
||||
"Successfully deleted": "Supprimé avec succès",
|
||||
"Successfully saved": "Succès enregistré",
|
||||
@@ -351,8 +368,12 @@
|
||||
"Or sign in with another account": "Ou connectez-vous avec un autre compte",
|
||||
"Please input your Email or Phone!": "S'il vous plaît, entrez votre adresse e-mail ou votre numéro de téléphone !",
|
||||
"Please input your code!": "Veuillez entrer votre code !",
|
||||
"Please input your organization name!": "Please input your organization name!",
|
||||
"Please input your password!": "Veuillez entrer votre mot de passe !",
|
||||
"Please input your password, at least 6 characters!": "Veuillez entrer votre mot de passe, au moins 6 caractères!",
|
||||
"Please select an organization": "Please select an organization",
|
||||
"Please select an organization to sign in": "Please select an organization to sign in",
|
||||
"Please type an organization to sign in": "Please type an organization to sign in",
|
||||
"Redirecting, please wait.": "Redirection en cours, veuillez patienter.",
|
||||
"Sign In": "Se connecter",
|
||||
"Sign in with WebAuthn": "Connectez-vous avec WebAuthn",
|
||||
@@ -423,6 +444,8 @@
|
||||
"Is profile public - Tooltip": "Après sa fermeture, seuls les administrateurs mondiaux ou les utilisateurs de la même organisation peuvent accéder à la page de profil de l'utilisateur",
|
||||
"Modify rule": "Modifier la règle",
|
||||
"New Organization": "Nouvelle organisation",
|
||||
"Optional": "Optional",
|
||||
"Required": "Required",
|
||||
"Soft deletion": "Suppression douce",
|
||||
"Soft deletion - Tooltip": "Lorsqu'elle est activée, la suppression d'utilisateurs ne les retirera pas complètement de la base de données. Au lieu de cela, ils seront marqués comme supprimés",
|
||||
"Tags": "Étiquettes",
|
||||
@@ -503,6 +526,34 @@
|
||||
"TreeNode": "Nœud arborescent",
|
||||
"Write": "Écrire"
|
||||
},
|
||||
"plan": {
|
||||
"Edit Plan": "Edit Plan",
|
||||
"New Plan": "New Plan",
|
||||
"PerMonth": "par mois",
|
||||
"Price per month": "Price per month",
|
||||
"Price per year": "Price per year",
|
||||
"PricePerMonth": "Prix par mois",
|
||||
"PricePerMonth - Tooltip": "PricePerMonth - Tooltip",
|
||||
"PricePerYear": "Prix par an",
|
||||
"PricePerYear - Tooltip": "PricePerYear - Tooltip",
|
||||
"Sub role": "Sub role",
|
||||
"Sub roles - Tooltip": "Rôle inclus dans le plan actuel"
|
||||
},
|
||||
"pricing": {
|
||||
"Copy pricing page URL": "Copier l'URL de la page tarifs",
|
||||
"Edit Pricing": "Edit Pricing",
|
||||
"Free": "Gratuit",
|
||||
"Getting started": "Commencer",
|
||||
"Has trial": "Essai gratuit disponible",
|
||||
"Has trial - Tooltip": "Disponibilité de la période d'essai après avoir choisi un forfait",
|
||||
"New Pricing": "New Pricing",
|
||||
"Sub plans": "Forfaits supplémentaires",
|
||||
"Sub plans - Tooltip": "Sub plans - Tooltip",
|
||||
"Trial duration": "Durée de l'essai",
|
||||
"Trial duration - Tooltip": "Durée de la période d'essai",
|
||||
"days trial available!": "jours d'essai disponibles !",
|
||||
"pricing page URL copied to clipboard successfully, please paste it into the incognito window or another browser": "URL de la page tarifs copiée avec succès dans le presse-papiers, veuillez le coller dans une fenêtre de navigation privée ou un autre navigateur"
|
||||
},
|
||||
"product": {
|
||||
"Alipay": "Alipay",
|
||||
"Buy": "Acheter",
|
||||
@@ -720,6 +771,24 @@
|
||||
"Your confirmed password is inconsistent with the password!": "Votre mot de passe confirmé est incompatible avec le mot de passe !",
|
||||
"sign in now": "Connectez-vous maintenant"
|
||||
},
|
||||
"subscription": {
|
||||
"Approved": "Approved",
|
||||
"Duration": "Durée",
|
||||
"Duration - Tooltip": "Durée de l'abonnement",
|
||||
"Edit Subscription": "Edit Subscription",
|
||||
"End Date": "Date de fin",
|
||||
"End Date - Tooltip": "Date de fin",
|
||||
"New Subscription": "New Subscription",
|
||||
"Pending": "Pending",
|
||||
"Start Date": "Date de début",
|
||||
"Start Date - Tooltip": "Date de début",
|
||||
"Sub plan": "Plan de l'abonnement",
|
||||
"Sub plan - Tooltip": "Plan de l'abonnement",
|
||||
"Sub plane": "Sub plane",
|
||||
"Sub user": "Sub user",
|
||||
"Sub users": "Utilisateurs de l'abonnement",
|
||||
"Sub users - Tooltip": "Utilisateurs de l'abonnement"
|
||||
},
|
||||
"syncer": {
|
||||
"Affiliation table": "Table d'affiliation",
|
||||
"Affiliation table - Tooltip": "Nom de la table de la base de données de l'unité de travail",
|
||||
|
@@ -56,14 +56,16 @@
|
||||
"Grant types": "Jenis-jenis hibah",
|
||||
"Grant types - Tooltip": "Pilih jenis hibah apa yang diperbolehkan dalam protokol OAuth",
|
||||
"Incremental": "Incremental",
|
||||
"Input": "Input",
|
||||
"Left": "Kiri",
|
||||
"Logged in successfully": "Berhasil masuk",
|
||||
"Logged out successfully": "Berhasil keluar dari sistem",
|
||||
"New Application": "Aplikasi Baru",
|
||||
"No verification": "No verification",
|
||||
"None": "Tidak ada",
|
||||
"Normal": "Normal",
|
||||
"Only signup": "Only signup",
|
||||
"Org choice mode": "Org choice mode",
|
||||
"Org choice mode - Tooltip": "Org choice mode - Tooltip",
|
||||
"Please input your application!": "Silakan masukkan aplikasi Anda!",
|
||||
"Please input your organization!": "Silakan masukkan organisasi Anda!",
|
||||
"Please select a HTML file": "Silahkan pilih file HTML",
|
||||
@@ -82,6 +84,7 @@
|
||||
"SAML metadata - Tooltip": "Metadata dari protokol SAML",
|
||||
"SAML metadata URL copied to clipboard successfully": "URL metadata SAML berhasil disalin ke clipboard",
|
||||
"SAML reply URL": "Alamat URL Balasan SAML",
|
||||
"Select": "Select",
|
||||
"Side panel HTML": "Panel samping HTML",
|
||||
"Side panel HTML - Edit": "Panel sisi HTML - Sunting",
|
||||
"Side panel HTML - Tooltip": "Menyesuaikan kode HTML untuk panel samping halaman login",
|
||||
@@ -167,8 +170,13 @@
|
||||
"Affiliation URL": "URL Afiliasi",
|
||||
"Affiliation URL - Tooltip": "URL halaman depan untuk afiliasi",
|
||||
"Application": "Aplikasi",
|
||||
"Application - Tooltip": "Application - Tooltip",
|
||||
"Applications": "Aplikasi",
|
||||
"Applications that require authentication": "Aplikasi yang memerlukan autentikasi",
|
||||
"Approve time": "Approve time",
|
||||
"Approve time - Tooltip": "Approve time - Tooltip",
|
||||
"Approver": "Approver",
|
||||
"Approver - Tooltip": "Approver - Tooltip",
|
||||
"Avatar": "Avatar",
|
||||
"Avatar - Tooltip": "Gambar avatar publik untuk pengguna",
|
||||
"Back": "Back",
|
||||
@@ -182,6 +190,7 @@
|
||||
"Click to Upload": "Klik untuk Mengunggah",
|
||||
"Client IP": "IP klien",
|
||||
"Close": "Tutup",
|
||||
"Confirm": "Confirm",
|
||||
"Created time": "Waktu dibuat",
|
||||
"Default application": "Aplikasi default",
|
||||
"Default application - Tooltip": "Aplikasi default untuk pengguna yang terdaftar langsung dari halaman organisasi",
|
||||
@@ -226,6 +235,8 @@
|
||||
"Last name": "Nama belakang",
|
||||
"Logo": "Logo",
|
||||
"Logo - Tooltip": "Ikon-ikon yang disajikan aplikasi ke dunia luar",
|
||||
"MFA items": "MFA items",
|
||||
"MFA items - Tooltip": "MFA items - Tooltip",
|
||||
"Master password": "Kata sandi utama",
|
||||
"Master password - Tooltip": "Dapat digunakan untuk masuk ke semua pengguna di bawah organisasi ini, sehingga memudahkan administrator untuk masuk sebagai pengguna ini untuk menyelesaikan masalah teknis",
|
||||
"Menu": "Daftar makanan",
|
||||
@@ -236,6 +247,7 @@
|
||||
"Models": "Model-model",
|
||||
"Name": "Nama",
|
||||
"Name - Tooltip": "ID unik berbasis string",
|
||||
"None": "None",
|
||||
"OAuth providers": "Penyedia OAuth",
|
||||
"OK": "Baik atau Oke",
|
||||
"Organization": "Organisasi",
|
||||
@@ -253,8 +265,10 @@
|
||||
"Phone": "Telepon",
|
||||
"Phone - Tooltip": "Nomor telepon",
|
||||
"Phone or email": "Phone or email",
|
||||
"Plans": "Rencana",
|
||||
"Preview": "Tinjauan",
|
||||
"Preview - Tooltip": "Mengawali pratinjau efek yang sudah dikonfigurasi",
|
||||
"Pricings": "Harga",
|
||||
"Products": "Produk",
|
||||
"Provider": "Penyedia",
|
||||
"Provider - Tooltip": "Penyedia pembayaran harus dikonfigurasi, termasuk PayPal, Alipay, WeChat Pay, dan sebagainya.",
|
||||
@@ -281,6 +295,9 @@
|
||||
"Sorry, you do not have permission to access this page or logged in status invalid.": "Maaf, Anda tidak memiliki izin untuk mengakses halaman ini atau status masuk tidak valid.",
|
||||
"State": "Negara",
|
||||
"State - Tooltip": "Negara",
|
||||
"Submitter": "Submitter",
|
||||
"Submitter - Tooltip": "Submitter - Tooltip",
|
||||
"Subscriptions": "Langganan",
|
||||
"Successfully added": "Berhasil ditambahkan",
|
||||
"Successfully deleted": "Berhasil dihapus",
|
||||
"Successfully saved": "Berhasil disimpan",
|
||||
@@ -351,8 +368,12 @@
|
||||
"Or sign in with another account": "Atau masuk dengan akun lain",
|
||||
"Please input your Email or Phone!": "Silahkan masukkan email atau nomor telepon Anda!",
|
||||
"Please input your code!": "Silakan masukkan kode Anda!",
|
||||
"Please input your organization name!": "Please input your organization name!",
|
||||
"Please input your password!": "Masukkan kata sandi Anda!",
|
||||
"Please input your password, at least 6 characters!": "Silakan masukkan kata sandi Anda, minimal 6 karakter!",
|
||||
"Please select an organization": "Please select an organization",
|
||||
"Please select an organization to sign in": "Please select an organization to sign in",
|
||||
"Please type an organization to sign in": "Please type an organization to sign in",
|
||||
"Redirecting, please wait.": "Mengalihkan, harap tunggu.",
|
||||
"Sign In": "Masuk",
|
||||
"Sign in with WebAuthn": "Masuk dengan WebAuthn",
|
||||
@@ -423,6 +444,8 @@
|
||||
"Is profile public - Tooltip": "Setelah ditutup, hanya administrator global atau pengguna di organisasi yang sama yang dapat mengakses halaman profil pengguna",
|
||||
"Modify rule": "Mengubah aturan",
|
||||
"New Organization": "Organisasi baru",
|
||||
"Optional": "Optional",
|
||||
"Required": "Required",
|
||||
"Soft deletion": "Penghapusan lunak",
|
||||
"Soft deletion - Tooltip": "Ketika diaktifkan, menghapus pengguna tidak akan sepenuhnya menghapus mereka dari database. Sebaliknya, mereka akan ditandai sebagai dihapus",
|
||||
"Tags": "Tag-tag",
|
||||
@@ -503,6 +526,34 @@
|
||||
"TreeNode": "PohonNode",
|
||||
"Write": "Menulis"
|
||||
},
|
||||
"plan": {
|
||||
"Edit Plan": "Edit Plan",
|
||||
"New Plan": "New Plan",
|
||||
"PerMonth": "per bulan",
|
||||
"Price per month": "Price per month",
|
||||
"Price per year": "Price per year",
|
||||
"PricePerMonth": "Harga per bulan",
|
||||
"PricePerMonth - Tooltip": "PricePerMonth - Tooltip",
|
||||
"PricePerYear": "Harga per tahun",
|
||||
"PricePerYear - Tooltip": "PricePerYear - Tooltip",
|
||||
"Sub role": "Sub role",
|
||||
"Sub roles - Tooltip": "Peran yang termasuk dalam rencana saat ini"
|
||||
},
|
||||
"pricing": {
|
||||
"Copy pricing page URL": "Salin URL halaman harga",
|
||||
"Edit Pricing": "Edit Pricing",
|
||||
"Free": "Gratis",
|
||||
"Getting started": "Mulai",
|
||||
"Has trial": "Mempunyai periode percobaan",
|
||||
"Has trial - Tooltip": "Ketersediaan periode percobaan setelah memilih rencana",
|
||||
"New Pricing": "New Pricing",
|
||||
"Sub plans": "Rencana Tambahan",
|
||||
"Sub plans - Tooltip": "Sub plans - Tooltip",
|
||||
"Trial duration": "Durasi percobaan",
|
||||
"Trial duration - Tooltip": "Durasi periode percobaan",
|
||||
"days trial available!": "hari percobaan tersedia!",
|
||||
"pricing page URL copied to clipboard successfully, please paste it into the incognito window or another browser": "URL halaman harga berhasil disalin ke clipboard, silakan tempelkan ke dalam jendela mode penyamaran atau browser lainnya"
|
||||
},
|
||||
"product": {
|
||||
"Alipay": "Alipay",
|
||||
"Buy": "Beli",
|
||||
@@ -720,6 +771,24 @@
|
||||
"Your confirmed password is inconsistent with the password!": "Kata sandi yang dikonfirmasi tidak konsisten dengan kata sandi!",
|
||||
"sign in now": "Masuk sekarang"
|
||||
},
|
||||
"subscription": {
|
||||
"Approved": "Approved",
|
||||
"Duration": "Durasi",
|
||||
"Duration - Tooltip": "Durasi langganan",
|
||||
"Edit Subscription": "Edit Subscription",
|
||||
"End Date": "Tanggal Berakhir",
|
||||
"End Date - Tooltip": "Tanggal Berakhir",
|
||||
"New Subscription": "New Subscription",
|
||||
"Pending": "Pending",
|
||||
"Start Date": "Tanggal Mulai",
|
||||
"Start Date - Tooltip": "Tanggal Mulai",
|
||||
"Sub plan": "Rencana Langganan",
|
||||
"Sub plan - Tooltip": "Rencana Langganan",
|
||||
"Sub plane": "Sub plane",
|
||||
"Sub user": "Sub user",
|
||||
"Sub users": "Pengguna Langganan",
|
||||
"Sub users - Tooltip": "Pengguna Langganan"
|
||||
},
|
||||
"syncer": {
|
||||
"Affiliation table": "Tabel afiliasi",
|
||||
"Affiliation table - Tooltip": "Nama tabel database dari unit kerja",
|
||||
|
@@ -56,14 +56,16 @@
|
||||
"Grant types": "グラント種類",
|
||||
"Grant types - Tooltip": "OAuthプロトコルで許可されているグラントタイプを選択してください",
|
||||
"Incremental": "Incremental",
|
||||
"Input": "Input",
|
||||
"Left": "左",
|
||||
"Logged in successfully": "正常にログインしました",
|
||||
"Logged out successfully": "正常にログアウトしました",
|
||||
"New Application": "新しいアプリケーション",
|
||||
"No verification": "No verification",
|
||||
"None": "なし",
|
||||
"Normal": "Normal",
|
||||
"Only signup": "Only signup",
|
||||
"Org choice mode": "Org choice mode",
|
||||
"Org choice mode - Tooltip": "Org choice mode - Tooltip",
|
||||
"Please input your application!": "あなたの申請を入力してください!",
|
||||
"Please input your organization!": "あなたの組織を入力してください!",
|
||||
"Please select a HTML file": "HTMLファイルを選択してください",
|
||||
@@ -82,6 +84,7 @@
|
||||
"SAML metadata - Tooltip": "SAMLプロトコルのメタデータ",
|
||||
"SAML metadata URL copied to clipboard successfully": "SAMLメタデータURLが正常にクリップボードにコピーされました",
|
||||
"SAML reply URL": "SAMLリプライURL",
|
||||
"Select": "Select",
|
||||
"Side panel HTML": "サイドパネルのHTML",
|
||||
"Side panel HTML - Edit": "サイドパネルのHTML - 編集",
|
||||
"Side panel HTML - Tooltip": "ログインページのサイドパネルに対するHTMLコードをカスタマイズしてください",
|
||||
@@ -167,8 +170,13 @@
|
||||
"Affiliation URL": "所属するURL",
|
||||
"Affiliation URL - Tooltip": "所属先のホームページURL",
|
||||
"Application": "アプリケーション",
|
||||
"Application - Tooltip": "Application - Tooltip",
|
||||
"Applications": "アプリケーション",
|
||||
"Applications that require authentication": "認証が必要なアプリケーション",
|
||||
"Approve time": "Approve time",
|
||||
"Approve time - Tooltip": "Approve time - Tooltip",
|
||||
"Approver": "Approver",
|
||||
"Approver - Tooltip": "Approver - Tooltip",
|
||||
"Avatar": "アバター",
|
||||
"Avatar - Tooltip": "ユーザーのパブリックアバター画像",
|
||||
"Back": "Back",
|
||||
@@ -182,6 +190,7 @@
|
||||
"Click to Upload": "アップロードするにはクリックしてください",
|
||||
"Client IP": "クライアントIP",
|
||||
"Close": "閉じる",
|
||||
"Confirm": "Confirm",
|
||||
"Created time": "作成された時間",
|
||||
"Default application": "デフォルトアプリケーション",
|
||||
"Default application - Tooltip": "組織ページから直接登録されたユーザーのデフォルトアプリケーション",
|
||||
@@ -226,6 +235,8 @@
|
||||
"Last name": "苗字",
|
||||
"Logo": "ロゴ",
|
||||
"Logo - Tooltip": "アプリケーションが外部世界に示すアイコン",
|
||||
"MFA items": "MFA items",
|
||||
"MFA items - Tooltip": "MFA items - Tooltip",
|
||||
"Master password": "マスターパスワード",
|
||||
"Master password - Tooltip": "この組織のすべてのユーザーにログインするために使用でき、管理者が技術的な問題を解決するためにこのユーザーとしてログインするのに便利です",
|
||||
"Menu": "メニュー",
|
||||
@@ -236,6 +247,7 @@
|
||||
"Models": "モデル",
|
||||
"Name": "名前",
|
||||
"Name - Tooltip": "ユニークで文字列ベースのID",
|
||||
"None": "None",
|
||||
"OAuth providers": "OAuthプロバイダー",
|
||||
"OK": "了解",
|
||||
"Organization": "組織",
|
||||
@@ -253,8 +265,10 @@
|
||||
"Phone": "電話",
|
||||
"Phone - Tooltip": "電話番号",
|
||||
"Phone or email": "Phone or email",
|
||||
"Plans": "プラン",
|
||||
"Preview": "プレビュー",
|
||||
"Preview - Tooltip": "構成されたエフェクトをプレビューする",
|
||||
"Pricings": "価格設定",
|
||||
"Products": "製品",
|
||||
"Provider": "プロバイダー",
|
||||
"Provider - Tooltip": "支払いプロバイダーを設定する必要があります。これには、PayPal、Alipay、WeChat Payなどが含まれます。",
|
||||
@@ -281,6 +295,9 @@
|
||||
"Sorry, you do not have permission to access this page or logged in status invalid.": "申し訳ありませんが、このページにアクセスする権限がありません、またはログイン状態が無効です。",
|
||||
"State": "州",
|
||||
"State - Tooltip": "状態",
|
||||
"Submitter": "Submitter",
|
||||
"Submitter - Tooltip": "Submitter - Tooltip",
|
||||
"Subscriptions": "サブスクリプション",
|
||||
"Successfully added": "正常に追加されました",
|
||||
"Successfully deleted": "正常に削除されました",
|
||||
"Successfully saved": "成功的に保存されました",
|
||||
@@ -351,8 +368,12 @@
|
||||
"Or sign in with another account": "別のアカウントでサインインする",
|
||||
"Please input your Email or Phone!": "あなたのメールアドレスまたは電話番号を入力してください!",
|
||||
"Please input your code!": "あなたのコードを入力してください!",
|
||||
"Please input your organization name!": "Please input your organization name!",
|
||||
"Please input your password!": "パスワードを入力してください!",
|
||||
"Please input your password, at least 6 characters!": "パスワードを入力してください。少なくとも6文字です!",
|
||||
"Please select an organization": "Please select an organization",
|
||||
"Please select an organization to sign in": "Please select an organization to sign in",
|
||||
"Please type an organization to sign in": "Please type an organization to sign in",
|
||||
"Redirecting, please wait.": "リダイレクト中、お待ちください。",
|
||||
"Sign In": "サインイン",
|
||||
"Sign in with WebAuthn": "WebAuthnでサインインしてください",
|
||||
@@ -423,6 +444,8 @@
|
||||
"Is profile public - Tooltip": "閉鎖された後、グローバル管理者または同じ組織のユーザーだけがユーザーのプロファイルページにアクセスできます",
|
||||
"Modify rule": "ルールを変更する",
|
||||
"New Organization": "新しい組織",
|
||||
"Optional": "Optional",
|
||||
"Required": "Required",
|
||||
"Soft deletion": "ソフト削除",
|
||||
"Soft deletion - Tooltip": "有効になっている場合、ユーザーを削除しても完全にデータベースから削除されません。代わりに、削除されたとマークされます",
|
||||
"Tags": "タグ",
|
||||
@@ -503,6 +526,34 @@
|
||||
"TreeNode": "ツリーノード",
|
||||
"Write": "書く"
|
||||
},
|
||||
"plan": {
|
||||
"Edit Plan": "Edit Plan",
|
||||
"New Plan": "New Plan",
|
||||
"PerMonth": "月毎",
|
||||
"Price per month": "Price per month",
|
||||
"Price per year": "Price per year",
|
||||
"PricePerMonth": "月額料金",
|
||||
"PricePerMonth - Tooltip": "PricePerMonth - Tooltip",
|
||||
"PricePerYear": "年間料金",
|
||||
"PricePerYear - Tooltip": "PricePerYear - Tooltip",
|
||||
"Sub role": "Sub role",
|
||||
"Sub roles - Tooltip": "現在のプランに含まれるロール"
|
||||
},
|
||||
"pricing": {
|
||||
"Copy pricing page URL": "価格ページのURLをコピー",
|
||||
"Edit Pricing": "Edit Pricing",
|
||||
"Free": "無料",
|
||||
"Getting started": "はじめる",
|
||||
"Has trial": "トライアル期間あり",
|
||||
"Has trial - Tooltip": "プラン選択後のトライアル期間の有無",
|
||||
"New Pricing": "New Pricing",
|
||||
"Sub plans": "追加プラン",
|
||||
"Sub plans - Tooltip": "Sub plans - Tooltip",
|
||||
"Trial duration": "トライアル期間の長さ",
|
||||
"Trial duration - Tooltip": "トライアル期間の長さ",
|
||||
"days trial available!": "日間のトライアルが利用可能です!",
|
||||
"pricing page URL copied to clipboard successfully, please paste it into the incognito window or another browser": "価格ページのURLが正常にクリップボードにコピーされました。シークレットウィンドウや別のブラウザに貼り付けてください。"
|
||||
},
|
||||
"product": {
|
||||
"Alipay": "Alipay",
|
||||
"Buy": "購入",
|
||||
@@ -720,6 +771,24 @@
|
||||
"Your confirmed password is inconsistent with the password!": "確認されたパスワードは、パスワードと矛盾しています!",
|
||||
"sign in now": "今すぐサインインしてください"
|
||||
},
|
||||
"subscription": {
|
||||
"Approved": "Approved",
|
||||
"Duration": "期間",
|
||||
"Duration - Tooltip": "購読の期間",
|
||||
"Edit Subscription": "Edit Subscription",
|
||||
"End Date": "終了日",
|
||||
"End Date - Tooltip": "終了日",
|
||||
"New Subscription": "New Subscription",
|
||||
"Pending": "Pending",
|
||||
"Start Date": "開始日",
|
||||
"Start Date - Tooltip": "開始日",
|
||||
"Sub plan": "購読プラン",
|
||||
"Sub plan - Tooltip": "購読プラン",
|
||||
"Sub plane": "Sub plane",
|
||||
"Sub user": "Sub user",
|
||||
"Sub users": "購読ユーザー",
|
||||
"Sub users - Tooltip": "購読ユーザー"
|
||||
},
|
||||
"syncer": {
|
||||
"Affiliation table": "所属テーブル",
|
||||
"Affiliation table - Tooltip": "作業単位のデータベーステーブル名",
|
||||
|
@@ -56,14 +56,16 @@
|
||||
"Grant types": "Grant types: 부여 유형",
|
||||
"Grant types - Tooltip": "OAuth 프로토콜에서 허용되는 그란트 유형을 선택하십시오",
|
||||
"Incremental": "Incremental",
|
||||
"Input": "Input",
|
||||
"Left": "왼쪽",
|
||||
"Logged in successfully": "성공적으로 로그인했습니다",
|
||||
"Logged out successfully": "로그아웃이 성공적으로 되었습니다",
|
||||
"New Application": "새로운 응용 프로그램",
|
||||
"No verification": "No verification",
|
||||
"None": "없음",
|
||||
"Normal": "Normal",
|
||||
"Only signup": "Only signup",
|
||||
"Org choice mode": "Org choice mode",
|
||||
"Org choice mode - Tooltip": "Org choice mode - Tooltip",
|
||||
"Please input your application!": "당신의 신청서를 입력해주세요!",
|
||||
"Please input your organization!": "귀하의 조직을 입력해 주세요!",
|
||||
"Please select a HTML file": "HTML 파일을 선택해 주세요",
|
||||
@@ -82,6 +84,7 @@
|
||||
"SAML metadata - Tooltip": "SAML 프로토콜의 메타 데이터",
|
||||
"SAML metadata URL copied to clipboard successfully": "SAML 메타데이터의 URL이 성공적으로 클립보드로 복사되었습니다",
|
||||
"SAML reply URL": "SAML 응답 URL",
|
||||
"Select": "Select",
|
||||
"Side panel HTML": "사이드 패널 HTML",
|
||||
"Side panel HTML - Edit": "사이드 패널 HTML - 편집",
|
||||
"Side panel HTML - Tooltip": "로그인 페이지의 측면 패널용 HTML 코드를 맞춤 설정하십시오",
|
||||
@@ -167,8 +170,13 @@
|
||||
"Affiliation URL": "소속 URL",
|
||||
"Affiliation URL - Tooltip": "소속 홈페이지 URL",
|
||||
"Application": "응용 프로그램",
|
||||
"Application - Tooltip": "Application - Tooltip",
|
||||
"Applications": "응용 프로그램",
|
||||
"Applications that require authentication": "인증이 필요한 애플리케이션들",
|
||||
"Approve time": "Approve time",
|
||||
"Approve time - Tooltip": "Approve time - Tooltip",
|
||||
"Approver": "Approver",
|
||||
"Approver - Tooltip": "Approver - Tooltip",
|
||||
"Avatar": "아바타",
|
||||
"Avatar - Tooltip": "사용자를 위한 공개 아바타 이미지",
|
||||
"Back": "Back",
|
||||
@@ -182,6 +190,7 @@
|
||||
"Click to Upload": "클릭하여 업로드하세요",
|
||||
"Client IP": "고객 IP",
|
||||
"Close": "닫다",
|
||||
"Confirm": "Confirm",
|
||||
"Created time": "작성한 시간",
|
||||
"Default application": "기본 애플리케이션",
|
||||
"Default application - Tooltip": "조직 페이지에서 직접 등록한 사용자의 기본 응용 프로그램",
|
||||
@@ -226,6 +235,8 @@
|
||||
"Last name": "성",
|
||||
"Logo": "로고",
|
||||
"Logo - Tooltip": "애플리케이션이 외부 세계에 제시하는 아이콘들",
|
||||
"MFA items": "MFA items",
|
||||
"MFA items - Tooltip": "MFA items - Tooltip",
|
||||
"Master password": "마스터 비밀번호",
|
||||
"Master password - Tooltip": "이 조직의 모든 사용자에게 로그인하는 데 사용될 수 있으며, 이 사용자로 로그인하여 기술 문제를 해결하는 관리자에게 편리합니다",
|
||||
"Menu": "메뉴",
|
||||
@@ -236,6 +247,7 @@
|
||||
"Models": "모델들",
|
||||
"Name": "이름",
|
||||
"Name - Tooltip": "고유한 문자열 기반 ID",
|
||||
"None": "None",
|
||||
"OAuth providers": "OAuth 공급자",
|
||||
"OK": "예",
|
||||
"Organization": "조직화",
|
||||
@@ -253,8 +265,10 @@
|
||||
"Phone": "전화기",
|
||||
"Phone - Tooltip": "전화 번호",
|
||||
"Phone or email": "Phone or email",
|
||||
"Plans": "플랜",
|
||||
"Preview": "미리보기",
|
||||
"Preview - Tooltip": "구성된 효과를 미리보기합니다",
|
||||
"Pricings": "가격",
|
||||
"Products": "제품들",
|
||||
"Provider": "공급자",
|
||||
"Provider - Tooltip": "지불 공급자를 구성해야합니다. PayPal, Alipay, WeChat Pay 등이 포함됩니다.",
|
||||
@@ -281,6 +295,9 @@
|
||||
"Sorry, you do not have permission to access this page or logged in status invalid.": "죄송합니다. 이 페이지에 접근할 권한이 없거나 로그인 상태가 유효하지 않습니다.",
|
||||
"State": "주",
|
||||
"State - Tooltip": "국가",
|
||||
"Submitter": "Submitter",
|
||||
"Submitter - Tooltip": "Submitter - Tooltip",
|
||||
"Subscriptions": "구독",
|
||||
"Successfully added": "성공적으로 추가되었습니다",
|
||||
"Successfully deleted": "성공적으로 삭제되었습니다",
|
||||
"Successfully saved": "성공적으로 저장되었습니다",
|
||||
@@ -351,8 +368,12 @@
|
||||
"Or sign in with another account": "다른 계정으로 로그인하세요",
|
||||
"Please input your Email or Phone!": "이메일 또는 전화번호를 입력해주세요!",
|
||||
"Please input your code!": "코드를 입력해주세요!",
|
||||
"Please input your organization name!": "Please input your organization name!",
|
||||
"Please input your password!": "비밀번호를 입력해주세요!",
|
||||
"Please input your password, at least 6 characters!": "비밀번호를 입력해주세요. 최소 6자 이상 필요합니다!",
|
||||
"Please select an organization": "Please select an organization",
|
||||
"Please select an organization to sign in": "Please select an organization to sign in",
|
||||
"Please type an organization to sign in": "Please type an organization to sign in",
|
||||
"Redirecting, please wait.": "리디렉팅 중입니다. 잠시 기다려주세요.",
|
||||
"Sign In": "로그인",
|
||||
"Sign in with WebAuthn": "WebAuthn으로 로그인하세요",
|
||||
@@ -423,6 +444,8 @@
|
||||
"Is profile public - Tooltip": "닫힌 후에는 전역 관리자 또는 동일한 조직의 사용자만 사용자 프로필 페이지에 액세스할 수 있습니다",
|
||||
"Modify rule": "규칙 수정",
|
||||
"New Organization": "새로운 조직",
|
||||
"Optional": "Optional",
|
||||
"Required": "Required",
|
||||
"Soft deletion": "소프트 삭제",
|
||||
"Soft deletion - Tooltip": "사용 가능한 경우, 사용자 삭제 시 데이터베이스에서 완전히 삭제되지 않습니다. 대신 삭제됨으로 표시됩니다",
|
||||
"Tags": "태그",
|
||||
@@ -503,6 +526,34 @@
|
||||
"TreeNode": "트리 노드",
|
||||
"Write": "쓰다"
|
||||
},
|
||||
"plan": {
|
||||
"Edit Plan": "Edit Plan",
|
||||
"New Plan": "New Plan",
|
||||
"PerMonth": "월",
|
||||
"Price per month": "Price per month",
|
||||
"Price per year": "Price per year",
|
||||
"PricePerMonth": "월별 가격",
|
||||
"PricePerMonth - Tooltip": "PricePerMonth - Tooltip",
|
||||
"PricePerYear": "연간 가격",
|
||||
"PricePerYear - Tooltip": "PricePerYear - Tooltip",
|
||||
"Sub role": "Sub role",
|
||||
"Sub roles - Tooltip": "현재 플랜에 포함된 역할"
|
||||
},
|
||||
"pricing": {
|
||||
"Copy pricing page URL": "가격 페이지 URL 복사",
|
||||
"Edit Pricing": "Edit Pricing",
|
||||
"Free": "무료",
|
||||
"Getting started": "시작하기",
|
||||
"Has trial": "무료 체험 가능",
|
||||
"Has trial - Tooltip": "플랜 선택 후 체험 기간의 가용 여부",
|
||||
"New Pricing": "New Pricing",
|
||||
"Sub plans": "추가 플랜",
|
||||
"Sub plans - Tooltip": "Sub plans - Tooltip",
|
||||
"Trial duration": "체험 기간",
|
||||
"Trial duration - Tooltip": "체험 기간의 기간",
|
||||
"days trial available!": "일 무료 체험 가능!",
|
||||
"pricing page URL copied to clipboard successfully, please paste it into the incognito window or another browser": "가격 페이지 URL이 클립보드에 성공적으로 복사되었습니다. 시크릿 창이나 다른 브라우저에 붙여넣기해주세요."
|
||||
},
|
||||
"product": {
|
||||
"Alipay": "Alipay",
|
||||
"Buy": "구매하다",
|
||||
@@ -720,6 +771,24 @@
|
||||
"Your confirmed password is inconsistent with the password!": "확인된 비밀번호가 비밀번호와 일치하지 않습니다!",
|
||||
"sign in now": "지금 로그인하십시오"
|
||||
},
|
||||
"subscription": {
|
||||
"Approved": "Approved",
|
||||
"Duration": "기간",
|
||||
"Duration - Tooltip": "구독 기간",
|
||||
"Edit Subscription": "Edit Subscription",
|
||||
"End Date": "종료일",
|
||||
"End Date - Tooltip": "종료일",
|
||||
"New Subscription": "New Subscription",
|
||||
"Pending": "Pending",
|
||||
"Start Date": "시작일",
|
||||
"Start Date - Tooltip": "시작일",
|
||||
"Sub plan": "구독 플랜",
|
||||
"Sub plan - Tooltip": "구독 플랜",
|
||||
"Sub plane": "Sub plane",
|
||||
"Sub user": "Sub user",
|
||||
"Sub users": "구독 사용자",
|
||||
"Sub users - Tooltip": "구독 사용자"
|
||||
},
|
||||
"syncer": {
|
||||
"Affiliation table": "소속 테이블",
|
||||
"Affiliation table - Tooltip": "작업 단위의 데이터베이스 테이블 이름",
|
||||
|
@@ -56,14 +56,16 @@
|
||||
"Grant types": "Tipos de concessão",
|
||||
"Grant types - Tooltip": "Selecione quais tipos de concessão são permitidos no protocolo OAuth",
|
||||
"Incremental": "Incremental",
|
||||
"Input": "Input",
|
||||
"Left": "Esquerda",
|
||||
"Logged in successfully": "Login realizado com sucesso",
|
||||
"Logged out successfully": "Logout realizado com sucesso",
|
||||
"New Application": "Nova Aplicação",
|
||||
"No verification": "Sem verificação",
|
||||
"None": "Nenhum",
|
||||
"Normal": "Normal",
|
||||
"Only signup": "Apenas registro",
|
||||
"Org choice mode": "Org choice mode",
|
||||
"Org choice mode - Tooltip": "Org choice mode - Tooltip",
|
||||
"Please input your application!": "Por favor, insira o nome da sua aplicação!",
|
||||
"Please input your organization!": "Por favor, insira o nome da sua organização!",
|
||||
"Please select a HTML file": "Por favor, selecione um arquivo HTML",
|
||||
@@ -82,6 +84,7 @@
|
||||
"SAML metadata - Tooltip": "Os metadados do protocolo SAML",
|
||||
"SAML metadata URL copied to clipboard successfully": "URL dos metadados do SAML copiada para a área de transferência com sucesso",
|
||||
"SAML reply URL": "URL de resposta do SAML",
|
||||
"Select": "Select",
|
||||
"Side panel HTML": "HTML do painel lateral",
|
||||
"Side panel HTML - Edit": "Editar HTML do painel lateral",
|
||||
"Side panel HTML - Tooltip": "Personalize o código HTML para o painel lateral da página de login",
|
||||
@@ -121,7 +124,7 @@
|
||||
"Private key copied to clipboard successfully": "Chave privada copiada para a área de transferência com sucesso",
|
||||
"Scope - Tooltip": "Cenários de uso do certificado",
|
||||
"Type - Tooltip": "Tipo de certificado"
|
||||
},
|
||||
},
|
||||
"chat": {
|
||||
"AI": "IA",
|
||||
"Edit Chat": "Editar Chat",
|
||||
@@ -167,8 +170,13 @@
|
||||
"Affiliation URL": "URL da Afiliação",
|
||||
"Affiliation URL - Tooltip": "A URL da página inicial para a afiliação",
|
||||
"Application": "Aplicação",
|
||||
"Application - Tooltip": "Application - Tooltip",
|
||||
"Applications": "Aplicações",
|
||||
"Applications that require authentication": "Aplicações que requerem autenticação",
|
||||
"Approve time": "Approve time",
|
||||
"Approve time - Tooltip": "Approve time - Tooltip",
|
||||
"Approver": "Approver",
|
||||
"Approver - Tooltip": "Approver - Tooltip",
|
||||
"Avatar": "Avatar",
|
||||
"Avatar - Tooltip": "Imagem de avatar pública do usuário",
|
||||
"Back": "Voltar",
|
||||
@@ -182,6 +190,7 @@
|
||||
"Click to Upload": "Clique para Enviar",
|
||||
"Client IP": "IP do Cliente",
|
||||
"Close": "Fechar",
|
||||
"Confirm": "Confirm",
|
||||
"Created time": "Hora de Criação",
|
||||
"Default application": "Aplicação padrão",
|
||||
"Default application - Tooltip": "Aplicação padrão para usuários registrados diretamente na página da organização",
|
||||
@@ -226,6 +235,8 @@
|
||||
"Last name": "Sobrenome",
|
||||
"Logo": "Logo",
|
||||
"Logo - Tooltip": "Ícones que o aplicativo apresenta para o mundo externo",
|
||||
"MFA items": "MFA items",
|
||||
"MFA items - Tooltip": "MFA items - Tooltip",
|
||||
"Master password": "Senha mestra",
|
||||
"Master password - Tooltip": "Pode ser usada para fazer login em todos os usuários desta organização, facilitando para os administradores fazerem login como este usuário para resolver problemas técnicos",
|
||||
"Menu": "Menu",
|
||||
@@ -236,6 +247,7 @@
|
||||
"Models": "Modelos",
|
||||
"Name": "Nome",
|
||||
"Name - Tooltip": "ID único em formato de string",
|
||||
"None": "None",
|
||||
"OAuth providers": "Provedores OAuth",
|
||||
"OK": "OK",
|
||||
"Organization": "Organização",
|
||||
@@ -253,8 +265,10 @@
|
||||
"Phone": "Telefone",
|
||||
"Phone - Tooltip": "Número de telefone",
|
||||
"Phone or email": "Telefone ou email",
|
||||
"Plans": "Kế hoạch",
|
||||
"Preview": "Visualizar",
|
||||
"Preview - Tooltip": "Visualizar os efeitos configurados",
|
||||
"Pricings": "Bảng giá",
|
||||
"Products": "Produtos",
|
||||
"Provider": "Provedor",
|
||||
"Provider - Tooltip": "Provedores de pagamento a serem configurados, incluindo PayPal, Alipay, WeChat Pay, etc.",
|
||||
@@ -281,6 +295,9 @@
|
||||
"Sorry, you do not have permission to access this page or logged in status invalid.": "Desculpe, você não tem permissão para acessar esta página ou o status de login é inválido.",
|
||||
"State": "Estado",
|
||||
"State - Tooltip": "Estado",
|
||||
"Submitter": "Submitter",
|
||||
"Submitter - Tooltip": "Submitter - Tooltip",
|
||||
"Subscriptions": "Đăng ký",
|
||||
"Successfully added": "Adicionado com sucesso",
|
||||
"Successfully deleted": "Excluído com sucesso",
|
||||
"Successfully saved": "Salvo com sucesso",
|
||||
@@ -351,8 +368,12 @@
|
||||
"Or sign in with another account": "Ou entre com outra conta",
|
||||
"Please input your Email or Phone!": "Por favor, informe seu email ou telefone!",
|
||||
"Please input your code!": "Por favor, informe o código!",
|
||||
"Please input your organization name!": "Please input your organization name!",
|
||||
"Please input your password!": "Por favor, informe sua senha!",
|
||||
"Please input your password, at least 6 characters!": "Por favor, informe sua senha, pelo menos 6 caracteres!",
|
||||
"Please select an organization": "Please select an organization",
|
||||
"Please select an organization to sign in": "Please select an organization to sign in",
|
||||
"Please type an organization to sign in": "Please type an organization to sign in",
|
||||
"Redirecting, please wait.": "Redirecionando, por favor aguarde.",
|
||||
"Sign In": "Entrar",
|
||||
"Sign in with WebAuthn": "Entrar com WebAuthn",
|
||||
@@ -365,7 +386,7 @@
|
||||
"WebAuthn": "WebAuthn",
|
||||
"sign up now": "Inscreva-se agora",
|
||||
"username, Email or phone": "Nome de usuário, email ou telefone"
|
||||
},
|
||||
},
|
||||
"message": {
|
||||
"Author": "Autor",
|
||||
"Author - Tooltip": "Autor - Dica de ferramenta",
|
||||
@@ -404,7 +425,7 @@
|
||||
"Verify Password": "Verificar Senha",
|
||||
"Your email is": "Seu e-mail é",
|
||||
"Your phone is": "Seu telefone é",
|
||||
"preferred": "Preferido"
|
||||
"preferred": "Preferido"
|
||||
},
|
||||
"model": {
|
||||
"Edit Model": "Editar Modelo",
|
||||
@@ -423,6 +444,8 @@
|
||||
"Is profile public - Tooltip": "Após ser fechado, apenas administradores globais ou usuários na mesma organização podem acessar a página de perfil do usuário",
|
||||
"Modify rule": "Modificar regra",
|
||||
"New Organization": "Nova Organização",
|
||||
"Optional": "Optional",
|
||||
"Required": "Required",
|
||||
"Soft deletion": "Exclusão suave",
|
||||
"Soft deletion - Tooltip": "Quando ativada, a exclusão de usuários não os removerá completamente do banco de dados. Em vez disso, eles serão marcados como excluídos",
|
||||
"Tags": "Tags",
|
||||
@@ -503,6 +526,34 @@
|
||||
"TreeNode": "Nó da Árvore",
|
||||
"Write": "Escrever"
|
||||
},
|
||||
"plan": {
|
||||
"Edit Plan": "Edit Plan",
|
||||
"New Plan": "New Plan",
|
||||
"PerMonth": "mỗi tháng",
|
||||
"Price per month": "Price per month",
|
||||
"Price per year": "Price per year",
|
||||
"PricePerMonth": "Giá mỗi tháng",
|
||||
"PricePerMonth - Tooltip": "PricePerMonth - Tooltip",
|
||||
"PricePerYear": "Giá mỗi năm",
|
||||
"PricePerYear - Tooltip": "PricePerYear - Tooltip",
|
||||
"Sub role": "Sub role",
|
||||
"Sub roles - Tooltip": "Vai trò bao gồm trong kế hoạch hiện tại"
|
||||
},
|
||||
"pricing": {
|
||||
"Copy pricing page URL": "Sao chép URL trang bảng giá",
|
||||
"Edit Pricing": "Edit Pricing",
|
||||
"Free": "Miễn phí",
|
||||
"Getting started": "Bắt đầu",
|
||||
"Has trial": "Có thời gian thử nghiệm",
|
||||
"Has trial - Tooltip": "Khả dụng thời gian thử nghiệm sau khi chọn kế hoạch",
|
||||
"New Pricing": "New Pricing",
|
||||
"Sub plans": "Kế hoạch phụ",
|
||||
"Sub plans - Tooltip": "Sub plans - Tooltip",
|
||||
"Trial duration": "Thời gian thử nghiệm",
|
||||
"Trial duration - Tooltip": "Thời gian thử nghiệm",
|
||||
"days trial available!": "ngày dùng thử có sẵn!",
|
||||
"pricing page URL copied to clipboard successfully, please paste it into the incognito window or another browser": "URL trang bảng giá đã được sao chép vào clipboard thành công, vui lòng dán vào cửa sổ ẩn danh hoặc trình duyệt khác"
|
||||
},
|
||||
"product": {
|
||||
"Alipay": "Alipay",
|
||||
"Buy": "Comprar",
|
||||
@@ -536,7 +587,7 @@
|
||||
"There is no payment channel for this product.": "Não há canal de pagamento disponível para este produto.",
|
||||
"This product is currently not in sale.": "Este produto não está disponível para venda no momento.",
|
||||
"USD": "USD",
|
||||
"WeChat Pay": "WeChat Pay"
|
||||
"WeChat Pay": "WeChat Pay"
|
||||
},
|
||||
"provider": {
|
||||
"Access key": "Chave de acesso",
|
||||
@@ -664,7 +715,7 @@
|
||||
"Type - Tooltip": "Selecione um tipo",
|
||||
"UserInfo URL": "URL do UserInfo",
|
||||
"UserInfo URL - Tooltip": "URL do UserInfo",
|
||||
"admin (Shared)": "admin (Compartilhado)"
|
||||
"admin (Shared)": "admin (Compartilhado)"
|
||||
},
|
||||
"record": {
|
||||
"Is triggered": "Foi acionado"
|
||||
@@ -720,6 +771,24 @@
|
||||
"Your confirmed password is inconsistent with the password!": "Sua senha confirmada não é consistente com a senha!",
|
||||
"sign in now": "Faça login agora"
|
||||
},
|
||||
"subscription": {
|
||||
"Approved": "Approved",
|
||||
"Duration": "Thời lượng",
|
||||
"Duration - Tooltip": "Thời lượng đăng ký",
|
||||
"Edit Subscription": "Edit Subscription",
|
||||
"End Date": "Ngày kết thúc",
|
||||
"End Date - Tooltip": "Ngày kết thúc",
|
||||
"New Subscription": "New Subscription",
|
||||
"Pending": "Pending",
|
||||
"Start Date": "Ngày bắt đầu",
|
||||
"Start Date - Tooltip": "Ngày bắt đầu",
|
||||
"Sub plan": "Kế hoạch đăng ký",
|
||||
"Sub plan - Tooltip": "Kế hoạch đăng ký",
|
||||
"Sub plane": "Sub plane",
|
||||
"Sub user": "Sub user",
|
||||
"Sub users": "Người dùng đăng ký",
|
||||
"Sub users - Tooltip": "Người dùng đăng ký"
|
||||
},
|
||||
"syncer": {
|
||||
"Affiliation table": "Tabela de Afiliação",
|
||||
"Affiliation table - Tooltip": "Nome da tabela no banco de dados da unidade de trabalho",
|
||||
@@ -785,92 +854,91 @@
|
||||
"New Token": "Novo Token",
|
||||
"Token type": "Tipo de Token"
|
||||
},
|
||||
"user":
|
||||
{
|
||||
"3rd-party logins": "Logins de terceiros",
|
||||
"3rd-party logins - Tooltip": "Logins sociais vinculados pelo usuário",
|
||||
"Address": "Endereço",
|
||||
"Address - Tooltip": "Endereço residencial",
|
||||
"Affiliation": "Afiliação",
|
||||
"Affiliation - Tooltip": "Empregador, como nome da empresa ou organização",
|
||||
"Bio": "Biografia",
|
||||
"Bio - Tooltip": "Autoapresentação do usuário",
|
||||
"Birthday": "Aniversário",
|
||||
"Birthday - Tooltip": "Aniversário - Tooltip",
|
||||
"Captcha Verify Failed": "Falha na verificação de captcha",
|
||||
"Captcha Verify Success": "Verificação de captcha bem-sucedida",
|
||||
"Country code": "Código do país",
|
||||
"Country/Region": "País/Região",
|
||||
"Country/Region - Tooltip": "País ou região",
|
||||
"Edit User": "Editar Usuário",
|
||||
"Education": "Educação",
|
||||
"Education - Tooltip": "Educação - Tooltip",
|
||||
"Email cannot be empty": "O e-mail não pode ficar em branco",
|
||||
"Email/phone reset successfully": "Redefinição de e-mail/telefone com sucesso",
|
||||
"Empty input!": "Entrada vazia!",
|
||||
"Gender": "Gênero",
|
||||
"Gender - Tooltip": "Gênero - Tooltip",
|
||||
"Homepage": "Página inicial",
|
||||
"Homepage - Tooltip": "URL da página inicial do usuário",
|
||||
"ID card": "Cartão de identidade",
|
||||
"ID card - Tooltip": "Cartão de identidade - Tooltip",
|
||||
"ID card type": "Tipo de cartão de identidade",
|
||||
"ID card type - Tooltip": "Tipo de cartão de identidade - Tooltip",
|
||||
"Input your email": "Digite seu e-mail",
|
||||
"Input your phone number": "Digite seu número de telefone",
|
||||
"Is admin": "É administrador",
|
||||
"Is admin - Tooltip": "É um administrador da organização à qual o usuário pertence",
|
||||
"Is deleted": "Foi excluído",
|
||||
"Is deleted - Tooltip": "Usuários excluídos somente mantêm registros no banco de dados e não podem realizar nenhuma operação",
|
||||
"Is forbidden": "Está proibido",
|
||||
"Is forbidden - Tooltip": "Usuários proibidos não podem fazer login novamente",
|
||||
"Is global admin": "É administrador global",
|
||||
"Is global admin - Tooltip": "É um administrador do Casdoor",
|
||||
"Is online": "Está online",
|
||||
"Karma": "Karma",
|
||||
"Karma - Tooltip": "Karma - Tooltip",
|
||||
"Keys": "Chaves",
|
||||
"Language": "Idioma",
|
||||
"Language - Tooltip": "Idioma - Tooltip",
|
||||
"Link": "Link",
|
||||
"Location": "Localização",
|
||||
"Location - Tooltip": "Cidade de residência",
|
||||
"Managed accounts": "Contas gerenciadas",
|
||||
"Modify password...": "Modificar senha...",
|
||||
"Multi-factor authentication": "Autenticação de vários fatores",
|
||||
"New Email": "Novo E-mail",
|
||||
"New Password": "Nova Senha",
|
||||
"New User": "Novo Usuário",
|
||||
"New phone": "Novo telefone",
|
||||
"Old Password": "Senha Antiga",
|
||||
"Password set successfully": "Senha definida com sucesso",
|
||||
"Phone cannot be empty": "O telefone não pode ficar vazio",
|
||||
"Please select avatar from resources": "Selecione um avatar dos recursos",
|
||||
"Properties": "Propriedades",
|
||||
"Properties - Tooltip": "Propriedades do usuário",
|
||||
"Ranking": "Classificação",
|
||||
"Ranking - Tooltip": "Classificação - Tooltip",
|
||||
"Re-enter New": "Digite Novamente",
|
||||
"Reset Email...": "Redefinir E-mail...",
|
||||
"Reset Phone...": "Redefinir Telefone...",
|
||||
"Score": "Pontuação",
|
||||
"Score - Tooltip": "Pontuação - Tooltip",
|
||||
"Select a photo...": "Selecionar uma foto...",
|
||||
"Set Password": "Definir Senha",
|
||||
"Set new profile picture": "Definir nova foto de perfil",
|
||||
"Set password...": "Definir senha...",
|
||||
"Tag": "Tag",
|
||||
"Tag - Tooltip": "Tag do usuário",
|
||||
"Title": "Título",
|
||||
"Title - Tooltip": "Cargo na afiliação",
|
||||
"Two passwords you typed do not match.": "As duas senhas digitadas não coincidem.",
|
||||
"Unlink": "Desvincular",
|
||||
"Upload (.xlsx)": "Enviar (.xlsx)",
|
||||
"Upload a photo": "Enviar uma foto",
|
||||
"Values": "Valores",
|
||||
"Verification code sent": "Código de verificação enviado",
|
||||
"WebAuthn credentials": "Credenciais WebAuthn",
|
||||
"input password": "Digite a senha"
|
||||
"user": {
|
||||
"3rd-party logins": "Logins de terceiros",
|
||||
"3rd-party logins - Tooltip": "Logins sociais vinculados pelo usuário",
|
||||
"Address": "Endereço",
|
||||
"Address - Tooltip": "Endereço residencial",
|
||||
"Affiliation": "Afiliação",
|
||||
"Affiliation - Tooltip": "Empregador, como nome da empresa ou organização",
|
||||
"Bio": "Biografia",
|
||||
"Bio - Tooltip": "Autoapresentação do usuário",
|
||||
"Birthday": "Aniversário",
|
||||
"Birthday - Tooltip": "Aniversário - Tooltip",
|
||||
"Captcha Verify Failed": "Falha na verificação de captcha",
|
||||
"Captcha Verify Success": "Verificação de captcha bem-sucedida",
|
||||
"Country code": "Código do país",
|
||||
"Country/Region": "País/Região",
|
||||
"Country/Region - Tooltip": "País ou região",
|
||||
"Edit User": "Editar Usuário",
|
||||
"Education": "Educação",
|
||||
"Education - Tooltip": "Educação - Tooltip",
|
||||
"Email cannot be empty": "O e-mail não pode ficar em branco",
|
||||
"Email/phone reset successfully": "Redefinição de e-mail/telefone com sucesso",
|
||||
"Empty input!": "Entrada vazia!",
|
||||
"Gender": "Gênero",
|
||||
"Gender - Tooltip": "Gênero - Tooltip",
|
||||
"Homepage": "Página inicial",
|
||||
"Homepage - Tooltip": "URL da página inicial do usuário",
|
||||
"ID card": "Cartão de identidade",
|
||||
"ID card - Tooltip": "Cartão de identidade - Tooltip",
|
||||
"ID card type": "Tipo de cartão de identidade",
|
||||
"ID card type - Tooltip": "Tipo de cartão de identidade - Tooltip",
|
||||
"Input your email": "Digite seu e-mail",
|
||||
"Input your phone number": "Digite seu número de telefone",
|
||||
"Is admin": "É administrador",
|
||||
"Is admin - Tooltip": "É um administrador da organização à qual o usuário pertence",
|
||||
"Is deleted": "Foi excluído",
|
||||
"Is deleted - Tooltip": "Usuários excluídos somente mantêm registros no banco de dados e não podem realizar nenhuma operação",
|
||||
"Is forbidden": "Está proibido",
|
||||
"Is forbidden - Tooltip": "Usuários proibidos não podem fazer login novamente",
|
||||
"Is global admin": "É administrador global",
|
||||
"Is global admin - Tooltip": "É um administrador do Casdoor",
|
||||
"Is online": "Está online",
|
||||
"Karma": "Karma",
|
||||
"Karma - Tooltip": "Karma - Tooltip",
|
||||
"Keys": "Chaves",
|
||||
"Language": "Idioma",
|
||||
"Language - Tooltip": "Idioma - Tooltip",
|
||||
"Link": "Link",
|
||||
"Location": "Localização",
|
||||
"Location - Tooltip": "Cidade de residência",
|
||||
"Managed accounts": "Contas gerenciadas",
|
||||
"Modify password...": "Modificar senha...",
|
||||
"Multi-factor authentication": "Autenticação de vários fatores",
|
||||
"New Email": "Novo E-mail",
|
||||
"New Password": "Nova Senha",
|
||||
"New User": "Novo Usuário",
|
||||
"New phone": "Novo telefone",
|
||||
"Old Password": "Senha Antiga",
|
||||
"Password set successfully": "Senha definida com sucesso",
|
||||
"Phone cannot be empty": "O telefone não pode ficar vazio",
|
||||
"Please select avatar from resources": "Selecione um avatar dos recursos",
|
||||
"Properties": "Propriedades",
|
||||
"Properties - Tooltip": "Propriedades do usuário",
|
||||
"Ranking": "Classificação",
|
||||
"Ranking - Tooltip": "Classificação - Tooltip",
|
||||
"Re-enter New": "Digite Novamente",
|
||||
"Reset Email...": "Redefinir E-mail...",
|
||||
"Reset Phone...": "Redefinir Telefone...",
|
||||
"Score": "Pontuação",
|
||||
"Score - Tooltip": "Pontuação - Tooltip",
|
||||
"Select a photo...": "Selecionar uma foto...",
|
||||
"Set Password": "Definir Senha",
|
||||
"Set new profile picture": "Definir nova foto de perfil",
|
||||
"Set password...": "Definir senha...",
|
||||
"Tag": "Tag",
|
||||
"Tag - Tooltip": "Tag do usuário",
|
||||
"Title": "Título",
|
||||
"Title - Tooltip": "Cargo na afiliação",
|
||||
"Two passwords you typed do not match.": "As duas senhas digitadas não coincidem.",
|
||||
"Unlink": "Desvincular",
|
||||
"Upload (.xlsx)": "Enviar (.xlsx)",
|
||||
"Upload a photo": "Enviar uma foto",
|
||||
"Values": "Valores",
|
||||
"Verification code sent": "Código de verificação enviado",
|
||||
"WebAuthn credentials": "Credenciais WebAuthn",
|
||||
"input password": "Digite a senha"
|
||||
},
|
||||
"webhook": {
|
||||
"Content type": "Tipo de conteúdo",
|
||||
|
@@ -56,14 +56,16 @@
|
||||
"Grant types": "Типы грантов",
|
||||
"Grant types - Tooltip": "Выберите, какие типы грантов разрешены в протоколе OAuth",
|
||||
"Incremental": "Incremental",
|
||||
"Input": "Input",
|
||||
"Left": "Левый",
|
||||
"Logged in successfully": "Успешный вход в систему",
|
||||
"Logged out successfully": "Успешный выход из системы",
|
||||
"New Application": "Новое приложение",
|
||||
"No verification": "No verification",
|
||||
"None": "Никакой",
|
||||
"Normal": "Normal",
|
||||
"Only signup": "Only signup",
|
||||
"Org choice mode": "Org choice mode",
|
||||
"Org choice mode - Tooltip": "Org choice mode - Tooltip",
|
||||
"Please input your application!": "Пожалуйста, введите свою заявку!",
|
||||
"Please input your organization!": "Пожалуйста, введите название вашей организации!",
|
||||
"Please select a HTML file": "Пожалуйста, выберите файл HTML",
|
||||
@@ -82,6 +84,7 @@
|
||||
"SAML metadata - Tooltip": "Метаданные протокола SAML",
|
||||
"SAML metadata URL copied to clipboard successfully": "URL метаданных SAML успешно скопирован в буфер обмена",
|
||||
"SAML reply URL": "URL ответа SAML",
|
||||
"Select": "Select",
|
||||
"Side panel HTML": "Боковая панель HTML",
|
||||
"Side panel HTML - Edit": "Боковая панель HTML - Редактировать",
|
||||
"Side panel HTML - Tooltip": "Настроить HTML-код для боковой панели страницы входа в систему",
|
||||
@@ -167,8 +170,13 @@
|
||||
"Affiliation URL": "URL принадлежности",
|
||||
"Affiliation URL - Tooltip": "URL домашней страницы для аффилированности",
|
||||
"Application": "Приложение",
|
||||
"Application - Tooltip": "Application - Tooltip",
|
||||
"Applications": "Приложения",
|
||||
"Applications that require authentication": "Приложения, которые требуют аутентификации",
|
||||
"Approve time": "Approve time",
|
||||
"Approve time - Tooltip": "Approve time - Tooltip",
|
||||
"Approver": "Approver",
|
||||
"Approver - Tooltip": "Approver - Tooltip",
|
||||
"Avatar": "Аватар",
|
||||
"Avatar - Tooltip": "Публичное изображение аватара пользователя",
|
||||
"Back": "Back",
|
||||
@@ -182,6 +190,7 @@
|
||||
"Click to Upload": "Нажмите, чтобы загрузить",
|
||||
"Client IP": "Клиентский IP",
|
||||
"Close": "Близко",
|
||||
"Confirm": "Confirm",
|
||||
"Created time": "Созданное время",
|
||||
"Default application": "Приложение по умолчанию",
|
||||
"Default application - Tooltip": "По умолчанию приложение для пользователей, зарегистрированных непосредственно со страницы организации",
|
||||
@@ -226,6 +235,8 @@
|
||||
"Last name": "Фамилия",
|
||||
"Logo": "Логотип",
|
||||
"Logo - Tooltip": "Иконки, которые приложение представляет во внешний мир",
|
||||
"MFA items": "MFA items",
|
||||
"MFA items - Tooltip": "MFA items - Tooltip",
|
||||
"Master password": "Главный пароль",
|
||||
"Master password - Tooltip": "Можно использовать для входа в учетные записи всех пользователей этой организации, что удобно для администраторов, чтобы войти в качестве этого пользователя и решить технические проблемы",
|
||||
"Menu": "Меню",
|
||||
@@ -236,6 +247,7 @@
|
||||
"Models": "Модели",
|
||||
"Name": "Имя",
|
||||
"Name - Tooltip": "Уникальный идентификатор на основе строки",
|
||||
"None": "None",
|
||||
"OAuth providers": "Провайдеры OAuth",
|
||||
"OK": "OK - Хорошо",
|
||||
"Organization": "Организация",
|
||||
@@ -253,8 +265,10 @@
|
||||
"Phone": "Телефон",
|
||||
"Phone - Tooltip": "Номер телефона",
|
||||
"Phone or email": "Phone or email",
|
||||
"Plans": "Планы",
|
||||
"Preview": "Предварительный просмотр",
|
||||
"Preview - Tooltip": "Предварительный просмотр настроенных эффектов",
|
||||
"Pricings": "Тарифы",
|
||||
"Products": "Продукты",
|
||||
"Provider": "Провайдер",
|
||||
"Provider - Tooltip": "Провайдеры платежей должны быть настроены, включая PayPal, Alipay, WeChat Pay и т.д.",
|
||||
@@ -281,6 +295,9 @@
|
||||
"Sorry, you do not have permission to access this page or logged in status invalid.": "К сожалению, у вас нет разрешения на доступ к этой странице или ваш статус входа недействителен.",
|
||||
"State": "Государство",
|
||||
"State - Tooltip": "Государство",
|
||||
"Submitter": "Submitter",
|
||||
"Submitter - Tooltip": "Submitter - Tooltip",
|
||||
"Subscriptions": "Подписки",
|
||||
"Successfully added": "Успешно добавлено",
|
||||
"Successfully deleted": "Успешно удалено",
|
||||
"Successfully saved": "Успешно сохранено",
|
||||
@@ -351,8 +368,12 @@
|
||||
"Or sign in with another account": "Или войти с другой учетной записью",
|
||||
"Please input your Email or Phone!": "Пожалуйста, введите свой адрес электронной почты или номер телефона!",
|
||||
"Please input your code!": "Пожалуйста, введите свой код!",
|
||||
"Please input your organization name!": "Please input your organization name!",
|
||||
"Please input your password!": "Пожалуйста, введите свой пароль!",
|
||||
"Please input your password, at least 6 characters!": "Пожалуйста, введите свой пароль, длина должна быть не менее 6 символов!",
|
||||
"Please select an organization": "Please select an organization",
|
||||
"Please select an organization to sign in": "Please select an organization to sign in",
|
||||
"Please type an organization to sign in": "Please type an organization to sign in",
|
||||
"Redirecting, please wait.": "Перенаправление, пожалуйста, подождите.",
|
||||
"Sign In": "Войти",
|
||||
"Sign in with WebAuthn": "Войти с помощью WebAuthn",
|
||||
@@ -423,6 +444,8 @@
|
||||
"Is profile public - Tooltip": "После закрытия страницы профиля, только глобальные администраторы или пользователи из той же организации могут получить к ней доступ",
|
||||
"Modify rule": "Изменить правило",
|
||||
"New Organization": "Новая организация",
|
||||
"Optional": "Optional",
|
||||
"Required": "Required",
|
||||
"Soft deletion": "Мягкое удаление",
|
||||
"Soft deletion - Tooltip": "Когда включено, удаление пользователей не полностью удаляет их из базы данных. Вместо этого они будут помечены как удаленные",
|
||||
"Tags": "Теги",
|
||||
@@ -503,6 +526,34 @@
|
||||
"TreeNode": "Узел дерева",
|
||||
"Write": "Написать"
|
||||
},
|
||||
"plan": {
|
||||
"Edit Plan": "Edit Plan",
|
||||
"New Plan": "New Plan",
|
||||
"PerMonth": "в месяц",
|
||||
"Price per month": "Price per month",
|
||||
"Price per year": "Price per year",
|
||||
"PricePerMonth": "Цена за месяц",
|
||||
"PricePerMonth - Tooltip": "PricePerMonth - Tooltip",
|
||||
"PricePerYear": "Цена за год",
|
||||
"PricePerYear - Tooltip": "PricePerYear - Tooltip",
|
||||
"Sub role": "Sub role",
|
||||
"Sub roles - Tooltip": "Роль, включенная в текущий план"
|
||||
},
|
||||
"pricing": {
|
||||
"Copy pricing page URL": "Скопировать URL прайс-листа",
|
||||
"Edit Pricing": "Edit Pricing",
|
||||
"Free": "Бесплатно",
|
||||
"Getting started": "Выьрать план",
|
||||
"Has trial": "Есть пробный период",
|
||||
"Has trial - Tooltip": "Наличие пробного периода после выбора плана",
|
||||
"New Pricing": "New Pricing",
|
||||
"Sub plans": "Тарифные планы",
|
||||
"Sub plans - Tooltip": "Sub plans - Tooltip",
|
||||
"Trial duration": "Продолжительность пробного периода",
|
||||
"Trial duration - Tooltip": "Продолжительность пробного периода",
|
||||
"days trial available!": "дней пробного периода доступно!",
|
||||
"pricing page URL copied to clipboard successfully, please paste it into the incognito window or another browser": "URL страницы прайс-листа успешно скопирован в буфер обмена, пожалуйста, вставьте его в режиме инкогнито или другом браузере"
|
||||
},
|
||||
"product": {
|
||||
"Alipay": "Alipay",
|
||||
"Buy": "Купить",
|
||||
@@ -720,6 +771,24 @@
|
||||
"Your confirmed password is inconsistent with the password!": "Ваш подтвержденный пароль не соответствует паролю!",
|
||||
"sign in now": "войти сейчас"
|
||||
},
|
||||
"subscription": {
|
||||
"Approved": "Approved",
|
||||
"Duration": "Продолжительность",
|
||||
"Duration - Tooltip": "Продолжительность подписки",
|
||||
"Edit Subscription": "Edit Subscription",
|
||||
"End Date": "Дата окончания",
|
||||
"End Date - Tooltip": "Дата окончания",
|
||||
"New Subscription": "New Subscription",
|
||||
"Pending": "Pending",
|
||||
"Start Date": "Дата начала",
|
||||
"Start Date - Tooltip": "Дата начала",
|
||||
"Sub plan": "План подписки",
|
||||
"Sub plan - Tooltip": "План подписки",
|
||||
"Sub plane": "Sub plane",
|
||||
"Sub user": "Sub user",
|
||||
"Sub users": "Пользователь подписки",
|
||||
"Sub users - Tooltip": "Пользователь которому офомлена подписка"
|
||||
},
|
||||
"syncer": {
|
||||
"Affiliation table": "Таблица принадлежности",
|
||||
"Affiliation table - Tooltip": "Имя таблицы базы данных рабочей единицы",
|
||||
|
@@ -56,14 +56,16 @@
|
||||
"Grant types": "Loại hỗ trợ",
|
||||
"Grant types - Tooltip": "Chọn loại hỗ trợ được cho phép trong giao thức OAuth",
|
||||
"Incremental": "Incremental",
|
||||
"Input": "Input",
|
||||
"Left": "Trái",
|
||||
"Logged in successfully": "Đăng nhập thành công",
|
||||
"Logged out successfully": "Đã đăng xuất thành công",
|
||||
"New Application": "Ứng dụng mới",
|
||||
"No verification": "No verification",
|
||||
"None": "Không có gì",
|
||||
"Normal": "Normal",
|
||||
"Only signup": "Only signup",
|
||||
"Org choice mode": "Org choice mode",
|
||||
"Org choice mode - Tooltip": "Org choice mode - Tooltip",
|
||||
"Please input your application!": "Vui lòng nhập đơn của bạn!",
|
||||
"Please input your organization!": "Vui lòng nhập tên tổ chức của bạn!",
|
||||
"Please select a HTML file": "Vui lòng chọn tệp HTML",
|
||||
@@ -82,6 +84,7 @@
|
||||
"SAML metadata - Tooltip": "Các siêu dữ liệu của giao thức SAML",
|
||||
"SAML metadata URL copied to clipboard successfully": "URL metadata SAML đã được sao chép vào bộ nhớ tạm thành công",
|
||||
"SAML reply URL": "URL phản hồi SAML",
|
||||
"Select": "Select",
|
||||
"Side panel HTML": "Bảng điều khiển HTML bên lề",
|
||||
"Side panel HTML - Edit": "Bảng Panel Bên - Chỉnh sửa HTML",
|
||||
"Side panel HTML - Tooltip": "Tùy chỉnh mã HTML cho bảng điều khiển bên của trang đăng nhập",
|
||||
@@ -167,8 +170,13 @@
|
||||
"Affiliation URL": "Đường dẫn liên kết liên kết",
|
||||
"Affiliation URL - Tooltip": "Đường dẫn URL trang chủ của liên kết",
|
||||
"Application": "Ứng dụng",
|
||||
"Application - Tooltip": "Application - Tooltip",
|
||||
"Applications": "Ứng dụng",
|
||||
"Applications that require authentication": "Các ứng dụng yêu cầu xác thực",
|
||||
"Approve time": "Approve time",
|
||||
"Approve time - Tooltip": "Approve time - Tooltip",
|
||||
"Approver": "Approver",
|
||||
"Approver - Tooltip": "Approver - Tooltip",
|
||||
"Avatar": "Ảnh đại diện",
|
||||
"Avatar - Tooltip": "Ảnh đại diện công khai cho người dùng",
|
||||
"Back": "Back",
|
||||
@@ -182,6 +190,7 @@
|
||||
"Click to Upload": "Nhấp để tải lên",
|
||||
"Client IP": "Địa chỉ IP của khách hàng",
|
||||
"Close": "Đóng lại",
|
||||
"Confirm": "Confirm",
|
||||
"Created time": "Thời gian tạo",
|
||||
"Default application": "Ứng dụng mặc định",
|
||||
"Default application - Tooltip": "Ứng dụng mặc định cho người dùng đăng ký trực tiếp từ trang tổ chức",
|
||||
@@ -226,6 +235,8 @@
|
||||
"Last name": "Họ",
|
||||
"Logo": "Logo",
|
||||
"Logo - Tooltip": "Biểu tượng mà ứng dụng hiển thị ra ngoài thế giới",
|
||||
"MFA items": "MFA items",
|
||||
"MFA items - Tooltip": "MFA items - Tooltip",
|
||||
"Master password": "Mật khẩu chính",
|
||||
"Master password - Tooltip": "Có thể được sử dụng để đăng nhập vào tất cả các người dùng trong tổ chức này, giúp cho quản trị viên dễ dàng đăng nhập với tư cách người dùng này để giải quyết các vấn đề kỹ thuật",
|
||||
"Menu": "Thực đơn",
|
||||
@@ -236,6 +247,7 @@
|
||||
"Models": "Mô hình",
|
||||
"Name": "Tên",
|
||||
"Name - Tooltip": "ID duy nhất dựa trên chuỗi",
|
||||
"None": "None",
|
||||
"OAuth providers": "Cung cấp OAuth",
|
||||
"OK": "Được rồi",
|
||||
"Organization": "Tổ chức",
|
||||
@@ -253,8 +265,10 @@
|
||||
"Phone": "Điện thoại",
|
||||
"Phone - Tooltip": "Số điện thoại",
|
||||
"Phone or email": "Phone or email",
|
||||
"Plans": "Kế hoạch",
|
||||
"Preview": "Xem trước",
|
||||
"Preview - Tooltip": "Xem trước các hiệu ứng đã cấu hình",
|
||||
"Pricings": "Bảng giá",
|
||||
"Products": "Sản phẩm",
|
||||
"Provider": "Nhà cung cấp",
|
||||
"Provider - Tooltip": "Cung cấp thanh toán được cấu hình, bao gồm PayPal, Alipay, WeChat Pay, vv.",
|
||||
@@ -281,6 +295,9 @@
|
||||
"Sorry, you do not have permission to access this page or logged in status invalid.": "Xin lỗi, bạn không có quyền truy cập trang này hoặc trạng thái đăng nhập không hợp lệ.",
|
||||
"State": "Nhà nước",
|
||||
"State - Tooltip": "Trạng thái",
|
||||
"Submitter": "Submitter",
|
||||
"Submitter - Tooltip": "Submitter - Tooltip",
|
||||
"Subscriptions": "Đăng ký",
|
||||
"Successfully added": "Đã thêm thành công",
|
||||
"Successfully deleted": "Đã xóa thành công",
|
||||
"Successfully saved": "Thành công đã được lưu lại",
|
||||
@@ -351,8 +368,12 @@
|
||||
"Or sign in with another account": "Hoặc đăng nhập bằng tài khoản khác",
|
||||
"Please input your Email or Phone!": "Vui lòng nhập địa chỉ Email hoặc số điện thoại của bạn!",
|
||||
"Please input your code!": "Vui lòng nhập mã của bạn!",
|
||||
"Please input your organization name!": "Please input your organization name!",
|
||||
"Please input your password!": "Vui lòng nhập mật khẩu của bạn!",
|
||||
"Please input your password, at least 6 characters!": "Vui lòng nhập mật khẩu của bạn, ít nhất 6 ký tự!",
|
||||
"Please select an organization": "Please select an organization",
|
||||
"Please select an organization to sign in": "Please select an organization to sign in",
|
||||
"Please type an organization to sign in": "Please type an organization to sign in",
|
||||
"Redirecting, please wait.": "Đang chuyển hướng, vui lòng đợi.",
|
||||
"Sign In": "Đăng nhập",
|
||||
"Sign in with WebAuthn": "Đăng nhập với WebAuthn",
|
||||
@@ -423,6 +444,8 @@
|
||||
"Is profile public - Tooltip": "Sau khi đóng lại, chỉ các quản trị viên toàn cầu hoặc người dùng trong cùng tổ chức mới có thể truy cập trang hồ sơ người dùng",
|
||||
"Modify rule": "Sửa đổi quy tắc",
|
||||
"New Organization": "Tổ chức mới",
|
||||
"Optional": "Optional",
|
||||
"Required": "Required",
|
||||
"Soft deletion": "Xóa mềm",
|
||||
"Soft deletion - Tooltip": "Khi được bật, việc xóa người dùng sẽ không hoàn toàn loại bỏ họ khỏi cơ sở dữ liệu. Thay vào đó, họ sẽ được đánh dấu là đã bị xóa",
|
||||
"Tags": "Thẻ",
|
||||
@@ -503,6 +526,34 @@
|
||||
"TreeNode": "Nút của cây",
|
||||
"Write": "Viết"
|
||||
},
|
||||
"plan": {
|
||||
"Edit Plan": "Edit Plan",
|
||||
"New Plan": "New Plan",
|
||||
"PerMonth": "mỗi tháng",
|
||||
"Price per month": "Price per month",
|
||||
"Price per year": "Price per year",
|
||||
"PricePerMonth": "Giá mỗi tháng",
|
||||
"PricePerMonth - Tooltip": "PricePerMonth - Tooltip",
|
||||
"PricePerYear": "Giá mỗi năm",
|
||||
"PricePerYear - Tooltip": "PricePerYear - Tooltip",
|
||||
"Sub role": "Sub role",
|
||||
"Sub roles - Tooltip": "Vai trò bao gồm trong kế hoạch hiện tại"
|
||||
},
|
||||
"pricing": {
|
||||
"Copy pricing page URL": "Sao chép URL trang bảng giá",
|
||||
"Edit Pricing": "Edit Pricing",
|
||||
"Free": "Miễn phí",
|
||||
"Getting started": "Bắt đầu",
|
||||
"Has trial": "Có thời gian thử nghiệm",
|
||||
"Has trial - Tooltip": "Khả dụng thời gian thử nghiệm sau khi chọn kế hoạch",
|
||||
"New Pricing": "New Pricing",
|
||||
"Sub plans": "Kế hoạch phụ",
|
||||
"Sub plans - Tooltip": "Sub plans - Tooltip",
|
||||
"Trial duration": "Thời gian thử nghiệm",
|
||||
"Trial duration - Tooltip": "Thời gian thử nghiệm",
|
||||
"days trial available!": "ngày dùng thử có sẵn!",
|
||||
"pricing page URL copied to clipboard successfully, please paste it into the incognito window or another browser": "URL trang bảng giá đã được sao chép vào clipboard thành công, vui lòng dán vào cửa sổ ẩn danh hoặc trình duyệt khác"
|
||||
},
|
||||
"product": {
|
||||
"Alipay": "Alipay",
|
||||
"Buy": "Mua",
|
||||
@@ -720,6 +771,24 @@
|
||||
"Your confirmed password is inconsistent with the password!": "Mật khẩu xác nhận của bạn không khớp với mật khẩu đã nhập!",
|
||||
"sign in now": "Đăng nhập ngay bây giờ"
|
||||
},
|
||||
"subscription": {
|
||||
"Approved": "Approved",
|
||||
"Duration": "Thời lượng",
|
||||
"Duration - Tooltip": "Thời lượng đăng ký",
|
||||
"Edit Subscription": "Edit Subscription",
|
||||
"End Date": "Ngày kết thúc",
|
||||
"End Date - Tooltip": "Ngày kết thúc",
|
||||
"New Subscription": "New Subscription",
|
||||
"Pending": "Pending",
|
||||
"Start Date": "Ngày bắt đầu",
|
||||
"Start Date - Tooltip": "Ngày bắt đầu",
|
||||
"Sub plan": "Kế hoạch đăng ký",
|
||||
"Sub plan - Tooltip": "Kế hoạch đăng ký",
|
||||
"Sub plane": "Sub plane",
|
||||
"Sub user": "Sub user",
|
||||
"Sub users": "Người dùng đăng ký",
|
||||
"Sub users - Tooltip": "Người dùng đăng ký"
|
||||
},
|
||||
"syncer": {
|
||||
"Affiliation table": "Bảng liên kết",
|
||||
"Affiliation table - Tooltip": "Tên bảng cơ sở dữ liệu của đơn vị làm việc",
|
||||
|
@@ -56,14 +56,16 @@
|
||||
"Grant types": "OAuth授权类型",
|
||||
"Grant types - Tooltip": "选择允许哪些OAuth协议中的grant types",
|
||||
"Incremental": "递增",
|
||||
"Input": "输入",
|
||||
"Left": "居左",
|
||||
"Logged in successfully": "登录成功",
|
||||
"Logged out successfully": "登出成功",
|
||||
"New Application": "添加应用",
|
||||
"No verification": "不校验",
|
||||
"None": "关闭",
|
||||
"Normal": "标准",
|
||||
"Only signup": "仅注册",
|
||||
"Org choice mode": "组织选择模式",
|
||||
"Org choice mode - Tooltip": "采用什么方式选择要登录的组织",
|
||||
"Please input your application!": "请输入你的应用",
|
||||
"Please input your organization!": "请输入你的组织",
|
||||
"Please select a HTML file": "请选择一个HTML文件",
|
||||
@@ -82,6 +84,7 @@
|
||||
"SAML metadata - Tooltip": "SAML协议的元数据(Metadata)信息",
|
||||
"SAML metadata URL copied to clipboard successfully": "SAML元数据URL已成功复制到剪贴板",
|
||||
"SAML reply URL": "SAML回复 URL",
|
||||
"Select": "选择",
|
||||
"Side panel HTML": "侧面板HTML",
|
||||
"Side panel HTML - Edit": "侧面板HTML - 编辑",
|
||||
"Side panel HTML - Tooltip": "自定义登录页面侧面板的HTML代码",
|
||||
@@ -167,8 +170,13 @@
|
||||
"Affiliation URL": "工作单位URL",
|
||||
"Affiliation URL - Tooltip": "工作单位的官网URL",
|
||||
"Application": "应用",
|
||||
"Application - Tooltip": "Application - Tooltip",
|
||||
"Applications": "应用",
|
||||
"Applications that require authentication": "需要认证和鉴权的应用",
|
||||
"Approve time": "Approve time",
|
||||
"Approve time - Tooltip": "Approve time - Tooltip",
|
||||
"Approver": "Approver",
|
||||
"Approver - Tooltip": "Approver - Tooltip",
|
||||
"Avatar": "头像",
|
||||
"Avatar - Tooltip": "公开展示的用户头像",
|
||||
"Back": "返回",
|
||||
@@ -182,6 +190,7 @@
|
||||
"Click to Upload": "点击上传",
|
||||
"Client IP": "客户端IP",
|
||||
"Close": "关闭",
|
||||
"Confirm": "确认",
|
||||
"Created time": "创建时间",
|
||||
"Default application": "默认应用",
|
||||
"Default application - Tooltip": "直接从组织页面注册的用户默认所属的应用",
|
||||
@@ -226,6 +235,8 @@
|
||||
"Last name": "姓氏",
|
||||
"Logo": "Logo",
|
||||
"Logo - Tooltip": "应用程序向外展示的图标",
|
||||
"MFA items": "MFA 项",
|
||||
"MFA items - Tooltip": "MFA 项 - Tooltip",
|
||||
"Master password": "万能密码",
|
||||
"Master password - Tooltip": "可用来登录该组织下的所有用户,方便管理员以该用户身份登录,以解决技术问题",
|
||||
"Menu": "目录",
|
||||
@@ -236,6 +247,7 @@
|
||||
"Models": "模型",
|
||||
"Name": "名称",
|
||||
"Name - Tooltip": "唯一的、字符串式的ID",
|
||||
"None": "无",
|
||||
"OAuth providers": "OAuth提供方",
|
||||
"OK": "OK",
|
||||
"Organization": "组织",
|
||||
@@ -253,8 +265,10 @@
|
||||
"Phone": "手机号",
|
||||
"Phone - Tooltip": "手机号",
|
||||
"Phone or email": "手机或邮箱",
|
||||
"Plans": "计划",
|
||||
"Preview": "预览",
|
||||
"Preview - Tooltip": "可预览所配置的效果",
|
||||
"Pricings": "定价",
|
||||
"Products": "商品",
|
||||
"Provider": "提供商",
|
||||
"Provider - Tooltip": "需要配置的支付提供商,包括PayPal、支付宝、微信支付等",
|
||||
@@ -281,6 +295,9 @@
|
||||
"Sorry, you do not have permission to access this page or logged in status invalid.": "抱歉,您无权访问该页面或登录状态失效",
|
||||
"State": "状态",
|
||||
"State - Tooltip": "状态",
|
||||
"Submitter": "Submitter",
|
||||
"Submitter - Tooltip": "Submitter - Tooltip",
|
||||
"Subscriptions": "订阅",
|
||||
"Successfully added": "添加成功",
|
||||
"Successfully deleted": "删除成功",
|
||||
"Successfully saved": "保存成功",
|
||||
@@ -351,8 +368,12 @@
|
||||
"Or sign in with another account": "或者,登录其他账号",
|
||||
"Please input your Email or Phone!": "请输入您的Email或手机号!",
|
||||
"Please input your code!": "请输入您的验证码!",
|
||||
"Please input your organization name!": "请输入组织的名字!",
|
||||
"Please input your password!": "请输入您的密码!",
|
||||
"Please input your password, at least 6 characters!": "请输入您的密码,不少于6位",
|
||||
"Please select an organization": "请选择一个组织",
|
||||
"Please select an organization to sign in": "请选择要登录的组织",
|
||||
"Please type an organization to sign in": "请输入要登录的组织",
|
||||
"Redirecting, please wait.": "正在跳转, 请稍等.",
|
||||
"Sign In": "登录",
|
||||
"Sign in with WebAuthn": "WebAuthn登录",
|
||||
@@ -423,6 +444,8 @@
|
||||
"Is profile public - Tooltip": "关闭后只有全局管理员或同组织用户才能访问用户主页",
|
||||
"Modify rule": "修改规则",
|
||||
"New Organization": "添加组织",
|
||||
"Optional": "可选",
|
||||
"Required": "必须",
|
||||
"Soft deletion": "软删除",
|
||||
"Soft deletion - Tooltip": "启用后,删除一个用户时不会在数据库彻底清除,只会标记为已删除状态",
|
||||
"Tags": "标签集合",
|
||||
@@ -503,6 +526,34 @@
|
||||
"TreeNode": "树节点",
|
||||
"Write": "写权限"
|
||||
},
|
||||
"plan": {
|
||||
"Edit Plan": "Edit Plan",
|
||||
"New Plan": "New Plan",
|
||||
"PerMonth": "每月",
|
||||
"Price per month": "Price per month",
|
||||
"Price per year": "Price per year",
|
||||
"PricePerMonth": "每月价格",
|
||||
"PricePerMonth - Tooltip": "PricePerMonth - Tooltip",
|
||||
"PricePerYear": "每年价格",
|
||||
"PricePerYear - Tooltip": "PricePerYear - Tooltip",
|
||||
"Sub role": "Sub role",
|
||||
"Sub roles - Tooltip": "当前计划中包含的角色"
|
||||
},
|
||||
"pricing": {
|
||||
"Copy pricing page URL": "复制定价页面链接",
|
||||
"Edit Pricing": "Edit Pricing",
|
||||
"Free": "免费",
|
||||
"Getting started": "开始使用",
|
||||
"Has trial": "有试用期",
|
||||
"Has trial - Tooltip": "选择计划后是否有试用期",
|
||||
"New Pricing": "New Pricing",
|
||||
"Sub plans": "附加计划",
|
||||
"Sub plans - Tooltip": "Sub plans - Tooltip",
|
||||
"Trial duration": "试用期时长",
|
||||
"Trial duration - Tooltip": "试用期时长",
|
||||
"days trial available!": "天试用期可用!",
|
||||
"pricing page URL copied to clipboard successfully, please paste it into the incognito window or another browser": "定价页面链接已成功复制到剪贴板,请粘贴到隐身窗口或其他浏览器中"
|
||||
},
|
||||
"product": {
|
||||
"Alipay": "支付宝",
|
||||
"Buy": "购买",
|
||||
@@ -720,6 +771,24 @@
|
||||
"Your confirmed password is inconsistent with the password!": "您两次输入的密码不一致!",
|
||||
"sign in now": "立即登录"
|
||||
},
|
||||
"subscription": {
|
||||
"Approved": "Approved",
|
||||
"Duration": "订阅时长",
|
||||
"Duration - Tooltip": "订阅时长",
|
||||
"Edit Subscription": "Edit Subscription",
|
||||
"End Date": "结束日期",
|
||||
"End Date - Tooltip": "结束日期",
|
||||
"New Subscription": "New Subscription",
|
||||
"Pending": "Pending",
|
||||
"Start Date": "开始日期",
|
||||
"Start Date - Tooltip": "开始日期",
|
||||
"Sub plan": "订阅计划",
|
||||
"Sub plan - Tooltip": "订阅计划",
|
||||
"Sub plane": "Sub plane",
|
||||
"Sub user": "Sub user",
|
||||
"Sub users": "订阅用户",
|
||||
"Sub users - Tooltip": "订阅用户"
|
||||
},
|
||||
"syncer": {
|
||||
"Affiliation table": "工作单位表",
|
||||
"Affiliation table - Tooltip": "工作单位的数据库表名",
|
||||
|
167
web/src/pricing/PricingPage.js
Normal file
167
web/src/pricing/PricingPage.js
Normal file
@@ -0,0 +1,167 @@
|
||||
// Copyright 2023 The Casdoor Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import React from "react";
|
||||
import {Card, Col, Row} from "antd";
|
||||
import * as PricingBackend from "../backend/PricingBackend";
|
||||
import * as PlanBackend from "../backend/PlanBackend";
|
||||
import CustomGithubCorner from "../common/CustomGithubCorner";
|
||||
import * as Setting from "../Setting";
|
||||
import SingleCard from "./SingleCard";
|
||||
import i18next from "i18next";
|
||||
|
||||
class PricingPage extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
classes: props,
|
||||
applications: null,
|
||||
pricingName: (props.pricingName ?? props.match?.params?.pricingName) ?? null,
|
||||
pricing: props.pricing,
|
||||
plans: null,
|
||||
loading: false,
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.setState({
|
||||
applications: [],
|
||||
});
|
||||
|
||||
if (this.state.pricing) {
|
||||
this.loadPlans();
|
||||
} else {
|
||||
this.loadPricing(this.state.pricingName);
|
||||
}
|
||||
this.setState({
|
||||
loading: true,
|
||||
});
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
if (this.state.pricing &&
|
||||
this.state.pricing.plans?.length !== this.state.plans?.length && !this.state.loading) {
|
||||
this.setState({loading: true});
|
||||
this.loadPlans();
|
||||
}
|
||||
}
|
||||
|
||||
loadPlans() {
|
||||
const plans = this.state.pricing.plans.map((plan) =>
|
||||
PlanBackend.getPlanById(plan, true));
|
||||
|
||||
Promise.all(plans)
|
||||
.then(results => {
|
||||
this.setState({
|
||||
plans: results,
|
||||
loading: false,
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
Setting.showMessage("error", `Failed to get plans: ${error}`);
|
||||
});
|
||||
}
|
||||
|
||||
loadPricing(pricingName) {
|
||||
if (pricingName === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
PricingBackend.getPricing("built-in", pricingName)
|
||||
.then((result) => {
|
||||
this.setState({
|
||||
loading: false,
|
||||
pricing: result,
|
||||
});
|
||||
this.onUpdatePricing(result);
|
||||
});
|
||||
}
|
||||
|
||||
onUpdatePricing(pricing) {
|
||||
this.props.onUpdatePricing(pricing);
|
||||
}
|
||||
|
||||
renderCards() {
|
||||
|
||||
const getUrlByPlan = (plan) => {
|
||||
const pricing = this.state.pricing;
|
||||
const signUpUrl = `/signup/${pricing.application}?plan=${plan}&pricing=${pricing.name}`;
|
||||
return `${window.location.origin}${signUpUrl}`;
|
||||
};
|
||||
|
||||
if (Setting.isMobile()) {
|
||||
return (
|
||||
<Card style={{border: "none"}} bodyStyle={{padding: 0}}>
|
||||
{
|
||||
this.state.plans.map(item => {
|
||||
return (
|
||||
<SingleCard link={getUrlByPlan(item.name)} key={item.name} plan={item} isSingle={this.state.plans.length === 1} />
|
||||
);
|
||||
})
|
||||
}
|
||||
</Card>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<div style={{marginRight: "15px", marginLeft: "15px"}}>
|
||||
<Row style={{justifyContent: "center"}} gutter={24}>
|
||||
{
|
||||
this.state.plans.map(item => {
|
||||
return (
|
||||
<SingleCard style={{marginRight: "5px", marginLeft: "5px"}} link={getUrlByPlan(item.name)} key={item.name} plan={item} isSingle={this.state.plans.length === 1} />
|
||||
);
|
||||
})
|
||||
}
|
||||
</Row>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.state.loading || this.state.plans === null || this.state.plans === undefined) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const pricing = this.state.pricing;
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<CustomGithubCorner />
|
||||
<div className="login-content">
|
||||
<div className="login-panel">
|
||||
<div className="login-form">
|
||||
<h1 style={{fontSize: "48px", marginTop: "0px", marginBottom: "15px"}}>{pricing.displayName}</h1>
|
||||
<span style={{fontSize: "20px"}}>{pricing.description}</span>
|
||||
<Row style={{width: "100%", marginTop: "40px"}}>
|
||||
<Col span={24} style={{display: "flex", justifyContent: "center"}} >
|
||||
{
|
||||
this.renderCards()
|
||||
}
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{justifyContent: "center"}}>
|
||||
{pricing && pricing.trialDuration > 0
|
||||
? <i>{i18next.t("pricing:Free")} {pricing.trialDuration}-{i18next.t("pricing:days trial available!")}</i>
|
||||
: null}
|
||||
</Row>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default PricingPage;
|
85
web/src/pricing/SingleCard.js
Normal file
85
web/src/pricing/SingleCard.js
Normal file
@@ -0,0 +1,85 @@
|
||||
// Copyright 2023 The Casdoor Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import i18next from "i18next";
|
||||
import React from "react";
|
||||
import {Button, Card, Col} from "antd";
|
||||
import * as Setting from "../Setting";
|
||||
import {withRouter} from "react-router-dom";
|
||||
|
||||
const {Meta} = Card;
|
||||
|
||||
class SingleCard extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
classes: props,
|
||||
};
|
||||
}
|
||||
|
||||
renderCard(plan, isSingle, link) {
|
||||
|
||||
return (
|
||||
<Col style={{minWidth: "320px", paddingLeft: "20px", paddingRight: "20px", paddingBottom: "20px", marginBottom: "20px", paddingTop: "0px"}} span={6}>
|
||||
<Card
|
||||
hoverable
|
||||
onClick={() => Setting.isMobile() ? window.location.href = link : null}
|
||||
style={isSingle ? {width: "320px", height: "100%"} : {width: "100%", height: "100%", paddingTop: "0px"}}
|
||||
>
|
||||
<div style={{textAlign: "right"}}>
|
||||
<h2
|
||||
style={{marginTop: "0px"}}>{plan.displayName}</h2>
|
||||
</div>
|
||||
|
||||
<div style={{textAlign: "left"}} className="px-10 mt-5">
|
||||
<span style={{fontWeight: 700, fontSize: "48px"}}>$ {plan.pricePerMonth}</span>
|
||||
<span style={{fontSize: "18px", fontWeight: 600, color: "gray"}}> {i18next.t("plan:PerMonth")}</span>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<div style={{textAlign: "left", fontSize: "18px"}}>
|
||||
<Meta description={plan.description} />
|
||||
</div>
|
||||
<br />
|
||||
<ul style={{listStyleType: "none", paddingLeft: "0px", textAlign: "left"}}>
|
||||
{(plan.options ?? []).map((option) => {
|
||||
// eslint-disable-next-line react/jsx-key
|
||||
return <li>
|
||||
<svg style={{height: "1rem", width: "1rem", fill: "green", marginRight: "10px"}} xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20">
|
||||
<path d="M0 11l2-2 5 5L18 3l2 2L7 18z"></path>
|
||||
</svg>
|
||||
<span style={{fontSize: "16px"}}>{option}</span>
|
||||
</li>;
|
||||
})}
|
||||
</ul>
|
||||
<div style={{minHeight: "60px"}}>
|
||||
|
||||
</div>
|
||||
<Button style={{width: "100%", position: "absolute", height: "50px", borderRadius: "0px", bottom: "0", left: "0"}} type="primary" key="subscribe" onClick={() => window.location.href = link}>
|
||||
{
|
||||
i18next.t("pricing:Getting started")
|
||||
}
|
||||
</Button>
|
||||
</Card>
|
||||
</Col>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
return this.renderCard(this.props.plan, this.props.isSingle, this.props.link);
|
||||
}
|
||||
}
|
||||
|
||||
export default withRouter(SingleCard);
|
@@ -188,7 +188,7 @@ class ProviderTable extends React.Component {
|
||||
onChange={value => {
|
||||
this.updateField(table, index, "rule", value);
|
||||
}} >
|
||||
<Option key="None" value="None">{i18next.t("application:None")}</Option>
|
||||
<Option key="None" value="None">{i18next.t("general:None")}</Option>
|
||||
<Option key="Dynamic" value="Dynamic">{i18next.t("application:Dynamic")}</Option>
|
||||
<Option key="Always" value="Always">{i18next.t("application:Always")}</Option>
|
||||
</Select>
|
||||
|
@@ -177,7 +177,7 @@ class SignupTable extends React.Component {
|
||||
];
|
||||
} else if (record.name === "Display name") {
|
||||
options = [
|
||||
{id: "None", name: i18next.t("application:None")},
|
||||
{id: "None", name: i18next.t("general:None")},
|
||||
{id: "Real name", name: i18next.t("application:Real name")},
|
||||
{id: "First, last", name: i18next.t("application:First, last")},
|
||||
];
|
||||
|
1124
web/yarn.lock
1124
web/yarn.lock
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user