Added: new text to pages

This commit is contained in:
TheJoKlLa 2023-02-27 00:41:44 +01:00
parent 5c14dd9972
commit 84413c3b67
12 changed files with 129 additions and 41 deletions

View File

@ -13,7 +13,8 @@
<ContentPage.Content>
<StackLayout Padding="20">
<StackLayout IsVisible="{Binding IsBusy}">
<ActivityIndicator IsRunning="{Binding IsBusy}"></ActivityIndicator>
<Label Text="{x:Static resource_text:TextResource.AddServerProcess_SelectServerPage_TryConnection}" IsVisible="{Binding TestConnection}" Style="{StaticResource Style_Label_Text_Center}"/>
<ActivityIndicator IsRunning="{Binding IsBusy}"/>
</StackLayout>
<StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}">
<Label Text="{x:Static resource_text:TextResource.USERNAME}" Style="{StaticResource Style_Label_Property_Title}"></Label>

View File

@ -13,7 +13,7 @@
<ContentPage.Content>
<StackLayout Padding="20">
<StackLayout IsVisible="{Binding IsBusy}">
<ActivityIndicator IsRunning="{Binding IsBusy}"></ActivityIndicator>
<ActivityIndicator IsRunning="{Binding IsBusy}"/>
</StackLayout>
<StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}">
<Label Text="{x:Static resource_text:TextResource.AddServerProcess_ChooseAuthTypePage_SignIn}" Style="{StaticResource Style_Label_Property_Title}"></Label>

View File

@ -12,12 +12,13 @@
</ContentPage.Resources>
<ContentPage.Content>
<StackLayout Padding="20">
<StackLayout IsVisible="{Binding IsBusy}">
<ActivityIndicator IsRunning="{Binding IsBusy}"></ActivityIndicator>
<StackLayout>
<Label Text="{x:Static resource_text:TextResource.AddServerProcess_SelectServerPage_TryConnection}" IsVisible="{Binding TestConnection}" Style="{StaticResource Style_Label_Text_Center}"/>
<ActivityIndicator IsRunning="{Binding IsBusy}" IsVisible="{Binding IsBusy}"/>
</StackLayout>
<StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}">
<Label Text="{x:Static resource_text:TextResource.HOST}" Style="{StaticResource Style_Label_Property_Title}"></Label>
<Entry Text="{Binding Host}" Keyboard="Url" IsSpellCheckEnabled="false"/>
<Entry Text="{Binding Host}" Placeholder="{x:Static resource_text:TextResource.AddServerProcess_SelectServerPage_Placeholder}" PlaceholderColor="{StaticResource SecondColor}" Keyboard="Url" IsSpellCheckEnabled="false"/>
<Button Text="{x:Static resource_text:TextResource.AddServerProcess_SelectServerPage_Connect}" Command="{Binding ConnectToServerCommand}" Style="{StaticResource Style_Button_Primary}"/>
<Button Text="{x:Static resource_text:TextResource.SCANQR}" Command="{Binding ScanCodeCommand}" Style="{StaticResource Style_Button_Primary}">
<Button.IsVisible>
@ -26,7 +27,7 @@
Android="true"/>
</Button.IsVisible>
</Button>
<Label Text="{x:Static resource_text:TextResource.AddServerProcess_SelectServerPage_Info}"></Label>
<Label Text="{x:Static resource_text:TextResource.AddServerProcess_SelectServerPage_Info}" Margin="0, 20, 0, 0"></Label>
</StackLayout>
</StackLayout>
</ContentPage.Content>

View File

