mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-24 17:10:12 +08:00
feat(cli): Enhance CLI functionality and add administrator mode support (#13539)
### What problem does this PR solve? feat(cli): Enhance CLI functionality and add administrator mode support - Modify `parseActivateUser` in `parser.go` to support 'on'/'off' states - Add administrator mode switching and host port settings functionality to `cli.go` - Implement user management API calls in `client.go` ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@@ -950,10 +950,11 @@ func (p *Parser) parseActivateUser() (*Command, error) {
|
||||
}
|
||||
|
||||
p.nextToken()
|
||||
status, err := p.parseIdentifier()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Accept 'on' or 'off' as identifier
|
||||
status := p.curToken.Value
|
||||
if status != "on" && status != "off" {
|
||||
return nil, fmt.Errorf("expected 'on' or 'off', got %s", p.curToken.Value)
|
||||
}
|
||||
|
||||
cmd := NewCommand("activate_user")
|
||||
cmd.Params["user_name"] = userName
|
||||
@@ -962,7 +963,7 @@ func (p *Parser) parseActivateUser() (*Command, error) {
|
||||
p.nextToken()
|
||||
if err := p.expectSemicolon(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return cmd, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user