1 parent
610cd0e899
commit
574f83615e
5 files changed
+23
-7
No files matched your search
+11
-1
@@ -1,10 +1,20 @@
|
|||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
|
|
||||||
|
import { readFileSync } from 'fs';
|
||||||
|
|
||||||
|
const { version } = JSON.parse(readFileSync('./package.json', 'utf-8'));
|
||||||
|
|
||||||
|
console.log(`Version: ${version}`);
|
||||||
|
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
reactStrictMode: false,
|
reactStrictMode: false,
|
||||||
output: 'standalone',
|
output: 'standalone',
|
||||||
images: {
|
images: {
|
||||||
unoptimized: true,
|
unoptimized: true,
|
||||||
}
|
},
|
||||||
|
env: {
|
||||||
|
VERSION: version,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig;
|
||||||
@@ -8,7 +8,7 @@ import { useToast } from "../ui/use-toast";
|
|||||||
|
|
||||||
export default function ProfileInfo() {
|
export default function ProfileInfo() {
|
||||||
const { updateContext, ...user } = useCurrentUser()
|
const { updateContext, ...user } = useCurrentUser()
|
||||||
const { immichURL, exImmichUrl } = useConfig();
|
const { immichURL, exImmichUrl, version } = useConfig();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
|
|
||||||
const handleLogout = () => logoutUser()
|
const handleLogout = () => logoutUser()
|
||||||
@@ -44,7 +44,7 @@ export default function ProfileInfo() {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="border text-muted-foreground text-xs text-center py-2">
|
<div className="border text-muted-foreground text-xs py-2 flex justify-between items-center px-2">
|
||||||
<p>
|
<p>
|
||||||
Made with <span className="text-red-500">♥</span> by{" "}
|
Made with <span className="text-red-500">♥</span> by{" "}
|
||||||
<Link
|
<Link
|
||||||
@@ -55,6 +55,9 @@ export default function ProfileInfo() {
|
|||||||
@zathvarun
|
@zathvarun
|
||||||
</Link>
|
</Link>
|
||||||
</p>
|
</p>
|
||||||
|
<Link target="_blank" href={`https://github.com/varun-raj/immich-power-tools/releases/tag/v${version}`}>
|
||||||
|
v{version}
|
||||||
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ export const ENV = {
|
|||||||
DATABASE_URL: (process.env.DATABASE_URL || `postgresql://${process.env.DB_USERNAME}:${process.env.DB_PASSWORD}@${(process.env.DB_HOST || 'immich_postgres')}:${(process.env.DB_PORT || '5432')}/${process.env.DB_DATABASE_NAME}`),
|
DATABASE_URL: (process.env.DATABASE_URL || `postgresql://${process.env.DB_USERNAME}:${process.env.DB_PASSWORD}@${(process.env.DB_HOST || 'immich_postgres')}:${(process.env.DB_PORT || '5432')}/${process.env.DB_DATABASE_NAME}`),
|
||||||
JWT_SECRET: process.env.JWT_SECRET as string,
|
JWT_SECRET: process.env.JWT_SECRET as string,
|
||||||
SECURE_COOKIE: process.env.SECURE_COOKIE === 'true',
|
SECURE_COOKIE: process.env.SECURE_COOKIE === 'true',
|
||||||
|
VERSION: process.env.VERSION
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -3,11 +3,13 @@ import { createContext, useContext } from "react";
|
|||||||
interface ConfigContextType {
|
interface ConfigContextType {
|
||||||
immichURL: string;
|
immichURL: string;
|
||||||
exImmichUrl: string;
|
exImmichUrl: string;
|
||||||
|
version?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ConfigContext = createContext<ConfigContextType>({
|
const ConfigContext = createContext<ConfigContextType>({
|
||||||
immichURL: "",
|
immichURL: "",
|
||||||
exImmichUrl: "",
|
exImmichUrl: "",
|
||||||
|
version: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
export default ConfigContext;
|
export default ConfigContext;
|
||||||
|
|||||||
+4
-4
@@ -4,14 +4,12 @@ import type { AppProps } from "next/app";
|
|||||||
import { ThemeProvider } from "next-themes";
|
import { ThemeProvider } from "next-themes";
|
||||||
import { ENV } from "@/config/environment";
|
import { ENV } from "@/config/environment";
|
||||||
import ConfigContext from "@/contexts/ConfigContext";
|
import ConfigContext from "@/contexts/ConfigContext";
|
||||||
import { useEffect, useRef, useState } from "react";
|
import { useRef } from "react";
|
||||||
import { getMe } from "@/handlers/api/user.handler";
|
|
||||||
import { db } from "@/config/db";
|
|
||||||
|
|
||||||
interface AppPropsWithProps extends AppProps {
|
interface AppPropsWithProps extends AppProps {
|
||||||
props: {
|
props: {
|
||||||
immichURL: string;
|
immichURL: string;
|
||||||
exImmichUrl: string;
|
exImmichUrl: string;
|
||||||
|
version?: string;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const App = ({ Component, pageProps, ...props }: AppPropsWithProps) => {
|
const App = ({ Component, pageProps, ...props }: AppPropsWithProps) => {
|
||||||
@@ -29,10 +27,12 @@ const App = ({ Component, pageProps, ...props }: AppPropsWithProps) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
App.getInitialProps = async () => {
|
App.getInitialProps = async () => {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
exImmichUrl: ENV.EXTERNAL_IMMICH_URL,
|
exImmichUrl: ENV.EXTERNAL_IMMICH_URL,
|
||||||
immichURL: ENV.IMMICH_URL,
|
immichURL: ENV.IMMICH_URL,
|
||||||
|
version: ENV.VERSION
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user