diff --git a/azure_m/azure_m/azure_m.Android/Properties/AndroidManifest.xml b/azure_m/azure_m/azure_m.Android/Properties/AndroidManifest.xml
index 74d76205e5b34668b18f4725a37e60f9e776e17d..8580b48541565a230b7160d8bbfbce56fddc81fd 100644
--- a/azure_m/azure_m/azure_m.Android/Properties/AndroidManifest.xml
+++ b/azure_m/azure_m/azure_m.Android/Properties/AndroidManifest.xml
@@ -3,4 +3,5 @@
+
diff --git a/azure_m/azure_m/azure_m.Android/Properties/AssemblyInfo.cs b/azure_m/azure_m/azure_m.Android/Properties/AssemblyInfo.cs
index a8f3e97ec98640863e0b9887e02ab2179f469b19..496313a5348efd08dd4a5e3b06d80c4715905c41 100644
--- a/azure_m/azure_m/azure_m.Android/Properties/AssemblyInfo.cs
+++ b/azure_m/azure_m/azure_m.Android/Properties/AssemblyInfo.cs
@@ -28,3 +28,4 @@ using Android.App;
// Add some common permissions, these can be removed if not needed
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
+[assembly: UsesPermission(Android.Manifest.Permission.Vibrate)]
\ No newline at end of file
diff --git a/azure_m/azure_m/azure_m.Android/Resources/Resource.designer.cs b/azure_m/azure_m/azure_m.Android/Resources/Resource.designer.cs
index 0b8d56b62eb118603da4ee2f5a44074c1ba01914..f881d6d6f3dc1c41bc255db31f3c1f35ad8bbe8e 100644
--- a/azure_m/azure_m/azure_m.Android/Resources/Resource.designer.cs
+++ b/azure_m/azure_m/azure_m.Android/Resources/Resource.designer.cs
@@ -14,7 +14,7 @@ namespace azure_m.Droid
{
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.2.4.160")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.3.0.26")]
public partial class Resource
{
diff --git a/azure_m/azure_m/azure_m/App.xaml.cs b/azure_m/azure_m/azure_m/App.xaml.cs
index d6ad8b9d07806e8e2bee066d612154afbce58ed1..ebcd6c97cd61251fdc067eb7896ecdff8f5fe5e4 100644
--- a/azure_m/azure_m/azure_m/App.xaml.cs
+++ b/azure_m/azure_m/azure_m/App.xaml.cs
@@ -1,6 +1,9 @@
-using azure_m.Services;
+#define DEBUG
+
+using azure_m.Services;
using azure_m.Views;
using System;
+using System.Threading;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using Microsoft.Identity.Client;
@@ -16,18 +19,19 @@ namespace azure_m
DependencyService.Register();
DependencyService.Register();
+
QueryInfo.initEnv();
+#if DEBUG
+ MainPage = new AppShell();
+#else
MainPage = new LoginPage();
((LoginPage)MainPage).LoginCompleted += h;
+#endif
startBack();
- //LoginPage loginPage = new LoginPage();
- ////VirtualNetworkPage = new AppShell
- //loginPage.LoginCompleted += h;
}
public void h(object sender, string e)
{
- Console.WriteLine(e);
MainPage=new AppShell();
}
diff --git a/azure_m/azure_m/azure_m/AppShell.xaml b/azure_m/azure_m/azure_m/AppShell.xaml
index 342767d988c50296c44aa51996489ba620719305..7a8c2dd0b38b0b046c1194b32ff6dc1a50c62842 100644
--- a/azure_m/azure_m/azure_m/AppShell.xaml
+++ b/azure_m/azure_m/azure_m/AppShell.xaml
@@ -4,7 +4,7 @@
xmlns:local="clr-namespace:azure_m.Views" xmlns:azure_m="clr-namespace:azure_m" x:DataType="azure_m:AppShell"
Title="Azure"
Shell.NavBarHasShadow="True"
-
+ Shell.TabBarIsVisible="False"
x:Class="azure_m.AppShell"
>
@@ -183,8 +183,8 @@
-
-
+
+
diff --git a/azure_m/azure_m/azure_m/AppShell.xaml.cs b/azure_m/azure_m/azure_m/AppShell.xaml.cs
index 313e6e29475ee14f35222ed7bfa33a790ecabcb0..87c62265ac7a0d30af87cd426991a7fd6478a2a7 100644
--- a/azure_m/azure_m/azure_m/AppShell.xaml.cs
+++ b/azure_m/azure_m/azure_m/AppShell.xaml.cs
@@ -18,6 +18,9 @@ namespace azure_m
Routing.RegisterRoute(nameof(MonitorPage), typeof(MonitorPage));
Routing.RegisterRoute(nameof(AllResourcesPage), typeof(AllResourcesPage));
Routing.RegisterRoute(nameof(AllServicePage), typeof(AllServicePage));
+ Routing.RegisterRoute(nameof(AddPage), typeof(AddPage));
+ Routing.RegisterRoute(nameof(VirtualMachinePage), typeof(VirtualMachinePage));
+ Routing.RegisterRoute(nameof(ResourceGroupPage), typeof(ResourceGroupPage));
this.CurrentItem = Home;
}
diff --git a/azure_m/azure_m/azure_m/Views/AddPage.xaml b/azure_m/azure_m/azure_m/Views/AddPage.xaml
new file mode 100644
index 0000000000000000000000000000000000000000..e65deb0a5016dd5076059e6702a20234ad1dd1f8
--- /dev/null
+++ b/azure_m/azure_m/azure_m/Views/AddPage.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/azure_m/azure_m/azure_m/Views/AddPage.xaml.cs b/azure_m/azure_m/azure_m/Views/AddPage.xaml.cs
new file mode 100644
index 0000000000000000000000000000000000000000..7abd070b8c776aa3e9e29b2234ea5e5b8f683b71
--- /dev/null
+++ b/azure_m/azure_m/azure_m/Views/AddPage.xaml.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using Xamarin.Forms;
+using Xamarin.Forms.Xaml;
+
+namespace azure_m.Views
+{
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class AddPage : ContentPage
+ {
+ public AddPage()
+ {
+ InitializeComponent();
+ }
+ }
+}
\ No newline at end of file
diff --git a/azure_m/azure_m/azure_m/Views/MainPage.xaml b/azure_m/azure_m/azure_m/Views/MainPage.xaml
index d6944bfd2a7deeecb600cbfd338e187d01209795..7112b1e0f90c5f5c44c2f71aafd1eabe7784033f 100644
--- a/azure_m/azure_m/azure_m/Views/MainPage.xaml
+++ b/azure_m/azure_m/azure_m/Views/MainPage.xaml
@@ -50,7 +50,13 @@
-
+
+
+
diff --git a/azure_m/azure_m/azure_m/Views/MainPage.xaml.cs b/azure_m/azure_m/azure_m/Views/MainPage.xaml.cs
index 63c7bf29075c1cdadc865f9e164029a695429473..c43ee1f55d7e80d9b35e177fc5c82601c9dda139 100644
--- a/azure_m/azure_m/azure_m/Views/MainPage.xaml.cs
+++ b/azure_m/azure_m/azure_m/Views/MainPage.xaml.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.ComponentModel;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
+using Xamarin.Essentials;
using azure_m.Models;
namespace azure_m.Views
@@ -27,7 +28,7 @@ namespace azure_m.Views
List resources = new List();
//查询指定资源,放置在ResourcesLayout中
//resources = await GetResourcesByApi(type)...
- //resources.sort by type nad name
+ //resources.sort by type nad name (or linq
///DEBUG
if(type == 0)
@@ -36,26 +37,55 @@ namespace azure_m.Views
resources.Add(new Resource( "jp", "vm", "1", "虚拟机"));
}
- resources.ForEach(o => {
+ //no resources
+ if (resources.Count == 0)
+ {
Grid grid = new Grid
{
Margin = new Thickness(20, 0, 20, 0),
HorizontalOptions = LayoutOptions.FillAndExpand,
BackgroundColor = Color.MintCream,
RowSpacing = 10,
- ColumnDefinitions =
+ RowDefinitions =
{
//new ColumnDefinition { Width = new GridLength (1, GridUnitType.Star) },
- new ColumnDefinition { Width = new GridLength (1, GridUnitType.Star) },
- new ColumnDefinition { Width = new GridLength (1, GridUnitType.Star) },
- new ColumnDefinition { Width = new GridLength (1, GridUnitType.Star) }
+ new RowDefinition { Height = new GridLength (2, GridUnitType.Star) },
+ new RowDefinition { Height = new GridLength (1, GridUnitType.Star) }
}
};
- grid.Children.Add(new Image { Source = getSourceByType(o.type), HeightRequest = 15, VerticalOptions = LayoutOptions.Start }, 0, 0);
- grid.Children.Add(new Label { Text = o.name, HeightRequest = grid.Height, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Start }, 0, 0);
- grid.Children.Add(new Label { Text = o.type, HeightRequest = grid.Height, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center }, 1, 0);
+ var formattedString = new FormattedString();
+ formattedString.Spans.Add(new Span { Text = "No resources have been favorited\n", FontAttributes = FontAttributes.Bold });
+
+ var span = new Span { Text = "Favorite resources to quickly navigate to them from the home page." };
+ formattedString.Spans.Add(span);
+ grid.Children.Add(new Label { FormattedText = formattedString },0,0);
ResourceLayout.Children.Add(grid);
- });
+ }
+
+ else
+ {
+ resources.ForEach(o =>
+ {
+ Grid grid = new Grid
+ {
+ Margin = new Thickness(20, 0, 20, 0),
+ HorizontalOptions = LayoutOptions.FillAndExpand,
+ BackgroundColor = Color.MintCream,
+ RowSpacing = 10,
+ ColumnDefinitions =
+ {
+ //new ColumnDefinition { Width = new GridLength (1, GridUnitType.Star) },
+ new ColumnDefinition { Width = new GridLength (1, GridUnitType.Star) },
+ new ColumnDefinition { Width = new GridLength (2, GridUnitType.Star) },
+ new ColumnDefinition { Width = new GridLength (1, GridUnitType.Star) }
+ }
+ };
+ grid.Children.Add(new Image { Source = getSourceByType(o.type), HeightRequest = 15, VerticalOptions = LayoutOptions.Start }, 0, 0);
+ grid.Children.Add(new Label { Text = o.name, HeightRequest = grid.Height, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Start }, 0, 0);
+ grid.Children.Add(new Label { Text = o.type, HeightRequest = grid.Height, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center }, 1, 0);
+ ResourceLayout.Children.Add(grid);
+ });
+ }
}
@@ -88,7 +118,7 @@ namespace azure_m.Views
{
swapBtnColors();
//异步 querying datas, 在此期间出现一个刷新标志
- GetResources(1);
+ GetResources(0);
}
public void OnMyIcon_Clicked(object sender, EventArgs e)
@@ -112,17 +142,20 @@ namespace azure_m.Views
public void OnAdd_Clicked(object sender, EventArgs e)
{
//this.Navigation.PushAsync(new AddPage());
- DisplayAlert("Alert", "AddPage", "OK");
+ Xamarin.Essentials.Vibration.Vibrate(500);
+ Navigation.PushAsync(new AddPage());
+
+
}
public void OnSubscribe_Clicked(object sender, EventArgs e)
{
//this.Navigation.PushAsync(new SubscribePage());
- DisplayAlert("Alert", "SubscribePage", "OK");
+ Navigation.PushAsync(new SubscribePage());
}
public void OnVM_Clicked(object sender, EventArgs e)
{
//Navigation.PushAsync(new VirtualMachinePage());
- DisplayAlert("Alert", "VMPage", "OK");
+ Navigation.PushAsync(new VirtualMachinePage());
}
public void OnDashboard_Clicked(object sender, EventArgs e)
{
@@ -136,7 +169,7 @@ namespace azure_m.Views
public void OnMoreService_Clicked(object sender, EventArgs e)
{
//Navigation.PushAsync(new AllService());
- DisplayAlert("Alert", "AllService", "OK");
+ Navigation.PushAsync(new AllServicePage());
}
private void MoreResourceBtn_Clicked(object sender, EventArgs e)
diff --git a/azure_m/azure_m/azure_m/Views/ResourceGroupPage.xaml b/azure_m/azure_m/azure_m/Views/ResourceGroupPage.xaml
new file mode 100644
index 0000000000000000000000000000000000000000..cfd8ef7745a95a35a6b39106acb673a0657d64c6
--- /dev/null
+++ b/azure_m/azure_m/azure_m/Views/ResourceGroupPage.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/azure_m/azure_m/azure_m/Views/ResourceGroupPage.xaml.cs b/azure_m/azure_m/azure_m/Views/ResourceGroupPage.xaml.cs
new file mode 100644
index 0000000000000000000000000000000000000000..59a2a2cb06d7ee453d4d2839415fad575fd2e322
--- /dev/null
+++ b/azure_m/azure_m/azure_m/Views/ResourceGroupPage.xaml.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using Xamarin.Forms;
+using Xamarin.Forms.Xaml;
+
+namespace azure_m.Views
+{
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class ResourceGroupPage : ContentPage
+ {
+ public ResourceGroupPage()
+ {
+ InitializeComponent();
+ }
+ }
+}
\ No newline at end of file
diff --git a/azure_m/azure_m/azure_m/Views/SubscribePage.xaml b/azure_m/azure_m/azure_m/Views/SubscribePage.xaml
new file mode 100644
index 0000000000000000000000000000000000000000..3929504ed7cbfd3aacb2e5546ab7490e96ccafa5
--- /dev/null
+++ b/azure_m/azure_m/azure_m/Views/SubscribePage.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/azure_m/azure_m/azure_m/Views/SubscribePage.xaml.cs b/azure_m/azure_m/azure_m/Views/SubscribePage.xaml.cs
new file mode 100644
index 0000000000000000000000000000000000000000..8613e34e8c8c41551b7617804aea6567b45157db
--- /dev/null
+++ b/azure_m/azure_m/azure_m/Views/SubscribePage.xaml.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using Xamarin.Forms;
+using Xamarin.Forms.Xaml;
+
+namespace azure_m.Views
+{
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class SubscribePage : ContentPage
+ {
+ public SubscribePage()
+ {
+ InitializeComponent();
+ }
+ }
+}
\ No newline at end of file
diff --git a/azure_m/azure_m/azure_m/Views/VirtualMachinePage.xaml b/azure_m/azure_m/azure_m/Views/VirtualMachinePage.xaml
new file mode 100644
index 0000000000000000000000000000000000000000..d1b8d8bf2520247a7da34e5dd60fe86d87f0cb83
--- /dev/null
+++ b/azure_m/azure_m/azure_m/Views/VirtualMachinePage.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/azure_m/azure_m/azure_m/Views/VirtualMachinePage.xaml.cs b/azure_m/azure_m/azure_m/Views/VirtualMachinePage.xaml.cs
new file mode 100644
index 0000000000000000000000000000000000000000..aed107c1df1b333d162efcc32c73ee76d50a558f
--- /dev/null
+++ b/azure_m/azure_m/azure_m/Views/VirtualMachinePage.xaml.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using Xamarin.Forms;
+using Xamarin.Forms.Xaml;
+
+namespace azure_m.Views
+{
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class VirtualMachinePage : ContentPage
+ {
+ public VirtualMachinePage()
+ {
+ InitializeComponent();
+ }
+ }
+}
\ No newline at end of file
diff --git a/azure_m/azure_m/azure_m/azure_m.csproj b/azure_m/azure_m/azure_m/azure_m.csproj
index f70c4b532bd6d82d83d628e16105a02431d0c456..e2d96c5b1af0883d6cf91878e7913b6fe746fbec 100644
--- a/azure_m/azure_m/azure_m/azure_m.csproj
+++ b/azure_m/azure_m/azure_m/azure_m.csproj
@@ -17,12 +17,30 @@
+
+ VirtualMachinePage.xaml
+
+
+
+
+
+ MSBuild:UpdateDesignTimeXaml
+
MSBuild:UpdateDesignTimeXaml
+
+ MSBuild:UpdateDesignTimeXaml
+
+
+ MSBuild:UpdateDesignTimeXaml
+
MSBuild:UpdateDesignTimeXaml
+
+ MSBuild:UpdateDesignTimeXaml
+
MSBuild:UpdateDesignTimeXaml