Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
e850f9746c
|
@ -1,6 +1,6 @@
|
|||
/typescript/Frontend/node_modules
|
||||
/typescript/Frontend/node_modules/*
|
||||
*/Debug/*
|
||||
*/Release/*
|
||||
*/db.sqlite
|
||||
*.fossil
|
||||
**/node_modules
|
||||
**/bin
|
||||
**/obj
|
||||
*.DotSettings.user
|
||||
**/.idea/workspace.xml
|
||||
**/.idea/tasks.xml
|
||||
|
|
|
@ -14,17 +14,5 @@
|
|||
</introspection-scope>
|
||||
</schema-mapping>
|
||||
</data-source>
|
||||
<data-source name="db [2]" uuid="90dbce14-c550-4450-973e-ce471278a4c1">
|
||||
<database-info product="SQLite" version="3.39.2" jdbc-version="2.1" driver-name="SQLite JDBC" driver-version="3.39.2.0" dbms="SQLITE" exact-version="3.39.2" exact-driver-version="3.39">
|
||||
<identifier-quote-string>"</identifier-quote-string>
|
||||
</database-info>
|
||||
<case-sensitivity plain-identifiers="mixed" quoted-identifiers="mixed" />
|
||||
<auth-provider>no-auth</auth-provider>
|
||||
<schema-mapping>
|
||||
<introspection-scope>
|
||||
<node kind="schema" qname="@" />
|
||||
</introspection-scope>
|
||||
</schema-mapping>
|
||||
</data-source>
|
||||
</component>
|
||||
</project>
|
|
@ -8,17 +8,5 @@
|
|||
<jdbc-url>jdbc:sqlite:$PROJECT_DIR$/app/Backend/db.sqlite</jdbc-url>
|
||||
<working-dir>$ProjectFileDir$</working-dir>
|
||||
</data-source>
|
||||
<data-source source="LOCAL" name="db [2]" uuid="90dbce14-c550-4450-973e-ce471278a4c1">
|
||||
<driver-ref>sqlite.xerial</driver-ref>
|
||||
<synchronize>true</synchronize>
|
||||
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
|
||||
<jdbc-url>jdbc:sqlite:$PROJECT_DIR$/app/Backend/db.sqlite-original</jdbc-url>
|
||||
<working-dir>$ProjectFileDir$</working-dir>
|
||||
<libraries>
|
||||
<library>
|
||||
<url>file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.39.2/sqlite-jdbc-3.39.2.jar</url>
|
||||
</library>
|
||||
</libraries>
|
||||
</data-source>
|
||||
</component>
|
||||
</project>
|
|
@ -1,7 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
File diff suppressed because it is too large
Load Diff
|
@ -87,6 +87,8 @@ EndProject
|
|||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FossilTui", "app/FossilTui/FossilTui.csproj", "{C40264BB-C834-4C48-9B3F-6BEF8F37C0ED}"
|
||||
EndProject
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Units", "lib\Units\Units.csproj", "{C04FB6DA-23C6-46BB-9B21-8F4FBA32FFF7}"
|
||||
EndProject
|
||||
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
@ -236,6 +238,10 @@ Global
|
|||
{C40264BB-C834-4C48-9B3F-6BEF8F37C0ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C40264BB-C834-4C48-9B3F-6BEF8F37C0ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C40264BB-C834-4C48-9B3F-6BEF8F37C0ED}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C04FB6DA-23C6-46BB-9B21-8F4FBA32FFF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C04FB6DA-23C6-46BB-9B21-8F4FBA32FFF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C04FB6DA-23C6-46BB-9B21-8F4FBA32FFF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C04FB6DA-23C6-46BB-9B21-8F4FBA32FFF7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{CF4834CB-91B7-4172-AC13-ECDA8613CD17} = {145597B4-3E30-45E6-9F72-4DD43194539A}
|
||||
|
@ -280,5 +286,6 @@ Global
|
|||
{A56F58C2-B265-435B-A985-53B4D6F49B1A} = {145597B4-3E30-45E6-9F72-4DD43194539A}
|
||||
{C40264BB-C834-4C48-9B3F-6BEF8F37C0ED} = {145597B4-3E30-45E6-9F72-4DD43194539A}
|
||||
{F162D50B-4B99-496D-8354-1FB68E992B2D} = {D846B46B-46FF-4EF7-9B9D-DDBEF9533C56}
|
||||
{C04FB6DA-23C6-46BB-9B21-8F4FBA32FFF7} = {AD5B98A8-AB7F-4DA2-B66D-5B4E63E7D854}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:String x:Key="/Default/CodeInspection/Highlighting/AnalysisEnabled/@EntryValue">VISIBLE_FILES</s:String>
|
||||
<s:String x:Key="/Default/Environment/Hierarchy/Build/BuildTool/CustomBuildToolPath/@EntryValue">/usr/lib/dotnet/sdk/6.0.113/MSBuild.dll</s:String>
|
||||
<s:String x:Key="/Default/Environment/Hierarchy/Build/BuildTool/DotNetCliExePath/@EntryValue">/usr/lib/dotnet/dotnet</s:String>
|
||||
<s:Boolean x:Key="/Default/Environment/Hierarchy/Build/BuildTool/RecentDotNetCliExePaths/=_002Fusr_002Fbin_002Fdotnet/@EntryIndexedValue">True</s:Boolean>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Innov/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
|
@ -1,486 +0,0 @@
|
|||
{
|
||||
"format": 1,
|
||||
"restore": {
|
||||
"/home/kim/code/innovenergy/new/csharp/app/API/API.csproj": {}
|
||||
},
|
||||
"projects": {
|
||||
"/home/kim/code/innovenergy/new/csharp/app/API/API.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "/home/kim/code/innovenergy/new/csharp/app/API/API.csproj",
|
||||
"projectName": "API",
|
||||
"projectPath": "/home/kim/code/innovenergy/new/csharp/app/API/API.csproj",
|
||||
"packagesPath": "/home/kim/.nuget/packages/",
|
||||
"outputPath": "/home/kim/code/innovenergy/new/csharp/app/API/obj/",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"/home/kim/.nuget/NuGet/NuGet.Config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net6.0"
|
||||
],
|
||||
"sources": {
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"projectReferences": {
|
||||
"/home/kim/code/innovenergy/new/csharp/app/OpenVpnCertificatesServer/OpenVpnCertificatesServer.csproj": {
|
||||
"projectPath": "/home/kim/code/innovenergy/new/csharp/app/OpenVpnCertificatesServer/OpenVpnCertificatesServer.csproj"
|
||||
},
|
||||
"/home/kim/code/innovenergy/new/csharp/lib/Utils/Utils.csproj": {
|
||||
"projectPath": "/home/kim/code/innovenergy/new/csharp/lib/Utils/Utils.csproj"
|
||||
},
|
||||
"/home/kim/code/innovenergy/new/csharp/lib/Victron/VictronVRM/VictronVRM.csproj": {
|
||||
"projectPath": "/home/kim/code/innovenergy/new/csharp/lib/Victron/VictronVRM/VictronVRM.csproj"
|
||||
},
|
||||
"/home/kim/code/innovenergy/new/csharp/lib/VictronVRM/VictronVRM.csproj": {
|
||||
"projectPath": "/home/kim/code/innovenergy/new/csharp/lib/VictronVRM/VictronVRM.csproj"
|
||||
},
|
||||
"/home/kim/code/innovenergy/new/csharp/lib/WebServer/WebServer.csproj": {
|
||||
"projectPath": "/home/kim/code/innovenergy/new/csharp/lib/WebServer/WebServer.csproj"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"dependencies": {
|
||||
"Newtonsoft.Json": {
|
||||
"target": "Package",
|
||||
"version": "[13.0.1, )"
|
||||
},
|
||||
"sqlite-net-pcl": {
|
||||
"target": "Package",
|
||||
"version": "[1.8.116, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "/usr/lib/dotnet/sdk/6.0.113/RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"/home/kim/code/innovenergy/new/csharp/app/OpenVpnCertificatesServer/OpenVpnCertificatesServer.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "/home/kim/code/innovenergy/new/csharp/app/OpenVpnCertificatesServer/OpenVpnCertificatesServer.csproj",
|
||||
"projectName": "OpenVpnCertificatesServer",
|
||||
"projectPath": "/home/kim/code/innovenergy/new/csharp/app/OpenVpnCertificatesServer/OpenVpnCertificatesServer.csproj",
|
||||
"packagesPath": "/home/kim/.nuget/packages/",
|
||||
"outputPath": "/home/kim/code/innovenergy/new/csharp/app/OpenVpnCertificatesServer/obj/",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"/home/kim/.nuget/NuGet/NuGet.Config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net6.0"
|
||||
],
|
||||
"sources": {
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"projectReferences": {
|
||||
"/home/kim/code/innovenergy/new/csharp/lib/Protocols/DBus/DBus.csproj": {
|
||||
"projectPath": "/home/kim/code/innovenergy/new/csharp/lib/Protocols/DBus/DBus.csproj"
|
||||
},
|
||||
"/home/kim/code/innovenergy/new/csharp/lib/Victron/VictronVRM/VictronVRM.csproj": {
|
||||
"projectPath": "/home/kim/code/innovenergy/new/csharp/lib/Victron/VictronVRM/VictronVRM.csproj"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"dependencies": {
|
||||
"BouncyCastle": {
|
||||
"target": "Package",
|
||||
"version": "[1.8.9, )"
|
||||
},
|
||||
"Flurl.Http": {
|
||||
"target": "Package",
|
||||
"version": "[3.2.2, )"
|
||||
},
|
||||
"SharpZipLib": {
|
||||
"target": "Package",
|
||||
"version": "[1.3.3, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "/usr/lib/dotnet/sdk/6.0.113/RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"/home/kim/code/innovenergy/new/csharp/lib/Protocols/DBus/DBus.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "/home/kim/code/innovenergy/new/csharp/lib/Protocols/DBus/DBus.csproj",
|
||||
"projectName": "InnovEnergy.Lib.Protocols.DBus",
|
||||
"projectPath": "/home/kim/code/innovenergy/new/csharp/lib/Protocols/DBus/DBus.csproj",
|
||||
"packagesPath": "/home/kim/.nuget/packages/",
|
||||
"outputPath": "/home/kim/code/innovenergy/new/csharp/lib/Protocols/DBus/obj/",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"/home/kim/.nuget/NuGet/NuGet.Config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net6.0"
|
||||
],
|
||||
"sources": {
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"dependencies": {
|
||||
"System.Reactive": {
|
||||
"target": "Package",
|
||||
"version": "[5.0.0, )"
|
||||
},
|
||||
"System.Reflection.Emit": {
|
||||
"target": "Package",
|
||||
"version": "[4.7.0, )"
|
||||
},
|
||||
"System.Security.Principal.Windows": {
|
||||
"target": "Package",
|
||||
"version": "[4.7.0, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "/usr/lib/dotnet/sdk/6.0.113/RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"/home/kim/code/innovenergy/new/csharp/lib/Time/Time.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "/home/kim/code/innovenergy/new/csharp/lib/Time/Time.csproj",
|
||||
"projectName": "Time",
|
||||
"projectPath": "/home/kim/code/innovenergy/new/csharp/lib/Time/Time.csproj",
|
||||
"packagesPath": "/home/kim/.nuget/packages/",
|
||||
"outputPath": "/home/kim/code/innovenergy/new/csharp/lib/Time/obj/",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"/home/kim/.nuget/NuGet/NuGet.Config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net6.0"
|
||||
],
|
||||
"sources": {
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "/usr/lib/dotnet/sdk/6.0.113/RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"/home/kim/code/innovenergy/new/csharp/lib/Utils/Utils.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "/home/kim/code/innovenergy/new/csharp/lib/Utils/Utils.csproj",
|
||||
"projectName": "Utils",
|
||||
"projectPath": "/home/kim/code/innovenergy/new/csharp/lib/Utils/Utils.csproj",
|
||||
"packagesPath": "/home/kim/.nuget/packages/",
|
||||
"outputPath": "/home/kim/code/innovenergy/new/csharp/lib/Utils/obj/",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"/home/kim/.nuget/NuGet/NuGet.Config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net6.0"
|
||||
],
|
||||
"sources": {
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"dependencies": {
|
||||
"CliWrap": {
|
||||
"target": "Package",
|
||||
"version": "[3.3.1, )"
|
||||
},
|
||||
"DecimalMath.DecimalEx": {
|
||||
"target": "Package",
|
||||
"version": "[1.0.2, )"
|
||||
},
|
||||
"System.Reactive.Linq": {
|
||||
"target": "Package",
|
||||
"version": "[5.0.0, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "/usr/lib/dotnet/sdk/6.0.113/RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"/home/kim/code/innovenergy/new/csharp/lib/Victron/VictronVRM/VictronVRM.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "/home/kim/code/innovenergy/new/csharp/lib/Victron/VictronVRM/VictronVRM.csproj",
|
||||
"projectName": "VictronVRM",
|
||||
"projectPath": "/home/kim/code/innovenergy/new/csharp/lib/Victron/VictronVRM/VictronVRM.csproj",
|
||||
"packagesPath": "/home/kim/.nuget/packages/",
|
||||
"outputPath": "/home/kim/code/innovenergy/new/csharp/lib/Victron/VictronVRM/obj/",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"/home/kim/.nuget/NuGet/NuGet.Config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net6.0"
|
||||
],
|
||||
"sources": {
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"projectReferences": {
|
||||
"/home/kim/code/innovenergy/new/csharp/lib/Time/Time.csproj": {
|
||||
"projectPath": "/home/kim/code/innovenergy/new/csharp/lib/Time/Time.csproj"
|
||||
},
|
||||
"/home/kim/code/innovenergy/new/csharp/lib/Utils/Utils.csproj": {
|
||||
"projectPath": "/home/kim/code/innovenergy/new/csharp/lib/Utils/Utils.csproj"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"dependencies": {
|
||||
"Flurl.Http": {
|
||||
"target": "Package",
|
||||
"version": "[3.2.0, )"
|
||||
},
|
||||
"System.Reactive.Linq": {
|
||||
"target": "Package",
|
||||
"version": "[5.0.0, )"
|
||||
},
|
||||
"System.Text.Json": {
|
||||
"target": "Package",
|
||||
"version": "[6.0.2, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "/usr/lib/dotnet/sdk/6.0.113/RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"/home/kim/code/innovenergy/new/csharp/lib/WebServer/WebServer.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "/home/kim/code/innovenergy/new/csharp/lib/WebServer/WebServer.csproj",
|
||||
"projectName": "WebServer",
|
||||
"projectPath": "/home/kim/code/innovenergy/new/csharp/lib/WebServer/WebServer.csproj",
|
||||
"packagesPath": "/home/kim/.nuget/packages/",
|
||||
"outputPath": "/home/kim/code/innovenergy/new/csharp/lib/WebServer/obj/",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"/home/kim/.nuget/NuGet/NuGet.Config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net6.0"
|
||||
],
|
||||
"sources": {
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"projectReferences": {
|
||||
"/home/kim/code/innovenergy/new/csharp/lib/Utils/Utils.csproj": {
|
||||
"projectPath": "/home/kim/code/innovenergy/new/csharp/lib/Utils/Utils.csproj"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"dependencies": {
|
||||
"Flurl": {
|
||||
"target": "Package",
|
||||
"version": "[3.0.1, )"
|
||||
},
|
||||
"Flurl.Http": {
|
||||
"target": "Package",
|
||||
"version": "[3.0.1, )"
|
||||
},
|
||||
"System.Reactive.Linq": {
|
||||
"target": "Package",
|
||||
"version": "[5.0.0, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "/usr/lib/dotnet/sdk/6.0.113/RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">False</RestoreSuccess>
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/home/kim/.nuget/packages/</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/home/kim/.nuget/packages/</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.4.0</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="/home/kim/.nuget/packages/" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,13 +0,0 @@
|
|||
is_global = true
|
||||
build_property.TargetFramework = net6.0
|
||||
build_property.TargetPlatformMinVersion =
|
||||
build_property.UsingMicrosoftNETSdkWeb =
|
||||
build_property.ProjectTypeGuids =
|
||||
build_property.InvariantGlobalization = true
|
||||
build_property.PlatformNeutralAssembly =
|
||||
build_property._SupportedPlatformList = Linux,macOS,Windows
|
||||
build_property.EnableSingleFileAnalyzer =
|
||||
build_property.EnableTrimAnalyzer = true
|
||||
build_property.IncludeAllContentForSelfExtract =
|
||||
build_property.RootNamespace = InnovEnergy.API
|
||||
build_property.ProjectDir = /home/kim/code/innovenergy/new/csharp/app/API/
|
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -1,52 +0,0 @@
|
|||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "txRMsA4BjmCk2iCx9W46PczSZ0GaJCkNKOobx6SK/uzt2sbt/jTboM3Q07JADBWy8hPwfpZqspriY8zteLQAzw==",
|
||||
"success": false,
|
||||
"projectFilePath": "/home/kim/code/innovenergy/new/csharp/app/API/API.csproj",
|
||||
"expectedPackageFiles": [
|
||||
"/home/kim/.nuget/packages/bouncycastle/1.8.9/bouncycastle.1.8.9.nupkg.sha512",
|
||||
"/home/kim/.nuget/packages/cliwrap/3.3.1/cliwrap.3.3.1.nupkg.sha512",
|
||||
"/home/kim/.nuget/packages/decimalmath.decimalex/1.0.2/decimalmath.decimalex.1.0.2.nupkg.sha512",
|
||||
"/home/kim/.nuget/packages/flurl/3.0.4/flurl.3.0.4.nupkg.sha512",
|
||||
"/home/kim/.nuget/packages/flurl.http/3.2.2/flurl.http.3.2.2.nupkg.sha512",
|
||||
"/home/kim/.nuget/packages/microsoft.netcore.platforms/2.1.2/microsoft.netcore.platforms.2.1.2.nupkg.sha512",
|
||||
"/home/kim/.nuget/packages/newtonsoft.json/13.0.1/newtonsoft.json.13.0.1.nupkg.sha512",
|
||||
"/home/kim/.nuget/packages/sharpziplib/1.3.3/sharpziplib.1.3.3.nupkg.sha512",
|
||||
"/home/kim/.nuget/packages/sqlite-net-pcl/1.8.116/sqlite-net-pcl.1.8.116.nupkg.sha512",
|
||||
"/home/kim/.nuget/packages/sqlitepclraw.bundle_green/2.0.4/sqlitepclraw.bundle_green.2.0.4.nupkg.sha512",
|
||||
"/home/kim/.nuget/packages/sqlitepclraw.core/2.0.4/sqlitepclraw.core.2.0.4.nupkg.sha512",
|
||||
"/home/kim/.nuget/packages/sqlitepclraw.lib.e_sqlite3/2.0.4/sqlitepclraw.lib.e_sqlite3.2.0.4.nupkg.sha512",
|
||||
"/home/kim/.nuget/packages/sqlitepclraw.provider.dynamic_cdecl/2.0.4/sqlitepclraw.provider.dynamic_cdecl.2.0.4.nupkg.sha512",
|
||||
"/home/kim/.nuget/packages/system.memory/4.5.3/system.memory.4.5.3.nupkg.sha512",
|
||||
"/home/kim/.nuget/packages/system.reactive/5.0.0/system.reactive.5.0.0.nupkg.sha512",
|
||||
"/home/kim/.nuget/packages/system.reactive.linq/5.0.0/system.reactive.linq.5.0.0.nupkg.sha512",
|
||||
"/home/kim/.nuget/packages/system.reflection.emit/4.7.0/system.reflection.emit.4.7.0.nupkg.sha512",
|
||||
"/home/kim/.nuget/packages/system.runtime.compilerservices.unsafe/6.0.0/system.runtime.compilerservices.unsafe.6.0.0.nupkg.sha512",
|
||||
"/home/kim/.nuget/packages/system.security.principal.windows/4.7.0/system.security.principal.windows.4.7.0.nupkg.sha512",
|
||||
"/home/kim/.nuget/packages/system.text.encoding.codepages/4.5.1/system.text.encoding.codepages.4.5.1.nupkg.sha512",
|
||||
"/home/kim/.nuget/packages/system.text.encodings.web/6.0.0/system.text.encodings.web.6.0.0.nupkg.sha512",
|
||||
"/home/kim/.nuget/packages/system.text.json/6.0.2/system.text.json.6.0.2.nupkg.sha512",
|
||||
"/home/kim/.nuget/packages/system.threading.tasks.extensions/4.5.4/system.threading.tasks.extensions.4.5.4.nupkg.sha512"
|
||||
],
|
||||
"logs": [
|
||||
{
|
||||
"code": "NU1104",
|
||||
"level": "Error",
|
||||
"message": "Unable to find project '/home/kim/code/innovenergy/new/csharp/lib/VictronVRM/VictronVRM.csproj'. Check that the project reference is valid and that the project file exists.",
|
||||
"libraryId": "/home/kim/code/innovenergy/new/csharp/lib/VictronVRM/VictronVRM.csproj",
|
||||
"targetGraphs": [
|
||||
"net6.0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"code": "NU1701",
|
||||
"level": "Warning",
|
||||
"warningLevel": 1,
|
||||
"message": "Package 'BouncyCastle 1.8.9' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework 'net6.0'. This package may not be fully compatible with your project.",
|
||||
"libraryId": "BouncyCastle",
|
||||
"targetGraphs": [
|
||||
"net6.0"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
"restore":{"projectUniqueName":"/home/kim/code/innovenergy/new/csharp/app/API/API.csproj","projectName":"API","projectPath":"/home/kim/code/innovenergy/new/csharp/app/API/API.csproj","outputPath":"/home/kim/code/innovenergy/new/csharp/app/API/obj/","projectStyle":"PackageReference","originalTargetFrameworks":["net6.0"],"sources":{"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net6.0":{"targetAlias":"net6.0","projectReferences":{"/home/kim/code/innovenergy/new/csharp/app/OpenVpnCertificatesServer/OpenVpnCertificatesServer.csproj":{"projectPath":"/home/kim/code/innovenergy/new/csharp/app/OpenVpnCertificatesServer/OpenVpnCertificatesServer.csproj"},"/home/kim/code/innovenergy/new/csharp/lib/Utils/Utils.csproj":{"projectPath":"/home/kim/code/innovenergy/new/csharp/lib/Utils/Utils.csproj"},"/home/kim/code/innovenergy/new/csharp/lib/Victron/VictronVRM/VictronVRM.csproj":{"projectPath":"/home/kim/code/innovenergy/new/csharp/lib/Victron/VictronVRM/VictronVRM.csproj"},"/home/kim/code/innovenergy/new/csharp/lib/VictronVRM/VictronVRM.csproj":{"projectPath":"/home/kim/code/innovenergy/new/csharp/lib/VictronVRM/VictronVRM.csproj"},"/home/kim/code/innovenergy/new/csharp/lib/WebServer/WebServer.csproj":{"projectPath":"/home/kim/code/innovenergy/new/csharp/lib/WebServer/WebServer.csproj"}}}},"warningProperties":{"warnAsError":["NU1605"]}}"frameworks":{"net6.0":{"targetAlias":"net6.0","dependencies":{"Newtonsoft.Json":{"target":"Package","version":"[13.0.1, )"},"sqlite-net-pcl":{"target":"Package","version":"[1.8.116, )"}},"imports":["net461","net462","net47","net471","net472","net48"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"/usr/lib/dotnet/sdk/6.0.113/RuntimeIdentifierGraph.json"}}
|
|
@ -1 +0,0 @@
|
|||
16769731911267901
|
|
@ -6,10 +6,10 @@ using Backend.Model;
|
|||
using Backend.Model.Relations;
|
||||
using Backend.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using HttpContextAccessor = Microsoft.AspNetCore.Http.HttpContextAccessor;
|
||||
|
||||
namespace Backend.Controllers;
|
||||
|
||||
|
||||
[ApiController]
|
||||
[Route("api/")]
|
||||
public class Controller
|
||||
|
@ -17,31 +17,35 @@ public class Controller
|
|||
[ProducesResponseType(200)]
|
||||
[ProducesResponseType(401)]
|
||||
[HttpPost($"{nameof(Login)}")]
|
||||
public Object Login(JsonElement usernamepass)
|
||||
public Object Login(Credentials credentials)
|
||||
{
|
||||
usernamepass.TryGetProperty("username", out var usr);
|
||||
usernamepass.TryGetProperty("password", out var pwd);
|
||||
var username = usr.ToString();
|
||||
var password = pwd.ToString();
|
||||
|
||||
if (username is null || username == "" || password == "" || password is null)
|
||||
if (String.IsNullOrWhiteSpace(credentials.Username) ||
|
||||
String.IsNullOrWhiteSpace(credentials.Password))
|
||||
return new HttpResponseMessage(HttpStatusCode.BadRequest);
|
||||
|
||||
using var db = Db.Connect();
|
||||
var user = db.GetUserByEmail(username);
|
||||
var user = db.GetUserByEmail(credentials.Username);
|
||||
|
||||
var hashedPassword = Crypto.ComputeHash(Encoding.UTF8.GetBytes(password),
|
||||
Encoding.UTF8.GetBytes(user.Salt + "innovEnergy"));
|
||||
|
||||
//Same error as to not communicate if a user exists or not
|
||||
if (user is null || user.Password != hashedPassword)
|
||||
if (user is null)
|
||||
return new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
||||
|
||||
// if (!VerifyPassword(password, user))
|
||||
// return new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
||||
|
||||
var ses = new Session(user);
|
||||
db.NewSession(ses);
|
||||
return ses.Token;
|
||||
}
|
||||
|
||||
private static Boolean VerifyPassword(String password, User user)
|
||||
{
|
||||
var pwdBytes = Encoding.UTF8.GetBytes(password);
|
||||
var saltBytes = Encoding.UTF8.GetBytes(user.Salt + "innovEnergy");
|
||||
var pwdHash = Crypto.ComputeHash(pwdBytes, saltBytes);
|
||||
|
||||
return user.Password == pwdHash;
|
||||
}
|
||||
|
||||
[ProducesResponseType(200)]
|
||||
[ProducesResponseType(401)]
|
||||
[HttpPost($"{nameof(Logout)}")]
|
||||
|
@ -72,7 +76,7 @@ public class Controller
|
|||
}
|
||||
|
||||
|
||||
[ProducesResponseType(200)]
|
||||
[ProducesResponseType(typeof(User), 200)]
|
||||
[ProducesResponseType(401)]
|
||||
[HttpGet($"{nameof(GetUserById)}")]
|
||||
public Object GetUserById(Int64 id)
|
||||
|
@ -90,7 +94,7 @@ public class Controller
|
|||
return viewedUser;
|
||||
}
|
||||
|
||||
[ProducesResponseType(200)]
|
||||
[ProducesResponseType(typeof(Installation), 200)]
|
||||
[ProducesResponseType(401)]
|
||||
[HttpGet($"{nameof(GetInstallationById)}")]
|
||||
public Object GetInstallationById(Int64 id)
|
||||
|
@ -99,17 +103,21 @@ public class Controller
|
|||
var ctx = ctxAccessor.HttpContext;
|
||||
using var db = Db.Connect();
|
||||
var currentUser = (User)ctx.Items["User"];
|
||||
var installation = db.GetInstallationById(id);
|
||||
|
||||
if(currentUser==null
|
||||
|| db.GetAllAccessibleInstallationIds(currentUser).ToList().Contains(id))
|
||||
return installation == null ? new HttpResponseMessage(HttpStatusCode.NotFound)
|
||||
: installation;
|
||||
if (currentUser == null)
|
||||
return new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
||||
|
||||
return new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
||||
var installation = db
|
||||
.GetAllAccessibleInstallations(currentUser)
|
||||
.FirstOrDefault(i => i.Id == id);
|
||||
|
||||
if (installation is null)
|
||||
return new HttpResponseMessage(HttpStatusCode.NotFound);
|
||||
|
||||
return installation;
|
||||
}
|
||||
|
||||
[ProducesResponseType(200)]
|
||||
[ProducesResponseType(typeof(Folder), 200)]
|
||||
[ProducesResponseType(401)]
|
||||
[HttpGet($"{nameof(GetFolderById)}")]
|
||||
public Object GetFolderById(Int64 id)
|
||||
|
@ -118,14 +126,15 @@ public class Controller
|
|||
var ctx = ctxAccessor.HttpContext;
|
||||
using var db = Db.Connect();
|
||||
var currentUser = (User)ctx.Items["User"];
|
||||
var folder = db.GetFolderById(id);
|
||||
|
||||
if(currentUser==null
|
||||
|| db.GetAllAccessibleFolderIds(currentUser).ToList().Contains(id))
|
||||
return folder == null ? new HttpResponseMessage(HttpStatusCode.NotFound)
|
||||
: folder;
|
||||
var folder = db
|
||||
.GetAllAccessibleFolders(currentUser!)
|
||||
.FirstOrDefault(f => f.Id == id);
|
||||
|
||||
return new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
||||
if(folder is null)
|
||||
return new HttpResponseMessage(HttpStatusCode.NotFound);
|
||||
|
||||
return folder;
|
||||
}
|
||||
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -138,9 +147,10 @@ public class Controller
|
|||
using var db = Db.Connect();
|
||||
var user = (User)ctx.Items["User"];
|
||||
|
||||
if (user != null) return db.GetAllAccessibleInstallations(user).ToList();
|
||||
if (user == null)
|
||||
return new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
||||
|
||||
return new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
||||
return db.GetAllAccessibleInstallations(user).ToList();
|
||||
}
|
||||
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -149,13 +159,15 @@ public class Controller
|
|||
public Object GetAllFolders()
|
||||
{
|
||||
var ctxAccessor = new HttpContextAccessor();
|
||||
var ctx = ctxAccessor.HttpContext;
|
||||
using var db = Db.Connect();
|
||||
var ctx = ctxAccessor.HttpContext;
|
||||
var user = (User)ctx.Items["User"];
|
||||
|
||||
if (user != null) return db.GetAllAccessibleFolders(user).ToList();
|
||||
using var db = Db.Connect();
|
||||
|
||||
return new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
||||
if (user == null)
|
||||
return new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
||||
|
||||
return db.GetAllAccessibleFolders(user).ToList();
|
||||
}
|
||||
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -181,21 +193,26 @@ public class Controller
|
|||
{
|
||||
var ctxAccessor = new HttpContextAccessor();
|
||||
var ctx = ctxAccessor.HttpContext;
|
||||
using var db = Db.Connect();
|
||||
|
||||
var currentUser = (User)ctx.Items["User"];
|
||||
|
||||
if (currentUser == null || !currentUser.HasWriteAccess)
|
||||
return new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
||||
|
||||
if(db.GetAllAccessibleInstallationIds(currentUser).ToList().Contains(updatedInstallation.Id))
|
||||
return db.GetInstallationById(updatedInstallation.Id) == null
|
||||
? new HttpResponseMessage(HttpStatusCode.Unauthorized)
|
||||
: db.UpdateInstallation(updatedInstallation);
|
||||
using var db = Db.Connect();
|
||||
|
||||
db.AddToAccessibleInstallations(currentUser.Id, updatedInstallation.Id);
|
||||
return db.CreateInstallation(updatedInstallation);
|
||||
var hasAccess = db.GetAllAccessibleInstallations(currentUser)
|
||||
.Any(i => i.Id == updatedInstallation.Id);
|
||||
if (!hasAccess)
|
||||
return new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
||||
|
||||
// TODO: accessibility by other users etc
|
||||
// TODO: sanity check changes
|
||||
|
||||
return db.UpdateInstallation(updatedInstallation);
|
||||
}
|
||||
|
||||
|
||||
[ProducesResponseType(200)]
|
||||
[ProducesResponseType(401)]
|
||||
[HttpPut($"{nameof(UpdateFolder)}/")]
|
||||
|
@ -209,13 +226,16 @@ public class Controller
|
|||
if (currentUser == null || !currentUser.HasWriteAccess)
|
||||
return new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
||||
|
||||
if(db.GetAllAccessibleFolderIds(currentUser).ToList().Contains(updatedFolder.Id))
|
||||
return db.GetFolderById(updatedFolder.Id) == null
|
||||
? new HttpResponseMessage(HttpStatusCode.Unauthorized)
|
||||
: db.UpdateFolder(updatedFolder);
|
||||
var hasAccess = db.GetAllAccessibleFolders(currentUser)
|
||||
.Any(f => f.Id == updatedFolder.Id);
|
||||
|
||||
db.AddToAccessibleFolders(currentUser.Id, updatedFolder.Id);
|
||||
return db.CreateFolder(updatedFolder);
|
||||
if (!hasAccess)
|
||||
return new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
||||
|
||||
// TODO: accessibility by other users etc
|
||||
// TODO: sanity check changes
|
||||
|
||||
return db.UpdateFolder(updatedFolder);
|
||||
}
|
||||
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -241,18 +261,18 @@ public class Controller
|
|||
[ProducesResponseType(200)]
|
||||
[ProducesResponseType(401)]
|
||||
[HttpDelete($"{nameof(DeleteInstallation)}/")]
|
||||
public Object DeleteInstallation(Int64 installationId)
|
||||
public Object DeleteInstallation(Int64 idOfInstallationToBeDeleted)
|
||||
{
|
||||
var ctxAccessor = new HttpContextAccessor();
|
||||
var ctx = ctxAccessor.HttpContext;
|
||||
using var db = Db.Connect();
|
||||
var currentUser = (User)ctx.Items["User"];
|
||||
var installationToBeDeleted = db.GetInstallationById(installationId);
|
||||
|
||||
if (currentUser == null
|
||||
|| installationToBeDeleted == null
|
||||
|| !currentUser.HasWriteAccess
|
||||
|| !db.GetAllAccessibleInstallationIds(currentUser).ToList().Contains(installationToBeDeleted.Id))
|
||||
var installationToBeDeleted = db
|
||||
.GetAllAccessibleInstallations(currentUser!)
|
||||
.FirstOrDefault(i => i.Id == idOfInstallationToBeDeleted);
|
||||
|
||||
if (installationToBeDeleted is null)
|
||||
return new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
||||
|
||||
return db.DeleteInstallation(installationToBeDeleted);
|
||||
|
@ -267,15 +287,15 @@ public class Controller
|
|||
var ctx = ctxAccessor.HttpContext;
|
||||
using var db = Db.Connect();
|
||||
var currentUser = (User)ctx.Items["User"];
|
||||
var folderToBeDeleted = db.GetFolderById(folderId);
|
||||
|
||||
if (currentUser == null
|
||||
|| folderToBeDeleted == null
|
||||
|| !currentUser.HasWriteAccess
|
||||
|| !db.GetAllAccessibleFolderIds(currentUser).ToList().Contains(folderToBeDeleted.Id))
|
||||
var folderToDelete = db
|
||||
.GetAllAccessibleFolders(currentUser!)
|
||||
.FirstOrDefault(f => f.Id == folderId);
|
||||
|
||||
if (folderToDelete is null)
|
||||
return new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
||||
|
||||
return db.DeleteFolder(folderToBeDeleted);
|
||||
return db.DeleteFolder(folderToDelete);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
namespace Backend.Controllers;
|
||||
|
||||
public record Credentials(String Username, String Password);
|
|
@ -97,15 +97,6 @@ public partial class Db : IDisposable
|
|||
return direct.Concat(fromFolders);
|
||||
}
|
||||
|
||||
public IEnumerable<Int64> GetAllAccessibleInstallationIds(User user)
|
||||
{
|
||||
var direct = GetDirectlyAccessibleInstallationIds(user);
|
||||
var fromFolders = GetAllAccessibleFolders(user)
|
||||
.SelectMany(GetChildInstallations)
|
||||
.Select(installation => installation.Id);
|
||||
|
||||
return direct.Concat(fromFolders);
|
||||
}
|
||||
|
||||
public IEnumerable<Folder> GetAllAccessibleFolders(User user)
|
||||
{
|
||||
|
@ -113,12 +104,6 @@ public partial class Db : IDisposable
|
|||
.SelectMany(GetDescendantFolders);
|
||||
}
|
||||
|
||||
public IEnumerable<Int64> GetAllAccessibleFolderIds(User user)
|
||||
{
|
||||
return GetDirectlyAccessibleFolders(user)
|
||||
.SelectMany(GetDescendantFolders)
|
||||
.Select(folder => folder.Id );
|
||||
}
|
||||
|
||||
public IEnumerable<Installation> GetDirectlyAccessibleInstallations(User user)
|
||||
{
|
||||
|
@ -129,14 +114,6 @@ public partial class Db : IDisposable
|
|||
.NotNull();
|
||||
}
|
||||
|
||||
public IEnumerable<Int64> GetDirectlyAccessibleInstallationIds(User user)
|
||||
{
|
||||
return User2Installation
|
||||
.Where(r => r.UserId == user.Id)
|
||||
.Select(r => r.InstallationId)
|
||||
.NotNull<Int64>();
|
||||
}
|
||||
|
||||
public IEnumerable<Folder> GetDirectlyAccessibleFolders(User user)
|
||||
{
|
||||
return User2Folder
|
||||
|
@ -148,9 +125,11 @@ public partial class Db : IDisposable
|
|||
|
||||
public Result AddToAccessibleInstallations(Int64 userId, Int64 updatedInstallationId)
|
||||
{
|
||||
var con = new User2Installation();
|
||||
con.UserId = userId;
|
||||
con.InstallationId = updatedInstallationId;
|
||||
var con = new User2Installation
|
||||
{
|
||||
UserId = userId,
|
||||
InstallationId = updatedInstallationId
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -166,9 +145,11 @@ public partial class Db : IDisposable
|
|||
|
||||
public Result AddToAccessibleFolders(Int64 userId, Int64 updatedFolderId)
|
||||
{
|
||||
var con = new User2Folder();
|
||||
con.UserId = userId;
|
||||
con.FolderId = updatedFolderId;
|
||||
var con = new User2Folder
|
||||
{
|
||||
UserId = userId,
|
||||
FolderId = updatedFolderId
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -213,9 +194,7 @@ public partial class Db : IDisposable
|
|||
{
|
||||
try
|
||||
{
|
||||
Sessions
|
||||
.Where(u => u.UserId == id)
|
||||
.Delete();
|
||||
Sessions.Delete(u => u.UserId == id);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
@ -65,9 +65,10 @@ public partial class Db
|
|||
_Db.Delete(uf);
|
||||
|
||||
var nFolders = NbFolders;
|
||||
var nUsers = NbUsers;
|
||||
|
||||
foreach (var user in Users)
|
||||
while (Random.Shared.Next(5) != 0)
|
||||
while (Random.Shared.Next((Int32)(nUsers - user.Id + 1)) != 0)
|
||||
{
|
||||
var relation = new User2Folder
|
||||
{
|
||||
|
|
|
@ -21,19 +21,20 @@ public partial class Db
|
|||
//return PopulateDescendants(folder);
|
||||
}
|
||||
|
||||
public IEnumerable<Folder> GetChildFolders(Folder folder)
|
||||
public IEnumerable<Folder> GetChildFolders(Folder parent)
|
||||
{
|
||||
return Folders.Where(f => f.ParentId == f.Id);
|
||||
return Folders.Where(f => f.ParentId == parent.Id);
|
||||
}
|
||||
|
||||
public IEnumerable<Folder> GetDescendantFolders(Folder folder)
|
||||
|
||||
public IEnumerable<Folder> GetDescendantFolders(Folder parent)
|
||||
{
|
||||
return folder.Traverse(GetChildFolders);
|
||||
return parent.Traverse(GetChildFolders);
|
||||
}
|
||||
|
||||
public IEnumerable<Installation> GetChildInstallations(Folder folder)
|
||||
public IEnumerable<Installation> GetChildInstallations(Folder parent)
|
||||
{
|
||||
return Installations.Where(f => f.ParentId == f.Id);
|
||||
return Installations.Where(f => f.ParentId == parent.Id);
|
||||
}
|
||||
|
||||
|
||||
|
@ -63,17 +64,13 @@ public partial class Db
|
|||
|
||||
public Result DeleteFolder(Folder folder)
|
||||
{
|
||||
// Delete direct children
|
||||
User2Folder .Delete(f => f.FolderId == folder.Id);
|
||||
Installations.Delete(i => i.ParentId == folder.Id);
|
||||
|
||||
User2Folder
|
||||
.Where(f => f.FolderId == folder.Id)
|
||||
.Delete();
|
||||
|
||||
// TODO: delete descendants? Here they are just adopted one level up
|
||||
foreach (var l in Installations
|
||||
.Where(i => i.ParentId == folder.Id))
|
||||
{
|
||||
ChangeParent(l, folder.ParentId);
|
||||
}
|
||||
// recursion
|
||||
Folders.Where(f => f.ParentId == folder.Id)
|
||||
.ForEach(DeleteFolder);
|
||||
|
||||
return Delete(folder);
|
||||
}
|
||||
|
|
|
@ -24,11 +24,10 @@ public partial class Db
|
|||
return Update(installation);
|
||||
}
|
||||
|
||||
|
||||
public Result DeleteInstallation(Installation installation)
|
||||
{
|
||||
User2Installation
|
||||
.Where(i => i.InstallationId == installation.Id)
|
||||
.Delete();
|
||||
User2Installation.Delete(i => i.InstallationId == installation.Id);
|
||||
|
||||
return Delete(installation);
|
||||
}
|
||||
|
|
|
@ -107,24 +107,24 @@ public partial class Db
|
|||
return Result.Error("User doesn't exist");
|
||||
|
||||
//Checking for unchangeable things
|
||||
user.Id = oldUser.Id;
|
||||
// TODO: depends on privileges of caller
|
||||
|
||||
user.Id = oldUser.Id;
|
||||
user.ParentId = oldUser.ParentId;
|
||||
user.Email = oldUser.Email;
|
||||
user.Email = oldUser.Email;
|
||||
|
||||
return Update(user);
|
||||
}
|
||||
|
||||
public Result DeleteUser(User user)
|
||||
{
|
||||
User2Folder
|
||||
.Where(u => u.UserId == user.Id)
|
||||
.Delete();
|
||||
User2Installation
|
||||
.Where(u => u.UserId == user.Id)
|
||||
.Delete();
|
||||
User2Folder .Delete(u => u.UserId == user.Id);
|
||||
User2Installation.Delete(u => u.UserId == user.Id);
|
||||
|
||||
//Todo check for orphaned Installations/Folders
|
||||
|
||||
// GetChildUsers()
|
||||
|
||||
return Delete(user);
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Backend.csproj Controllers/Controller.cs Controllers/DatabaseHandler.cs Models/Folder.cs Models/Installation.cs Models/Token.cs Models/User.cs Program.cs Properties/launchSettings.json ServerFunctions/RequestJsonGetters.cs ServerFunctions/ServerFunctions.cs appsettings.Development.json appsettings.json identifier.sqlite
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
"ConnectionString" : "Data Source=identifier.sqlite;"
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net6.0",
|
||||
"frameworks": [
|
||||
{
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "6.0.0"
|
||||
},
|
||||
{
|
||||
"name": "Microsoft.AspNetCore.App",
|
||||
"version": "6.0.0"
|
||||
}
|
||||
],
|
||||
"configProperties": {
|
||||
"System.GC.Server": true,
|
||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue