NL
apps/cryo-studio / forms / MainForm.form.yaml · commit 76aa68d
# The main window, made with the IDE's visual editor (open this file there: Design). The code behind it is# src/Form/MainForm.php: `events` name its methods. One page per screen (page*), the radios of the "nav" group show one.# Lists have a small height and grow: they share the room of the window and scroll inside it.form:  title: Cryo Studio  theme: light  accent: '#2f7fd8'  layout: column  padding: 16  gap: 10  children:    - type: row      gap: 12      children:        - {type: image, id: logo, src: assets/images/logo.png, width: 40, height: 40}        - type: column          gap: 0          children:            - {type: label, id: heading, text: Cryo Studio, style: title}            - {type: label, id: subtitle, text: 'Find the PHP line that leaks memory, from .cryo snapshots', style: muted, hide: [xs, sm]}        - {type: spacer}        - {type: button, id: demo, text: 'Demo', style: flat, events: {click: onDemoClick}}        - {type: button, id: open, text: 'Open .cryo', style: primary, events: {click: onOpenClick}}        - {type: checkbox, id: dark, text: Dark, events: {change: onDarkChange}, hide: [xs]}    - type: row      id: nav      gap: 10      wrap: true      children:        - {type: radio, id: navOverview, text: Overview, group: nav, events: {change: onNavChange}}        - {type: radio, id: navLeaks, text: Leaks, group: nav, checked: true, events: {change: onNavChange}}        - {type: radio, id: navClasses, text: Classes, group: nav, events: {change: onNavChange}}        - {type: radio, id: navInspector, text: Inspector, group: nav, events: {change: onNavChange}}        - {type: radio, id: navDominators, text: Dominators, group: nav, events: {change: onNavChange}}        - {type: radio, id: navOrphans, text: Orphans, group: nav, events: {change: onNavChange}}        - {type: radio, id: navDupes, text: Duplicates, group: nav, events: {change: onNavChange}}        - {type: radio, id: navQuery, text: Query, group: nav, events: {change: onNavChange}}        - {type: radio, id: navSeries, text: Series, group: nav, events: {change: onNavChange}}        - {type: radio, id: navStack, text: Stack, group: nav, events: {change: onNavChange}}        - {type: radio, id: navLive, text: Live, group: nav, events: {change: onNavChange}}    - type: grid      gap: 12      height: fill      children:        - type: panel          id: snapshotsPanel          title: Snapshots          span: {xs: 12, md: 3}          height: fill          gap: 8          children:            - {type: listbox, id: snapshots, height: 110, grow: 1, events: {change: onSnapshotChange}}            - {type: label, id: snapInfo, text: '', style: small, wrap: true}            - {type: label, id: backend, text: '', style: muted}        - type: panel          id: analysis          title: Analysis          span: {xs: 12, md: 9}          height: fill          gap: 8          children:            - {type: label, id: viewTitle, text: '', style: subtitle}            # overview: alerts of the heuristics, then top classes / sites / roots of the snapshot            - type: column              id: pageOverview              visible: false              grow: 1              gap: 6              children:                - {type: label, id: alertsTitle, text: 'Alerts (heuristics): score, kind, message', bold: true}                - {type: listbox, id: alerts, height: 120, events: {change: onAlertChange}}                - {type: label, id: alertDetail, text: '', style: small, wrap: true}                - {type: listbox, id: overviewRows, height: 120, grow: 1, events: {change: onOverviewRowChange}}            # leaks: delta by site / class / stack, code of the creation and of the write, typical path            - type: column              id: pageLeaks              grow: 1              gap: 6              children:                - type: row                  gap: 14                  wrap: true                  children:                    - {type: label, id: byLabel, text: 'Group by', style: muted}                    - {type: radio, id: bySite, text: 'Allocation site', group: by, checked: true, events: {change: onByChange}}                    - {type: radio, id: byClass, text: Class, group: by, events: {change: onByChange}}                    - {type: radio, id: byStack, text: Stack, group: by, events: {change: onByChange}}                - {type: listbox, id: rows, height: 110, grow: 1, events: {change: onRowChange}}                - {type: label, id: detail, text: '', bold: true, wrap: true}                - type: grid                  gap: 8                  children:                    - type: column                      span: {xs: 12, md: 6}                      gap: 2                      children:                        - {type: label, id: sourceTitle, text: 'Created at', style: muted}                        - {type: textbox, id: source, multiline: true, rows: 5, readonly: true, text: ''}                    - type: column                      span: {xs: 12, md: 6}                      gap: 2                      children:                        - {type: label, id: hookTitle, text: 'Hooked by (write site)', style: muted}                        - {type: textbox, id: hookSource, multiline: true, rows: 5, readonly: true, text: ''}                - {type: label, id: pathInfo, text: '', style: small, wrap: true}            # classes: objects per class by retained size, a click lists its instances, a click on one opens it            - type: column              id: pageClasses              visible: false              grow: 1              gap: 6              children:                - {type: listbox, id: classes, height: 120, grow: 1, events: {change: onClassChange}}                - {type: label, id: instancesTitle, text: 'Click a class to list its instances', style: muted}                - {type: listbox, id: instances, height: 120, grow: 1, events: {change: onNodeRowChange}}            # inspector of one node            - type: column              id: pageInspector              visible: false              grow: 1              gap: 6              children:                - type: row                  gap: 10                  children:                    - {type: button, id: back, text: Back, style: flat, events: {click: onBackClick}}                    - {type: label, id: nodeTitle, text: '', bold: true, grow: 1}                    - {type: button, id: pathButton, text: 'Path to a root', events: {click: onPathClick}}                - {type: label, id: nodeInfo, text: '', style: small, wrap: true}                - type: grid                  gap: 8                  grow: 1                  children:                    - type: column                      span: {xs: 12, md: 6}                      gap: 2                      children:                        - {type: label, id: outTitle, text: 'References (out)', style: muted}                        - {type: listbox, id: outEdges, height: 100, grow: 1, events: {change: onEdgeChange}}                    - type: column                      span: {xs: 12, md: 6}                      gap: 2                      children:                        - {type: label, id: inTitle, text: 'Referenced by (in)', style: muted}                        - {type: listbox, id: inEdges, height: 100, grow: 1, events: {change: onEdgeChange}}                - {type: listbox, id: pathRows, height: 90, grow: 1, events: {change: onPathRowChange}}            # dominators, orphans, duplicates: a list, a click opens the node            - type: column              id: pageDominators              visible: false              grow: 1              children:                - {type: listbox, id: dominators, height: 120, grow: 1, events: {change: onNodeRowChange}}            - type: column              id: pageOrphans              visible: false              grow: 1              children:                - {type: listbox, id: orphans, height: 120, grow: 1, events: {change: onNodeRowChange}}            - type: column              id: pageDupes              visible: false              grow: 1              children:                - {type: listbox, id: dupes, height: 120, grow: 1, events: {change: onNodeRowChange}}            # query language            - type: column              id: pageQuery              visible: false              grow: 1              gap: 6              children:                - type: row                  gap: 8                  children:                    - {type: textbox, id: queryText, text: 'retained>1K', placeholder: 'class=Query and retained>1K', grow: 1, events: {submit: onQuerySubmit}}                    - {type: button, id: runQuery, text: Run, style: primary, events: {click: onQueryClick}}                - {type: label, id: queryHelp, text: 'Fields: class, type, site, write (= != with *), size, retained, epoch (= != < > <= >=, K M G); and, or', style: small, wrap: true}                - {type: label, id: queryStatus, text: '', bold: true, wrap: true}                - {type: listbox, id: queryRows, height: 120, grow: 1, events: {change: onNodeRowChange}}            # metric series (.cryom)            - type: column              id: pageSeries              visible: false              grow: 1              gap: 6              children:                - type: row                  gap: 8                  wrap: true                  children:                    - {type: button, id: openSeries, text: 'Open .cryom', events: {click: onOpenSeriesClick}}                    - {type: button, id: demoSeries, text: 'Demo series', style: flat, events: {click: onDemoSeriesClick}}                    - {type: label, id: seriesName, text: '', style: muted}                - {type: widget, class: App\Gui\MemoryChart, id: chart, height: 220, grow: 1}                - {type: label, id: seriesInfo, text: '', style: small, wrap: true}            # call stack of a freeze file (.cryf): frames, their variables, the code of the line            - type: column              id: pageStack              visible: false              grow: 1              gap: 6              children:                - type: row                  gap: 8                  wrap: true                  children:                    - {type: button, id: openFreeze, text: 'Open .cryf', events: {click: onOpenFreezeClick}}                    - {type: button, id: demoFreeze, text: 'Demo freeze', style: flat, events: {click: onDemoFreezeClick}}                    - {type: label, id: freezeName, text: '', style: muted}                - {type: label, id: freezeInfo, text: '', style: small, wrap: true}                - type: grid                  gap: 8                  grow: 1                  children:                    - type: column                      span: {xs: 12, md: 6}                      gap: 2                      children:                        - {type: label, id: framesTitle, text: 'Frames (innermost first)', style: muted}                        - {type: listbox, id: frames, height: 100, grow: 1, events: {change: onFrameChange}}                    - type: column                      span: {xs: 12, md: 6}                      gap: 2                      children:                        - {type: label, id: varsTitle, text: 'Variables', style: muted}                        - {type: listbox, id: frameVars, height: 100, grow: 1}                - {type: textbox, id: frameSource, multiline: true, rows: 5, readonly: true, text: ''}            # live: a running script (cryo_metrics_serve of ext-cryo), its memory every 2 s, snapshots on demand            - type: column              id: pageLive              visible: false              grow: 1              gap: 6              children:                - type: row                  gap: 8                  wrap: true                  children:                    - {type: textbox, id: liveUrl, text: 'http://127.0.0.1:9600', placeholder: 'http://127.0.0.1:9600', grow: 1, minWidth: 170, events: {submit: onLiveSubmit}}                    - {type: textbox, id: liveToken, text: '', placeholder: Token, password: true, width: 130, events: {submit: onLiveSubmit}}                    - {type: button, id: liveConnect, text: Connect, style: primary, events: {click: onLiveConnectClick}}                    - {type: button, id: liveSnapshot, text: Snapshot, enabled: false, events: {click: onLiveSnapshotClick}}                - {type: label, id: liveStatus, text: '', style: small, wrap: true}                - {type: widget, class: App\Gui\MemoryChart, id: liveChart, height: 180, grow: 1, empty: 'Waiting for the script'}                - {type: label, id: liveCounters, text: '', style: small, wrap: true}                - {type: label, id: liveClassesTitle, text: 'Live objects per class (cryo.metrics=1)', style: muted}                - {type: listbox, id: liveClasses, height: 80, grow: 1}                - {type: label, id: liveHelp, text: "In the script: cryo_metrics_serve(9600, '127.0.0.1', ['cors' => '*', 'token' => '...'])", style: small, wrap: true}