mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 07:57:21 +08:00
fix: 优化表格样式
This commit is contained in:
@@ -372,7 +372,12 @@ func Cli() []*cli.Command {
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "clearTask",
|
||||
Name: "sync-time",
|
||||
Usage: "同步系统时间",
|
||||
Action: cliService.SyncTime,
|
||||
},
|
||||
{
|
||||
Name: "clear-task",
|
||||
Usage: "清理面板任务队列(仅限指导下使用)",
|
||||
Hidden: true,
|
||||
Action: cliService.ClearTask,
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/TheTNB/panel/pkg/ntp"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
@@ -612,6 +613,20 @@ func (s *CliService) AppRemove(ctx context.Context, cmd *cli.Command) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *CliService) SyncTime(ctx context.Context, cmd *cli.Command) error {
|
||||
now, err := ntp.Now()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err = ntp.UpdateSystemTime(now); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
color.Greenln("时间同步成功")
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *CliService) ClearTask(ctx context.Context, cmd *cli.Command) error {
|
||||
if err := app.Orm.Model(&biz.Task{}).
|
||||
Where("status", biz.TaskStatusRunning).Or("status", biz.TaskStatusWaiting).
|
||||
@@ -620,6 +635,7 @@ func (s *CliService) ClearTask(ctx context.Context, cmd *cli.Command) error {
|
||||
return fmt.Errorf("任务清理失败:%v", err)
|
||||
}
|
||||
|
||||
color.Greenln("任务清理成功")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -20,27 +20,27 @@ const columns: any = [
|
||||
{
|
||||
title: t('appIndex.columns.name'),
|
||||
key: 'name',
|
||||
minWidth: 200,
|
||||
width: 300,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true }
|
||||
},
|
||||
{
|
||||
title: t('appIndex.columns.description'),
|
||||
key: 'description',
|
||||
minWidth: 200,
|
||||
minWidth: 300,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true }
|
||||
},
|
||||
{
|
||||
title: t('appIndex.columns.installedVersion'),
|
||||
key: 'installed_version',
|
||||
minWidth: 100,
|
||||
width: 100,
|
||||
ellipsis: { tooltip: true }
|
||||
},
|
||||
{
|
||||
title: t('appIndex.columns.show'),
|
||||
key: 'show',
|
||||
minWidth: 100,
|
||||
width: 100,
|
||||
align: 'center',
|
||||
render(row: any) {
|
||||
return h(NSwitch, {
|
||||
|
||||
@@ -25,11 +25,16 @@ const columns: any = [
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true }
|
||||
},
|
||||
{ title: '大小', key: 'size', minWidth: 160, ellipsis: { tooltip: true } },
|
||||
{
|
||||
title: '大小',
|
||||
key: 'size',
|
||||
width: 160,
|
||||
ellipsis: { tooltip: true }
|
||||
},
|
||||
{
|
||||
title: '更新日期',
|
||||
key: 'time',
|
||||
minWidth: 200,
|
||||
width: 200,
|
||||
ellipsis: { tooltip: true },
|
||||
render(row: any) {
|
||||
return formatDateTime(row.time)
|
||||
|
||||
@@ -49,7 +49,7 @@ const accountColumns: any = [
|
||||
{
|
||||
title: 'CA',
|
||||
key: 'ca',
|
||||
minWidth: 150,
|
||||
width: 150,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true },
|
||||
render(row: any) {
|
||||
@@ -70,7 +70,7 @@ const accountColumns: any = [
|
||||
{
|
||||
title: '密钥类型',
|
||||
key: 'key_type',
|
||||
minWidth: 150,
|
||||
width: 150,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true }
|
||||
},
|
||||
|
||||
@@ -64,7 +64,7 @@ const certColumns: any = [
|
||||
{
|
||||
title: '类型',
|
||||
key: 'type',
|
||||
minWidth: 100,
|
||||
width: 100,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true },
|
||||
render(row: any) {
|
||||
@@ -153,7 +153,7 @@ const certColumns: any = [
|
||||
{
|
||||
title: '自动续签',
|
||||
key: 'auto_renew',
|
||||
minWidth: 100,
|
||||
width: 100,
|
||||
align: 'center',
|
||||
resizable: true,
|
||||
render(row: any) {
|
||||
|
||||
@@ -43,7 +43,7 @@ const dnsColumns: any = [
|
||||
{
|
||||
title: '类型',
|
||||
key: 'type',
|
||||
minWidth: 150,
|
||||
width: 150,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true },
|
||||
render(row: any) {
|
||||
|
||||
@@ -35,7 +35,7 @@ const columns: any = [
|
||||
{
|
||||
title: '状态',
|
||||
key: 'state',
|
||||
minWidth: 100,
|
||||
width: 100,
|
||||
resizable: true,
|
||||
render(row: any) {
|
||||
return h(NSwitch, {
|
||||
@@ -56,7 +56,7 @@ const columns: any = [
|
||||
{
|
||||
title: '端口(主机->容器)',
|
||||
key: 'ports',
|
||||
minWidth: 100,
|
||||
width: 100,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true },
|
||||
render(row: any) {
|
||||
@@ -70,7 +70,7 @@ const columns: any = [
|
||||
{
|
||||
title: '运行状态',
|
||||
key: 'status',
|
||||
minWidth: 300,
|
||||
width: 300,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true }
|
||||
},
|
||||
|
||||
@@ -25,14 +25,14 @@ const columns: any = [
|
||||
{
|
||||
title: 'ID',
|
||||
key: 'id',
|
||||
minWidth: 150,
|
||||
width: 150,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true }
|
||||
},
|
||||
{
|
||||
title: '容器数',
|
||||
key: 'containers',
|
||||
minWidth: 100,
|
||||
width: 100,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true }
|
||||
},
|
||||
@@ -56,14 +56,14 @@ const columns: any = [
|
||||
{
|
||||
title: '大小',
|
||||
key: 'size',
|
||||
minWidth: 150,
|
||||
width: 150,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true }
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
key: 'created',
|
||||
minWidth: 200,
|
||||
width: 200,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true }
|
||||
},
|
||||
|
||||
@@ -54,14 +54,14 @@ const columns: any = [
|
||||
{
|
||||
title: '驱动',
|
||||
key: 'driver',
|
||||
minWidth: 100,
|
||||
width: 100,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true }
|
||||
},
|
||||
{
|
||||
title: '范围',
|
||||
key: 'scope',
|
||||
minWidth: 100,
|
||||
width: 100,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true }
|
||||
},
|
||||
@@ -85,7 +85,7 @@ const columns: any = [
|
||||
{
|
||||
title: '网关',
|
||||
key: 'gateway',
|
||||
minWidth: 150,
|
||||
width: 150,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true },
|
||||
render(row: any): any {
|
||||
@@ -102,7 +102,7 @@ const columns: any = [
|
||||
{
|
||||
title: '创建时间',
|
||||
key: 'created',
|
||||
minWidth: 200,
|
||||
width: 200,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true }
|
||||
},
|
||||
|
||||
@@ -35,14 +35,14 @@ const columns: any = [
|
||||
{
|
||||
title: '驱动',
|
||||
key: 'driver',
|
||||
minWidth: 100,
|
||||
width: 100,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true }
|
||||
},
|
||||
{
|
||||
title: '范围',
|
||||
key: 'scope',
|
||||
minWidth: 100,
|
||||
width: 100,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true }
|
||||
},
|
||||
@@ -56,7 +56,7 @@ const columns: any = [
|
||||
{
|
||||
title: '创建时间',
|
||||
key: 'created',
|
||||
minWidth: 200,
|
||||
width: 200,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true }
|
||||
},
|
||||
|
||||
@@ -61,7 +61,7 @@ const columns: any = [
|
||||
{
|
||||
title: '任务类型',
|
||||
key: 'type',
|
||||
minWidth: 100,
|
||||
width: 100,
|
||||
resizable: true,
|
||||
render(row: any) {
|
||||
return row.type === 'shell' ? '运行脚本' : row.type === 'backup' ? '备份数据' : '切割日志'
|
||||
@@ -70,7 +70,7 @@ const columns: any = [
|
||||
{
|
||||
title: '启用',
|
||||
key: 'status',
|
||||
minWidth: 60,
|
||||
width: 100,
|
||||
align: 'center',
|
||||
resizable: true,
|
||||
render(row: any) {
|
||||
@@ -85,14 +85,14 @@ const columns: any = [
|
||||
{
|
||||
title: '任务周期',
|
||||
key: 'time',
|
||||
minWidth: 100,
|
||||
width: 100,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true }
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
key: 'created_at',
|
||||
minWidth: 200,
|
||||
width: 200,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true },
|
||||
render(row: any): string {
|
||||
@@ -102,7 +102,7 @@ const columns: any = [
|
||||
{
|
||||
title: '最后更新时间',
|
||||
key: 'updated_at',
|
||||
minWidth: 200,
|
||||
width: 200,
|
||||
ellipsis: { tooltip: true },
|
||||
render(row: any): string {
|
||||
return formatDateTime(row.updated_at)
|
||||
|
||||
@@ -20,7 +20,7 @@ const columns: any = [
|
||||
{
|
||||
title: '传输协议',
|
||||
key: 'protocol',
|
||||
minWidth: 150,
|
||||
width: 150,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true },
|
||||
render(row: any): any {
|
||||
@@ -37,7 +37,7 @@ const columns: any = [
|
||||
{
|
||||
title: '网络协议',
|
||||
key: 'family',
|
||||
minWidth: 150,
|
||||
width: 150,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true },
|
||||
render(row: any): any {
|
||||
@@ -54,7 +54,7 @@ const columns: any = [
|
||||
{
|
||||
title: '端口',
|
||||
key: 'port',
|
||||
minWidth: 200,
|
||||
minWidth: 300,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true },
|
||||
render(row: any): any {
|
||||
@@ -129,7 +129,7 @@ const columns: any = [
|
||||
{
|
||||
title: '操作',
|
||||
key: 'actions',
|
||||
width: 150,
|
||||
width: 200,
|
||||
align: 'center',
|
||||
hideInExcel: true,
|
||||
render(row: any) {
|
||||
|
||||
@@ -26,7 +26,7 @@ const columns: any = [
|
||||
{
|
||||
title: t('taskIndex.columns.status'),
|
||||
key: 'status',
|
||||
minWidth: 100,
|
||||
width: 150,
|
||||
ellipsis: { tooltip: true },
|
||||
render(row: any) {
|
||||
return row.status === 'finished'
|
||||
@@ -41,7 +41,7 @@ const columns: any = [
|
||||
{
|
||||
title: t('taskIndex.columns.createdAt'),
|
||||
key: 'created_at',
|
||||
minWidth: 200,
|
||||
width: 200,
|
||||
ellipsis: { tooltip: true },
|
||||
render(row: any): string {
|
||||
return formatDateTime(row.created_at)
|
||||
@@ -50,7 +50,7 @@ const columns: any = [
|
||||
{
|
||||
title: t('taskIndex.columns.updatedAt'),
|
||||
key: 'updated_at',
|
||||
minWidth: 200,
|
||||
width: 200,
|
||||
ellipsis: { tooltip: true },
|
||||
render(row: any): string {
|
||||
return formatDateTime(row.updated_at)
|
||||
|
||||
@@ -26,14 +26,14 @@ const columns: any = [
|
||||
{
|
||||
title: t('websiteIndex.columns.name'),
|
||||
key: 'name',
|
||||
minWidth: 150,
|
||||
width: 200,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true }
|
||||
},
|
||||
{
|
||||
title: t('websiteIndex.columns.status'),
|
||||
key: 'status',
|
||||
minWidth: 60,
|
||||
width: 150,
|
||||
align: 'center',
|
||||
render(row: any) {
|
||||
return h(NSwitch, {
|
||||
@@ -54,7 +54,7 @@ const columns: any = [
|
||||
{
|
||||
title: 'SSL',
|
||||
key: 'ssl',
|
||||
minWidth: 60,
|
||||
width: 150,
|
||||
align: 'center',
|
||||
render(row: any) {
|
||||
return h(NSwitch, {
|
||||
@@ -73,7 +73,6 @@ const columns: any = [
|
||||
ellipsis: { tooltip: true },
|
||||
render(row: any) {
|
||||
return h(NInput, {
|
||||
class: 'w-100',
|
||||
size: 'small',
|
||||
value: row.remark,
|
||||
onBlur: () => handleRemark(row),
|
||||
|
||||
Reference in New Issue
Block a user