diff --git a/app/Models/Server.php b/app/Models/Server.php index 26e93e0..16f0460 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -116,22 +116,29 @@ class Server extends Model public static function osIntToIcon(int $os, string $os_name): string { - if ($os === 1) {//None + $name = strtolower(str_replace(' ', '', $os_name)); + if ($name === "none") {//None return ""; - } else if ($os <= 3) {//Centos + } else if (str_contains($name, "centos")) {//CentOS return ""; - } elseif (($os > 7 && $os <= 10) || $os === 44) {//Debian - return ""; - } elseif (($os > 11 && $os < 15) || $os === 43) {//Fedora + } elseif (str_contains($name, "debian")) {//Debian + return ""; + } elseif (str_contains($name, "fedora")) {//Fedora return ""; - } elseif (($os > 14 && $os < 18) || $os === 46) {//FreeBSD + } elseif (str_contains($name, "freebsd")) {//FreeBSD + return ""; + } elseif (str_contains($name, "openbsd")) {//OpenBSD return ""; - } elseif (($os > 17 && $os < 21) || $os === 42) {//OpenBSD - return ""; - } elseif (($os > 25 && $os < 32) || $os === 41) {//Ubuntu + } elseif (str_contains($name, "ubuntu")) {//Ubuntu return ""; - } elseif (($os > 32 && $os < 38) || $os === 40) {//Windows + } elseif (str_contains($name, "windows")) {//Windows return ""; + } elseif (str_contains($name, "opensuse")) {//OpenSUSE + return ""; + } elseif (str_contains($name, "redhat")) {//Red Hat + return ""; + } elseif (str_contains($name, "linux")) {//Linux + return ""; } else {//OTHER ISO CUSTOM etc return ""; }