Skip to content

Commit

Permalink
moved appversion to user settings
Browse files Browse the repository at this point in the history
  • Loading branch information
sinamics committed Aug 7, 2023
1 parent 361b667 commit 0600f8c
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 33 deletions.
12 changes: 7 additions & 5 deletions src/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,7 @@
},
"settings": {
"authentication": "Authentication",
"enableUserRegistration": "Enable user registration?",
"application": "Application",
"version": "Version",
"developerMode": "developer mode"
"enableUserRegistration": "Enable user registration?"
},
"networkSetting": {
"memberAnotations": "Member Anotations",
Expand Down Expand Up @@ -373,9 +370,14 @@
"apiUrlLabel": "Zerotier API Url",
"apiUrlLabelDescription": "The url of the ZeroTier Central API, Default is https://api.zerotier.com/api/v1"
},
"acccountPreferences": {
"accountPreferences": {
"title": "Account Preferences",
"languageLabel": "Language"
},
"application": {
"title": "Application",
"version": "Version",
"developerMode": "developer mode"
}
}
}
Expand Down
10 changes: 6 additions & 4 deletions src/locales/es/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,7 @@
},
"settings": {
"authentication": "Autenticación",
"enableUserRegistration": "¿Habilitar registro de usuario?",
"application": "Aplicación",
"version": "Versión",
"developerMode": "modo de desarrollador"
"enableUserRegistration": "¿Habilitar registro de usuario?"
},
"networkSetting": {
"memberAnotations": "Anotaciones de miembro",
Expand Down Expand Up @@ -376,6 +373,11 @@
"accountPreferences": {
"title": "Preferencias de la cuenta",
"languageLabel": "Idioma"
},
"application": {
"title": "Aplicación",
"version": "Versión",
"developerMode": "modo de desarrollador"
}
}
}
Expand Down
10 changes: 6 additions & 4 deletions src/locales/no/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,7 @@
},
"settings": {
"authentication": "Autentisering",
"enableUserRegistration": "Aktiver brukerregistrering?",
"application": "Applikasjon",
"version": "Versjon",
"developerMode": "utviklermodus"
"enableUserRegistration": "Aktiver brukerregistrering?"
},
"networkSetting": {
"memberAnotations": "Medlemsanmerkninger",
Expand Down Expand Up @@ -376,6 +373,11 @@
"accountPreferences": {
"title": "Kontoinnstillinger",
"languageLabel": "Språk"
},
"application": {
"title": "Applikasjon",
"version": "Versjon",
"developerMode": "utviklermodus"
}
}
}
Expand Down
10 changes: 6 additions & 4 deletions src/locales/zh/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,7 @@
},
"settings": {
"authentication": "身份验证",
"enableUserRegistration": "启用用户注册?",
"application": "应用",
"version": "版本",
"developerMode": "开发者模式"
"enableUserRegistration": "启用用户注册?"
},
"networkSetting": {
"memberAnotations": "成员注释",
Expand Down Expand Up @@ -376,6 +373,11 @@
"accountPreferences": {
"title": "帐户首选项",
"languageLabel": "语言"
},
"application": {
"title": "应用",
"version": "版本",
"developerMode": "开发者模式"
}
}
}
Expand Down
14 changes: 0 additions & 14 deletions src/pages/admin/settings/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { type ReactElement } from "react";
import { LayoutAuthenticated } from "~/components/layouts/layout";
import { api } from "~/utils/api";
import { globalSiteVersion } from "~/utils/global";
import { useTranslations } from "next-intl";

const Settings = () => {
Expand Down Expand Up @@ -45,19 +44,6 @@ const Settings = () => {
/>
</div>
</div>
<div className="pb-10">
<p className="text-sm text-gray-400">{t("settings.application")}</p>
<div className="divider mt-0 p-0 text-gray-500"></div>
<div className="flex items-center justify-between">
<p>{t("settings.version")}</p>
<a
className="link text-primary"
href="https://github.com/sinamics/ztnet/releases"
>
{globalSiteVersion ?? t("settings.developerMode")}
</a>
</div>
</div>
</main>
);
};
Expand Down
20 changes: 18 additions & 2 deletions src/pages/user-settings/account/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { toast } from "react-hot-toast";
import InputField from "~/components/elements/inputField";
import { useRouter } from "next/router";
import { useTranslations } from "next-intl";
import { globalSiteVersion } from "~/utils/global";

const languageNames = {
en: "English",
Expand Down Expand Up @@ -233,13 +234,13 @@ const Account = () => {
</div>
</div>
<p className="pt-10 text-[0.7rem] text-gray-400">
{t("account.acccountPreferences.title")}
{t("account.accountPreferences.title")}
</p>
<div className="divider mt-0 p-0 text-gray-500" />
<div className="form-control w-full max-w-xs">
<label className="label">
<span className="label-text font-medium">
{t("account.acccountPreferences.languageLabel")}
{t("account.accountPreferences.languageLabel")}
</span>
</label>
<select
Expand All @@ -254,6 +255,21 @@ const Account = () => {
))}
</select>
</div>
<div className="py-10">
<p className="text-sm text-gray-400">
{t("account.application.title")}
</p>
<div className="divider mt-0 p-0 text-gray-500"></div>
<div className="flex items-center justify-between">
<p>{t("account.application.version")}</p>
<a
className="link text-primary"
href="https://github.com/sinamics/ztnet/releases"
>
{globalSiteVersion ?? t("account.application.developerMode")}
</a>
</div>
</div>
</div>
</main>
);
Expand Down

0 comments on commit 0600f8c

Please sign in to comment.