aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Azure
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-07-28 15:50:27 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-07-28 15:50:27 +0300
commit0281068b4adb3f94af50f2c758d3e0fa0fe5f191 (patch)
tree63d1dcc9ce546722beb7689739a94194556013ba /Software/Visual_Studio/Azure
parent7c7aba43ab895d02e0209861550fed3bc12f3904 (diff)
downloadTango-0281068b4adb3f94af50f2c758d3e0fa0fe5f191.tar.gz
Tango-0281068b4adb3f94af50f2c758d3e0fa0fe5f191.zip
Added machine service version display to AzureUtils.
Diffstat (limited to 'Software/Visual_Studio/Azure')
-rw-r--r--Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Controls/WebAppPropertiesControl.xaml3
-rw-r--r--Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Controls/WebAppPropertiesControl.xaml.cs14
-rw-r--r--Software/Visual_Studio/Azure/Tango.AzureUtils.UI/MainWindow.xaml2
-rw-r--r--Software/Visual_Studio/Azure/Tango.AzureUtils/FTP/FtpManager.cs17
4 files changed, 35 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Controls/WebAppPropertiesControl.xaml b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Controls/WebAppPropertiesControl.xaml
index aadfb7918..6eb78c808 100644
--- a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Controls/WebAppPropertiesControl.xaml
+++ b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Controls/WebAppPropertiesControl.xaml
@@ -64,6 +64,9 @@
<TextBlock FontWeight="SemiBold">Tango FSE Version:</TextBlock>
<TextBlock Text="{Binding ElementName=control,Path=FseVersion.Version}"></TextBlock>
+
+ <TextBlock FontWeight="SemiBold">Machine Service Version:</TextBlock>
+ <TextBlock Text="{Binding ElementName=control,Path=MachineServiceVersion}"></TextBlock>
</controls:TableGrid>
</StackPanel>
diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Controls/WebAppPropertiesControl.xaml.cs b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Controls/WebAppPropertiesControl.xaml.cs
index 8888dfc02..129550d14 100644
--- a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Controls/WebAppPropertiesControl.xaml.cs
+++ b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Controls/WebAppPropertiesControl.xaml.cs
@@ -14,6 +14,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Tango.AzureUtils.Database;
+using Tango.AzureUtils.FTP;
using Tango.BL.Entities;
namespace Tango.AzureUtils.UI.Controls
@@ -63,6 +64,16 @@ namespace Tango.AzureUtils.UI.Controls
public static readonly DependencyProperty MachineStudioVersionProperty =
DependencyProperty.Register("MachineStudioVersion", typeof(MachineStudioVersion), typeof(WebAppPropertiesControl), new PropertyMetadata(null));
+ public String MachineServiceVersion
+ {
+ get { return (String)GetValue(MachineServiceVersionProperty); }
+ set { SetValue(MachineServiceVersionProperty, value); }
+ }
+ public static readonly DependencyProperty MachineServiceVersionProperty =
+ DependencyProperty.Register("MachineServiceVersion", typeof(String), typeof(WebAppPropertiesControl), new PropertyMetadata(null));
+
+
+
public bool IsBusy
{
get { return (bool)GetValue(IsBusyProperty); }
@@ -97,6 +108,9 @@ namespace Tango.AzureUtils.UI.Controls
TangoVersion = await databaseManager.GetLatestPPCVersion(app);
MachineStudioVersion = await databaseManager.GetLatestMachineStudioVersion(app);
FseVersion = await databaseManager.GetLatestFSEVersion(app);
+
+ FtpManager ftpManager = new FtpManager(azure);
+ MachineServiceVersion = await ftpManager.GetMachineServiceVersion(app);
}
catch { }
finally
diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/MainWindow.xaml b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/MainWindow.xaml
index 6eaedea2a..d23fd41d8 100644
--- a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/MainWindow.xaml
+++ b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/MainWindow.xaml
@@ -6,7 +6,7 @@
xmlns:views="clr-namespace:Tango.AzureUtils.UI.Views"
xmlns:local="clr-namespace:Tango.AzureUtils.UI"
mc:Ignorable="d"
- Title="Azure Utils" Height="920" Width="1280">
+ Title="Azure Utils" Height="950" Width="1280" WindowStartupLocation="CenterScreen">
<Grid>
<views:MainView/>
diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils/FTP/FtpManager.cs b/Software/Visual_Studio/Azure/Tango.AzureUtils/FTP/FtpManager.cs
index 5a174dcb2..021426d12 100644
--- a/Software/Visual_Studio/Azure/Tango.AzureUtils/FTP/FtpManager.cs
+++ b/Software/Visual_Studio/Azure/Tango.AzureUtils/FTP/FtpManager.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
using System.Security.Authentication;
using System.Text;
@@ -115,5 +116,21 @@ namespace Tango.AzureUtils.FTP
var downloadResults = await DownloadWebAppFiles(sourceApp, webAppFilesTempFolder);
var uploadResults = await UploadWebAppFiles(targetApp, webAppFilesTempFolder);
}
+
+ public async Task<String> GetMachineServiceVersion(IWebAppBase app)
+ {
+ var exeTempFile = TemporaryManager.CreateImaginaryFile(".dll");
+
+ var profile = await app.GetPublishingProfileAsync();
+
+ using (var ftp = CreateFtpClient(profile.FtpUrl, profile.FtpUsername, profile.FtpPassword))
+ {
+ await ftp.ConnectAsync();
+ await ftp.DownloadFileAsync(exeTempFile, "/site/wwwroot/bin/Tango.MachineService.dll");
+ String version = FileVersionInfo.GetVersionInfo(exeTempFile).ProductVersion;
+ await exeTempFile.DeleteAsync();
+ return version;
+ }
+ }
}
}