From 0c7373c7e89a4ff717efaa7d6a5854f7ccd6a8d3 Mon Sep 17 00:00:00 2001
From: Danshil Kokil Mungur
Date: Tue, 15 Mar 2022 17:01:11 +0400
Subject: [PATCH] feat(about): show config directory (#2600)
* feat(about): show config directory
* feat(about): run yarn i18n:extract
* refactor(about): use existing appdata path method
* feat(about): suggested changes
* refactor(logs): rename variable to be more consistent
* feat: suggested changes
---
overseerr-api.yml | 3 +++
server/interfaces/api/settingsInterfaces.ts | 1 +
server/routes/settings/index.ts | 2 ++
src/components/Settings/SettingsAbout/index.tsx | 4 ++++
src/components/Settings/SettingsLogs/index.tsx | 4 ++--
src/i18n/locale/en.json | 3 ++-
6 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/overseerr-api.yml b/overseerr-api.yml
index 5a028d34..77282ea1 100644
--- a/overseerr-api.yml
+++ b/overseerr-api.yml
@@ -3042,6 +3042,9 @@ paths:
type: string
nullable: true
example: Asia/Tokyo
+ appDataPath:
+ type: string
+ example: /app/config
/auth/me:
get:
summary: Get logged-in user
diff --git a/server/interfaces/api/settingsInterfaces.ts b/server/interfaces/api/settingsInterfaces.ts
index 2f556635..8e4f66c4 100644
--- a/server/interfaces/api/settingsInterfaces.ts
+++ b/server/interfaces/api/settingsInterfaces.ts
@@ -17,6 +17,7 @@ export interface SettingsAboutResponse {
totalRequests: number;
totalMediaItems: number;
tz?: string;
+ appDataPath: string;
}
export interface PublicSettingsResponse {
diff --git a/server/routes/settings/index.ts b/server/routes/settings/index.ts
index 6532980c..bd9c1164 100644
--- a/server/routes/settings/index.ts
+++ b/server/routes/settings/index.ts
@@ -26,6 +26,7 @@ import { plexFullScanner } from '../../lib/scanners/plex';
import { getSettings, MainSettings } from '../../lib/settings';
import logger from '../../logger';
import { isAuthenticated } from '../../middleware/auth';
+import { appDataPath } from '../../utils/appDataVolume';
import { getAppVersion } from '../../utils/appVersion';
import notificationRoutes from './notifications';
import radarrRoutes from './radarr';
@@ -564,6 +565,7 @@ settingsRoutes.get('/about', async (req, res) => {
totalMediaItems,
totalRequests,
tz: process.env.TZ,
+ appDataPath: appDataPath(),
} as SettingsAboutResponse);
});
diff --git a/src/components/Settings/SettingsAbout/index.tsx b/src/components/Settings/SettingsAbout/index.tsx
index a9d41c1e..2b638108 100644
--- a/src/components/Settings/SettingsAbout/index.tsx
+++ b/src/components/Settings/SettingsAbout/index.tsx
@@ -24,6 +24,7 @@ const messages = defineMessages({
gettingsupport: 'Getting Support',
githubdiscussions: 'GitHub Discussions',
timezone: 'Time Zone',
+ appDataPath: 'Data Directory',
supportoverseerr: 'Support Overseerr',
helppaycoffee: 'Help Pay for Coffee',
documentation: 'Documentation',
@@ -143,6 +144,9 @@ const SettingsAbout: React.FC = () => {
{intl.formatNumber(data.totalRequests)}
+
+ {data.appDataPath}
+
{data.tz && (
{data.tz}
diff --git a/src/components/Settings/SettingsLogs/index.tsx b/src/components/Settings/SettingsLogs/index.tsx
index b604e8ab..0a607e0a 100644
--- a/src/components/Settings/SettingsLogs/index.tsx
+++ b/src/components/Settings/SettingsLogs/index.tsx
@@ -31,7 +31,7 @@ import Transition from '../../Transition';
const messages = defineMessages({
logs: 'Logs',
logsDescription:
- 'You can also view these logs directly via stdout
, or in {configDir}/logs/overseerr.log
.',
+ 'You can also view these logs directly via stdout
, or in {appDataPath}/logs/overseerr.log
.',
time: 'Timestamp',
level: 'Severity',
label: 'Label',
@@ -235,7 +235,7 @@ const SettingsLogs: React.FC = () => {
code: function code(msg) {
return {msg}
;
},
- configDir: appData ? appData.appDataPath : '/app/config',
+ appDataPath: appData ? appData.appDataPath : '/app/config',
})}
diff --git a/src/i18n/locale/en.json b/src/i18n/locale/en.json
index 5f8c7542..6bcb3932 100644
--- a/src/i18n/locale/en.json
+++ b/src/i18n/locale/en.json
@@ -564,6 +564,7 @@
"components.Settings.SettingsAbout.Releases.viewchangelog": "View Changelog",
"components.Settings.SettingsAbout.Releases.viewongithub": "View on GitHub",
"components.Settings.SettingsAbout.about": "About",
+ "components.Settings.SettingsAbout.appDataPath": "Data Directory",
"components.Settings.SettingsAbout.betawarning": "This is BETA software. Features may be broken and/or unstable. Please report any issues on GitHub!",
"components.Settings.SettingsAbout.documentation": "Documentation",
"components.Settings.SettingsAbout.gettingsupport": "Getting Support",
@@ -625,7 +626,7 @@
"components.Settings.SettingsLogs.level": "Severity",
"components.Settings.SettingsLogs.logDetails": "Log Details",
"components.Settings.SettingsLogs.logs": "Logs",
- "components.Settings.SettingsLogs.logsDescription": "You can also view these logs directly via stdout
, or in {configDir}/logs/overseerr.log
.",
+ "components.Settings.SettingsLogs.logsDescription": "You can also view these logs directly via stdout
, or in {appDataPath}/logs/overseerr.log
.",
"components.Settings.SettingsLogs.message": "Message",
"components.Settings.SettingsLogs.pauseLogs": "Pause",
"components.Settings.SettingsLogs.resumeLogs": "Resume",