first commit
This commit is contained in:
commit
db5762abd4
687 files changed
+171307
No files matched your search
@@ -0,0 +1,62 @@
|
||||
var e = {
|
||||
cloud: [
|
||||
`mf_cloud`,
|
||||
`kky_ecs`,
|
||||
`whmcs_cloud`,
|
||||
`mf_finance`,
|
||||
`remf_finance`,
|
||||
`jy_cloud`,
|
||||
],
|
||||
dcim: [
|
||||
`mf_dcim`,
|
||||
`remf_dcim`,
|
||||
`mf_finance_dcim`,
|
||||
`remf_finance_dcim`,
|
||||
`whmcs_dcim`,
|
||||
`jy_dcim`,
|
||||
],
|
||||
common: [`idcsmart_common`, `mf_finance_common`],
|
||||
};
|
||||
function t(e, t, n) {
|
||||
let r = String(e ?? ``).trim();
|
||||
if (r && !/[\u0000-\u0020\u007f\\]/.test(r)) {
|
||||
if (/^\/(?!\/)/.test(r)) return r;
|
||||
try {
|
||||
let e = new URL(r.startsWith(`//`) ? `https:${r}` : r);
|
||||
if (/^(https?:)$/.test(e.protocol) && !e.username && !e.password)
|
||||
return r;
|
||||
} catch {}
|
||||
}
|
||||
let i = [
|
||||
[`Windows`, [`windows`, `winserver`]],
|
||||
[`Ubuntu`, [`ubuntu`]],
|
||||
[`Debian`, [`debian`]],
|
||||
[`TencentOS-Server`, [`tencentos`]],
|
||||
[`CentOS`, [`centos`]],
|
||||
[`Rocky`, [`rocky`]],
|
||||
[`AlmaLinux`, [`almalinux`]],
|
||||
[`OpenEuler`, [`openeuler`, `euleros`]],
|
||||
[`RedHat`, [`redhat`, `rhel`]],
|
||||
[`Fedora`, [`fedora`, `fedroa`]],
|
||||
[`ArchLinux`, [`archlinux`]],
|
||||
[`FreeBSD`, [`freebsd`]],
|
||||
[`ESXi`, [`esxi`]],
|
||||
[`XenServer`, [`xenserver`]],
|
||||
[`OpenClaw`, [`openclaw`]],
|
||||
],
|
||||
a = [e, n].map((e) =>
|
||||
String(e ?? ``)
|
||||
.toLowerCase()
|
||||
.replace(/[\s_.\-/]+/g, ``),
|
||||
);
|
||||
for (let e of a) {
|
||||
let t = i.find(([, t]) => t.some((t) => e.includes(t)));
|
||||
if (t) return `/images/os/${t[0]}.svg`;
|
||||
}
|
||||
return a.some((e) => /linux|alpine|opensuse|suse/.test(e))
|
||||
? `/images/os/Linux.svg`
|
||||
: e || n
|
||||
? `/images/os/Other.svg`
|
||||
: ``;
|
||||
}
|
||||
export { t as n, e as t };
|
||||
Reference in new issue
Block a user