mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-03-12 14:51:44 +01:00
Fixed MainPage Grid
This commit is contained in:
parent
5ca2e66443
commit
50e614047a
@ -5,22 +5,27 @@
|
||||
xmlns:resource_text="clr-namespace:Borepin.Resources.Text">
|
||||
<FlyoutPage.Flyout>
|
||||
<ContentPage Title="FabAccess" BackgroundColor="{StaticResource SecondColor}">
|
||||
<StackLayout>
|
||||
<StackLayout Margin="0,50,0,0" VerticalOptions="FillAndExpand">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="50"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackLayout Grid.Row="0" IsVisible="{Binding IsConnected}" Margin="0, 50, 0, 0">
|
||||
<Button Text="{x:Static resource_text:TextResource.MainPage_Machines}" Command="{Binding NavigateCommand}" CommandParameter="MachineListPage" BackgroundColor="{StaticResource SecondColor}" TextColor="{StaticResource FirstColor}"/>
|
||||
<Button Text="{x:Static resource_text:TextResource.MainPage_Users}" IsVisible="{Binding CanManageUsers}" Command="{Binding NavigateCommand}" CommandParameter="UserListPage" BackgroundColor="{StaticResource SecondColor}" TextColor="{StaticResource FirstColor}"/>
|
||||
</StackLayout>
|
||||
<StackLayout Margin="0,50,0,50">
|
||||
<Button Text="{x:Static resource_text:TextResource.MainPage_Servers}" Command="{Binding NavigateCommand}" CommandParameter="ServerListPage" BackgroundColor="{StaticResource SecondColor}" TextColor="{StaticResource FirstColor}" VerticalOptions="End"/>
|
||||
<StackLayout Grid.Row="1" VerticalOptions="End" Margin="0, 0, 0, 50">
|
||||
<StackLayout IsVisible="{Binding IsConnected}">
|
||||
<Button Text="{x:Static resource_text:TextResource.MainPage_Profile}" Command="{Binding NavigateCommand}" CommandParameter="ProfilePage" BackgroundColor="{StaticResource SecondColor}" TextColor="{StaticResource FirstColor}" VerticalOptions="End"/>
|
||||
<Button Text="{x:Static resource_text:TextResource.MainPage_Profile}" Command="{Binding NavigateCommand}" CommandParameter="ProfilePage" BackgroundColor="{StaticResource SecondColor}" TextColor="{StaticResource FirstColor}"/>
|
||||
</StackLayout>
|
||||
<Button Text="{x:Static resource_text:TextResource.MainPage_Servers}" Command="{Binding NavigateCommand}" CommandParameter="ServerListPage" 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 Grid.Row="2" Margin="10, 0, 0, 10" VerticalOptions="End">
|
||||
<Label Text="{Binding CurrentVersion, StringFormat='Version: {0}'}" Margin="10,0,0,0" TextColor="{StaticResource FirstColor}"/>
|
||||
<Label Text="{Binding CurrentBuild, StringFormat='Build: {0}'}" Margin="10,0,0,0" TextColor="{StaticResource FirstColor}"/>
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
</Grid>
|
||||
</ContentPage>
|
||||
</FlyoutPage.Flyout>
|
||||
</FlyoutPage>
|
||||
|
@ -17,11 +17,13 @@
|
||||
</StackLayout>
|
||||
<StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}">
|
||||
<StackLayout IsVisible="{Binding IsConnected}">
|
||||
<Label Text="{Binding UserItem.Username}" Style="{StaticResource LabelStyle_Title}"/>
|
||||
<Label Text="{x:Static resource_text:TextResource.ProfilePage_ChangePassword}" Style="{StaticResource Style_Label_Property_Title}"/>
|
||||
<Entry Placeholder="{x:Static resource_text:TextResource.ProfilePage_OldPassword}" Text="{Binding OldPassword}"/>
|
||||
<Entry Placeholder="{x:Static resource_text:TextResource.ProfilePage_NewPassword}" Text="{Binding NewPassword}"/>
|
||||
<Button Text="{x:Static resource_text:TextResource.ProfilePage_UpdatePassword}" Command="{Binding UpdatePasswordCommand}" Style="{StaticResource Style_Button_Primary}"/>
|
||||
<Label Text="{Binding Username}" Style="{StaticResource LabelStyle_Title}"/>
|
||||
<StackLayout IsVisible="{Binding CanManage}">
|
||||
<Label Text="{x:Static resource_text:TextResource.ProfilePage_ChangePassword}" Style="{StaticResource Style_Label_Property_Title}"/>
|
||||
<Entry Placeholder="{x:Static resource_text:TextResource.ProfilePage_OldPassword}" Text="{Binding OldPassword}"/>
|
||||
<Entry Placeholder="{x:Static resource_text:TextResource.ProfilePage_NewPassword}" Text="{Binding NewPassword}"/>
|
||||
<Button Text="{x:Static resource_text:TextResource.ProfilePage_UpdatePassword}" Command="{Binding UpdatePasswordCommand}" Style="{StaticResource Style_Button_Primary}"/>
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
<StackLayout IsVisible="{Binding IsConnected, Converter={StaticResource InvertBoolConverter}}">
|
||||
<Label Text="{x:Static resource_text:TextResource.PLEASECONNECTTOSERVER}"/>
|
||||
|
@ -31,11 +31,13 @@
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
<Label Text="{x:Static resource_text:TextResource.UserPage_ChangePassword}" Style="{StaticResource Style_Label_Property_Title}"/>
|
||||
<Entry Placeholder="{x:Static resource_text:TextResource.UserPage_NewPassword}" Text="{Binding NewPassword}"/>
|
||||
<Button Text="{x:Static resource_text:TextResource.UserPage_UpdatePassword}" Command="{Binding UpdatePasswordCommand}" Style="{StaticResource Style_Button_Primary}"/>
|
||||
<StackLayout IsVisible="{Binding CanAdmin}">
|
||||
<Label Text="{x:Static resource_text:TextResource.UserPage_ChangePassword}" Style="{StaticResource Style_Label_Property_Title}"/>
|
||||
<Entry Placeholder="{x:Static resource_text:TextResource.UserPage_NewPassword}" Text="{Binding NewPassword}"/>
|
||||
<Button Text="{x:Static resource_text:TextResource.UserPage_UpdatePassword}" Command="{Binding UpdatePasswordCommand}" Style="{StaticResource Style_Button_Primary}"/>
|
||||
</StackLayout>
|
||||
<Button Grid.Row="1" Text="{x:Static resource_text:TextResource.DELETE}" Command="{Binding DeleteCommand}" Style="{StaticResource Style_Button_Admin}" VerticalOptions="End"/>
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
<StackLayout IsVisible="{Binding IsConnected, Converter={StaticResource InvertBoolConverter}}">
|
||||
<Label Text="{x:Static resource_text:TextResource.PLEASECONNECTTOSERVER}"/>
|
||||
</StackLayout>
|
||||
|
@ -6,7 +6,6 @@ using Borepin.Base;
|
||||
using Borepin.Base.Exceptions;
|
||||
using Borepin.Service;
|
||||
using Borepin.Service.Storage;
|
||||
using Borepin.Service.Storage.Exceptions;
|
||||
using FabAccessAPI;
|
||||
using FabAccessAPI.Exceptions;
|
||||
using Prism.Commands;
|
||||
@ -47,6 +46,11 @@ namespace Borepin.PageModel.AddServerProcess
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public override Task<object> CreateInstance()
|
||||
{
|
||||
return Task.FromResult<object>(_ConnectionData);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Fields
|
||||
|
@ -4,18 +4,10 @@ using Prism.Navigation;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using FabAccessAPI.Schema;
|
||||
using Borepin.Model;
|
||||
using Prism.Services;
|
||||
using Borepin.Service;
|
||||
using Borepin.Base.Exceptions;
|
||||
using Capnp.Rpc;
|
||||
using System;
|
||||
using Borepin.ViewModel;
|
||||
using System.Collections.Generic;
|
||||
using NaturalSort.Extension;
|
||||
using System.Linq;
|
||||
using Prism.Services.Dialogs;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Borepin.PageModel
|
||||
{
|
||||
@ -29,25 +21,22 @@ namespace Borepin.PageModel
|
||||
#endregion
|
||||
|
||||
#region Data
|
||||
public override Task LoadInstance(object instance)
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public override async Task LoadAPIData()
|
||||
{
|
||||
_UserItem = new UserVisualize(await _API.Session.UserSystem.Info.GetUserSelf().ConfigureAwait(false));
|
||||
_UserItem.LoadData();
|
||||
User self = await _API.Session.UserSystem.Info.GetUserSelf().ConfigureAwait(false);
|
||||
Username = self.Username;
|
||||
|
||||
CanManage = !((User.ManageInterface_Proxy)self.Manage).IsNull;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Fields
|
||||
|
||||
private UserVisualize _UserItem;
|
||||
public UserVisualize UserItem
|
||||
private string _Username;
|
||||
public string Username
|
||||
{
|
||||
get => _UserItem;
|
||||
set => SetProperty(ref _UserItem, value);
|
||||
get => _Username;
|
||||
set => SetProperty(ref _Username, value);
|
||||
}
|
||||
|
||||
private string _OldPassword = null;
|
||||
@ -63,6 +52,13 @@ namespace Borepin.PageModel
|
||||
get => _NewPassword;
|
||||
set => SetProperty(ref _NewPassword, value);
|
||||
}
|
||||
|
||||
private bool _CanManage;
|
||||
public bool CanManage
|
||||
{
|
||||
get => _CanManage;
|
||||
set => SetProperty(ref _CanManage, value);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Commands
|
||||
@ -84,6 +80,8 @@ namespace Borepin.PageModel
|
||||
{
|
||||
User self = await _API.Session.UserSystem.Info.GetUserSelf().ConfigureAwait(false);
|
||||
await self.Manage.Pwd(OldPassword, NewPassword).ConfigureAwait(false);
|
||||
OldPassword = string.Empty;
|
||||
NewPassword = string.Empty;
|
||||
}
|
||||
}
|
||||
catch (RpcException exception) when (string.Equals(exception.Message, "RPC connection is broken. Task would never return.", StringComparison.Ordinal))
|
||||
|
@ -194,7 +194,7 @@ namespace Borepin.PageModel
|
||||
|
||||
public void UpdatePasswordCommandExecute()
|
||||
{
|
||||
_User.Manage.Pwd(null, NewPassword);
|
||||
_User.Admin.Pwd(NewPassword);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ namespace Borepin.ViewModel
|
||||
|
||||
Device.BeginInvokeOnMainThread(async () =>
|
||||
{
|
||||
INavigationResult result = await _NavigationService.NavigateAsync("/MainPage/NavigationPage/MachineListPage/MachinePage", parameters).ConfigureAwait(false);
|
||||
INavigationResult result = await _NavigationService.NavigateAsync("MachinePage", parameters).ConfigureAwait(false);
|
||||
if (result.Exception != null)
|
||||
{
|
||||
Log.Fatal(result.Exception, "Navigating failed");
|
||||
|
@ -58,7 +58,7 @@ namespace Borepin.ViewModel
|
||||
|
||||
Device.BeginInvokeOnMainThread(async () =>
|
||||
{
|
||||
INavigationResult result = await _NavigationService.NavigateAsync("/MainPage/NavigationPage/ServerListPage/ServerPage", parameters).ConfigureAwait(false);
|
||||
INavigationResult result = await _NavigationService.NavigateAsync("ServerPage", parameters).ConfigureAwait(false);
|
||||
if (result.Exception != null)
|
||||
{
|
||||
Log.Fatal(result.Exception, "Navigating failed");
|
||||
|
@ -59,7 +59,7 @@ namespace Borepin.ViewModel
|
||||
|
||||
Device.BeginInvokeOnMainThread(async () =>
|
||||
{
|
||||
INavigationResult result = await _NavigationService.NavigateAsync("/MainPage/NavigationPage/UserListPage/UserPage", parameters).ConfigureAwait(false);
|
||||
INavigationResult result = await _NavigationService.NavigateAsync("UserPage", parameters).ConfigureAwait(false);
|
||||
if (result.Exception != null)
|
||||
{
|
||||
Log.Fatal(result.Exception, "Navigating failed");
|
||||
|
2
external/capnproto-dotnetcore
vendored
2
external/capnproto-dotnetcore
vendored
@ -1 +1 @@
|
||||
Subproject commit 63e63853c1d5ca9f223aa3627ad391ce434a0683
|
||||
Subproject commit 086bbc2497785d2cc63e9252df6f6d3ee7599579
|
Loading…
x
Reference in New Issue
Block a user