Merge branch 'beta' into 'main'

Beta

See merge request fabinfra/fabaccess/borepin!26
This commit is contained in:
TheJoKlLa 2021-09-25 15:09:39 +00:00
commit 040dedd428
71 changed files with 22463 additions and 4595 deletions

View File

@ -28,94 +28,105 @@ variables:
UWP_RELEASE_FOLDER: 'Borepin\Borepin.UWP\bin\x86\Release' UWP_RELEASE_FOLDER: 'Borepin\Borepin.UWP\bin\x86\Release'
TEST_FOLDER: 'Tests\bin\Release' TEST_FOLDER: 'Tests\bin\Release'
# DEPLOY_FOLDER: 'P:\Projects\YourApp\Builds' # DEPLOY_FOLDER: 'P:\Projects\YourApp\Builds'
NUGET_PATH: 'C:\NuGet\nuget.exe' NUGET_PATH: 'C:\ProgramData\chocolatey\bin\nuget.exe'
DOTNET_PATH: 'C:\Program Files\dotnet\dotnet.exe' DOTNET_PATH: 'C:\Program Files\dotnet\dotnet.exe'
MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\msbuild.exe' MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe'
NUNIT_PATH: 'C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe' NUNIT_PATH: 'C:\ProgramData\chocolatey\bin\nunit3-console.exe'
#stages: stages:
#- build - build
#- test - deploy
#- deploy
#build_base: build_base:
# stage: build stage: build
# tags: tags:
# - xamarin - xamarin
# - windows - windows
# only: # only:
# - tags # the build process will only be started by git tag commits # - tags # the build process will only be started by git tag commits
# script: script:
# - '& "$env:NUGET_PATH" restore' # restore Nuget dependencies - '& "$env:NUGET_PATH" restore' # restore Nuget dependencies
# - '& "$env:MSBUILD_PATH" /p:Configuration=Release /target:Borepin' # build the project - '& "$env:MSBUILD_PATH" /p:Configuration=Release /target:Restore /target:Borepin' # build the project
# artifacts: artifacts:
# expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on
# paths: paths:
# - '$env:LIB_RELEASE_FOLDER' # saving exe to copy to deploy folder - '$env:LIB_RELEASE_FOLDER' # saving exe to copy to deploy folder
# - '$env:TEST_FOLDER\' # saving entire Test project so NUnit can run tests # - '$env:TEST_FOLDER\' # saving entire Test project so NUnit can run tests
#build_UWP: build_UWP:
# stage: build needs:
# tags: - build_base
# - xamarin stage: build
# - windows tags:
- xamarin
- windows
# only: # only:
# - tags # the build process will only be started by git tag commits # - tags # the build process will only be started by git tag commits
# script: script:
# - '& "$env:NUGET_PATH" restore' # restore Nuget dependencies - '& "$env:NUGET_PATH" restore' # restore Nuget dependencies
# - '& "$env:MSBUILD_PATH" /p:Configuration=Debug /target:Borepin_UWP' # build the project - '& "$env:MSBUILD_PATH" /p:Configuration=Debug /target:Borepin_UWP' # build the project
# artifacts: # artifacts:
# expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on # expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on
# paths: # paths:
# - '$env:UWP_RELEASE_FOLDER' # saving exe to copy to deploy folder # - '$env:UWP_RELEASE_FOLDER' # saving exe to copy to deploy folder
# - '$env:TEST_FOLDER\' # saving entire Test project so NUnit can run tests # - '$env:TEST_FOLDER\' # saving entire Test project so NUnit can run tests
#build_Android: build_Android:
# stage: build needs:
# tags: - build_base
# - xamarin stage: build
# - windows tags:
- xamarin
- windows
# only: # only:
# - tags # the build process will only be started by git tag commits # - tags # the build process will only be started by git tag commits
# script: script:
# - '& "$env:NUGET_PATH" restore' # restore Nuget dependencies - '& "$env:NUGET_PATH" restore' # restore Nuget dependencies
# - '& "$env:MSBUILD_PATH" /p:Configuration=Release /target:Borepin_Android:PackageForAndroid /target:Borepin_Android:SignAndroidPackage' # build the project /p:AndroidKeyStore=True - '[System.IO.File]::WriteAllBytes("$(pwd)/fabaccess.keystore", [System.Convert]::FromBase64String($AndroidKeyStore))'
# artifacts: - '& "$env:MSBUILD_PATH" /p:Configuration=Release /target:Borepin_Android:PackageForAndroid /target:Borepin_Android:SignAndroidPackage /p:AndroidKeyStore="True" /p:AndroidSigningKeyStore="$(pwd)/fabaccess.keystore" /p:AndroidSigningKeyPass="$AndroidKeyStore_Password" /p:AndroidSigningKeyAlias="$AndroidKeyStore_ID" /p:AndroidSigningStorePass="$AndroidKeyStore_Password"' # build the project
# expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on - rm "$(pwd)/fabaccess.keystore"
# paths: artifacts:
# - Borepin/Borepin.Android/bin/Release/com.companyname.borepin-Signed.apk # saving apk to copy to deploy folder expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on
paths:
- Borepin/Borepin.Android/bin/Release/org.fab_infra.fabaccess-Signed.aab # saving apk to copy to deploy folder
- Borepin/Borepin.Android/bin/Release/
# - '$env:TEST_FOLDER\' # saving entire Test project so NUnit can run tests # - '$env:TEST_FOLDER\' # saving entire Test project so NUnit can run tests
#build_iOS: build_iOS:
# stage: build needs:
# tags: - build_base
# - macos stage: build
# # only: tags:
# # - tags # the build process will only be started by git tag commits - macos
# script: # only:
# - 'nuget restore' # restore Nuget dependencies # - tags # the build process will only be started by git tag commits
# - 'msbuild /t:Borepin_iOS /p:Configuration=Debug /p:Platform=iPhone /p:ArchiveOnBuild=true' # build the project /p:AndroidKeyStore=True script:
# artifacts: - 'nuget restore' # restore Nuget dependencies
# expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on - 'msbuild /t:Restore'
# paths: - 'msbuild /t:Borepin_iOS /p:Configuration=Debug /p:Platform=iPhone /p:ArchiveOnBuild=true /p:BuildIpa=true' # build the project /p:AndroidKeyStore=True
# - Borepin/Borepin.iOS/bin/iPhone/Debug/Borepin.ipa artifacts:
# - Borepin/Borepin.iOS/bin/iPhone/Debug/Borepin.app.dSYM expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on
# # - '$env:TEST_FOLDER\' # saving entire Test project so NUnit can run tests paths:
- Borepin/Borepin.iOS/bin/iPhone/Debug/Borepin.iOS.ipa
- Borepin/Borepin.iOS/bin/iPhone/Debug/
# - '$env:TEST_FOLDER\' # saving entire Test project so NUnit can run tests
#build_GTK: build_GTK:
# stage: build needs:
# image: registry.gitlab.com/fabinfra/gtk-sharp-build:latest - build_base
# tags: stage: build
# - docker image: registry.gitlab.com/fabinfra/gtk-sharp-build:latest
tags:
- docker
# only: # only:
# - tags # the build process will only be started by git tag commits # - tags # the build process will only be started by git tag commits
# script: script:
# - 'nuget restore' # restore Nuget dependencies - 'nuget restore' # restore Nuget dependencies
# - 'msbuild -t:Borepin_GTK' # build the project /p:AndroidKeyStore=True - 'msbuild -t:Borepin_GTK' # build the project /p:AndroidKeyStore=True
# artifacts: artifacts:
# expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on
# paths: paths:
# - Borepin/Borepin.GTK/bin/Debug/ - Borepin/Borepin.GTK/bin/Debug/
# test_job: # test_job:
# stage: test # stage: test
@ -134,22 +145,69 @@ variables:
# dependencies: # dependencies:
# - build_job # - build_job
# deploy_job: deploy_Android_alpha:
# stage: deploy variables:
# only: LC_ALL: 'en_US.UTF-8'
# - tags LANG: 'en_US.UTF-8'
# script: only:
# # Compose a folder for each release based on commit tag. - alpha
# # Assuming your tag is Rev1.0.0.1, and your last commit message is 'First commit' needs:
# # the artifact files will be copied to: - build_Android
# # P:\Projects\YourApp\Builds\Rev1.0.0.1 - First commit\ stage: deploy
# - '$commitSubject = git log -1 --pretty=%s' image: registry.gitlab.com/fabinfra/gtk-sharp-build:latest
# - '$deployFolder = $($env:DEPLOY_FOLDER) + "\" + $($env:CI_BUILD_TAG) + " - " + $commitSubject + "\"' tags:
- docker
before_script:
- 'echo $play_store_credentials > play-store-credentials.json'
script:
- 'bundle install'
- 'bundle exec fastlane supply --aab Borepin/Borepin.Android/bin/Release/org.fab_infra.fabaccess-Signed.aab --track internal'
after_script:
- 'rm play-store-credentials.json'
dependencies:
- build_Android
# # xcopy takes care of recursively creating required folders deploy_Android_beta:
# - 'xcopy /y ".\$env:EXE_RELEASE_FOLDER\YourApp.exe" "$deployFolder"' variables:
# - 'xcopy /y ".\$env:MSI_RELEASE_FOLDER\YourApp Setup.msi" "$deployFolder"' LC_ALL: 'en_US.UTF-8'
# - 'xcopy /y ".\TestResult.xml" "$deployFolder"' LANG: 'en_US.UTF-8'
# dependencies: only:
# - build_job - beta
# - test_job needs:
- build_Android
stage: deploy
image: registry.gitlab.com/fabinfra/gtk-sharp-build:latest
tags:
- docker
before_script:
- 'echo $play_store_credentials > play-store-credentials.json'
script:
- 'bundle install'
- 'bundle exec fastlane supply --aab Borepin/Borepin.Android/bin/Release/org.fab_infra.fabaccess-Signed.aab --track beta'
after_script:
- 'rm play-store-credentials.json'
dependencies:
- build_Android
deploy_iOS:
variables:
LC_ALL: 'en_US.UTF-8'
LANG: 'en_US.UTF-8'
only:
- alpha
- feature/fastlane
needs:
- build_iOS
stage: deploy
tags:
- macos
before_script:
- 'echo $app_store_credentials > app-store-credentials.json'
- 'export PATH="/usr/local/opt/ruby/bin:$PATH"'
script:
- 'bundle install'
- 'bundle exec fastlane pilot upload --api_key_path app-store-credentials.json --ipa Borepin/Borepin.iOS/bin/iPhone/Debug/Borepin.iOS.ipa'
after_script:
- 'rm app-store-credentials.json'
dependencies:
- build_iOS

12
.gitmodules vendored
View File

@ -1,9 +1,15 @@
[submodule "FabAccessAPI/schema"]
path = FabAccessAPI/schema
url = https://gitlab.com/fabinfra/fabaccess/fabaccess-api.git
[submodule "external/SASL"] [submodule "external/SASL"]
path = external/SASL path = external/SASL
url = https://github.com/kjkriegel/S22.Sasl.git url = https://github.com/kjkriegel/S22.Sasl.git
branch = main
[submodule "external/NFC"] [submodule "external/NFC"]
path = external/NFC path = external/NFC
url = https://gitlab.com/fabinfra/fabaccess/nfc.git url = https://gitlab.com/fabinfra/fabaccess/nfc.git
branch = main
[submodule "FabAccessAPI/schema"]
path = FabAccessAPI/schema
url = https://gitlab.com/fabinfra/fabaccess/fabaccess-api.git
branch = main
[submodule "external/capnproto-dotnetcore"]
path = external/capnproto-dotnetcore
url = https://github.com/FabInfra/capnproto-dotnetcore_Runtime.git

View File