@ -44,7 +44,7 @@
</StackLayout>
<Button Text="{x:Static resource_text:TextResource.MachinePage_Use}" IsVisible="{Binding MachineItem.CanUse}" Command="{Binding UseMachineCommand}" Style="{StaticResource Style_Button_Primary}"/>
<Label Text="{x:Static resource_text:TextResource.MachinePage_CanNotUseByPermission}" IsVisible="{Binding MachineItem.CanNotUseByPermission}" Style="{StaticResource Style_Label_Text_Center}"/>
<Label Text="{x:Static resource_text:TextResource.MachinePage_CanNotUseByPermission}" IsVisible="{Binding MachineItem.CanNotUseByPermission}" Style="{StaticResource Style_Label_Text_Center}" TextColor="{StaticResource FourthColor}"/>
<Button Text="{x:Static resource_text:TextResource.MachinePage_GiveBack}" IsVisible="{Binding MachineItem.CanInUse}" Command="{Binding GiveBackMachineCommand}" Style="{StaticResource Style_Button_Primary}"/>
<Button VerticalOptions="End" Text="{x:Static resource_text:TextResource.MachinePage_OpenWiki}" IsVisible="{Binding MachineItem.Wiki, Converter={StaticResource IsNotNullBoolConverter}}" Command="{Binding OpenWikiCommand}" Style="{StaticResource Style_Button_Primary}"/>
<StackLayout Grid.Row="2" VerticalOptions="End" IsVisible="{Binding MachineItem.CanManage}">

View File

@ -15,7 +15,7 @@
<ContentPage.Content>
<StackLayout Padding="20">
<StackLayout IsVisible="{Binding IsBusy}">
<ActivityIndicator IsRunning="{Binding IsBusy}"></ActivityIndicator>
<ActivityIndicator IsRunning="{Binding IsBusy}"/>
</StackLayout>
<StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}" VerticalOptions="FillAndExpand">
<Label Text="{x:Static resource_text:TextResource.ServerListPage_ActiveConnection}" IsVisible="{Binding HasActiveConnection}"/>

View File

@ -13,7 +13,8 @@
<ContentPage.Content>
<StackLayout Padding="20">
<StackLayout IsVisible="{Binding IsBusy}">
<ActivityIndicator IsRunning="{Binding IsBusy}"></ActivityIndicator>
<Label Text="{x:Static resource_text:TextResource.AddServerProcess_SelectServerPage_TryConnection}" IsVisible="{Binding TestConnection}" Style="{StaticResource Style_Label_Text_Center}"/>
<ActivityIndicator IsRunning="{Binding IsBusy}"/>
</StackLayout>
<Grid IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}" VerticalOptions="FillAndExpand">
<Grid.RowDefinitions>
@ -23,8 +24,11 @@
<StackLayout Grid.Row="0">
<Label Text="{Binding DisplayAddress}" Style="{StaticResource LabelStyle_Title}"/>
<Label Text="{Binding Connection_Item.Username}" Style="{StaticResource Style_Label_Text_Center}"/>
<Button IsVisible="{Binding InstanceIsDefaultConnection, Converter={StaticResource InvertBoolConverter}}" Text="{x:Static resource_text:TextResource.ServerPage_SetDefault}" Margin="0,10,0,0" Command="{Binding SetDefaultCommand}" Style="{StaticResource Style_Button_Primary}"/>
<Label IsVisible="{Binding InstanceIsDefaultConnection}" Text="{x:Static resource_text:TextResource.ServerPage_IsDefault}" Style="{StaticResource Style_Label_Text_Center}"/>
<Label IsVisible="{Binding InstanceIsDefaultConnection}" Text="{x:Static resource_text:TextResource.ServerPage_IsDefault}" Style="{StaticResource Style_Label_Text_Center}" TextColor="{StaticResource FourthColor}"/>
<Label IsVisible="{Binding InstanceIsDefaultConnection,Converter={StaticResource InvertBoolConverter}}" Text="{x:Static resource_text:TextResource.ServerPage_DefaultText}" Style="{StaticResource Style_Label_Text_Center}" TextColor="{StaticResource FourthColor}"/>
<Button IsVisible="{Binding InstanceIsActiveConnection, Converter={StaticResource InvertBoolConverter}}" Text="{x:Static resource_text:TextResource.ServerPage_Connect}" Margin="0,10,0,0" Command="{Binding ConnectCommand}" Style="{StaticResource Style_Button_Primary}"/>
<Button IsVisible="{Binding InstanceIsActiveConnection}" Text="{x:Static resource_text:TextResource.ServerPage_Disconnect}" Margin="0,10,0,0" Command="{Binding DisconnectCommand}" Style="{StaticResource Style_Button_Admin}"/>
</StackLayout>

