updates to backend and 10.2.0.1

This commit is contained in:
Kim 2023-07-27 13:23:17 +02:00
parent c23149c5cc
commit 22e2561f14
10 changed files with 26 additions and 1183 deletions

View File

@ -9,7 +9,7 @@ namespace InnovEnergy.App.Backend;
using Token = String;
[ApiController]
[Controller]
[Route("api/")]
public class Controller : ControllerBase
{
@ -260,7 +260,7 @@ public class Controller : ControllerBase
}
[HttpPost(nameof(CreateInstallation))]
public async Task<ActionResult<Installation>> CreateInstallation(Installation installation, Token authToken)
public async Task<ActionResult<Installation>> CreateInstallation([FromBody]Installation installation, Token authToken)
{
var session = Db.GetSession(authToken);

View File

@ -7,7 +7,7 @@ namespace InnovEnergy.App.Backend.DataTypes.Methods;
public static class InstallationMethods
{
private const String BucketNameSalt = "3e5b3069-214a-43ee-8d85-57d72000c19d";
private const String BucketNameSalt = "3e5b3069-214a-43ee-8d85-57d72000c10d";
public static String BucketName(this Installation installation)
{
@ -37,7 +37,7 @@ public static class InstallationMethods
public static Task<Boolean> CreateBucket(this Installation installation)
{
return S3Access
.ReadWrite
.Admin
.CreateBucket(installation.BucketName());
}

View File

@ -0,0 +1,9 @@
<?xml version="1.0" ?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>HEAD</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>

View File

@ -1,4 +1,4 @@
{
"Key": "EXO1abcb772bf43ab72951ba1dc",
"Secret": "_ym1KsGBSp90S5dwhZn18XD-u9Y4ghHvyIxg5gv5fHw"
"Secret": "_ym1KsGBSp90S5dwhZn18XD-u9Y4ghHvyIxg5gv5fHw"
}

View File

@ -46,15 +46,7 @@ public class S3Cmd
public async Task<Boolean> CreateBucket(String bucketName)
{
var cors = @"<?xml version=""1.0"" ?>
<CORSConfiguration xmlns=""http://s3.amazonaws.com/doc/2006-03-01/"">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>HEAD</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>";
const String cors = "./Resources/CORS";
var result = await Run(bucketName, "mb");
var setCors = await Run(bucketName, "setcors", cors);
@ -91,8 +83,8 @@ public class S3Cmd
var args = credentials
.Append(operation)
.Append(bucketName.EnsureStartsWith(S3Prefix))
.Concat(optionalArgs);
.Concat(optionalArgs)
.Append(bucketName.EnsureStartsWith(S3Prefix));
return Python
.WithArguments(args)

View File

@ -24,7 +24,7 @@ public static class Program
app.MapControllers();
// app.MapGet("/", () => Controller.Index());
var webTask = app.RunAsync();
await Task.WhenAll(webTask, updateTask);
await Task.WhenAll(webTask);
}
private static OpenApiInfo OpenApiInfo { get; } = new OpenApiInfo

Binary file not shown.

View File

@ -79,6 +79,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IEM3kGridMeter", "Lib\Devic
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "S3Explorer", "App\S3Explorer\S3Explorer.csproj", "{EB56EF94-D8A7-4111-A8E7-A87EF13596DA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VrmGrabber", "App\VrmGrabber\VrmGrabber.csproj", "{88633C71-D701-49B3-A6DE-9D7CED9046E3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -202,6 +204,10 @@ Global
{EB56EF94-D8A7-4111-A8E7-A87EF13596DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB56EF94-D8A7-4111-A8E7-A87EF13596DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB56EF94-D8A7-4111-A8E7-A87EF13596DA}.Release|Any CPU.Build.0 = Release|Any CPU
{88633C71-D701-49B3-A6DE-9D7CED9046E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{88633C71-D701-49B3-A6DE-9D7CED9046E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{88633C71-D701-49B3-A6DE-9D7CED9046E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{88633C71-D701-49B3-A6DE-9D7CED9046E3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{CF4834CB-91B7-4172-AC13-ECDA8613CD17} = {145597B4-3E30-45E6-9F72-4DD43194539A}
@ -237,5 +243,6 @@ Global
{A3C79247-4CAA-44BE-921E-7285AB39E71F} = {4931A385-24DC-4E78-BFF4-356F8D6D5183}
{1391165D-51F1-45B4-8B7F-042A20AA0277} = {4931A385-24DC-4E78-BFF4-356F8D6D5183}
{EB56EF94-D8A7-4111-A8E7-A87EF13596DA} = {145597B4-3E30-45E6-9F72-4DD43194539A}
{88633C71-D701-49B3-A6DE-9D7CED9046E3} = {145597B4-3E30-45E6-9F72-4DD43194539A}
EndGlobalSection
EndGlobal

File diff suppressed because it is too large Load Diff

View File

@ -28,7 +28,7 @@ const S3CredentialsContextProvider = ({
const [s3Credentials, setS3Credentials] = useState<S3Credentials>();
const saveS3Credentials = (credentials: S3Credentials, id: string) => {
const s3Bucket = id + "-3e5b3069-214a-43ee-8d85-57d72000c19d";
const s3Bucket = id + "-3e5b3069-214a-43ee-8d85-57d72000c10d";
setS3Credentials({ s3Bucket, ...credentials });
/* setS3Credentials({
s3Region: "sos-ch-dk-2",