mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 18:35:51 +02:00
feat: added name filter for domains list #41
This commit is contained in:
parent
c4f87fb4cc
commit
3d0c40eaac
2 changed files with 11 additions and 3 deletions
|
@ -9,12 +9,17 @@ const {$gettext, interpolate} = useGettext()
|
||||||
import domain from '@/api/domain'
|
import domain from '@/api/domain'
|
||||||
import {Badge, message} from 'ant-design-vue'
|
import {Badge, message} from 'ant-design-vue'
|
||||||
import {h, ref} from 'vue'
|
import {h, ref} from 'vue'
|
||||||
|
import {input} from '@/components/StdDataEntry'
|
||||||
|
|
||||||
const columns = [{
|
const columns = [{
|
||||||
title: () => $gettext('Name'),
|
title: () => $gettext('Name'),
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
pithy: true
|
pithy: true,
|
||||||
|
edit: {
|
||||||
|
type: input
|
||||||
|
},
|
||||||
|
search: true
|
||||||
}, {
|
}, {
|
||||||
title: () => $gettext('Status'),
|
title: () => $gettext('Status'),
|
||||||
dataIndex: 'enabled',
|
dataIndex: 'enabled',
|
||||||
|
@ -40,7 +45,7 @@ const columns = [{
|
||||||
pithy: true
|
pithy: true
|
||||||
}, {
|
}, {
|
||||||
title: () => $gettext('Action'),
|
title: () => $gettext('Action'),
|
||||||
dataIndex: 'action',
|
dataIndex: 'action'
|
||||||
}]
|
}]
|
||||||
|
|
||||||
const table = ref(null)
|
const table = ref(null)
|
||||||
|
@ -85,7 +90,6 @@ function destroy(site_name: any) {
|
||||||
<std-table
|
<std-table
|
||||||
:api="domain"
|
:api="domain"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:disable_search="true"
|
|
||||||
row-key="name"
|
row-key="name"
|
||||||
ref="table"
|
ref="table"
|
||||||
@clickEdit="r => $router.push({
|
@clickEdit="r => $router.push({
|
||||||
|
|
|
@ -15,6 +15,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetDomains(c *gin.Context) {
|
func GetDomains(c *gin.Context) {
|
||||||
|
name := c.Query("name")
|
||||||
orderBy := c.Query("order_by")
|
orderBy := c.Query("order_by")
|
||||||
sort := c.DefaultQuery("sort", "desc")
|
sort := c.DefaultQuery("sort", "desc")
|
||||||
|
|
||||||
|
@ -49,6 +50,9 @@ func GetDomains(c *gin.Context) {
|
||||||
file := configFiles[i]
|
file := configFiles[i]
|
||||||
fileInfo, _ := file.Info()
|
fileInfo, _ := file.Info()
|
||||||
if !file.IsDir() {
|
if !file.IsDir() {
|
||||||
|
if name != "" && !strings.Contains(file.Name(), name) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
configs = append(configs, gin.H{
|
configs = append(configs, gin.H{
|
||||||
"name": file.Name(),
|
"name": file.Name(),
|
||||||
"size": fileInfo.Size(),
|
"size": fileInfo.Size(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue