feat: add option to disable update checker (#502)
* feat: add option to disable update checker Add a new setting in User Profile > Settings to disable automatic update checking on startup and dashboard. - Adds 'Disable Update Check' toggle in profile settings - Skips GitHub API calls when disabled (reduces network requests) - Works for both web app and Electron client Fixes Termix-SSH/Support#410 * feat: remove locales --------- Co-authored-by: LukeGus <bugattiguy527@gmail.com>
This commit was merged in pull request #502.
This commit is contained in:
@@ -1958,6 +1958,9 @@
|
|||||||
"terminalSettings": "Terminal",
|
"terminalSettings": "Terminal",
|
||||||
"hostSidebarSettings": "Host & Sidebar",
|
"hostSidebarSettings": "Host & Sidebar",
|
||||||
"snippetsSettings": "Snippets",
|
"snippetsSettings": "Snippets",
|
||||||
|
"updateSettings": "Updates",
|
||||||
|
"disableUpdateCheck": "Disable Update Check",
|
||||||
|
"disableUpdateCheckDesc": "Stop checking for new versions on startup and dashboard. Reduces network requests.",
|
||||||
"currentPassword": "Current Password",
|
"currentPassword": "Current Password",
|
||||||
"passwordChangedSuccess": "Password changed successfully! Please log in again.",
|
"passwordChangedSuccess": "Password changed successfully! Please log in again.",
|
||||||
"failedToChangePassword": "Failed to change password. Please check your current password and try again.",
|
"failedToChangePassword": "Failed to change password. Please check your current password and try again.",
|
||||||
|
|||||||
@@ -160,6 +160,8 @@ export function Dashboard({
|
|||||||
const uptimeInfo = await getUptime();
|
const uptimeInfo = await getUptime();
|
||||||
setUptime(uptimeInfo.formatted);
|
setUptime(uptimeInfo.formatted);
|
||||||
|
|
||||||
|
const updateCheckDisabled = localStorage.getItem("disableUpdateCheck") === "true";
|
||||||
|
if (!updateCheckDisabled) {
|
||||||
const versionInfo = await getVersionInfo();
|
const versionInfo = await getVersionInfo();
|
||||||
setVersionText(`v${versionInfo.localVersion}`);
|
setVersionText(`v${versionInfo.localVersion}`);
|
||||||
if (
|
if (
|
||||||
@@ -168,6 +170,7 @@ export function Dashboard({
|
|||||||
) {
|
) {
|
||||||
setVersionStatus(versionInfo.status);
|
setVersionStatus(versionInfo.status);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await getDatabaseHealth();
|
await getDatabaseHealth();
|
||||||
|
|||||||
@@ -30,6 +30,11 @@ export function ElectronVersionCheck({
|
|||||||
const lineColor = isDarkMode ? "#151517" : "#f9f9f9";
|
const lineColor = isDarkMode ? "#151517" : "#f9f9f9";
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
const updateCheckDisabled = localStorage.getItem("disableUpdateCheck") === "true";
|
||||||
|
if (updateCheckDisabled) {
|
||||||
|
onContinue();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (isElectron()) {
|
if (isElectron()) {
|
||||||
checkForUpdates();
|
checkForUpdates();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -133,6 +133,9 @@ export function UserProfile({
|
|||||||
const saved = localStorage.getItem("showHostTags");
|
const saved = localStorage.getItem("showHostTags");
|
||||||
return saved !== null ? saved === "true" : true;
|
return saved !== null ? saved === "true" : true;
|
||||||
});
|
});
|
||||||
|
const [disableUpdateCheck, setDisableUpdateCheck] = useState<boolean>(
|
||||||
|
localStorage.getItem("disableUpdateCheck") === "true",
|
||||||
|
);
|
||||||
const [userRoles, setUserRoles] = useState<UserRole[]>([]);
|
const [userRoles, setUserRoles] = useState<UserRole[]>([]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -212,6 +215,11 @@ export function UserProfile({
|
|||||||
window.dispatchEvent(new Event("showHostTagsChanged"));
|
window.dispatchEvent(new Event("showHostTagsChanged"));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleDisableUpdateCheckToggle = (enabled: boolean) => {
|
||||||
|
setDisableUpdateCheck(enabled);
|
||||||
|
localStorage.setItem("disableUpdateCheck", enabled.toString());
|
||||||
|
};
|
||||||
|
|
||||||
const handleDeleteAccount = async (e: React.FormEvent) => {
|
const handleDeleteAccount = async (e: React.FormEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setDeleteLoading(true);
|
setDeleteLoading(true);
|
||||||
@@ -613,6 +621,28 @@ export function UserProfile({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="rounded-lg border-2 border-edge bg-elevated p-4">
|
||||||
|
<h3 className="text-lg font-semibold mb-4">
|
||||||
|
{t("profile.updateSettings")}
|
||||||
|
</h3>
|
||||||
|
<div className="space-y-4">
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<Label className="text-foreground-secondary">
|
||||||
|
{t("profile.disableUpdateCheck")}
|
||||||
|
</Label>
|
||||||
|
<p className="text-sm text-muted-foreground mt-1">
|
||||||
|
{t("profile.disableUpdateCheckDesc")}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<Switch
|
||||||
|
checked={disableUpdateCheck}
|
||||||
|
onCheckedChange={handleDisableUpdateCheckToggle}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</TabsContent>
|
</TabsContent>
|
||||||
|
|
||||||
<TabsContent value="security" className="space-y-4">
|
<TabsContent value="security" className="space-y-4">
|
||||||
|
|||||||
Reference in New Issue
Block a user