Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions agent/app/dto/request/website_ssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ type WebsiteSSLSearch struct {
dto.PageInfo
AcmeAccountID string `json:"acmeAccountID"`
Domain string `json:"domain"`
OrderBy string `json:"orderBy" validate:"required,oneof=expire_date"`
Order string `json:"order" validate:"required,oneof=null ascending descending"`
}

type WebsiteSSLCreate struct {
Expand Down
6 changes: 5 additions & 1 deletion agent/app/service/website_ssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ func (w WebsiteSSLService) Page(search request.WebsiteSSLSearch) (int64, []respo
result []response.WebsiteSSLDTO
opts []repo.DBOption
)
opts = append(opts, repo.WithOrderBy("created_at desc"))
if search.OrderBy != "" && search.Order != "null" {
opts = append(opts, repo.WithOrderRuleBy(search.OrderBy, search.Order))
} else {
opts = append(opts, repo.WithOrderBy("created_at desc"))
}
if search.Domain != "" {
opts = append(opts, websiteSSLRepo.WithByDomain(search.Domain))
}
Expand Down
12 changes: 12 additions & 0 deletions frontend/src/views/website/ssl/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
:columns="columns"
localKey="sslColumn"
:height-diff="260"
@sort-change="changeSort"
>
<el-table-column type="selection" width="30" />
<el-table-column
Expand Down Expand Up @@ -144,6 +145,7 @@
:formatter="dateFormat"
show-overflow-tooltip
width="180px"
sortable
/>
<fu-table-operations
:ellipsis="3"
Expand Down Expand Up @@ -211,6 +213,8 @@ let selects = ref<any>([]);
const columns = ref([]);
const req = reactive({
domain: '',
orderBy: 'expire_date',
order: 'ascending',
});

const routerButton = [
Expand Down Expand Up @@ -302,11 +306,19 @@ const mobile = computed(() => {
return globalStore.isMobile();
});

const changeSort = ({ order }) => {
req.orderBy = 'expire_date';
req.order = order;
search();
};

const search = () => {
const request = {
page: paginationConfig.currentPage,
pageSize: paginationConfig.pageSize,
domain: req.domain,
orderBy: req.orderBy,
order: req.order,
};
loading.value = true;
searchSSL(request)
Expand Down
Loading