Skip to content

Commit

Permalink
Merge pull request #93 from doodz/Develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
doodz authored Mar 23, 2021
2 parents f89e265 + 3ae2c72 commit b9743de
Show file tree
Hide file tree
Showing 6,990 changed files with 4,532,011 additions and 4,230 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="SSH.NET" Version="2020.0.0" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.1874" />
<PackageReference Include="SSH.NET" Version="2020.0.1" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" />
</ItemGroup>

<ItemGroup>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<?xaml-comp compile="true" ?>
<ResourceDictionary xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:controls="clr-namespace:Doods.Framework.Mobile.Std.Controls;assembly=Doods.Framework.Mobile.Std"
xmlns:forms="clr-namespace:FFImageLoading.Svg.Forms;assembly=FFImageLoading.Svg.Forms"
xmlns:enum="clr-namespace:Doods.Framework.Mobile.Std.Enum;assembly=Doods.Framework.Mobile.Std"
xmlns:controls1="clr-namespace:Doods.Framework.Mobile.Ssh.Std.Controls;assembly=Doods.Framework.Mobile.Ssh.Std"
xmlns:resources="clr-namespace:Doods.Openmediavault.Mobile.Std.Resources;assembly=Doods.Openmediavault.Mobile.Std">

<ResourceDictionary xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:controls="clr-namespace:Doods.Framework.Mobile.Std.Controls;assembly=Doods.Framework.Mobile.Std"
xmlns:resources="clr-namespace:Doods.Openmediavault.Mobile.Std.Resources;assembly=Doods.Openmediavault.Mobile.Std">

<Style x:Key="NewSubTitleStyle2" TargetType="Label">
<Setter Property="FontAttributes" Value="None" />
Expand All @@ -15,28 +13,27 @@
<Style x:Key="NewTitleStyle2" TargetType="Label">
<Setter Property="FontAttributes" Value="Bold" />
<Setter Property="TextColor" Value="White" />
<Setter Property="FontSize" Value="14"/>
<Setter Property="VerticalTextAlignment" Value="Center"/>
<Setter Property="FontSize" Value="14" />
<Setter Property="VerticalTextAlignment" Value="Center" />
</Style>



<ControlTemplate x:Key="SystemInfomationTitledFrameView">
<ControlTemplate x:Key="SystemInfomationTitledFrameView">
<controls:TitledFrameView Title="{resources:Translate Text=SystemInfomation}"
TitleStyle="{StaticResource NewTitleStyle2}" >
TitleStyle="{StaticResource NewTitleStyle2}">
<StackLayout Padding="8" BindableLayout.ItemsSource="{Binding .,Mode=OneWay}">
<BindableLayout.ItemTemplate>
<DataTemplate>
<StackLayout Orientation="Horizontal">
<Label Text="{Binding Name,Mode=OneWay}"/>
<Label Text="{Binding Value,Mode=OneWay}"/>
<StackLayout Orientation="Horizontal">
<Label Text="{Binding Name,Mode=OneWay}" />
<Label Text="{Binding Value,Mode=OneWay}" />
</StackLayout>
</DataTemplate>
</BindableLayout.ItemTemplate>
</StackLayout>


</controls:TitledFrameView>
</ControlTemplate>

</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ namespace Doods.Openmediavault.Mobile.Std.Resources
[ContentProperty(nameof(Text))]
public class TranslateExtension : TranslateService, IMarkupExtension
{
private readonly CultureInfo ci = null;
private const string ResourceId = "Doods.Openmediavault.Mobile.Std.Resources";

private static IDictionary<string, ResourceManager> ResourcesManagersLst =
new Dictionary<string, ResourceManager>()
private static readonly IDictionary<string, ResourceManager> ResourcesManagersLst =
new Dictionary<string, ResourceManager>
{
{
nameof(openmediavault),
Expand Down Expand Up @@ -71,27 +70,29 @@ public class TranslateExtension : TranslateService, IMarkupExtension
nameof(openmediavault_usbbackup),
new ResourceManager("Doods.Openmediavault.Mobile.Std.Resources.openmediavault_usbbackup",
typeof(openmediavault_usbbackup).Assembly)
},
}
};

private readonly CultureInfo ci = null;

public TranslateExtension() : base(Resource.ResourceManager)
{
}


//static readonly Lazy<ResourceManager> ResMgr = new Lazy<ResourceManager>(
// () => new ResourceManager(ResourceId, IntrospectionExtensions.GetTypeInfo(typeof(TranslateExtension)).Assembly));

