Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite26a4fa

Browse files
committed
fix: replace env_group_id with namespace_id in API endpoints and types#1369
1 parenteb4dc12 commite26a4fa

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

‎api/config/list.go‎

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import (
44
"net/http"
55
"os"
66
"path/filepath"
7-
"strconv"
87
"strings"
98

109
"github.com/0xJacky/Nginx-UI/internal/config"
1110
"github.com/0xJacky/Nginx-UI/internal/helper"
1211
"github.com/0xJacky/Nginx-UI/internal/nginx"
1312
"github.com/0xJacky/Nginx-UI/model"
1413
"github.com/gin-gonic/gin"
14+
"github.com/spf13/cast"
1515
"github.com/uozi-tech/cosy"
1616
)
1717

@@ -41,7 +41,7 @@ func GetConfigs(c *gin.Context) {
4141
search:=c.Query("search")
4242
sortBy:=c.DefaultQuery("sort_by","name")
4343
order:=c.DefaultQuery("order","asc")
44-
namespaceIDStr:=c.Query("env_group_id")
44+
namespaceId:=cast.ToUint64(c.Query("namespace_id"))
4545

4646
// Get directory parameter
4747
encodedDir:=c.DefaultQuery("dir","/")
@@ -55,20 +55,12 @@ func GetConfigs(c *gin.Context) {
5555
dir=strings.TrimSuffix(dir,"/")
5656
}
5757

58-
// Parse env_group_id
59-
varnamespaceIDuint64
60-
ifnamespaceIDStr!="" {
61-
ifid,err:=strconv.ParseUint(namespaceIDStr,10,64);err==nil {
62-
namespaceID=id
63-
}
64-
}
65-
6658
// Create options
6759
options:=&config.GenericListOptions{
6860
Search:search,
6961
OrderBy:sortBy,
7062
Sort:order,
71-
NamespaceID:namespaceID,
63+
NamespaceID:namespaceId,
7264
IncludeDirs:true,// Keep directories for the list.go endpoint
7365
}
7466

‎api/sites/list.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func GetSiteList(c *gin.Context) {
1818
Status:c.Query("status"),
1919
OrderBy:c.Query("sort_by"),
2020
Sort:c.DefaultQuery("order","desc"),
21-
NamespaceID:cast.ToUint64(c.Query("env_group_id")),
21+
NamespaceID:cast.ToUint64(c.Query("namespace_id")),
2222
}
2323

2424
// Get sites from database

‎api/sites/site.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func SaveSite(c *gin.Context) {
132132

133133
varjsonstruct {
134134
Contentstring`json:"content" binding:"required"`
135-
NamespaceIDuint64`json:"env_group_id"`
135+
NamespaceIDuint64`json:"namespace_id"`
136136
SyncNodeIDs []uint64`json:"sync_node_ids"`
137137
Overwritebool`json:"overwrite"`
138138
PostActionstring`json:"post_action"`
@@ -237,7 +237,7 @@ func DeleteSite(c *gin.Context) {
237237

238238
funcBatchUpdateSites(c*gin.Context) {
239239
cosy.Core[model.Site](c).SetValidRules(gin.H{
240-
"env_group_id":"required",
240+
"namespace_id":"required",
241241
}).SetItemKey("path").
242242
BeforeExecuteHook(func(ctx*cosy.Ctx[model.Site]) {
243243
effectedPath:=make([]string,len(ctx.BatchEffectedIDs))

‎app/components.d.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,30 @@ declare module 'vue' {
1010
exportinterfaceGlobalComponents{
1111
AAlert:typeofimport('ant-design-vue/es')['Alert']
1212
AApp:typeofimport('ant-design-vue/es')['App']
13+
AAutoComplete:typeofimport('ant-design-vue/es')['AutoComplete']
1314
AAvatar:typeofimport('ant-design-vue/es')['Avatar']
1415
ABadge:typeofimport('ant-design-vue/es')['Badge']
1516
ABreadcrumb:typeofimport('ant-design-vue/es')['Breadcrumb']
1617
ABreadcrumbItem:typeofimport('ant-design-vue/es')['BreadcrumbItem']
1718
AButton:typeofimport('ant-design-vue/es')['Button']
1819
ACard:typeofimport('ant-design-vue/es')['Card']
20+
ACheckbox:typeofimport('ant-design-vue/es')['Checkbox']
21+
ACheckboxGroup:typeofimport('ant-design-vue/es')['CheckboxGroup']
1922
ACol:typeofimport('ant-design-vue/es')['Col']
23+
ACollapse:typeofimport('ant-design-vue/es')['Collapse']
24+
ACollapsePanel:typeofimport('ant-design-vue/es')['CollapsePanel']
25+
AComment:typeofimport('ant-design-vue/es')['Comment']
2026
AConfigProvider:typeofimport('ant-design-vue/es')['ConfigProvider']
2127
ADivider:typeofimport('ant-design-vue/es')['Divider']
2228
ADrawer:typeofimport('ant-design-vue/es')['Drawer']
29+
ADropdown:typeofimport('ant-design-vue/es')['Dropdown']
30+
AEmpty:typeofimport('ant-design-vue/es')['Empty']
2331
AForm:typeofimport('ant-design-vue/es')['Form']
2432
AFormItem:typeofimport('ant-design-vue/es')['FormItem']
2533
AInput:typeofimport('ant-design-vue/es')['Input']
2634
AInputGroup:typeofimport('ant-design-vue/es')['InputGroup']
35+
AInputNumber:typeofimport('ant-design-vue/es')['InputNumber']
36+
AInputPassword:typeofimport('ant-design-vue/es')['InputPassword']
2737
ALayout:typeofimport('ant-design-vue/es')['Layout']
2838
ALayoutContent:typeofimport('ant-design-vue/es')['LayoutContent']
2939
ALayoutFooter:typeofimport('ant-design-vue/es')['LayoutFooter']
@@ -33,6 +43,7 @@ declare module 'vue' {
3343
AListItem:typeofimport('ant-design-vue/es')['ListItem']
3444
AListItemMeta:typeofimport('ant-design-vue/es')['ListItemMeta']
3545
AMenu:typeofimport('ant-design-vue/es')['Menu']
46+
AMenuDivider:typeofimport('ant-design-vue/es')['MenuDivider']
3647
AMenuItem:typeofimport('ant-design-vue/es')['MenuItem']
3748
AModal:typeofimport('ant-design-vue/es')['Modal']
3849
APopconfirm:typeofimport('ant-design-vue/es')['Popconfirm']
@@ -47,9 +58,11 @@ declare module 'vue' {
4758
AStatistic:typeofimport('ant-design-vue/es')['Statistic']
4859
ASubMenu:typeofimport('ant-design-vue/es')['SubMenu']
4960
ASwitch:typeofimport('ant-design-vue/es')['Switch']
61+
ATable:typeofimport('ant-design-vue/es')['Table']
5062
ATabPane:typeofimport('ant-design-vue/es')['TabPane']
5163
ATabs:typeofimport('ant-design-vue/es')['Tabs']
5264
ATag:typeofimport('ant-design-vue/es')['Tag']
65+
ATextarea:typeofimport('ant-design-vue/es')['Textarea']
5366
ATooltip:typeofimport('ant-design-vue/es')['Tooltip']
5467
ATypographyText:typeofimport('ant-design-vue/es')['TypographyText']
5568
ATypographyTitle:typeofimport('ant-design-vue/es')['TypographyTitle']

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp