diff --git a/api/system.go b/api/system.go index a916e832..92052745 100644 --- a/api/system.go +++ b/api/system.go @@ -10,8 +10,6 @@ type SystemStatus struct { // System settings // Allow sign up. AllowSignUp bool `json:"allowSignUp"` - // Ignore upgrade - IgnoreUpgrade bool `json:"ignoreUpgrade"` // Disable public memos. DisablePublicMemos bool `json:"disablePublicMemos"` // Max upload size. diff --git a/api/system_setting.go b/api/system_setting.go index d2e0a399..471a937f 100644 --- a/api/system_setting.go +++ b/api/system_setting.go @@ -17,8 +17,6 @@ const ( SystemSettingSecretSessionName SystemSettingName = "secret-session" // SystemSettingAllowSignUpName is the name of allow signup setting. SystemSettingAllowSignUpName SystemSettingName = "allow-signup" - // SystemSettingIgnoreUpgradeName is the name of ignore upgrade. - SystemSettingIgnoreUpgradeName SystemSettingName = "ignore-upgrade" // SystemSettingDisablePublicMemosName is the name of disable public memos setting. SystemSettingDisablePublicMemosName SystemSettingName = "disable-public-memos" // SystemSettingMaxUploadSizeMiBName is the name of max upload size setting. @@ -69,8 +67,6 @@ func (key SystemSettingName) String() string { return "secret-session" case SystemSettingAllowSignUpName: return "allow-signup" - case SystemSettingIgnoreUpgradeName: - return "ignore-upgrade" case SystemSettingDisablePublicMemosName: return "disable-public-memos" case SystemSettingMaxUploadSizeMiBName: @@ -119,11 +115,6 @@ func (upsert SystemSettingUpsert) Validate() error { if err := json.Unmarshal([]byte(upsert.Value), &value); err != nil { return fmt.Errorf(systemSettingUnmarshalError, settingName) } - case SystemSettingIgnoreUpgradeName: - var value bool - if err := json.Unmarshal([]byte(upsert.Value), &value); err != nil { - return fmt.Errorf(systemSettingUnmarshalError, settingName) - } case SystemSettingDisablePublicMemosName: var value bool if err := json.Unmarshal([]byte(upsert.Value), &value); err != nil { diff --git a/server/system.go b/server/system.go index eb23a0b0..15d12a6b 100644 --- a/server/system.go +++ b/server/system.go @@ -42,7 +42,6 @@ func (s *Server) registerSystemRoutes(g *echo.Group) { Profile: *s.Profile, DBSize: 0, AllowSignUp: false, - IgnoreUpgrade: false, DisablePublicMemos: false, MaxUploadSizeMiB: 32, AdditionalStyle: "", @@ -79,8 +78,6 @@ func (s *Server) registerSystemRoutes(g *echo.Group) { switch systemSetting.Name { case api.SystemSettingAllowSignUpName: systemStatus.AllowSignUp = baseValue.(bool) - case api.SystemSettingIgnoreUpgradeName: - systemStatus.IgnoreUpgrade = baseValue.(bool) case api.SystemSettingDisablePublicMemosName: systemStatus.DisablePublicMemos = baseValue.(bool) case api.SystemSettingMaxUploadSizeMiBName: diff --git a/web/src/components/ArchivedMemo.tsx b/web/src/components/ArchivedMemo.tsx index 392b48d9..297f01e1 100644 --- a/web/src/components/ArchivedMemo.tsx +++ b/web/src/components/ArchivedMemo.tsx @@ -3,6 +3,8 @@ import { useTranslation } from "react-i18next"; import { useMemoStore } from "@/store/module"; import { getDateTimeString } from "@/helpers/datetime"; import useToggle from "@/hooks/useToggle"; +import Tooltip from "./kit/Tooltip"; +import Icon from "./Icon"; import MemoContent from "./MemoContent"; import MemoResourceListView from "./MemoResourceListView"; import "@/less/memo.less"; @@ -53,15 +55,23 @@ const ArchivedMemo: React.FC = (props: Props) => { return (
- {getDateTimeString(memo.updatedTs)} -
- - {t("common.restore")} - - - {t("common.delete")} - {showConfirmDeleteBtn ? "!" : ""} - +
+ {getDateTimeString(memo.updatedTs)} +
+
+ + + + + +
diff --git a/web/src/components/DemoBanner.tsx b/web/src/components/DemoBanner.tsx index da1ea3d0..4f44bc9a 100644 --- a/web/src/components/DemoBanner.tsx +++ b/web/src/components/DemoBanner.tsx @@ -23,7 +23,7 @@ const DemoBanner: React.FC = () => { if (!state.show) return null; return ( -
+
+ )} {isVisitorMode && ( diff --git a/web/src/components/Settings/SystemSection.tsx b/web/src/components/Settings/SystemSection.tsx index fa38fdcc..add1c2a5 100644 --- a/web/src/components/Settings/SystemSection.tsx +++ b/web/src/components/Settings/SystemSection.tsx @@ -12,7 +12,6 @@ import "@/less/settings/system-section.less"; interface State { dbSize: number; allowSignUp: boolean; - ignoreUpgrade: boolean; disablePublicMemos: boolean; additionalStyle: string; additionalScript: string; @@ -27,7 +26,6 @@ const SystemSection = () => { const [state, setState] = useState({ dbSize: systemStatus.dbSize, allowSignUp: systemStatus.allowSignUp, - ignoreUpgrade: systemStatus.ignoreUpgrade, additionalStyle: systemStatus.additionalStyle, additionalScript: systemStatus.additionalScript, disablePublicMemos: systemStatus.disablePublicMemos, @@ -82,17 +80,6 @@ const SystemSection = () => { }); }; - const handleIgnoreUpgradeChanged = async (value: boolean) => { - setState({ - ...state, - ignoreUpgrade: value, - }); - await api.upsertSystemSetting({ - name: "ignore-upgrade", - value: JSON.stringify(value), - }); - }; - const handleUpdateCustomizedProfileButtonClick = () => { showUpdateCustomizedProfileDialog(); }; @@ -261,10 +248,6 @@ const SystemSection = () => { {t("setting.system-section.allow-user-signup")} handleAllowSignUpChanged(event.target.checked)} />
-
- {t("setting.system-section.ignore-version-upgrade")} - handleIgnoreUpgradeChanged(event.target.checked)} /> -
{t("setting.system-section.disable-public-memos")} handleDisablePublicMemosChanged(event.target.checked)} /> diff --git a/web/src/components/UpgradeVersionBanner.tsx b/web/src/components/UpgradeVersionBanner.tsx index 1eae70e1..ba47726b 100644 --- a/web/src/components/UpgradeVersionBanner.tsx +++ b/web/src/components/UpgradeVersionBanner.tsx @@ -4,13 +4,14 @@ import * as api from "@/helpers/api"; import storage from "@/helpers/storage"; import { useGlobalStore } from "@/store/module"; import Icon from "./Icon"; +import Tooltip from "./kit/Tooltip"; interface State { latestVersion: string; show: boolean; } -const UpgradeVersionBanner: React.FC = () => { +const UpgradeVersionView: React.FC = () => { const globalStore = useGlobalStore(); const profile = globalStore.state.systemStatus.profile; const [state, setState] = useState({ @@ -19,10 +20,6 @@ const UpgradeVersionBanner: React.FC = () => { }); useEffect(() => { - if (globalStore.state.systemStatus.ignoreUpgrade) { - return; - } - api.getRepoLatestTag().then((latestTag) => { const { skippedVersion } = storage.get(["skippedVersion"]); const latestVersion = latestTag.slice(1) || "0.0.0"; @@ -46,20 +43,21 @@ const UpgradeVersionBanner: React.FC = () => { if (!state.show) return null; return ( -
+ ); }; -export default UpgradeVersionBanner; +export default UpgradeVersionView; diff --git a/web/src/layouts/Root.tsx b/web/src/layouts/Root.tsx index 7c779db1..0a9f16c7 100644 --- a/web/src/layouts/Root.tsx +++ b/web/src/layouts/Root.tsx @@ -1,6 +1,5 @@ import { Outlet } from "react-router-dom"; import Header from "@/components/Header"; -import UpgradeVersionBanner from "@/components/UpgradeVersionBanner"; import DemoBanner from "@/components/DemoBanner"; function Root() { @@ -8,9 +7,8 @@ function Root() {
-
-
+
diff --git a/web/src/less/memo.less b/web/src/less/memo.less index 62dfdefd..b2131237 100644 --- a/web/src/less/memo.less +++ b/web/src/less/memo.less @@ -5,10 +5,6 @@ @apply border-gray-200 border-2 dark:border-zinc-600; } - &.archived { - @apply border-gray-200 dark:border-zinc-600; - } - > .memo-top-wrapper { @apply flex flex-row justify-between items-center w-full h-6 mb-1; @@ -36,10 +32,6 @@ } } - > .time-text { - @apply text-xs text-gray-400 cursor-pointer; - } - > .btns-container { @apply flex flex-row justify-end items-center relative shrink-0; diff --git a/web/src/store/module/global.ts b/web/src/store/module/global.ts index 86a7f189..06244ed0 100644 --- a/web/src/store/module/global.ts +++ b/web/src/store/module/global.ts @@ -11,7 +11,6 @@ export const initialGlobalState = async () => { appearance: "system" as Appearance, systemStatus: { allowSignUp: false, - ignoreUpgrade: false, disablePublicMemos: false, maxUploadSizeMiB: 0, additionalStyle: "", diff --git a/web/src/store/reducer/global.ts b/web/src/store/reducer/global.ts index e0b6e1a0..48362f5f 100644 --- a/web/src/store/reducer/global.ts +++ b/web/src/store/reducer/global.ts @@ -19,7 +19,6 @@ const globalSlice = createSlice({ }, dbSize: 0, allowSignUp: false, - ignoreUpgrade: false, disablePublicMemos: false, additionalStyle: "", additionalScript: "", diff --git a/web/src/types/modules/system.d.ts b/web/src/types/modules/system.d.ts index fe942163..92220ff4 100644 --- a/web/src/types/modules/system.d.ts +++ b/web/src/types/modules/system.d.ts @@ -23,7 +23,6 @@ interface SystemStatus { dbSize: number; // System settings allowSignUp: boolean; - ignoreUpgrade: boolean; disablePublicMemos: boolean; maxUploadSizeMiB: number; additionalStyle: string;