Fix merged groups: unique names, public ChartSpec
This commit is contained in:
41 files changed
+79
-1103
No files matched your search
@@ -108,7 +108,7 @@ view := func(c *ui.Context) {
|
||||
mujica.WorkspaceSwitcher(c, ¤t, spaces, mujica.WorkspaceSwitcherOptions{})
|
||||
}
|
||||
ui.Render(view, 400, 300, 1)`,
|
||||
"UserMenu": `status := mujica.PresenceOnline
|
||||
"UserMenu": `status := mujica.UserStatusOnline
|
||||
view := func(c *ui.Context) {
|
||||
mujica.Use(c, mujica.Settings{})
|
||||
if mujica.UserMenu(c, &status, mujica.UserMenuOptions{Name: "Sakiko Togawa"}).SignOut() {
|
||||
|
||||
@@ -60,7 +60,7 @@ view := func(c *ui.Context) {
|
||||
}
|
||||
ui.Render(view, 720, 480, 1)`
|
||||
|
||||
const devTraceWaterfallCode = `spans := []mujica.TraceSpan{{ID: "root", Name: "GET /api", Service: "gateway", Duration: 200 * time.Millisecond}, {ID: "db", Parent: "root", Name: "Query", Service: "database", Start: 20 * time.Millisecond, Duration: 80 * time.Millisecond}}
|
||||
const devTraceWaterfallCode = `spans := []mujica.WaterfallSpan{{ID: "root", Name: "GET /api", Service: "gateway", Duration: 200 * time.Millisecond}, {ID: "db", Parent: "root", Name: "Query", Service: "database", Start: 20 * time.Millisecond, Duration: 80 * time.Millisecond}}
|
||||
view := func(c *ui.Context) {
|
||||
mujica.Use(c, mujica.Settings{})
|
||||
if mujica.TraceWaterfall(c, spans, mujica.TraceWaterfallOptions{}).Changed() {
|
||||
|
||||
@@ -38,8 +38,8 @@ func devLogStreamDemo(c *ui.Context, log func(string)) {
|
||||
func devTraceWaterfallDemo(c *ui.Context, log func(string)) {
|
||||
dtSection(c, "TraceWaterfall", func() {
|
||||
s := devControls(c, "448", log, false)
|
||||
spans := ui.Local(c.Root(), "448", func() []mujica.TraceSpan {
|
||||
return []mujica.TraceSpan{{ID: "root", Name: "GET /api", Service: "gateway", Duration: 320 * time.Millisecond}, {ID: "db", Parent: "root", Name: "Query", Service: "database", Start: 40 * time.Millisecond, Duration: 90 * time.Millisecond}, {ID: "pay", Parent: "root", Name: "Charge", Service: "payments", Start: 230 * time.Millisecond, Duration: 80 * time.Millisecond, Error: true}}
|
||||
spans := ui.Local(c.Root(), "448", func() []mujica.WaterfallSpan {
|
||||
return []mujica.WaterfallSpan{{ID: "root", Name: "GET /api", Service: "gateway", Duration: 320 * time.Millisecond}, {ID: "db", Parent: "root", Name: "Query", Service: "database", Start: 40 * time.Millisecond, Duration: 90 * time.Millisecond}, {ID: "pay", Parent: "root", Name: "Charge", Service: "payments", Start: 230 * time.Millisecond, Duration: 80 * time.Millisecond, Error: true}}
|
||||
})
|
||||
devPreview(c, s, func() {
|
||||
data := *spans
|
||||
|
||||
@@ -76,7 +76,7 @@ func memberListDemo(c *ui.Context, log func(string)) {
|
||||
|
||||
func userProfileCardDemo(c *ui.Context, log func(string)) {
|
||||
type state struct {
|
||||
presence mujica.Presence
|
||||
presence mujica.PresenceStatus
|
||||
actions, disabled bool
|
||||
}
|
||||
s := ui.Local(c.Root(), "406", func() state { return state{actions: true, presence: mujica.PresenceOnline} })
|
||||
@@ -98,7 +98,7 @@ func userProfileCardDemo(c *ui.Context, log func(string)) {
|
||||
|
||||
func onlineStatusDemo(c *ui.Context, log func(string)) {
|
||||
type state struct {
|
||||
presence mujica.Presence
|
||||
presence mujica.PresenceStatus
|
||||
hidden bool
|
||||
}
|
||||
s := ui.Local(c.Root(), "407", func() state { return state{presence: mujica.PresenceOnline} })
|
||||
@@ -125,8 +125,8 @@ func statusSetterDemo(c *ui.Context, log func(string)) {
|
||||
ui.Text(c, fmt.Sprintf("Text: %s; expires: %v", s.status.Text, s.status.Until))
|
||||
}
|
||||
|
||||
func messagingPresence(c *ui.Context, log func(string), value *mujica.Presence) {
|
||||
items := []mujica.SelectOption[mujica.Presence]{
|
||||
func messagingPresence(c *ui.Context, log func(string), value *mujica.PresenceStatus) {
|
||||
items := []mujica.SelectOption[mujica.PresenceStatus]{
|
||||
{Value: mujica.PresenceOnline, Label: "Online"}, {Value: mujica.PresenceAway, Label: "Away"},
|
||||
{Value: mujica.PresenceBusy, Label: "Busy"}, {Value: mujica.PresenceOffline, Label: "Offline"},
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ var projectsStatuses = []mujica.WorkflowStatus{
|
||||
{ID: "doing", Name: "In progress", Group: mujica.StatusStarted},
|
||||
{ID: "done", Name: "Done", Group: mujica.StatusCompleted},
|
||||
}
|
||||
var projectsMembers = []mujica.Member{{ID: "ann", Name: "Ann"}, {ID: "ben", Name: "Ben"}, {ID: "cy", Name: "Cy"}}
|
||||
var projectsMembers = []mujica.ProjectMember{{ID: "ann", Name: "Ann"}, {ID: "ben", Name: "Ben"}, {ID: "cy", Name: "Cy"}}
|
||||
var projectsLabels = []mujica.TaskLabel{{ID: "ui", Name: "UI", Color: mujica.EventInfo}, {ID: "release", Name: "Release", Color: mujica.EventSuccess}}
|
||||
|
||||
func projectsCheck(c *ui.Context, log func(string), value *bool, label string) {
|
||||
|
||||
@@ -32,7 +32,7 @@ view := func(c *ui.Context) {
|
||||
}
|
||||
}
|
||||
ui.Render(view, 1000, 700, 1)`},
|
||||
{ID: "372", Name: "AssigneePicker", ZhName: "负责人选择", Category: projectsCategory, Demo: projectsDemoAssigneePicker, Keys: "Enter/Space 打开;输入搜索;下键进入选项;Space/Enter 勾选;Backspace 移除最后一项;Escape 关闭。", Code: `members := []mujica.Member{{ID: "ann", Name: "Ann"}, {ID: "ben", Name: "Ben"}}
|
||||
{ID: "372", Name: "AssigneePicker", ZhName: "负责人选择", Category: projectsCategory, Demo: projectsDemoAssigneePicker, Keys: "Enter/Space 打开;输入搜索;下键进入选项;Space/Enter 勾选;Backspace 移除最后一项;Escape 关闭。", Code: `members := []mujica.ProjectMember{{ID: "ann", Name: "Ann"}, {ID: "ben", Name: "Ben"}}
|
||||
ids := []string{"ann"}
|
||||
view := func(c *ui.Context) {
|
||||
mujica.Use(c, mujica.Settings{})
|
||||
|
||||
@@ -24,7 +24,7 @@ view := func(c *ui.Context) {
|
||||
mujica.MilestoneProgress(c, milestone, mujica.MilestoneProgressOptions{})
|
||||
}
|
||||
ui.Render(view, 1000, 700, 1)`},
|
||||
{ID: "378", Name: "WorkloadView", ZhName: "成员负载", Category: projectsCategory, Demo: projectsDemoWorkloadView, Keys: "静态行通过无障碍名称读取负载与超出量;滚动查看更多成员。", Code: `loads := []mujica.Workload{{Member: mujica.Member{ID: "ann", Name: "Ann"}, Assigned: 46, Capacity: 40}}
|
||||
{ID: "378", Name: "WorkloadView", ZhName: "成员负载", Category: projectsCategory, Demo: projectsDemoWorkloadView, Keys: "静态行通过无障碍名称读取负载与超出量;滚动查看更多成员。", Code: `loads := []mujica.Workload{{Member: mujica.ProjectMember{ID: "ann", Name: "Ann"}, Assigned: 46, Capacity: 40}}
|
||||
view := func(c *ui.Context) {
|
||||
mujica.Use(c, mujica.Settings{})
|
||||
mujica.WorkloadView(c, loads, mujica.WorkloadViewOptions{})
|
||||
|
||||
Reference in new issue
Block a user