mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-03-12 14:51:44 +01:00
Merge branch 'beta' into 'main'
Update Main See merge request fabinfra/fabaccess/borepin!30
This commit is contained in:
commit
8bba433ff2
@ -31,6 +31,8 @@
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchSdkVersion>14.5</MtouchSdkVersion>
|
||||
<CodesignProvision>Borepin Distribution Profile 2021</CodesignProvision>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||
<DebugType>none</DebugType>
|
||||
|
@ -35,33 +35,37 @@ namespace Borepin
|
||||
|
||||
protected override void RegisterTypes(IContainerRegistry containerRegistry)
|
||||
{
|
||||
// Register Navigation
|
||||
#region Register Basic Navigation
|
||||
containerRegistry.RegisterForNavigation<MainPage, MainPagePageModel>();
|
||||
containerRegistry.RegisterForNavigation<NavigationPage>();
|
||||
|
||||
containerRegistry.RegisterForNavigation<StartUpDistributorPage, StartUpDistributorPageModel>();
|
||||
|
||||
containerRegistry.RegisterForNavigation<NavigationPage>();
|
||||
containerRegistry.RegisterForNavigation<MainPage, MainPagePageModel>();
|
||||
containerRegistry.RegisterForNavigation<MachinePage, MachinePageModel>();
|
||||
containerRegistry.RegisterForNavigation<SettingsPage>();
|
||||
containerRegistry.RegisterForNavigation<MachineListPage, MachineListPageModel>();
|
||||
containerRegistry.RegisterForNavigation<ServerListPage, ServerListPageModel>();
|
||||
containerRegistry.RegisterForNavigation<ServerPage, ServerPageModel>();
|
||||
containerRegistry.RegisterForNavigation<ListPage, ListPageModel>();
|
||||
#endregion
|
||||
|
||||
#region Register Sequence Navigation
|
||||
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");
|
||||
#endregion
|
||||
|
||||
//containerRegistry.RegisterForNavigation<TestPage, TestPageModel>();
|
||||
// Register Dialog
|
||||
#region Register Dialog
|
||||
containerRegistry.RegisterDialog<ConfirmDialog, ConfirmDialogModel>();
|
||||
#endregion
|
||||
|
||||
// Register Service
|
||||
#region Register Service
|
||||
containerRegistry.Register<IConnectionService, ConnectionService>();
|
||||
containerRegistry.Register<ICredentialService, CredentialService>();
|
||||
containerRegistry.RegisterSingleton<IBFFHService, BFFHService>();
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,9 +21,17 @@
|
||||
</StackLayout>
|
||||
<StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}">
|
||||
<Label Text="{Binding MachineItem.Name}" Style="{StaticResource LabelStyle_Title}"/>
|
||||
|
||||
<Button Text="Use" Command="{Binding UseMachineCommand}" IsVisible="{Binding MachineItem.CanUse}" Style="{StaticResource Style_Button_Primary}"/>
|
||||
<Button Text="GiveBack" Command="{Binding GiveBackMachineCommand}" IsVisible="{Binding MachineItem.CanInUse}" Style="{StaticResource Style_Button_Primary}"/>
|
||||
<Label Text="{Binding MachineItem.Description}" Style="{StaticResource Style_Label_Text}"/>
|
||||
<StackLayout IsVisible="{Binding MachineItem.CanUse}">
|
||||
<Button Text="Use" Command="{Binding UseMachineCommand}" Style="{StaticResource Style_Button_Primary}"/>
|
||||
</StackLayout>
|
||||
<StackLayout IsVisible="{Binding MachineItem.CanInUse}">
|
||||
<Button Text="GiveBack" Command="{Binding GiveBackMachineCommand}" Style="{StaticResource Style_Button_Primary}"/>
|
||||
</StackLayout>
|
||||
<StackLayout IsVisible="{Binding MachineItem.CanManage}">
|
||||
<Label Text="Manage Machine:" Style="{StaticResource Style_Label_Property_Title}"/>
|
||||
<Button Text="Force Free" Command="{Binding ForceFreeMachineCommand}" Style="{StaticResource Style_Button_Primary}"/>
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
</ContentPage.Content>
|
||||
|
@ -5,7 +5,7 @@
|
||||
x:Name="page">
|
||||
<FlyoutPage.Flyout>
|
||||
<ContentPage Title="FabAccess">
|
||||
<StackLayout>
|
||||
<StackLayout Margin="0,50,0,0">
|
||||
<Button Text="Machines" Command="{Binding NavigateCommand}" CommandParameter="MachineListPage" />
|
||||
<Button Text="Servers" Command="{Binding NavigateCommand}" CommandParameter="ServerListPage" />
|
||||
<!--<Button Text="Settings" Command="{Binding NavigateCommand}" CommandParameter="SettingsPage" />-->
|
||||
|
@ -25,6 +25,7 @@ namespace Borepin.PageModel
|
||||
|
||||
UseMachineCommand = new DelegateCommand(UseMachineCommandExecuted);
|
||||
GiveBackMachineCommand = new DelegateCommand(GiveBackMachineCommandExecuted);
|
||||
ForceFreeMachineCommand = new DelegateCommand(ForceFreeMachineCommandExecuted);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -85,12 +86,27 @@ namespace Borepin.PageModel
|
||||
await inUseInterface.GiveBack();
|
||||
await LoadData();
|
||||
}
|
||||
|
||||
private ICommand _ForceFreeMachineCommand;
|
||||
public ICommand ForceFreeMachineCommand
|
||||
{
|
||||
get => _ForceFreeMachineCommand;
|
||||
set => SetProperty(ref _ForceFreeMachineCommand, value);
|
||||
}
|
||||
|
||||
private async void ForceFreeMachineCommandExecuted()
|
||||
{
|
||||
Machine.IManageInterface manageInterface = _Machine.Manage;
|
||||
|
||||
await manageInterface.ForceFree();
|
||||
await LoadData();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region INavigationService
|
||||
public override void OnNavigatedFrom(INavigationParameters parameters)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override void OnNavigatedTo(INavigationParameters parameters)
|
||||
|
@ -93,7 +93,7 @@ namespace Borepin.PageModel
|
||||
|
||||
NavigationParameters parameters = new NavigationParameters
|
||||
{
|
||||
{ "instance", viewmodel.Instance }
|
||||
{ "instance", viewmodel._Instance }
|
||||
};
|
||||
|
||||
INavigationResult result = await _NavigationService.NavigateAsync($"ServerPage", parameters);
|
||||
|
@ -101,6 +101,13 @@ namespace Borepin.PageModel
|
||||
}
|
||||
|
||||
IsConnected = true;
|
||||
|
||||
var result = await _NavigationService.NavigateAsync("/MainPage/NavigationPage/MachineListPage");
|
||||
|
||||
if (!result.Success)
|
||||
{
|
||||
System.Diagnostics.Debugger.Break();
|
||||
}
|
||||
}
|
||||
|
||||
IsBusy = false;
|
||||
|
@ -14,9 +14,9 @@
|
||||
<Grid RowSpacing="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5" />
|
||||
<ColumnDefinition Width="7*" />
|
||||
<ColumnDefinition Width="6*" />
|
||||
<ColumnDefinition Width="2*" />
|
||||
<ColumnDefinition Width="2*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
|
@ -9,15 +9,15 @@
|
||||
<ColumnDefinition Width="5" />
|
||||
<ColumnDefinition Width="7*" />
|
||||
<ColumnDefinition Width="2*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="2*" />
|
||||
<ColumnDefinition Width="1" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="1"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Row="0" Grid.Column="1" Text="{Binding Instance.Address, StringFormat='{0}'}" Style="{StaticResource LabelStyle_Primary}"/>
|
||||
<Label Grid.Row="0" Grid.Column="2" Text="{Binding Instance.Username}" Style="{StaticResource LabelStyle_Second}" HorizontalTextAlignment="End" />
|
||||
<Label Grid.Row="0" Grid.Column="1" Text="{Binding Address, StringFormat='{0}'}" Style="{StaticResource LabelStyle_Primary}"/>
|
||||
<Label Grid.Row="0" Grid.Column="2" Text="{Binding Username}" Style="{StaticResource LabelStyle_Second}" HorizontalTextAlignment="End" />
|
||||
<Button Grid.Row="0" Grid.Column="3" Margin="0, 3, 0, 3" Text="->" Command="{Binding Source={RelativeSource AncestorType={x:Type pagemodel:ServerListPageModel}}, Path=SelectInstanceCommand}" CommandParameter="{Binding .}" Style="{StaticResource Style_Button_Primary}"/>
|
||||
<BoxView Grid.Row="1" Grid.ColumnSpan="5" BackgroundColor="{StaticResource FifthColor}"/>
|
||||
</Grid>
|
||||
|
@ -1,28 +1,45 @@
|
||||
using Borepin.Model;
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
|
||||
namespace Borepin.ViewModel
|
||||
{
|
||||
public class ServerListItemViewModel : BindableBase
|
||||
{
|
||||
#region Private Properties
|
||||
public Connection _Instance { get; private set; }
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
public ServerListItemViewModel(Connection instance)
|
||||
{
|
||||
_Instance = instance;
|
||||
Address = instance.Address.ToString();
|
||||
}
|
||||
|
||||
private Connection _Instance;
|
||||
public Connection Instance
|
||||
{
|
||||
get => _Instance;
|
||||
set => SetProperty(ref _Instance, value);
|
||||
Address = ConvertUriToString(instance.Address);
|
||||
Username = instance.Username;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
private string _Address;
|
||||
public string Address
|
||||
{
|
||||
get => _Address;
|
||||
set => SetProperty(ref _Address, value);
|
||||
}
|
||||
|
||||
private string _Username;
|
||||
public string Username
|
||||
{
|
||||
get => _Username;
|
||||
set => SetProperty(ref _Username, value);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
public string ConvertUriToString(Uri uri)
|
||||
{
|
||||
return uri.Host;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user