♻️ Add version reading by package file

This commit is contained in:
Manuel
2023-01-31 21:17:37 +01:00
committed by ajnart
parent e20149a93c
commit 766418ce53
19 changed files with 87 additions and 40 deletions

View File

@@ -1,14 +1,5 @@
import Dockerode from 'dockerode';
import { Config, 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