mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat(template-helpers): Add timestamps and timestampms helpers
This commit is contained in:
parent
2b5af1897f
commit
d0dbc1837f
@ -105,10 +105,21 @@ export function processValue(
|
||||
return crypto.randomUUID();
|
||||
}
|
||||
|
||||
if (varName === "timestamp") {
|
||||
if (varName === "timestamp" || varName === "timestampms") {
|
||||
return Date.now().toString();
|
||||
}
|
||||
|
||||
if (varName === "timestamps") {
|
||||
return Math.round(Date.now() / 1000).toString();
|
||||
}
|
||||
|
||||
if (varName.startsWith("timestampms:")) {
|
||||
return new Date(varName.slice(12)).getTime().toString();
|
||||
}
|
||||
if (varName.startsWith("timestamps:")) {
|
||||
return Math.round(new Date(varName.slice(11)).getTime() / 1000).toString();
|
||||
}
|
||||
|
||||
if (varName === "randomPort") {
|
||||
return Math.floor(Math.random() * 65535).toString();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user