mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-27 20:49:03 +08:00
feat: 网站过期时间增加排序 (#5833)
This commit is contained in:
parent
74bd997f07
commit
b562d9f8e8
@ -7,7 +7,7 @@ import (
|
||||
type WebsiteSearch struct {
|
||||
dto.PageInfo
|
||||
Name string `json:"name"`
|
||||
OrderBy string `json:"orderBy" validate:"required,oneof=primary_domain type status created_at"`
|
||||
OrderBy string `json:"orderBy" validate:"required,oneof=primary_domain type status created_at expire_date"`
|
||||
Order string `json:"order" validate:"required,oneof=null ascending descending"`
|
||||
WebsiteGroupID uint `json:"websiteGroupId"`
|
||||
}
|
||||
@ -55,7 +55,7 @@ type WebsiteUpdate struct {
|
||||
ID uint `json:"id" validate:"required"`
|
||||
PrimaryDomain string `json:"primaryDomain" validate:"required"`
|
||||
Remark string `json:"remark"`
|
||||
WebsiteGroupID uint `json:"webSiteGroupID" validate:"required"`
|
||||
WebsiteGroupID uint `json:"webSiteGroupID"`
|
||||
ExpireDate string `json:"expireDate"`
|
||||
IPV6 bool `json:"IPV6"`
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ func (w *WebsiteRepo) Page(page, size int, opts ...DBOption) (int64, []model.Web
|
||||
db := getDb(opts...).Model(&model.Website{})
|
||||
count := int64(0)
|
||||
db = db.Count(&count)
|
||||
err := db.Limit(size).Offset(size * (page - 1)).Preload("WebsiteSSL").Find(&websites).Error
|
||||
err := db.Debug().Limit(size).Offset(size * (page - 1)).Preload("WebsiteSSL").Find(&websites).Error
|
||||
return count, websites, err
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@
|
||||
prop="protocol"
|
||||
width="90px"
|
||||
></el-table-column>
|
||||
<el-table-column :label="$t('website.expireDate')">
|
||||
<el-table-column :label="$t('website.expireDate')" prop="expireDate" sortable>
|
||||
<template #default="{ row, $index }">
|
||||
<div v-show="row.showdate">
|
||||
<el-date-picker
|
||||
@ -271,6 +271,7 @@ const mobile = computed(() => {
|
||||
const changeSort = ({ prop, order }) => {
|
||||
if (order) {
|
||||
req.orderBy = prop == 'primaryDomain' ? 'primary_domain' : prop;
|
||||
req.orderBy = prop == 'expireDate' ? 'expire_date' : prop;
|
||||
req.order = order;
|
||||
} else {
|
||||
req.orderBy = 'created_at';
|
||||
|
Loading…
Reference in New Issue
Block a user