mirror of
https://github.com/certimate-go/certimate.git
synced 2026-09-24 23:10:13 +08:00
refactor(ui): clean code
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -9,7 +9,7 @@ i18n
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
resources,
|
||||
fallbackLng: LOCALE_ZH_NAME,
|
||||
fallbackLng: LOCALE_EN_NAME,
|
||||
debug: true,
|
||||
interpolation: {
|
||||
escapeValue: false,
|
||||
|
||||
@@ -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>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user