refactor(ui): clean code

This commit is contained in:
Fu Diwei
2025-08-29 13:00:21 +08:00
parent 1cf55ba974
commit 90907427ba
3 changed files with 15 additions and 11 deletions
+2 -3
View File
@@ -3,12 +3,11 @@
import (
"fmt"
"github.com/go-acme/lego/v4/challenge"
"github.com/certimate-go/certimate/internal/domain"
"github.com/certimate-go/certimate/pkg/core"
)
type ProviderFactoryFunc func(options *ProviderFactoryOptions) (challenge.Provider, error)
type ProviderFactoryFunc func(options *ProviderFactoryOptions) (core.ACMEChallenger, error)
type ProviderFactoryOptions struct {
AccessConfig map[string]any
+1 -1
View File
@@ -9,7 +9,7 @@ i18n
.use(initReactI18next)
.init({
resources,
fallbackLng: LOCALE_ZH_NAME,
fallbackLng: LOCALE_EN_NAME,
debug: true,
interpolation: {
escapeValue: false,
+12 -7
View File
@@ -136,14 +136,19 @@ const SettingsDiagnosticsLogs = ({ className, style }: { className?: string; sty
</div>
</Show>
<Show when={listData.length === 0 && !loading}>
<Empty description={loadError ? getErrMsg(loadError) : t("common.text.nodata")} image={Empty.PRESENTED_IMAGE_SIMPLE}>
<Button icon={<IconReload size="1.25em" />} type="primary" onClick={handleReloadClick}>
{t("common.button.reload")}
</Button>
</Empty>
<div className="px-4 py-2">
<div className="w-full overflow-hidden">
<div className="text-xs leading-relaxed text-stone-400">{loadError ? `> ${getErrMsg(loadError)}` : "> no logs avaiable"}</div>
</div>
<div className="flex w-full items-center">
<a onClick={handleReloadClick}>
<span className="text-xs">{t("common.button.reload")}</span>
</a>
</div>
</div>
</Show>
<Show when={listData.length > 0}>
<div className="min-h-16 px-4 py-2">
<div className="px-4 py-2">
<div className="flex w-full flex-col overflow-hidden">
{listData.map((record) => {
return (
@@ -235,7 +240,7 @@ const SettingsDiagnosticsCrons = ({ className, style }: { className?: string; st
emptyText: (
<Empty description={loadError ? getErrMsg(loadError) : t("common.text.nodata")} image={Empty.PRESENTED_IMAGE_SIMPLE}>
{loadError && (
<Button icon={<IconReload size="1.25em" />} type="primary" onClick={handleReloadClick}>
<Button ghost icon={<IconReload size="1.25em" />} type="primary" onClick={handleReloadClick}>
{t("common.button.reload")}
</Button>
)}