View File

@ -71,6 +71,13 @@ namespace Borepin.PageModel.AddServerProcess
get => _Password;
set => SetProperty(ref _Password, value);
}
private bool _TestConnection;
public bool TestConnection
{
get => _TestConnection;
set => SetProperty(ref _TestConnection, value);
}
#endregion
#region Commands
@ -83,7 +90,8 @@ namespace Borepin.PageModel.AddServerProcess
public async Task AuthenticateCommandExecute()
{
IsBusy = true;
if(Username == null || Username == String.Empty || Password == null || Password == String.Empty)
TestConnection = true;
if (Username == null || Username == String.Empty || Password == null || Password == String.Empty)
{
IsBusy = false;
return;
@ -119,7 +127,9 @@ namespace Borepin.PageModel.AddServerProcess
catch (Exception exception)
{
_ErrorMessageService.DisplayConnectFailedMessage(exception);
IsBusy = false;
TestConnection = false;
return;
}
@ -134,6 +144,9 @@ namespace Borepin.PageModel.AddServerProcess
Log.Fatal(result.Exception, "Navigating failed");
}
});
IsBusy = false;
TestConnection = false;
}
#endregion
}

View File

@ -1,7 +1,6 @@
using Borepin.Base;
using Borepin.Service.ErrorMessage;
using FabAccessAPI;
using FabAccessAPI.Exceptions;
using Prism.Commands;
using Prism.Navigation;
using Prism.Services;
@ -28,6 +27,8 @@ namespace Borepin.PageModel.AddServerProcess
ConnectToServerCommand = new DelegateCommand(async () => await ConnectToServerExecute().ConfigureAwait(false));
DetectLocalServerCommand = new DelegateCommand(DetectHostCommandExecute);
ScanCodeCommand = new DelegateCommand(ScanCodeCommandExecute);
TestConnection = false;
}
#endregion
@ -37,7 +38,7 @@ namespace Borepin.PageModel.AddServerProcess
if(instance is ConnectionData)
{
_ConnectionData = instance as ConnectionData;
Host = _ConnectionData.Host.ToString();
Host = _ConnectionData.Host.Host + ":" + _ConnectionData.Host.Port;
}
return Task.CompletedTask;
@ -66,6 +67,13 @@ namespace Borepin.PageModel.AddServerProcess
get => _Host;
set => SetProperty(ref _Host, value);
}
private bool _TestConnection;
public bool TestConnection
{
get => _TestConnection;
set => SetProperty(ref _TestConnection, value);
}
#endregion
#region Commands
@ -86,6 +94,7 @@ namespace Borepin.PageModel.AddServerProcess
try
{
TestConnection = true;
string server_address = "";
if(Regex.IsMatch(Host, "([a-zA-Z]{2,20}):\\/\\/", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, TimeSpan.FromSeconds(1)))
{
@ -101,6 +110,7 @@ namespace Borepin.PageModel.AddServerProcess
{
builder.Port = 59661;
}
builder.Scheme = "fabaccess";
_ConnectionData = new ConnectionData()
{
@ -113,6 +123,7 @@ namespace Borepin.PageModel.AddServerProcess
{
await _PageDialogService.DisplayAlertAsync(Resources.Text.TextResource.ALERT_ConnectionFailed, Resources.Text.TextResource.ALERT_AddressInvalid, Resources.Text.TextResource.OK).ConfigureAwait(false);
TestConnection = false;
IsBusy = false;
});
@ -127,6 +138,8 @@ namespace Borepin.PageModel.AddServerProcess
catch(Exception exception)
{
_ErrorMessageService.DisplayConnectFailedMessage(exception);
TestConnection = false;
IsBusy = false;
return;
}
@ -139,6 +152,9 @@ namespace Borepin.PageModel.AddServerProcess
Log.Fatal(result.Exception, "Navigating failed");
}
});
TestConnection = false;
IsBusy = false;
}
private ICommand _ScanCodeCommand;

