Compare commits
2 commits
develop
...
release/0.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
20cc8479db | ||
![]() |
b1c1abeb9f |
9 changed files with 14 additions and 9 deletions
|
@ -43,6 +43,8 @@ services:
|
||||||
container_name: tipi-redis
|
container_name: tipi-redis
|
||||||
image: redis:alpine
|
image: redis:alpine
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- 6379:6379
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/redis:/data
|
- ./data/redis:/data
|
||||||
networks:
|
networks:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "runtipi",
|
"name": "runtipi",
|
||||||
"version": "0.7.2",
|
"version": "0.7.3",
|
||||||
"description": "A homeserver for everyone",
|
"description": "A homeserver for everyone",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "husky install",
|
"prepare": "husky install",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "dashboard",
|
"name": "dashboard",
|
||||||
"version": "0.7.2",
|
"version": "0.7.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "jest --colors",
|
"test": "jest --colors",
|
||||||
|
|
|
@ -11,6 +11,7 @@ import { IconType } from 'react-icons';
|
||||||
import { useLogoutMutation, useVersionQuery } from '../../generated/graphql';
|
import { useLogoutMutation, useVersionQuery } from '../../generated/graphql';
|
||||||
import { getUrl } from '../../core/helpers/url-helpers';
|
import { getUrl } from '../../core/helpers/url-helpers';
|
||||||
import { BsHeart } from 'react-icons/bs';
|
import { BsHeart } from 'react-icons/bs';
|
||||||
|
import semver from 'semver';
|
||||||
|
|
||||||
const SideMenu: React.FC = () => {
|
const SideMenu: React.FC = () => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -19,7 +20,8 @@ const SideMenu: React.FC = () => {
|
||||||
const versionQuery = useVersionQuery();
|
const versionQuery = useVersionQuery();
|
||||||
const path = router.pathname.split('/')[1];
|
const path = router.pathname.split('/')[1];
|
||||||
|
|
||||||
const isLatest = versionQuery.data?.version.latest === versionQuery.data?.version.current;
|
const defaultVersion = '0.0.0';
|
||||||
|
const isLatest = semver.gte(versionQuery.data?.version.current || defaultVersion, versionQuery.data?.version.latest || defaultVersion);
|
||||||
|
|
||||||
const renderMenuItem = (title: string, name: string, Icon: IconType) => {
|
const renderMenuItem = (title: string, name: string, Icon: IconType) => {
|
||||||
const selected = path === name;
|
const selected = path === name;
|
||||||
|
|
|
@ -29,11 +29,12 @@ export default function useCachedResources(): IReturnProps {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const hostname = window.location.hostname;
|
const hostname = window.location.hostname;
|
||||||
const port = window.location.port;
|
const port = window.location.port;
|
||||||
|
const protocol = window.location.protocol;
|
||||||
|
|
||||||
if (!port) {
|
if (!port) {
|
||||||
setBaseUrl(`http://${hostname}/api`);
|
setBaseUrl(`${protocol}://${hostname}/api`);
|
||||||
} else {
|
} else {
|
||||||
setBaseUrl(`http://${hostname}:${port}/api`);
|
setBaseUrl(`${protocol}//${hostname}:${port}/api`);
|
||||||
}
|
}
|
||||||
}, [setBaseUrl]);
|
}, [setBaseUrl]);
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ const Settings: NextPage = () => {
|
||||||
const [logout] = useLogoutMutation({ refetchQueries: ['Me'] });
|
const [logout] = useLogoutMutation({ refetchQueries: ['Me'] });
|
||||||
|
|
||||||
const defaultVersion = '0.0.0';
|
const defaultVersion = '0.0.0';
|
||||||
const isLatest = semver.gte(data?.version.latest || defaultVersion, data?.version.current || defaultVersion);
|
const isLatest = semver.gte(data?.version.current || defaultVersion, data?.version.latest || defaultVersion);
|
||||||
|
|
||||||
const handleError = (error: unknown) => {
|
const handleError = (error: unknown) => {
|
||||||
if (error instanceof Error) {
|
if (error instanceof Error) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "system-api",
|
"name": "system-api",
|
||||||
"version": "0.7.2",
|
"version": "0.7.3",
|
||||||
"description": "",
|
"description": "",
|
||||||
"exports": "./dist/server.js",
|
"exports": "./dist/server.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|
|
@ -43,10 +43,9 @@ const getVersion = async (): Promise<{ current: string; latest?: string }> => {
|
||||||
const { data } = await axios.get('https://api.github.com/repos/meienberger/runtipi/releases/latest');
|
const { data } = await axios.get('https://api.github.com/repos/meienberger/runtipi/releases/latest');
|
||||||
|
|
||||||
version = data.name.replace('v', '');
|
version = data.name.replace('v', '');
|
||||||
|
await TipiCache.set('latestVersion', version?.replace('v', '') || '', 60 * 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
await TipiCache.set('latestVersion', version?.replace('v', '') || '', 60 * 60);
|
|
||||||
|
|
||||||
return { current: getConfig().version, latest: version?.replace('v', '') };
|
return { current: getConfig().version, latest: version?.replace('v', '') };
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error(e);
|
logger.error(e);
|
||||||
|
|
|
@ -19,6 +19,7 @@ import startJobs from './core/jobs/jobs';
|
||||||
import { applyJsonConfig, getConfig, setConfig } from './core/config/TipiConfig';
|
import { applyJsonConfig, getConfig, setConfig } from './core/config/TipiConfig';
|
||||||
import systemController from './modules/system/system.controller';
|
import systemController from './modules/system/system.controller';
|
||||||
import { eventDispatcher, EventTypes } from './core/config/EventDispatcher';
|
import { eventDispatcher, EventTypes } from './core/config/EventDispatcher';
|
||||||
|
import TipiCache from './config/TipiCache';
|
||||||
|
|
||||||
const applyCustomConfig = () => {
|
const applyCustomConfig = () => {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Add table
Reference in a new issue