Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
68994ac
feat: dashboard improvement #617
shuashuai Nov 13, 2023
89e918b
fix: default pop-up box displays the cancel button
shuashuai Nov 13, 2023
1975d0e
fix: add debounce to similar questions #616
shuashuai Nov 13, 2023
2169704
fix: escape the label slug to prevent url errors
shuashuai Nov 13, 2023
92911e3
feat(dashboard): add more information to dashboard
LinkinStars Nov 14, 2023
d736547
feat: allow admin can disable the default log in form #565
shuashuai Nov 14, 2023
913bd87
feat: add background color to comment area #575
shuashuai Nov 14, 2023
b454515
feat(siteinfo): add allow_password_login config
LinkinStars Nov 15, 2023
175c042
Feat/1.2.1/UI (#623)
shuashuai Nov 15, 2023
5a06b5d
fix: github links error
shuashuai Nov 15, 2023
498daa3
fix: login default value
shuashuai Nov 15, 2023
a17ce16
fix: resolve conflict
shuashuai Nov 15, 2023
def4d8c
feat(command): add config command to set default config
LinkinStars Nov 16, 2023
107316d
fix(user): update the length of user avatar field #620
LinkinStars Nov 16, 2023
c99b450
fix: upgrade ui eslint dependences
shuashuai Nov 17, 2023
ae95a95
fix: fix some ui bugs
shuashuai Nov 21, 2023
6a0432b
Feat/1.2.1/UI (#645)
shuashuai Nov 21, 2023
615d90f
fix: editor auto focus
shuashuai Nov 24, 2023
f770445
Feat/1.2.1/UI (#650)
shuashuai Nov 24, 2023
81ad54c
fix: the editor clicks the img button for the first time and it does …
shuashuai Nov 24, 2023
d598b16
Feat/1.2.1/UI (#654)
shuashuai Nov 24, 2023
5871488
fix: editor img btn props add editor instance
shuashuai Nov 24, 2023
75ad986
fix: change props name
shuashuai Nov 24, 2023
5bc5f3f
Feat/1.2.1/UI (#655)
shuashuai Nov 24, 2023
0e43082
refactor(collection): refactor collection
LinkinStars Nov 28, 2023
ac18f30
fix: bookmark params changed
shuashuai Nov 28, 2023
8ddaba8
Merge branch 'feat/1.2.1/dashboard' into test
LinkinStars Nov 29, 2023
619149f
fix: resolve conflict lock file
shuashuai Nov 29, 2023
1f8d08c
fix: update depedence
shuashuai Nov 29, 2023
7b709ec
support tag search for synonyms
kelvinkuo Nov 10, 2023
1389346
simply the GetTagPage logic
kelvinkuo Nov 14, 2023
72ff929
add default notification config for users registered by third party c…
hgaol Nov 15, 2023
f1e6af0
sort imports
hgaol Nov 17, 2023
b2de62d
Merge remote-tracking branch 'origin/main' into dev
LinkinStars Nov 29, 2023
42b4d74
Merge branch 'refactor/collection' into dev
LinkinStars Nov 29, 2023
1a7cbb7
docs(swagger): update swagger docs
LinkinStars Nov 29, 2023
3fc0b3b
Merge branch 'dev' into test
LinkinStars Nov 29, 2023
7a96ff5
feat: add logout page
shuashuai Dec 5, 2023
36827eb
fix(user): remove deleted user from ranking
LinkinStars Dec 5, 2023
2268774
fix: conflcit
shuashuai Dec 6, 2023
7d28759
fix: pnpm-lock
shuashuai Dec 6, 2023
088585e
docs(image): rename all docker image name to apache/answer
LinkinStars Nov 29, 2023
b72058d
fix: can't show tag description in tag edit page (#664)
hgaol Nov 30, 2023
d7136ba
fix: timeline page sort error
sy-records Dec 6, 2023
f0ebcaf
fix(activity): remove identical block fix #559
LinkinStars Dec 7, 2023
6f55ff7
Merge branch 'fix/1.2.1/user' into test
LinkinStars Dec 7, 2023
c81ea65
feat: (restrict) users can only write one answer to the same question…
hgaol Dec 13, 2023
9c7055b
Merge branch 'dev' into test
LinkinStars Dec 13, 2023
935ed47
feat(answer): add default restrict_answer config
LinkinStars Dec 13, 2023
ae6d98a
fix(siteinfo): set default login config
LinkinStars Dec 13, 2023
95cdace
fix: set restrict_answer default value true (#674)
shuashuai Dec 13, 2023
a637efa
Fix/UI restrict answer (#675)
shuashuai Dec 13, 2023
c14a1f6
Merge branch 'main' into dev
LinkinStars Dec 14, 2023
937f95d
Merge branch 'dev' into test
LinkinStars Dec 14, 2023
fad5da8
refactor(asf): add asf header
LinkinStars Dec 14, 2023
77a392c
docs(makefile): upgrade 1.2.1
LinkinStars Dec 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: build clean ui

VERSION=1.2.0
VERSION=1.2.1
BIN=answer
DIR_SRC=./cmd/answer
DOCKER_CMD=docker
Expand Down
38 changes: 37 additions & 1 deletion cmd/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ var (
// This config is used to upgrade the database from a specific version manually.
// If you want to upgrade the database to version 1.1.0, you can use `answer upgrade -f v1.1.0`.
upgradeVersion string
// The fields that need to be set to the default value
configFields []string
)

func init() {
Expand All @@ -60,7 +62,9 @@ func init() {

upgradeCmd.Flags().StringVarP(&upgradeVersion, "from", "f", "", "upgrade from specific version, eg: -f v1.1.0")

for _, cmd := range []*cobra.Command{initCmd, checkCmd, runCmd, dumpCmd, upgradeCmd, buildCmd, pluginCmd} {
configCmd.Flags().StringSliceVarP(&configFields, "with", "w", []string{}, "the fields that need to be set to the default value, eg: -w allow_password_login")

for _, cmd := range []*cobra.Command{initCmd, checkCmd, runCmd, dumpCmd, upgradeCmd, buildCmd, pluginCmd, configCmd} {
rootCmd.AddCommand(cmd)
}
}
Expand Down Expand Up @@ -231,6 +235,38 @@ To run answer, use:
})
},
}

// configCmd set some config to default value
configCmd = &cobra.Command{
Use: "config",
Short: "set some config to default value",
Long: `set some config to default value`,
Run: func(_ *cobra.Command, _ []string) {
cli.FormatAllPath(dataDirPath)

c, err := conf.ReadConfig(cli.GetConfigFilePath())
if err != nil {
fmt.Println("read config failed: ", err.Error())
return
}

field := &cli.ConfigField{}
for _, f := range configFields {
switch f {
case "allow_password_login":
field.AllowPasswordLogin = true
default:
fmt.Printf("field %s not support\n", f)
}
}
err = cli.SetDefaultConfig(c.Data.Database, c.Data.Cache, field)
if err != nil {
fmt.Println("set default config failed: ", err.Error())
} else {
fmt.Println("set default config successfully")
}
},
}
)

// Execute adds all child commands to the root command and sets flags appropriately.
Expand Down
3 changes: 3 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ var (
Revision = "-"
// Time is the build time of the project
Time = "-"
// GoVersion is the go version of the project
GoVersion = "1.19"
// log level
logLevel = os.Getenv("LOG_LEVEL")
// log path
Expand Down Expand Up @@ -75,6 +77,7 @@ func runApp() {
}
constant.Version = Version
constant.Revision = Revision
constant.GoVersion = GoVersion
schema.AppStartTime = time.Now()
fmt.Println("answer Version:", constant.Version, " Revision:", constant.Revision)

Expand Down
4 changes: 2 additions & 2 deletions cmd/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 19 additions & 9 deletions docs/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 19 additions & 9 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -6871,12 +6871,13 @@
"object_id"
],
"properties": {
"bookmark": {
"type": "boolean"
},
"group_id": {
"description": "user collection group TagID",
"type": "string"
},
"object_id": {
"description": "object TagID",
"type": "string"
}
}
Expand All @@ -6885,13 +6886,7 @@
"type": "object",
"properties": {
"object_collection_count": {
"type": "string"
},
"object_id": {
"type": "string"
},
"switch": {
"type": "boolean"
"type": "integer"
}
}
},
Expand Down Expand Up @@ -8755,6 +8750,9 @@
"site_users": {
"$ref": "#/definitions/schema.SiteUsersResp"
},
"site_write": {
"$ref": "#/definitions/schema.SiteWriteResp"
},
"theme": {
"$ref": "#/definitions/schema.SiteThemeResp"
},
Expand Down Expand Up @@ -8846,6 +8844,9 @@
"allow_new_registrations": {
"type": "boolean"
},
"allow_password_login": {
"type": "boolean"
},
"login_required": {
"type": "boolean"
}
Expand All @@ -8866,6 +8867,9 @@
"allow_new_registrations": {
"type": "boolean"
},
"allow_password_login": {
"type": "boolean"
},
"login_required": {
"type": "boolean"
}
Expand Down Expand Up @@ -9028,6 +9032,9 @@
"items": {
"type": "string"
}
},
"restrict_answer": {
"type": "boolean"
}
}
},
Expand All @@ -9048,6 +9055,9 @@
"items": {
"type": "string"
}
},
"restrict_answer": {
"type": "boolean"
}
}
},
Expand Down
20 changes: 13 additions & 7 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,11 @@ definitions:
type: object
schema.CollectionSwitchReq:
properties:
bookmark:
type: boolean
group_id:
description: user collection group TagID
type: string
object_id:
description: object TagID
type: string
required:
- group_id
Expand All @@ -370,11 +370,7 @@ definitions:
schema.CollectionSwitchResp:
properties:
object_collection_count:
type: string
object_id:
type: string
switch:
type: boolean
type: integer
type: object
schema.ConfigField:
properties:
Expand Down Expand Up @@ -1677,6 +1673,8 @@ definitions:
$ref: '#/definitions/schema.SiteSeoResp'
site_users:
$ref: '#/definitions/schema.SiteUsersResp'
site_write:
$ref: '#/definitions/schema.SiteWriteResp'
theme:
$ref: '#/definitions/schema.SiteThemeResp'
version:
Expand Down Expand Up @@ -1738,6 +1736,8 @@ definitions:
type: boolean
allow_new_registrations:
type: boolean
allow_password_login:
type: boolean
login_required:
type: boolean
type: object
Expand All @@ -1751,6 +1751,8 @@ definitions:
type: boolean
allow_new_registrations:
type: boolean
allow_password_login:
type: boolean
login_required:
type: boolean
type: object
Expand Down Expand Up @@ -1861,6 +1863,8 @@ definitions:
items:
type: string
type: array
restrict_answer:
type: boolean
type: object
schema.SiteWriteResp:
properties:
Expand All @@ -1874,6 +1878,8 @@ definitions:
items:
type: string
type: array
restrict_answer:
type: boolean
type: object
schema.TagItem:
properties:
Expand Down
Loading