├── .gitattributes ├── .gitignore ├── CHANGELOG.md ├── Glimpse.sln ├── LICENSE.txt ├── NuGet.config ├── NuGet.exe ├── build.cmd ├── build.ps1 ├── build.sh ├── contributing.md ├── global.json ├── makefile.shade ├── pack.cmd ├── sample ├── Glimpse.Agent.AspNet.Sample │ ├── Glimpse.Agent.AspNet.Sample.csproj │ ├── Program.cs │ ├── Properties │ │ └── debugSettings.json │ ├── Startup.cs │ ├── glimpse.json │ └── web.config ├── Glimpse.AgentServer.AspNet.Mvc.Sample │ ├── .bowerrc │ ├── Controllers │ │ ├── AccountController.cs │ │ ├── HomeController.cs │ │ └── ManageController.cs │ ├── Data │ │ ├── ApplicationDbContext.cs │ │ └── Migrations │ │ │ ├── 00000000000000_CreateIdentitySchema.Designer.cs │ │ │ ├── 00000000000000_CreateIdentitySchema.cs │ │ │ └── ApplicationDbContextModelSnapshot.cs │ ├── Glimpse.AgentServer.AspNet.Mvc.Sample.csproj │ ├── Models │ │ ├── AccountViewModels │ │ │ ├── ExternalLoginConfirmationViewModel.cs │ │ │ ├── ForgotPasswordViewModel.cs │ │ │ ├── LoginViewModel.cs │ │ │ ├── RegisterViewModel.cs │ │ │ ├── ResetPasswordViewModel.cs │ │ │ ├── SendCodeViewModel.cs │ │ │ └── VerifyCodeViewModel.cs │ │ ├── ApplicationUser.cs │ │ └── ManageViewModels │ │ │ ├── AddPhoneNumberViewModel.cs │ │ │ ├── ChangePasswordViewModel.cs │ │ │ ├── ConfigureTwoFactorViewModel.cs │ │ │ ├── FactorViewModel.cs │ │ │ ├── IndexViewModel.cs │ │ │ ├── ManageLoginsViewModel.cs │ │ │ ├── RemoveLoginViewModel.cs │ │ │ ├── SetPasswordViewModel.cs │ │ │ └── VerifyPhoneNumberViewModel.cs │ ├── Program.cs │ ├── Services │ │ ├── IEmailSender.cs │ │ ├── ISmsSender.cs │ │ └── MessageServices.cs │ ├── Startup.cs │ ├── Views │ │ ├── Account │ │ │ ├── ConfirmEmail.cshtml │ │ │ ├── ExternalLoginConfirmation.cshtml │ │ │ ├── ExternalLoginFailure.cshtml │ │ │ ├── ForgotPassword.cshtml │ │ │ ├── ForgotPasswordConfirmation.cshtml │ │ │ ├── Lockout.cshtml │ │ │ ├── Login.cshtml │ │ │ ├── Register.cshtml │ │ │ ├── ResetPassword.cshtml │ │ │ ├── ResetPasswordConfirmation.cshtml │ │ │ ├── SendCode.cshtml │ │ │ └── VerifyCode.cshtml │ │ ├── Home │ │ │ ├── About.cshtml │ │ │ ├── Contact.cshtml │ │ │ └── Index.cshtml │ │ ├── Manage │ │ │ ├── AddPhoneNumber.cshtml │ │ │ ├── ChangePassword.cshtml │ │ │ ├── Index.cshtml │ │ │ ├── ManageLogins.cshtml │ │ │ ├── SetPassword.cshtml │ │ │ └── VerifyPhoneNumber.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ ├── _Layout.cshtml │ │ │ ├── _LoginPartial.cshtml │ │ │ └── _ValidationScriptsPartial.cshtml │ │ ├── _ViewImports.cshtml │ │ └── _ViewStart.cshtml │ ├── appsettings.json │ ├── bower.json │ ├── bundleconfig.json │ ├── web.config │ └── wwwroot │ │ ├── _references.js │ │ ├── css │ │ ├── site.css │ │ └── site.min.css │ │ ├── favicon.ico │ │ ├── images │ │ ├── banner1.svg │ │ ├── banner2.svg │ │ ├── banner3.svg │ │ └── banner4.svg │ │ ├── js │ │ ├── site.js │ │ └── site.min.js │ │ └── lib │ │ ├── bootstrap │ │ ├── .bower.json │ │ ├── LICENSE │ │ └── dist │ │ │ ├── css │ │ │ ├── bootstrap-theme.css │ │ │ ├── bootstrap-theme.css.map │ │ │ ├── bootstrap-theme.min.css │ │ │ ├── bootstrap-theme.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ └── js │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.min.js │ │ │ └── npm.js │ │ ├── jquery-validation-unobtrusive │ │ ├── .bower.json │ │ ├── jquery.validate.unobtrusive.js │ │ └── jquery.validate.unobtrusive.min.js │ │ ├── jquery-validation │ │ ├── .bower.json │ │ ├── LICENSE.md │ │ └── dist │ │ │ ├── additional-methods.js │ │ │ ├── additional-methods.min.js │ │ │ ├── jquery.validate.js │ │ │ └── jquery.validate.min.js │ │ └── jquery │ │ ├── .bower.json │ │ ├── LICENSE.txt │ │ └── dist │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ └── jquery.min.map ├── Glimpse.AgentServer.AspNet.Mvc.Simple.Sample │ ├── .bowerrc │ ├── Controllers │ │ └── HomeController.cs │ ├── Glimpse.AgentServer.AspNet.Mvc.Simple.Sample.csproj │ ├── Program.cs │ ├── Startup.cs │ ├── Views │ │ ├── Home │ │ │ ├── About.cshtml │ │ │ ├── Contact.cshtml │ │ │ └── Index.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ └── _Layout.cshtml │ │ ├── _ViewImports.cshtml │ │ └── _ViewStart.cshtml │ ├── appsettings.json │ ├── bower.json │ ├── bundleconfig.json │ ├── web.config │ └── wwwroot │ │ ├── _references.js │ │ ├── css │ │ ├── site.css │ │ └── site.min.css │ │ ├── favicon.ico │ │ ├── images │ │ ├── banner1.svg │ │ ├── banner2.svg │ │ ├── banner3.svg │ │ └── banner4.svg │ │ ├── js │ │ ├── site.js │ │ └── site.min.js │ │ └── lib │ │ ├── bootstrap │ │ ├── .bower.json │ │ ├── LICENSE │ │ └── dist │ │ │ ├── css │ │ │ ├── bootstrap-theme.css │ │ │ ├── bootstrap-theme.css.map │ │ │ ├── bootstrap-theme.min.css │ │ │ ├── bootstrap-theme.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ └── js │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.min.js │ │ │ └── npm.js │ │ ├── jquery-validation-unobtrusive │ │ ├── .bower.json │ │ ├── jquery.validate.unobtrusive.js │ │ └── jquery.validate.unobtrusive.min.js │ │ ├── jquery-validation │ │ ├── .bower.json │ │ ├── LICENSE.md │ │ └── dist │ │ │ ├── additional-methods.js │ │ │ ├── additional-methods.min.js │ │ │ ├── jquery.validate.js │ │ │ └── jquery.validate.min.js │ │ └── jquery │ │ ├── .bower.json │ │ ├── LICENSE.txt │ │ └── dist │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ └── jquery.min.map ├── Glimpse.AgentServer.AspNet.Sample │ ├── Glimpse.AgentServer.AspNet.Sample.csproj │ ├── Program.cs │ ├── Properties │ │ └── debugSettings.json │ ├── SamplePage.cs │ ├── Startup.cs │ └── web.config ├── Glimpse.Server.AspNet.Sample │ ├── Glimpse.Server.AspNet.Sample.csproj │ ├── Program.cs │ ├── Properties │ │ └── debugSettings.json │ ├── Startup.cs │ └── web.config └── MusicStore │ ├── Areas │ └── Admin │ │ ├── Controllers │ │ └── StoreManagerController.cs │ │ └── Views │ │ ├── StoreManager │ │ ├── Create.cshtml │ │ ├── Details.cshtml │ │ ├── Edit.cshtml │ │ ├── Index.cshtml │ │ └── RemoveAlbum.cshtml │ │ └── _ViewStart.cshtml │ ├── Components │ ├── CartSummaryComponent.cs │ ├── GenreMenuComponent.cs │ ├── ISystemClock.cs │ └── SystemClock.cs │ ├── Controllers │ ├── AccountController.cs │ ├── CheckoutController.cs │ ├── HomeController.cs │ ├── ManageController.cs │ ├── ShoppingCartController.cs │ └── StoreController.cs │ ├── MessageServices.cs │ ├── Models │ ├── AccountViewModels.cs │ ├── Album.cs │ ├── Artist.cs │ ├── CartItem.cs │ ├── Genre.cs │ ├── ManageViewModels.cs │ ├── MusicStoreContext.cs │ ├── Order.cs │ ├── OrderDetail.cs │ ├── SampleData.cs │ └── ShoppingCart.cs │ ├── MusicStore.csproj │ ├── MusicStoreConfig.cs │ ├── Platform.cs │ ├── Program.cs │ ├── Properties │ └── AppSettings.cs │ ├── Scripts │ └── _references.js │ ├── Startup.cs │ ├── StartupNtlmAuthentication.cs │ ├── StartupOpenIdConnect.cs │ ├── ViewModels │ ├── AlbumData.cs │ ├── ShoppingCartRemoveViewModel.cs │ └── ShoppingCartViewModel.cs │ ├── Views │ ├── Account │ │ ├── ConfirmEmail.cshtml │ │ ├── ExternalLoginConfirmation.cshtml │ │ ├── ExternalLoginFailure.cshtml │ │ ├── ForgotPassword.cshtml │ │ ├── ForgotPasswordConfirmation.cshtml │ │ ├── Login.cshtml │ │ ├── Register.cshtml │ │ ├── RegisterConfirmation.cshtml │ │ ├── ResetPassword.cshtml │ │ ├── ResetPasswordConfirmation.cshtml │ │ ├── SendCode.cshtml │ │ ├── VerifyCode.cshtml │ │ └── _ExternalLoginsListPartial.cshtml │ ├── Checkout │ │ ├── AddressAndPayment.cshtml │ │ └── Complete.cshtml │ ├── Home │ │ └── Index.cshtml │ ├── Manage │ │ ├── AddPhoneNumber.cshtml │ │ ├── ChangePassword.cshtml │ │ ├── Index.cshtml │ │ ├── ManageLogins.cshtml │ │ ├── SetPassword.cshtml │ │ └── VerifyPhoneNumber.cshtml │ ├── Shared │ │ ├── AccessDenied.cshtml │ │ ├── Components │ │ │ ├── Announcement │ │ │ │ └── Default.cshtml │ │ │ ├── CartSummary │ │ │ │ └── Default.cshtml │ │ │ └── GenreMenu │ │ │ │ └── Default.cshtml │ │ ├── DemoLinkDisplay.cshtml │ │ ├── Error.cshtml │ │ ├── Lockout.cshtml │ │ ├── StatusCodePage.cshtml │ │ ├── _Layout.cshtml │ │ ├── _LoginPartial.cshtml │ │ └── _ValidationScriptsPartial.cshtml │ ├── ShoppingCart │ │ └── Index.cshtml │ ├── Store │ │ ├── Browse.cshtml │ │ ├── Details.cshtml │ │ └── Index.cshtml │ ├── _ViewImports.cshtml │ └── _ViewStart.cshtml │ ├── config.json │ ├── web.config │ └── wwwroot │ ├── Content │ ├── Site.css │ ├── bootstrap.css │ └── bootstrap.min.css │ ├── Images │ ├── home-showcase.png │ ├── logo.png │ ├── logo.svg │ ├── placeholder.png │ └── placeholder.svg │ ├── Scripts │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery-2.0.3.intellisense.js │ ├── jquery-2.0.3.js │ ├── jquery-2.0.3.min.js │ ├── jquery-2.0.3.min.map │ ├── jquery.signalR-2.0.1.js │ ├── jquery.signalR-2.0.1.min.js │ ├── jquery.validate-vsdoc.js │ ├── jquery.validate.js │ ├── jquery.validate.min.js │ ├── jquery.validate.unobtrusive.js │ ├── jquery.validate.unobtrusive.min.js │ ├── modernizr-2.6.2.js │ ├── respond.js │ └── respond.min.js │ ├── favicon.ico │ └── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff ├── src ├── Glimpse.Agent.AspNet.Mvc │ ├── Glimpse.Agent.AspNet.Mvc.csproj │ └── Razor │ │ ├── RazorServices.cs │ │ ├── ScriptInjector.cs │ │ └── ScriptInjectorRazorHost.cs ├── Glimpse.Agent.AspNet │ ├── AgentMiddleware.cs │ ├── AgentServices.cs │ ├── Configuration │ │ ├── DefaultRequestIgnorerContentTypeProvider.cs │ │ ├── DefaultRequestIgnorerManager.cs │ │ ├── DefaultRequestIgnorerStatusCodeProvider.cs │ │ ├── DefaultRequestIgnorerUriProvider.cs │ │ ├── IRequestIgnorer.cs │ │ ├── IRequestIgnorerContentTypeProvider.cs │ │ ├── IRequestIgnorerManager.cs │ │ ├── IRequestIgnorerStatusCodeProvider.cs │ │ ├── IRequestIgnorerUriProvider.cs │ │ ├── RegexExtensions.cs │ │ ├── RequestIgnorerContentType.cs │ │ ├── RequestIgnorerOptionsShouldIgnore.cs │ │ ├── RequestIgnorerStatusCode.cs │ │ └── RequestIgnorerUri.cs │ ├── Glimpse.Agent.AspNet.csproj │ ├── GlimpseAgentMiddleware.cs │ ├── GlimpseAgentOptions.cs │ ├── GlimpseAgentOptionsSetup.cs │ ├── GlimpseAgentServiceCollectionBuilder.cs │ ├── GlimpseAgentServiceCollectionExtensions.cs │ ├── Initialization │ │ ├── DefaultAgentStartupManager.cs │ │ ├── IAgentStartup.cs │ │ └── IAgentStartupManager.cs │ ├── Inspectors │ │ ├── DefaultInspectorFunctionManager.cs │ │ ├── Execute.cs │ │ ├── IInspector.cs │ │ ├── IInspectorFunction.cs │ │ ├── IInspectorFunctionBuilder.cs │ │ ├── IInspectorFunctionManager.cs │ │ ├── Inspector.cs │ │ ├── InspectorFunctionBuilder.cs │ │ ├── InspectorsInspectorFunction.cs │ │ └── Tab.cs │ ├── Internal │ │ ├── Inspectors │ │ │ ├── AgentStartupWebDiagnosticsInspector.cs │ │ │ ├── AspNet │ │ │ │ ├── AjaxInspector.cs │ │ │ │ ├── AspNetDiagnosticsInspector.cs │ │ │ │ ├── EnvironmentInspector.cs │ │ │ │ ├── ExceptionProcessor.cs │ │ │ │ ├── IExceptionProcessor.cs │ │ │ │ └── UserInspector.cs │ │ │ ├── EF │ │ │ │ ├── EFDiagnosticsInspector.cs │ │ │ │ └── Proxies │ │ │ │ │ └── IDbCommand.cs │ │ │ ├── Mvc │ │ │ │ ├── MvcDiagnosticsInspector.cs │ │ │ │ └── Proxies │ │ │ │ │ ├── ActionResultTypes.cs │ │ │ │ │ ├── IActionContext.cs │ │ │ │ │ ├── IActionDescriptor.cs │ │ │ │ │ ├── IActionResult.cs │ │ │ │ │ ├── IRouteData.cs │ │ │ │ │ ├── IView.cs │ │ │ │ │ ├── IViewComponentContext.cs │ │ │ │ │ ├── IViewComponentDescriptor.cs │ │ │ │ │ ├── IViewContext.cs │ │ │ │ │ └── ProxyAdapter.cs │ │ │ └── WebDiagnosticsInspector.cs │ │ ├── Messaging │ │ │ ├── DefaultMessageConverter.cs │ │ │ ├── DefaultMessageIndexProcessor.cs │ │ │ ├── DefaultMessagePayloadFormatter.cs │ │ │ ├── DefaultMessageTypeProcessor.cs │ │ │ ├── IMessageConverter.cs │ │ │ ├── IMessageIndexProcessor.cs │ │ │ ├── IMessagePayloadFormatter.cs │ │ │ └── IMessageTypeProcessor.cs │ │ └── Tabs │ │ │ ├── ConnectionTab.cs │ │ │ └── HeadersTab.cs │ ├── Messages │ │ ├── ActionViewDidFoundMessage.cs │ │ ├── ActionViewFoundMessage.cs │ │ ├── ActionViewNotFoundMessage.cs │ │ ├── AfterActionInvokedMessage.cs │ │ ├── AfterActionMessage.cs │ │ ├── AfterActionResultMessage.cs │ │ ├── AfterActionViewInvokedMessage.cs │ │ ├── AfterExecuteCommandMessage.cs │ │ ├── AfterViewComponentMessage.cs │ │ ├── ArgumentData.cs │ │ ├── BeforeActionInvokedMessage.cs │ │ ├── BeforeActionMessage.cs │ │ ├── BeforeActionResultMessage.cs │ │ ├── BeforeActionViewInvokedMessage.cs │ │ ├── BeforeExecuteCommandMessage.cs │ │ ├── BeforeViewComponentMessage.cs │ │ ├── BeginRequestMessage.cs │ │ ├── BindingData.cs │ │ ├── DiagnosticsExceptionMessage.cs │ │ ├── EndRequestMessage.cs │ │ ├── EnvironmentMessage.cs │ │ ├── ExceptionDetails.cs │ │ ├── HostingExceptionMessage.cs │ │ ├── IActionContentMessage.cs │ │ ├── IActionRouteMessage.cs │ │ ├── IExceptionMessage.cs │ │ ├── RouteData.cs │ │ ├── StackFrame.cs │ │ ├── TabMessage.cs │ │ ├── UserIdentificationMessage.cs │ │ └── ViewResultData.cs │ └── Messaging │ │ ├── AgentBrokerExtensions.cs │ │ ├── DefaultAgentBroker.cs │ │ ├── HttpMessagePublisher.cs │ │ ├── PromoteToContentTypeAttribute.cs │ │ ├── PromoteToDateTimeAttribute.cs │ │ ├── PromoteToDurationAttribute.cs │ │ ├── PromoteToMethodAttribute.cs │ │ ├── PromoteToStatusCodeAttribute.cs │ │ ├── PromoteToUrlAttribute.cs │ │ └── PromoteToUserIdAttribute.cs ├── Glimpse.Common │ ├── ApplicationBuilderExtensions.cs │ ├── DefaultGlimpseContextAccessor.cs │ ├── Glimpse.Common.csproj │ ├── GlimpseOptions.cs │ ├── GlimpseServiceCollectionBuilder.cs │ ├── GlimpseServiceCollectionExtensions.cs │ ├── GlimpseServices.cs │ ├── IGlimpseContextAccessor.cs │ ├── Initialization │ │ ├── DefaultExtensionProvider.cs │ │ ├── FixedExtensionProvider.cs │ │ ├── IExtensionProvider.cs │ │ ├── IRegisterMiddleware.cs │ │ ├── IRegisterServices.cs │ │ ├── IResourceOptionsProvider.cs │ │ ├── IStartupOptions.cs │ │ ├── OptionsResourceOptionsProvider.cs │ │ ├── ResourceOptions.cs │ │ └── StartupOptions.cs │ ├── Internal │ │ ├── ContextData.cs │ │ ├── Extensions │ │ │ ├── DictionaryExtensions.cs │ │ │ ├── HashExtensions.cs │ │ │ ├── JsonSerializerExtensions.cs │ │ │ ├── PathStringExtension.cs │ │ │ ├── ReflectionExtensions.cs │ │ │ ├── StringExtensions.cs │ │ │ └── TypeExtension.cs │ │ ├── IContextData.cs │ │ ├── Messaging │ │ │ ├── Operation.cs │ │ │ ├── OperationOffset.cs │ │ │ ├── OperationStack.cs │ │ │ ├── OperationTiming.cs │ │ │ └── Timing.cs │ │ ├── Reflection │ │ │ ├── DefaultAssemblyProvider.cs │ │ │ ├── DefaultTypeActivator.cs │ │ │ ├── DefaultTypeSelector.cs │ │ │ ├── DefaultTypeService.cs │ │ │ ├── IAssemblyProvider.cs │ │ │ ├── ITypeActivator.cs │ │ │ ├── ITypeSelector.cs │ │ │ └── ITypeService.cs │ │ ├── SanitizeUserObjectsHelper.cs │ │ ├── Serialization │ │ │ ├── DefaultJsonSerializerProvider.cs │ │ │ ├── GuidConverter.cs │ │ │ ├── IJsonSerializerProvider.cs │ │ │ ├── StringValuesConverter.cs │ │ │ └── TimeSpanConverter.cs │ │ ├── ServiceCollectionWrapper.cs │ │ └── TypeNameHelper.cs │ └── Messaging │ │ ├── AgentBrokerObservations.cs │ │ ├── AgentBrokerPayload.cs │ │ ├── IAgentBroker.cs │ │ ├── IMessage.cs │ │ ├── IMessagePublisher.cs │ │ ├── IMessageTypeProvider.cs │ │ ├── Message.cs │ │ ├── MessageContext.cs │ │ └── PromoteToAttribute.cs ├── Glimpse.Server │ ├── Configuration │ │ ├── AllowAgentAccessOptions.cs │ │ ├── AllowClientAccessOptions.cs │ │ ├── AllowClientAccessRemote.cs │ │ ├── DefaultAllowRemoteProvider.cs │ │ ├── DefaultMetadataProvider.cs │ │ ├── DefaultResourceOptionsProvider.cs │ │ ├── IAllowAgentAccess.cs │ │ ├── IAllowClientAccess.cs │ │ ├── IAllowRemoteProvider.cs │ │ ├── IMetadataProvider.cs │ │ └── Metadata.cs │ ├── Glimpse.Server.csproj │ ├── GlimpseServerMiddleware.cs │ ├── GlimpseServerOptions.cs │ ├── GlimpseServerOptionsSetup.cs │ ├── GlimpseServerServiceCollectionBuilder.cs │ ├── GlimpseServerServiceCollectionExtensions.cs │ ├── Internal │ │ ├── Extensions │ │ │ ├── JsonStringExtensions.cs │ │ │ ├── ParameterExtensions.cs │ │ │ └── UriTemplateExtensions.cs │ │ ├── IResourceManager.cs │ │ ├── ResourceManager.cs │ │ ├── ResourceManagerResult.cs │ │ └── Resources │ │ │ ├── ContextResource.cs │ │ │ ├── EmbeddedFileResource.cs │ │ │ ├── Embeded │ │ │ ├── Agent │ │ │ │ └── agent │ │ │ │ │ └── agent.js │ │ │ └── Client │ │ │ │ ├── client │ │ │ │ ├── assets │ │ │ │ │ ├── favicon.png │ │ │ │ │ ├── logo-long-white.png │ │ │ │ │ ├── selawk.woff │ │ │ │ │ ├── selawk.woff2 │ │ │ │ │ ├── selawkl.woff │ │ │ │ │ └── selawkl.woff2 │ │ │ │ ├── index.html │ │ │ │ ├── main.js │ │ │ │ └── main.min.js │ │ │ │ ├── diagnostics │ │ │ │ ├── index.html │ │ │ │ └── scripts │ │ │ │ │ ├── jquery │ │ │ │ │ ├── jquery-2.1.1.js │ │ │ │ │ └── jquery-2.1.1.min.js │ │ │ │ │ ├── reactjs │ │ │ │ │ ├── JSXTransformer.js │ │ │ │ │ ├── react-with-addons.js │ │ │ │ │ ├── react-with-addons.min.js │ │ │ │ │ ├── react.js │ │ │ │ │ └── react.min.js │ │ │ │ │ └── signalr │ │ │ │ │ ├── jquery.signalR-2.2.0.js │ │ │ │ │ └── jquery.signalR-2.2.0.min.js │ │ │ │ └── hud │ │ │ │ ├── assets │ │ │ │ ├── glimpse-logo.png │ │ │ │ ├── selawk.woff │ │ │ │ ├── selawk.woff2 │ │ │ │ ├── selawkl.woff │ │ │ │ └── selawkl.woff2 │ │ │ │ ├── hud.js │ │ │ │ └── hud.min.js │ │ │ ├── ExportConfigurationResource.cs │ │ │ ├── MessageHistoryResource.cs │ │ │ ├── MessageIngressResource.cs │ │ │ ├── MessageStreamResource.cs │ │ │ ├── MetadataResource.cs │ │ │ ├── NullResponse.cs │ │ │ ├── RequestHistoryResource.cs │ │ │ └── ResponseDecorator.cs │ ├── Messaging │ │ ├── DefaultServerBroker.cs │ │ ├── IServerBroker.cs │ │ ├── InProcessPublisher.cs │ │ └── ServerBrokerObservations.cs │ ├── Properties │ │ └── debugSettings.json │ ├── Resources │ │ ├── ExceptionProblem.cs │ │ ├── HttpContextExtensions.cs │ │ ├── HttpStatusResponse.cs │ │ ├── IResource.cs │ │ ├── IResourceBuilder.cs │ │ ├── IResourceStartup.cs │ │ ├── IResponse.cs │ │ ├── InvalidJsonProblem.cs │ │ ├── InvalidMethodProblem.cs │ │ ├── Json.cs │ │ ├── MissingParameterProblem.cs │ │ ├── Problem.cs │ │ ├── RawJson.cs │ │ ├── ResourceBuilder.cs │ │ ├── ResourceParameter.cs │ │ ├── ResourceParameterExtentions.cs │ │ └── ResourceType.cs │ ├── ServerMiddleware.cs │ ├── ServerServices.cs │ └── Storage │ │ ├── IQueryRequests.cs │ │ ├── IStorage.cs │ │ ├── InMemoryStorage.cs │ │ └── StorageExtensions.cs ├── Glimpse │ ├── Glimpse.nuspec │ ├── lib │ │ ├── net35 │ │ │ └── Glimpse.Core.dll │ │ ├── net40 │ │ │ └── Glimpse.Core.dll │ │ ├── net45 │ │ │ └── Glimpse.Core.dll │ │ ├── net451 │ │ │ └── _._ │ │ └── netstandard1.6 │ │ │ └── _._ │ └── tools │ │ ├── glimpse.psm1 │ │ ├── init.ps1 │ │ ├── install.ps1 │ │ └── uninstall.ps1 └── readme.md └── test ├── Glimpse.FunctionalTest ├── FunctionalTests.cs └── Glimpse.FunctionalTest.csproj ├── Glimpse.Prototype.UnitTest ├── Glimpse.Prototype.UnitTest.csproj └── InMemoryStorageUnitTests.cs └── websites └── Glimpse.FunctionalTest.Website ├── Controllers └── HomeController.cs ├── Glimpse.FunctionalTest.Website.csproj ├── Program.cs ├── Startup.cs └── hosting.ini /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Glimpse Project 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /NuGet.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/NuGet.exe -------------------------------------------------------------------------------- /build.cmd: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*; exit $LASTEXITCODE" -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "projects": [ 3 | "src", 4 | "test/websites" 5 | ], 6 | "sdk": { 7 | "version": "1.0.0-preview2-003121" 8 | } 9 | } -------------------------------------------------------------------------------- /makefile.shade: -------------------------------------------------------------------------------- 1 | 2 | var VERSION='0.1' 3 | var FULL_VERSION='0.1' 4 | var AUTHORS='Microsoft Open Technologies, Inc.' 5 | 6 | use-standard-lifecycle 7 | k-standard-goals -------------------------------------------------------------------------------- /sample/Glimpse.Agent.AspNet.Sample/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace Glimpse.Agent.AspNet.Sample 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | var host = new WebHostBuilder() 15 | .UseKestrel() 16 | .UseContentRoot(Directory.GetCurrentDirectory()) 17 | .UseIISIntegration() 18 | .UseStartup() 19 | .Build(); 20 | 21 | host.Run(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sample/Glimpse.Agent.AspNet.Sample/Properties/debugSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Profiles": [] 3 | } -------------------------------------------------------------------------------- /sample/Glimpse.Agent.AspNet.Sample/glimpse.json: -------------------------------------------------------------------------------- 1 | { 2 | "resources": { 3 | "browserAgentScriptTemplate": "http://localhost:5210/glimpse/agent/agent.js?hash=abaae0c9", 4 | "hudScriptTemplate": "http://localhost:5210/glimpse/hud/hud.js?hash=abaae0c9", 5 | "messageIngressTemplate": "http://localhost:5210/glimpse/message-ingress/", 6 | "metadataTemplate": "http://localhost:5210/glimpse/metadata/?hash=abaae0c9", 7 | "contextTemplate": "http://localhost:5210/glimpse/context/?contextId={contextId}{&types}", 8 | "clientScriptTemplate": "http://localhost:5210/glimpse/client/index.html?hash=abaae0c9{&requestId,follow,metadataUri}" 9 | } 10 | } -------------------------------------------------------------------------------- /sample/Glimpse.Agent.AspNet.Sample/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "wwwroot/lib" 3 | } 4 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | 7 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Controllers 8 | { 9 | public class HomeController : Controller 10 | { 11 | public IActionResult Index() 12 | { 13 | return View(); 14 | } 15 | 16 | public IActionResult About() 17 | { 18 | ViewData["Message"] = "Your application description page."; 19 | 20 | return View(); 21 | } 22 | 23 | public IActionResult Contact() 24 | { 25 | ViewData["Message"] = "Your contact page."; 26 | 27 | return View(); 28 | } 29 | 30 | public IActionResult Error() 31 | { 32 | return View(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Data/ApplicationDbContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore; 6 | using Microsoft.EntityFrameworkCore; 7 | using Glimpse.AgentServer.AspNet.Mvc.Sample.Models; 8 | 9 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Data 10 | { 11 | public class ApplicationDbContext : IdentityDbContext 12 | { 13 | public ApplicationDbContext(DbContextOptions options) 14 | : base(options) 15 | { 16 | } 17 | 18 | protected override void OnModelCreating(ModelBuilder builder) 19 | { 20 | base.OnModelCreating(builder); 21 | // Customize the ASP.NET Identity model and override the defaults if needed. 22 | // For example, you can rename the ASP.NET Identity table names and more. 23 | // Add your customizations after calling base.OnModelCreating(builder); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Models.AccountViewModels 8 | { 9 | public class ExternalLoginConfirmationViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | public string Email { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Models/AccountViewModels/ForgotPasswordViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Models.AccountViewModels 8 | { 9 | public class ForgotPasswordViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | public string Email { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Models/AccountViewModels/LoginViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Models.AccountViewModels 8 | { 9 | public class LoginViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | public string Email { get; set; } 14 | 15 | [Required] 16 | [DataType(DataType.Password)] 17 | public string Password { get; set; } 18 | 19 | [Display(Name = "Remember me?")] 20 | public bool RememberMe { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Models/AccountViewModels/RegisterViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Models.AccountViewModels 8 | { 9 | public class RegisterViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | [Display(Name = "Email")] 14 | public string Email { get; set; } 15 | 16 | [Required] 17 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 18 | [DataType(DataType.Password)] 19 | [Display(Name = "Password")] 20 | public string Password { get; set; } 21 | 22 | [DataType(DataType.Password)] 23 | [Display(Name = "Confirm password")] 24 | [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] 25 | public string ConfirmPassword { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Models/AccountViewModels/ResetPasswordViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Models.AccountViewModels 8 | { 9 | public class ResetPasswordViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | public string Email { get; set; } 14 | 15 | [Required] 16 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 17 | [DataType(DataType.Password)] 18 | public string Password { get; set; } 19 | 20 | [DataType(DataType.Password)] 21 | [Display(Name = "Confirm password")] 22 | [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] 23 | public string ConfirmPassword { get; set; } 24 | 25 | public string Code { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Models/AccountViewModels/SendCodeViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc.Rendering; 6 | 7 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Models.AccountViewModels 8 | { 9 | public class SendCodeViewModel 10 | { 11 | public string SelectedProvider { get; set; } 12 | 13 | public ICollection Providers { get; set; } 14 | 15 | public string ReturnUrl { get; set; } 16 | 17 | public bool RememberMe { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Models/AccountViewModels/VerifyCodeViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Models.AccountViewModels 8 | { 9 | public class VerifyCodeViewModel 10 | { 11 | [Required] 12 | public string Provider { get; set; } 13 | 14 | [Required] 15 | public string Code { get; set; } 16 | 17 | public string ReturnUrl { get; set; } 18 | 19 | [Display(Name = "Remember this browser?")] 20 | public bool RememberBrowser { get; set; } 21 | 22 | [Display(Name = "Remember me?")] 23 | public bool RememberMe { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Models/ApplicationUser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore; 6 | 7 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Models 8 | { 9 | // Add profile data for application users by adding properties to the ApplicationUser class 10 | public class ApplicationUser : IdentityUser 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Models/ManageViewModels/AddPhoneNumberViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Models.ManageViewModels 8 | { 9 | public class AddPhoneNumberViewModel 10 | { 11 | [Required] 12 | [Phone] 13 | [Display(Name = "Phone number")] 14 | public string PhoneNumber { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Models/ManageViewModels/ChangePasswordViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Models.ManageViewModels 8 | { 9 | public class ChangePasswordViewModel 10 | { 11 | [Required] 12 | [DataType(DataType.Password)] 13 | [Display(Name = "Current password")] 14 | public string OldPassword { get; set; } 15 | 16 | [Required] 17 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 18 | [DataType(DataType.Password)] 19 | [Display(Name = "New password")] 20 | public string NewPassword { get; set; } 21 | 22 | [DataType(DataType.Password)] 23 | [Display(Name = "Confirm new password")] 24 | [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] 25 | public string ConfirmPassword { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc.Rendering; 6 | 7 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Models.ManageViewModels 8 | { 9 | public class ConfigureTwoFactorViewModel 10 | { 11 | public string SelectedProvider { get; set; } 12 | 13 | public ICollection Providers { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Models/ManageViewModels/FactorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Models.ManageViewModels 7 | { 8 | public class FactorViewModel 9 | { 10 | public string Purpose { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Models/ManageViewModels/IndexViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Identity; 6 | 7 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Models.ManageViewModels 8 | { 9 | public class IndexViewModel 10 | { 11 | public bool HasPassword { get; set; } 12 | 13 | public IList Logins { get; set; } 14 | 15 | public string PhoneNumber { get; set; } 16 | 17 | public bool TwoFactor { get; set; } 18 | 19 | public bool BrowserRemembered { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Models/ManageViewModels/ManageLoginsViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Http.Authentication; 6 | using Microsoft.AspNetCore.Identity; 7 | 8 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Models.ManageViewModels 9 | { 10 | public class ManageLoginsViewModel 11 | { 12 | public IList CurrentLogins { get; set; } 13 | 14 | public IList OtherLogins { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Models/ManageViewModels/RemoveLoginViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Models.ManageViewModels 8 | { 9 | public class RemoveLoginViewModel 10 | { 11 | public string LoginProvider { get; set; } 12 | public string ProviderKey { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Models/ManageViewModels/SetPasswordViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Models.ManageViewModels 8 | { 9 | public class SetPasswordViewModel 10 | { 11 | [Required] 12 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 13 | [DataType(DataType.Password)] 14 | [Display(Name = "New password")] 15 | public string NewPassword { get; set; } 16 | 17 | [DataType(DataType.Password)] 18 | [Display(Name = "Confirm new password")] 19 | [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] 20 | public string ConfirmPassword { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Models.ManageViewModels 8 | { 9 | public class VerifyPhoneNumberViewModel 10 | { 11 | [Required] 12 | public string Code { get; set; } 13 | 14 | [Required] 15 | [Phone] 16 | [Display(Name = "Phone number")] 17 | public string PhoneNumber { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | var host = new WebHostBuilder() 15 | .UseKestrel() 16 | .UseContentRoot(Directory.GetCurrentDirectory()) 17 | .UseIISIntegration() 18 | .UseStartup() 19 | .Build(); 20 | 21 | host.Run(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Services/IEmailSender.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Services 7 | { 8 | public interface IEmailSender 9 | { 10 | Task SendEmailAsync(string email, string subject, string message); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Services/ISmsSender.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Services 7 | { 8 | public interface ISmsSender 9 | { 10 | Task SendSmsAsync(string number, string message); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Services/MessageServices.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Services 7 | { 8 | // This class is used by the application to send Email and SMS 9 | // when you turn on two-factor authentication in ASP.NET Identity. 10 | // For more details see this link http://go.microsoft.com/fwlink/?LinkID=532713 11 | public class AuthMessageSender : IEmailSender, ISmsSender 12 | { 13 | public Task SendEmailAsync(string email, string subject, string message) 14 | { 15 | // Plug in your email service here to send an email. 16 | return Task.FromResult(0); 17 | } 18 | 19 | public Task SendSmsAsync(string number, string message) 20 | { 21 | // Plug in your SMS service here to send a text message. 22 | return Task.FromResult(0); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Account/ConfirmEmail.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Confirm Email"; 3 | } 4 | 5 |

@ViewData["Title"].

6 |
7 |

8 | Thank you for confirming your email. Please Click here to Log in. 9 |

10 |
11 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Account/ExternalLoginFailure.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Login Failure"; 3 | } 4 | 5 |
6 |

@ViewData["Title"].

7 |

Unsuccessful login with service.

8 |
9 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Account/ForgotPassword.cshtml: -------------------------------------------------------------------------------- 1 | @model ForgotPasswordViewModel 2 | @{ 3 | ViewData["Title"] = "Forgot your password?"; 4 | } 5 | 6 |

@ViewData["Title"]

7 |

8 | For more information on how to enable reset password please see this article. 9 |

10 | 11 | @*
12 |

Enter your email.

13 |
14 |
15 |
16 | 17 |
18 | 19 | 20 |
21 |
22 |
23 |
24 | 25 |
26 |
27 |
*@ 28 | 29 | @section Scripts { 30 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 31 | } 32 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Account/ForgotPasswordConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Forgot Password Confirmation"; 3 | } 4 | 5 |

@ViewData["Title"].

6 |

7 | Please check your email to reset your password. 8 |

9 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Account/Lockout.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Locked out"; 3 | } 4 | 5 |
6 |

Locked out.

7 |

This account has been locked out, please try again later.

8 |
9 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Account/ResetPasswordConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Reset password confirmation"; 3 | } 4 | 5 |

@ViewData["Title"].

6 |

7 | Your password has been reset. Please Click here to log in. 8 |

9 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Account/SendCode.cshtml: -------------------------------------------------------------------------------- 1 | @model SendCodeViewModel 2 | @{ 3 | ViewData["Title"] = "Send Verification Code"; 4 | } 5 | 6 |

@ViewData["Title"].

7 | 8 |
9 | 10 |
11 |
12 | Select Two-Factor Authentication Provider: 13 | 14 | 15 |
16 |
17 |
18 | 19 | @section Scripts { 20 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 21 | } 22 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "About"; 3 | } 4 |

@ViewData["Title"].

5 |

@ViewData["Message"]

6 | 7 |

Use this area to provide additional information.

8 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Home/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Contact"; 3 | } 4 |

@ViewData["Title"].

5 |

@ViewData["Message"]

6 | 7 |
8 | One Microsoft Way
9 | Redmond, WA 98052-6399
10 | P: 11 | 425.555.0100 12 |
13 | 14 |
15 | Support: Support@example.com
16 | Marketing: Marketing@example.com 17 |
18 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Manage/AddPhoneNumber.cshtml: -------------------------------------------------------------------------------- 1 | @model AddPhoneNumberViewModel 2 | @{ 3 | ViewData["Title"] = "Add Phone Number"; 4 | } 5 | 6 |

@ViewData["Title"].

7 |
8 |

Add a phone number.

9 |
10 |
11 |
12 | 13 |
14 | 15 | 16 |
17 |
18 |
19 |
20 | 21 |
22 |
23 |
24 | 25 | @section Scripts { 26 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 27 | } 28 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Manage/VerifyPhoneNumber.cshtml: -------------------------------------------------------------------------------- 1 | @model VerifyPhoneNumberViewModel 2 | @{ 3 | ViewData["Title"] = "Verify Phone Number"; 4 | } 5 | 6 |

@ViewData["Title"].

7 | 8 |
9 | 10 |

Add a phone number.

11 |
@ViewData["Status"]
12 |
13 |
14 |
15 | 16 |
17 | 18 | 19 |
20 |
21 |
22 |
23 | 24 |
25 |
26 |
27 | 28 | @section Scripts { 29 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 30 | } 31 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Error"; 3 | } 4 | 5 |

Error.

6 |

An error occurred while processing your request.

7 | 8 |

Development Mode

9 |

10 | Swapping to Development environment will display more detailed information about the error that occurred. 11 |

12 |

13 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. 14 |

15 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Identity 2 | @using Glimpse.AgentServer.AspNet.Mvc.Sample.Models 3 | 4 | @inject SignInManager SignInManager 5 | @inject UserManager UserManager 6 | 7 | @if (SignInManager.IsSignedIn(User)) 8 | { 9 | 19 | } 20 | else 21 | { 22 | 26 | } 27 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 10 | 14 | 15 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Glimpse.AgentServer.AspNet.Mvc.Sample 2 | @using Glimpse.AgentServer.AspNet.Mvc.Sample.Models 3 | @using Glimpse.AgentServer.AspNet.Mvc.Sample.Models.AccountViewModels 4 | @using Glimpse.AgentServer.AspNet.Mvc.Sample.Models.ManageViewModels 5 | @using Microsoft.AspNetCore.Identity 6 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 7 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-Glimpse.AgentServer.AspNet.Mvc.Sample-dbd166cf-e778-4976-a0f5-6c3de1011986;Trusted_Connection=True;MultipleActiveResultSets=true" 4 | }, 5 | "Logging": { 6 | "IncludeScopes": false, 7 | "LogLevel": { 8 | "Default": "Debug", 9 | "System": "Information", 10 | "Microsoft": "Information" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "asp.net", 3 | "private": true, 4 | "dependencies": { 5 | "bootstrap": "3.3.6", 6 | "jquery": "2.2.0", 7 | "jquery-validation": "1.14.0", 8 | "jquery-validation-unobtrusive": "3.2.6" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/bundleconfig.json: -------------------------------------------------------------------------------- 1 | // Configure bundling and minification for the project. 2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241 3 | [ 4 | { 5 | "outputFileName": "wwwroot/css/site.min.css", 6 | // An array of relative input file paths. Globbing patterns supported 7 | "inputFiles": [ 8 | "wwwroot/css/site.css" 9 | ] 10 | }, 11 | { 12 | "outputFileName": "wwwroot/js/site.min.js", 13 | "inputFiles": [ 14 | "wwwroot/js/site.js" 15 | ], 16 | // Optionally specify minification options 17 | "minify": { 18 | "enabled": true, 19 | "renameLocals": true 20 | }, 21 | // Optinally generate .map file 22 | "sourceMap": false 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/_references.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// 7 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}input,select,textarea{max-width:280px}.carousel-caption p{font-size:20px;line-height:1.4}.btn-bracketed::before{display:inline-block;content:"[";padding-right:.5em}.btn-bracketed::after{display:inline-block;content:"]";padding-left:.5em}.carousel-inner .item img[src$=".svg"]{width:100%}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/favicon.ico -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Write your Javascript code. 2 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/js/site.min.js -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/bootstrap/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap", 3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", 4 | "keywords": [ 5 | "css", 6 | "js", 7 | "less", 8 | "mobile-first", 9 | "responsive", 10 | "front-end", 11 | "framework", 12 | "web" 13 | ], 14 | "homepage": "http://getbootstrap.com", 15 | "license": "MIT", 16 | "moduleType": "globals", 17 | "main": [ 18 | "less/bootstrap.less", 19 | "dist/js/bootstrap.js" 20 | ], 21 | "ignore": [ 22 | "/.*", 23 | "_config.yml", 24 | "CNAME", 25 | "composer.json", 26 | "CONTRIBUTING.md", 27 | "docs", 28 | "js/tests", 29 | "test-infra" 30 | ], 31 | "dependencies": { 32 | "jquery": "1.9.1 - 2" 33 | }, 34 | "version": "3.3.6", 35 | "_release": "3.3.6", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.3.6", 39 | "commit": "81df608a40bf0629a1dc08e584849bb1e43e0b7a" 40 | }, 41 | "_source": "git://github.com/twbs/bootstrap.git", 42 | "_target": "3.3.6", 43 | "_originalSource": "bootstrap" 44 | } -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2015 Twitter, Inc 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/jquery-validation/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation", 3 | "homepage": "http://jqueryvalidation.org/", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/jzaefferer/jquery-validation.git" 7 | }, 8 | "authors": [ 9 | "Jörn Zaefferer " 10 | ], 11 | "description": "Form validation made easy", 12 | "main": "dist/jquery.validate.js", 13 | "keywords": [ 14 | "forms", 15 | "validation", 16 | "validate" 17 | ], 18 | "license": "MIT", 19 | "ignore": [ 20 | "**/.*", 21 | "node_modules", 22 | "bower_components", 23 | "test", 24 | "demo", 25 | "lib" 26 | ], 27 | "dependencies": { 28 | "jquery": ">= 1.7.2" 29 | }, 30 | "version": "1.14.0", 31 | "_release": "1.14.0", 32 | "_resolution": { 33 | "type": "version", 34 | "tag": "1.14.0", 35 | "commit": "c1343fb9823392aa9acbe1c3ffd337b8c92fed48" 36 | }, 37 | "_source": "git://github.com/jzaefferer/jquery-validation.git", 38 | "_target": ">=1.8", 39 | "_originalSource": "jquery-validation" 40 | } -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "2.2.0", 16 | "_release": "2.2.0", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "2.2.0", 20 | "commit": "6fc01e29bdad0964f62ef56d01297039cdcadbe5" 21 | }, 22 | "_source": "git://github.com/jquery/jquery-dist.git", 23 | "_target": "2.2.0", 24 | "_originalSource": "jquery" 25 | } -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "wwwroot/lib" 3 | } 4 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | 7 | namespace Glimpse.AgentServer.AspNet.Mvc.Simple.Sample.Controllers 8 | { 9 | public class HomeController : Controller 10 | { 11 | public IActionResult Index() 12 | { 13 | return View(); 14 | } 15 | 16 | public IActionResult About() 17 | { 18 | ViewData["Message"] = "Your application description page."; 19 | 20 | return View(); 21 | } 22 | 23 | public IActionResult Contact() 24 | { 25 | ViewData["Message"] = "Your contact page."; 26 | 27 | return View(); 28 | } 29 | 30 | public IActionResult Error() 31 | { 32 | return View(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace Glimpse.AgentServer.AspNet.Mvc.Simple.Sample 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | var host = new WebHostBuilder() 15 | .UseKestrel() 16 | .UseContentRoot(Directory.GetCurrentDirectory()) 17 | .UseIISIntegration() 18 | .UseStartup() 19 | .Build(); 20 | 21 | host.Run(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "About"; 3 | } 4 |

@ViewData["Title"].

5 |

@ViewData["Message"]

6 | 7 |

Use this area to provide additional information.

8 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/Views/Home/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Contact"; 3 | } 4 |

@ViewData["Title"].

5 |

@ViewData["Message"]

6 | 7 |
8 | One Microsoft Way
9 | Redmond, WA 98052-6399
10 | P: 11 | 425.555.0100 12 |
13 | 14 |
15 | Support: Support@example.com
16 | Marketing: Marketing@example.com 17 |
18 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Error"; 3 | } 4 | 5 |

Error.

6 |

An error occurred while processing your request.

7 | 8 |

Development Mode

9 |

10 | Swapping to Development environment will display more detailed information about the error that occurred. 11 |

12 |

13 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. 14 |

15 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Glimpse.AgentServer.AspNet.Mvc.Simple.Sample 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "asp.net", 3 | "private": true, 4 | "dependencies": { 5 | "bootstrap": "3.3.6", 6 | "jquery": "2.2.0", 7 | "jquery-validation": "1.14.0", 8 | "jquery-validation-unobtrusive": "3.2.6" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/bundleconfig.json: -------------------------------------------------------------------------------- 1 | // Configure bundling and minification for the project. 2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241 3 | [ 4 | { 5 | "outputFileName": "wwwroot/css/site.min.css", 6 | // An array of relative input file paths. Globbing patterns supported 7 | "inputFiles": [ 8 | "wwwroot/css/site.css" 9 | ] 10 | }, 11 | { 12 | "outputFileName": "wwwroot/js/site.min.js", 13 | "inputFiles": [ 14 | "wwwroot/js/site.js" 15 | ], 16 | // Optionally specify minification options 17 | "minify": { 18 | "enabled": true, 19 | "renameLocals": true 20 | }, 21 | // Optinally generate .map file 22 | "sourceMap": false 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/_references.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// 7 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Wrapping element */ 7 | /* Set some basic padding to keep content from hitting the edges */ 8 | .body-content { 9 | padding-left: 15px; 10 | padding-right: 15px; 11 | } 12 | 13 | /* Set widths on the form inputs since otherwise they're 100% wide */ 14 | input, 15 | select, 16 | textarea { 17 | max-width: 280px; 18 | } 19 | 20 | /* Carousel */ 21 | .carousel-caption p { 22 | font-size: 20px; 23 | line-height: 1.4; 24 | } 25 | 26 | /* Make .svg files in the carousel display properly in older browsers */ 27 | .carousel-inner .item img[src$=".svg"] 28 | { 29 | width: 100%; 30 | } 31 | 32 | /* Hide/rearrange for smaller screens */ 33 | @media screen and (max-width: 767px) { 34 | /* Hide captions */ 35 | .carousel-caption { 36 | display: none 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}input,select,textarea{max-width:280px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/favicon.ico -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Write your Javascript code. 2 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/js/site.min.js -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/bootstrap/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap", 3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", 4 | "keywords": [ 5 | "css", 6 | "js", 7 | "less", 8 | "mobile-first", 9 | "responsive", 10 | "front-end", 11 | "framework", 12 | "web" 13 | ], 14 | "homepage": "http://getbootstrap.com", 15 | "license": "MIT", 16 | "moduleType": "globals", 17 | "main": [ 18 | "less/bootstrap.less", 19 | "dist/js/bootstrap.js" 20 | ], 21 | "ignore": [ 22 | "/.*", 23 | "_config.yml", 24 | "CNAME", 25 | "composer.json", 26 | "CONTRIBUTING.md", 27 | "docs", 28 | "js/tests", 29 | "test-infra" 30 | ], 31 | "dependencies": { 32 | "jquery": "1.9.1 - 2" 33 | }, 34 | "version": "3.3.6", 35 | "_release": "3.3.6", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.3.6", 39 | "commit": "81df608a40bf0629a1dc08e584849bb1e43e0b7a" 40 | }, 41 | "_source": "git://github.com/twbs/bootstrap.git", 42 | "_target": "3.3.6", 43 | "_originalSource": "bootstrap" 44 | } -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2015 Twitter, Inc 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/jquery-validation/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation", 3 | "homepage": "http://jqueryvalidation.org/", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/jzaefferer/jquery-validation.git" 7 | }, 8 | "authors": [ 9 | "Jörn Zaefferer " 10 | ], 11 | "description": "Form validation made easy", 12 | "main": "dist/jquery.validate.js", 13 | "keywords": [ 14 | "forms", 15 | "validation", 16 | "validate" 17 | ], 18 | "license": "MIT", 19 | "ignore": [ 20 | "**/.*", 21 | "node_modules", 22 | "bower_components", 23 | "test", 24 | "demo", 25 | "lib" 26 | ], 27 | "dependencies": { 28 | "jquery": ">= 1.7.2" 29 | }, 30 | "version": "1.14.0", 31 | "_release": "1.14.0", 32 | "_resolution": { 33 | "type": "version", 34 | "tag": "1.14.0", 35 | "commit": "c1343fb9823392aa9acbe1c3ffd337b8c92fed48" 36 | }, 37 | "_source": "git://github.com/jzaefferer/jquery-validation.git", 38 | "_target": ">=1.8", 39 | "_originalSource": "jquery-validation" 40 | } -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "2.2.0", 16 | "_release": "2.2.0", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "2.2.0", 20 | "commit": "6fc01e29bdad0964f62ef56d01297039cdcadbe5" 21 | }, 22 | "_source": "git://github.com/jquery/jquery-dist.git", 23 | "_target": "2.2.0", 24 | "_originalSource": "jquery" 25 | } -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Sample/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace Glimpse.AgentServer.AspNet.Sample 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | var host = new WebHostBuilder() 15 | .UseKestrel() 16 | .UseContentRoot(Directory.GetCurrentDirectory()) 17 | .UseIISIntegration() 18 | .UseStartup() 19 | .Build(); 20 | 21 | host.Run(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Sample/Properties/debugSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Profiles": [] 3 | } -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Sample/SamplePage.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Glimpse.Internal; 3 | using Microsoft.AspNetCore.Http; 4 | using Microsoft.Net.Http.Headers; 5 | 6 | namespace Glimpse.AgentServer.AspNet.Sample 7 | { 8 | public class SamplePage 9 | { 10 | private readonly ContextData _context; 11 | 12 | public SamplePage() 13 | { 14 | _context = new ContextData(); 15 | } 16 | 17 | public async Task Invoke(HttpContext context) 18 | { 19 | var response = context.Response; 20 | 21 | response.Headers[HeaderNames.ContentType] = "text/html"; 22 | 23 | await response.WriteAsync($"

Agent Test

"); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /sample/Glimpse.AgentServer.AspNet.Sample/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sample/Glimpse.Server.AspNet.Sample/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace Glimpse.Server.AspNet.Sample 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | var host = new WebHostBuilder() 15 | .UseKestrel() 16 | .UseContentRoot(Directory.GetCurrentDirectory()) 17 | .UseIISIntegration() 18 | .UseStartup() 19 | .Build(); 20 | 21 | host.Run(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sample/Glimpse.Server.AspNet.Sample/Properties/debugSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Profiles": [] 3 | } -------------------------------------------------------------------------------- /sample/Glimpse.Server.AspNet.Sample/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sample/MusicStore/Areas/Admin/Views/StoreManager/RemoveAlbum.cshtml: -------------------------------------------------------------------------------- 1 | @model MusicStore.Models.Album 2 | 3 | @{ 4 | ViewBag.Title = "Delete"; 5 | } 6 | 7 | @if (Model != null) 8 | { 9 |

Delete Confirmation

10 | 11 |

12 | Are you sure you want to delete the album titled 13 | @Model.Title? 14 |

15 | 16 | @using (Html.BeginForm()) 17 | { 18 |

19 | 20 |

21 |

22 | @Html.ActionLink("Back to List", "Index") 23 |

24 | } 25 | } 26 | else 27 | { 28 | @Html.Label(null, "Unable to locate the album") 29 | } -------------------------------------------------------------------------------- /sample/MusicStore/Areas/Admin/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /sample/MusicStore/Components/CartSummaryComponent.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Mvc; 5 | using MusicStore.Models; 6 | 7 | namespace MusicStore.Components 8 | { 9 | [ViewComponent(Name = "CartSummary")] 10 | public class CartSummaryComponent : ViewComponent 11 | { 12 | public CartSummaryComponent(MusicStoreContext dbContext) 13 | { 14 | DbContext = dbContext; 15 | } 16 | 17 | private MusicStoreContext DbContext { get; } 18 | 19 | public async Task InvokeAsync() 20 | { 21 | var cart = ShoppingCart.GetCart(DbContext, HttpContext); 22 | 23 | var cartItems = await cart.GetCartAlbumTitles(); 24 | 25 | ViewBag.CartCount = cartItems.Count; 26 | ViewBag.CartSummary = string.Join("\n", cartItems.Distinct()); 27 | 28 | return View(); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /sample/MusicStore/Components/GenreMenuComponent.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.EntityFrameworkCore; 6 | using MusicStore.Models; 7 | 8 | namespace MusicStore.Components 9 | { 10 | [ViewComponent(Name = "GenreMenu")] 11 | public class GenreMenuComponent : ViewComponent 12 | { 13 | public GenreMenuComponent(MusicStoreContext dbContext) 14 | { 15 | DbContext = dbContext; 16 | } 17 | 18 | private MusicStoreContext DbContext { get; } 19 | 20 | public async Task InvokeAsync() 21 | { 22 | // TODO use nested sum https://github.com/aspnet/EntityFramework/issues/3792 23 | //.OrderByDescending( 24 | // g => g.Albums.Sum(a => a.OrderDetails.Sum(od => od.Quantity))) 25 | 26 | var genres = await DbContext.Genres.Select(g => g.Name).Take(9).ToListAsync(); 27 | 28 | return View(genres); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /sample/MusicStore/Components/ISystemClock.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MusicStore.Components 4 | { 5 | /// 6 | /// Abstracts the system clock to facilitate testing. 7 | /// 8 | public interface ISystemClock 9 | { 10 | /// 11 | /// Gets a DateTime object that is set to the current date and time on this computer, 12 | /// expressed as the Coordinated Universal Time(UTC) 13 | /// 14 | DateTime UtcNow { get; } 15 | } 16 | } -------------------------------------------------------------------------------- /sample/MusicStore/Components/SystemClock.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MusicStore.Components 4 | { 5 | /// 6 | /// Provides access to the normal system clock. 7 | /// 8 | public class SystemClock : ISystemClock 9 | { 10 | /// 11 | public DateTime UtcNow 12 | { 13 | get 14 | { 15 | // The clock measures whole seconds only, and truncates the milliseconds, 16 | // because millisecond resolution is inconsistent among various underlying systems. 17 | DateTime utcNow = DateTime.UtcNow; 18 | return utcNow.AddMilliseconds(-utcNow.Millisecond); 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /sample/MusicStore/MessageServices.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace MusicStore 4 | { 5 | public static class MessageServices 6 | { 7 | public static Task SendEmailAsync(string email, string subject, string message) 8 | { 9 | // Plug in your email service 10 | return Task.FromResult(0); 11 | } 12 | 13 | public static Task SendSmsAsync(string number, string message) 14 | { 15 | // Plug in your sms service 16 | return Task.FromResult(0); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /sample/MusicStore/Models/Artist.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace MusicStore.Models 4 | { 5 | public class Artist 6 | { 7 | public int ArtistId { get; set; } 8 | 9 | [Required] 10 | public string Name { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /sample/MusicStore/Models/CartItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace MusicStore.Models 5 | { 6 | public class CartItem 7 | { 8 | [Key] 9 | public int CartItemId { get; set; } 10 | 11 | [Required] 12 | public string CartId { get; set; } 13 | public int AlbumId { get; set; } 14 | public int Count { get; set; } 15 | 16 | [DataType(DataType.DateTime)] 17 | public DateTime DateCreated { get; set; } 18 | 19 | public virtual Album Album { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /sample/MusicStore/Models/Genre.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace MusicStore.Models 5 | { 6 | public class Genre 7 | { 8 | public int GenreId { get; set; } 9 | 10 | [Required] 11 | public string Name { get; set; } 12 | 13 | public string Description { get; set; } 14 | 15 | public List Albums { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /sample/MusicStore/Models/MusicStoreContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | namespace MusicStore.Models 5 | { 6 | public class ApplicationUser : IdentityUser { } 7 | 8 | public class MusicStoreContext : IdentityDbContext 9 | { 10 | public MusicStoreContext(DbContextOptions options) 11 | : base(options) 12 | { 13 | // TODO: #639 14 | //ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking; 15 | } 16 | 17 | public DbSet Albums { get; set; } 18 | public DbSet Artists { get; set; } 19 | public DbSet Orders { get; set; } 20 | public DbSet Genres { get; set; } 21 | public DbSet CartItems { get; set; } 22 | public DbSet OrderDetails { get; set; } 23 | } 24 | } -------------------------------------------------------------------------------- /sample/MusicStore/Models/OrderDetail.cs: -------------------------------------------------------------------------------- 1 | namespace MusicStore.Models 2 | { 3 | public class OrderDetail 4 | { 5 | public int OrderDetailId { get; set; } 6 | 7 | public int OrderId { get; set; } 8 | 9 | public int AlbumId { get; set; } 10 | 11 | public int Quantity { get; set; } 12 | 13 | public decimal UnitPrice { get; set; } 14 | 15 | public virtual Album Album { get; set; } 16 | 17 | public virtual Order Order { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /sample/MusicStore/MusicStoreConfig.cs: -------------------------------------------------------------------------------- 1 | namespace MusicStore 2 | { 3 | public class StoreConfig 4 | { 5 | public const string ConnectionStringKey = "Data__DefaultConnection__ConnectionString"; 6 | } 7 | } -------------------------------------------------------------------------------- /sample/MusicStore/Properties/AppSettings.cs: -------------------------------------------------------------------------------- 1 | namespace MusicStore 2 | { 3 | public class AppSettings 4 | { 5 | public string SiteTitle { get; set; } 6 | 7 | public bool CacheDbResults { get; set; } = true; 8 | } 9 | } -------------------------------------------------------------------------------- /sample/MusicStore/Scripts/_references.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// 7 | /// 8 | /// 9 | -------------------------------------------------------------------------------- /sample/MusicStore/ViewModels/AlbumData.cs: -------------------------------------------------------------------------------- 1 | namespace MusicStore.ViewModels 2 | { 3 | public class AlbumData 4 | { 5 | public string Title { get; set; } 6 | 7 | public string Url { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /sample/MusicStore/ViewModels/ShoppingCartRemoveViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace MusicStore.ViewModels 2 | { 3 | public class ShoppingCartRemoveViewModel 4 | { 5 | public string Message { get; set; } 6 | public decimal CartTotal { get; set; } 7 | public int CartCount { get; set; } 8 | public int ItemCount { get; set; } 9 | public int DeleteId { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /sample/MusicStore/ViewModels/ShoppingCartViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using MusicStore.Models; 3 | 4 | namespace MusicStore.ViewModels 5 | { 6 | public class ShoppingCartViewModel 7 | { 8 | public List CartItems { get; set; } 9 | public decimal CartTotal { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /sample/MusicStore/Views/Account/ConfirmEmail.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Confirm Email"; 3 | } 4 | 5 |

@ViewBag.Title.

6 |
7 |

8 | Thank you for confirming your email. Please Click here to Log in. 9 |

10 |
-------------------------------------------------------------------------------- /sample/MusicStore/Views/Account/ExternalLoginFailure.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Login Failure"; 3 | } 4 | 5 |
6 |

@ViewBag.Title.

7 |

Unsuccessful login with service.

8 |
-------------------------------------------------------------------------------- /sample/MusicStore/Views/Account/ForgotPassword.cshtml: -------------------------------------------------------------------------------- 1 | @model ForgotPasswordViewModel 2 | @{ 3 | ViewBag.Title = "Forgot your password?"; 4 | } 5 | 6 |

@ViewBag.Title.

7 | 8 |
9 |

Enter your email.

10 |
11 |
12 |
13 | 14 |
15 | 16 | 17 |
18 |
19 |
20 |
21 | 22 |
23 |
24 |
25 | 26 | @section Scripts { 27 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 28 | } 29 | -------------------------------------------------------------------------------- /sample/MusicStore/Views/Account/ForgotPasswordConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Forgot Password Confirmation"; 3 | } 4 | 5 |
6 |

@ViewBag.Title.

7 |
8 |
9 |

10 | Please check your email to reset your password. 11 |

12 |

13 | For demo purpose only: Click here to reset the password 14 |

15 |
-------------------------------------------------------------------------------- /sample/MusicStore/Views/Account/RegisterConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Register Confirmation"; 3 | } 4 | 5 |
6 |

@ViewBag.Title.

7 |
8 |
9 |

10 | Please check your email to activate your account. 11 |

12 |

13 | Demo/testing purposes only: The sample displays the code and user id in the page: Click here to confirm your email: 14 |

15 |
-------------------------------------------------------------------------------- /sample/MusicStore/Views/Account/ResetPasswordConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Reset password confirmation"; 3 | } 4 | 5 |
6 |

@ViewBag.Title.

7 |
8 |
9 |

10 | Your password has been reset. Please Click here to log in. 11 |

12 |
-------------------------------------------------------------------------------- /sample/MusicStore/Views/Account/SendCode.cshtml: -------------------------------------------------------------------------------- 1 | @model SendCodeViewModel 2 | @{ 3 | ViewBag.Title = "Send Verification Code"; 4 | } 5 | 6 |

@ViewBag.Title.

7 | 8 |
9 | 10 |
11 |
12 | Select Two-Factor Authentication Provider: 13 | 14 | 15 |
16 |
17 |
18 | 19 | @section Scripts { 20 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 21 | } 22 | -------------------------------------------------------------------------------- /sample/MusicStore/Views/Checkout/AddressAndPayment.cshtml: -------------------------------------------------------------------------------- 1 | @model Order 2 | 3 | @{ 4 | ViewBag.Title = "Address And Payment"; 5 | } 6 | 7 | @section Scripts { 8 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 9 | } 10 | 11 |
12 |

Address And Payment

13 |
14 |
15 |
16 | Shipping Information 17 | 18 | @Html.EditorForModel() 19 |
20 |
21 | Payment 22 |

We're running a promotion: all music is free with the promo code: "FREE"

23 | 24 |
25 | 26 |
27 |
28 | @Html.TextBox("PromoCode") 29 |
30 |
31 | 32 | 33 |
-------------------------------------------------------------------------------- /sample/MusicStore/Views/Checkout/Complete.cshtml: -------------------------------------------------------------------------------- 1 | @model int 2 | 3 | @{ 4 | ViewBag.Title = "Checkout Complete"; 5 | } 6 | 7 |

Checkout Complete

8 | 9 |

Thanks for your order! Your order number is: @Model

10 | 11 |

12 | How about shopping for some more music in our 13 | Store 14 |

-------------------------------------------------------------------------------- /sample/MusicStore/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @inject IOptions AppSettings 2 | @{ 3 | ViewBag.Title = "Home Page"; 4 | } 5 | 6 |
7 |

@AppSettings.Value.SiteTitle

8 | 9 |
10 | 11 | -------------------------------------------------------------------------------- /sample/MusicStore/Views/Manage/AddPhoneNumber.cshtml: -------------------------------------------------------------------------------- 1 | @model AddPhoneNumberViewModel 2 | @{ 3 | ViewBag.Title = "Add Phone Number"; 4 | } 5 | 6 |

@ViewBag.Title.

7 |
8 |

Add a phone number.

9 |
10 |
11 |
12 | 13 |
14 | 15 | 16 |
17 |
18 |
19 |
20 | 21 |
22 |
23 |
24 | 25 | @section Scripts { 26 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial"); } 27 | } -------------------------------------------------------------------------------- /sample/MusicStore/Views/Shared/AccessDenied.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Access denied due to insufficient permissions"; 3 | } 4 | 5 |

Access denied due to insufficient permissions.

-------------------------------------------------------------------------------- /sample/MusicStore/Views/Shared/Components/Announcement/Default.cshtml: -------------------------------------------------------------------------------- 1 | @model Album 2 | 3 | @if (Model != null) 4 | { 5 |
  • 6 |
    7 | 8 | @Model.Title 9 |
  • 10 | } -------------------------------------------------------------------------------- /sample/MusicStore/Views/Shared/Components/CartSummary/Default.cshtml: -------------------------------------------------------------------------------- 1 | @if (ViewBag.CartCount > 0) 2 | { 3 |
  • 4 | 5 | 6 | 7 | @ViewBag.CartCount 8 | 9 | 10 |
  • 11 | } -------------------------------------------------------------------------------- /sample/MusicStore/Views/Shared/Components/GenreMenu/Default.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | -------------------------------------------------------------------------------- /sample/MusicStore/Views/Shared/DemoLinkDisplay.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Demo link display page - Not for production use"; 3 | } 4 | 5 |
    6 |

    @ViewBag.Title.

    7 |
    8 |
    9 |

    10 | Demo link display page - Not for production use. 11 |

    12 | 13 | @if (ViewBag.Link != null) 14 | { 15 |

    16 | For DEMO only: You can click this link to confirm the email: [[link]] 17 |
    18 | Please change this code to register an email service in IdentityConfig to send an email. 19 |

    20 | } 21 |
    -------------------------------------------------------------------------------- /sample/MusicStore/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Error"; 3 | } 4 | 5 |

    Error.

    6 |

    An error occurred while processing your request.

    -------------------------------------------------------------------------------- /sample/MusicStore/Views/Shared/Lockout.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Locked Out"; 3 | } 4 | 5 |
    6 |

    Locked out.

    7 |

    This account has been locked out, please try again later.

    8 |
    -------------------------------------------------------------------------------- /sample/MusicStore/Views/Shared/StatusCodePage.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Item not found"; 3 | } 4 | 5 |

    Item not found.

    6 |

    Unable to find the item you are searching for. Please try again.

    -------------------------------------------------------------------------------- /sample/MusicStore/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 10 | 14 | -------------------------------------------------------------------------------- /sample/MusicStore/Views/Store/Browse.cshtml: -------------------------------------------------------------------------------- 1 | @model Genre 2 | @{ 3 | ViewBag.Title = "Browse Albums"; 4 | } 5 |
    6 |

    7 | @Model.Name Albums 8 |

    9 | 10 | 24 |
    -------------------------------------------------------------------------------- /sample/MusicStore/Views/Store/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model Album 2 | 3 | @{ 4 | ViewBag.Title = "Album - " + Model.Title; 5 | } 6 | 7 |

    @Model.Title

    8 | 9 |

    10 | @Model.Title 11 |

    12 | 13 |
    14 |

    15 | Genre: 16 | @Model.Genre.Name 17 |

    18 |

    19 | Artist: 20 | @Model.Artist.Name 21 |

    22 |

    23 | Price: 24 | 25 |

    26 |

    27 | Add to cart 28 |

    29 |
    -------------------------------------------------------------------------------- /sample/MusicStore/Views/Store/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | @{ 3 | ViewBag.Title = "Store"; 4 | } 5 |

    Browse Genres

    6 | 7 |

    8 | Select from @Model.Count() genres: 9 |

    10 |
      11 | @foreach (var genre in Model) 12 | { 13 |
    • @genre.Name
    • 14 | } 15 |
    -------------------------------------------------------------------------------- /sample/MusicStore/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using MusicStore 2 | @using MusicStore.Models 3 | @using Microsoft.Extensions.Options 4 | @using Microsoft.AspNetCore.Identity 5 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 6 | -------------------------------------------------------------------------------- /sample/MusicStore/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /sample/MusicStore/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "AppSettings": { 3 | "SiteTitle": "ASP.NET MVC Music Store", 4 | "CacheDbResults": true 5 | }, 6 | "DefaultAdminUsername": "Administrator@test.com", 7 | "DefaultAdminPassword": "YouShouldChangeThisPassword1!", 8 | "Data": { 9 | "DefaultConnection": { 10 | // Use a shared (and running) LocalDB database when executing in IIS e.g. 11 | // "Server=(localdb)\\.\\IIS_DB;Database=MusicStore;Trusted_Connection=False;MultipleActiveResultSets=true;User ID=iis_login;Password=********" 12 | "ConnectionString": "Server=(localdb)\\MSSQLLocalDB;Database=MusicStore;Trusted_Connection=True;MultipleActiveResultSets=true;Connect Timeout=30;" 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /sample/MusicStore/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sample/MusicStore/wwwroot/Images/home-showcase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/MusicStore/wwwroot/Images/home-showcase.png -------------------------------------------------------------------------------- /sample/MusicStore/wwwroot/Images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/MusicStore/wwwroot/Images/logo.png -------------------------------------------------------------------------------- /sample/MusicStore/wwwroot/Images/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/MusicStore/wwwroot/Images/placeholder.png -------------------------------------------------------------------------------- /sample/MusicStore/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/MusicStore/wwwroot/favicon.ico -------------------------------------------------------------------------------- /sample/MusicStore/wwwroot/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/MusicStore/wwwroot/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /sample/MusicStore/wwwroot/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/MusicStore/wwwroot/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /sample/MusicStore/wwwroot/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/MusicStore/wwwroot/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet.Mvc/Razor/RazorServices.cs: -------------------------------------------------------------------------------- 1 | using Glimpse.Agent.Razor; 2 | using Glimpse.Common.Initialization; 3 | using Microsoft.AspNetCore.Mvc.Razor; 4 | using Microsoft.Extensions.DependencyInjection; 5 | 6 | namespace Glimpse.Agent.AspNet.Mvc.Razor 7 | { 8 | public class RazorServices : IRegisterServices 9 | { 10 | public void RegisterServices(GlimpseServiceCollectionBuilder services) 11 | { 12 | services.AddTransient(); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/AgentMiddleware.cs: -------------------------------------------------------------------------------- 1 | using Glimpse.Common.Initialization; 2 | using Glimpse.Initialization; 3 | using Microsoft.AspNetCore.Builder; 4 | using Microsoft.Extensions.DependencyInjection; 5 | 6 | namespace Glimpse.Agent 7 | { 8 | public class AgentMiddleware : IRegisterMiddleware 9 | { 10 | public void RegisterMiddleware(IApplicationBuilder appBuilder) 11 | { 12 | var manager = appBuilder.ApplicationServices.GetRequiredService(); 13 | manager.Run(new StartupOptions(appBuilder)); 14 | 15 | appBuilder.UseMiddleware(appBuilder); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Configuration/DefaultRequestIgnorerContentTypeProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using Microsoft.Extensions.Options; 4 | 5 | namespace Glimpse.Agent.Configuration 6 | { 7 | public class DefaultRequestIgnorerContentTypeProvider : IRequestIgnorerContentTypeProvider 8 | { 9 | public DefaultRequestIgnorerContentTypeProvider(IOptions optionsAccessor) 10 | { 11 | var contentTypes = optionsAccessor.Value.IgnoredContentTypes; 12 | ContentTypes = contentTypes.ToList(); 13 | } 14 | 15 | public IReadOnlyList ContentTypes { get; } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Configuration/DefaultRequestIgnorerStatusCodeProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using Microsoft.Extensions.Options; 4 | 5 | namespace Glimpse.Agent.Configuration 6 | { 7 | public class DefaultRequestIgnorerStatusCodeProvider : IRequestIgnorerStatusCodeProvider 8 | { 9 | public DefaultRequestIgnorerStatusCodeProvider(IOptions optionsAccessor) 10 | { 11 | var statusCodes = optionsAccessor.Value.IgnoredStatusCodes; 12 | StatusCodes = statusCodes.ToList(); 13 | } 14 | 15 | public IReadOnlyList StatusCodes { get; } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Configuration/DefaultRequestIgnorerUriProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Text.RegularExpressions; 4 | using Microsoft.Extensions.Options; 5 | 6 | namespace Glimpse.Agent.Configuration 7 | { 8 | public class DefaultRequestIgnorerUriProvider : IRequestIgnorerUriProvider 9 | { 10 | public DefaultRequestIgnorerUriProvider(IOptions optionsAccessor) 11 | { 12 | var ignoredUris = optionsAccessor.Value.IgnoredUris; 13 | IgnoredUris = ignoredUris.ToList(); 14 | } 15 | 16 | public IReadOnlyList IgnoredUris { get; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Configuration/IRequestIgnorer.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | 3 | namespace Glimpse.Agent.Configuration 4 | { 5 | public interface IRequestIgnorer 6 | { 7 | bool ShouldIgnore(HttpContext context); 8 | } 9 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Configuration/IRequestIgnorerContentTypeProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Glimpse.Agent.Configuration 4 | { 5 | public interface IRequestIgnorerContentTypeProvider 6 | { 7 | IReadOnlyList ContentTypes { get; } 8 | } 9 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Configuration/IRequestIgnorerManager.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | 3 | namespace Glimpse.Agent.Configuration 4 | { 5 | public interface IRequestIgnorerManager 6 | { 7 | bool ShouldIgnore(); 8 | 9 | bool ShouldIgnore(HttpContext context); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Configuration/IRequestIgnorerStatusCodeProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Glimpse.Agent.Configuration 4 | { 5 | public interface IRequestIgnorerStatusCodeProvider 6 | { 7 | IReadOnlyList StatusCodes { get; } 8 | } 9 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Configuration/IRequestIgnorerUriProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Text.RegularExpressions; 3 | 4 | namespace Glimpse.Agent.Configuration 5 | { 6 | public interface IRequestIgnorerUriProvider 7 | { 8 | IReadOnlyList IgnoredUris { get; } 9 | } 10 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Configuration/RegexExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel; 3 | using System.Text.RegularExpressions; 4 | 5 | namespace Glimpse.Agent.Configuration 6 | { 7 | [EditorBrowsable(EditorBrowsableState.Never)] 8 | public static class RegexExtensions 9 | { 10 | public static void AddCompiled(this ICollection collection, string expression) 11 | { 12 | var regex = new Regex(expression, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.None); 13 | collection.Add(regex); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Configuration/RequestIgnorerContentType.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using Microsoft.AspNetCore.Http; 4 | 5 | namespace Glimpse.Agent.Configuration 6 | { 7 | public class RequestIgnorerContentType : IRequestIgnorer 8 | { 9 | private readonly IReadOnlyCollection _contextType; 10 | 11 | public RequestIgnorerContentType(IRequestIgnorerContentTypeProvider requestIgnorerContentTypeProvider) 12 | { 13 | _contextType = requestIgnorerContentTypeProvider.ContentTypes; 14 | } 15 | 16 | public bool ShouldIgnore(HttpContext context) 17 | { 18 | return _contextType.Contains(context.Response.ContentType); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Configuration/RequestIgnorerOptionsShouldIgnore.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.Extensions.Options; 4 | 5 | namespace Glimpse.Agent.Configuration 6 | { 7 | public class RequestIgnorerOptionsShouldIgnore : IRequestIgnorer 8 | { 9 | private readonly Func _shouldIgnore; 10 | 11 | public RequestIgnorerOptionsShouldIgnore(IOptions optionsAccessor) 12 | { 13 | _shouldIgnore = optionsAccessor.Value.ShouldIgnore; 14 | } 15 | 16 | public bool ShouldIgnore(HttpContext context) 17 | { 18 | return _shouldIgnore != null ? _shouldIgnore(context) : false; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Configuration/RequestIgnorerStatusCode.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using Microsoft.AspNetCore.Http; 4 | 5 | namespace Glimpse.Agent.Configuration 6 | { 7 | public class RequestIgnorerStatusCode : IRequestIgnorer 8 | { 9 | private readonly IReadOnlyCollection _statusCodes; 10 | 11 | public RequestIgnorerStatusCode(IRequestIgnorerStatusCodeProvider requestIgnorerStatusCodeProvider) 12 | { 13 | _statusCodes = requestIgnorerStatusCodeProvider.StatusCodes; 14 | } 15 | 16 | public bool ShouldIgnore(HttpContext context) 17 | { 18 | return _statusCodes.Contains(context.Response.StatusCode); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/GlimpseAgentOptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text.RegularExpressions; 4 | using Microsoft.AspNetCore.Http; 5 | 6 | namespace Glimpse.Agent 7 | { 8 | public class GlimpseAgentOptions 9 | { 10 | public GlimpseAgentOptions() 11 | { 12 | IgnoredUris = new List(); 13 | IgnoredStatusCodes = new List(); 14 | IgnoredContentTypes = new List(); 15 | } 16 | 17 | public IList IgnoredUris { get; } 18 | 19 | public IList IgnoredStatusCodes { get; } 20 | 21 | public IList IgnoredContentTypes { get; } 22 | 23 | public Func ShouldIgnore { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/GlimpseAgentOptionsSetup.cs: -------------------------------------------------------------------------------- 1 | using Glimpse.Agent.Configuration; 2 | using Microsoft.Extensions.Options; 3 | 4 | namespace Glimpse.Agent 5 | { 6 | public class GlimpseAgentOptionsSetup : ConfigureOptions 7 | { 8 | public GlimpseAgentOptionsSetup() : base(ConfigureGlimpseAgentWebOptions) 9 | { 10 | } 11 | 12 | public static void ConfigureGlimpseAgentWebOptions(GlimpseAgentOptions options) 13 | { 14 | // Set up IgnoredUris 15 | options.IgnoredUris.AddCompiled("^/__browserLink/requestData"); 16 | options.IgnoredUris.AddCompiled("^/Glimpse"); // TODO: Need to make sure this honor overridden basePath's 17 | options.IgnoredUris.AddCompiled("^/favicon.ico"); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/GlimpseAgentServiceCollectionBuilder.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | 3 | namespace Glimpse 4 | { 5 | public class GlimpseAgentServiceCollectionBuilder : GlimpseServiceCollectionBuilder 6 | { 7 | public GlimpseAgentServiceCollectionBuilder(IServiceCollection innerCollection) 8 | : base(innerCollection) 9 | { 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/GlimpseAgentServiceCollectionExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using Microsoft.Extensions.DependencyInjection.Extensions; 3 | using System; 4 | using Glimpse.Agent; 5 | 6 | namespace Glimpse 7 | { 8 | public static class GlimpseAgentServiceCollectionExtensions 9 | { 10 | public static GlimpseAgentServiceCollectionBuilder RunningAgentWeb(this GlimpseServiceCollectionBuilder services) 11 | { 12 | return services.RunningAgentWeb(null); 13 | } 14 | 15 | public static GlimpseAgentServiceCollectionBuilder RunningAgentWeb(this GlimpseServiceCollectionBuilder services, Action setupAction) 16 | { 17 | if (setupAction != null) 18 | { 19 | services.Configure(setupAction); 20 | } 21 | 22 | return new GlimpseAgentServiceCollectionBuilder(services); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Initialization/DefaultAgentStartupManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using Glimpse.Initialization; 4 | 5 | namespace Glimpse.Initialization 6 | { 7 | public class DefaultAgentStartupManager : IAgentStartupManager 8 | { 9 | public DefaultAgentStartupManager(IExtensionProvider startupProvider) 10 | { 11 | Startups = startupProvider.Instances; 12 | } 13 | 14 | private IEnumerable Startups { get; } 15 | 16 | public void Run(IStartupOptions options) 17 | { 18 | if (Startups.Any()) 19 | { 20 | foreach (var startup in Startups) 21 | { 22 | startup.Run(options); 23 | } 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Initialization/IAgentStartup.cs: -------------------------------------------------------------------------------- 1 | using Glimpse.Initialization; 2 | 3 | namespace Glimpse.Initialization 4 | { 5 | public interface IAgentStartup 6 | { 7 | void Run(IStartupOptions options); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Initialization/IAgentStartupManager.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Initialization 2 | { 3 | public interface IAgentStartupManager 4 | { 5 | void Run(IStartupOptions options); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Inspectors/Execute.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Agent.Inspectors 2 | { 3 | public enum Execute 4 | { 5 | BeforeResponse, 6 | AfterResponse 7 | } 8 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Inspectors/IInspector.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | 3 | namespace Glimpse.Agent.Inspectors 4 | { 5 | public interface IInspector 6 | { 7 | void Before(HttpContext context); 8 | 9 | void After(HttpContext context); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Inspectors/IInspectorFunction.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Agent.Inspectors 2 | { 3 | public interface IInspectorFunction 4 | { 5 | void Configure(IInspectorFunctionBuilder inspectorBuilder); 6 | } 7 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Inspectors/IInspectorFunctionBuilder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using Microsoft.AspNetCore.Builder; 4 | using Microsoft.AspNetCore.Http; 5 | 6 | namespace Glimpse.Agent.Inspectors 7 | { 8 | public interface IInspectorFunctionBuilder 9 | { 10 | IApplicationBuilder AppBuilder { get; } 11 | 12 | IInspectorFunctionBuilder Use(Func, Task> middleware); 13 | } 14 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Inspectors/IInspectorFunctionManager.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | using Microsoft.AspNetCore.Http; 3 | 4 | namespace Glimpse.Agent.Inspectors 5 | { 6 | public interface IInspectorFunctionManager 7 | { 8 | RequestDelegate BuildInspectorBranch(RequestDelegate next, IApplicationBuilder app); 9 | } 10 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Inspectors/Inspector.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | 3 | namespace Glimpse.Agent.Inspectors 4 | { 5 | public class Inspector : IInspector 6 | { 7 | public virtual void Before(HttpContext context) 8 | { 9 | } 10 | 11 | public virtual void After(HttpContext context) 12 | { 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Inspectors/InspectorFunctionBuilder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using Microsoft.AspNetCore.Builder; 4 | using Microsoft.AspNetCore.Http; 5 | 6 | namespace Glimpse.Agent.Inspectors 7 | { 8 | public class InspectorFunctionBuilder : IInspectorFunctionBuilder 9 | { 10 | public InspectorFunctionBuilder(IApplicationBuilder app) 11 | { 12 | AppBuilder = app; 13 | } 14 | 15 | public IApplicationBuilder AppBuilder { get; } 16 | 17 | public IInspectorFunctionBuilder Use(Func, Task> middleware) 18 | { 19 | var newAppBuilder = AppBuilder.Use(middleware); 20 | return (newAppBuilder != AppBuilder) ? new InspectorFunctionBuilder(newAppBuilder) : this; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Inspectors/InspectorsInspectorFunction.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Glimpse.Initialization; 3 | 4 | namespace Glimpse.Agent.Inspectors 5 | { 6 | public class InspectorsInspectorFunction : IInspectorFunction 7 | { 8 | private readonly IEnumerable _inspectors; 9 | 10 | public InspectorsInspectorFunction(IExtensionProvider inspectorProvider) 11 | { 12 | _inspectors = inspectorProvider.Instances; 13 | } 14 | 15 | public void Configure(IInspectorFunctionBuilder builder) 16 | { 17 | builder.Use(async (context, next) => 18 | { 19 | foreach (var inspector in _inspectors) 20 | { 21 | inspector.Before(context); 22 | } 23 | 24 | await next(); 25 | 26 | foreach (var inspector in _inspectors) 27 | { 28 | inspector.After(context); 29 | } 30 | }); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Internal/Inspectors/AspNet/AjaxInspector.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Glimpse.Agent.Inspectors; 6 | using Glimpse.Common; 7 | using Microsoft.AspNetCore.Http; 8 | using Microsoft.Extensions.Primitives; 9 | 10 | namespace Glimpse.Agent.AspNet.Internal.Inspectors.AspNet 11 | { 12 | public class AjaxInspector : Inspector 13 | { 14 | private readonly IGlimpseContextAccessor _context; 15 | 16 | public AjaxInspector(IGlimpseContextAccessor context) 17 | { 18 | _context = context; 19 | } 20 | 21 | public override void Before(HttpContext context) 22 | { 23 | var isAjax = StringValues.Empty; 24 | if (context.Request.Headers.TryGetValue("__glimpse-isAjax", out isAjax) && isAjax == "true") 25 | { 26 | context.Response.Headers.Add("__glimpse-id", _context.RequestId.ToString("N")); 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Internal/Inspectors/AspNet/IExceptionProcessor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Glimpse.Agent.Messages; 4 | 5 | namespace Glimpse.Agent.Internal.Inspectors 6 | { 7 | public interface IExceptionProcessor 8 | { 9 | IEnumerable GetErrorDetails(Exception ex); 10 | } 11 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Internal/Inspectors/EF/Proxies/IDbCommand.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Agent.Internal.Inspectors.EF.Proxies 2 | { 3 | public interface IDbCommand 4 | { 5 | string CommandText { get; } 6 | 7 | object CommandType { get; } 8 | 9 | object Parameters { get; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IActionContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | 3 | namespace Glimpse.Agent.Internal.Inspectors.Mvc.Proxies 4 | { 5 | public interface IActionContext 6 | { 7 | object ActionDescriptor { get; } 8 | HttpContext HttpContext { get; } 9 | IRouteData RouteData { get; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IActionDescriptor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | 4 | namespace Glimpse.Agent.Internal.Inspectors.Mvc.Proxies 5 | { 6 | public interface IActionDescriptor 7 | { 8 | string Id { get; } 9 | string DisplayName { get; } 10 | string ActionName { get; } 11 | string ControllerName { get; } 12 | Type ControllerTypeInfo { get; } 13 | MethodInfo MethodInfo { get; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IActionResult.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace Glimpse.Agent.Internal.Inspectors.Mvc.Proxies 3 | { 4 | public interface IActionResult 5 | { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IRouteData.cs: -------------------------------------------------------------------------------- 1 |  2 | using System.Collections.Generic; 3 | 4 | namespace Glimpse.Agent.Internal.Inspectors.Mvc.Proxies 5 | { 6 | public interface IRouteData 7 | { 8 | IReadOnlyList Routers { get; } 9 | IDictionary DataTokens { get; } 10 | IDictionary Values { get; } 11 | } 12 | 13 | public interface IRouter 14 | { 15 | string Name { get; } 16 | string RouteTemplate { get; } 17 | IReadOnlyDictionary Values { get; } 18 | IRouterParsedTemplate ParsedTemplate { get; } 19 | } 20 | 21 | public interface IRouterParsedTemplate 22 | { 23 | IReadOnlyList Parameters { get; } 24 | } 25 | 26 | public interface IRouterTemplatePart 27 | { 28 | string Name { get; } 29 | object DefaultValue { get; } 30 | bool IsOptional { get; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IView.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace Glimpse.Agent.Internal.Inspectors.Mvc.Proxies 3 | { 4 | public interface IView 5 | { 6 | string Path { get; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IViewComponentContext.cs: -------------------------------------------------------------------------------- 1 |  2 | using System.Collections.Generic; 3 | 4 | namespace Glimpse.Agent.Internal.Inspectors.Mvc.Proxies 5 | { 6 | public interface IViewComponentContext 7 | { 8 | IViewComponentDescriptor ViewComponentDescriptor { get; } 9 | 10 | IDictionary Arguments { get; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IViewComponentDescriptor.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Agent.Internal.Inspectors.Mvc.Proxies 2 | { 3 | public interface IViewComponentDescriptor 4 | { 5 | string Id { get; } 6 | string FullName { get; } 7 | string ShortName { get; } 8 | } 9 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IViewContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Http; 6 | 7 | namespace Glimpse.Agent.Internal.Inspectors.Mvc.Proxies 8 | { 9 | public interface IViewContext 10 | { 11 | object ActionDescriptor { get; } 12 | HttpContext HttpContext { get; } 13 | IRouteData RouteData { get; } 14 | IDictionary TempData { get; } 15 | IDictionary ViewData { get; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Internal/Messaging/IMessageConverter.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Agent.Internal.Messaging 2 | { 3 | public interface IMessageConverter 4 | { 5 | IMessage ConvertMessage(object payload, MessageContext context, int ordinal); 6 | } 7 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Internal/Messaging/IMessageIndexProcessor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Glimpse.Agent.Internal.Messaging 4 | { 5 | public interface IMessageIndexProcessor 6 | { 7 | IReadOnlyDictionary Derive(object payload); 8 | } 9 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Internal/Messaging/IMessagePayloadFormatter.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Agent.Internal.Messaging 2 | { 3 | // TODO: Review as I don't love passing IMessage into this, but 4 | // not sure if there is a better way of doing it. 5 | public interface IMessagePayloadFormatter 6 | { 7 | string Serialize(IMessage message, object payload); 8 | 9 | string SerializeCore(object payload); 10 | } 11 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Internal/Messaging/IMessageTypeProcessor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Glimpse.Agent.Internal.Messaging 4 | { 5 | public interface IMessageTypeProcessor 6 | { 7 | IEnumerable Derive(object payload); 8 | } 9 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Internal/Tabs/ConnectionTab.cs: -------------------------------------------------------------------------------- 1 | //using Glimpse.Agent.Inspectors; 2 | //using Microsoft.AspNet.Http; 3 | 4 | //namespace Glimpse.Agent.AspNet.Internal.Tabs 5 | //{ 6 | // // TODO: Delete me. This tab isn't intended to stick around, it's just a sample of a Tab. 7 | // public class ConnectionTab : Tab 8 | // { 9 | // public override string Name => "Connection"; 10 | 11 | // public override object GetData(HttpContext context) 12 | // { 13 | // var connection = context.Connection; 14 | // return new 15 | // { 16 | // ClientCertificate = connection.ClientCertificate?.ToString(), 17 | // connection.IsLocal, 18 | // LocalIpAddress = connection.LocalIpAddress.ToString(), 19 | // connection.LocalPort, 20 | // RemoteIpAddress = connection.RemoteIpAddress.ToString(), 21 | // connection.RemotePort 22 | // }; 23 | // } 24 | 25 | // public override Execute ExecuteWhen => Execute.BeforeResponse; 26 | // } 27 | //} 28 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Internal/Tabs/HeadersTab.cs: -------------------------------------------------------------------------------- 1 | //using Glimpse.Agent.Inspectors; 2 | //using Microsoft.AspNet.Http; 3 | 4 | //namespace Glimpse.Agent.AspNet.Internal.Tabs 5 | //{ 6 | // // TODO: Delete me. This tab isn't intended to stick around, it's just a sample of a Tab. 7 | // public class HeadersTab : Tab 8 | // { 9 | // public override string Name => "Headers"; 10 | 11 | // public override object GetData(HttpContext context) 12 | // { 13 | // return new 14 | // { 15 | // Request = context.Request.Headers, 16 | // Response = context.Response.Headers 17 | // }; 18 | // } 19 | // } 20 | //} 21 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/ActionViewDidFoundMessage.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Agent.Messages 2 | { 3 | public class ActionViewDidFoundMessage : ActionViewFoundMessage 4 | { 5 | public string ViewPath { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/ActionViewFoundMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Glimpse.Agent.Messages 5 | { 6 | public class ActionViewFoundMessage 7 | { 8 | public string ActionId { get; set; } 9 | 10 | public string ActionName { get; set; } 11 | 12 | public string ActionControllerName { get; set; } 13 | 14 | public string ViewName { get; set; } 15 | 16 | public DateTime ViewSearchedTime { get; set; } 17 | 18 | public bool ViewDidFind { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/ActionViewNotFoundMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Glimpse.Agent.Messages 5 | { 6 | public class ActionViewNotFoundMessage : ActionViewFoundMessage 7 | { 8 | public IEnumerable ViewSearchedLocations { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/AfterActionInvokedMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Glimpse.Agent.Messages 4 | { 5 | public class AfterActionInvokedMessage 6 | { 7 | public string ActionId { get; set; } 8 | 9 | public string ActionName { get; set; } 10 | 11 | public string ActionControllerName { get; set; } 12 | 13 | public DateTime ActionInvokedEndTime { get; set; } 14 | 15 | public TimeSpan ActionInvokedDuration { get; set; } 16 | 17 | public TimeSpan? ActionInvokedOffset { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/AfterActionMessage.cs: -------------------------------------------------------------------------------- 1 |  2 | using System; 3 | using Glimpse.Internal; 4 | 5 | namespace Glimpse.Agent.Messages 6 | { 7 | public class AfterActionMessage 8 | { 9 | public string ActionId { get; set; } 10 | 11 | public string ActionName { get; set; } 12 | 13 | public string ActionControllerName { get; set; } 14 | 15 | public DateTime ActionEndTime { get; set; } 16 | 17 | public TimeSpan ActionDuration { get; set; } 18 | 19 | public TimeSpan? ActionOffset { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/AfterActionResultMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Glimpse.Internal; 3 | 4 | namespace Glimpse.Agent.Messages 5 | { 6 | public class AfterActionResultMessage 7 | { 8 | public string ActionId { get; set; } 9 | 10 | public string ActionName { get; set; } 11 | 12 | public string ActionControllerName { get; set; } 13 | 14 | public DateTime ActionResultEndTime { get; set; } 15 | 16 | public TimeSpan ActionResultDuration { get; set; } 17 | 18 | public TimeSpan? ActionResultOffset { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/AfterActionViewInvokedMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Glimpse.Agent.Messages 4 | { 5 | public class AfterActionViewInvokedMessage 6 | { 7 | public string ActionId { get; set; } 8 | 9 | public string ActionName { get; set; } 10 | 11 | public string ActionControllerName { get; set; } 12 | 13 | public DateTime? ViewEndTime { get; set; } 14 | 15 | public TimeSpan ViewDuration { get; set; } 16 | 17 | public TimeSpan? ViewOffset { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/AfterExecuteCommandMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Glimpse.Agent.Messages 4 | { 5 | public class AfterExecuteCommandMessage 6 | { 7 | public bool CommandHadException { get; set; } 8 | 9 | public DateTime CommandEndTime { get; set; } 10 | 11 | public TimeSpan CommandDuration { get; set; } 12 | 13 | public TimeSpan? CommandOffset { get; set; } 14 | } 15 | 16 | public class AfterExecuteCommandExceptionMessage : AfterExecuteCommandMessage 17 | { 18 | // TODO: Need to decide what I want to pull out here 19 | //public bool CommandHadException { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/AfterViewComponentMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Glimpse.Agent.Messages 4 | { 5 | public class AfterViewComponentMessage 6 | { 7 | public string ComponentId { get; set; } 8 | public string ComponentDisplayName { get; set; } 9 | public string ComponentName { get; set; } 10 | public DateTime ComponentEndTime { get; set; } 11 | public TimeSpan ComponentDuration { get; set; } 12 | public TimeSpan? ComponentOffset { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/ArgumentData.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Agent.Messages 2 | { 3 | public class ArgumentData 4 | { 5 | public string Type { get; set; } 6 | public string TypeFullName { get; set; } 7 | public string Name { get; set; } 8 | public object Value { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/BeforeActionInvokedMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Glimpse.Agent.Messages 5 | { 6 | public class BeforeActionInvokedMessage : IActionContentMessage 7 | { 8 | public string ActionId { get; set; } 9 | 10 | public string ActionDisplayName { get; set; } 11 | 12 | public string ActionName { get; set; } 13 | 14 | public string ActionControllerName { get; set; } 15 | 16 | public string ActionTargetClass { get; set; } 17 | 18 | public string ActionTargetMethod { get; set; } 19 | 20 | public DateTime ActionInvokedStartTime { get; set; } 21 | 22 | public IReadOnlyList Binding { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/BeforeActionMessage.cs: -------------------------------------------------------------------------------- 1 |  2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace Glimpse.Agent.Messages 6 | { 7 | public class BeforeActionMessage : IActionRouteMessage 8 | { 9 | public string ActionId { get; set; } 10 | 11 | public string ActionDisplayName { get; set; } 12 | 13 | public string ActionName { get; set; } 14 | 15 | public string ActionControllerName { get; set; } 16 | 17 | public string RouteName { get; set; } 18 | 19 | public string RoutePattern { get; set; } 20 | 21 | public IReadOnlyDictionary RouteData { get; set; } 22 | 23 | public IReadOnlyDictionary RouteConfiguration { get; set; } 24 | 25 | public DateTime ActionStartTime { get; set; } 26 | } 27 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/BeforeActionViewInvokedMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Glimpse.Agent.Messages 4 | { 5 | public class BeforeActionViewInvokedMessage 6 | { 7 | public string ActionId { get; set; } 8 | 9 | public string ActionName { get; set; } 10 | 11 | public string ActionControllerName { get; set; } 12 | 13 | public string ViewPath { get; set; } 14 | 15 | public ViewResultData ViewData { get; set; } 16 | 17 | public DateTime? ViewStartTime { get; set; } 18 | 19 | } 20 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/BeforeExecuteCommandMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Glimpse.Agent.Messages 4 | { 5 | public class BeforeExecuteCommandMessage 6 | { 7 | public string CommandText { get; set; } 8 | 9 | public object CommandType { get; set; } 10 | 11 | public object CommandParameters { get; set; } 12 | 13 | public string CommandMethod { get; set; } 14 | 15 | public bool CommandIsAsync { get; set; } 16 | 17 | public DateTime CommandStartTime { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/BeforeViewComponentMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Glimpse.Agent.Messages 5 | { 6 | public class BeforeViewComponentMessage 7 | { 8 | public string ComponentId { get; set; } 9 | public string ComponentDisplayName { get; set; } 10 | public string ComponentName { get; set; } 11 | public DateTime ComponentStartTime { get; set; } 12 | public IReadOnlyList Arguments { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/BeginRequestMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Microsoft.Extensions.Primitives; 4 | 5 | namespace Glimpse.Agent.Messages 6 | { 7 | public class BeginRequestMessage 8 | { 9 | [PromoteToUrl] 10 | public string RequestUrl { get; set; } 11 | 12 | public string RequestPath { get; set; } 13 | 14 | public string RequestQueryString { get; set; } 15 | 16 | [PromoteToMethod] 17 | public string RequestMethod { get; set; } 18 | 19 | public IReadOnlyDictionary RequestHeaders { get; set; } 20 | 21 | public long? RequestContentLength { get; set; } 22 | 23 | public string RequestContentType { get; set; } 24 | 25 | [PromoteToDateTime] 26 | public DateTime RequestStartTime { get; set; } 27 | 28 | public bool RequestIsAjax { get; set; } 29 | } 30 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/BindingData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Glimpse.Agent.Messages 4 | { 5 | public class BindingData 6 | { 7 | public string Type { get; set; } 8 | public string TypeFullName { get; set; } 9 | public string Name { get; set; } 10 | public object Value { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/DiagnosticsExceptionMessage.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Glimpse.Agent.Messages 4 | { 5 | public class DiagnosticsExceptionMessage : IExceptionMessage 6 | { 7 | public bool ExceptionIsHandelled { get; set; } 8 | 9 | public string ExceptionTypeName { get; set; } 10 | 11 | public string ExceptionMessage { get; set; } 12 | 13 | public IEnumerable ExceptionDetails { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/EndRequestMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Microsoft.Extensions.Primitives; 4 | 5 | namespace Glimpse.Agent.Messages 6 | { 7 | public class EndRequestMessage 8 | { 9 | [PromoteToUrl] 10 | public string RequestUrl { get; set; } 11 | 12 | public string RequestPath { get; set; } 13 | 14 | public string RequestQueryString { get; set; } 15 | 16 | public long? ResponseContentLength { get; set; } 17 | 18 | [PromoteToContentType] 19 | public string ResponseContentType { get; set; } 20 | 21 | [PromoteToStatusCode] 22 | public int ResponseStatusCode { get; set; } 23 | 24 | public IReadOnlyDictionary ResponseHeaders { get; set; } 25 | 26 | [PromoteToDuration] 27 | public double? ResponseDuration { get; set; } 28 | 29 | public DateTime ResponseEndTime { get; set; } 30 | } 31 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/EnvironmentMessage.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | 3 | namespace Glimpse.Agent.AspNet.Messages 4 | { 5 | public class EnvironmentMessage 6 | { 7 | public string ServerName { get; set; } 8 | 9 | public string ServerTime { get; set; } 10 | 11 | public string ServerTimezoneOffset { get; set; } 12 | 13 | public bool ServerDaylightSavingTime { get; set; } 14 | 15 | public string FrameworkDescription { get; set; } 16 | 17 | public string ProcessArchitecture { get; set; } 18 | 19 | public string OSDescription { get; set; } 20 | 21 | public string OSArchitecture { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/ExceptionDetails.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Glimpse.Agent.Messages 5 | { 6 | public class ExceptionDetails 7 | { 8 | public Type Type { get; set; } 9 | 10 | public string TypeName { get; set; } 11 | 12 | public string Message { get; set; } 13 | 14 | public string RawException { get; set; } 15 | 16 | /// 17 | /// The generated stack frames 18 | /// 19 | public IEnumerable StackFrames { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/HostingExceptionMessage.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Glimpse.Agent.Messages 4 | { 5 | public class HostingExceptionMessage : EndRequestMessage, IExceptionMessage 6 | { 7 | public bool ExceptionIsHandelled { get; set; } 8 | 9 | public string ExceptionTypeName { get; set; } 10 | 11 | public string ExceptionMessage { get; set; } 12 | 13 | public IEnumerable ExceptionDetails { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/IActionContentMessage.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Glimpse.Agent.Messages 4 | { 5 | public interface IActionContentMessage 6 | { 7 | IReadOnlyList Binding { get; } 8 | } 9 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/IActionRouteMessage.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Glimpse.Agent.Messages 4 | { 5 | public interface IActionRouteMessage 6 | { 7 | string ActionId { get; set; } 8 | 9 | string RouteName { get; set; } 10 | 11 | string RoutePattern { get; set; } 12 | 13 | IReadOnlyDictionary RouteData { get; set; } 14 | 15 | IReadOnlyDictionary RouteConfiguration { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/IExceptionMessage.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Glimpse.Agent.Messages 4 | { 5 | public interface IExceptionMessage 6 | { 7 | bool ExceptionIsHandelled { get; set; } 8 | 9 | string ExceptionTypeName { get; set; } 10 | 11 | string ExceptionMessage { get; set; } 12 | 13 | IEnumerable ExceptionDetails { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/RouteData.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Agent.Messages 2 | { 3 | public class RouteConfigurationData 4 | { 5 | public string Default { get; set; } 6 | 7 | public bool Optional { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/TabMessage.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using Glimpse.Common.Messaging; 4 | 5 | namespace Glimpse.Agent.AspNet.Messages 6 | { 7 | public class TabMessage : IMessageTypeProvider 8 | { 9 | public TabMessage(string name, object data) 10 | { 11 | Name = name; 12 | Data = data; 13 | } 14 | 15 | public string Name { get; } 16 | 17 | public object Data { get; } 18 | 19 | public IEnumerable Types => string.IsNullOrWhiteSpace(Name) ? Enumerable.Empty() : new[] { Name }; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/UserIdentificationMessage.cs: -------------------------------------------------------------------------------- 1 | using Glimpse.Agent.Internal.Messaging; 2 | using Glimpse.Internal; 3 | 4 | namespace Glimpse.Agent.Messages 5 | { 6 | public class UserIdentificationMessage 7 | { 8 | public UserIdentificationMessage(string userId, string username, string email, string image, bool isAnonymous) 9 | { 10 | UserId = userId; 11 | Username = username; 12 | Email = email; 13 | Image = image; 14 | IsAnonymous = isAnonymous; 15 | } 16 | 17 | [PromoteToUserId] 18 | public string UserId { get; } 19 | 20 | public string Username { get; } 21 | 22 | public string Email { get; } 23 | 24 | public string Image { get; } 25 | 26 | public bool IsAnonymous { get; } 27 | } 28 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messages/ViewResultData.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Glimpse.Agent.Messages 4 | { 5 | public class ViewResultData 6 | { 7 | // TODO: need make sure that these are serializable 8 | public IDictionary TempData { get; set; } 9 | 10 | // TODO: need make sure that these are serializable 11 | public IDictionary ViewData { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messaging/PromoteToContentTypeAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Agent 2 | { 3 | public class PromoteToContentTypeAttribute : PromoteToAttribute 4 | { 5 | public PromoteToContentTypeAttribute() : base("request-content-type") 6 | { 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messaging/PromoteToDateTimeAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Agent 2 | { 3 | public class PromoteToDateTimeAttribute : PromoteToAttribute 4 | { 5 | public PromoteToDateTimeAttribute() : base("request-datetime") 6 | { 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messaging/PromoteToDurationAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Agent 2 | { 3 | public class PromoteToDurationAttribute : PromoteToAttribute 4 | { 5 | public PromoteToDurationAttribute() : base("request-duration") 6 | { 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messaging/PromoteToMethodAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Agent 2 | { 3 | public class PromoteToMethodAttribute : PromoteToAttribute 4 | { 5 | public PromoteToMethodAttribute() : base("request-method") 6 | { 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messaging/PromoteToStatusCodeAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Agent 2 | { 3 | public class PromoteToStatusCodeAttribute : PromoteToAttribute 4 | { 5 | public PromoteToStatusCodeAttribute() : base("request-status-code") 6 | { 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messaging/PromoteToUrlAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Agent 2 | { 3 | public class PromoteToUrlAttribute : PromoteToAttribute 4 | { 5 | public PromoteToUrlAttribute() : base("request-url") 6 | { 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Glimpse.Agent.AspNet/Messaging/PromoteToUserIdAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Agent 2 | { 3 | public class PromoteToUserIdAttribute : PromoteToAttribute 4 | { 5 | public PromoteToUserIdAttribute() : base("request-userId") 6 | { 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Glimpse.Common/ApplicationBuilderExtensions.cs: -------------------------------------------------------------------------------- 1 | using Glimpse.Common.Initialization; 2 | using Glimpse.Initialization; 3 | using Microsoft.AspNetCore.Builder; 4 | using Microsoft.Extensions.DependencyInjection; 5 | 6 | namespace Glimpse 7 | { 8 | public static class ApplicationBuilderExtensions 9 | { 10 | public static IApplicationBuilder UseGlimpse(this IApplicationBuilder appBuilder) 11 | { 12 | var middlewareRegistrations = appBuilder.ApplicationServices.GetService>(); 13 | 14 | foreach (var instance in middlewareRegistrations.Instances) 15 | { 16 | instance.RegisterMiddleware(appBuilder); 17 | } 18 | 19 | return appBuilder; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Glimpse.Common/DefaultGlimpseContextAccessor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Glimpse.Internal; 3 | 4 | namespace Glimpse.Common 5 | { 6 | public class DefaultGlimpseContextAccessor : IGlimpseContextAccessor 7 | { 8 | private readonly IContextData _context; 9 | public DefaultGlimpseContextAccessor(IContextData context) 10 | { 11 | _context = context; 12 | } 13 | 14 | public Guid RequestId => _context.Value.Id; 15 | } 16 | } -------------------------------------------------------------------------------- /src/Glimpse.Common/GlimpseOptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Glimpse 4 | { 5 | public class GlimpseOptions 6 | { 7 | 8 | } 9 | } -------------------------------------------------------------------------------- /src/Glimpse.Common/GlimpseServiceCollectionBuilder.cs: -------------------------------------------------------------------------------- 1 | using Glimpse.Internal; 2 | using Microsoft.Extensions.DependencyInjection; 3 | 4 | namespace Glimpse 5 | { 6 | public class GlimpseServiceCollectionBuilder : ServiceCollectionWrapper 7 | { 8 | public GlimpseServiceCollectionBuilder(IServiceCollection innerCollection) 9 | : base(innerCollection) 10 | { 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Glimpse.Common/GlimpseServiceCollectionExtensions.cs: -------------------------------------------------------------------------------- 1 | using Glimpse.Common.Initialization; 2 | using Glimpse.Initialization; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using Microsoft.Extensions.DependencyInjection.Extensions; 5 | 6 | namespace Glimpse 7 | { 8 | public static class GlimpseServiceCollectionExtensions 9 | { 10 | public static GlimpseServiceCollectionBuilder AddGlimpse(this IServiceCollection services) 11 | { 12 | services.TryAdd(GlimpseServices.GetDefaultServices()); 13 | 14 | var extensionProvider = services.BuildServiceProvider().GetService>(); 15 | 16 | var glimpseServiceCollectionBuilder = new GlimpseServiceCollectionBuilder(services); 17 | 18 | foreach (var registration in extensionProvider.Instances) 19 | { 20 | registration.RegisterServices(glimpseServiceCollectionBuilder); 21 | } 22 | 23 | return glimpseServiceCollectionBuilder; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /src/Glimpse.Common/IGlimpseContextAccessor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Glimpse.Common 4 | { 5 | public interface IGlimpseContextAccessor 6 | { 7 | Guid RequestId { get; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Glimpse.Common/Initialization/DefaultExtensionProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using Glimpse.Internal; 4 | 5 | namespace Glimpse.Initialization 6 | { 7 | public class DefaultExtensionProvider : IExtensionProvider 8 | where T : class 9 | { 10 | private readonly ITypeService _typeService; 11 | 12 | public DefaultExtensionProvider(ITypeService typeService) 13 | { 14 | _typeService = typeService; 15 | } 16 | 17 | public IEnumerable Instances 18 | { 19 | get { return _typeService.Resolve().ToArray(); } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Glimpse.Common/Initialization/FixedExtensionProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | 4 | namespace Glimpse.Initialization 5 | { 6 | public class FixedExtensionProvider : IExtensionProvider 7 | where T : class 8 | { 9 | public FixedExtensionProvider() 10 | : this(Enumerable.Empty()) 11 | { 12 | } 13 | 14 | public FixedExtensionProvider(IEnumerable extensionTypes) 15 | { 16 | Instances = new List(extensionTypes); 17 | } 18 | 19 | public IList Instances { get; } 20 | 21 | IEnumerable IExtensionProvider.Instances => Instances; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Glimpse.Common/Initialization/IExtensionProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Glimpse.Initialization 4 | { 5 | public interface IExtensionProvider 6 | where T : class 7 | { 8 | IEnumerable Instances { get; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Glimpse.Common/Initialization/IRegisterMiddleware.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | 3 | namespace Glimpse.Common.Initialization 4 | { 5 | public interface IRegisterMiddleware 6 | { 7 | void RegisterMiddleware(IApplicationBuilder appBuilder); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Glimpse.Common/Initialization/IRegisterServices.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Common.Initialization 2 | { 3 | public interface IRegisterServices 4 | { 5 | void RegisterServices(GlimpseServiceCollectionBuilder services); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Glimpse.Common/Initialization/IResourceOptionsProvider.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Initialization 2 | { 3 | public interface IResourceOptionsProvider 4 | { 5 | ResourceOptions BuildInstance(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Glimpse.Common/Initialization/IStartupOptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Glimpse.Initialization 4 | { 5 | public interface IStartupOptions 6 | { 7 | IServiceProvider ApplicationServices { get; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Glimpse.Common/Initialization/OptionsResourceOptionsProvider.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Options; 2 | 3 | namespace Glimpse.Initialization 4 | { 5 | public class OptionsResourceOptionsProvider : IResourceOptionsProvider 6 | { 7 | private readonly ResourceOptions _resourceOptions; 8 | 9 | public OptionsResourceOptionsProvider(IOptions optionsAccessor) 10 | { 11 | _resourceOptions = optionsAccessor.Value; 12 | } 13 | 14 | public ResourceOptions BuildInstance() 15 | { 16 | return _resourceOptions; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Glimpse.Common/Initialization/ResourceOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Initialization 2 | { 3 | public class ResourceOptions 4 | { 5 | public string BrowserAgentScriptTemplate { get; set; } 6 | 7 | public string HudScriptTemplate { get; set; } 8 | 9 | public string MessageIngressTemplate { get; set; } 10 | 11 | public string ContextTemplate { get; set; } 12 | 13 | public string MetadataTemplate { get; set; } 14 | 15 | public string ClientScriptTemplate { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Glimpse.Common/Initialization/StartupOptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.AspNetCore.Builder; 3 | 4 | namespace Glimpse.Initialization 5 | { 6 | public class StartupOptions : IStartupOptions 7 | { 8 | public StartupOptions(IApplicationBuilder builder) 9 | { 10 | Builder = builder; 11 | } 12 | 13 | private IApplicationBuilder Builder { get; } 14 | 15 | public IServiceProvider ApplicationServices => Builder.ApplicationServices; 16 | } 17 | } -------------------------------------------------------------------------------- /src/Glimpse.Common/Internal/ContextData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | #if NET451 3 | using System.Runtime.Remoting.Messaging; 4 | using System.Runtime.Remoting; 5 | #else 6 | using System.Threading; 7 | #endif 8 | 9 | namespace Glimpse.Internal 10 | { 11 | public class ContextData : IContextData 12 | { 13 | #if NET451 14 | private static string Key = typeof(ContextData).FullName; 15 | 16 | public T Value 17 | { 18 | get 19 | { 20 | var handle = CallContext.LogicalGetData(Key) as ObjectHandle; 21 | return handle != null ? (T)handle.Unwrap() : default(T); 22 | } 23 | set 24 | { 25 | CallContext.LogicalSetData(Key, new ObjectHandle(value)); 26 | } 27 | } 28 | #else 29 | private readonly AsyncLocal _storage = new AsyncLocal(); 30 | 31 | public T Value 32 | { 33 | get { return _storage.Value; } 34 | set { _storage.Value = value; } 35 | } 36 | #endif 37 | } 38 | } -------------------------------------------------------------------------------- /src/Glimpse.Common/Internal/Extensions/PathStringExtension.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using Microsoft.AspNetCore.Http; 3 | 4 | namespace Glimpse.Internal.Extensions 5 | { 6 | [EditorBrowsable(EditorBrowsableState.Never)] 7 | public static class PathStringExtension 8 | { 9 | public static string StartingSegment(this PathString path, out PathString remaining) 10 | { 11 | var startingSegment = ""; 12 | 13 | var spath = path.ToString(); 14 | for (var i = 1; i < spath.Length; i++) 15 | { 16 | if (spath[i] == '/') 17 | { 18 | remaining = spath.Substring(i, spath.Length - i); 19 | return startingSegment; 20 | } 21 | 22 | startingSegment += spath[i]; 23 | } 24 | 25 | remaining = PathString.Empty; 26 | return startingSegment; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Glimpse.Common/Internal/Extensions/ReflectionExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Reflection; 5 | 6 | namespace Glimpse.Internal.Extensions 7 | { 8 | [EditorBrowsable(EditorBrowsableState.Never)] 9 | public static class ReflectionExtensions 10 | { 11 | public static IEnumerable BaseTypes(this TypeInfo typeInfo, bool includeSelf = false) 12 | { 13 | if (includeSelf) 14 | yield return typeInfo.AsType(); 15 | 16 | var baseType = typeInfo.BaseType; 17 | 18 | while (baseType != null) 19 | { 20 | yield return baseType; 21 | 22 | baseType = baseType.GetTypeInfo().BaseType; 23 | } 24 | } 25 | 26 | public static string KebabCase(this Type type) 27 | { 28 | var result = type.Name.KebabCase(); 29 | 30 | if (type.GetTypeInfo().IsInterface && result[0] == 'i') 31 | return result.Substring(1); // Handle IFooBar -> foo-bar case 32 | 33 | return result; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Glimpse.Common/Internal/Extensions/TypeExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Reflection; 5 | 6 | namespace Glimpse.Internal.Extensions 7 | { 8 | [EditorBrowsable(EditorBrowsableState.Never)] 9 | public static class TypeExtension 10 | { 11 | public static IEnumerable GetInheritancHierarchy(this Type target) 12 | { 13 | for (var next = target; next != null; next = next.GetTypeInfo().BaseType) 14 | { 15 | yield return next; 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Glimpse.Common/Internal/IContextData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Glimpse.Internal 4 | { 5 | public interface IContextData 6 | { 7 | T Value { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /src/Glimpse.Common/Internal/Messaging/Operation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | 4 | namespace Glimpse.Internal 5 | { 6 | public class Operation 7 | { 8 | public Operation(object item, DateTime start, TimeSpan? offset) 9 | { 10 | Item = item; 11 | Start = start; 12 | Offset = offset; 13 | Timer = Stopwatch.StartNew(); 14 | } 15 | 16 | public object Item { get; set; } 17 | 18 | public DateTime Start { get; } 19 | 20 | public TimeSpan? Offset { get; set; } 21 | 22 | public Stopwatch Timer { get; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Glimpse.Common/Internal/Messaging/OperationOffset.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace Glimpse.Common.Internal.Messaging 8 | { 9 | public class OperationOffset 10 | { 11 | private Stopwatch _timer; 12 | 13 | public OperationOffset() 14 | : this(DateTime.UtcNow) 15 | { 16 | } 17 | 18 | public OperationOffset(DateTime startTime) 19 | { 20 | StartTime = startTime; 21 | _timer = new Stopwatch(); 22 | _timer.Start(); 23 | } 24 | 25 | public TimeSpan Elapsed => _timer.Elapsed; 26 | 27 | public DateTime StartTime { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Glimpse.Common/Internal/Messaging/OperationTiming.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Threading; 4 | 5 | namespace Glimpse.Internal 6 | { 7 | public class OperationTiming 8 | { 9 | public OperationTiming(Operation operation) 10 | : this((T)operation.Item, operation.Start, DateTime.UtcNow, operation.Timer, operation.Offset) 11 | { 12 | } 13 | 14 | public OperationTiming(T item, DateTime start, DateTime end, Stopwatch timer, TimeSpan? offset) 15 | { 16 | timer.Stop(); 17 | 18 | Item = item; 19 | Offset = offset; 20 | Start = start; 21 | End = end; 22 | Elapsed = timer.Elapsed; 23 | 24 | timer.Stop(); 25 | } 26 | 27 | public T Item { get; } 28 | 29 | public TimeSpan? Offset { get; } 30 | 31 | public DateTime Start { get; } 32 | 33 | public DateTime End { get; } 34 | 35 | public TimeSpan Elapsed { get; } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Glimpse.Common/Internal/Messaging/Timing.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Glimpse.Internal 4 | { 5 | public struct Timing 6 | { 7 | public Timing(DateTime start, DateTime end, TimeSpan elapsed) 8 | { 9 | Start = start; 10 | End = end; 11 | Elapsed = elapsed; 12 | } 13 | 14 | public DateTime Start { get; set; } 15 | 16 | public DateTime End { get; set; } 17 | 18 | public TimeSpan Elapsed { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Glimpse.Common/Internal/Reflection/DefaultTypeSelector.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | 6 | namespace Glimpse.Internal 7 | { 8 | public class DefaultTypeSelector : ITypeSelector 9 | { 10 | public IEnumerable FindTypes(IEnumerable targetAssmblies, TypeInfo targetTypeInfo) 11 | { 12 | var types = targetAssmblies 13 | .SelectMany(a => a.DefinedTypes) 14 | .Where(t => t.IsClass && 15 | !t.IsAbstract && 16 | !t.ContainsGenericParameters && 17 | targetTypeInfo.IsAssignableFrom(t)); 18 | 19 | return types; 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /src/Glimpse.Common/Internal/Reflection/IAssemblyProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Reflection; 4 | 5 | namespace Glimpse.Internal 6 | { 7 | public interface IAssemblyProvider 8 | { 9 | IEnumerable GetCandidateAssemblies(string coreLibrary); 10 | } 11 | } -------------------------------------------------------------------------------- /src/Glimpse.Common/Internal/Reflection/ITypeActivator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Reflection; 4 | 5 | namespace Glimpse.Internal 6 | { 7 | public interface ITypeActivator 8 | { 9 | object CreateInstance(Type instanceType, params object[] parameters); 10 | 11 | T CreateInstance(params object[] parameters); 12 | 13 | IEnumerable CreateInstances(IEnumerable types); 14 | 15 | IEnumerable CreateInstances(IEnumerable types); 16 | } 17 | } -------------------------------------------------------------------------------- /src/Glimpse.Common/Internal/Reflection/ITypeSelector.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Reflection; 4 | 5 | namespace Glimpse.Internal 6 | { 7 | public interface ITypeSelector 8 | { 9 | IEnumerable FindTypes(IEnumerable targetAssmblies, TypeInfo targetTypeInfo); 10 | } 11 | } -------------------------------------------------------------------------------- /src/Glimpse.Common/Internal/Reflection/ITypeService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Reflection; 4 | 5 | namespace Glimpse.Internal 6 | { 7 | public interface ITypeService 8 | { 9 | IEnumerable Resolve(Type targetType); 10 | 11 | IEnumerable Resolve(); 12 | 13 | IEnumerable Resolve(string coreLibrary, Type targetType); 14 | 15 | IEnumerable Resolve(string coreLibrary); 16 | 17 | IEnumerable Resolve(IEnumerable assemblies, Type targetType); 18 | 19 | IEnumerable Resolve(IEnumerable assemblies); 20 | 21 | IEnumerable ResolveTypes(Type targetType); 22 | 23 | IEnumerable ResolveTypes(); 24 | 25 | IEnumerable ResolveTypes(string coreLibrary, Type targetType); 26 | 27 | IEnumerable ResolveTypes(string coreLibrary); 28 | 29 | IEnumerable ResolveTypes(IEnumerable assemblies, Type targetType); 30 | 31 | IEnumerable ResolveTypes(IEnumerable assemblies); 32 | } 33 | } -------------------------------------------------------------------------------- /src/Glimpse.Common/Internal/Serialization/DefaultJsonSerializerProvider.cs: -------------------------------------------------------------------------------- 1 | using Glimpse.Internal.Extensions; 2 | using Newtonsoft.Json; 3 | 4 | namespace Glimpse.Common.Internal.Serialization 5 | { 6 | public class DefaultJsonSerializerProvider : IJsonSerializerProvider 7 | { 8 | private readonly JsonSerializer _jsonSerializer; 9 | public DefaultJsonSerializerProvider(JsonSerializer jsonSerializer) 10 | { 11 | jsonSerializer.Configure(); 12 | _jsonSerializer = jsonSerializer; 13 | } 14 | 15 | public JsonSerializer GetJsonSerializer() => _jsonSerializer; 16 | } 17 | } -------------------------------------------------------------------------------- /src/Glimpse.Common/Internal/Serialization/GuidConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace Glimpse.Common.Internal.Serialization 5 | { 6 | public class GuidConverter : JsonConverter 7 | { 8 | private const string _guidFormat = "N"; 9 | 10 | public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) 11 | { 12 | var guid = value as Guid?; 13 | 14 | if (guid.HasValue) 15 | writer.WriteValue(guid.Value.ToString(_guidFormat)); 16 | else 17 | writer.WriteNull(); 18 | } 19 | 20 | public override bool CanWrite => true; 21 | 22 | public override bool CanRead => false; 23 | 24 | public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) 25 | { 26 | throw new NotImplementedException("This method is not required."); 27 | } 28 | 29 | public override bool CanConvert(Type objectType) 30 | { 31 | return objectType == typeof(Guid) || objectType == typeof(Guid?); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /src/Glimpse.Common/Internal/Serialization/IJsonSerializerProvider.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Glimpse.Common.Internal.Serialization 4 | { 5 | public interface IJsonSerializerProvider 6 | { 7 | JsonSerializer GetJsonSerializer(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Glimpse.Common/Internal/Serialization/StringValuesConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.Extensions.Primitives; 6 | using Newtonsoft.Json; 7 | 8 | namespace Glimpse.Internal 9 | { 10 | public class StringValuesConverter : JsonConverter 11 | { 12 | public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) 13 | { 14 | writer.WriteValue(value?.ToString()); 15 | } 16 | 17 | public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) 18 | { 19 | return reader.Value; 20 | } 21 | 22 | public override bool CanConvert(Type objectType) 23 | { 24 | return objectType == typeof(StringValues); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Glimpse.Common/Internal/Serialization/TimeSpanConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using Newtonsoft.Json; 4 | 5 | namespace Glimpse.Internal 6 | { 7 | public class TimeSpanConverter : JsonConverter 8 | { 9 | public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) 10 | { 11 | var result = 0.0; 12 | 13 | var convertedNullable = value as TimeSpan?; 14 | if (convertedNullable.HasValue) 15 | { 16 | result = Math.Round(convertedNullable.Value.TotalMilliseconds, 2); 17 | } 18 | 19 | writer.WriteRawValue(result.ToString(CultureInfo.InvariantCulture)); 20 | } 21 | 22 | public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) 23 | { 24 | return reader.Value; 25 | } 26 | 27 | public override bool CanConvert(Type objectType) 28 | { 29 | return objectType == typeof(TimeSpan) || objectType == typeof(TimeSpan?); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Glimpse.Common/Messaging/AgentBrokerObservations.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reactive.Linq; 3 | using System.Reflection; 4 | 5 | namespace Glimpse.Agent 6 | { 7 | public class AgentBrokerObservations 8 | { 9 | private readonly IObservable _observable; 10 | 11 | public AgentBrokerObservations(IObservable observable) 12 | { 13 | _observable = observable; 14 | } 15 | 16 | public IObservable Listen() 17 | { 18 | return _observable.Where(opts => typeof(T).GetTypeInfo().IsAssignableFrom(opts.Payload.GetType().GetTypeInfo())); 19 | } 20 | 21 | public IObservable ListenAll() 22 | { 23 | return _observable; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /src/Glimpse.Common/Messaging/AgentBrokerPayload.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Agent 2 | { 3 | public class AgentBrokerPayload 4 | { 5 | public AgentBrokerPayload(object payload, MessageContext context, int ordinal) 6 | { 7 | Payload = payload; 8 | Context = context; 9 | Ordinal = ordinal; 10 | } 11 | 12 | public object Payload { get; set; } 13 | 14 | public MessageContext Context { get; set; } 15 | 16 | public int Ordinal { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Glimpse.Common/Messaging/IAgentBroker.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Agent 2 | { 3 | public interface IAgentBroker 4 | { 5 | /// 6 | /// On the sender thread and is blocking 7 | /// 8 | AgentBrokerObservations OnSenderThread { get; } 9 | 10 | /// 11 | /// Off the sender thread and is not blocking 12 | /// 13 | AgentBrokerObservations OffSenderThread { get; } 14 | 15 | void SendMessage(object message); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Glimpse.Common/Messaging/IMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Glimpse 5 | { 6 | public interface IMessage 7 | { 8 | Guid Id { get; } 9 | 10 | IEnumerable Types { get; } 11 | 12 | string Payload { get; } 13 | 14 | int Ordinal { get; } 15 | 16 | MessageContext Context { get; } 17 | 18 | IReadOnlyDictionary Indices { get; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Glimpse.Common/Messaging/IMessagePublisher.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse 2 | { 3 | public interface IMessagePublisher 4 | { 5 | void PublishMessage(IMessage message); 6 | } 7 | } -------------------------------------------------------------------------------- /src/Glimpse.Common/Messaging/IMessageTypeProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Glimpse.Common.Messaging 4 | { 5 | public interface IMessageTypeProvider 6 | { 7 | IEnumerable Types { get; } 8 | } 9 | } -------------------------------------------------------------------------------- /src/Glimpse.Common/Messaging/Message.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Linq; 5 | using Glimpse.Internal; 6 | using Newtonsoft.Json; 7 | 8 | namespace Glimpse 9 | { 10 | public class Message : IMessage 11 | { 12 | // Default indices to avoid unecissary allocations 13 | private static readonly IReadOnlyDictionary _defaultIndices = new ReadOnlyDictionary(new Dictionary()); 14 | private IReadOnlyDictionary _indices = _defaultIndices; 15 | 16 | public Guid Id { get; set; } 17 | 18 | public IEnumerable Types { get; set; } = Enumerable.Empty(); 19 | 20 | public string Payload { get; set; } 21 | 22 | public int Ordinal { get; set; } = 0; 23 | 24 | public MessageContext Context { get; set; } 25 | 26 | public IReadOnlyDictionary Indices 27 | { 28 | get { return _indices; } 29 | set { _indices = value; } 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Glimpse.Common/Messaging/MessageContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Glimpse 4 | { 5 | public class MessageContext 6 | { 7 | public Guid Id { get; set; } 8 | 9 | public string Type { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /src/Glimpse.Common/Messaging/PromoteToAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Glimpse 4 | { 5 | [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] 6 | public class PromoteToAttribute : Attribute 7 | { 8 | public PromoteToAttribute(string key) 9 | { 10 | Key = key; 11 | } 12 | 13 | public string Key { get; private set; } 14 | } 15 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Configuration/AllowAgentAccessOptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Glimpse.Server; 3 | using Microsoft.AspNetCore.Http; 4 | using Microsoft.Extensions.Options; 5 | 6 | namespace Glimpse.Server.Configuration 7 | { 8 | public class AllowAgentAccessOptions : IAllowAgentAccess 9 | { 10 | private readonly Func _allowAgentAccess; 11 | 12 | public AllowAgentAccessOptions(IOptions optionsAccessor) 13 | { 14 | _allowAgentAccess = optionsAccessor.Value.AllowAgentAccess; 15 | } 16 | 17 | public bool AllowAgent(HttpContext context) 18 | { 19 | return _allowAgentAccess != null ? _allowAgentAccess(context) : true; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Glimpse.Server/Configuration/AllowClientAccessOptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Glimpse.Server; 3 | using Microsoft.AspNetCore.Http; 4 | using Microsoft.Extensions.Options; 5 | 6 | namespace Glimpse.Server.Configuration 7 | { 8 | public class AllowClientAccessOptions : IAllowClientAccess 9 | { 10 | private readonly Func _allowAccess; 11 | 12 | public AllowClientAccessOptions(IOptions optionsAccessor) 13 | { 14 | _allowAccess = optionsAccessor.Value.AllowClientAccess; 15 | } 16 | 17 | public bool AllowUser(HttpContext context) 18 | { 19 | return _allowAccess != null ? _allowAccess(context) : true; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Glimpse.Server/Configuration/AllowClientAccessRemote.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Http.Features; 3 | 4 | namespace Glimpse.Server.Configuration 5 | { 6 | public class AllowClientAccessRemote : IAllowClientAccess 7 | { 8 | private readonly IAllowRemoteProvider _allowRemoteProvider; 9 | 10 | public AllowClientAccessRemote(IAllowRemoteProvider allowRemoteProvider) 11 | { 12 | _allowRemoteProvider = allowRemoteProvider; 13 | } 14 | 15 | public bool AllowUser(HttpContext context) 16 | { 17 | // TODO: need to fix this logic up since IsLocal isn't available and wouldn't work 18 | 19 | var connectionFeature = context.Features.Get(); 20 | return _allowRemoteProvider.AllowRemote; // || (connectionFeature != null && connectionFeature.IsLocal); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Configuration/DefaultAllowRemoteProvider.cs: -------------------------------------------------------------------------------- 1 | using Glimpse.Server; 2 | using Microsoft.Extensions.Options; 3 | 4 | namespace Glimpse.Server.Configuration 5 | { 6 | public class DefaultAllowRemoteProvider : IAllowRemoteProvider 7 | { 8 | public DefaultAllowRemoteProvider(IOptions optionsAccessor) 9 | { 10 | AllowRemote = optionsAccessor.Value.AllowRemote; 11 | } 12 | 13 | public bool AllowRemote { get; } 14 | } 15 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Configuration/IAllowAgentAccess.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | 3 | namespace Glimpse.Server.Configuration 4 | { 5 | public interface IAllowAgentAccess 6 | { 7 | bool AllowAgent(HttpContext context); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Glimpse.Server/Configuration/IAllowClientAccess.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | 3 | namespace Glimpse.Server.Configuration 4 | { 5 | public interface IAllowClientAccess 6 | { 7 | bool AllowUser(HttpContext context); 8 | } 9 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Configuration/IAllowRemoteProvider.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Server.Configuration 2 | { 3 | public interface IAllowRemoteProvider 4 | { 5 | bool AllowRemote { get; } 6 | } 7 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Configuration/IMetadataProvider.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Server.Configuration 2 | { 3 | public interface IMetadataProvider 4 | { 5 | Metadata BuildInstance(); 6 | } 7 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Configuration/Metadata.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Collections.ObjectModel; 3 | using System.Linq; 4 | using Glimpse.Internal.Extensions; 5 | 6 | namespace Glimpse.Server.Configuration 7 | { 8 | public class Metadata 9 | { 10 | public Metadata(IDictionary resources) 11 | { 12 | Resources = new ReadOnlyDictionary(resources); 13 | } 14 | 15 | public IReadOnlyDictionary Resources { get; set; } 16 | 17 | public string Hash 18 | { 19 | get { return string.Join("&", Resources.Select(r => $"{r.Key}={r.Value}")).Crc32().ToLower(); } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/GlimpseServerOptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Microsoft.AspNetCore.Http; 4 | 5 | namespace Glimpse.Server 6 | { 7 | public class GlimpseServerOptions 8 | { 9 | public bool AllowRemote { get; set; } 10 | 11 | public string BasePath { get; set; } 12 | 13 | public Action> OverrideResources { get; set; } 14 | 15 | public Func AllowClientAccess { get; set; } 16 | 17 | public Func AllowAgentAccess { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/GlimpseServerOptionsSetup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Options; 2 | 3 | namespace Glimpse.Server 4 | { 5 | public class GlimpseServerOptionsSetup : ConfigureOptions 6 | { 7 | public GlimpseServerOptionsSetup() : base(ConfigureGlimpseServerWebOptions) 8 | { 9 | } 10 | 11 | public static void ConfigureGlimpseServerWebOptions(GlimpseServerOptions options) 12 | { 13 | options.AllowRemote = true; // Temp workaround for kestrel not implementing IHttpConnectionFeature 14 | options.BasePath = "glimpse"; 15 | options.OverrideResources = _ => { }; 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/GlimpseServerServiceCollectionBuilder.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | 3 | namespace Glimpse 4 | { 5 | public class GlimpseServerServiceCollectionBuilder : GlimpseServiceCollectionBuilder 6 | { 7 | public GlimpseServerServiceCollectionBuilder(IServiceCollection innerCollection) 8 | : base(innerCollection) 9 | { 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/GlimpseServerServiceCollectionExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Glimpse.Server; 3 | using Microsoft.Extensions.DependencyInjection; 4 | 5 | namespace Glimpse 6 | { 7 | public static class GlimpseServerServiceCollectionExtensions 8 | { 9 | public static GlimpseServerServiceCollectionBuilder RunningServerWeb(this GlimpseServiceCollectionBuilder services) 10 | { 11 | return services.RunningServerWeb(null); 12 | } 13 | 14 | public static GlimpseServerServiceCollectionBuilder RunningServerWeb(this GlimpseServiceCollectionBuilder services, Action setupAction) 15 | { 16 | if (setupAction != null) 17 | { 18 | services.Configure(setupAction); 19 | } 20 | 21 | return new GlimpseServerServiceCollectionBuilder(services); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Internal/Extensions/JsonStringExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Glimpse.Server.Internal.Extensions 7 | { 8 | [EditorBrowsable(EditorBrowsableState.Never)] 9 | public static class JsonStringExtensions 10 | { 11 | public static string ToJsonArray(this IEnumerable jsonStringCollection) 12 | { 13 | var array = jsonStringCollection.ToArray(); 14 | var sb = new StringBuilder("["); 15 | sb.Append(string.Join(",", array)); 16 | sb.Append("]"); 17 | return sb.ToString(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Glimpse.Server/Internal/Extensions/UriTemplateExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using Tavis.UriTemplates; 5 | 6 | namespace Glimpse.Server.Internal.Extensions 7 | { 8 | [EditorBrowsable(EditorBrowsableState.Never)] 9 | public static class UriTemplateExtensions 10 | { 11 | public static string ResolveWith(this UriTemplate uriTemplate, IDictionary parameters) 12 | { 13 | uriTemplate.AddParameters(parameters); 14 | return uriTemplate.Resolve(); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Internal/IResourceManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | using Glimpse.Server.Resources; 5 | using Microsoft.AspNetCore.Http; 6 | 7 | namespace Glimpse.Server.Internal 8 | { 9 | public interface IResourceManager 10 | { 11 | void Register(string name, string uriTemplate); 12 | 13 | void Register(string name, string uriTemplate, ResourceType type, Func, Task> resource); 14 | 15 | ResourceManagerResult Match(HttpContext context); 16 | 17 | IReadOnlyDictionary RegisteredUris { get; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Internal/ResourceManagerResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | using Glimpse.Server.Resources; 5 | using Microsoft.AspNetCore.Http; 6 | 7 | namespace Glimpse.Server.Internal 8 | { 9 | public class ResourceManagerResult 10 | { 11 | public ResourceManagerResult(IDictionary paramaters, Func, Task> resource, ResourceType type) 12 | { 13 | Paramaters = paramaters; 14 | Resource = resource; 15 | Type = type; 16 | } 17 | 18 | public IDictionary Paramaters { get; } 19 | 20 | public Func, Task> Resource { get; } 21 | 22 | public ResourceType Type { get; } 23 | } 24 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/favicon.png -------------------------------------------------------------------------------- /src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/logo-long-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/logo-long-white.png -------------------------------------------------------------------------------- /src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/selawk.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/selawk.woff -------------------------------------------------------------------------------- /src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/selawk.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/selawk.woff2 -------------------------------------------------------------------------------- /src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/selawkl.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/selawkl.woff -------------------------------------------------------------------------------- /src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/selawkl.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/selawkl.woff2 -------------------------------------------------------------------------------- /src/Glimpse.Server/Internal/Resources/Embeded/Client/client/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Glimpse 7 | 8 | 9 |
    10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/assets/glimpse-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/assets/glimpse-logo.png -------------------------------------------------------------------------------- /src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/assets/selawk.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/assets/selawk.woff -------------------------------------------------------------------------------- /src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/assets/selawk.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/assets/selawk.woff2 -------------------------------------------------------------------------------- /src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/assets/selawkl.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/assets/selawkl.woff -------------------------------------------------------------------------------- /src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/assets/selawkl.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/assets/selawkl.woff2 -------------------------------------------------------------------------------- /src/Glimpse.Server/Internal/Resources/NullResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Glimpse.Server.Resources; 3 | using Microsoft.AspNetCore.Http; 4 | 5 | namespace Glimpse.Server.Internal.Resources 6 | { 7 | public class NullResponse : IResponse 8 | { 9 | public async Task Respond(HttpContext context) 10 | { 11 | // TODO: Use Task.CompletedTask when it's available. 12 | // See https://github.com/aspnet/Home/issues/337 for more details 13 | await Task.FromResult(false); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Internal/Resources/ResponseDecorator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using Glimpse.Server.Resources; 4 | using Microsoft.AspNetCore.Http; 5 | 6 | namespace Glimpse.Server.Internal.Resources 7 | { 8 | public class ResponseDecorator : IResponse 9 | { 10 | private readonly IResponse _response; 11 | private readonly Action _decoration; 12 | public ResponseDecorator(IResponse response, Action decoration) 13 | { 14 | _response = response; 15 | _decoration = decoration; 16 | } 17 | 18 | public async Task Respond(HttpContext context) 19 | { 20 | _decoration(context); 21 | await _response.Respond(context); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Messaging/IServerBroker.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Server 2 | { 3 | public interface IServerBroker 4 | { 5 | /// 6 | /// Off the reciever thread and is not blocking 7 | /// 8 | ServerBrokerObservations OffRecieverThread { get; } 9 | 10 | void SendMessage(IMessage message); 11 | } 12 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Messaging/InProcessPublisher.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Server 2 | { 3 | public class InProcessPublisher : IMessagePublisher 4 | { 5 | private readonly IServerBroker _messageBus; 6 | 7 | public InProcessPublisher(IServerBroker messageBus) 8 | { 9 | _messageBus = messageBus; 10 | } 11 | 12 | public void PublishMessage(IMessage message) 13 | { 14 | _messageBus.SendMessage(message); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Messaging/ServerBrokerObservations.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Reactive.Linq; 4 | 5 | namespace Glimpse.Server 6 | { 7 | public class ServerBrokerObservations 8 | { 9 | private readonly IObservable _observable; 10 | 11 | public ServerBrokerObservations(IObservable observable) 12 | { 13 | _observable = observable; 14 | } 15 | 16 | public IObservable Listen(string type) 17 | { 18 | return _observable.Where(opts => opts.Types.Contains(type)); 19 | } 20 | 21 | public IObservable ListenAll() 22 | { 23 | return _observable; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Properties/debugSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Profiles": [] 3 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Resources/ExceptionProblem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Glimpse.Server.Resources 4 | { 5 | public class ExceptionProblem : Problem 6 | { 7 | private readonly Exception _exception; 8 | public ExceptionProblem(Exception exception) 9 | { 10 | _exception = exception; 11 | Extensions["StackTrace"] = _exception.StackTrace; 12 | } 13 | 14 | public override Uri Type => new Uri("http://getglimpse.com/Docs/Troubleshooting/Exception"); 15 | public override string Title => "Server Exception"; 16 | public override string Details => _exception.Message; 17 | public override int StatusCode => 500; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Glimpse.Server/Resources/IResource.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using Microsoft.AspNetCore.Http; 4 | 5 | namespace Glimpse.Server.Resources 6 | { 7 | public interface IResource 8 | { 9 | Task Invoke(HttpContext context, IDictionary parameters); 10 | 11 | string Name { get; } 12 | 13 | IEnumerable Parameters { get; } 14 | 15 | // This should usually be set to ResourceType.Client. 16 | ResourceType Type { get; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Resources/IResourceBuilder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Builder; 5 | using Microsoft.AspNetCore.Http; 6 | 7 | namespace Glimpse.Server.Resources 8 | { 9 | public interface IResourceBuilder 10 | { 11 | IApplicationBuilder AppBuilder { get; } 12 | 13 | IResourceBuilder Run(string name, string uriTemplate, ResourceType type, Func, Task> resource); 14 | 15 | IResourceBuilder RegisterResource(string name, string uriTemplate); 16 | } 17 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Resources/IResourceStartup.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Server.Resources 2 | { 3 | public interface IResourceStartup 4 | { 5 | void Configure(IResourceBuilder resourceBuilder); 6 | 7 | ResourceType Type { get; } 8 | } 9 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Resources/IResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Microsoft.AspNetCore.Http; 3 | 4 | namespace Glimpse.Server.Resources 5 | { 6 | public interface IResponse 7 | { 8 | Task Respond(HttpContext context); 9 | } 10 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Resources/InvalidJsonProblem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace Glimpse.Server.Resources 5 | { 6 | public class InvalidJsonProblem : ExceptionProblem 7 | { 8 | public InvalidJsonProblem(JsonReaderException exception) : base(exception) 9 | { 10 | Extensions["LineNumber"] = exception.LineNumber; 11 | Extensions["LinePosition"] = exception.LinePosition; 12 | } 13 | 14 | public override Uri Type => new Uri("http://getglimpse.com/Docs/Troubleshooting/InvalidJson"); 15 | public override string Title => "Invalid Json"; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Glimpse.Server/Resources/Json.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Glimpse.Internal.Extensions; 3 | using Microsoft.AspNetCore.Http; 4 | using Newtonsoft.Json; 5 | 6 | namespace Glimpse.Server.Resources 7 | { 8 | public class Json : IResponse 9 | { 10 | private readonly object _obj; 11 | private readonly string _contentType; 12 | public Json(object obj) : this(obj, "application/json") 13 | { 14 | } 15 | 16 | public Json(object obj, string contentType) 17 | { 18 | _obj = obj; 19 | _contentType = contentType; 20 | } 21 | 22 | public async Task Respond(HttpContext context) 23 | { 24 | var jsonSerializer = new JsonSerializer(); 25 | jsonSerializer.Configure(); 26 | 27 | var json = jsonSerializer.Serialize(_obj); 28 | 29 | var response = new RawJson(json, _contentType); 30 | await response.Respond(context); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Resources/MissingParameterProblem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | 4 | namespace Glimpse.Server.Resources 5 | { 6 | public class MissingParameterProblem : Problem 7 | { 8 | private readonly string _parameterName; 9 | public MissingParameterProblem(string parameterName) 10 | { 11 | _parameterName = parameterName; 12 | } 13 | 14 | public override Uri Type => new Uri("http://getglimpse.com/Docs/Troubleshooting/MissingParameter"); 15 | 16 | public override string Title => "Missing Required Parameter"; 17 | 18 | public override string Details => $"Required parameter '{_parameterName}' is missing."; 19 | 20 | public override int StatusCode => (int) HttpStatusCode.NotFound; 21 | } 22 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Resources/Problem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Http; 5 | 6 | namespace Glimpse.Server.Resources 7 | { 8 | public abstract class Problem : IResponse 9 | { 10 | protected Problem() 11 | { 12 | Extensions = new Dictionary(); 13 | } 14 | 15 | public IDictionary Extensions { get; } 16 | 17 | public abstract Uri Type { get; } 18 | 19 | public abstract string Title { get; } 20 | 21 | public abstract string Details { get; } 22 | 23 | public abstract int StatusCode { get; } 24 | 25 | public virtual async Task Respond(HttpContext context) 26 | { 27 | context.Response.StatusCode = StatusCode; 28 | 29 | Extensions["Status"] = StatusCode; 30 | Extensions["Type"] = Type.AbsoluteUri; 31 | Extensions["Title"] = Title; 32 | Extensions["Details"] = Details; 33 | 34 | var response = new Json(Extensions, "application/problem+json"); 35 | await response.Respond(context); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Resources/RawJson.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Microsoft.AspNetCore.Http; 3 | 4 | namespace Glimpse.Server.Resources 5 | { 6 | public class RawJson : IResponse 7 | { 8 | private readonly string _json; 9 | private readonly string _contentType; 10 | 11 | public RawJson(string json) : this(json, "application/json") 12 | { 13 | } 14 | 15 | public RawJson(string json, string contentType) 16 | { 17 | _json = json; 18 | _contentType = contentType; 19 | } 20 | 21 | public async Task Respond(HttpContext context) 22 | { 23 | var response = context.Response; 24 | response.ContentType = _contentType; 25 | await response.WriteAsync(_json); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Resources/ResourceBuilder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | using Glimpse.Server.Internal; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Http; 7 | 8 | namespace Glimpse.Server.Resources 9 | { 10 | public class ResourceBuilder : IResourceBuilder 11 | { 12 | public ResourceBuilder(IApplicationBuilder app, IResourceManager resourceManager) 13 | { 14 | AppBuilder = app; 15 | ResourceManager = resourceManager; 16 | } 17 | private IResourceManager ResourceManager { get; } 18 | 19 | public IApplicationBuilder AppBuilder { get; } 20 | 21 | public IResourceBuilder Run(string name, string uriTemplate, ResourceType type, Func, Task> resource) 22 | { 23 | ResourceManager.Register(name, uriTemplate, type, resource); 24 | 25 | return this; 26 | } 27 | 28 | public IResourceBuilder RegisterResource(string name, string uriTemplate) 29 | { 30 | ResourceManager.Register(name, uriTemplate); 31 | 32 | return this; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Resources/ResourceType.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Server.Resources 2 | { 3 | public enum ResourceType 4 | { 5 | Client = 0, 6 | Agent = 1 7 | } 8 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/ServerMiddleware.cs: -------------------------------------------------------------------------------- 1 | using Glimpse.Common.Initialization; 2 | using Microsoft.AspNetCore.Builder; 3 | 4 | namespace Glimpse.Server 5 | { 6 | public class ServerMiddleware : IRegisterMiddleware 7 | { 8 | public void RegisterMiddleware(IApplicationBuilder appBuilder) 9 | { 10 | appBuilder.UseMiddleware(appBuilder); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Storage/IStorage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | namespace Glimpse.Server.Storage 6 | { 7 | public interface IStorage 8 | { 9 | void Persist(IMessage message); 10 | 11 | // types is required 12 | Task> RetrieveByType(params string[] types); 13 | 14 | Task> RetrieveByContextId(Guid id); 15 | 16 | // If no typeFilters are passed in, just don't filter 17 | Task> RetrieveByContextId(Guid id, params string[] typeFilter); 18 | } 19 | } -------------------------------------------------------------------------------- /src/Glimpse.Server/Storage/StorageExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace Glimpse.Server.Storage 2 | { 3 | public static class StorageExtensions 4 | { 5 | public static T As(this IStorage storage) where T : class 6 | { 7 | return storage as T; 8 | } 9 | 10 | public static bool Supports(this IStorage storage) where T : class 11 | { 12 | return storage.As() != null; 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /src/Glimpse/lib/net35/Glimpse.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/src/Glimpse/lib/net35/Glimpse.Core.dll -------------------------------------------------------------------------------- /src/Glimpse/lib/net40/Glimpse.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/src/Glimpse/lib/net40/Glimpse.Core.dll -------------------------------------------------------------------------------- /src/Glimpse/lib/net45/Glimpse.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/src/Glimpse/lib/net45/Glimpse.Core.dll -------------------------------------------------------------------------------- /src/Glimpse/lib/net451/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/src/Glimpse/lib/net451/_._ -------------------------------------------------------------------------------- /src/Glimpse/lib/netstandard1.6/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/src/Glimpse/lib/netstandard1.6/_._ -------------------------------------------------------------------------------- /src/Glimpse/tools/init.ps1: -------------------------------------------------------------------------------- 1 | param($installPath, $toolsPath, $package) 2 | 3 | Import-Module (Join-Path $toolsPath glimpse.psm1) -------------------------------------------------------------------------------- /src/Glimpse/tools/install.ps1: -------------------------------------------------------------------------------- 1 | param($installPath, $toolsPath, $package, $project) 2 | 3 | Register-GlimpseExtension $package $DTE -------------------------------------------------------------------------------- /src/Glimpse/tools/uninstall.ps1: -------------------------------------------------------------------------------- 1 | param($installPath, $toolsPath, $package, $project) 2 | 3 | Unregister-GlimpseExtension $package -------------------------------------------------------------------------------- /src/readme.md: -------------------------------------------------------------------------------- 1 | 2 | # Running Samples 3 | 4 | ## Glimpse.AgentServer.AspNet.Sample 5 | 6 | Sample project that runs the Web Agenet, Web Server and Web Client all in proc on top of pure middleware. 7 | 8 | To run, simply set the project as default and start the project or use command line and WebListener. 9 | 10 | Client is available at the [/glimpseui/index.html](/glimpseui/index.html) endpoint. 11 | 12 | ## Glimpse.AgentServer.AspNet.Mvc.Sample 13 | 14 | Sample project that runs the Web Agenet, Web Server and Web Client all in proc on top of MVC. 15 | 16 | To run, simply set the project as default and start the project or use command line and WebListener. 17 | 18 | Client is available at the [/glimpseui/index.html](/glimpseui/index.html) endpoint. 19 | 20 | ## Glimpse.Agent.AspNet.Sample & Glimpse.Server.AspNet.Sample 21 | 22 | To run, simply set both these project as startup projects and start the project or use command line and WebListener. 23 | -------------------------------------------------------------------------------- /test/websites/Glimpse.FunctionalTest.Website/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.AspNetCore.Mvc; 4 | 5 | namespace Glimpse.FunctionalTest.Website.Controllers 6 | { 7 | public class HomeController : Controller 8 | { 9 | public async Task Index() 10 | { 11 | await Response.WriteAsync("Hello, world!"); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/websites/Glimpse.FunctionalTest.Website/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace Glimpse.FunctionalTest.Website 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | var host = new WebHostBuilder() 15 | .UseKestrel() 16 | .UseContentRoot(Directory.GetCurrentDirectory()) 17 | .UseIISIntegration() 18 | .UseStartup() 19 | .Build(); 20 | 21 | host.Run(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/websites/Glimpse.FunctionalTest.Website/Startup.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.Tracing; 2 | using Glimpse.Agent; 3 | using Glimpse.Server; 4 | using Microsoft.AspNetCore.Builder; 5 | using Microsoft.Extensions.DependencyInjection; 6 | 7 | namespace Glimpse.FunctionalTest.Website 8 | { 9 | public class Startup 10 | { 11 | public void ConfigureServices(IServiceCollection services) 12 | { 13 | services.AddGlimpse(); 14 | 15 | services.AddMvc(); 16 | } 17 | 18 | public void Configure(IApplicationBuilder app) 19 | { 20 | app.UseGlimpse(); 21 | 22 | app.UseMvcWithDefaultRoute(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/websites/Glimpse.FunctionalTest.Website/hosting.ini: -------------------------------------------------------------------------------- 1 | server=Microsoft.AspNet.Server.WebListener 2 | server.urls=http://localhost:5000 3 | --------------------------------------------------------------------------------