mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-22 12:48:14 -05:00
fix server deletion api, add issue templates (#526)
* add issue templates * fix: server deletion api
This commit is contained in:
parent
7f33f8239e
commit
b128a0a5ed
47
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
47
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
name: Bug Report
|
||||
description: File a bug report about nezha.
|
||||
|
||||
body:
|
||||
- type: input
|
||||
attributes:
|
||||
label: Environment
|
||||
description: Input your OS information and host architecture here.
|
||||
placeholder: Debian GNU/Linux 12 6.1.0-22-amd64
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: Agent Version
|
||||
description: Input the version of your copy of nezha here.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe the bug
|
||||
description: A clear and concise description of what the bug is.
|
||||
value: |
|
||||
<details></details>
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: To Reproduce
|
||||
description: Input your configuration and the steps to reproduce the bug here.
|
||||
value: |
|
||||
<details></details>
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional Context
|
||||
description: Input any other relevant information that may help understand the issue.
|
||||
value: |
|
||||
<details></details>
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Validation
|
||||
options:
|
||||
- label: I confirm this is a bug about nezha (Nezha Dashboard).
|
||||
required: true
|
||||
- label: I have searched Issues and confirm this bug has been reported before.
|
||||
required: true
|
47
.github/ISSUE_TEMPLATE/bug_report_zh.yml
vendored
Normal file
47
.github/ISSUE_TEMPLATE/bug_report_zh.yml
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
name: 问题反馈
|
||||
description: 提交 nezha 问题反馈
|
||||
|
||||
body:
|
||||
- type: input
|
||||
attributes:
|
||||
label: 运行环境
|
||||
description: 请在这里输入你的系统信息及设备架构
|
||||
placeholder: Debian GNU/Linux 12 6.1.0-22-amd64
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: Agent 版本
|
||||
description: 在这里输入你的 nezha 版本号
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: 描述问题
|
||||
description: 一个清晰明了的问题描述
|
||||
value: |
|
||||
<details></details>
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: 复现步骤
|
||||
description: 在这里输入你的配置信息及复现问题的步骤
|
||||
value: |
|
||||
<details></details>
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: 附加信息
|
||||
description: 在这里输入其它对问题解决有帮助的信息
|
||||
value: |
|
||||
<details></details>
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: 验证
|
||||
options:
|
||||
- label: 我确认这是一个 nezha (哪吒面板) 的问题。
|
||||
required: true
|
||||
- label: 我已经搜索了 Issues,并确认该问题之前没有被反馈过。
|
||||
required: true
|
10
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
10
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
contact_links:
|
||||
- name: Report nezha-agent issues / 反馈 nezha-agent 问题
|
||||
url: https://github.com/nezhahq/agent/issues
|
||||
about: 请在这里创建 nezha-agent 的问题反馈。
|
||||
- name: Report admin frontend issues / 反馈管理前端问题
|
||||
url: https://github.com/nezhahq/admin-frontend/issues
|
||||
about: 请在这里创建管理前端的问题反馈。
|
||||
- name: Report user frontend issues / 反馈用户前端问题
|
||||
url: https://github.com/hamster1963/nezha-dash/issues
|
||||
about: 请在这里创建用户前端的问题反馈。
|
@ -5,6 +5,7 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/jinzhu/copier"
|
||||
"gorm.io/gorm"
|
||||
|
||||
"github.com/nezhahq/nezha/model"
|
||||
"github.com/nezhahq/nezha/pkg/utils"
|
||||
@ -103,7 +104,17 @@ func batchDeleteServer(c *gin.Context) (any, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err := singleton.DB.Unscoped().Delete(&model.Server{}, "id in (?)", servers).Error; err != nil {
|
||||
err := singleton.DB.Transaction(func(tx *gorm.DB) error {
|
||||
if err := tx.Unscoped().Delete(&model.Server{}, "id in (?)", servers).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
if err := tx.Unscoped().Delete(&model.ServerGroupServer{}, "server_id in (?)", servers).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return nil, newGormError("%v", err)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user