@ -23,6 +23,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FabAccessAPI_Test", "FabAcc
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NFC", "external\NFC\NFC\NFC.csproj", "{D53A98E8-48B5-4DCE-A98E-4623EE746E16}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NFC", "external\NFC\NFC\NFC.csproj", "{D53A98E8-48B5-4DCE-A98E-4623EE746E16}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Capnp.Net.Runtime", "external\capnproto-dotnetcore\Capnp.Net.Runtime\Capnp.Net.Runtime.csproj", "{C587AAC3-50A7-4871-A50D-7880B6F24EF6}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -327,6 +329,30 @@ Global
{D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Release|x64.Build.0 = Release|Any CPU {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Release|x64.Build.0 = Release|Any CPU
{D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Release|x86.ActiveCfg = Release|Any CPU {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Release|x86.ActiveCfg = Release|Any CPU
{D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Release|x86.Build.0 = Release|Any CPU {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Release|x86.Build.0 = Release|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|ARM.ActiveCfg = Debug|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|ARM.Build.0 = Debug|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|iPhone.Build.0 = Debug|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|x64.ActiveCfg = Debug|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|x64.Build.0 = Debug|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|x86.ActiveCfg = Debug|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|x86.Build.0 = Debug|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|Any CPU.Build.0 = Release|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|ARM.ActiveCfg = Release|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|ARM.Build.0 = Release|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|iPhone.ActiveCfg = Release|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|iPhone.Build.0 = Release|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|x64.ActiveCfg = Release|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|x64.Build.0 = Release|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|x86.ActiveCfg = Release|Any CPU
{C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

BIN
Borepin/.DS_Store vendored Normal file

Binary file not shown.

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -16,7 +16,7 @@
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest> <AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix> <MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix> <MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion> <TargetFrameworkVersion>v11.0</TargetFrameworkVersion>
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent> <AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
<AndroidUseAapt2>true</AndroidUseAapt2> <AndroidUseAapt2>true</AndroidUseAapt2>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType> <AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
@ -49,7 +49,9 @@
</AndroidSigningKeyStore> </AndroidSigningKeyStore>
<AndroidSigningStorePass> <AndroidSigningStorePass>
</AndroidSigningStorePass> </AndroidSigningStorePass>
<AndroidCreatePackagePerAbi>true</AndroidCreatePackagePerAbi> <AndroidCreatePackagePerAbi>false</AndroidCreatePackagePerAbi>
<AndroidPackageFormat>aab</AndroidPackageFormat>
<AndroidUseAapt2>true</AndroidUseAapt2>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Mono.Android" /> <Reference Include="Mono.Android" />
@ -62,10 +64,10 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Prism.DryIoc.Forms"> <PackageReference Include="Prism.DryIoc.Forms">
<Version>7.2.0.1422</Version> <Version>8.1.97</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" /> <PackageReference Include="Xamarin.Forms" Version="5.0.0.2125" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" /> <PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="MainActivity.cs" /> <Compile Include="MainActivity.cs" />
@ -170,10 +172,19 @@
<ItemGroup> <ItemGroup>
<AndroidResource Include="Resources\layout\Toolbar.xml" /> <AndroidResource Include="Resources\layout\Toolbar.xml" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\xml\network_security_config.xml">
<SubType>Designer</SubType>
</AndroidResource>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" /> <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<ProjectExtensions> <ProjectExtensions>
<VisualStudio> <VisualStudio>
<UserProperties TriggeredFromHotReload="False" /> <UserProperties TriggeredFromHotReload="False" />
</VisualStudio> </VisualStudio>
</ProjectExtensions> </ProjectExtensions>
</Project> <Target Name="BeforeBuild" Condition=" '$(GITLAB_CI)' == 'true' ">
<XmlPoke XmlInputPath="Properties\AndroidManifest.xml" Namespaces="&lt;Namespace Prefix='android' Uri='http://schemas.android.com/apk/res/android' /&gt;" Query="manifest/@android:versionCode" Value="$(CI_PIPELINE_ID)" />
<XmlPoke XmlInputPath="Properties\AndroidManifest.xml" Namespaces="&lt;Namespace Prefix='android' Uri='http://schemas.android.com/apk/res/android' /&gt;" Query="manifest/@android:versionName" Value="$(CI_COMMIT_SHORT_SHA)-$(CI_PIPELINE_ID)" />
</Target>
</Project>

View File

@ -2,6 +2,7 @@
using Android.App; using Android.App;
using Android.Content.PM; using Android.Content.PM;
using Android.OS; using Android.OS;
using AndroidX.AppCompat.App;
namespace Borepin.Droid namespace Borepin.Droid
{ {
@ -10,6 +11,8 @@ namespace Borepin.Droid
{ {
protected override void OnCreate(Bundle savedInstanceState) protected override void OnCreate(Bundle savedInstanceState)
{ {
AppCompatDelegate.DefaultNightMode = AppCompatDelegate.ModeNightNo;
TabLayoutResource = Resource.Layout.Tabbar; TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar; ToolbarResource = Resource.Layout.Toolbar;

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="org.fabinfra.fabaccess" android:installLocation="auto"> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="org.fab_infra.fabaccess" android:installLocation="auto">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" /> <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30" />
<application android:theme="@style/MainTheme" android:label="FabAccess"></application> <application android:theme="@style/MainTheme" android:label="FabAccess" android:networkSecurityConfig="@xml/network_security_config"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
</manifest> </manifest>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config>

View File

@ -1,6 +1,6 @@
using Android.App; using Android.App;
using Android.Support.V7.App;
using Android.Content; using Android.Content;
using AndroidX.AppCompat.App;
namespace Borepin.Droid namespace Borepin.Droid
{ {

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\Xamarin.Forms.5.0.0.2012\build\Xamarin.Forms.props" Condition="Exists('..\..\packages\Xamarin.Forms.5.0.0.2012\build\Xamarin.Forms.props')" /> <Import Project="..\..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.props" Condition="Exists('..\..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -42,8 +42,8 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\GtkSharp\2.12\lib\gtk-sharp-2.0\atk-sharp.dll</HintPath> <HintPath>..\..\..\..\..\..\..\Program Files (x86)\GtkSharp\2.12\lib\gtk-sharp-2.0\atk-sharp.dll</HintPath>
</Reference> </Reference>
<Reference Include="DryIoc, Version=4.5.1.0, Culture=neutral, PublicKeyToken=dfbf2bd50fcf7768, processorArchitecture=MSIL"> <Reference Include="DryIoc, Version=4.8.1.0, Culture=neutral, PublicKeyToken=dfbf2bd50fcf7768, processorArchitecture=MSIL">
<HintPath>..\..\packages\DryIoc.dll.4.5.1\lib\net45\DryIoc.dll</HintPath> <HintPath>..\..\packages\DryIoc.dll.4.8.1\lib\net45\DryIoc.dll</HintPath>
</Reference> </Reference>
<Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f, processorArchitecture=MSIL"> <Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
@ -72,14 +72,14 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\GtkSharp\2.12\lib\gtk-sharp-2.0\pango-sharp.dll</HintPath> <HintPath>..\..\..\..\..\..\..\Program Files (x86)\GtkSharp\2.12\lib\gtk-sharp-2.0\pango-sharp.dll</HintPath>
</Reference> </Reference>
<Reference Include="Prism, Version=8.0.0.1909, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL"> <Reference Include="Prism, Version=8.1.97.5141, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
<HintPath>..\..\packages\Prism.Core.8.0.0.1909\lib\net47\Prism.dll</HintPath> <HintPath>..\..\packages\Prism.Core.8.1.97\lib\net47\Prism.dll</HintPath>
</Reference> </Reference>
<Reference Include="Prism.DryIoc.Forms, Version=7.2.0.1422, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Prism.DryIoc.Forms, Version=8.1.97.5141, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Prism.DryIoc.Forms.7.2.0.1422\lib\netstandard2.0\Prism.DryIoc.Forms.dll</HintPath> <HintPath>..\..\packages\Prism.DryIoc.Forms.8.1.97\lib\netstandard2.0\Prism.DryIoc.Forms.dll</HintPath>
</Reference> </Reference>
<Reference Include="Prism.Forms, Version=7.2.0.1422, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Prism.Forms, Version=8.1.97.5141, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Prism.Forms.7.2.0.1422\lib\netstandard2.0\Prism.Forms.dll</HintPath> <HintPath>..\..\packages\Prism.Forms.8.1.97\lib\netstandard2.0\Prism.Forms.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@ -89,20 +89,20 @@
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="webkit-sharp, Version=1.1.15.0, Culture=neutral, PublicKeyToken=eaa1d335d2e19745, processorArchitecture=MSIL"> <Reference Include="Xamarin.Forms.Core">
<HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.5.0.0.2012\lib\net45\webkit-sharp.dll</HintPath> <HintPath>..\..\packages\Xamarin.Forms.5.0.0.2125\lib\netstandard2.0\Xamarin.Forms.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Xamarin.Forms.Platform">
<HintPath>..\..\packages\Xamarin.Forms.5.0.0.2012\lib\netstandard2.0\Xamarin.Forms.Core.dll</HintPath> <HintPath>..\..\packages\Xamarin.Forms.5.0.0.2125\lib\netstandard2.0\Xamarin.Forms.Platform.dll</HintPath>
</Reference> </Reference>
<Reference Include="Xamarin.Forms.Platform, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\..\packages\Xamarin.Forms.5.0.0.2012\lib\netstandard2.0\Xamarin.Forms.Platform.dll</HintPath> <HintPath>..\..\packages\Xamarin.Forms.5.0.0.2125\lib\netstandard2.0\Xamarin.Forms.Xaml.dll</HintPath>
</Reference> </Reference>
<Reference Include="Xamarin.Forms.Platform.GTK, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="webkit-sharp">
<HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.5.0.0.2012\lib\net45\Xamarin.Forms.Platform.GTK.dll</HintPath> <HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.5.0.0.2125\lib\net45\webkit-sharp.dll</HintPath>
</Reference> </Reference>
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Xamarin.Forms.Platform.GTK">
<HintPath>..\..\packages\Xamarin.Forms.5.0.0.2012\lib\netstandard2.0\Xamarin.Forms.Xaml.dll</HintPath> <HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.5.0.0.2125\lib\net45\Xamarin.Forms.Platform.GTK.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -123,12 +123,5 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Import Project="..\..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.targets')" />
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.5.0.0.2012\build\Xamarin.Forms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.5.0.0.2012\build\Xamarin.Forms.props'))" />
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.5.0.0.2012\build\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.5.0.0.2012\build\Xamarin.Forms.targets'))" />
</Target>
<Import Project="..\..\packages\Xamarin.Forms.5.0.0.2012\build\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.5.0.0.2012\build\Xamarin.Forms.targets')" />
</Project> </Project>

View File

@ -8,11 +8,11 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Prism" publicKeyToken="40ee6c3a2184dc59" culture="neutral" /> <assemblyIdentity name="Prism" publicKeyToken="40ee6c3a2184dc59" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1909" newVersion="8.0.0.1909" /> <bindingRedirect oldVersion="0.0.0.0-8.1.97.5141" newVersion="8.1.97.5141" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="DryIoc" publicKeyToken="dfbf2bd50fcf7768" culture="neutral" /> <assemblyIdentity name="DryIoc" publicKeyToken="dfbf2bd50fcf7768" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.5.1.0" newVersion="4.5.1.0" /> <bindingRedirect oldVersion="0.0.0.0-4.8.1.0" newVersion="4.8.1.0" />
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="DryIoc.dll" version="4.5.1" targetFramework="net48" /> <package id="DryIoc.dll" version="4.8.1" targetFramework="net48" />
<package id="OpenTK" version="3.2" targetFramework="net48" /> <package id="OpenTK" version="3.2" targetFramework="net48" />
<package id="Prism.Core" version="8.0.0.1909" targetFramework="net472" /> <package id="Prism.Core" version="8.1.97" targetFramework="net48" />
<package id="Prism.DryIoc.Forms" version="7.2.0.1422" targetFramework="net48" /> <package id="Prism.DryIoc.Forms" version="8.1.97" targetFramework="net48" />
<package id="Prism.Forms" version="7.2.0.1422" targetFramework="net48" /> <package id="Prism.Forms" version="8.1.97" targetFramework="net48" />
<package id="Xamarin.Forms" version="5.0.0.2012" targetFramework="net48" /> <package id="Xamarin.Forms" version="5.0.0.2125" targetFramework="net48" />
<package id="Xamarin.Forms.Platform.GTK" version="5.0.0.2012" targetFramework="net48" /> <package id="Xamarin.Forms.Platform.GTK" version="5.0.0.2125" targetFramework="net48" />
</packages> </packages>

View File

@ -2,6 +2,5 @@
x:Class="Borepin.UWP.App" x:Class="Borepin.UWP.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Borepin.UWP"> xmlns:local="using:Borepin.UWP" RequestedTheme="Light">
</Application> </Application>

View File

@ -9,15 +9,16 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Borepin.UWP</RootNamespace> <RootNamespace>Borepin.UWP</RootNamespace>
<AssemblyName>Borepin.UWP</AssemblyName> <AssemblyName>Borepin.UWP</AssemblyName>
<DefaultLanguage>en</DefaultLanguage> <DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier> <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion> <TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion> <TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion> <MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<EnableDotNetNativeCompatibleProfile>true</EnableDotNetNativeCompatibleProfile> <EnableDotNetNativeCompatibleProfile>true</EnableDotNetNativeCompatibleProfile>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled> <AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
<AppxBundlePlatforms>x86|x64|arm</AppxBundlePlatforms>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@ -175,11 +176,11 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Prism.DryIoc.Forms"> <PackageReference Include="Prism.DryIoc.Forms">
<Version>7.2.0.1422</Version> <Version>8.1.97</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" /> <PackageReference Include="Xamarin.Forms" Version="5.0.0.2125" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.12" /> <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.12" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" /> <PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Borepin\Borepin.csproj"> <ProjectReference Include="..\Borepin\Borepin.csproj">

View File

@ -27,4 +27,4 @@ using System.Runtime.InteropServices;
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
[assembly: NeutralResourcesLanguage("")] [assembly: NeutralResourcesLanguage("en-US")]

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
@ -30,6 +30,7 @@
<MtouchLink>SdkOnly</MtouchLink> <MtouchLink>SdkOnly</MtouchLink>
<MtouchDebug>true</MtouchDebug> <MtouchDebug>true</MtouchDebug>
<CodesignKey>iPhone Developer</CodesignKey> <CodesignKey>iPhone Developer</CodesignKey>
<MtouchSdkVersion>14.5</MtouchSdkVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>none</DebugType> <DebugType>none</DebugType>
@ -55,6 +56,8 @@
<MtouchLink>SdkOnly</MtouchLink> <MtouchLink>SdkOnly</MtouchLink>
<MtouchInterpreter>-all</MtouchInterpreter> <MtouchInterpreter>-all</MtouchInterpreter>
<MtouchExtraArgs>--optimize=experimental-xforms-product-type</MtouchExtraArgs> <MtouchExtraArgs>--optimize=experimental-xforms-product-type</MtouchExtraArgs>
<MtouchSdkVersion />
<CodesignProvision>Borepin Distribution Profile 2021</CodesignProvision>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType> <DebugType>none</DebugType>
@ -65,8 +68,9 @@
<MtouchArch>ARM64</MtouchArch> <MtouchArch>ARM64</MtouchArch>
<CodesignKey>iPhone Developer</CodesignKey> <CodesignKey>iPhone Developer</CodesignKey>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements> <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<CodesignProvision>Automatic:AppStore</CodesignProvision> <CodesignProvision>Borepin Distribution Profile 2021</CodesignProvision>
<MtouchExtraArgs>--optimize=experimental-xforms-product-type</MtouchExtraArgs> <MtouchExtraArgs>--optimize=experimental-xforms-product-type</MtouchExtraArgs>
<MtouchLink>SdkOnly</MtouchLink>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Default' "> <PropertyGroup Condition=" '$(RunConfiguration)' == 'Default' ">
<AppExtensionDebugBundleId /> <AppExtensionDebugBundleId />
@ -175,11 +179,11 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Prism.DryIoc.Forms"> <PackageReference Include="Prism.DryIoc.Forms">
<Version>7.2.0.1422</Version> <Version>8.1.97</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" /> <PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
<PackageReference Include="Xamarin.Forms"> <PackageReference Include="Xamarin.Forms">
<Version>5.0.0.2012</Version> <Version>5.0.0.2125</Version>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" /> <Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
@ -192,4 +196,8 @@
<ItemGroup> <ItemGroup>
<Folder Include="Assets.xcassets\LaunchIcon.imageset\" /> <Folder Include="Assets.xcassets\LaunchIcon.imageset\" />
</ItemGroup> </ItemGroup>
</Project> <Target Name="BeforeBuild" Condition=" '$(GITLAB_CI)' == 'true' ">
<XmlPoke XmlInputPath="Info.plist" Query="//dict/key[. = 'CFBundleVersion']/following-sibling::string[1]" Value="$(CI_PIPELINE_ID)" />
<XmlPoke XmlInputPath="Info.plist" Query="//dict/key[. = 'CFBundleShortVersionString']/following-sibling::string[1]" Value="0.1.0" />
</Target>
</Project>

View File

@ -7,5 +7,9 @@
<string>NDEF</string> <string>NDEF</string>
<string>TAG</string> <string>TAG</string>
</array> </array>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)org.fab-access.borepin</string>
</array>
</dict> </dict>
</plist> </plist>

View File

@ -40,5 +40,7 @@
<false/> <false/>
<key>NFCReaderUsageDescription</key> <key>NFCReaderUsageDescription</key>
<string>FabAccess needs to be able to read your card for authentication with the server.</string> <string>FabAccess needs to be able to read your card for authentication with the server.</string>
<key>UIUserInterfaceStyle</key>
<string>Light</string>
</dict> </dict>
</plist> </plist>

View File

@ -1,4 +1,5 @@
using System.Reflection; using System.Resources;
using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
@ -33,3 +34,4 @@ using System.Runtime.InteropServices;
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguage("en-US")]

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\Xamarin.Forms.5.0.0.2012\build\Xamarin.Forms.props" Condition="Exists('..\..\packages\Xamarin.Forms.5.0.0.2012\build\Xamarin.Forms.props')" /> <Import Project="..\..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.props" Condition="Exists('..\..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@ -59,31 +59,31 @@
</XamMacArch> </XamMacArch>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="DryIoc, Version=4.5.1.0, Culture=neutral, PublicKeyToken=dfbf2bd50fcf7768, processorArchitecture=MSIL"> <Reference Include="DryIoc, Version=4.8.1.0, Culture=neutral, PublicKeyToken=dfbf2bd50fcf7768, processorArchitecture=MSIL">
<HintPath>..\..\packages\DryIoc.dll.4.5.1\lib\netstandard2.0\DryIoc.dll</HintPath> <HintPath>..\..\packages\DryIoc.dll.4.8.1\lib\netstandard2.0\DryIoc.dll</HintPath>
</Reference> </Reference>
<Reference Include="Prism, Version=8.0.0.1909, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL"> <Reference Include="Prism, Version=8.1.97.5141, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
<HintPath>..\..\packages\Prism.Core.8.0.0.1909\lib\netstandard2.0\Prism.dll</HintPath> <HintPath>..\..\packages\Prism.Core.8.1.97\lib\netstandard2.0\Prism.dll</HintPath>
</Reference> </Reference>
<Reference Include="Prism.DryIoc.Forms, Version=7.2.0.1422, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Prism.DryIoc.Forms, Version=8.1.97.5141, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Prism.DryIoc.Forms.7.2.0.1422\lib\netstandard2.0\Prism.DryIoc.Forms.dll</HintPath> <HintPath>..\..\packages\Prism.DryIoc.Forms.8.1.97\lib\netstandard2.0\Prism.DryIoc.Forms.dll</HintPath>
</Reference> </Reference>
<Reference Include="Prism.Forms, Version=7.2.0.1422, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Prism.Forms, Version=8.1.97.5141, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Prism.Forms.7.2.0.1422\lib\netstandard2.0\Prism.Forms.dll</HintPath> <HintPath>..\..\packages\Prism.Forms.8.1.97\lib\netstandard2.0\Prism.Forms.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Forms.5.0.0.2012\lib\Xamarin.Mac\Xamarin.Forms.Core.dll</HintPath> <HintPath>..\..\packages\Xamarin.Forms.5.0.0.2125\lib\Xamarin.Mac\Xamarin.Forms.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="Xamarin.Forms.Platform, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Xamarin.Forms.Platform, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Forms.5.0.0.2012\lib\Xamarin.Mac\Xamarin.Forms.Platform.dll</HintPath> <HintPath>..\..\packages\Xamarin.Forms.5.0.0.2125\lib\Xamarin.Mac\Xamarin.Forms.Platform.dll</HintPath>
</Reference> </Reference>
<Reference Include="Xamarin.Forms.Platform.macOS, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Xamarin.Forms.Platform.macOS, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Forms.5.0.0.2012\lib\Xamarin.Mac\Xamarin.Forms.Platform.macOS.dll</HintPath> <HintPath>..\..\packages\Xamarin.Forms.5.0.0.2125\lib\Xamarin.Mac\Xamarin.Forms.Platform.macOS.dll</HintPath>
</Reference> </Reference>
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Forms.5.0.0.2012\lib\Xamarin.Mac\Xamarin.Forms.Xaml.dll</HintPath> <HintPath>..\..\packages\Xamarin.Forms.5.0.0.2125\lib\Xamarin.Mac\Xamarin.Forms.Xaml.dll</HintPath>
</Reference> </Reference>
<Reference Include="Xamarin.Mac" /> <Reference Include="Xamarin.Mac" />
</ItemGroup> </ItemGroup>
@ -133,8 +133,8 @@
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.5.0.0.2012\build\Xamarin.Forms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.5.0.0.2012\build\Xamarin.Forms.props'))" /> <Error Condition="!Exists('..\..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.props'))" />
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.5.0.0.2012\build\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.5.0.0.2012\build\Xamarin.Forms.targets'))" /> <Error Condition="!Exists('..\..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.targets'))" />
</Target> </Target>
<Import Project="..\..\packages\Xamarin.Forms.5.0.0.2012\build\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.5.0.0.2012\build\Xamarin.Forms.targets')" /> <Import Project="..\..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.targets')" />
</Project> </Project>

View File

@ -8,7 +8,7 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="DryIoc" publicKeyToken="dfbf2bd50fcf7768" culture="neutral" /> <assemblyIdentity name="DryIoc" publicKeyToken="dfbf2bd50fcf7768" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.5.1.0" newVersion="4.5.1.0" /> <bindingRedirect oldVersion="0.0.0.0-4.8.1.0" newVersion="4.8.1.0" />
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="DryIoc.dll" version="4.5.1" targetFramework="xamarinmac20" /> <package id="DryIoc.dll" version="4.8.1" targetFramework="xamarinmac20" />
<package id="Prism.Core" version="8.0.0.1909" targetFramework="xamarinmac20" /> <package id="Prism.Core" version="8.1.97" targetFramework="xamarinmac20" />
<package id="Prism.DryIoc.Forms" version="7.2.0.1422" targetFramework="xamarinmac20" /> <package id="Prism.DryIoc.Forms" version="8.1.97" targetFramework="xamarinmac20" />
<package id="Prism.Forms" version="7.2.0.1422" targetFramework="xamarinmac20" /> <package id="Prism.Forms" version="8.1.97" targetFramework="xamarinmac20" />
<package id="System.Reflection.Emit.Lightweight" version="4.7.0" targetFramework="xamarinmac20" /> <package id="System.Reflection.Emit.Lightweight" version="4.7.0" targetFramework="xamarinmac20" />
<package id="Xamarin.Forms" version="5.0.0.2012" targetFramework="xamarinmac20" /> <package id="Xamarin.Forms" version="5.0.0.2125" targetFramework="xamarinmac20" />
</packages> </packages>

View File

@ -26,7 +26,7 @@ namespace Borepin
{ {
InitializeComponent(); InitializeComponent();
Prism.Navigation.INavigationResult result = await NavigationService.NavigateAsync("/MainPage/NavigationPage/SetUpProcess_WelcomePage"); Prism.Navigation.INavigationResult result = await NavigationService.NavigateAsync("/MainPage/NavigationPage/StartUpDistributorPage");
if (!result.Success) if (!result.Success)
{ {
System.Diagnostics.Debugger.Break(); System.Diagnostics.Debugger.Break();
@ -36,21 +36,25 @@ namespace Borepin
protected override void RegisterTypes(IContainerRegistry containerRegistry) protected override void RegisterTypes(IContainerRegistry containerRegistry)
{ {
// Register Navigation // Register Navigation
containerRegistry.RegisterForNavigation<StartUpDistributorPage, StartUpDistributorPageModel>();
containerRegistry.RegisterForNavigation<NavigationPage>(); containerRegistry.RegisterForNavigation<NavigationPage>();
containerRegistry.RegisterForNavigation<MainPage, MainPagePageModel>(); containerRegistry.RegisterForNavigation<MainPage, MainPagePageModel>();
containerRegistry.RegisterForNavigation<MachinePage, MachinePageModel>(); containerRegistry.RegisterForNavigation<MachinePage, MachinePageModel>();
containerRegistry.RegisterForNavigation<SettingsPage>(); containerRegistry.RegisterForNavigation<SettingsPage>();
containerRegistry.RegisterForNavigation<MachineListPage, MachineListPageModel>(); containerRegistry.RegisterForNavigation<MachineListPage, MachineListPageModel>();
containerRegistry.RegisterForNavigation<LoginPasswordPage, LoginPasswordPageModel>("AddServerProcess_LoginPasswordPage");
containerRegistry.RegisterForNavigation<HostSelectPage, HostSelectPageModel>("AddServerProcess_HostSelectPage");
containerRegistry.RegisterForNavigation<LoginChoosePage, LoginChoosePageModel>("AddServerProcess_LoginChoosePage");
containerRegistry.RegisterForNavigation<ServerListPage, ServerListPageModel>(); containerRegistry.RegisterForNavigation<ServerListPage, ServerListPageModel>();
containerRegistry.RegisterForNavigation<ServerPage, ServerPageModel>(); containerRegistry.RegisterForNavigation<ServerPage, ServerPageModel>();
containerRegistry.RegisterForNavigation<ListPage, ListPageModel>(); containerRegistry.RegisterForNavigation<ListPage, ListPageModel>();
containerRegistry.RegisterForNavigation<TestPage, TestPageModel>();
containerRegistry.RegisterForNavigation<WelcomePage, WelcomePageModel>("SetUpProcess_WelcomePage");
containerRegistry.RegisterForNavigation<ScanPage, ScanPageModel>("SetUpProcess_ScanPage");
containerRegistry.RegisterForNavigation<WelcomePage, WelcomePageModel>("SetUpProcess_WelcomePage");
//containerRegistry.RegisterForNavigation<ScanPage, ScanPageModel>("SetUpProcess_ScanPage");
containerRegistry.RegisterForNavigation<LoginPasswordPage, LoginPasswordPageModel>("AddServerProcess_LoginPasswordPage");
containerRegistry.RegisterForNavigation<HostSelectPage, HostSelectPageModel>("AddServerProcess_HostSelectPage");
containerRegistry.RegisterForNavigation<LoginChoosePage, LoginChoosePageModel>("AddServerProcess_LoginChoosePage");
//containerRegistry.RegisterForNavigation<TestPage, TestPageModel>();
// Register Dialog // Register Dialog
containerRegistry.RegisterDialog<ConfirmDialog, ConfirmDialogModel>(); containerRegistry.RegisterDialog<ConfirmDialog, ConfirmDialogModel>();

View File

@ -20,10 +20,15 @@
<Warning Text="$(MSBuildProjectFile) is Multilingual build enabled, but the Multilingual App Toolkit is unavailable during the build. If building with Visual Studio, please check to ensure that toolkit is properly installed." /> <Warning Text="$(MSBuildProjectFile) is Multilingual build enabled, but the Multilingual App Toolkit is unavailable during the build. If building with Visual Studio, please check to ensure that toolkit is properly installed." />
</Target> </Target>
<ItemGroup> <ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> <Compile Remove="Behaviour\**" />
<EmbeddedResource Remove="Behaviour\**" />
<None Remove="Behaviour\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Plugin.Multilingual" Version="1.0.2" /> <PackageReference Include="Plugin.Multilingual" Version="1.0.2" />
<PackageReference Include="Prism.DryIoc.Forms" Version="7.2.0.1422" /> <PackageReference Include="Prism.DryIoc.Forms" Version="8.1.97" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" /> <PackageReference Include="Xamarin.Forms" Version="5.0.0.2125" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" /> <PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -33,9 +38,6 @@
<Compile Update="Page\SettingsPage.xaml.cs"> <Compile Update="Page\SettingsPage.xaml.cs">
<DependentUpon>SettingsPage.xaml</DependentUpon> <DependentUpon>SettingsPage.xaml</DependentUpon>
</Compile> </Compile>
<Compile Update="Page\SetUpProcess\ScanPage.xaml.cs">
<DependentUpon>ScanPage.xaml</DependentUpon>
</Compile>
<Compile Update="Page\SetUpProcess\WelcomePage.xaml.cs"> <Compile Update="Page\SetUpProcess\WelcomePage.xaml.cs">
<DependentUpon>WelcomePage.xaml</DependentUpon> <DependentUpon>WelcomePage.xaml</DependentUpon>
</Compile> </Compile>
@ -87,10 +89,10 @@
<EmbeddedResource Update="Page\SettingsPage.xaml"> <EmbeddedResource Update="Page\SettingsPage.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator> <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Update="Page\SetUpProcess\ScanPage.xaml"> <EmbeddedResource Update="Page\SetUpProcess\WelcomePage.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator> <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Update="Page\SetUpProcess\WelcomePage.xaml"> <EmbeddedResource Update="Page\StartUpDistributorPage.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator> <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Update="Page\TestPage.xaml"> <EmbeddedResource Update="Page\TestPage.xaml">
@ -120,9 +122,6 @@
<Generator>MSBuild:UpdateDesignTimeXaml</Generator> <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Behaviour\" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\FabAccessAPI\FabAccessAPI.csproj" /> <ProjectReference Include="..\..\FabAccessAPI\FabAccessAPI.csproj" />
</ItemGroup> </ItemGroup>

View File

@ -8,9 +8,9 @@ namespace Borepin.Converter
{ {
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{ {
switch((FabAccessAPI.Schema.State)value) switch((FabAccessAPI.Schema.Machine.MachineState)value)
{ {
case (FabAccessAPI.Schema.State.free): case (FabAccessAPI.Schema.Machine.MachineState.free):
return (Color)Application.Current.Resources["FirstColor"]; return (Color)Application.Current.Resources["FirstColor"];
default: default:
return (Color)Application.Current.Resources["SixthColor"]; return (Color)Application.Current.Resources["SixthColor"];

View File

@ -8,19 +8,19 @@ namespace Borepin.Converter
{ {
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{ {
switch((FabAccessAPI.Schema.State)value) switch((FabAccessAPI.Schema.Machine.MachineState)value)
{ {
case (FabAccessAPI.Schema.State.free): case (FabAccessAPI.Schema.Machine.MachineState.free):
return "Free"; return "Free";
case (FabAccessAPI.Schema.State.inUse): case (FabAccessAPI.Schema.Machine.MachineState.inUse):
return "In Use"; return "In Use";
case (FabAccessAPI.Schema.State.toCheck): case (FabAccessAPI.Schema.Machine.MachineState.toCheck):
return "To Check"; return "To Check";
case (FabAccessAPI.Schema.State.reserved): case (FabAccessAPI.Schema.Machine.MachineState.reserved):
return "Reserved"; return "Reserved";
case (FabAccessAPI.Schema.State.blocked): case (FabAccessAPI.Schema.Machine.MachineState.blocked):
return "Blocked"; return "Blocked";
case (FabAccessAPI.Schema.State.disabled): case (FabAccessAPI.Schema.Machine.MachineState.disabled):
return "Disabled"; return "Disabled";
default: default:
return "Unknown"; return "Unknown";

View File

@ -1,8 +0,0 @@
namespace Borepin.Model
{
public class Machine
{
public FabAccessAPI.Machine Instance { get; set; }
public FabAccessAPI.Schema.Machine.MInfo MInfo { get; set; }
}
}

View File

@ -0,0 +1,127 @@
using FabAccessAPI.Schema;
using Prism.Mvvm;
using static FabAccessAPI.Schema.Machine;
namespace Borepin.Model
{
public class MachineVisualize : BindableBase
{
#region Private Properties
public readonly Machine _Machine;
#endregion
#region Constructors
public MachineVisualize(Machine machine)
{
_Machine = machine;
LoadData();
}
#endregion
#region Methods
public void LoadData()
{
//ID = _Machine.Id;
//Space = new SpaceVisualize(_Machine.Space);
Name = _Machine.Name;
Description = _Machine.Description;
State = _Machine.State;
Manager = new UserVisualize(_Machine.Manager);
CanUse = !((UseInterface_Proxy)_Machine.Use).IsNull;
CanInUse = !((InUseInterface_Proxy) _Machine.Inuse).IsNull;
CanTransfer = !((TransferInterface_Proxy) _Machine.Transfer).IsNull;
CanCheck = !((CheckInterface_Proxy) _Machine.Check).IsNull;
CanManage = !((ManageInterface_Proxy) _Machine.Manage).IsNull;
CanAdmin = !((AdminInterface_Proxy) _Machine.Admin).IsNull;
}
#endregion
#region Properties
private UUID _ID;
public UUID ID
{
get => _ID;
set => SetProperty(ref _ID, value);
}
private SpaceVisualize _Space;
public SpaceVisualize Space
{
get => _Space;
set => SetProperty(ref _Space, value);
}
private string _Name;
public string Name
{
get => _Name;
set => SetProperty(ref _Name, value);
}
private string _Description;
public string Description
{
get => _Description;
set => SetProperty(ref _Description, value);
}
private MachineState _State;
public MachineState State
{
get => _State;
set => SetProperty(ref _State, value);
}
private UserVisualize _Manager;
public UserVisualize Manager
{
get => _Manager;
set => SetProperty(ref _Manager, value);
}
private bool _CanUse;
public bool CanUse
{
get => _CanUse;
set => SetProperty(ref _CanUse, value);
}
private bool _CanInUse;
public bool CanInUse
{
get => _CanInUse;
set => SetProperty(ref _CanInUse, value);
}
private bool _CanTransfer;
public bool CanTransfer
{
get => _CanTransfer;
set => SetProperty(ref _CanTransfer, value);
}
private bool _CanCheck;
public bool CanCheck
{
get => _CanCheck;
set => SetProperty(ref _CanCheck, value);
}
private bool _CanManage;
public bool CanManage
{
get => _CanManage;
set => SetProperty(ref _CanManage, value);
}
private bool _CanAdmin;
public bool CanAdmin
{
get => _CanAdmin;
set => SetProperty(ref _CanAdmin, value);
}
#endregion
}
}

View File

@ -0,0 +1,52 @@
using FabAccessAPI.Schema;
using Prism.Mvvm;
namespace Borepin.Model
{
public class SpaceVisualize : BindableBase
{
#region Private Properties
public readonly Space _Space;
#endregion
#region Constructors
public SpaceVisualize(Space space)
{
_Space = space;
LoadData();
}
#endregion
#region LoadData
public void LoadData()
{
//ID = _Space.Id;
Name = _Space.Name;
Info = _Space.Info;
}
#endregion
#region Properties
private UUID _ID;
public UUID ID
{
get => _ID;
set => SetProperty(ref _ID, value);
}
private string _Name;
public string Name
{
get => _Name;
set => SetProperty(ref _Name, value);
}
private string _Info;
public string Info
{
get => _Info;
set => SetProperty(ref _Info, value);
}
#endregion
}
}

View File

@ -0,0 +1,52 @@
using FabAccessAPI.Schema;
using Prism.Mvvm;
namespace Borepin.Model
{
public class UserVisualize : BindableBase
{
#region Private Properties
public readonly User _User;
#endregion
#region Contructors
public UserVisualize(User user)
{
_User = user;
LoadData();
}
#endregion
#region LoadData
public void LoadData()
{
//ID = _User.Id;
Username = _User.Username;
//Space = new SpaceVisualize(_User.Space);
}
#endregion
#region Properties
private UUID _ID;
public UUID ID
{
get => _ID;
set => SetProperty(ref _ID, value);
}
private string _Username;
public string Username
{
get => _Username;
set => SetProperty(ref _Username, value);
}
private SpaceVisualize _Space;
public SpaceVisualize Space
{
get => _Space;
set => SetProperty(ref _Space, value);
}
#endregion
}
}

View File

@ -15,16 +15,16 @@
<body> <body>
<group id="BOREPIN/RESOURCES/TEXT/TEXTRESOURCE.RESX" datatype="resx"> <group id="BOREPIN/RESOURCES/TEXT/TEXTRESOURCE.RESX" datatype="resx">
<trans-unit id="SetUp_WelcomePage_Text" translate="yes" xml:space="preserve"> <trans-unit id="SetUp_WelcomePage_Text" translate="yes" xml:space="preserve">
<source>Hier muss ein kurzer Text hin was FabAccess ist und was man damit machen kann</source> <source>Automate your Space with FabAccess</source>
<target state="new">Hier muss ein kurzer Text hin was FabAccess ist und was man damit machen kann</target> <target state="new">Automate your Space with FabAccess</target>
</trans-unit> </trans-unit>
<trans-unit id="SetUp_WelcomePage_Title" translate="yes" xml:space="preserve"> <trans-unit id="SetUp_WelcomePage_Title" translate="yes" xml:space="preserve">
<source>Welcome</source> <source>Welcome</source>
<target state="new">Welcome</target> <target state="new">Welcome</target>
</trans-unit> </trans-unit>
<trans-unit id="SetUp_WelcomePage_Button" translate="yes" xml:space="preserve"> <trans-unit id="SetUp_WelcomePage_Button" translate="yes" xml:space="preserve">
<source>Start working</source> <source>Begin working</source>
<target state="new">Start working</target> <target state="new">Begin working</target>
</trans-unit> </trans-unit>
<trans-unit id="SetUp_ScanPage_Button" translate="yes" xml:space="preserve"> <trans-unit id="SetUp_ScanPage_Button" translate="yes" xml:space="preserve">
<source>Login to your Space</source> <source>Login to your Space</source>

View File

@ -15,16 +15,16 @@
<body> <body>
<group id="BOREPIN/RESOURCES/TEXT/TEXTRESOURCE.RESX" datatype="resx"> <group id="BOREPIN/RESOURCES/TEXT/TEXTRESOURCE.RESX" datatype="resx">
<trans-unit id="SetUp_WelcomePage_Text" translate="yes" xml:space="preserve"> <trans-unit id="SetUp_WelcomePage_Text" translate="yes" xml:space="preserve">
<source>Hier muss ein kurzer Text hin was FabAccess ist und was man damit machen kann</source> <source>Automate your Space with FabAccess</source>
<target state="new">Hier muss ein kurzer Text hin was FabAccess ist und was man damit machen kann</target> <target state="new">Automate your Space with FabAccess</target>
</trans-unit> </trans-unit>
<trans-unit id="SetUp_WelcomePage_Title" translate="yes" xml:space="preserve"> <trans-unit id="SetUp_WelcomePage_Title" translate="yes" xml:space="preserve">
<source>Welcome</source> <source>Welcome</source>
<target state="new">Welcome</target> <target state="new">Welcome</target>
</trans-unit> </trans-unit>
<trans-unit id="SetUp_WelcomePage_Button" translate="yes" xml:space="preserve"> <trans-unit id="SetUp_WelcomePage_Button" translate="yes" xml:space="preserve">
<source>Start working</source> <source>Begin working</source>
<target state="new">Start working</target> <target state="new">Begin working</target>
</trans-unit> </trans-unit>
<trans-unit id="SetUp_ScanPage_Button" translate="yes" xml:space="preserve"> <trans-unit id="SetUp_ScanPage_Button" translate="yes" xml:space="preserve">
<source>Login to your Space</source> <source>Login to your Space</source>

View File

@ -1,16 +1,27 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Borepin.Page.AddServerProcess.HostSelectPage"> x:Class="Borepin.Page.AddServerProcess.HostSelectPage"
xmlns:converters="clr-namespace:Borepin.Converter">
<NavigationPage.TitleView> <NavigationPage.TitleView>
<Label Text="FabAccess" Style="{StaticResource Style_Label_Header}"/> <Label Text="FabAccess" HorizontalOptions="End" Margin="0, 0, 10, 0" VerticalOptions="CenterAndExpand" FontSize="Medium" TextColor="{StaticResource FirstColor}"/>
</NavigationPage.TitleView> </NavigationPage.TitleView>
<ContentPage.Resources>
<ResourceDictionary>
<converters:InvertBoolConverter x:Key="InvertBoolConverter"/>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content> <ContentPage.Content>
<StackLayout Padding="20"> <StackLayout Padding="20">
<Label Text="Host" Style="{StaticResource Style_Label_Property_Title}"></Label> <StackLayout IsVisible="{Binding IsBusy}">
<Entry Text="{Binding Host}"/> <ActivityIndicator IsRunning="{Binding IsBusy}"></ActivityIndicator>
<Button Text="Detect local host" Command="{Binding DetectHostCommand}" Style="{StaticResource Style_Button_Primary}"/> </StackLayout>
<Button Text="Select Host" Command="{Binding UseHostCommand}" Style="{StaticResource Style_Button_Primary}"/> <StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}">
<Label Text="Host" Style="{StaticResource Style_Label_Property_Title}"></Label>
<Entry Text="{Binding Host}"/>
<Button Text="Demo Host Address" Command="{Binding DetectHostCommand}" Style="{StaticResource Style_Button_Primary}"/>
<Button Text="Select Host" Command="{Binding UseHostCommand}" Style="{StaticResource Style_Button_Primary}"/>
</StackLayout>
</StackLayout> </StackLayout>
</ContentPage.Content> </ContentPage.Content>
</ContentPage> </ContentPage>

View File

@ -1,19 +1,30 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Borepin.Page.AddServerProcess.LoginChoosePage"> x:Class="Borepin.Page.AddServerProcess.LoginChoosePage"
xmlns:converters="clr-namespace:Borepin.Converter">
<NavigationPage.TitleView> <NavigationPage.TitleView>
<Label Text="FabAccess" FontAttributes="Bold" HorizontalOptions="FillAndExpand" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" VerticalOptions="FillAndExpand" FontSize="Medium" TextColor="{StaticResource FirstColor}"/> <Label Text="FabAccess" HorizontalOptions="End" Margin="0, 0, 10, 0" VerticalOptions="CenterAndExpand" FontSize="Medium" TextColor="{StaticResource FirstColor}"/>
</NavigationPage.TitleView> </NavigationPage.TitleView>
<ContentPage.Resources>
<ResourceDictionary>
<converters:InvertBoolConverter x:Key="InvertBoolConverter"/>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content> <ContentPage.Content>
<StackLayout Padding="20"> <StackLayout Padding="20">
<Label Text="Sign In:" Style="{StaticResource Style_Label_Property_Title}"></Label> <StackLayout IsVisible="{Binding IsBusy}">
<Button Text="Login with Password" Command="{Binding LoginPasswordCommand}" Style="{StaticResource Style_Button_Primary}"/> <ActivityIndicator IsRunning="{Binding IsBusy}"></ActivityIndicator>
<Label Text="or" Style="{StaticResource Style_Label_Property_Title}"></Label> </StackLayout>
<Button Text="Login with Card" Style="{StaticResource Style_Button_Primary}" IsEnabled="False"/> <StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}">
<Label Text="Sign In:" Style="{StaticResource Style_Label_Property_Title}"></Label>
<Button Text="Login with Password" Command="{Binding LoginPasswordCommand}" Style="{StaticResource Style_Button_Primary}"/>
<Label Text="or" Style="{StaticResource Style_Label_Property_Title}"></Label>
<Button Text="Login with Card" Style="{StaticResource Style_Button_Primary}" IsEnabled="False"/>
<Label Text="Sign Up:" Style="{StaticResource Style_Label_Property_Title}"></Label> <Label Text="Sign Up:" Style="{StaticResource Style_Label_Property_Title}"></Label>
<Button Text="Register" Style="{StaticResource Style_Button_Primary}" IsEnabled="False"/> <Button Text="Register" Style="{StaticResource Style_Button_Primary}" IsEnabled="False"/>
</StackLayout>
</StackLayout> </StackLayout>
</ContentPage.Content> </ContentPage.Content>
</ContentPage> </ContentPage>

View File

@ -1,19 +1,30 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Borepin.Page.AddServerProcess.LoginPasswordPage"> x:Class="Borepin.Page.AddServerProcess.LoginPasswordPage"
xmlns:converters="clr-namespace:Borepin.Converter">
<NavigationPage.TitleView> <NavigationPage.TitleView>
<Label Text="FabAccess" FontAttributes="Bold" HorizontalOptions="FillAndExpand" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" VerticalOptions="FillAndExpand" FontSize="Medium" TextColor="{StaticResource FirstColor}"/> <Label Text="FabAccess" HorizontalOptions="End" Margin="0, 0, 10, 0" VerticalOptions="CenterAndExpand" FontSize="Medium" TextColor="{StaticResource FirstColor}"/>
</NavigationPage.TitleView> </NavigationPage.TitleView>
<ContentPage.Resources>
<ResourceDictionary>
<converters:InvertBoolConverter x:Key="InvertBoolConverter"/>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content> <ContentPage.Content>
<StackLayout Padding="20"> <StackLayout Padding="20">
<Label Text="Username" Style="{StaticResource Style_Label_Property_Title}"></Label> <StackLayout IsVisible="{Binding IsBusy}">
<Entry Text="{Binding Username}"/> <ActivityIndicator IsRunning="{Binding IsBusy}"></ActivityIndicator>
</StackLayout>
<StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}">
<Label Text="Username" Style="{StaticResource Style_Label_Property_Title}"></Label>
<Entry Text="{Binding Username}"/>
<Label Text="Password" Style="{StaticResource Style_Label_Property_Title}"></Label> <Label Text="Password" Style="{StaticResource Style_Label_Property_Title}"></Label>
<Entry Text="{Binding Password}" IsPassword="True"/> <Entry Text="{Binding Password}" IsPassword="True"/>
<Button Text="Login" Command="{Binding AuthenticateCommand}" Style="{StaticResource Style_Button_Primary}"/> <Button Text="Login" Command="{Binding AuthenticateCommand}" Style="{StaticResource Style_Button_Primary}"/>
</StackLayout>
</StackLayout> </StackLayout>
</ContentPage.Content> </ContentPage.Content>
</ContentPage> </ContentPage>

View File

@ -18,7 +18,7 @@
<ActivityIndicator IsRunning="{Binding IsBusy}"></ActivityIndicator> <ActivityIndicator IsRunning="{Binding IsBusy}"></ActivityIndicator>
</StackLayout> </StackLayout>
<StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}"> <StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}">
<ListView ItemsSource="{Binding MachineListItemViewModel_List}"> <ListView ItemsSource="{Binding MachineListItemViewModel_List}" IsVisible="{Binding IsConnected}">
<ListView.ItemTemplate> <ListView.ItemTemplate>
<DataTemplate> <DataTemplate>
<ViewCell> <ViewCell>
@ -27,6 +27,7 @@
</DataTemplate> </DataTemplate>
</ListView.ItemTemplate> </ListView.ItemTemplate>
</ListView> </ListView>
<Label Text="Please connect to Server" IsVisible="{Binding IsConnected, Converter={StaticResource InvertBoolConverter}}"></Label>
</StackLayout> </StackLayout>
</StackLayout> </StackLayout>
</ContentPage.Content> </ContentPage.Content>

View File

@ -4,11 +4,12 @@
x:Class="Borepin.Page.MachinePage" x:Class="Borepin.Page.MachinePage"
xmlns:converters="clr-namespace:Borepin.Converter"> xmlns:converters="clr-namespace:Borepin.Converter">
<NavigationPage.TitleView> <NavigationPage.TitleView>
<Label Text="{Binding Machine.State}" FontAttributes="Bold" HorizontalOptions="End" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" WidthRequest="150" Margin="7.5" VerticalOptions="FillAndExpand" FontSize="Small" BackgroundColor="{StaticResource NinthColor}"/> <Label Text="{Binding MachineItem.State, Converter={StaticResource MachineStateStringConverter}}" FontAttributes="Bold" HorizontalOptions="End" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" WidthRequest="150" Margin="7.5" VerticalOptions="FillAndExpand" FontSize="Small" BackgroundColor="{Binding MachineItem.State, Converter={StaticResource MachineStateColorConverter}}"/>
</NavigationPage.TitleView> </NavigationPage.TitleView>
<ContentPage.Resources> <ContentPage.Resources>
<ResourceDictionary> <ResourceDictionary>
<converters:MachineStateColorConverter x:Key="MachineStateColorConverter"/> <converters:MachineStateColorConverter x:Key="MachineStateColorConverter"/>
<converters:MachineStateStringConverter x:Key="MachineStateStringConverter"/>
<converters:IsNotNullBoolConverter x:Key="IsNotNullBoolConverter"/> <converters:IsNotNullBoolConverter x:Key="IsNotNullBoolConverter"/>
<converters:InvertBoolConverter x:Key="InvertBoolConverter"/> <converters:InvertBoolConverter x:Key="InvertBoolConverter"/>
</ResourceDictionary> </ResourceDictionary>
@ -19,10 +20,10 @@
<ActivityIndicator IsRunning="{Binding IsBusy}"></ActivityIndicator> <ActivityIndicator IsRunning="{Binding IsBusy}"></ActivityIndicator>
</StackLayout> </StackLayout>
<StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}"> <StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}">
<Label Text="{Binding Name}" Style="{StaticResource LabelStyle_Title}"/> <Label Text="{Binding MachineItem.Name}" Style="{StaticResource LabelStyle_Title}"/>
<Button Text="Use" Command="{Binding UseMachineCommand}" IsVisible="{Binding CanUse}" Style="{StaticResource Style_Button_Primary}"/> <Button Text="Use" Command="{Binding UseMachineCommand}" IsVisible="{Binding MachineItem.CanUse}" Style="{StaticResource Style_Button_Primary}"/>
<Button Text="GiveBack" Command="{Binding GiveBackMachineCommand}" IsVisible="{Binding CanGiveBack}" Style="{StaticResource Style_Button_Primary}"/> <Button Text="GiveBack" Command="{Binding GiveBackMachineCommand}" IsVisible="{Binding MachineItem.CanInUse}" Style="{StaticResource Style_Button_Primary}"/>
</StackLayout> </StackLayout>
</StackLayout> </StackLayout>
</ContentPage.Content> </ContentPage.Content>

View File

@ -1,16 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms" <FlyoutPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Borepin.Page.MainPage" x:Class="Borepin.Page.MainPage"
MasterBehavior="Popover"
x:Name="page"> x:Name="page">
<MasterDetailPage.Master> <FlyoutPage.Flyout>
<ContentPage Title="FabAccess"> <ContentPage Title="FabAccess">
<StackLayout> <StackLayout>
<Button Text="Machines" Command="{Binding NavigateCommand}" CommandParameter="MachineListPage" /> <Button Text="Machines" Command="{Binding NavigateCommand}" CommandParameter="MachineListPage" />
<Button Text="Settings" Command="{Binding NavigateCommand}" CommandParameter="SettingsPage" />
<Button Text="Servers" Command="{Binding NavigateCommand}" CommandParameter="ServerListPage" /> <Button Text="Servers" Command="{Binding NavigateCommand}" CommandParameter="ServerListPage" />
<!--<Button Text="Settings" Command="{Binding NavigateCommand}" CommandParameter="SettingsPage" />-->
</StackLayout> </StackLayout>
</ContentPage> </ContentPage>
</MasterDetailPage.Master> </FlyoutPage.Flyout>
</MasterDetailPage> </FlyoutPage>

View File

@ -3,7 +3,7 @@ using Xamarin.Forms;
namespace Borepin.Page namespace Borepin.Page
{ {
public partial class MainPage : IMasterDetailPageOptions public partial class MainPage : IFlyoutPageOptions
{ {
public static readonly BindableProperty IsPresentedAfterNavigationProperty = public static readonly BindableProperty IsPresentedAfterNavigationProperty =
BindableProperty.Create(nameof(IsPresentedAfterNavigation), typeof(bool), typeof(MainPage), false); BindableProperty.Create(nameof(IsPresentedAfterNavigation), typeof(bool), typeof(MainPage), false);

View File

@ -1,14 +0,0 @@
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace Borepin.Page.SetUpProcess
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class ScanPage : ContentPage
{
public ScanPage()
{
InitializeComponent();
}
}
}

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:Borepin.View"
x:Class="Borepin.Page.StartUpDistributorPage"
xmlns:converters="clr-namespace:Borepin.Converter">
<ContentPage.Resources>
<ResourceDictionary>
<converters:InvertBoolConverter x:Key="InvertBoolConverter"/>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content>
<StackLayout Padding="20">
<StackLayout IsVisible="{Binding IsBusy}">
<ActivityIndicator IsRunning="{Binding IsBusy}"></ActivityIndicator>
</StackLayout>
</StackLayout>
</ContentPage.Content>
</ContentPage>

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace Borepin.Page
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class StartUpDistributorPage : ContentPage
{
public StartUpDistributorPage()
{
InitializeComponent();
}
}
}

View File

@ -1,6 +1,7 @@
using Borepin.Service.BFFH; using Borepin.Base;
using Prism.Mvvm; using Borepin.Service.BFFH;
using Prism.Navigation; using Prism.Navigation;
using Prism.Services;
using System; using System;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -9,27 +10,36 @@ using Xamarin.Forms;
namespace Borepin.PageModel.AddServerProcess namespace Borepin.PageModel.AddServerProcess
{ {
public class HostSelectPageModel : BindableBase public class HostSelectPageModel : PageModelBase
{ {
private readonly INavigationService _NavigationService; #region Private Properties
private readonly IBFFHService _BFFHService; private readonly IBFFHService _BFFHService;
private readonly IPageDialogService _PageDialogService;
#endregion
public HostSelectPageModel(INavigationService navigationService, IBFFHService bffhService) #region Constructors
public HostSelectPageModel(INavigationService navigationService, IBFFHService bffhService, IPageDialogService pageDialogService) : base(navigationService)
{ {
_NavigationService = navigationService;
_BFFHService = bffhService; _BFFHService = bffhService;
_PageDialogService = pageDialogService;
UseHostCommand = new Command(UseHostCommandExecuted); UseHostCommand = new Command(UseHostCommandExecuted);
DetectHostCommand = new Command(DetectHostCommandExecuted); DetectHostCommand = new Command(DetectHostCommandExecuted);
Task.Run(LoadData); Task.Run(LoadData);
} }
#endregion
private void LoadData() #region LoadData
public override Task LoadData()
{ {
IsBusy = false;
return Task.CompletedTask;
} }
#endregion
#region Properties
private string _Host; private string _Host;
public string Host public string Host
{ {
@ -43,7 +53,9 @@ namespace Borepin.PageModel.AddServerProcess
get => _KnownHost_List; get => _KnownHost_List;
set => SetProperty(ref _KnownHost_List, value); set => SetProperty(ref _KnownHost_List, value);
} }
#endregion
#region Commands
private ICommand _UseHostCommand; private ICommand _UseHostCommand;
public ICommand UseHostCommand public ICommand UseHostCommand
{ {
@ -53,6 +65,8 @@ namespace Borepin.PageModel.AddServerProcess
private async void UseHostCommandExecuted() private async void UseHostCommandExecuted()
{ {
IsBusy = true;
UriBuilder builder = new UriBuilder(Host); UriBuilder builder = new UriBuilder(Host);
if(builder.Port == 80) if(builder.Port == 80)
{ {
@ -64,7 +78,22 @@ namespace Borepin.PageModel.AddServerProcess
Address = builder.Uri Address = builder.Uri
}; };
await _BFFHService.Connect(connection); if(_BFFHService.ActiveConnection != null)
{
await _BFFHService.Disconnect();
}
try
{
await _BFFHService.Connect(connection);
}
catch (Capnp.Rpc.RpcException exception) when (exception.Message == "TcpRpcClient is unable to connect")
{
await _PageDialogService.DisplayAlertAsync("Connection failed", "Unable to connect to server.", "Ok");
IsBusy = false;
return;
}
INavigationResult result = await _NavigationService.NavigateAsync("AddServerProcess_LoginChoosePage"); INavigationResult result = await _NavigationService.NavigateAsync("AddServerProcess_LoginChoosePage");
if(!result.Success) if(!result.Success)
@ -85,5 +114,18 @@ namespace Borepin.PageModel.AddServerProcess
// Use Demo Host // Use Demo Host
Host = "127.0.0.1:59661"; Host = "127.0.0.1:59661";
} }
#endregion
#region INavigationAware
public override void OnNavigatedFrom(INavigationParameters parameters)
{
}
public override void OnNavigatedTo(INavigationParameters parameters)
{
}
#endregion
} }
} }

View File

@ -1,21 +1,30 @@
using Prism.Mvvm; using Borepin.Base;
using Prism.Navigation; using Prism.Navigation;
using System.Threading.Tasks;
using System.Windows.Input; using System.Windows.Input;
using Xamarin.Forms; using Xamarin.Forms;
namespace Borepin.PageModel.AddServerProcess namespace Borepin.PageModel.AddServerProcess
{ {
public class LoginChoosePageModel : BindableBase public class LoginChoosePageModel : PageModelBase
{ {
private INavigationService _NavigationService; #region Contructors
public LoginChoosePageModel(INavigationService navigationService) : base(navigationService)
public LoginChoosePageModel(INavigationService navigationService)
{ {
_NavigationService = navigationService;
LoginPasswordCommand = new Command(LoginPasswordCommandExecuted); LoginPasswordCommand = new Command(LoginPasswordCommandExecuted);
} }
#endregion
#region LoadData
public override Task LoadData()
{
IsBusy = false;
return Task.CompletedTask;
}
#endregion
#region Commands
private ICommand _LoginPasswordCommand; private ICommand _LoginPasswordCommand;
public ICommand LoginPasswordCommand public ICommand LoginPasswordCommand
{ {
@ -31,5 +40,18 @@ namespace Borepin.PageModel.AddServerProcess
System.Diagnostics.Debugger.Break(); System.Diagnostics.Debugger.Break();
} }
} }
#endregion
#region INavigationAware
public override void OnNavigatedFrom(INavigationParameters parameters)
{
}
public override void OnNavigatedTo(INavigationParameters parameters)
{
IsBusy = false;
}
#endregion
} }
} }

View File

@ -1,36 +1,48 @@
using Borepin.Model; using Borepin.Base;
using Borepin.Model;
using Borepin.Service.BFFH; using Borepin.Service.BFFH;
using Borepin.Service.Connections; using Borepin.Service.Connections;
using Prism.Commands; using Prism.Commands;
using Prism.Mvvm;
using Prism.Navigation; using Prism.Navigation;
using Prism.Services;
using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Input; using System.Windows.Input;
namespace Borepin.PageModel.AddServerProcess namespace Borepin.PageModel.AddServerProcess
{ {
public class LoginPasswordPageModel : BindableBase public class LoginPasswordPageModel : PageModelBase
{ {
private readonly INavigationService _NavigationService; #region Private Properties
private readonly IBFFHService _BFFHService; private readonly IBFFHService _BFFHService;
private readonly IConnectionService _ConnectionService; private readonly IConnectionService _ConnectionService;
private readonly IPageDialogService _PageDialogService;
#endregion
public LoginPasswordPageModel(INavigationService navigationService, IBFFHService bffhService, IConnectionService connectionService) #region Constructors
public LoginPasswordPageModel(INavigationService navigationService, IBFFHService bffhService, IConnectionService connectionService, IPageDialogService pageDialogService) : base(navigationService)
{ {
_NavigationService = navigationService;
_BFFHService = bffhService; _BFFHService = bffhService;
_ConnectionService = connectionService; _ConnectionService = connectionService;
_PageDialogService = pageDialogService;
AuthenticateCommand = new DelegateCommand(async () => await AuthenticateCommandExecuted()); AuthenticateCommand = new DelegateCommand(async () => await AuthenticateCommandExecuted());
Task.Run(LoadData); Task.Run(LoadData);
} }
#endregion
private void LoadData() #region LoadData
public override Task LoadData()
{ {
IsBusy = false;
}
return Task.CompletedTask;
}
#endregion
#region Properties
private string _Username; private string _Username;
public string Username public string Username
{ {
@ -44,7 +56,9 @@ namespace Borepin.PageModel.AddServerProcess
get => _Password; get => _Password;
set => SetProperty(ref _Password, value); set => SetProperty(ref _Password, value);
} }
#endregion
#region Commands
private ICommand _AuthenticateCommand; private ICommand _AuthenticateCommand;
public ICommand AuthenticateCommand public ICommand AuthenticateCommand
{ {
@ -54,13 +68,29 @@ namespace Borepin.PageModel.AddServerProcess
private async Task AuthenticateCommandExecuted() private async Task AuthenticateCommandExecuted()
{ {
IsBusy = true;
Connection connection_update = _BFFHService.ActiveConnection; Connection connection_update = _BFFHService.ActiveConnection;
connection_update.Username = Username; connection_update.Username = Username;
await _BFFHService.Authenticate(connection_update, Password); if(!await _BFFHService.Authenticate(connection_update, Password))
{
await _PageDialogService.DisplayAlertAsync("Connection failed", "Unable to authenticate to server.", "Ok");
IsBusy = false;
return;
}
try
{
await _ConnectionService.AddConnection(_BFFHService.ActiveConnection);
}
catch (ArgumentException)
{
// Could be better catched
}
await _ConnectionService.AddConnection(_BFFHService.ActiveConnection);
await _ConnectionService.LogConnect(_BFFHService.ActiveConnection); await _ConnectionService.LogConnect(_BFFHService.ActiveConnection);
var result = await _NavigationService.NavigateAsync("/MainPage/NavigationPage/MachineListPage"); var result = await _NavigationService.NavigateAsync("/MainPage/NavigationPage/MachineListPage");
@ -70,5 +100,18 @@ namespace Borepin.PageModel.AddServerProcess
System.Diagnostics.Debugger.Break(); System.Diagnostics.Debugger.Break();
} }
} }
#endregion
#region INavigationAware
public override void OnNavigatedFrom(INavigationParameters parameters)
{
}
public override void OnNavigatedTo(INavigationParameters parameters)
{
}
#endregion
} }
} }

View File

@ -5,8 +5,8 @@ using System.Windows.Input;
using Prism.Commands; using Prism.Commands;
using Prism.Navigation; using Prism.Navigation;
using Borepin.Service.BFFH; using Borepin.Service.BFFH;
using Borepin.Model;
using Borepin.Base; using Borepin.Base;
using FabAccessAPI.Schema;
namespace Borepin.PageModel namespace Borepin.PageModel
{ {
@ -30,6 +30,7 @@ namespace Borepin.PageModel
{ {
if (_BFFHService.ActiveConnection == null) if (_BFFHService.ActiveConnection == null)
{ {
IsBusy = false;
return; return;
} }
else else
@ -37,18 +38,13 @@ namespace Borepin.PageModel
IsConnected = true; IsConnected = true;
} }
FabAccessAPI.Machines machineInterface = await _BFFHService.GetMachineInterface(); IMachineSystem machineInterface = await _BFFHService.GetMachineSystemInterface();
MachineSystem.IInfoInterface infoInterface = await machineInterface.Info();
List<Machine> list = new List<Machine>(); IReadOnlyList<Machine> machine_list = await infoInterface.GetMachineList();
IReadOnlyList<FabAccessAPI.Machine> machine_list = await machineInterface.ListMachines();
foreach (FabAccessAPI.Machine machine in machine_list)
{
list.Add(new Machine() { Instance = machine, MInfo = await machine.GetMInfo() });
}
List<MachineListItemViewModel> viewmodel_list = new List<MachineListItemViewModel>(); List<MachineListItemViewModel> viewmodel_list = new List<MachineListItemViewModel>();
foreach (Machine machine in list) foreach (Machine machine in machine_list)
{ {
viewmodel_list.Add(new MachineListItemViewModel(machine)); viewmodel_list.Add(new MachineListItemViewModel(machine));
} }
@ -88,7 +84,7 @@ namespace Borepin.PageModel
NavigationParameters parameters = new NavigationParameters NavigationParameters parameters = new NavigationParameters
{ {
{ "instance", viewmodel.Instance } { "name", viewmodel.Instance.Name }
}; };
INavigationResult result = await _NavigationService.NavigateAsync($"MachinePage", parameters); INavigationResult result = await _NavigationService.NavigateAsync($"MachinePage", parameters);

View File

@ -1,83 +1,62 @@
using Borepin.Base; using Borepin.Base;
using Borepin.Model;
using Prism.Commands; using Prism.Commands;
using Prism.Navigation; using Prism.Navigation;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Input; using System.Windows.Input;
using static FabAccessAPI.Schema.Machine.WriteInterface; using FabAccessAPI.Schema;
using Borepin.Service.BFFH;
using static FabAccessAPI.Schema.MachineSystem;
using Borepin.Model;
namespace Borepin.PageModel namespace Borepin.PageModel
{ {
public class MachinePageModel : PageModelBase public class MachinePageModel : PageModelBase
{ {
#region Private Properties
private readonly IBFFHService _BFFHService;
private string _Name;
private Machine _Machine;
#endregion
#region Contructors #region Contructors
public MachinePageModel(INavigationService navigationService) : base(navigationService) public MachinePageModel(INavigationService navigationService, IBFFHService bffhService) : base(navigationService)
{ {
_BFFHService = bffhService;
UseMachineCommand = new DelegateCommand(UseMachineCommandExecuted); UseMachineCommand = new DelegateCommand(UseMachineCommandExecuted);
GiveBackMachineCommand = new DelegateCommand(GiveBackMachineCommandExecuted); GiveBackMachineCommand = new DelegateCommand(GiveBackMachineCommandExecuted);
} }
#endregion #endregion
#region Data #region Data
public override Task LoadData() public override async Task LoadData()
{ {
Name = MachineItem.MInfo.Name; IsBusy = true;
CanUse = MachineItem.MInfo.State == FabAccessAPI.Schema.State.free; IMachineSystem machineSystem = await _BFFHService.GetMachineSystemInterface();
//if (GiveBack == null) IInfoInterface info = await machineSystem.Info();
//{
// GiveBack = await MachineItem.Instance.GetGiveBack();
//}
CanGiveBack = GiveBack != null; _Machine = (await info.GetMachine(_Name)).Item1;
MachineItem = new MachineVisualize(_Machine);
MachineItem.LoadData();
IsBusy = false; IsBusy = false;
return Task.CompletedTask;
} }
#endregion #endregion
#region Properties #region Properties
private Machine _MachineItem; private MachineVisualize _MachineItem;
public Machine MachineItem public MachineVisualize MachineItem
{ {
get => _MachineItem; get => _MachineItem;
set => SetProperty(ref _MachineItem, value); set => SetProperty(ref _MachineItem, value);
} }
private string _Name;
public string Name
{
get => _Name;
set => SetProperty(ref _Name, value);
}
private IGiveBack _GiveBack;
public IGiveBack GiveBack
{
get => _GiveBack;
set => SetProperty(ref _GiveBack, value);
}
private bool _CanUse;
public bool CanUse
{
get => _CanUse;
set => SetProperty(ref _CanUse, value);
}
private bool _CanGiveBack;
public bool CanGiveBack
{
get => _CanGiveBack;
set => SetProperty(ref _CanGiveBack, value);
}
#endregion #endregion
#region Commands #region Commands
private ICommand _UseMachineCommand; private ICommand _UseMachineCommand;
public ICommand UseMachineCommand public ICommand UseMachineCommand
{ {
get => _UseMachineCommand; get => _UseMachineCommand;
@ -86,12 +65,10 @@ namespace Borepin.PageModel
private async void UseMachineCommandExecuted() private async void UseMachineCommandExecuted()
{ {
GiveBack = await MachineItem.Instance.Use(); Machine.IUseInterface useInterface = _Machine.Use;
CanGiveBack = GiveBack != null;
MachineItem.MInfo = await MachineItem.Instance.GetMInfo(); await useInterface.Use();
await LoadData();
CanUse = MachineItem.MInfo.State == FabAccessAPI.Schema.State.free;
} }
private ICommand _GiveBackMachineCommand; private ICommand _GiveBackMachineCommand;
@ -103,14 +80,10 @@ namespace Borepin.PageModel
private async void GiveBackMachineCommandExecuted() private async void GiveBackMachineCommandExecuted()
{ {
await GiveBack.Ret(); Machine.IInUseInterface inUseInterface = _Machine.Inuse;
GiveBack = null; await inUseInterface.GiveBack();
CanGiveBack = GiveBack != null; await LoadData();
MachineItem.MInfo = await MachineItem.Instance.GetMInfo();
CanUse = MachineItem.MInfo.State == FabAccessAPI.Schema.State.free;
} }
#endregion #endregion
@ -122,7 +95,7 @@ namespace Borepin.PageModel
public override void OnNavigatedTo(INavigationParameters parameters) public override void OnNavigatedTo(INavigationParameters parameters)
{ {
MachineItem = parameters["instance"] as Machine; _Name = parameters["name"] as string;
IsBusy = true; IsBusy = true;
Task.Run(LoadData); Task.Run(LoadData);

View File

@ -111,7 +111,7 @@ namespace Borepin.PageModel
} }
private async void AddInstancesCommandExecuted() private async void AddInstancesCommandExecuted()
{ {
INavigationResult result = await _NavigationService.NavigateAsync("HostSelectPage"); INavigationResult result = await _NavigationService.NavigateAsync("AddServerProcess_HostSelectPage");
if (!result.Success) if (!result.Success)
{ {
System.Diagnostics.Debugger.Break(); System.Diagnostics.Debugger.Break();

View File

@ -5,6 +5,7 @@ using Borepin.Service.Connections;
using Borepin.Service.Credentials; using Borepin.Service.Credentials;
using Prism.Commands; using Prism.Commands;
using Prism.Navigation; using Prism.Navigation;
using Prism.Services;
using Prism.Services.Dialogs; using Prism.Services.Dialogs;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Input; using System.Windows.Input;
@ -18,16 +19,18 @@ namespace Borepin.PageModel
private readonly IConnectionService _ConnectionService; private readonly IConnectionService _ConnectionService;
private readonly IBFFHService _BFFHService; private readonly IBFFHService _BFFHService;
private readonly ICredentialService _CredentialService; private readonly ICredentialService _CredentialService;
private readonly IPageDialogService _PageDialogService;
#endregion #endregion
#region Constructors #region Constructors
public ServerPageModel(INavigationService navigationService, IDialogService dialogService, IConnectionService connectionService, IBFFHService bffhService, ICredentialService credentialService) : base(navigationService) public ServerPageModel(INavigationService navigationService, IDialogService dialogService, IConnectionService connectionService, IBFFHService bffhService, ICredentialService credentialService, IPageDialogService pageDialogService) : base(navigationService)
{ {
_DialogService = dialogService; _DialogService = dialogService;
_ConnectionService = connectionService; _ConnectionService = connectionService;
_BFFHService = bffhService; _BFFHService = bffhService;
_CredentialService = credentialService; _CredentialService = credentialService;
_PageDialogService = pageDialogService;
ConnectCommand = new DelegateCommand(async () => await ConnectCommandExecuted()); ConnectCommand = new DelegateCommand(async () => await ConnectCommandExecuted());
DeleteCommand = new DelegateCommand(DeleteCommandExecuted); DeleteCommand = new DelegateCommand(DeleteCommandExecuted);
@ -71,14 +74,31 @@ namespace Borepin.PageModel
if(IsConnected) if(IsConnected)
{ {
_BFFHService.Disconnect(); await _BFFHService.Disconnect();
IsConnected = false; IsConnected = false;
} }
else else
{ {
await _BFFHService.Connect(Connection_Item); try
await _BFFHService.Authenticate(); {
await _BFFHService.Connect(Connection_Item);
}
catch(Capnp.Rpc.RpcException exception) when (exception.Message == "TcpRpcClient is unable to connect")
{
await _PageDialogService.DisplayAlertAsync("Connection failed", "Unable to connect to server.", "Ok");
IsBusy = false;
return;
}
if(!await _BFFHService.Authenticate())
{
await _PageDialogService.DisplayAlertAsync("Connection failed", "Unable to authenticate to server.", "Ok");
IsBusy = false;
return;
}
IsConnected = true; IsConnected = true;
} }
@ -113,7 +133,7 @@ namespace Borepin.PageModel
if(_BFFHService.ActiveConnection != null && connection == _BFFHService.ActiveConnection) if(_BFFHService.ActiveConnection != null && connection == _BFFHService.ActiveConnection)
{ {
_BFFHService.Disconnect(); await _BFFHService.Disconnect();
} }
await _ConnectionService.RemoveConnection(connection); await _ConnectionService.RemoveConnection(connection);

View File

@ -31,7 +31,8 @@ namespace Borepin.PageModel.SetUpProcess
} }
private async void NextCommandCommandExecuted(object obj) private async void NextCommandCommandExecuted(object obj)
{ {
INavigationResult result = await _NavigationService.NavigateAsync("SetUpProcess_ScanPage"); //INavigationResult result = await _NavigationService.NavigateAsync("SetUpProcess_ScanPage");
INavigationResult result = await _NavigationService.NavigateAsync("AddServerProcess_HostSelectPage");
if (!result.Success) if (!result.Success)
{ {
System.Diagnostics.Debugger.Break(); System.Diagnostics.Debugger.Break();

View File

@ -0,0 +1,82 @@
using Borepin.Base;
using Borepin.Model;
using Borepin.Service.Connections;
using Prism.Commands;
using Prism.Navigation;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows.Input;
namespace Borepin.PageModel
{
public class StartUpDistributorPageModel : PageModelBase
{
#region Private Properties
private readonly IConnectionService _ConnectionService;
#endregion
#region Constructors
public StartUpDistributorPageModel(INavigationService navigationService, IConnectionService connectionService) : base(navigationService)
{
_ConnectionService = connectionService;
DistributePageCommand = new DelegateCommand<string>(DistributePageCommandExecuted);
DistributePageCommand.Execute(null);
}
#endregion
#region LoadData
public override Task LoadData()
{
return Task.CompletedTask;
}
#endregion
#region Command
private ICommand _DistributePageCommand;
public ICommand DistributePageCommand
{
get => _DistributePageCommand;
set => SetProperty(ref _DistributePageCommand, value);
}
private async void DistributePageCommandExecuted(string view)
{
List<Connection> connection_list = await _ConnectionService.GetConnectionList();
if (connection_list.Count == 0)
{
INavigationResult result = await _NavigationService.NavigateAsync("MainPage/NavigationPage/SetUpProcess_WelcomePage");
if (!result.Success)
{
System.Diagnostics.Debugger.Break();
}
}
else
{
INavigationResult result = await _NavigationService.NavigateAsync("MainPage/NavigationPage/ServerListPage");
if (!result.Success)
{
System.Diagnostics.Debugger.Break();
}
}
}
#endregion
#region Properties
#endregion
#region INavigationAware
public override void OnNavigatedFrom(INavigationParameters parameters)
{
}
public override void OnNavigatedTo(INavigationParameters parameters)
{
}
#endregion
}
}

View File

@ -10,48 +10,35 @@
namespace Borepin.Resources.Text { namespace Borepin.Resources.Text {
using System; using System;
using System.Reflection;
/// <summary> [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
/// A strongly-typed resource class, for looking up localized strings, etc. [System.Diagnostics.DebuggerNonUserCodeAttribute()]
/// </summary> [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class TextResource { internal class TextResource {
private static global::System.Resources.ResourceManager resourceMan; private static System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture; private static System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal TextResource() { internal TextResource() {
} }
/// <summary> [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
/// Returns the cached ResourceManager instance used by this class. internal static System.Resources.ResourceManager ResourceManager {
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get { get {
if (object.ReferenceEquals(resourceMan, null)) { if (object.Equals(null, resourceMan)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Borepin.Resources.Text.TextResource", typeof(TextResource).Assembly); System.Resources.ResourceManager temp = new System.Resources.ResourceManager("Borepin.Resources.Text.TextResource", typeof(TextResource).Assembly);
resourceMan = temp; resourceMan = temp;
} }
return resourceMan; return resourceMan;
} }
} }
/// <summary> [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
/// Overrides the current thread's CurrentUICulture property for all internal static System.Globalization.CultureInfo Culture {
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get { get {
return resourceCulture; return resourceCulture;
} }
@ -60,45 +47,30 @@ namespace Borepin.Resources.Text {
} }
} }
/// <summary>
/// Looks up a localized string similar to Login to your Space.
/// </summary>
internal static string SetUp_ScanPage_Button { internal static string SetUp_ScanPage_Button {
get { get {
return ResourceManager.GetString("SetUp_ScanPage_Button", resourceCulture); return ResourceManager.GetString("SetUp_ScanPage_Button", resourceCulture);
} }
} }
/// <summary>
/// Looks up a localized string similar to Wenn du dieses Logo siehst, dann kannst du es scannen.
/// </summary>
internal static string SetUp_ScanPage_Text { internal static string SetUp_ScanPage_Text {
get { get {
return ResourceManager.GetString("SetUp_ScanPage_Text", resourceCulture); return ResourceManager.GetString("SetUp_ScanPage_Text", resourceCulture);
} }
} }
/// <summary>
/// Looks up a localized string similar to Start working.
/// </summary>
internal static string SetUp_WelcomePage_Button { internal static string SetUp_WelcomePage_Button {
get { get {
return ResourceManager.GetString("SetUp_WelcomePage_Button", resourceCulture); return ResourceManager.GetString("SetUp_WelcomePage_Button", resourceCulture);
} }
} }
/// <summary>
/// Looks up a localized string similar to Hier muss ein kurzer Text hin was FabAccess ist und was man damit machen kann.
/// </summary>
internal static string SetUp_WelcomePage_Text { internal static string SetUp_WelcomePage_Text {
get { get {
return ResourceManager.GetString("SetUp_WelcomePage_Text", resourceCulture); return ResourceManager.GetString("SetUp_WelcomePage_Text", resourceCulture);
} }
} }
/// <summary>
/// Looks up a localized string similar to Welcome.
/// </summary>
internal static string SetUp_WelcomePage_Title { internal static string SetUp_WelcomePage_Title {
get { get {
return ResourceManager.GetString("SetUp_WelcomePage_Title", resourceCulture); return ResourceManager.GetString("SetUp_WelcomePage_Title", resourceCulture);

View File

@ -124,10 +124,10 @@
<value>Wenn du dieses Logo siehst, dann kannst du es scannen</value> <value>Wenn du dieses Logo siehst, dann kannst du es scannen</value>
</data> </data>
<data name="SetUp_WelcomePage_Button" xml:space="preserve"> <data name="SetUp_WelcomePage_Button" xml:space="preserve">
<value>Start working</value> <value>Begin working</value>
</data> </data>
<data name="SetUp_WelcomePage_Text" xml:space="preserve"> <data name="SetUp_WelcomePage_Text" xml:space="preserve">
<value>Hier muss ein kurzer Text hin was FabAccess ist und was man damit machen kann</value> <value>Automate your Space with FabAccess</value>
</data> </data>
<data name="SetUp_WelcomePage_Title" xml:space="preserve"> <data name="SetUp_WelcomePage_Title" xml:space="preserve">
<value>Welcome</value> <value>Welcome</value>

View File

@ -1,13 +1,27 @@
using Borepin.Model; using Borepin.Model;
using Borepin.Service.Credentials; using Borepin.Service.Credentials;
using System.Threading.Tasks; using System.Threading.Tasks;
using Capnp.Rpc;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading; using FabAccessAPI.Schema;
using System; using System;
namespace Borepin.Service.BFFH namespace Borepin.Service.BFFH
{ {
public class ConnectionActiveException : Exception
{
public ConnectionActiveException()
{
}
public ConnectionActiveException(string message) : base(message)
{
}
public ConnectionActiveException(string message, Exception inner) : base(message, inner)
{
}
}
public class BFFHService : IBFFHService public class BFFHService : IBFFHService
{ {
private readonly ICredentialService _CredentialService; private readonly ICredentialService _CredentialService;
@ -19,18 +33,18 @@ namespace Borepin.Service.BFFH
_CredentialService = credentialService; _CredentialService = credentialService;
} }
public Model.Connection ActiveConnection { get; private set; } public Connection ActiveConnection { get; private set; }
public bool IsAuthenticated { get; private set; } public bool IsAuthenticated { get; private set; }
public async Task Connect(Model.Connection connection) public async Task Connect(Connection connection)
{ {
if (_Connection != null || ActiveConnection != null) if (_Connection != null || ActiveConnection != null)
{ {
throw new System.Exception("Still connected"); throw new ConnectionActiveException();
} }
TcpRpcClient rpcClient = new TcpRpcClient(); Capnp.Rpc.TcpRpcClient rpcClient = new Capnp.Rpc.TcpRpcClient();
rpcClient.Connect(connection.Address.Host, connection.Address.Port); rpcClient.Connect(connection.Address.Host, connection.Address.Port);
@ -43,11 +57,13 @@ namespace Borepin.Service.BFFH
ActiveConnection = connection; ActiveConnection = connection;
} }
public void Disconnect() public async Task Disconnect()
{ {
_Connection.RpcClient?.Dispose(); _Connection.RpcClient?.Dispose();
_Connection = null; _Connection = null;
ActiveConnection = null; ActiveConnection = null;
await Task.CompletedTask;
} }
public bool CanAuthenticate() public bool CanAuthenticate()
@ -59,25 +75,36 @@ namespace Borepin.Service.BFFH
{ {
string password = await _CredentialService.GetPasswordAsync(ActiveConnection); string password = await _CredentialService.GetPasswordAsync(ActiveConnection);
await _Connection.Auth("PLAIN", new Dictionary<string, object> { { "Username", ActiveConnection.Username }, { "Password", password } }); return await _Connection.Auth("PLAIN", new Dictionary<string, object> { { "Username", ActiveConnection.Username }, { "Password", password } });
return await Task.FromResult(true);
} }
public async Task<bool> Authenticate(Model.Connection connection, string password) public async Task<bool> Authenticate(Connection connection, string password)
{ {
await _Connection.Auth("PLAIN", new Dictionary<string, object> { { "Username", ActiveConnection.Username }, { "Password", password } }); bool result = await _Connection.Auth("PLAIN", new Dictionary<string, object> { { "Username", ActiveConnection.Username }, { "Password", password } });
await _CredentialService.AddCredentialsAsync(connection, password); if(result == true)
{
await _CredentialService.AddCredentialsAsync(connection, password);
ActiveConnection = connection; ActiveConnection = connection;
}
return await Task.FromResult(true); return result;
} }
public Task<FabAccessAPI.Machines> GetMachineInterface() public Task<IMachineSystem> GetMachineSystemInterface()
{ {
return _Connection.AccessMachines(); return _Connection.AccessMachineSystem();
}
public Task<IUserSystem> GetUserSystemInterface()
{
return _Connection.AccessUserSystem();
}
public Task<IPermissionSystem> GetPermissionSystemInterface()
{
return _Connection.AccessPermissionSystem();
} }
} }
} }

View File

@ -1,4 +1,5 @@
using Borepin.Model; using Borepin.Model;
using FabAccessAPI.Schema;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Borepin.Service.BFFH namespace Borepin.Service.BFFH
@ -30,7 +31,7 @@ namespace Borepin.Service.BFFH
/// <summary> /// <summary>
/// Disconnect from BFFH Instance /// Disconnect from BFFH Instance
/// </summary> /// </summary>
void Disconnect(); Task Disconnect();
/// <summary> /// <summary>
@ -46,6 +47,8 @@ namespace Borepin.Service.BFFH
/// <param name="connection">address + username</param> /// <param name="connection">address + username</param>
Task<bool> Authenticate(Connection connection, string password); Task<bool> Authenticate(Connection connection, string password);
Task<FabAccessAPI.Machines> GetMachineInterface(); Task<IMachineSystem> GetMachineSystemInterface();
Task<IUserSystem> GetUserSystemInterface();
Task<IPermissionSystem> GetPermissionSystemInterface();
} }
} }

View File

@ -1,28 +1,37 @@
using Borepin.Model; using Prism.Mvvm;
using Prism.Mvvm; using FabAccessAPI.Schema;
namespace Borepin.ViewModel namespace Borepin.ViewModel
{ {
public class ServerListItemViewModel : BindableBase public class MachineListItemViewModel : BindableBase
{ {
public ServerListItemViewModel(Connection instance) public MachineListItemViewModel(Machine instance)
{ {
_Instance = instance; _Instance = instance;
Address = instance.Address.ToString();
Name = instance.Name;
State = instance.State;
} }
private Connection _Instance; private Machine _Instance;
public Connection Instance public Machine Instance
{ {
get => _Instance; get => _Instance;
set => SetProperty(ref _Instance, value); set => SetProperty(ref _Instance, value);
} }
private string _Address; private string _Name;
public string Address public string Name
{ {
get => _Address; get => _Name;
set => SetProperty(ref _Address, value); set => SetProperty(ref _Name, value);
}
private Machine.MachineState _State;
public Machine.MachineState State
{
get => _State;
set => SetProperty(ref _State, value);
} }
} }
} }

View File

@ -1,36 +1,28 @@
using Prism.Mvvm; using Borepin.Model;
using Prism.Mvvm;
namespace Borepin.ViewModel namespace Borepin.ViewModel
{ {
public class MachineListItemViewModel : BindableBase public class ServerListItemViewModel : BindableBase
{ {
public MachineListItemViewModel(Model.Machine instance) public ServerListItemViewModel(Connection instance)
{ {
_Instance = instance; _Instance = instance;
Address = instance.Address.ToString();
Name = instance.MInfo.Name;
State = instance.MInfo.State;
} }
private Model.Machine _Instance; private Connection _Instance;
public Model.Machine Instance public Connection Instance
{ {
get => _Instance; get => _Instance;
set => SetProperty(ref _Instance, value); set => SetProperty(ref _Instance, value);
} }
private string _Name; private string _Address;
public string Name public string Address
{ {
get => _Name; get => _Address;
set => SetProperty(ref _Name, value); set => SetProperty(ref _Address, value);
}
private FabAccessAPI.Schema.State _State;
public FabAccessAPI.Schema.State State
{
get => _State;
set => SetProperty(ref _State, value);
} }
} }
} }

View File

@ -10,17 +10,19 @@ namespace FabAccessAPI
/// Authentication Identity /// Authentication Identity
/// ///
/// Under the hood a string because the form depends heavily on the method /// Under the hood a string because the form depends heavily on the method
public struct AuthCId { public struct AuthCId
{
public string Id { get; private set; } public string Id { get; private set; }
public AuthCId(string id) : this() { Id = id; } public AuthCId(string id) : this() { Id = id; }
} }
/// Authorization Identity /// Authorization Identity
/// ///
/// This identity is internal to FabAccess and completely independent from the authentication /// This identity is internal to FabAccess and completely independent from the authentication
/// method or source /// method or source
public struct AuthZId { public struct AuthZId
{
/// Main User ID. Generally an user name or similar /// Main User ID. Generally an user name or similar
public string Uid; public string Uid;
@ -43,7 +45,8 @@ namespace FabAccessAPI
/// This struct contains the user as is passed to the actual authentication/authorization /// This struct contains the user as is passed to the actual authentication/authorization
/// subsystems /// subsystems
/// ///
public struct AuthUser { public struct AuthUser
{
/// Contains the Authentication ID used /// Contains the Authentication ID used
/// ///
/// The authentication ID is an identifier for the authentication exchange. This is different /// The authentication ID is an identifier for the authentication exchange. This is different
@ -83,7 +86,8 @@ namespace FabAccessAPI
// a programming failure — the authcid come from the same source as that tuple // a programming failure — the authcid come from the same source as that tuple
// b) the given authcid may authenticate as the given authzid. E.g. if a given client certificate // b) the given authcid may authenticate as the given authzid. E.g. if a given client certificate
// has been configured for that user, if a GSSAPI user maps to a given user, // has been configured for that user, if a GSSAPI user maps to a given user,
public enum AuthError { public enum AuthError
{
/// Authentication ID is bad/unknown/.. /// Authentication ID is bad/unknown/..
BadAuthcid, BadAuthcid,
/// Authorization ID is unknown/.. /// Authorization ID is unknown/..
@ -95,59 +99,71 @@ namespace FabAccessAPI
} }
public class UnauthorizedException : Exception{} public class UnauthorizedException : Exception { }
public class UnsupportedMechanismException : Exception{} public class UnsupportedMechanismException : Exception { }
/// <summary> /// <summary>
/// THIS IS VERY INCOMPLETE! /// THIS IS VERY INCOMPLETE!
/// </summary> /// </summary>
public class Auth { public class Auth
{
#region Log #region Log
private static readonly log4net.ILog _Log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); //private static readonly log4net.ILog _Log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion #endregion
private IAuthentication _authCap; private IAuthenticationSystem _authCap;
public Auth(IAuthentication authCap) { public Auth(IAuthenticationSystem authCap)
{
_authCap = authCap; _authCap = authCap;
} }
public Task<IReadOnlyList<string>> GetMechanisms() { public Task<IReadOnlyList<string>> GetMechanisms()
{
return _authCap.Mechanisms(); return _authCap.Mechanisms();
} }
public async Task<bool> Authenticate(string mech, Dictionary<string, object> properties) { public async Task<bool> Authenticate(string mech, Dictionary<string, object> properties)
{
var m = SaslFactory.Create(mech); var m = SaslFactory.Create(mech);
foreach (KeyValuePair<string, object> entry in properties) { foreach (KeyValuePair<string, object> entry in properties)
{
m.Properties.Add(entry.Key, entry.Value); m.Properties.Add(entry.Key, entry.Value);
} }
var initialResponse = new Request.initialResponse(); var initialResponse = new Request.initialResponse();
if (m.HasInitial) { if (m.HasInitial)
{
initialResponse.Initial = m.GetResponse(new byte[0]); initialResponse.Initial = m.GetResponse(new byte[0]);
} }
var req = new Request { var req = new Request
{
Mechanism = m.Name, Mechanism = m.Name,
InitialResponse = initialResponse InitialResponse = initialResponse
}; };
var resp = await _authCap.Start(req); var resp = await _authCap.Start(req);
while (!m.IsCompleted) { while (!m.IsCompleted)
if (resp.which == Response.WHICH.Challence) { {
if (resp.which == Response.WHICH.Challence)
{
var additional = m.GetResponse(resp.Challence.ToArray()); var additional = m.GetResponse(resp.Challence.ToArray());
resp = await _authCap.Step(additional); resp = await _authCap.Step(additional);
} }
else { else
{
break; break;
} }
} }
if (resp.which == Response.WHICH.Outcome) { if (resp.which == Response.WHICH.Outcome)
if (resp.Outcome.Result == Response.Result.successful) { {
if (resp.Outcome.Result == Response.Result.successful)
{
return true; return true;
} }
else { else
{
//TODO: Provide meaningful info about auth failure //TODO: Provide meaningful info about auth failure
return false; return false;
} }
@ -155,9 +171,5 @@ namespace FabAccessAPI
return false; return false;
} }
} }
} }

View File

@ -6,29 +6,31 @@ using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace FabAccessAPI { namespace FabAccessAPI
public class Connection { {
public class Connection
{
#region private variables #region private variables
private readonly TcpRpcClient? _rpcClient = null; private readonly TcpRpcClient? _rpcClient = null;
private readonly IBootstrap? _bootstrapCap = null; private readonly IBootstrap? _bootstrapCap = null;
private Auth? _auth = null; private Auth? _auth = null;
private Machines? _machines = null;
#endregion #endregion
public TcpRpcClient? RpcClient => _rpcClient; public TcpRpcClient? RpcClient => _rpcClient;
#region Log #region Log
private static readonly log4net.ILog _Log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); //private static readonly log4net.ILog _Log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion #endregion
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="rpcClient">Should be an already configured and connected TcpRpcClient</param> /// <param name="rpcClient">Should be an already configured and connected TcpRpcClient</param>
public Connection(TcpRpcClient rpcClient) { public Connection(TcpRpcClient rpcClient)
{
_rpcClient = rpcClient; _rpcClient = rpcClient;
_bootstrapCap = _rpcClient.GetMain<IBootstrap>(); _bootstrapCap = _rpcClient.GetMain<IBootstrap>();
_Log.Debug($"Done bootstraping API connection."); //_Log.Debug($"Done bootstraping API connection.");
} }
/// <summary> /// <summary>
@ -38,27 +40,51 @@ namespace FabAccessAPI {
/// <param name="mech">The desired authentication mechanism</param> /// <param name="mech">The desired authentication mechanism</param>
/// <param name="kvs">Key-Value data specific to the mechanism</param> /// <param name="kvs">Key-Value data specific to the mechanism</param>
/// <returns></returns> /// <returns></returns>
public async Task Auth(string mech, Dictionary<string, object> kvs, CancellationToken cancellationToken_ = default) { public async Task<bool> Auth(string mech, Dictionary<string, object> kvs, CancellationToken cancellationToken_ = default)
{
// _bootstrapCap = await _bootstrapCap.Unwrap(); // _bootstrapCap = await _bootstrapCap.Unwrap();
var authCap = await _bootstrapCap.Auth(cancellationToken_); if(_auth == null)
_auth = new Auth(authCap); {
var authCap = await _bootstrapCap.AuthenticationSystem(cancellationToken_);
_auth = new Auth(authCap);
}
var mechs = await _auth.GetMechanisms(); var mechs = await _auth.GetMechanisms();
_Log.Debug($"The Server supports the following auth mechs: {string.Join(", ", mechs)}"); //_Log.Debug($"The Server supports the following auth mechs: {string.Join(", ", mechs)}");
if (!mechs.Contains(mech)) { if (!mechs.Contains(mech))
{
throw new UnsupportedMechanismException(); throw new UnsupportedMechanismException();
} }
await _auth.Authenticate(mech, kvs); return await _auth.Authenticate(mech, kvs);
} }
/// <summary> /// <summary>
/// Get a wrapped capability to interact with machines /// Get a wrapped capability to interact with machines
/// </summary> /// </summary>
/// <returns>A wrapped capability to interact with machines</returns> /// <returns>A wrapped capability to interact with machines</returns>
public async Task<Machines> AccessMachines() { public async Task<IMachineSystem> AccessMachineSystem()
_machines ??= new Machines(await _bootstrapCap.Machines()); {
return _machines; return await _bootstrapCap.MachineSystem();
}
/// <summary>
/// Get a wrapped capability to interact with users
/// </summary>
/// <returns>A wrapped capability to interact with users</returns>
public async Task<IUserSystem> AccessUserSystem()
{
return await _bootstrapCap.UserSystem();
}
/// <summary>
/// Get a wrapped capability to interact with permissions
/// </summary>
/// <returns>A wrapped capability to interact with permissions</returns>
public async Task<IPermissionSystem> AccessPermissionSystem()
{
return await _bootstrapCap.PermissionSystem();
} }
} }
} }

View File

@ -11,13 +11,13 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Capnp.Net.Runtime" Version="1.3.118" />
<PackageReference Include="CapnpC.CSharp.MsBuild.Generation" Version="1.3.118" /> <PackageReference Include="CapnpC.CSharp.MsBuild.Generation" Version="1.3.118" />
<PackageReference Include="log4net" Version="2.0.12" /> <PackageReference Include="log4net" Version="2.0.12" />
<PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="5.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="5.0.4" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\external\capnproto-dotnetcore\Capnp.Net.Runtime\Capnp.Net.Runtime.csproj" />
<ProjectReference Include="..\external\SASL\S22.Sasl.csproj" /> <ProjectReference Include="..\external\SASL\S22.Sasl.csproj" />
</ItemGroup> </ItemGroup>

View File

@ -1,224 +0,0 @@
using FabAccessAPI.Schema;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace FabAccessAPI
{
public class MachineException : Exception { }
/// <summary>
/// Wraps a capability for accessing the Machines subsystem of BFFH
/// </summary>
public class Machines {
private readonly IMachines _machinesCap;
/// <summary>
/// Constructs the Wrapper Class from a given capability.
/// </summary>
/// <param name="machinesCap">The capability that should be wrapped.</param>
public Machines(IMachines machinesCap) {
_machinesCap = machinesCap;
}
/// <summary>
/// List of all machines that BFFH knows about the user has been granted at least read access on
/// </summary>
/// <returns>ReadOnlyList of available Machines</returns>
public async Task<IReadOnlyList<Machine>?> ListMachines()
{
IReadOnlyList<Schema.Machine>? machineList = await _machinesCap.ListMachines().ConfigureAwait(false);
List<Machine> machineList_new = new List<Machine>();
foreach(Schema.Machine machine in machineList)
{
machineList_new.Add(new Machine(machine));
}
return machineList_new;
}
/// <summary>
/// Access a particular machine by known name. This may fail for two reasons:
/// The user has not been granted access to know the machine exists or the machine does in fact not exist.
/// In both cases the `machine` result will be a NULL-pointer
/// </summary>
/// <param name="name">Name of the Machine</param>
/// <returns>The Machine we requested</returns>
public async Task<Machine> GetMachine(string name) {
var mach = (await _machinesCap.GetMachine(name).ConfigureAwait(false)).Item1;
if (mach == null) {
//TODO: Throw a more specific exception!
throw new MachineException();
}
return new Machine(mach);
}
}
/// <summary>
/// A machine. This represents a machine as BFFH thinks about it which may mean
///several machines or just part of a machine in the real world.
///By itself this struct is completely useless since it contains only the information
///that the machine exists the user is allowed to know about that fact. For all further
///information the user has to call the contained capabilities which depending on the
///access level may not be set. For example an admin will have every capability here
///set but a simple user may only have `read` and `write` set while some users may not
/// even have `read` set and are unable to even see if the machine is currently in use.
/// </summary>
public class Machine {
private readonly Schema.Machine _machine;
/// <summary>
/// Constructs the Wrapper Class from a given capability
/// </summary>
/// <param name="machine">The capability that should be wrapped.</param>
public Machine(Schema.Machine machine) {
_machine = machine;
}
// read operations
/// <summary>
/// Get the MInfo Struct for the Machine.
/// This contains everything BFFH knows about the Machine.
/// </summary>
/// <exception cref="UnauthorizedException"></exception>
/// <returns>The MInfo Struct describing the Machine</returns>
public async Task<Schema.Machine.MInfo> GetMInfo() {
var readCap = _machine.Read;
if (readCap == null) {
throw new UnauthorizedException();
}
return (await _machine.Read.Info().ConfigureAwait(false)).Item1;
}
//write operations
/// <summary>
/// Try to use a machine. Throws a UnauthorizedException if the user does not have the required
/// permissions to use this machine.
///
/// Use the Ret() Method of the returned Object to return the machine
/// </summary>
/// <exception cref="UnauthorizedException"></exception>
/// <returns>Capability to give back the machine</returns>
public Task<Schema.Machine.WriteInterface.IGiveBack> Use() {
var writeCap = _machine.Write;
if (writeCap == null) {
throw new UnauthorizedException();
}
return writeCap.Use();
}
/// <summary>
/// Try to get a GiveBack capability for a machine.
/// </summary>
/// <returns>Capability to give back the machine or null</returns>
/// <exception cref="UnauthorizedException"></exception>
public Task<Schema.Machine.WriteInterface.IGiveBack> GetGiveBack()
{
var writeCap = _machine.Write;
if (writeCap == null)
{
throw new UnauthorizedException();
}
return writeCap.GetGiveBack();
}
/// <summary>
/// Try to reserve a machine. Throws a UnauthorizedException if the user does not have the required
/// permissions to use this machine.
///
/// Use the Ret() Method of the returned Object to return the machine
/// Use the Use() Nethod of the Machine to use your reserved machine.
/// </summary>
/// <exception cref="UnauthorizedException"></exception>
/// <returns>Capability to give back the machine</returns>
public Task<Schema.Machine.WriteInterface.IGiveBack> Reserve()
{
var writeCap = _machine.Write;
if (writeCap == null)
{
throw new UnauthorizedException();
}
return writeCap.Reserve();
}
// public void GiveBack(Schema.Machine.WriteInterface.IGiveBack cap) {
// cap.Ret();
// }
//manage operations
/// <summary>
/// After a machine has been used by an user with low enough permissions it's
/// in the 'toCheck' state. This call then allows more priviledged users to
/// "check" the machine and move it to the `free` state.
///
/// Calling this method signifies that the machine was checked and in an acceptable state.
/// </summary>
public async void MarkOk() {
var manageCap = _machine.Manage;
if (manageCap == null) {
throw new UnauthorizedException();
}
// TODO: Do we really want to check this here?
if ((await GetMInfo().ConfigureAwait(false)).State == State.toCheck) {
await _machine.Manage.Ok().ConfigureAwait(false);
}
}
/// <summary>
/// After a machine has been used by an user with low enough permissions it's
/// in the 'toCheck' state. This call then allows more priviledged users to
/// "check" the machine and move it to the `free` state.
///
/// Calling this method signifies that the machine was checked and in an unacceptable state.
/// It will most likely be marked as `blocked` and the previous user will somehow be informed.
/// </summary>
public async void MarkNotOk() {
var manageCap = _machine.Manage;
if (manageCap == null) {
throw new UnauthorizedException();
}
// TODO: Do we really want to check this here?
if ((await GetMInfo().ConfigureAwait(false)).State == State.toCheck) {
await _machine.Manage.NotOk().ConfigureAwait(false);
}
}
//administrative operations
/// <summary>
/// Forcefully set a machine state.
/// </summary>
/// <param name="state">The desired machine state.</param>
public async void ForceSetState(State state) {
var adminCap = _machine.Admin;
if (adminCap == null) {
throw new UnauthorizedException();
}
await adminCap.ForceSetState(state).ConfigureAwait(false);
}
/// <summary>
/// Set the given user as current responsible
/// </summary>
/// <param name="user">The user</param>
public async void ForceSetUser(String user) {
var adminCap = _machine.Admin;
if (adminCap == null) {
throw new UnauthorizedException();
}
await adminCap.ForceSetUser(user).ConfigureAwait(false);
}
}
}

View File

@ -1,9 +0,0 @@
//This is where the permissions subsystem will live
namespace FabAccessAPI
{
public class Permissions {
#region Log
private static readonly log4net.ILog _Log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion
}
}

@ -1 +1 @@
Subproject commit 2dc488d13b2a8eaa743fb759b4929d50843ccb23 Subproject commit 1441b59145bb364c2c61fe67f52c64a3522ee124

View File

@ -6,7 +6,6 @@ using Capnp;
using Capnp.Rpc; using Capnp.Rpc;
using log4net.Config; using log4net.Config;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using static FabAccessAPI.Schema.Machine.WriteInterface;
namespace FabAccessAPI_Test { namespace FabAccessAPI_Test {
public class Tests { public class Tests {
@ -51,50 +50,5 @@ namespace FabAccessAPI_Test {
public async Task Authenticate() { public async Task Authenticate() {
await _connection.Auth("PLAIN", new Dictionary<string, object>{{"Username", "Testuser"}, {"Password", "secret"}}); await _connection.Auth("PLAIN", new Dictionary<string, object>{{"Username", "Testuser"}, {"Password", "secret"}});
} }
[Test]
public async Task GetMInfo() {
await _connection.Auth("PLAIN", new Dictionary<string, object>{{"Username", "Testuser"}, {"Password", "secret"}});
Machines machines = await _connection.AccessMachines();
Machine testmachine = await machines.GetMachine("Testmachine");
Assert.NotNull(testmachine);
FabAccessAPI.Schema.Machine.MInfo minfo = await testmachine.GetMInfo();
Assert.NotNull(minfo);
_Log.Info($"Name: {minfo.Name}, Description: {minfo.Description}, State: {minfo.State}");
}
[Test]
public async Task ListMachines()
{
await _connection.Auth("PLAIN", new Dictionary<string, object> { { "Username", "Testuser" }, { "Password", "secret" } });
Machines machines = await _connection.AccessMachines();
IReadOnlyList<Machine> machineList = await machines.ListMachines();
Assert.NotNull(machineList);
Assert.AreNotEqual(0, machineList.Count);
}
[Test]
public async Task UseMachine()
{
await _connection.Auth("PLAIN", new Dictionary<string, object> { { "Username", "Testuser" }, { "Password", "secret" } });
Machines machines = await _connection.AccessMachines();
Machine testmachine = await machines.GetMachine("Testmachine");
Assert.NotNull(testmachine);
await testmachine.Use();
FabAccessAPI.Schema.Machine.MInfo minfo = await testmachine.GetMInfo();
Assert.NotNull(minfo);
Assert.AreEqual(FabAccessAPI.Schema.State.inUse, minfo.State);
//await giveBack.Ret();
//minfo = await testmachine.GetMInfo();
//Assert.NotNull(minfo);
//Assert.AreEqual(FabAccessAPI.Schema.State.free, minfo.State);
}
} }
} }

View File

@ -7,10 +7,10 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="5.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="5.0.4" />
<PackageReference Include="NUnit" Version="3.12.0" /> <PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" /> <PackageReference Include="NUnit3TestAdapter" Version="4.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

3
Gemfile Normal file
View File

@ -0,0 +1,3 @@
source "https://rubygems.org"
gem "fastlane"

213
Gemfile.lock Normal file
View File

@ -0,0 +1,213 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.2.0)
aws-partitions (1.502.0)
aws-sdk-core (3.121.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.48.0)
aws-sdk-core (~> 3, >= 3.120.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.103.0)
aws-sdk-core (~> 3, >= 3.120.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
aws-sigv4 (1.4.0)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
claide (1.0.3)
colored (1.2)
colored2 (3.1.2)
commander (4.6.0)
highline (~> 2.0.0)
declarative (0.0.20)
digest-crc (0.6.4)
rake (>= 12.0.0, < 14.0.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.7.6)
emoji_regex (3.2.2)
excon (0.85.0)
faraday (1.7.2)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0.1)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.1)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
multipart-post (>= 1.2, < 3)
ruby2_keywords (>= 0.0.4)
faraday-cookie_jar (0.0.7)
faraday (>= 0.8.0)
http-cookie (~> 1.0.0)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday_middleware (1.1.0)
faraday (~> 1.0)
fastimage (2.2.5)
fastlane (2.194.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
aws-sdk-s3 (~> 1.0)
babosa (>= 1.0.3, < 2.0.0)
bundler (>= 1.12.0, < 3.0.0)
colored
commander (~> 4.6)
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (>= 0.1, < 4.0)
excon (>= 0.71.0, < 1.0.0)
faraday (~> 1.0)
faraday-cookie_jar (~> 0.0.6)
faraday_middleware (~> 1.0)
fastimage (>= 2.1.0, < 3.0.0)
gh_inspector (>= 1.1.2, < 2.0.0)
google-apis-androidpublisher_v3 (~> 0.3)
google-apis-playcustomapp_v1 (~> 0.1)
google-cloud-storage (~> 1.31)
highline (~> 2.0)
json (< 3.0.0)
jwt (>= 2.1.0, < 3)
mini_magick (>= 4.9.4, < 5.0.0)
multipart-post (~> 2.0.0)
naturally (~> 2.2)
optparse (~> 0.1.1)
plist (>= 3.1.0, < 4.0.0)
rubyzip (>= 2.0.0, < 3.0.0)
security (= 0.1.3)
simctl (~> 1.6.3)
terminal-notifier (>= 2.0.0, < 3.0.0)
terminal-table (>= 1.4.5, < 2.0.0)
tty-screen (>= 0.6.3, < 1.0.0)
tty-spinner (>= 0.8.0, < 1.0.0)
word_wrap (~> 1.0.0)
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.11.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-core (0.4.1)
addressable (~> 2.5, >= 2.5.1)
googleauth (>= 0.16.2, < 2.a)
httpclient (>= 2.8.1, < 3.a)
mini_mime (~> 1.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.a)
rexml
webrick
google-apis-iamcredentials_v1 (0.7.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-playcustomapp_v1 (0.5.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-storage_v1 (0.6.0)
google-apis-core (>= 0.4, < 2.a)
google-cloud-core (1.6.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
google-cloud-env (1.5.0)
faraday (>= 0.17.3, < 2.0)
google-cloud-errors (1.1.0)
google-cloud-storage (1.34.1)
addressable (~> 2.5)
digest-crc (~> 0.4)
google-apis-iamcredentials_v1 (~> 0.1)
google-apis-storage_v1 (~> 0.1)
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
googleauth (0.17.1)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (~> 0.15)
highline (2.0.3)
http-cookie (1.0.4)
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.4.0)
json (2.5.1)
jwt (2.2.3)
memoist (0.16.2)
mini_magick (4.11.0)
mini_mime (1.1.1)
multi_json (1.15.0)
multipart-post (2.0.0)
nanaimo (0.3.0)
naturally (2.2.1)
optparse (0.1.1)
os (1.1.1)
plist (3.6.0)
public_suffix (4.0.6)
rake (13.0.6)
representable (3.1.1)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.2.5)
rouge (2.0.7)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
security (0.1.3)
signet (0.16.0)
addressable (~> 2.8)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simctl (1.6.8)
CFPropertyList
naturally
terminal-notifier (2.0.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
trailblazer-option (0.1.1)
tty-cursor (0.7.1)
tty-screen (0.8.1)
tty-spinner (0.9.3)
tty-cursor (~> 0.7)
uber (0.1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.8)
unicode-display_width (1.8.0)
webrick (1.7.0)
word_wrap (1.0.0)
xcodeproj (1.21.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
xcpretty (0.3.0)
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.1)
xcpretty (~> 0.2, >= 0.0.7)
PLATFORMS
x86_64-linux
DEPENDENCIES
fastlane
BUNDLED WITH
2.2.27

1
external/capnproto-dotnetcore vendored Submodule

@ -0,0 +1 @@
Subproject commit 1ba1b6fbe0d9a278445ef7fde7624f218171156b

5
fastlane/Appfile Normal file
View File

@ -0,0 +1,5 @@
json_key_file("./play-store-credentials.json")
package_name("org.fab_infra.fabaccess")
# For more information about the Appfile, see:
# https://docs.fastlane.tools/advanced/#appfile

23
fastlane/Fastfile Normal file
View File

@ -0,0 +1,23 @@
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
default_platform(:ios)
platform :ios do
desc "Description of what the lane does"
lane :custom_lane do
# add actions here: https://docs.fastlane.tools/actions
end
end