104 references to DashboardUIHelpers
Aspire.Dashboard (55)
Components\Controls\TextVisualizer.razor.cs (2)
44private bool IsUnformatted => DisplayUnformatted || ViewModel.FormatKind is DashboardUIHelpers.PlaintextFormat; 76if (ViewModel.FormatKind is not DashboardUIHelpers.PlaintextFormat)
Components\Dialogs\TextVisualizerDialog.razor.cs (12)
27internal bool IsMarkdownFormat => TextVisualizerViewModel.FormatKind == DashboardUIHelpers.MarkdownFormat; 61new SelectViewModel<string> { Id = DashboardUIHelpers.PlaintextFormat, Name = Loc[nameof(Resources.Dialogs.TextVisualizerDialogPlaintextFormat)] }, 62new SelectViewModel<string> { Id = DashboardUIHelpers.MarkdownFormat, Name = Loc[nameof(Resources.Dialogs.TextVisualizerDialogMarkdownFormat)] }, 63new SelectViewModel<string> { Id = DashboardUIHelpers.JsonFormat, Name = Loc[nameof(Resources.Dialogs.TextVisualizerDialogJsonFormat)] }, 64new SelectViewModel<string> { Id = DashboardUIHelpers.XmlFormat, Name = Loc[nameof(Resources.Dialogs.TextVisualizerDialogXmlFormat)] } 74EnabledOptions.Add(DashboardUIHelpers.PlaintextFormat); 85if (TextVisualizerViewModel.FormatKind == DashboardUIHelpers.JsonFormat) 87EnabledOptions.Add(DashboardUIHelpers.JsonFormat); 89else if (TextVisualizerViewModel.FormatKind == DashboardUIHelpers.XmlFormat) 91EnabledOptions.Add(DashboardUIHelpers.XmlFormat); 97EnabledOptions.Add(DashboardUIHelpers.MarkdownFormat); 123TextVisualizerViewModel.UpdateFormat(_selectedFormat.Id ?? DashboardUIHelpers.PlaintextFormat);
Components\Interactions\InteractionsProvider.cs (1)
429DashboardUIHelpers.MessageBarSection);
Components\Layout\MainLayout.razor.cs (1)
209DashboardUIHelpers.MessageBarSection,
Components\Pages\ConsoleLogs.razor.cs (2)
212_logEntries = new(DashboardUIHelpers.GetVirtualizedItemCount(Options.Value.Frontend.MaxConsoleLogCount)); 784_highlightedCommands.AddRange(selectedResource.Commands.Where(c => c.IsHighlighted && c.State != CommandViewModelState.Hidden).Take(DashboardUIHelpers.MaxHighlightedCommands));
Components\Pages\Resources.razor.cs (2)
478.Take(request.Count ?? DashboardUIHelpers.DefaultDataGridResultCount) 576_maxHighlightedCount = Math.Min(maxHighlightedCount, DashboardUIHelpers.MaxHighlightedCommands);
Components\Pages\StructuredLogs.razor.cs (3)
132ViewModel.Count = request.Count ?? DashboardUIHelpers.DefaultDataGridResultCount; 140TelemetryRepository.MaxLogLimitMessage = await DashboardUIHelpers.DisplayMaxLimitMessageAsync( 155var virtualizedLogCount = DashboardUIHelpers.GetVirtualizedItemCount(logs.TotalItemCount);
Components\Pages\TraceDetail.razor.cs (1)
159var count = Math.Min(request.Count ?? DashboardUIHelpers.DefaultDataGridResultCount, visibleItems.Count - startIndex);
Components\Pages\Traces.razor.cs (3)
139TracesViewModel.Count = request.Count ?? DashboardUIHelpers.DefaultDataGridResultCount; 146TelemetryRepository.MaxTraceLimitMessage = await DashboardUIHelpers.DisplayMaxLimitMessageAsync( 161var virtualizedTraceCount = DashboardUIHelpers.GetVirtualizedItemCount(traces.TotalItemCount);
Model\DashboardCommandExecutor.cs (4)
248toastOptions.Lifetime = DashboardUIHelpers.ToastTimeout; 291await Task.Delay(DashboardUIHelpers.ToastTimeout, cancellationToken).ConfigureAwait(false); 356CommandResultFormat.Json => DashboardUIHelpers.JsonFormat, 357CommandResultFormat.Markdown => DashboardUIHelpers.MarkdownFormat,
Model\GenAI\GenAIItemPartViewModel.cs (6)
70return new TextVisualizerViewModel(textPart.Content ?? string.Empty, indentText: true, fallbackFormat: DashboardUIHelpers.MarkdownFormat); 82return new TextVisualizerViewModel($"{toolCallRequestPart.Name}({argumentsText})", indentText: true, knownFormat: DashboardUIHelpers.JavascriptFormat); 93return new TextVisualizerViewModel(toolResponseContent, indentText: true, fallbackFormat: DashboardUIHelpers.MarkdownFormat); 109return new TextVisualizerViewModel(reasoningPart.Content ?? string.Empty, indentText: true, fallbackFormat: DashboardUIHelpers.MarkdownFormat); 121return new TextVisualizerViewModel($"{serverToolCallPart.Name}({serverToolCallText})", indentText: true, knownFormat: DashboardUIHelpers.JavascriptFormat); 129return new TextVisualizerViewModel(responseContent, indentText: true, fallbackFormat: DashboardUIHelpers.MarkdownFormat);
Model\ResourceMenuBuilder.cs (2)
111FixedFormat = DashboardUIHelpers.JsonFormat 132FixedFormat = DashboardUIHelpers.PropertiesFormat
Model\ResourceSourceViewModel.cs (1)
68: DashboardUIHelpers.GetMaskingText(6).Text)));
Model\SpanMenuBuilder.cs (1)
105FixedFormat = DashboardUIHelpers.JsonFormat
Model\StructuredLogMenuBuilder.cs (1)
129FixedFormat = DashboardUIHelpers.JsonFormat
Model\StructuredLogsViewModel.cs (1)
92LatestItemCount = DashboardUIHelpers.MaxVirtualizedItemCount
Model\TextVisualizerViewModel.cs (10)
28Lines = GetLines(Text, DashboardUIHelpers.PlaintextFormat); 36ChangeFormattedText(DashboardUIHelpers.JsonFormat, indentText ? formattedJson : Text); 40ChangeFormattedText(DashboardUIHelpers.XmlFormat, indentText ? formattedXml : Text); 44ChangeFormattedText(fallbackFormat ?? DashboardUIHelpers.PlaintextFormat, Text); 50if (knownFormat == DashboardUIHelpers.JsonFormat && TryFormatJson(text, out var formattedJson)) 55if (knownFormat == DashboardUIHelpers.XmlFormat && TryFormatXml(text, out var formattedXml)) 297if (newFormat == DashboardUIHelpers.XmlFormat) 304else if (newFormat == DashboardUIHelpers.JsonFormat) 311else if (newFormat == DashboardUIHelpers.MarkdownFormat) 317ChangeFormattedText(DashboardUIHelpers.PlaintextFormat, Text);
Model\TraceMenuBuilder.cs (1)
123FixedFormat = DashboardUIHelpers.JsonFormat
Model\TracesViewModel.cs (1)
91LatestItemCount = DashboardUIHelpers.MaxVirtualizedItemCount
Aspire.Dashboard.Components.Tests (27)
Controls\TextVisualizerDialogTests.cs (24)
57Assert.Equal(DashboardUIHelpers.JsonFormat, instance.TextVisualizerViewModel.FormatKind); 58Assert.Equal([DashboardUIHelpers.JsonFormat, DashboardUIHelpers.PlaintextFormat], instance.EnabledOptions.ToImmutableSortedSet()); 85Assert.Equal(DashboardUIHelpers.XmlFormat, instance.TextVisualizerViewModel.FormatKind); 87Assert.Equal([DashboardUIHelpers.PlaintextFormat, DashboardUIHelpers.XmlFormat], instance.EnabledOptions.ToImmutableSortedSet()); 89instance.ChangeFormat(DashboardUIHelpers.PlaintextFormat); 91Assert.Equal(DashboardUIHelpers.PlaintextFormat, instance.TextVisualizerViewModel.FormatKind); 110Assert.Equal(DashboardUIHelpers.XmlFormat, formatSelect.Instance.Value?.Id); 115var plaintextOption = formatOptions.Single(o => o.Id == DashboardUIHelpers.PlaintextFormat); 121Assert.Equal(DashboardUIHelpers.PlaintextFormat, dialog.TextVisualizerViewModel.FormatKind); 123Assert.Equal(DashboardUIHelpers.PlaintextFormat, cut.FindComponent<FluentSelect<SelectViewModel<string>, SelectViewModel<string>>>().Instance.Value?.Id); 132Assert.Equal(DashboardUIHelpers.PlaintextFormat, dialog.TextVisualizerViewModel.FormatKind); 134Assert.Equal(DashboardUIHelpers.PlaintextFormat, cut.FindComponent<FluentSelect<SelectViewModel<string>, SelectViewModel<string>>>().Instance.Value?.Id); 168Assert.Equal(DashboardUIHelpers.XmlFormat, instance.TextVisualizerViewModel.FormatKind); 170Assert.Equal([DashboardUIHelpers.PlaintextFormat, DashboardUIHelpers.XmlFormat], instance.EnabledOptions.ToImmutableSortedSet()); 185Assert.Equal(DashboardUIHelpers.PlaintextFormat, instance.TextVisualizerViewModel.FormatKind); 187Assert.Equal([DashboardUIHelpers.MarkdownFormat, DashboardUIHelpers.PlaintextFormat], instance.EnabledOptions.ToImmutableSortedSet()); 308await dialogService.ShowDialogAsync<TextVisualizerDialog>(new TextVisualizerDialogViewModel(rawText, string.Empty, ContainsSecret: false, FixedFormat: DashboardUIHelpers.PropertiesFormat), new DialogParameters()); 315Assert.Equal(DashboardUIHelpers.PropertiesFormat, instance.TextVisualizerViewModel.FormatKind); 328await dialogService.ShowDialogAsync<TextVisualizerDialog>(new TextVisualizerDialogViewModel(rawText, string.Empty, ContainsSecret: false, FixedFormat: DashboardUIHelpers.JsonFormat), new DialogParameters()); 335Assert.Equal(DashboardUIHelpers.JsonFormat, instance.TextVisualizerViewModel.FormatKind);
Interactions\InteractionsProviderTests.cs (1)
748builder.Add(p => p.Section, DashboardUIHelpers.MessageBarSection);
Layout\MainLayoutTests.cs (1)
1064builder.Add(p => p.Section, DashboardUIHelpers.MessageBarSection);
Shared\FluentUISetupHelpers.cs (1)
386builder.AddComponentParameter(1, nameof(FluentMessageBarProvider.Section), DashboardUIHelpers.MessageBarSection);
Aspire.Dashboard.Tests (22)
DashboardUIHelpersTests.cs (8)
16Assert.Equal(expected, DashboardUIHelpers.GetVirtualizedItemCount(totalItemCount)); 32var result = DashboardUIHelpers.SafeConvertToMilliseconds(duration); 45var result = DashboardUIHelpers.SafeConvertToMilliseconds(duration); 58var result = DashboardUIHelpers.SafeConvertToMilliseconds(duration); 71var result = DashboardUIHelpers.SafeConvertToMilliseconds(duration); 85var result = DashboardUIHelpers.SafeConvertToMilliseconds(duration); 98var result = DashboardUIHelpers.SafeConvertToMilliseconds(duration); 107var mask = DashboardUIHelpers.GetMaskingText(3);
Model\DashboardCommandExecutorTests.cs (1)
185Assert.Equal(DashboardUIHelpers.ToastTimeout, resultToast.Options.Lifetime);
Model\GenAIItemPartViewModelTests.cs (6)
28Assert.Equal(DashboardUIHelpers.MarkdownFormat, itemPart.TextVisualizerViewModel.FormatKind); 47Assert.Equal(DashboardUIHelpers.JsonFormat, itemPart.TextVisualizerViewModel.FormatKind); 79Assert.Equal(DashboardUIHelpers.JsonFormat, itemPart.TextVisualizerViewModel.FormatKind); 111Assert.Equal(DashboardUIHelpers.JsonFormat, itemPart.TextVisualizerViewModel.FormatKind); 129Assert.Equal(DashboardUIHelpers.JavascriptFormat, itemPart.TextVisualizerViewModel.FormatKind); 147Assert.Equal(DashboardUIHelpers.JsonFormat, itemPart.TextVisualizerViewModel.FormatKind);
Model\ResourceSourceViewModelTests.cs (1)
97var maskingText = DashboardUIHelpers.GetMaskingText(6).Text;
Model\TextVisualizerViewModelTests.cs (6)
77var vm = new TextVisualizerViewModel("""{"key":"value"}""", indentText, knownFormat: DashboardUIHelpers.JsonFormat); 80Assert.Equal(DashboardUIHelpers.JsonFormat, vm.FormatKind); 95var vm = new TextVisualizerViewModel("""{"large":9223372036854775807,"precise":0.1234567890123456789012345,"trailing":1.2300}""", indentText: true, knownFormat: DashboardUIHelpers.JsonFormat); 113var vm = new TextVisualizerViewModel(json, indentText: true, knownFormat: DashboardUIHelpers.JsonFormat); 115Assert.Equal(DashboardUIHelpers.JsonFormat, vm.FormatKind); 130var vm = new TextVisualizerViewModel("""[/* number */0.1234567890123456789012345,9223372036854775807,1.2300]""", indentText: true, knownFormat: DashboardUIHelpers.JsonFormat);