diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-02-13 23:09:44 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-02-13 23:09:44 +0200 |
| commit | 678b22afc27e53811f978103b7ea41609ff68606 (patch) | |
| tree | faaabb6468c1b22d770eb753eeac39b34ef65e4f /Software/Visual_Studio/Azure/Tango.AzureUtils.UI | |
| parent | 69f27fd4bfc5a46fad019b06c9c8d06159c400b9 (diff) | |
| download | Tango-678b22afc27e53811f978103b7ea41609ff68606.tar.gz Tango-678b22afc27e53811f978103b7ea41609ff68606.zip | |
Implemented and deployed machine service gateway.
Implemented AzureUtils => Gateway.
Diffstat (limited to 'Software/Visual_Studio/Azure/Tango.AzureUtils.UI')
11 files changed, 195 insertions, 143 deletions
diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/App.config b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/App.config index f97c59da6..a142ac2b3 100644 --- a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/App.config +++ b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/App.config @@ -1,9 +1,14 @@ <?xml version="1.0" encoding="utf-8"?> -<configuration> +<configuration> <configSections> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> </configSections> + + <appSettings> + <add key="GatewayUrl" value="https://machineservice-gateway.azurewebsites.net/" /> + </appSettings> + <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> </startup> @@ -73,6 +78,14 @@ <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" /> </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" /> + </dependentAssembly> </assemblyBinding> </runtime> <entityFramework> diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/AzureDashboardViewModel.cs b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/AzureDashboardViewModel.cs index 3c6a95ebf..eddc7d009 100644 --- a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/AzureDashboardViewModel.cs +++ b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/AzureDashboardViewModel.cs @@ -8,6 +8,7 @@ using System.Threading.Tasks; using System.Windows; using Tango.AzureUtils.UI.Managers; using Tango.Core.DI; +using Tango.Settings; using Tango.SharedUI; namespace Tango.AzureUtils.UI @@ -17,9 +18,16 @@ namespace Tango.AzureUtils.UI [TangoInject] public IStatusManager StatusManager { get; set; } - public virtual void OnApplicationReady() + public AzureUtilsSettings Settings { get; set; } + + public AzureDashboardViewModel() { + Settings = SettingsManager.Default.GetOrCreate<AzureUtilsSettings>(); + } + public virtual void OnApplicationReady() + { + } public virtual void OnAuthenticated(IAzure azure, List<IWebAppBase> apps) diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/AzureUtilsSettings.cs b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/AzureUtilsSettings.cs new file mode 100644 index 000000000..b6ed1845d --- /dev/null +++ b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/AzureUtilsSettings.cs @@ -0,0 +1,38 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Cryptography; +using Tango.Settings; + +namespace Tango.AzureUtils.UI +{ + public class AzureUtilsSettings : SettingsBase + { + private Rfc2898Cryptographer _crypt; + + public AzureUtilsSettings() + { + _crypt = new Rfc2898Cryptographer(); + } + + public String Email { get; set; } + + public String EncryptedPassword { get; set; } + + [JsonIgnore] + public String Password + { + get + { + return _crypt.Decrypt(EncryptedPassword); + } + set + { + EncryptedPassword = _crypt.Encrypt(value); + } + } + } +} diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Tango.AzureUtils.UI.csproj b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Tango.AzureUtils.UI.csproj index 8f0546bfa..985c54c00 100644 --- a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Tango.AzureUtils.UI.csproj +++ b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Tango.AzureUtils.UI.csproj @@ -56,80 +56,80 @@ <Reference Include="Microsoft.Azure.KeyVault.WebKey, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <HintPath>..\..\packages\Microsoft.Azure.KeyVault.WebKey.3.0.1\lib\net452\Microsoft.Azure.KeyVault.WebKey.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.AppService.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.AppService.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.AppService.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.AppService.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.AppService.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.AppService.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.BatchAI.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.BatchAI.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.BatchAI.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.BatchAI.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.BatchAI.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.BatchAI.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.Cdn.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.Cdn.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.Cdn.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.Cdn.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.Cdn.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.Cdn.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.Compute.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.Compute.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.Compute.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.Compute.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.Compute.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.Compute.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.ContainerInstance.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.ContainerInstance.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.ContainerInstance.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.ContainerInstance.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.ContainerInstance.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.ContainerInstance.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.ContainerRegistry.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.ContainerRegistry.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.ContainerRegistry.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.ContainerRegistry.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.ContainerRegistry.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.ContainerRegistry.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.ContainerService.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.ContainerService.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.ContainerService.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.ContainerService.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.ContainerService.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.ContainerService.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.CosmosDB.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.CosmosDB.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.CosmosDB.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.CosmosDB.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.CosmosDB.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.CosmosDB.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.Dns.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.Dns.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.Dns.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.Dns.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.Dns.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.Dns.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.EventHub.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.EventHub.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.EventHub.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.EventHub.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.EventHub.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.EventHub.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.Graph.RBAC.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.Graph.RBAC.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.Graph.RBAC.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.Graph.RBAC.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.Graph.RBAC.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.Graph.RBAC.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.KeyVault.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.KeyVault.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.KeyVault.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.KeyVault.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.KeyVault.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.KeyVault.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.Locks.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.Locks.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.Locks.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.Locks.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.Locks.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.Locks.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.Monitor.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.Monitor.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.Monitor.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.Monitor.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.Monitor.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.Monitor.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.Msi.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.Msi.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.Msi.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.Msi.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.Msi.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.Msi.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.Network.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.Network.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.Network.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.Network.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.Network.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.Network.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.PrivateDns.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.PrivateDns.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.PrivateDns.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.PrivateDns.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.PrivateDns.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.PrivateDns.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.Redis.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.Redis.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.Redis.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.Redis.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.Redis.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.Redis.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.ResourceManager.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.ResourceManager.Fluent.1.30.0\lib\net461\Microsoft.Azure.Management.ResourceManager.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.ResourceManager.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.ResourceManager.Fluent.1.31.0\lib\net461\Microsoft.Azure.Management.ResourceManager.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.Search.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.Search.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.Search.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.Search.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.Search.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.Search.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.ServiceBus.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.ServiceBus.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.ServiceBus.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.ServiceBus.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.ServiceBus.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.ServiceBus.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.Sql.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.Sql.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.Sql.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.Sql.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.Sql.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.Sql.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.Storage.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.Storage.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.Storage.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.Storage.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.Storage.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.Storage.Fluent.dll</HintPath> </Reference> - <Reference Include="Microsoft.Azure.Management.TrafficManager.Fluent, Version=1.0.0.63, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\..\packages\Microsoft.Azure.Management.TrafficManager.Fluent.1.30.0\lib\net452\Microsoft.Azure.Management.TrafficManager.Fluent.dll</HintPath> + <Reference Include="Microsoft.Azure.Management.TrafficManager.Fluent, Version=1.0.0.64, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.Azure.Management.TrafficManager.Fluent.1.31.0\lib\net452\Microsoft.Azure.Management.TrafficManager.Fluent.dll</HintPath> </Reference> <Reference Include="Microsoft.Azure.Storage.Blob, Version=11.1.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <HintPath>..\..\packages\Microsoft.Azure.Storage.Blob.11.1.2\lib\net452\Microsoft.Azure.Storage.Blob.dll</HintPath> @@ -166,6 +166,7 @@ </Reference> <Reference Include="System" /> <Reference Include="System.ComponentModel.DataAnnotations" /> + <Reference Include="System.Configuration" /> <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> <Reference Include="System.IdentityModel" /> @@ -194,6 +195,7 @@ <SubType>Designer</SubType> </ApplicationDefinition> <Compile Include="AzureDashboardViewModel.cs" /> + <Compile Include="AzureUtilsSettings.cs" /> <Compile Include="Controls\WebAppPropertiesControl.xaml.cs"> <DependentUpon>WebAppPropertiesControl.xaml</DependentUpon> </Compile> @@ -311,6 +313,10 @@ <Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project> <Name>Tango.Core</Name> </ProjectReference> + <ProjectReference Include="..\..\Tango.Settings\Tango.Settings.csproj"> + <Project>{d8f1ad85-526a-4f50-b6dc-d437af63d8d8}</Project> + <Name>Tango.Settings</Name> + </ProjectReference> <ProjectReference Include="..\..\Tango.SharedUI\Tango.SharedUI.csproj"> <Project>{8491D07B-C1F6-4B62-A412-41B9FD2D6538}</Project> <Name>Tango.SharedUI</Name> diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/EnvironmentCreationViewVM.cs b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/EnvironmentCreationViewVM.cs index 7c3abd169..a4c65fcdd 100644 --- a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/EnvironmentCreationViewVM.cs +++ b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/EnvironmentCreationViewVM.cs @@ -41,23 +41,6 @@ namespace Tango.AzureUtils.UI.ViewModels set { _slotName = value; RaisePropertyChangedAuto(); } } - private String _email; - [Required(ErrorMessage = "Active directory email is required.")] - [EmailAddress(ErrorMessage = "Please enter a valid email.")] - public String Email - { - get { return _email; } - set { _email = value; RaisePropertyChangedAuto(); } - } - - private String _password; - [Required(ErrorMessage = "Password is required.")] - public String Password - { - get { return _password; } - set { _password = value; RaisePropertyChangedAuto(); } - } - private CreateEnvironmentConfiguration _config; public CreateEnvironmentConfiguration Config { @@ -73,11 +56,6 @@ namespace Tango.AzureUtils.UI.ViewModels Config = new CreateEnvironmentConfiguration(); } - public override void OnApplicationReady() - { - Email = "roy@twine-s.com"; - } - public override void OnAuthenticated(IAzure azure, List<IWebAppBase> apps) { _machineServiceApp = apps.SingleOrDefault(x => x.Name == "MachineService"); @@ -97,8 +75,8 @@ namespace Tango.AzureUtils.UI.ViewModels IsFree = false; - Config.Email = Email; - Config.Password = Password; + Config.Email = Settings.Email; + Config.Password = Settings.Password; await _environmentManager.CreateEnvironment(_machineServiceApp as IWebApp, SelectedDeploymentSlot, SlotName, Config); } diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/EnvironmentRemovalViewVM.cs b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/EnvironmentRemovalViewVM.cs index e8d966158..0917b012d 100644 --- a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/EnvironmentRemovalViewVM.cs +++ b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/EnvironmentRemovalViewVM.cs @@ -39,23 +39,6 @@ namespace Tango.AzureUtils.UI.ViewModels set { _slotName = value; RaisePropertyChangedAuto(); } } - private String _email; - [Required(ErrorMessage = "Active directory email is required.")] - [EmailAddress(ErrorMessage = "Please enter a valid email.")] - public String Email - { - get { return _email; } - set { _email = value; RaisePropertyChangedAuto(); } - } - - private String _password; - [Required(ErrorMessage = "Password is required.")] - public String Password - { - get { return _password; } - set { _password = value; RaisePropertyChangedAuto(); } - } - private RemoveEnvironmentConfiguration _config; public RemoveEnvironmentConfiguration Config { @@ -71,12 +54,6 @@ namespace Tango.AzureUtils.UI.ViewModels Config = new RemoveEnvironmentConfiguration(); } - public override void OnApplicationReady() - { - Email = "roy@twine-s.com"; - Password = "1Creativity"; - } - public override void OnAuthenticated(IAzure azure, List<IWebAppBase> apps) { _machineServiceApp = apps.SingleOrDefault(x => x.Name == "MachineService"); @@ -96,8 +73,8 @@ namespace Tango.AzureUtils.UI.ViewModels IsFree = false; - Config.Email = Email; - Config.Password = Password; + Config.Email = Settings.Email; + Config.Password = Settings.Password; await _environmentManager.RemoveEnvironment(SelectedDeploymentSlot, SlotName, Config); diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/MainViewVM.cs index 4faf1369f..69543cb5a 100644 --- a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/MainViewVM.cs @@ -2,6 +2,7 @@ using Microsoft.Azure.Management.Fluent; using System; using System.Collections.Generic; +using System.Configuration; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -9,6 +10,7 @@ using System.Windows.Input; using Tango.AzureUtils.Deployment; using Tango.AzureUtils.UI.Managers; using Tango.Core.Commands; +using Tango.Core.Cryptography; using Tango.Core.DI; using Tango.SharedUI; @@ -34,6 +36,21 @@ namespace Tango.AzureUtils.UI.ViewModels set { _progress = value; RaisePropertyChangedAuto(); } } + private String _email; + public String Email + { + get { return _email; } + set { _email = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + + private String _password; + public String Password + { + get { return _password; } + set { _password = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + + #endregion #region Commands @@ -44,7 +61,14 @@ namespace Tango.AzureUtils.UI.ViewModels public MainViewVM() { - InitCommand = new RelayCommand(Init, () => !IsInitialized); + InitCommand = new RelayCommand(Init, () => !IsInitialized && !String.IsNullOrWhiteSpace(Email) && !String.IsNullOrWhiteSpace(Password)); + + try + { + Email = Settings.Email; + Password = Settings.Password; + } + catch { } } public override void OnApplicationReady() @@ -65,7 +89,12 @@ namespace Tango.AzureUtils.UI.ViewModels IsFree = false; StatusManager.UpdateStatus(AzureUtilsStage.Initializing, "Authenticating...", true); - _azure = await AzureUtilsAuthenticationFactory.AuthenticateOrGetAsync(); + _azure = await AzureUtilsAuthenticationFactory.AuthenticateOrGetAsync(ConfigurationManager.AppSettings.Get("GatewayUrl"), Email, Password); + + Settings.Email = Email; + Settings.Password = Password; + Settings.Save(); + List<IWebAppBase> allApps = new List<IWebAppBase>(); diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Views/EnvironmentCreationView.xaml b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Views/EnvironmentCreationView.xaml index 068e96318..05f917e5b 100644 --- a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Views/EnvironmentCreationView.xaml +++ b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Views/EnvironmentCreationView.xaml @@ -51,16 +51,10 @@ </GroupBox> <StackPanel> - <GroupBox HorizontalAlignment="Left" Margin="50 10 10 10" Header="Environment Name/Credentials" Padding="10 10 90 10"> + <GroupBox HorizontalAlignment="Left" Margin="50 10 10 10" Header="Environment Name" Padding="10 10 90 10"> <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" MinWidth="300"> <TextBlock FontSize="10">Environment Name (e.g DEV)</TextBlock> <TextBox Margin="0 2 0 0" Text="{Binding SlotName}"></TextBox> - - <TextBlock FontSize="10" Margin="0 10 0 0">Active Directory Administrator Email</TextBlock> - <TextBox Margin="0 2 0 0" Text="{Binding Email}"></TextBox> - - <TextBlock Margin="0 10 0 0" FontSize="10">Password</TextBlock> - <PasswordBox Margin="0 2 0 0" helpers:PasswordHelper.Attach="True" helpers:PasswordHelper.Password="{Binding Password,Mode=TwoWay}"></PasswordBox> </StackPanel> </GroupBox> diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Views/EnvironmentRemovalView.xaml b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Views/EnvironmentRemovalView.xaml index 2175aaaf3..3eed6575e 100644 --- a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Views/EnvironmentRemovalView.xaml +++ b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Views/EnvironmentRemovalView.xaml @@ -41,16 +41,10 @@ </GroupBox> <StackPanel> - <GroupBox HorizontalAlignment="Left" Margin="50 10 10 10" Header="Environment Credentials" Padding="10 10 90 10"> + <GroupBox HorizontalAlignment="Left" Margin="50 10 10 10" Header="Environment Name" Padding="10 10 90 10"> <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" MinWidth="300"> <TextBlock FontSize="10">Environment Name (e.g DEV)</TextBlock> <TextBox Margin="0 2 0 0" Text="{Binding SlotName}"></TextBox> - - <TextBlock FontSize="10" Margin="0 10 0 0">Active Directory Administrator Email</TextBlock> - <TextBox Margin="0 2 0 0" Text="{Binding Email}"></TextBox> - - <TextBlock Margin="0 10 0 0" FontSize="10">Password</TextBlock> - <PasswordBox Margin="0 2 0 0" helpers:PasswordHelper.Attach="True" helpers:PasswordHelper.Password="{Binding Password,Mode=TwoWay}"></PasswordBox> </StackPanel> </GroupBox> diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Views/MainView.xaml b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Views/MainView.xaml index 40d431be1..b79d306d1 100644 --- a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Views/MainView.xaml @@ -3,6 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:helpers="clr-namespace:Tango.SharedUI.Helpers;assembly=Tango.SharedUI" xmlns:vm="clr-namespace:Tango.AzureUtils.UI.ViewModels" xmlns:global="clr-namespace:Tango.AzureUtils.UI" xmlns:views="clr-namespace:Tango.AzureUtils.UI.Views" @@ -24,7 +25,21 @@ <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10 0 0 0" FontSize="50">Azure Utils</TextBlock> - <Button Command="{Binding InitCommand}" HorizontalAlignment="Right" VerticalAlignment="Center" Padding="30 10" Margin="10">Authenticate</Button> + <StackPanel HorizontalAlignment="Right" Orientation="Horizontal" IsEnabled="{Binding IsInitialized,Converter={StaticResource BooleanInverseConverter}}"> + + <StackPanel> + <StackPanel VerticalAlignment="Center" Width="150"> + <TextBlock FontSize="10" Margin="0 10 0 0">Email</TextBlock> + <TextBox Margin="0 2 0 0" Text="{Binding Email}"></TextBox> + </StackPanel> + + <StackPanel VerticalAlignment="Center" Width="150"> + <TextBlock Margin="0 5 0 0" FontSize="10">Password</TextBlock> + <PasswordBox Margin="0 2 0 0" helpers:PasswordHelper.Attach="True" helpers:PasswordHelper.Password="{Binding Password,Mode=TwoWay}"></PasswordBox> + </StackPanel> + </StackPanel> + <Button Command="{Binding InitCommand}" VerticalAlignment="Center" Padding="30 19" Margin="20 14 10 10" IsDefault="True">Authenticate</Button> + </StackPanel> <Grid Grid.Row="1" IsEnabled="{Binding IsInitialized}"> <TabControl Margin="10"> diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/packages.config b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/packages.config index 14a601db9..95f192e49 100644 --- a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/packages.config +++ b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/packages.config @@ -6,31 +6,31 @@ <package id="Microsoft.Azure.KeyVault" version="3.0.1" targetFramework="net461" /> <package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net461" /> <package id="Microsoft.Azure.KeyVault.WebKey" version="3.0.1" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.AppService.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.BatchAI.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.Cdn.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.Compute.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.ContainerInstance.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.ContainerRegistry.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.ContainerService.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.CosmosDB.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.Dns.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.EventHub.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.Graph.RBAC.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.KeyVault.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.Locks.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.Monitor.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.Msi.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.Network.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.PrivateDns.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.Redis.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.ResourceManager.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.Search.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.ServiceBus.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.Sql.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.Storage.Fluent" version="1.30.0" targetFramework="net461" /> - <package id="Microsoft.Azure.Management.TrafficManager.Fluent" version="1.30.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.AppService.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.BatchAI.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.Cdn.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.Compute.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.ContainerInstance.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.ContainerRegistry.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.ContainerService.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.CosmosDB.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.Dns.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.EventHub.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.Graph.RBAC.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.KeyVault.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.Locks.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.Monitor.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.Msi.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.Network.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.PrivateDns.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.Redis.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.ResourceManager.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.Search.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.ServiceBus.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.Sql.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.Storage.Fluent" version="1.31.0" targetFramework="net461" /> + <package id="Microsoft.Azure.Management.TrafficManager.Fluent" version="1.31.0" targetFramework="net461" /> <package id="Microsoft.Azure.Storage.Blob" version="11.1.2" targetFramework="net461" /> <package id="Microsoft.Azure.Storage.Common" version="11.1.2" targetFramework="net461" /> <package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="4.3.0" targetFramework="net461" /> |
