committed by
GitHub
136 changed files with 3794 additions and 50560 deletions
@ -1,76 +1,98 @@ |
|||||
# Uppy |
# Uppy |
||||
|
|
||||
Hi, thanks for trying out the bundled version of the Uppy File Uploader. You can use |
Hi, thanks for trying out the bundled version of the Uppy File Uploader. You can |
||||
this from a CDN (e.g. `<script src="https://releases.transloadit.com/uppy/v1.31.1/uppy.min.js"></script>`) or bundle it with your webapp. |
use this from a CDN |
||||
|
(`<script src="https://releases.transloadit.com/uppy/v3.25.3/uppy.min.js"></script>`) |
||||
|
or bundle it with your webapp. |
||||
|
|
||||
Note that the recommended way to use Uppy is to install it with yarn/npm and use a |
Note that the recommended way to use Uppy is to install it with yarn/npm and use |
||||
bundler like Webpack so that you can create a smaller custom build with just the |
a bundler like Webpack so that you can create a smaller custom build with only |
||||
things that you need. More info on <https://uppy.io/docs/#With-a-module-bundler>. |
the things that you need. More info on |
||||
|
<https://uppy.io/docs/#With-a-module-bundler>. |
||||
|
|
||||
## How to use this bundle |
## How to use this bundle |
||||
|
|
||||
You can extract the contents of this zip to e.g. `./js/uppy` |
You can extract the contents of this zip to a directory, such as `./js/uppy`. |
||||
|
|
||||
Now you can create an HTML file, e.g.: `./upload.html` with the following contents: |
Now you can create an HTML file, for example `./upload.html`, with the following |
||||
|
contents: |
||||
|
|
||||
```html |
```html |
||||
<html> |
<html> |
||||
<head> |
<head> |
||||
<link rel="stylesheet" href="./js/uppy/uppy.min.css"> |
<link rel="stylesheet" href="./js/uppy/uppy.min.css" /> |
||||
</head> |
</head> |
||||
|
|
||||
<body> |
<body> |
||||
<div class="DashboardContainer"></div> |
<div class="DashboardContainer"></div> |
||||
<button class="UppyModalOpenerBtn">Upload</button> |
<button class="UppyModalOpenerBtn">Upload</button> |
||||
<div class="uploaded-files"> |
<div class="uploaded-files"> |
||||
<h5>Uploaded files:</h5> |
<h5>Uploaded files:</h5> |
||||
<ol></ol> |
<ol></ol> |
||||
</div> |
</div> |
||||
</body> |
</body> |
||||
|
|
||||
<script src="./js/uppy/uppy.min.js"></script> |
<script type="module"> |
||||
<script> |
import { Uppy, Dashboard, Tus } from './js/uppy/uppy.min.mjs' |
||||
var uppy = Uppy.Core({ |
var uppy = new Uppy({ |
||||
debug : true, |
debug: true, |
||||
autoProceed: false, |
autoProceed: false, |
||||
}) |
|
||||
.use(Uppy.Dashboard, { |
|
||||
browserBackButtonClose: false, |
|
||||
height : 470, |
|
||||
inline : false, |
|
||||
replaceTargetContent : true, |
|
||||
showProgressDetails : true, |
|
||||
target : '.DashboardContainer', |
|
||||
trigger : '.UppyModalOpenerBtn', |
|
||||
metaFields : [ |
|
||||
{ id: 'name', name: 'Name', placeholder: 'file name' }, |
|
||||
{ id: 'caption', name: 'Caption', placeholder: 'describe what the image is about' } |
|
||||
] |
|
||||
}) |
}) |
||||
.use(Uppy.Tus, { endpoint: 'https://tusd.tusdemo.net/files/' }) |
.use(Dashboard, { |
||||
.on('upload-success', function (file, response) { |
browserBackButtonClose: false, |
||||
var url = response.uploadURL |
height: 470, |
||||
var fileName = file.name |
inline: false, |
||||
|
replaceTargetContent: true, |
||||
document.querySelector('.uploaded-files ol').innerHTML += |
showProgressDetails: true, |
||||
'<li><a href="' + url + '" target="_blank">' + fileName + '</a></li>' |
target: '.DashboardContainer', |
||||
}) |
trigger: '.UppyModalOpenerBtn', |
||||
</script> |
metaFields: [ |
||||
|
{ id: 'name', name: 'Name', placeholder: 'file name' }, |
||||
|
{ |
||||
|
id: 'caption', |
||||
|
name: 'Caption', |
||||
|
placeholder: 'describe what the image is about', |
||||
|
}, |
||||
|
], |
||||
|
}) |
||||
|
.use(Tus, { endpoint: 'https://tusd.tusdemo.net/files/' }) |
||||
|
.on('upload-success', function (file, response) { |
||||
|
var url = response.uploadURL |
||||
|
var fileName = file.name |
||||
|
|
||||
|
document.querySelector('.uploaded-files ol').innerHTML += |
||||
|
'<li><a href="' + url + '" target="_blank">' + fileName + '</a></li>' |
||||
|
}) |
||||
|
</script> |
||||
|
</html> |
||||
``` |
``` |
||||
|
|
||||
Now open `upload.html` in your browser, and the Uppy Dashboard will appear. |
Now open `upload.html` in your browser, and the Uppy Dashboard will appear. |
||||
|
|
||||
## Next steps |
## Next steps |
||||
|
|
||||
In the example you just built, Uppy uploads to a demo server where files will be deleted |
In the example you built, Uppy uploads to a demo server where files will be |
||||
shortly after uploading. You'll want to target your own tusd server, S3 bucket, or Nginx/Apache server. For the latter, use the Xhr plugin: <https://uppy.io/docs/xhr-upload/> which uploads using regular multipart form posts, that you'll existing Ruby or PHP backend will be able to make sense of, just as if a `<input type="file">` had been used. |
deleted shortly after uploading. You’ll want to target your own tusd server, S3 |
||||
|
bucket, or Nginx/Apache server. For the latter, use the Xhr plugin: |
||||
|
<https://uppy.io/docs/xhr-upload/> which uploads using regular multipart form |
||||
|
posts, that you’ll existing Ruby or PHP backend will be able to make sense of, |
||||
|
as if a `<input type="file">` had been used. |
||||
|
|
||||
The Dashboard currently opens when clicking the button, but you can also draw it inline into the page. This, and many more configuration options can be found here: <https://uppy.io/docs/dashboard/>. |
The Dashboard now opens when clicking the button, but you can also draw it |
||||
|
inline into the page. This, and many more configuration options can be found |
||||
|
here: <https://uppy.io/docs/dashboard/>. |
||||
|
|
||||
Uppy has many more Plugins besides Xhr and the Dashboard. For example, you can enable Webcam, Instagram, or video encoding support. For a full list of Plugins check here: <https://uppy.io/docs/plugins/>. |
Uppy has many more Plugins besides Xhr and the Dashboard. For example, you can |
||||
|
enable Webcam, Instagram, or video encoding support. For a full list of Plugins |
||||
|
check here: <https://uppy.io/docs/plugins/>. |
||||
|
|
||||
Note that for some Plugins, you will need to run a server side component called: Companion. Those plugins are marked with a (c) symbol. Alternatively, you can sign up for a free Transloadit account. Transloadit runs Companion for you, tusd servers to handle resumable file uploads, and can post-process files to scan for viruses, recognize faces, etc. Check: <https://transloadit.com>. |
Note that for some Plugins, you will need to run a server side component called: |
||||
|
Companion. Those plugins are marked with a (c) symbol. Alternatively, you can |
||||
|
sign up for a free Transloadit account. Transloadit runs Companion for you, tusd |
||||
|
servers to handle resumable file uploads, and can post-process files to scan for |
||||
|
viruses, recognize faces, etc. Check: <https://transloadit.com>. |
||||
|
|
||||
## Getting help |
## Getting help |
||||
|
|
||||
Stuck with anything? We're welcoming all your questions and feedback over at <https://community.transloadit.com/c/uppy/5>. |
Stuck with anything? We’re welcoming all your questions and feedback over at |
||||
|
<https://community.transloadit.com/c/uppy/5>. |
||||
|
|||||
File diff suppressed because it is too large
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
@ -0,0 +1,31 @@ |
|||||
|
using Aspire.Hosting.Lifecycle; |
||||
|
|
||||
|
namespace eShopOnAbp.AppHost; |
||||
|
|
||||
|
internal static class Extensions |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Adds a hook to set the ASPNETCORE_FORWARDEDHEADERS_ENABLED environment variable to true for all projects in the application.
|
||||
|
/// </summary>
|
||||
|
public static IDistributedApplicationBuilder AddForwardedHeaders(this IDistributedApplicationBuilder builder) |
||||
|
{ |
||||
|
builder.Services.TryAddLifecycleHook<AddForwardHeadersHook>(); |
||||
|
return builder; |
||||
|
} |
||||
|
|
||||
|
private class AddForwardHeadersHook : IDistributedApplicationLifecycleHook |
||||
|
{ |
||||
|
public Task BeforeStartAsync(DistributedApplicationModel appModel, CancellationToken cancellationToken = default) |
||||
|
{ |
||||
|
foreach (var p in appModel.GetProjectResources()) |
||||
|
{ |
||||
|
p.Annotations.Add(new EnvironmentCallbackAnnotation(context => |
||||
|
{ |
||||
|
context.EnvironmentVariables["ASPNETCORE_FORWARDEDHEADERS_ENABLED"] = "true"; |
||||
|
})); |
||||
|
} |
||||
|
|
||||
|
return Task.CompletedTask; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,48 @@ |
|||||
|
using eShopOnAbp.AppHost; |
||||
|
|
||||
|
var builder = DistributedApplication.CreateBuilder(args); |
||||
|
|
||||
|
builder.AddForwardedHeaders(); |
||||
|
|
||||
|
var profile = "http"; |
||||
|
|
||||
|
// Microservices
|
||||
|
var administrationService = |
||||
|
builder.AddProject<Projects.EShopOnAbp_AdministrationService_HttpApi_Host>("administrationService", profile); |
||||
|
var identityService = builder.AddProject<Projects.EShopOnAbp_IdentityService_HttpApi_Host>("identityService", profile); |
||||
|
var catalogService = builder.AddProject<Projects.EShopOnAbp_CatalogService_HttpApi_Host>("catalogService", null) |
||||
|
.WithHttpEndpoint(name: "http", port: 5054, isProxied: false) |
||||
|
.WithEndpoint( |
||||
|
endpointName: "grpc", |
||||
|
callback: static endpoint => |
||||
|
{ |
||||
|
endpoint.Port = 8181; |
||||
|
endpoint.UriScheme = "http"; |
||||
|
endpoint.Transport = "http2"; |
||||
|
endpoint.IsProxied = false; |
||||
|
} |
||||
|
); |
||||
|
var basketService = builder.AddProject<Projects.EShopOnAbp_BasketService>("basketService", profile) |
||||
|
.WithReference(catalogService); |
||||
|
var cmsKitService = builder.AddProject<Projects.EShopOnAbp_CmskitService_HttpApi_Host>("cmsKitService", profile); |
||||
|
var orderingService = builder.AddProject<Projects.EShopOnAbp_OrderingService_HttpApi_Host>("orderingService", profile); |
||||
|
var paymentService = builder.AddProject<Projects.EShopOnAbp_PaymentService_HttpApi_Host>("paymentService", profile); |
||||
|
|
||||
|
// Gateways
|
||||
|
var webGateway = builder.AddProject<Projects.EShopOnAbp_WebGateway>("webGateway"); |
||||
|
var webPublicGateway = builder.AddProject<Projects.EShopOnAbp_WebPublicGateway>("webPublicGateway") |
||||
|
.WithReference(administrationService) |
||||
|
.WithReference(identityService) |
||||
|
.WithReference(catalogService) |
||||
|
.WithReference(basketService) |
||||
|
.WithReference(cmsKitService) |
||||
|
.WithReference(orderingService) |
||||
|
.WithReference(paymentService); |
||||
|
|
||||
|
// Apps
|
||||
|
var publicWebApp = builder.AddProject<Projects.EShopOnAbp_PublicWeb>("public-web", "https") |
||||
|
.WithExternalHttpEndpoints() |
||||
|
.WithReference(catalogService) |
||||
|
.WithReference(webPublicGateway); |
||||
|
|
||||
|
builder.Build().Run(); |
||||
@ -0,0 +1,30 @@ |
|||||
|
{ |
||||
|
"$schema": "https://json.schemastore.org/launchsettings.json", |
||||
|
"profiles": { |
||||
|
"https": { |
||||
|
"commandName": "Project", |
||||
|
"dotnetRunMessages": true, |
||||
|
"launchBrowser": true, |
||||
|
"applicationUrl": "https://localhost:17286;http://localhost:15011", |
||||
|
"environmentVariables": { |
||||
|
"ASPNETCORE_ENVIRONMENT": "Development", |
||||
|
"DOTNET_ENVIRONMENT": "Development", |
||||
|
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21296", |
||||
|
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22033" |
||||
|
} |
||||
|
}, |
||||
|
"http": { |
||||
|
"commandName": "Project", |
||||
|
"dotnetRunMessages": true, |
||||
|
"launchBrowser": true, |
||||
|
"applicationUrl": "http://localhost:15011", |
||||
|
"environmentVariables": { |
||||
|
"ASPNETCORE_ENVIRONMENT": "Development", |
||||
|
"DOTNET_ENVIRONMENT": "Development", |
||||
|
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19089", |
||||
|
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20048", |
||||
|
"ASPIRE_ALLOW_UNSECURED_TRANSPORT": "true" |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,8 @@ |
|||||
|
{ |
||||
|
"Logging": { |
||||
|
"LogLevel": { |
||||
|
"Default": "Information", |
||||
|
"Microsoft.AspNetCore": "Warning" |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,9 @@ |
|||||
|
{ |
||||
|
"Logging": { |
||||
|
"LogLevel": { |
||||
|
"Default": "Information", |
||||
|
"Microsoft.AspNetCore": "Warning", |
||||
|
"Aspire.Hosting.Dcp": "Warning" |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<OutputType>Exe</OutputType> |
||||
|
<TargetFramework>net8.0</TargetFramework> |
||||
|
<ImplicitUsings>enable</ImplicitUsings> |
||||
|
<Nullable>enable</Nullable> |
||||
|
<IsAspireHost>true</IsAspireHost> |
||||
|
<UserSecretsId>40d1d3f9-6593-4f5a-9d74-ff6ea82eb14e</UserSecretsId> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<PackageReference Include="Aspire.Hosting.AppHost" Version="8.0.0-preview.7.24251.11" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<ProjectReference Include="..\..\apps\public-web\src\EShopOnAbp.PublicWeb\EShopOnAbp.PublicWeb.csproj" /> |
||||
|
<ProjectReference Include="..\..\gateways\web-public\src\EShopOnAbp.WebPublicGateway\EShopOnAbp.WebPublicGateway.csproj" /> |
||||
|
<ProjectReference Include="..\..\gateways\web\src\EShopOnAbp.WebGateway\EShopOnAbp.WebGateway.csproj" /> |
||||
|
<ProjectReference Include="..\..\services\administration\src\EShopOnAbp.AdministrationService.HttpApi.Host\EShopOnAbp.AdministrationService.HttpApi.Host.csproj" /> |
||||
|
<ProjectReference Include="..\..\services\basket\src\EShopOnAbp.BasketService\EShopOnAbp.BasketService.csproj" /> |
||||
|
<ProjectReference Include="..\..\services\catalog\src\EShopOnAbp.CatalogService.HttpApi.Host\EShopOnAbp.CatalogService.HttpApi.Host.csproj" /> |
||||
|
<ProjectReference Include="..\..\services\cmskit\src\EShopOnAbp.CmskitService.HttpApi.Host\EShopOnAbp.CmskitService.HttpApi.Host.csproj" /> |
||||
|
<ProjectReference Include="..\..\services\identity\src\EShopOnAbp.IdentityService.HttpApi.Host\EShopOnAbp.IdentityService.HttpApi.Host.csproj" /> |
||||
|
<ProjectReference Include="..\..\services\ordering\src\EShopOnAbp.OrderingService.HttpApi.Host\EShopOnAbp.OrderingService.HttpApi.Host.csproj" /> |
||||
|
<ProjectReference Include="..\..\services\payment\src\EShopOnAbp.PaymentService.HttpApi.Host\EShopOnAbp.PaymentService.HttpApi.Host.csproj" /> |
||||
|
<ProjectReference Include="..\..\shared\EShopOnAbp.Keycloak.DbMigrator\EShopOnAbp.Keycloak.DbMigrator.csproj" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
</Project> |
||||
@ -0,0 +1,115 @@ |
|||||
|
using Microsoft.AspNetCore.Builder; |
||||
|
using Microsoft.AspNetCore.Diagnostics.HealthChecks; |
||||
|
using Microsoft.Extensions.DependencyInjection; |
||||
|
using Microsoft.Extensions.Diagnostics.HealthChecks; |
||||
|
using Microsoft.Extensions.Logging; |
||||
|
using OpenTelemetry; |
||||
|
using OpenTelemetry.Metrics; |
||||
|
using OpenTelemetry.Trace; |
||||
|
|
||||
|
namespace Microsoft.Extensions.Hosting; |
||||
|
|
||||
|
public static class Extensions |
||||
|
{ |
||||
|
public static IHostApplicationBuilder AddServiceDefaults(this IHostApplicationBuilder builder) |
||||
|
{ |
||||
|
builder.ConfigureOpenTelemetry(); |
||||
|
|
||||
|
builder.AddDefaultHealthChecks(); |
||||
|
|
||||
|
builder.Services.AddServiceDiscovery(); |
||||
|
|
||||
|
builder.Services.ConfigureHttpClientDefaults(http => |
||||
|
{ |
||||
|
// Turn on resilience by default
|
||||
|
http.AddStandardResilienceHandler(); |
||||
|
|
||||
|
// Turn on service discovery by default
|
||||
|
http.AddServiceDiscovery(); |
||||
|
}); |
||||
|
|
||||
|
return builder; |
||||
|
} |
||||
|
|
||||
|
public static IHostApplicationBuilder ConfigureOpenTelemetry(this IHostApplicationBuilder builder) |
||||
|
{ |
||||
|
builder.Logging.AddOpenTelemetry(logging => |
||||
|
{ |
||||
|
logging.IncludeFormattedMessage = true; |
||||
|
logging.IncludeScopes = true; |
||||
|
}); |
||||
|
|
||||
|
builder.Services.AddOpenTelemetry() |
||||
|
.WithMetrics(metrics => |
||||
|
{ |
||||
|
metrics.AddAspNetCoreInstrumentation() |
||||
|
.AddHttpClientInstrumentation() |
||||
|
.AddRuntimeInstrumentation(); |
||||
|
}) |
||||
|
.WithTracing(tracing => |
||||
|
{ |
||||
|
tracing.AddAspNetCoreInstrumentation() |
||||
|
// Uncomment the following line to enable gRPC instrumentation (requires the OpenTelemetry.Instrumentation.GrpcNetClient package)
|
||||
|
//.AddGrpcClientInstrumentation()
|
||||
|
.AddHttpClientInstrumentation(); |
||||
|
}); |
||||
|
|
||||
|
builder.AddOpenTelemetryExporters(); |
||||
|
|
||||
|
return builder; |
||||
|
} |
||||
|
|
||||
|
private static IHostApplicationBuilder AddOpenTelemetryExporters(this IHostApplicationBuilder builder) |
||||
|
{ |
||||
|
var useOtlpExporter = !string.IsNullOrWhiteSpace(builder.Configuration["OTEL_EXPORTER_OTLP_ENDPOINT"]); |
||||
|
|
||||
|
if (useOtlpExporter) |
||||
|
{ |
||||
|
builder.Services.AddOpenTelemetry().UseOtlpExporter(); |
||||
|
} |
||||
|
|
||||
|
// Uncomment the following lines to enable the Prometheus exporter (requires the OpenTelemetry.Exporter.Prometheus.AspNetCore package)
|
||||
|
// builder.Services.AddOpenTelemetry()
|
||||
|
// .WithMetrics(metrics => metrics.AddPrometheusExporter());
|
||||
|
|
||||
|
// Uncomment the following lines to enable the Azure Monitor exporter (requires the Azure.Monitor.OpenTelemetry.AspNetCore package)
|
||||
|
//if (!string.IsNullOrEmpty(builder.Configuration["APPLICATIONINSIGHTS_CONNECTION_STRING"]))
|
||||
|
//{
|
||||
|
// builder.Services.AddOpenTelemetry()
|
||||
|
// .UseAzureMonitor();
|
||||
|
//}
|
||||
|
|
||||
|
return builder; |
||||
|
} |
||||
|
|
||||
|
public static IHostApplicationBuilder AddDefaultHealthChecks(this IHostApplicationBuilder builder) |
||||
|
{ |
||||
|
builder.Services.AddHealthChecks() |
||||
|
// Add a default liveness check to ensure app is responsive
|
||||
|
.AddCheck("self", () => HealthCheckResult.Healthy(), ["live"]); |
||||
|
|
||||
|
return builder; |
||||
|
} |
||||
|
|
||||
|
public static WebApplication MapDefaultEndpoints(this WebApplication app) |
||||
|
{ |
||||
|
// Adding health checks endpoints to applications in non-development environments has security implications.
|
||||
|
// See https://aka.ms/dotnet/aspire/healthchecks for details before enabling these endpoints in non-development environments.
|
||||
|
if (app.Environment.IsDevelopment()) |
||||
|
{ |
||||
|
// All health checks must pass for app to be considered ready to accept traffic after starting
|
||||
|
app.MapHealthChecks("/health"); |
||||
|
|
||||
|
// Only health checks tagged with the "live" tag must pass for app to be considered alive
|
||||
|
app.MapHealthChecks("/alive", new HealthCheckOptions |
||||
|
{ |
||||
|
Predicate = r => r.Tags.Contains("live") |
||||
|
}); |
||||
|
|
||||
|
// Uncomment the following line to enable the Prometheus endpoint (requires the OpenTelemetry.Exporter.Prometheus.AspNetCore package)
|
||||
|
// app.MapPrometheusScrapingEndpoint();
|
||||
|
} |
||||
|
|
||||
|
return app; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<TargetFramework>net8.0</TargetFramework> |
||||
|
<ImplicitUsings>enable</ImplicitUsings> |
||||
|
<Nullable>enable</Nullable> |
||||
|
<IsAspireSharedProject>true</IsAspireSharedProject> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<FrameworkReference Include="Microsoft.AspNetCore.App" /> |
||||
|
|
||||
|
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.5.0" /> |
||||
|
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="8.0.1" /> |
||||
|
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.8.1" /> |
||||
|
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.8.1" /> |
||||
|
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.8.1" /> |
||||
|
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.8.1" /> |
||||
|
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.8.0" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
</Project> |
||||
@ -1,18 +1,18 @@ |
|||||
{ |
{ |
||||
"Kestrel": { |
// "Kestrel": { |
||||
"Endpoints": { |
// "Endpoints": { |
||||
"Http": { |
// "Http": { |
||||
"Url": "http://localhost:5000", |
// "Url": "http://localhost:5000", |
||||
"Protocols": "Http1AndHttp2" |
// "Protocols": "Http1AndHttp2" |
||||
}, |
// }, |
||||
"Https": { |
// "Https": { |
||||
"Url": "https://localhost:44354", |
// "Url": "https://localhost:44354", |
||||
"Protocols": "Http1AndHttp2" |
// "Protocols": "Http1AndHttp2" |
||||
}, |
// }, |
||||
"gRPC": { |
// "gRPC": { |
||||
"Url": "http://localhost:81", |
// "Url": "http://localhost:81", |
||||
"Protocols": "Http2" |
// "Protocols": "Http2" |
||||
} |
// } |
||||
} |
// } |
||||
} |
// } |
||||
} |
} |
||||
|
|||||
@ -1,28 +0,0 @@ |
|||||
using System.Threading.Tasks; |
|
||||
using Microsoft.AspNetCore.Authorization; |
|
||||
|
|
||||
namespace EShopOnAbp.CmskitService.Samples; |
|
||||
|
|
||||
public class SampleAppService : CmskitServiceAppService, ISampleAppService |
|
||||
{ |
|
||||
public Task<SampleDto> GetAsync() |
|
||||
{ |
|
||||
return Task.FromResult( |
|
||||
new SampleDto |
|
||||
{ |
|
||||
Value = 42 |
|
||||
} |
|
||||
); |
|
||||
} |
|
||||
|
|
||||
[Authorize] |
|
||||
public Task<SampleDto> GetAuthorizedAsync() |
|
||||
{ |
|
||||
return Task.FromResult( |
|
||||
new SampleDto |
|
||||
{ |
|
||||
Value = 42 |
|
||||
} |
|
||||
); |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,205 @@ |
|||||
|
// <auto-generated />
|
||||
|
using System; |
||||
|
using EShopOnAbp.CmskitService.EntityFrameworkCore; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Microsoft.EntityFrameworkCore.Infrastructure; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; |
||||
|
using Volo.Abp.EntityFrameworkCore; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace EShopOnAbp.CmskitService.Migrations |
||||
|
{ |
||||
|
[DbContext(typeof(CmskitServiceDbContext))] |
||||
|
[Migration("20240520210718_Abp_8_0_Update")] |
||||
|
partial class Abp_8_0_Update |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
||||
|
{ |
||||
|
#pragma warning disable 612, 618
|
||||
|
modelBuilder |
||||
|
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql) |
||||
|
.HasAnnotation("ProductVersion", "8.0.0") |
||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 63); |
||||
|
|
||||
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.CmsKit.Comments.Comment", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.HasColumnType("uuid"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(40) |
||||
|
.HasColumnType("character varying(40)") |
||||
|
.HasColumnName("ConcurrencyStamp"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("timestamp without time zone") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid>("CreatorId") |
||||
|
.HasColumnType("uuid") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<string>("EntityId") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(64) |
||||
|
.HasColumnType("character varying(64)"); |
||||
|
|
||||
|
b.Property<string>("EntityType") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(64) |
||||
|
.HasColumnType("character varying(64)"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.IsRequired() |
||||
|
.HasColumnType("text") |
||||
|
.HasColumnName("ExtraProperties"); |
||||
|
|
||||
|
b.Property<string>("IdempotencyToken") |
||||
|
.HasMaxLength(32) |
||||
|
.HasColumnType("character varying(32)"); |
||||
|
|
||||
|
b.Property<Guid?>("RepliedCommentId") |
||||
|
.HasColumnType("uuid"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnType("uuid") |
||||
|
.HasColumnName("TenantId"); |
||||
|
|
||||
|
b.Property<string>("Text") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(512) |
||||
|
.HasColumnType("character varying(512)"); |
||||
|
|
||||
|
b.Property<string>("Url") |
||||
|
.HasMaxLength(512) |
||||
|
.HasColumnType("character varying(512)"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("TenantId", "RepliedCommentId"); |
||||
|
|
||||
|
b.HasIndex("TenantId", "EntityType", "EntityId"); |
||||
|
|
||||
|
b.ToTable("CmsComments", (string)null); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.CmsKit.Ratings.Rating", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.HasColumnType("uuid"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("timestamp without time zone") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid>("CreatorId") |
||||
|
.HasColumnType("uuid") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<string>("EntityId") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(64) |
||||
|
.HasColumnType("character varying(64)"); |
||||
|
|
||||
|
b.Property<string>("EntityType") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(64) |
||||
|
.HasColumnType("character varying(64)"); |
||||
|
|
||||
|
b.Property<short>("StarCount") |
||||
|
.HasColumnType("smallint"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnType("uuid"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("TenantId", "EntityType", "EntityId", "CreatorId"); |
||||
|
|
||||
|
b.ToTable("CmsRatings", (string)null); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.CmsKit.Users.CmsUser", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.HasColumnType("uuid"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(40) |
||||
|
.HasColumnType("character varying(40)") |
||||
|
.HasColumnName("ConcurrencyStamp"); |
||||
|
|
||||
|
b.Property<string>("Email") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(256) |
||||
|
.HasColumnType("character varying(256)") |
||||
|
.HasColumnName("Email"); |
||||
|
|
||||
|
b.Property<bool>("EmailConfirmed") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("boolean") |
||||
|
.HasDefaultValue(false) |
||||
|
.HasColumnName("EmailConfirmed"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.IsRequired() |
||||
|
.HasColumnType("text") |
||||
|
.HasColumnName("ExtraProperties"); |
||||
|
|
||||
|
b.Property<bool>("IsActive") |
||||
|
.HasColumnType("boolean") |
||||
|
.HasColumnName("IsActive"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.HasMaxLength(64) |
||||
|
.HasColumnType("character varying(64)") |
||||
|
.HasColumnName("Name"); |
||||
|
|
||||
|
b.Property<string>("PhoneNumber") |
||||
|
.HasMaxLength(16) |
||||
|
.HasColumnType("character varying(16)") |
||||
|
.HasColumnName("PhoneNumber"); |
||||
|
|
||||
|
b.Property<bool>("PhoneNumberConfirmed") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("boolean") |
||||
|
.HasDefaultValue(false) |
||||
|
.HasColumnName("PhoneNumberConfirmed"); |
||||
|
|
||||
|
b.Property<string>("Surname") |
||||
|
.HasMaxLength(64) |
||||
|
.HasColumnType("character varying(64)") |
||||
|
.HasColumnName("Surname"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnType("uuid") |
||||
|
.HasColumnName("TenantId"); |
||||
|
|
||||
|
b.Property<string>("UserName") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(256) |
||||
|
.HasColumnType("character varying(256)") |
||||
|
.HasColumnName("UserName"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("TenantId", "Email"); |
||||
|
|
||||
|
b.HasIndex("TenantId", "UserName"); |
||||
|
|
||||
|
b.ToTable("CmsUsers", (string)null); |
||||
|
}); |
||||
|
#pragma warning restore 612, 618
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,120 @@ |
|||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace EShopOnAbp.CmskitService.Migrations |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
public partial class Abp_8_0_Update : Migration |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "ExtraProperties", |
||||
|
table: "CmsUsers", |
||||
|
type: "text", |
||||
|
nullable: false, |
||||
|
defaultValue: "", |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "text", |
||||
|
oldNullable: true); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "ConcurrencyStamp", |
||||
|
table: "CmsUsers", |
||||
|
type: "character varying(40)", |
||||
|
maxLength: 40, |
||||
|
nullable: false, |
||||
|
defaultValue: "", |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "character varying(40)", |
||||
|
oldMaxLength: 40, |
||||
|
oldNullable: true); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "ExtraProperties", |
||||
|
table: "CmsComments", |
||||
|
type: "text", |
||||
|
nullable: false, |
||||
|
defaultValue: "", |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "text", |
||||
|
oldNullable: true); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "ConcurrencyStamp", |
||||
|
table: "CmsComments", |
||||
|
type: "character varying(40)", |
||||
|
maxLength: 40, |
||||
|
nullable: false, |
||||
|
defaultValue: "", |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "character varying(40)", |
||||
|
oldMaxLength: 40, |
||||
|
oldNullable: true); |
||||
|
|
||||
|
migrationBuilder.AddColumn<string>( |
||||
|
name: "IdempotencyToken", |
||||
|
table: "CmsComments", |
||||
|
type: "character varying(32)", |
||||
|
maxLength: 32, |
||||
|
nullable: true); |
||||
|
|
||||
|
migrationBuilder.AddColumn<string>( |
||||
|
name: "Url", |
||||
|
table: "CmsComments", |
||||
|
type: "character varying(512)", |
||||
|
maxLength: 512, |
||||
|
nullable: true); |
||||
|
} |
||||
|
|
||||
|
/// <inheritdoc />
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "IdempotencyToken", |
||||
|
table: "CmsComments"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "Url", |
||||
|
table: "CmsComments"); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "ExtraProperties", |
||||
|
table: "CmsUsers", |
||||
|
type: "text", |
||||
|
nullable: true, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "text"); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "ConcurrencyStamp", |
||||
|
table: "CmsUsers", |
||||
|
type: "character varying(40)", |
||||
|
maxLength: 40, |
||||
|
nullable: true, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "character varying(40)", |
||||
|
oldMaxLength: 40); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "ExtraProperties", |
||||
|
table: "CmsComments", |
||||
|
type: "text", |
||||
|
nullable: true, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "text"); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "ConcurrencyStamp", |
||||
|
table: "CmsComments", |
||||
|
type: "character varying(40)", |
||||
|
maxLength: 40, |
||||
|
nullable: true, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "character varying(40)", |
||||
|
oldMaxLength: 40); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,15 +1,17 @@ |
|||||
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
|
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
|
||||
using System; |
using System; |
||||
|
using System.Collections.Generic; |
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
using Volo.Abp; |
||||
using Volo.Abp.Application.Dtos; |
using Volo.Abp.Application.Dtos; |
||||
using Volo.Abp.Http.Client; |
|
||||
using Volo.Abp.Http.Modeling; |
|
||||
using Volo.Abp.DependencyInjection; |
using Volo.Abp.DependencyInjection; |
||||
|
using Volo.Abp.Http.Client; |
||||
using Volo.Abp.Http.Client.ClientProxying; |
using Volo.Abp.Http.Client.ClientProxying; |
||||
|
using Volo.Abp.Http.Modeling; |
||||
using Volo.CmsKit.Public.Comments; |
using Volo.CmsKit.Public.Comments; |
||||
|
|
||||
// ReSharper disable once CheckNamespace
|
// ReSharper disable once CheckNamespace
|
||||
namespace Volo.CmsKit.Public.Comments.ClientProxies; |
namespace Volo.CmsKit.Public.Comments; |
||||
|
|
||||
[Dependency(ReplaceServices = true)] |
[Dependency(ReplaceServices = true)] |
||||
[ExposeServices(typeof(ICommentPublicAppService), typeof(CommentPublicClientProxy))] |
[ExposeServices(typeof(ICommentPublicAppService), typeof(CommentPublicClientProxy))] |
||||
@ -1,6 +1,6 @@ |
|||||
// This file is part of CommentPublicClientProxy, you can customize it here
|
// This file is part of CommentPublicClientProxy, you can customize it here
|
||||
// ReSharper disable once CheckNamespace
|
// ReSharper disable once CheckNamespace
|
||||
namespace Volo.CmsKit.Public.Comments.ClientProxies; |
namespace Volo.CmsKit.Public.Comments; |
||||
|
|
||||
public partial class CommentPublicClientProxy |
public partial class CommentPublicClientProxy |
||||
{ |
{ |
||||
@ -1,16 +1,17 @@ |
|||||
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
|
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
|
||||
using System; |
using System; |
||||
|
using System.Collections.Generic; |
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
using Volo.Abp; |
||||
using Volo.Abp.Application.Dtos; |
using Volo.Abp.Application.Dtos; |
||||
using Volo.Abp.Http.Client; |
|
||||
using Volo.Abp.Http.Modeling; |
|
||||
using Volo.Abp.DependencyInjection; |
using Volo.Abp.DependencyInjection; |
||||
|
using Volo.Abp.Http.Client; |
||||
using Volo.Abp.Http.Client.ClientProxying; |
using Volo.Abp.Http.Client.ClientProxying; |
||||
|
using Volo.Abp.Http.Modeling; |
||||
using Volo.CmsKit.Public.Ratings; |
using Volo.CmsKit.Public.Ratings; |
||||
using System.Collections.Generic; |
|
||||
|
|
||||
// ReSharper disable once CheckNamespace
|
// ReSharper disable once CheckNamespace
|
||||
namespace Volo.CmsKit.Public.Ratings.ClientProxies; |
namespace Volo.CmsKit.Public.Ratings; |
||||
|
|
||||
[Dependency(ReplaceServices = true)] |
[Dependency(ReplaceServices = true)] |
||||
[ExposeServices(typeof(IRatingPublicAppService), typeof(RatingPublicClientProxy))] |
[ExposeServices(typeof(IRatingPublicAppService), typeof(RatingPublicClientProxy))] |
||||
@ -1,6 +1,6 @@ |
|||||
// This file is part of RatingPublicClientProxy, you can customize it here
|
// This file is part of RatingPublicClientProxy, you can customize it here
|
||||
// ReSharper disable once CheckNamespace
|
// ReSharper disable once CheckNamespace
|
||||
namespace Volo.CmsKit.Public.Ratings.ClientProxies; |
namespace Volo.CmsKit.Public.Ratings; |
||||
|
|
||||
public partial class RatingPublicClientProxy |
public partial class RatingPublicClientProxy |
||||
{ |
{ |
||||
@ -1 +0,0 @@ |
|||||
{} |
|
||||
@ -1,34 +0,0 @@ |
|||||
using System.Threading.Tasks; |
|
||||
using Microsoft.AspNetCore.Authorization; |
|
||||
using Microsoft.AspNetCore.Mvc; |
|
||||
using Volo.Abp; |
|
||||
|
|
||||
namespace EShopOnAbp.CmskitService.Samples; |
|
||||
|
|
||||
[RemoteService(Name = CmskitServiceRemoteServiceConsts.RemoteServiceName)] |
|
||||
[Area("CmskitService")] |
|
||||
[ControllerName("CmskitService")] |
|
||||
[Route("api/CmskitService/sample")] |
|
||||
public class SampleController : CmskitServiceController, ISampleAppService |
|
||||
{ |
|
||||
private readonly ISampleAppService _sampleAppService; |
|
||||
|
|
||||
public SampleController(ISampleAppService sampleAppService) |
|
||||
{ |
|
||||
_sampleAppService = sampleAppService; |
|
||||
} |
|
||||
|
|
||||
[HttpGet] |
|
||||
public async Task<SampleDto> GetAsync() |
|
||||
{ |
|
||||
return await _sampleAppService.GetAsync(); |
|
||||
} |
|
||||
|
|
||||
[HttpGet] |
|
||||
[Route("authorized")] |
|
||||
[Authorize] |
|
||||
public async Task<SampleDto> GetAuthorizedAsync() |
|
||||
{ |
|
||||
return await _sampleAppService.GetAsync(); |
|
||||
} |
|
||||
} |
|
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue