MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / draw_confirm_set

Function draw_confirm_set

crates/openshell-tui/src/ui/global_settings.rs:129–161  ·  view source on GitHub ↗
(frame: &mut Frame<'_>, app: &App, idx: usize, area: Rect)

Source from the content-addressed store, hash-verified

127}
128
129fn draw_confirm_set(frame: &mut Frame<'_>, app: &App, idx: usize, area: Rect) {
130 let t = &app.theme;
131 let Some(entry) = app.global_settings.get(idx) else {
132 return;
133 };
134 let new_value = app.setting_edit.as_ref().map_or("-", |e| e.input.as_str());
135
136 let lines = vec![
137 Line::from(Span::styled(" Confirm Global Setting Change ", t.heading)),
138 Line::from(""),
139 Line::from(vec![
140 Span::styled("Set ", t.text),
141 Span::styled(&entry.key, t.accent),
142 Span::styled(" = ", t.text),
143 Span::styled(new_value, t.accent),
144 Span::styled(" globally?", t.text),
145 ]),
146 Line::from(""),
147 Line::from(Span::styled(
148 "This will apply to all sandboxes on this gateway.",
149 t.status_warn,
150 )),
151 Line::from(""),
152 Line::from(vec![
153 Span::styled("[y]", t.key_hint),
154 Span::styled(" Confirm ", t.muted),
155 Span::styled("[n]", t.key_hint),
156 Span::styled(" Cancel", t.muted),
157 ]),
158 ];
159
160 super::draw_confirm_popup(frame, lines, t.border_focused, 60, area);
161}
162
163fn draw_confirm_delete(frame: &mut Frame<'_>, app: &App, idx: usize, area: Rect) {
164 let t = &app.theme;

Callers 1

drawFunction · 0.70

Calls 3

draw_confirm_popupFunction · 0.85
getMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected