diff --git a/community/gitlab/config/command.py b/community/gitlab/config/command.py index ac38697..bae917a 100644 --- a/community/gitlab/config/command.py +++ b/community/gitlab/config/command.py @@ -17,8 +17,7 @@ "Input your gitlab API URL to access gitlab api, if not specified, default is https://gitlab.com/api/v4" ) @editor("Input your gitlab TOKEN to access gitlab api") -@editor("Input your gitlab work report template path") -def edit_config(issue_url, gitlab_api_url, gitlab_token, template_path): +def edit_config(issue_url, gitlab_api_url, gitlab_token): pass @@ -26,17 +25,13 @@ def main(): issue_url = read_config("git_issue_repo", is_global=True) gitlab_token = read_config("gitlab_token", is_global=True) gitlab_api_url = read_config("gitlab_api_url", is_global=True) - template_path = read_config("gitlab_work_report_template_path", is_global=True) - issue_url, gitlab_api_url, gitlab_token, template_path = edit_config( - issue_url, gitlab_api_url, gitlab_token, template_path - ) + issue_url, gitlab_api_url, gitlab_token = edit_config(issue_url, gitlab_api_url, gitlab_token) if not gitlab_token: print("Please specify the gitlab token to access gitlab api.") sys.exit(0) save_config("git_issue_repo", issue_url, is_global=True) save_config("gitlab_token", gitlab_token, is_global=True) save_config("gitlab_api_url", gitlab_api_url, is_global=True) - save_config("gitlab_work_report_template_path", template_path, is_global=True) print("config gitlab settings successfully.") sys.exit(0) diff --git a/community/gitlab/work_report/README.md b/community/gitlab/work_report/README.md index 8be70aa..132c0d5 100644 --- a/community/gitlab/work_report/README.md +++ b/community/gitlab/work_report/README.md @@ -44,4 +44,4 @@ The report includes: ## Configuration -The report template can be customized by setting the `gitlab_work_report_template_path` in the global configuration. +The report template can be customized by modifying the `template.md` file in the `~/.chat/scripts/community/gitlab/work_report` directory. diff --git a/community/gitlab/work_report/README.zh.md b/community/gitlab/work_report/README.zh.md index 3a110ba..dd29524 100644 --- a/community/gitlab/work_report/README.zh.md +++ b/community/gitlab/work_report/README.zh.md @@ -44,4 +44,4 @@ ## 配置说明 -可以通过全局配置中的 `gitlab_work_report_template_path` 来自定义报告模板。 +可以修改 `~/.chat/scripts/community/gitlab/work_report/template.md` 文件来修改报告模板。 diff --git a/community/gitlab/work_report/command.py b/community/gitlab/work_report/command.py index 2506582..9bcc31f 100755 --- a/community/gitlab/work_report/command.py +++ b/community/gitlab/work_report/command.py @@ -11,10 +11,9 @@ get_repo_issues, get_username, ) -from lib.workflow.config import read_config PROMPT = """ -我希望你根据以下信息生成一份从 {start_time} 到 {end_time} 的 Gitlab 工作报告。 +我希望你根据以下信息生成一份从 {start_time} 到 {end_time} 的工作报告。 问题列表: @@ -26,7 +25,7 @@ {commits} -请参考以下模板内容: +请参考以下模板内容的格式: @@ -34,11 +33,7 @@ def get_template(): - template_path = read_config( - "gitlab_work_report_template_path", - is_global=True, - default=os.path.join(os.path.dirname(__file__), "template.md"), - ) + template_path = os.path.join(os.path.dirname(__file__), "template.md") with open(template_path, "r", encoding="utf-8") as f: return f.read() diff --git a/community/gitlab/work_report/template.md b/community/gitlab/work_report/template.md index 8b13789..82a2455 100644 --- a/community/gitlab/work_report/template.md +++ b/community/gitlab/work_report/template.md @@ -1 +1,19 @@ +# 工作报告 2025-05-19 至 2025-05-20 +## 完成 + +1. xxx +2. xxx +3. xxx + +## 未完成 + +1. xxx +2. xxx +3. xxx + +## 待办 + +1. xxx +2. xxx +3. xxx