public string Text { get; set; }

public TranslateExtension() : base(Resource.ResourceManager)
{
}

public object ProvideValue(IServiceProvider serviceProvider)
{
if (Text == null)
return string.Empty;

if (Text.Contains(nameof(openmediavault)))
{
var array = Text.Split(new string[] {"::"}, StringSplitOptions.RemoveEmptyEntries);
var array = Text.Split(new[] {"::"}, StringSplitOptions.RemoveEmptyEntries);
ResourceManager manager;
if (ResourcesManagersLst.TryGetValue(array[0], out manager))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Doods.Openmedivault.Http.St
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Doods.Openmedivault.Ssh.Std", "..\..\Doods.Openmedivault.Ssh.Std\Doods.Openmedivault.Ssh.Std.csproj", "{51FE0D08-1EA8-44C6-8F19-D8871B22DE68}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Doods.Framework.Http.Std", "..\..\Submodules\Doods.Frameworks.Std\Doods.Framework.Http.Std\Doods.Framework.Http.Std.csproj", "{A7EB2CE0-5532-4E37-91F8-56B0214D24AB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Doods.Framework.Http.Std", "..\..\..\Submodules\Doods.Frameworks.Std\Doods.Framework.Http.Std\Doods.Framework.Http.Std.csproj", "{A7EB2CE0-5532-4E37-91F8-56B0214D24AB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Doods.Framework.Std", "..\..\Submodules\Doods.Frameworks.Std\Doods.Framework.Std\Doods.Framework.Std.csproj", "{03EFAD40-19E1-47F5-A4BE-ABF90166916A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Doods.Framework.Std", "..\..\..\Submodules\Doods.Frameworks.Std\Doods.Framework.Std\Doods.Framework.Std.csproj", "{03EFAD40-19E1-47F5-A4BE-ABF90166916A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Doods.Framework.ApiClientBase.Std", "..\..\Submodules\Doods.Frameworks.Std\Doods.Framework.ApiClientBase.Std\Doods.Framework.ApiClientBase.Std.csproj", "{2AC35B70-7D17-41A0-B1E8-DAE84CD208F8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Doods.Framework.ApiClientBase.Std", "..\..\..\Submodules\Doods.Frameworks.Std\Doods.Framework.ApiClientBase.Std\Doods.Framework.ApiClientBase.Std.csproj", "{2AC35B70-7D17-41A0-B1E8-DAE84CD208F8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Doods.Framework.Ssh.Std", "..\..\Submodules\Doods.Frameworks.Std\Doods.Framework.Ssh.Std\Doods.Framework.Ssh.Std.csproj", "{AF60C2AA-EE0B-4CF8-860A-75DBCF832108}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Doods.Framework.Ssh.Std", "..\..\..\Submodules\Doods.Frameworks.Std\Doods.Framework.Ssh.Std\Doods.Framework.Ssh.Std.csproj", "{AF60C2AA-EE0B-4CF8-860A-75DBCF832108}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Framework", "Framework", "{1733E6ED-671A-4EBB-8057-C3A51E63CA3D}"
EndProject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ private static void Main(string[] args)
var con = GetConnection();
var client = new OmvHttpService(null, con);
client.SetHandlers(new NewtonsoftJsonSerializer(LocalJsonConverter.Singleton));
if (client.LoginAsync("admin", "admin").GetAwaiter().GetResult())
if (client.LoginAsync("admin", "openmediavault").GetAwaiter().GetResult())
{
var objTest = new OmvRpcService(client);

Expand All @@ -29,7 +29,7 @@ private static void Main(string[] args)

private static IConnection GetConnection()
{
return new HttpConnection("https://192.168.1.40", 80);
return new HttpConnection("http://192.168.1.47", 80);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@
using Doods.Openmediavault.Rpc.std.Data.V4;
using Doods.Openmediavault.Rpc.std.Data.V4.Settings;
using Doods.Openmediavault.Rpc.Std.Interfaces;
using Doods.Openmedivault.Ssh.Std.Requests;

namespace Doods.Openmediavault.Rpc.Std.Clients
{
public class OmvAptClient : OmvServiceClient
{
public Task<AptSetting> GetSettings()
public OmvAptClient(IRpcClient client) : base(client)
{
ServiceName = "Apt";
}

public Task<AptSetting> GetSettings()
{
var request = NewRequest("getSettings");

var result = RunCmd<AptSetting>(request);
Expand All @@ -21,23 +24,17 @@ public Task<AptSetting> GetSettings()

public Task<object> SetSettings(AptSetting settings)
{

var request = NewRequest("setSettings");
request.Params = settings;

var result = RunCmd<object>(request);
return result;
}

public OmvAptClient(IRpcClient client) : base(client)
{
ServiceName = "Apt";
}

public Task<IEnumerable<Upgraded>> GetUpgraded()
{
var request = NewRequest("enumerateUpgraded");

var result = RunCmd<IEnumerable<Upgraded>>(request);

return result;
Expand All @@ -46,7 +43,7 @@ public Task<IEnumerable<Upgraded>> GetUpgraded()
public Task<string> UpdateAptList()
{
var request = NewRequest("update");

var result = RunCmd<string>(request);

return result;
Expand All @@ -56,7 +53,7 @@ public Task<string> UpdateAptList()
public Task<string> Install(IEnumerable<string> lst)
{
var request = NewRequest("install");
request.Params = new { packages = lst };
request.Params = new {packages = lst};

var result = RunCmd<string>(request);

Expand All @@ -68,26 +65,21 @@ public async Task<string> InstallPacjages(IEnumerable<string> lst)
{
await CheckRpcVersionAsync();
var request = NewRequest("getInformation");
request.Options = new Options { Updatelastaccess = false };
request.Options = new Options {Updatelastaccess = false};

if (GetRpcVersion() < OMVVersions.Version5)
{
return await UpgradeAptList(lst);
}
if (GetRpcVersion() < OMVVersions.Version5) return await UpgradeAptList(lst);
return await Install(lst);
}

//For OMV 4
public Task<string> UpgradeAptList(IEnumerable<string> lst)
{

var request = NewRequest("upgrade");
request.Params = new {packages = lst};

var result = RunCmd<string>(request);

return result;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,41 @@
using System.Threading.Tasks;
using Doods.Openmediavault.Rpc.std.Data.V4.Settings;
using Doods.Openmediavault.Rpc.Std.Interfaces;
using Doods.Openmedivault.Ssh.Std.Requests;

namespace Doods.Openmediavault.Rpc.Std.Clients
{
public class OmvConfigClient : OmvServiceClient
{



public OmvConfigClient(IRpcClient client) : base(client)
{
ServiceName = "Config";
}

public Task<string> ApplyChangesBg()
{

var request = NewRequest("applyChangesBg");
request.Params = new {modules = new ArrayList(),force=false};
request.Params = new {modules = new ArrayList(), force = false};

var result = RunCmd<string>(request);
return result;
}

public Task<WebGuiSetting> GetSettings()
{

var request = NewRequest("getSettings");


var result = RunCmd<WebGuiSetting>(request);
return result;
}

public Task<object> SetSettings(WebGuiSetting settings)
{

var request = NewRequest("setSettings");
request.Params = settings;

var result = RunCmd<object>(request);
return result;
}

}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Threading.Tasks;
using Doods.Openmediavault.Rpc.Std.Interfaces;
using Doods.Openmedivault.Ssh.Std.Requests;

namespace Doods.Openmediavault.Rpc.Std.Clients
{
Expand All @@ -13,7 +12,6 @@ public OmvDiskMgmtClient(IRpcClient client) : base(client)

public Task<string> GetDisksBackground()
{

var request = NewRequest("getListBg");
var result = RunCmd<string>(request);
return result;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Threading.Tasks;
using Doods.Openmediavault.Rpc.std.Data.V4;
using Doods.Openmediavault.Rpc.Std.Interfaces;
using Doods.Openmedivault.Ssh.Std.Requests;

namespace Doods.Openmediavault.Rpc.Std.Clients
{
Expand All @@ -16,16 +15,15 @@ public OmvExecClient(IRpcClient client) : base(client)
public Task<IsRunning> IsRunning(string filename)
{
var request = NewRequest("isRunning");
request.Params = new { filename= filename };
request.Params = new {filename};
var result = RunCmd<IsRunning>(request);
return result;
}

public Task<Output<T>> GetOutput<T>(string filename, int pos)
{

var request = NewRequest("getOutput");
request.Params = new { filename,pos };
request.Params = new {filename, pos};
var result = RunCmd<Output<T>>(request);
return result;
}
Expand Down
Loading

0 comments on commit b9743de

Please sign in to comment.