mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-03-12 23:01:52 +01:00
Added: #37
This commit is contained in:
parent
7b4498f8e8
commit
3212904bd0
@ -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>
|
||||||
@ -78,6 +78,7 @@
|
|||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Services\PreferenceStorageService.cs" />
|
<Compile Include="Services\PreferenceStorageService.cs" />
|
||||||
<Compile Include="Services\SecretStorage.cs" />
|
<Compile Include="Services\SecretStorage.cs" />
|
||||||
|
<Compile Include="Services\VersioningService.cs" />
|
||||||
<Compile Include="SplashActivity.cs" />
|
<Compile Include="SplashActivity.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@ -188,4 +189,4 @@
|
|||||||
<XmlPoke XmlInputPath="Properties\AndroidManifest.xml" Namespaces="<Namespace Prefix='android' Uri='http://schemas.android.com/apk/res/android' />" Query="manifest/@android:versionCode" Value="$(CI_PIPELINE_ID)" />
|
<XmlPoke XmlInputPath="Properties\AndroidManifest.xml" Namespaces="<Namespace Prefix='android' Uri='http://schemas.android.com/apk/res/android' />" Query="manifest/@android:versionCode" Value="$(CI_PIPELINE_ID)" />
|
||||||
<XmlPoke XmlInputPath="Properties\AndroidManifest.xml" Namespaces="<Namespace Prefix='android' Uri='http://schemas.android.com/apk/res/android' />" Query="manifest/@android:versionName" Value="$(CI_COMMIT_TAG.SubString(1))" />
|
<XmlPoke XmlInputPath="Properties\AndroidManifest.xml" Namespaces="<Namespace Prefix='android' Uri='http://schemas.android.com/apk/res/android' />" Query="manifest/@android:versionName" Value="$(CI_COMMIT_TAG.SubString(1))" />
|
||||||
</Target>
|
</Target>
|
||||||
</Project>
|
</Project>
|
@ -1,5 +1,6 @@
|
|||||||
using Borepin.Droid.Services;
|
using Borepin.Droid.Services;
|
||||||
using Borepin.Service.Storage;
|
using Borepin.Service.Storage;
|
||||||
|
using Borepin.Service.Versioning;
|
||||||
using Prism;
|
using Prism;
|
||||||
using Prism.Ioc;
|
using Prism.Ioc;
|
||||||
|
|
||||||
@ -11,6 +12,7 @@ namespace Borepin.Droid
|
|||||||
{
|
{
|
||||||
containerRegistry.Register<IPreferenceStorageService, PreferenceStorageService>();
|
containerRegistry.Register<IPreferenceStorageService, PreferenceStorageService>();
|
||||||
containerRegistry.Register<ISecretStorageService, SecretStorage>();
|
containerRegistry.Register<ISecretStorageService, SecretStorage>();
|
||||||
|
containerRegistry.Register<IVersioningService, VersioningService>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
30
Borepin/Borepin.Android/Services/VersioningService.cs
Normal file
30
Borepin/Borepin.Android/Services/VersioningService.cs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
using Borepin.Service.Versioning;
|
||||||
|
using Xamarin.Essentials;
|
||||||
|
|
||||||
|
namespace Borepin.Droid.Services
|
||||||
|
{
|
||||||
|
public class VersioningService : IVersioningService
|
||||||
|
{
|
||||||
|
#region Constructors
|
||||||
|
public VersioningService()
|
||||||
|
{
|
||||||
|
VersionTracking.Track();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
public string CurrentBuild
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return VersionTracking.CurrentBuild;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string CurrentVersion
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return VersionTracking.CurrentVersion;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -100,6 +100,7 @@
|
|||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Services\PreferenceStorageService.cs" />
|
<Compile Include="Services\PreferenceStorageService.cs" />
|
||||||
<Compile Include="Services\SecretStorageService.cs" />
|
<Compile Include="Services\SecretStorageService.cs" />
|
||||||
|
<Compile Include="Services\VersioningService.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<AppxManifest Include="Package.appxmanifest">
|
<AppxManifest Include="Package.appxmanifest">
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
using Prism;
|
using Prism;
|
||||||
using Prism.Ioc;
|
using Prism.Ioc;
|
||||||
using Borepin.Service.Storage;
|
using Borepin.Service.Storage;
|
||||||
|
using Borepin.Service.Versioning;
|
||||||
|
|
||||||
namespace Borepin.UWP
|
namespace Borepin.UWP
|
||||||
{
|
{
|
||||||
@ -11,6 +12,7 @@ namespace Borepin.UWP
|
|||||||
{
|
{
|
||||||
containerRegistry.Register<IPreferenceStorageService, PreferenceStorageService>();
|
containerRegistry.Register<IPreferenceStorageService, PreferenceStorageService>();
|
||||||
containerRegistry.Register<ISecretStorageService, SecretStorageService>();
|
containerRegistry.Register<ISecretStorageService, SecretStorageService>();
|
||||||
|
containerRegistry.Register<IVersioningService, VersioningService>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
30
Borepin/Borepin.UWP/Services/VersioningService.cs
Normal file
30
Borepin/Borepin.UWP/Services/VersioningService.cs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
using Borepin.Service.Versioning;
|
||||||
|
using Xamarin.Essentials;
|
||||||
|
|
||||||
|
namespace Borepin.UWP.Services
|
||||||
|
{
|
||||||
|
public class VersioningService : IVersioningService
|
||||||
|
{
|
||||||
|
#region Constructors
|
||||||
|
public VersioningService()
|
||||||
|
{
|
||||||
|
VersionTracking.Track();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
public string CurrentBuild
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return VersionTracking.CurrentBuild;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string CurrentVersion
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return VersionTracking.CurrentVersion;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -82,6 +82,7 @@
|
|||||||
<Compile Include="AppDelegate.cs" />
|
<Compile Include="AppDelegate.cs" />
|
||||||
<Compile Include="Services\PreferenceStorageService.cs" />
|
<Compile Include="Services\PreferenceStorageService.cs" />
|
||||||
<Compile Include="Services\SecretStorageService.cs" />
|
<Compile Include="Services\SecretStorageService.cs" />
|
||||||
|
<Compile Include="Services\VersioningService.cs" />
|
||||||
<None Include="Entitlements.plist" />
|
<None Include="Entitlements.plist" />
|
||||||
<None Include="Info.plist" />
|
<None Include="Info.plist" />
|
||||||
<Compile Include="PlatformInitializer.cs" />
|
<Compile Include="PlatformInitializer.cs" />
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using Borepin.iOS.Services;
|
using Borepin.iOS.Services;
|
||||||
using Borepin.Service.Storage;
|
using Borepin.Service.Storage;
|
||||||
|
using Borepin.Service.Versioning;
|
||||||
using Prism;
|
using Prism;
|
||||||
using Prism.Ioc;
|
using Prism.Ioc;
|
||||||
|
|
||||||
@ -11,6 +12,7 @@ namespace Borepin.iOS
|
|||||||
{
|
{
|
||||||
containerRegistry.Register<IPreferenceStorageService, PreferenceStorageService>();
|
containerRegistry.Register<IPreferenceStorageService, PreferenceStorageService>();
|
||||||
containerRegistry.Register<ISecretStorageService, SecretStorageService>();
|
containerRegistry.Register<ISecretStorageService, SecretStorageService>();
|
||||||
|
containerRegistry.Register<IVersioningService, VersioningService>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
30
Borepin/Borepin.iOS/Services/VersioningService.cs
Normal file
30
Borepin/Borepin.iOS/Services/VersioningService.cs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
using Borepin.Service.Versioning;
|
||||||
|
using Xamarin.Essentials;
|
||||||
|
|
||||||
|
namespace Borepin.iOS.Services
|
||||||
|
{
|
||||||
|
public class VersioningService : IVersioningService
|
||||||
|
{
|
||||||
|
#region Constructors
|
||||||
|
public VersioningService()
|
||||||
|
{
|
||||||
|
VersionTracking.Track();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
public string CurrentBuild
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return VersionTracking.CurrentBuild;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string CurrentVersion
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return VersionTracking.CurrentVersion;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -4,10 +4,16 @@
|
|||||||
x:Class="Borepin.Page.MainPage"
|
x:Class="Borepin.Page.MainPage"
|
||||||
Title="MainPage">
|
Title="MainPage">
|
||||||
<FlyoutPage.Flyout>
|
<FlyoutPage.Flyout>
|
||||||
<ContentPage Title="FabAccess">
|
<ContentPage Title="FabAccess" BackgroundColor="{StaticResource SecondColor}">
|
||||||
<StackLayout Margin="0,50,0,0">
|
<StackLayout>
|
||||||
<Button Text="Machines" Command="{Binding NavigateCommand}" CommandParameter="MachineListPage" />
|
<StackLayout Margin="0,50,0,0" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
|
||||||
<Button Text="Servers" Command="{Binding NavigateCommand}" CommandParameter="ServerListPage" />
|
<Button Text="Machines" Command="{Binding NavigateCommand}" CommandParameter="MachineListPage" VerticalOptions="Start" BackgroundColor="{StaticResource SecondColor}" TextColor="{StaticResource FirstColor}"/>
|
||||||
|
<Button Text="Servers" Command="{Binding NavigateCommand}" CommandParameter="ServerListPage" VerticalOptions="Start" BackgroundColor="{StaticResource SecondColor}" TextColor="{StaticResource FirstColor}"/>
|
||||||
|
</StackLayout>
|
||||||
|
<StackLayout Margin="0,0,0,10">
|
||||||
|
<Label Text="{Binding CurrentVersion, StringFormat='Version: {0}'}" VerticalOptions="End" Margin="10,0,0,0" TextColor="{StaticResource FirstColor}"/>
|
||||||
|
<Label Text="{Binding CurrentBuild, StringFormat='Build: {0}'}" VerticalOptions="End" Margin="10,0,0,0" TextColor="{StaticResource FirstColor}"/>
|
||||||
|
</StackLayout>
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</ContentPage>
|
</ContentPage>
|
||||||
</FlyoutPage.Flyout>
|
</FlyoutPage.Flyout>
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using Borepin.Base;
|
using Borepin.Base;
|
||||||
|
using Borepin.Service.Versioning;
|
||||||
using Prism.Navigation;
|
using Prism.Navigation;
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
|
|
||||||
@ -9,9 +10,15 @@ namespace Borepin.PageModel
|
|||||||
{
|
{
|
||||||
public class MainPageModel : PageModelBase
|
public class MainPageModel : PageModelBase
|
||||||
{
|
{
|
||||||
|
#region Private Members
|
||||||
|
private readonly IVersioningService _VersioningService;
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
public MainPageModel(INavigationService navigationService) : base(navigationService)
|
public MainPageModel(INavigationService navigationService, IVersioningService versioningService) : base(navigationService)
|
||||||
{
|
{
|
||||||
|
_VersioningService = versioningService;
|
||||||
|
|
||||||
NavigateCommand = new Command<string>(NavigateCommandExecute);
|
NavigateCommand = new Command<string>(NavigateCommandExecute);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@ -19,10 +26,29 @@ namespace Borepin.PageModel
|
|||||||
#region LoadData
|
#region LoadData
|
||||||
public override Task LoadData()
|
public override Task LoadData()
|
||||||
{
|
{
|
||||||
|
CurrentVersion = _VersioningService.CurrentVersion;
|
||||||
|
CurrentBuild = _VersioningService.CurrentBuild;
|
||||||
|
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Fields
|
||||||
|
private string _CurrentVersion;
|
||||||
|
public string CurrentVersion
|
||||||
|
{
|
||||||
|
get => _CurrentVersion;
|
||||||
|
set => SetProperty(ref _CurrentVersion, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private string _CurrentBuild;
|
||||||
|
public string CurrentBuild
|
||||||
|
{
|
||||||
|
get => _CurrentBuild;
|
||||||
|
set => SetProperty(ref _CurrentBuild, value);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Commands
|
#region Commands
|
||||||
private ICommand _NavigationCommand;
|
private ICommand _NavigationCommand;
|
||||||
public ICommand NavigateCommand
|
public ICommand NavigateCommand
|
||||||
@ -42,9 +68,9 @@ namespace Borepin.PageModel
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnNavigatedTo(INavigationParameters parameters)
|
public override async void OnNavigatedTo(INavigationParameters parameters)
|
||||||
{
|
{
|
||||||
|
await LoadData().ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
8
Borepin/Borepin/Service/Versioning/IVersioningService.cs
Normal file
8
Borepin/Borepin/Service/Versioning/IVersioningService.cs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
namespace Borepin.Service.Versioning
|
||||||
|
{
|
||||||
|
public interface IVersioningService
|
||||||
|
{
|
||||||
|
string CurrentBuild { get; }
|
||||||
|
string CurrentVersion { get; }
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user