mirror of
https://github.com/ajnart/homarr.git
synced 2026-03-06 04:11:04 +01:00
🔀 Merge branch 'dev' into next-13
This commit is contained in:
@@ -1,14 +1,6 @@
|
||||
import Dockerode from 'dockerode';
|
||||
import { MatchingImages, ServiceType, tryMatchPort } from './types';
|
||||
|
||||
async function MatchIcon(name: string) {
|
||||
const res = await fetch(
|
||||
`https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/${name
|
||||
.replace(/\s+/g, '-')
|
||||
.toLowerCase()}.png`
|
||||
);
|
||||
return res.ok ? res.url : '/imgs/favicon/favicon.png';
|
||||
}
|
||||
import { MatchingImages, ServiceType, tryMatchPort } from './types';
|
||||
|
||||
function tryMatchType(imageName: string): ServiceType {
|
||||
// Try to find imageName inside MatchingImages
|
||||
|
||||
15
src/tools/client/zustands/usePackageAttributesStore.ts
Normal file
15
src/tools/client/zustands/usePackageAttributesStore.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import create from 'zustand';
|
||||
|
||||
import { ServerSidePackageAttributesType } from '../../server/getPackageVersion';
|
||||
|
||||
interface PackageAttributesState {
|
||||
attributes: ServerSidePackageAttributesType;
|
||||
setInitialPackageAttributes: (attributes: ServerSidePackageAttributesType) => void;
|
||||
}
|
||||
|
||||
export const usePackageAttributesStore = create<PackageAttributesState>((set) => ({
|
||||
attributes: { packageVersion: undefined, environment: 'test' },
|
||||
setInitialPackageAttributes(attributes) {
|
||||
set((state) => ({ ...state, attributes }));
|
||||
},
|
||||
}));
|
||||
@@ -9,7 +9,7 @@ import { ICalendarWidget } from '../../widgets/calendar/CalendarTile';
|
||||
import { IDashDotTile } from '../../widgets/dashDot/DashDotTile';
|
||||
import { IDateWidget } from '../../widgets/date/DateTile';
|
||||
import { ITorrent } from '../../widgets/torrent/TorrentTile';
|
||||
import { ITorrentNetworkTraffic } from '../../widgets/torrentNetworkTraffic/TorrentNetworkTrafficTile';
|
||||
import { ITorrentNetworkTraffic } from '../../widgets/download-speed/TorrentNetworkTrafficTile';
|
||||
import { IUsenetWidget } from '../../widgets/useNet/UseNetTile';
|
||||
import { IWeatherWidget } from '../../widgets/weather/WeatherTile';
|
||||
import { IWidget } from '../../widgets/widgets';
|
||||
|
||||
@@ -131,6 +131,12 @@ export const languages: Language[] = [
|
||||
translatedName: 'Chinese',
|
||||
emoji: '🇨🇳',
|
||||
},
|
||||
{
|
||||
shortName: 'el',
|
||||
originalName: 'Ελληνικά',
|
||||
translatedName: 'Greek',
|
||||
emoji: '🇬🇷',
|
||||
},
|
||||
];
|
||||
|
||||
export const getLanguageByCode = (code: string | null) =>
|
||||
|
||||
14
src/tools/server/getPackageVersion.ts
Normal file
14
src/tools/server/getPackageVersion.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
const getServerPackageVersion = (): string | undefined => process.env.npm_package_version;
|
||||
|
||||
const getServerNodeEnvironment = (): 'development' | 'production' | 'test' =>
|
||||
process.env.NODE_ENV;
|
||||
|
||||
export const getServiceSidePackageAttributes = (): ServerSidePackageAttributesType => ({
|
||||
packageVersion: getServerPackageVersion(),
|
||||
environment: getServerNodeEnvironment(),
|
||||
});
|
||||
|
||||
export type ServerSidePackageAttributesType = {
|
||||
packageVersion: string | undefined;
|
||||
environment: 'development' | 'production' | 'test';
|
||||
};
|
||||
@@ -1,9 +1,9 @@
|
||||
export const dashboardNamespaces = [
|
||||
'common',
|
||||
'layout/tools',
|
||||
'layout/element-selector/selector',
|
||||
'layout/modals/add-app',
|
||||
'layout/modals/change-position',
|
||||
'layout/modals/icon-picker',
|
||||
'layout/modals/about',
|
||||
'layout/header/actions/toggle-edit-mode',
|
||||
'layout/mobile/drawer',
|
||||
Reference in New Issue
Block a user