1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-03-07 00:03:49 +08:00
parent a72045154d
commit f450f44088
2 changed files with 12 additions and 3 deletions

View File

@ -117,7 +117,7 @@ func init() {
func _spark_project(m *ice.Message, arg ...string) {
defer m.Cmdy(STYLE, FLEX).Cmdy(STYLE, END)
m.Cmdy(STYLE, COLUMN)
m.Cmdy(TITLE, kit.Capital(path.Base(kit.Select(ice.Info.Pathname, ice.Info.Make.Remote))))
m.Cmdy(TITLE, ice.Info.Title())
m.Cmdy(SPARK, TITLE, arg[0]).Cmdy(ORDER, arg[1])
m.Cmdy(STYLE, FLEX)
m.Cmdy(SPARK, html.BUTTON, "体 验", ROUTE, web.SpideOrigin(m, ice.DEMO))

13
info.go
View File

@ -44,8 +44,15 @@ func (s MakeInfo) Versions() string {
return kit.Format("%s-%s-%s", s.Version, s.Forword, s.Hash[:6])
}
}
func (s info) Title() string {
p := path.Base(kit.Select(s.Pathname, s.Make.Remote))
if strings.HasPrefix(p, "20") {
p = kit.Join(strings.Split(p, "-")[1:], "-")
}
return kit.Capital(p)
}
var Info = struct {
type info struct {
Make MakeInfo
Time string
Size string
@ -86,7 +93,9 @@ var Info = struct {
Save func(m *Message, key ...string) *Message
Load func(m *Message, key ...string) *Message
Log func(m *Message, p, l, s string)
}{
}
var Info = info{
Localhost: true,
File: Maps{},