chore: 纳入本地 Dify 1.19.0 源码及品牌与免登改动
演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
60158935f4
commit
6519682885
15831 files changed
+3063428
No files matched your search
@@ -0,0 +1,35 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
// GenerateJobID produces a short random hex job identifier.
|
||||
func GenerateJobID() string {
|
||||
b := make([]byte, 8)
|
||||
_, _ = rand.Read(b)
|
||||
return hex.EncodeToString(b)
|
||||
}
|
||||
|
||||
// FormatTimestamp returns an ISO-8601 UTC timestamp string.
|
||||
func FormatTimestamp(t time.Time) string {
|
||||
return t.UTC().Truncate(time.Second).Format("2006-01-02T15:04:05Z")
|
||||
}
|
||||
|
||||
// ParseTimestamp parses an ISO-8601 UTC timestamp.
|
||||
func ParseTimestamp(s string) (time.Time, error) {
|
||||
return time.Parse("2006-01-02T15:04:05Z", s)
|
||||
}
|
||||
|
||||
// JobSessionName returns the tmux session name for a job.
|
||||
func JobSessionName(jobID string) string {
|
||||
return fmt.Sprintf("shellctl-%s", jobID)
|
||||
}
|
||||
|
||||
// JobPaneTarget returns the tmux pane target for a job.
|
||||
func JobPaneTarget(jobID string) string {
|
||||
return fmt.Sprintf("%s:0.0", JobSessionName(jobID))
|
||||
}
|
||||
Reference in new issue
Block a user