View File

@ -112,6 +112,13 @@ namespace Borepin.PageModel
get => _InstanceIsDefaultConnection;
set => SetProperty(ref _InstanceIsDefaultConnection, value);
}
private bool _TestConnection;
public bool TestConnection
{
get => _TestConnection;
set => SetProperty(ref _TestConnection, value);
}
#endregion
#region Commands
@ -124,8 +131,9 @@ namespace Borepin.PageModel
public async Task ConnectCommandExecute()
{
IsBusy = true;
TestConnection = true;
if(_API.IsConnected)
if (_API.IsConnected)
{
await _API.Disconnect().ConfigureAwait(true);
}
@ -137,6 +145,8 @@ namespace Borepin.PageModel
catch(Exception exception)
{
_ErrorMessageService.DisplayConnectFailedMessage(exception);
TestConnection = false;
IsBusy = false;
return;
}
@ -151,6 +161,9 @@ namespace Borepin.PageModel
Log.Fatal(result.Exception, "Navigating failed");
}
});
TestConnection = false;
IsBusy = false;
}
private ICommand _SetDefaultCommand;
public ICommand SetDefaultCommand

View File

@ -124,9 +124,9 @@ namespace Borepin.Resources.Text {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die FabAccess is a decentralized machine management system. Each Space thus uses its own server.
///Ask your Space for the address of your server.
///You can also put down several servers and then connect to the desired server. ähnelt.
/// Sucht eine lokalisierte Zeichenfolge, die FabAccess is a decentralized machine management system, which means that it is designed to allow each Space to have its own dedicated server for managing its machines. If you want to connect to the FabAccess server for a specific Space, you will need to obtain the host address from that particular Space.
///
///In addition to being able to connect to individual servers, FabAccess also allows you to add multiple servers to your account. This feature is especially useful for makers and innovators who have access [Rest der Zeichenfolge wurde abgeschnitten]&quot;; ähnelt.
/// </summary>
internal static string AddServerProcess_SelectServerPage_Info {
get {
@ -134,6 +134,24 @@ namespace Borepin.Resources.Text {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die test.fab-access.org ähnelt.
/// </summary>
internal static string AddServerProcess_SelectServerPage_Placeholder {
get {
return ResourceManager.GetString("AddServerProcess_SelectServerPage_Placeholder", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Trying to connect to the server ähnelt.
/// </summary>
internal static string AddServerProcess_SelectServerPage_TryConnection {
get {
return ResourceManager.GetString("AddServerProcess_SelectServerPage_TryConnection", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Add User ähnelt.
/// </summary>
@ -162,7 +180,7 @@ namespace Borepin.Resources.Text {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Add User failed ähnelt.
/// Sucht eine lokalisierte Zeichenfolge, die Add User failed. ähnelt.
/// </summary>
internal static string ALERT_AddUserFailed {
get {
@ -171,7 +189,7 @@ namespace Borepin.Resources.Text {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Authentication failed ähnelt.
/// Sucht eine lokalisierte Zeichenfolge, die Authentication failed. ähnelt.
/// </summary>
internal static string ALERT_AuthFailed {
get {
@ -189,7 +207,7 @@ namespace Borepin.Resources.Text {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die SASL Mechanism is not supported- ähnelt.
/// Sucht eine lokalisierte Zeichenfolge, die SASL Mechanism is not supported. ähnelt.
/// </summary>
internal static string ALERT_BadMechanism {
get {
@ -198,7 +216,7 @@ namespace Borepin.Resources.Text {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Connection failed ähnelt.
/// Sucht eine lokalisierte Zeichenfolge, die Connection failed. ähnelt.
/// </summary>
internal static string ALERT_ConnectionFailed {
get {
@ -315,7 +333,7 @@ namespace Borepin.Resources.Text {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die It&apos;s Bionade ähnelt.
/// Sucht eine lokalisierte Zeichenfolge, die It&apos;s Bionade! ähnelt.
/// </summary>
internal static string Bionade {
get {
@ -459,8 +477,8 @@ namespace Borepin.Resources.Text {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die You do not have the authorization to use this machine.
///Ask in your Space if you can be trained on the machine to be unlocked for the machine. ähnelt.
/// Sucht eine lokalisierte Zeichenfolge, die You are not currently authorized to use this machine.
///Please speak with the staff at the Space to receive the necessary training and authorization. ähnelt.
/// </summary>
internal static string MachinePage_CanNotUseByPermission {
get {
@ -720,6 +738,15 @@ namespace Borepin.Resources.Text {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die You can set a server as the default server and then the app will automatically connect to that server upon startup. ähnelt.
/// </summary>
internal static string ServerPage_DefaultText {
get {
return ResourceManager.GetString("ServerPage_DefaultText", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Disconnect ähnelt.
/// </summary>
@ -730,7 +757,7 @@ namespace Borepin.Resources.Text {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Is Default Connection ähnelt.
/// Sucht eine lokalisierte Zeichenfolge, die This connection has been set as the default and FabAccess will automatically connect to this server upon startup. ähnelt.
/// </summary>
internal static string ServerPage_IsDefault {
get {
@ -775,7 +802,9 @@ namespace Borepin.Resources.Text {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Automate your Space with FabAccess ähnelt.
/// Sucht eine lokalisierte Zeichenfolge, die FabAccess is a machine management system designed for makerspaces, fablab and other collaborative workspaces.
///
///With FabAccess, you can access and schedule machines, manage users and receive real-time updates on machine status and usage. The platform provides a decentralized solution for managing and connecting to machines across different Spaces, making it easier for users to collaborate and innovate together. ähnelt.
/// </summary>
internal static string SetUpProcess_WelcomePage_Text {
get {
@ -784,7 +813,7 @@ namespace Borepin.Resources.Text {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Welcome ähnelt.
/// Sucht eine lokalisierte Zeichenfolge, die Welcome to FabAccess ähnelt.
/// </summary>
internal static string SetUpProcess_WelcomePage_Title {
get {

View File

@ -139,9 +139,15 @@
<value>Connect to Server</value>
</data>
<data name="AddServerProcess_SelectServerPage_Info" xml:space="preserve">
<value>FabAccess is a decentralized machine management system. Each Space thus uses its own server.
Ask your Space for the address of your server.
You can also put down several servers and then connect to the desired server.</value>
<value>FabAccess is a decentralized machine management system, which means that it is designed to allow each Space to have its own dedicated server for managing its machines. If you want to connect to the FabAccess server for a specific Space, you will need to obtain the host address from that particular Space.
In addition to being able to connect to individual servers, FabAccess also allows you to add multiple servers to your account. This feature is especially useful for makers and innovators who have access to machines at multiple Spaces.</value>
</data>
<data name="AddServerProcess_SelectServerPage_Placeholder" xml:space="preserve">
<value>test.fab-access.org</value>
</data>
<data name="AddServerProcess_SelectServerPage_TryConnection" xml:space="preserve">
<value>Trying to connect to the server</value>
</data>
<data name="AddUserPage_AddUser" xml:space="preserve">
<value>Add User</value>
@ -154,11 +160,11 @@ You can also put down several servers and then connect to the desired server.</v
<comment>Message Content</comment>
</data>
<data name="ALERT_AddUserFailed" xml:space="preserve">
<value>Add User failed</value>
<value>Add User failed.</value>
<comment>Message Content</comment>
</data>
<data name="ALERT_AuthFailed" xml:space="preserve">
<value>Authentication failed</value>
<value>Authentication failed.</value>
<comment>Message Title</comment>
</data>
<data name="ALERT_AuthServer" xml:space="preserve">
@ -166,11 +172,11 @@ You can also put down several servers and then connect to the desired server.</v
<comment>Message Content</comment>
</data>
<data name="ALERT_BadMechanism" xml:space="preserve">
<value>SASL Mechanism is not supported-</value>
<value>SASL Mechanism is not supported.</value>
<comment>Message Content</comment>
</data>
<data name="ALERT_ConnectionFailed" xml:space="preserve">
<value>Connection failed</value>
<value>Connection failed.</value>
<comment>Message Title</comment>
</data>
<data name="ALERT_ConnectionTimeout" xml:space="preserve">
@ -221,7 +227,7 @@ You can also put down several servers and then connect to the desired server.</v
<comment>Message Content</comment>
</data>
<data name="Bionade" xml:space="preserve">
<value>It's Bionade</value>
<value>It's Bionade!</value>
</data>
<data name="BUILD" xml:space="preserve">
<value>Build</value>
@ -269,8 +275,8 @@ You can also put down several servers and then connect to the desired server.</v
<value>Machine</value>
</data>
<data name="MachinePage_CanNotUseByPermission" xml:space="preserve">
<value>You do not have the authorization to use this machine.
Ask in your Space if you can be trained on the machine to be unlocked for the machine.</value>
<value>You are not currently authorized to use this machine.
Please speak with the staff at the Space to receive the necessary training and authorization.</value>
</data>
<data name="MachinePage_CurrentUser" xml:space="preserve">
<value>Current User:</value>
@ -359,11 +365,14 @@ Ask in your Space if you can be trained on the machine to be unlocked for the ma
<data name="ServerPage_Connect" xml:space="preserve">
<value>Connect</value>
</data>
<data name="ServerPage_DefaultText" xml:space="preserve">
<value>You can set a server as the default server and then the app will automatically connect to that server upon startup.</value>
</data>
<data name="ServerPage_Disconnect" xml:space="preserve">
<value>Disconnect</value>
</data>
<data name="ServerPage_IsDefault" xml:space="preserve">
<value>Is Default Connection</value>
<value>This connection has been set as the default and FabAccess will automatically connect to this server upon startup.</value>
</data>
<data name="ServerPage_SetDefault" xml:space="preserve">
<value>Set as Default Connection</value>
@ -375,10 +384,12 @@ Ask in your Space if you can be trained on the machine to be unlocked for the ma
<value>Begin working</value>
</data>
<data name="SetUpProcess_WelcomePage_Text" xml:space="preserve">
<value>Automate your Space with FabAccess</value>
<value>FabAccess is a machine management system designed for makerspaces, fablab and other collaborative workspaces.
With FabAccess, you can access and schedule machines, manage users and receive real-time updates on machine status and usage. The platform provides a decentralized solution for managing and connecting to machines across different Spaces, making it easier for users to collaborate and innovate together.</value>
</data>
<data name="SetUpProcess_WelcomePage_Title" xml:space="preserve">
<value>Welcome</value>
<value>Welcome to FabAccess</value>
</data>
<data name="StartPage_Connecting" xml:space="preserve">
<value>Connecting to Server</value>

View File

@ -13,7 +13,7 @@
<ContentView.Content>
<StackLayout>
<StackLayout IsVisible="{Binding IsBusy}">
<ActivityIndicator IsRunning="{Binding IsBusy}"></ActivityIndicator>
<ActivityIndicator IsRunning="{Binding IsBusy}"/>
</StackLayout>
<StackLayout>