diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..59e0bbe --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM microsoft/dotnet:1.1.0-sdk-projectjson + +RUN apt-get update +RUN wget -qO- https://deb.nodesource.com/setup_4.x | bash - +RUN apt-get install -y build-essential nodejs + + +COPY . /app + + +WORKDIR /app/src/LanBackup.WebApp +RUN ["dotnet", "restore"] + +WORKDIR /app/src/LanBackup.DataCore +RUN ["dotnet", "restore"] + +WORKDIR /app/src/LanBackup.ModelsCore +RUN ["dotnet", "restore"] + + + +WORKDIR /app/src/LanBackup.WebApp +RUN ["dotnet", "build"] + +EXPOSE 5000/tcp + +CMD ["dotnet", "run", "--server.urls", "http://*:5000"] diff --git a/LanBackup.sln b/LanBackup.sln new file mode 100644 index 0000000..bb42bd5 --- /dev/null +++ b/LanBackup.sln @@ -0,0 +1,108 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F99F86DB-318D-4D40-803F-B6C0BC10A222}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{555C50F9-9FB8-4846-9043-759A63B67965}" + ProjectSection(SolutionItems) = preProject + Dockerfile = Dockerfile + global.json = global.json + NuGet.config = NuGet.config + Readme.md = Readme.md + EndProjectSection +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "LanBackup.ModelsCore", "src\LanBackup.ModelsCore\LanBackup.ModelsCore.xproj", "{CDC21836-C111-4DB4-96C1-A37128DF2127}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "LanBackup.DataCore", "src\LanBackup.DataCore\LanBackup.DataCore.xproj", "{B4144721-0F2C-4750-ABA3-5238490A71FF}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "LanBackup.WebApp", "src\LanBackup.WebApp\LanBackup.WebApp.xproj", "{315453E2-9C17-46F3-9CCC-2FC0688342C2}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LanBackupAgent", "LanBackupAgent", "{9EF05F3D-E711-452B-885A-EDA277B36D20}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LanBackupServices", "LanBackupServices", "{067F2B55-97D6-46C0-AD33-F7F56BD06F40}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{18488CFA-6E13-4F3B-A5B4-74958B8BB813}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "LanBackup.WebAppSpa.Tests", "test\LanBackup.WebAppSpa.Tests\LanBackup.WebAppSpa.Tests.xproj", "{F124A292-3711-4FD1-9C54-63D5CF613D37}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LanBackupAgent", "src\LanBackupAgent\LanBackupAgent.csproj", "{CB7EE867-93E8-43E3-9EEE-9068AED1DE6C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_stylecop", "_stylecop", "{3F8C9C01-BB62-433C-92E6-20439354352A}" + ProjectSection(SolutionItems) = preProject + misc\_stylecop\stylecop.json = misc\_stylecop\stylecop.json + misc\_stylecop\StyleCopeRules.ruleset = misc\_stylecop\StyleCopeRules.ruleset + EndProjectSection +EndProject +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "LanBackupAgentSetup", "src\LanBackupAgentSetup\LanBackupAgentSetup.wixproj", "{F530020F-0DF2-49B8-9401-1C1C282077F5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CDC21836-C111-4DB4-96C1-A37128DF2127}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CDC21836-C111-4DB4-96C1-A37128DF2127}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CDC21836-C111-4DB4-96C1-A37128DF2127}.Debug|x86.ActiveCfg = Debug|Any CPU + {CDC21836-C111-4DB4-96C1-A37128DF2127}.Debug|x86.Build.0 = Debug|Any CPU + {CDC21836-C111-4DB4-96C1-A37128DF2127}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CDC21836-C111-4DB4-96C1-A37128DF2127}.Release|Any CPU.Build.0 = Release|Any CPU + {CDC21836-C111-4DB4-96C1-A37128DF2127}.Release|x86.ActiveCfg = Release|Any CPU + {CDC21836-C111-4DB4-96C1-A37128DF2127}.Release|x86.Build.0 = Release|Any CPU + {B4144721-0F2C-4750-ABA3-5238490A71FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B4144721-0F2C-4750-ABA3-5238490A71FF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B4144721-0F2C-4750-ABA3-5238490A71FF}.Debug|x86.ActiveCfg = Debug|Any CPU + {B4144721-0F2C-4750-ABA3-5238490A71FF}.Debug|x86.Build.0 = Debug|Any CPU + {B4144721-0F2C-4750-ABA3-5238490A71FF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B4144721-0F2C-4750-ABA3-5238490A71FF}.Release|Any CPU.Build.0 = Release|Any CPU + {B4144721-0F2C-4750-ABA3-5238490A71FF}.Release|x86.ActiveCfg = Release|Any CPU + {B4144721-0F2C-4750-ABA3-5238490A71FF}.Release|x86.Build.0 = Release|Any CPU + {315453E2-9C17-46F3-9CCC-2FC0688342C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {315453E2-9C17-46F3-9CCC-2FC0688342C2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {315453E2-9C17-46F3-9CCC-2FC0688342C2}.Debug|x86.ActiveCfg = Debug|Any CPU + {315453E2-9C17-46F3-9CCC-2FC0688342C2}.Debug|x86.Build.0 = Debug|Any CPU + {315453E2-9C17-46F3-9CCC-2FC0688342C2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {315453E2-9C17-46F3-9CCC-2FC0688342C2}.Release|Any CPU.Build.0 = Release|Any CPU + {315453E2-9C17-46F3-9CCC-2FC0688342C2}.Release|x86.ActiveCfg = Release|Any CPU + {315453E2-9C17-46F3-9CCC-2FC0688342C2}.Release|x86.Build.0 = Release|Any CPU + {F124A292-3711-4FD1-9C54-63D5CF613D37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F124A292-3711-4FD1-9C54-63D5CF613D37}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F124A292-3711-4FD1-9C54-63D5CF613D37}.Debug|x86.ActiveCfg = Debug|Any CPU + {F124A292-3711-4FD1-9C54-63D5CF613D37}.Debug|x86.Build.0 = Debug|Any CPU + {F124A292-3711-4FD1-9C54-63D5CF613D37}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F124A292-3711-4FD1-9C54-63D5CF613D37}.Release|Any CPU.Build.0 = Release|Any CPU + {F124A292-3711-4FD1-9C54-63D5CF613D37}.Release|x86.ActiveCfg = Release|Any CPU + {F124A292-3711-4FD1-9C54-63D5CF613D37}.Release|x86.Build.0 = Release|Any CPU + {CB7EE867-93E8-43E3-9EEE-9068AED1DE6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CB7EE867-93E8-43E3-9EEE-9068AED1DE6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CB7EE867-93E8-43E3-9EEE-9068AED1DE6C}.Debug|x86.ActiveCfg = Debug|Any CPU + {CB7EE867-93E8-43E3-9EEE-9068AED1DE6C}.Debug|x86.Build.0 = Debug|Any CPU + {CB7EE867-93E8-43E3-9EEE-9068AED1DE6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CB7EE867-93E8-43E3-9EEE-9068AED1DE6C}.Release|Any CPU.Build.0 = Release|Any CPU + {CB7EE867-93E8-43E3-9EEE-9068AED1DE6C}.Release|x86.ActiveCfg = Release|Any CPU + {CB7EE867-93E8-43E3-9EEE-9068AED1DE6C}.Release|x86.Build.0 = Release|Any CPU + {F530020F-0DF2-49B8-9401-1C1C282077F5}.Debug|Any CPU.ActiveCfg = Debug|x86 + {F530020F-0DF2-49B8-9401-1C1C282077F5}.Debug|x86.ActiveCfg = Debug|x86 + {F530020F-0DF2-49B8-9401-1C1C282077F5}.Debug|x86.Build.0 = Debug|x86 + {F530020F-0DF2-49B8-9401-1C1C282077F5}.Release|Any CPU.ActiveCfg = Release|x86 + {F530020F-0DF2-49B8-9401-1C1C282077F5}.Release|x86.ActiveCfg = Release|x86 + {F530020F-0DF2-49B8-9401-1C1C282077F5}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {CDC21836-C111-4DB4-96C1-A37128DF2127} = {067F2B55-97D6-46C0-AD33-F7F56BD06F40} + {B4144721-0F2C-4750-ABA3-5238490A71FF} = {067F2B55-97D6-46C0-AD33-F7F56BD06F40} + {315453E2-9C17-46F3-9CCC-2FC0688342C2} = {067F2B55-97D6-46C0-AD33-F7F56BD06F40} + {9EF05F3D-E711-452B-885A-EDA277B36D20} = {F99F86DB-318D-4D40-803F-B6C0BC10A222} + {067F2B55-97D6-46C0-AD33-F7F56BD06F40} = {F99F86DB-318D-4D40-803F-B6C0BC10A222} + {F124A292-3711-4FD1-9C54-63D5CF613D37} = {18488CFA-6E13-4F3B-A5B4-74958B8BB813} + {CB7EE867-93E8-43E3-9EEE-9068AED1DE6C} = {9EF05F3D-E711-452B-885A-EDA277B36D20} + {F530020F-0DF2-49B8-9401-1C1C282077F5} = {9EF05F3D-E711-452B-885A-EDA277B36D20} + EndGlobalSection +EndGlobal diff --git a/NuGet.config b/NuGet.config new file mode 100644 index 0000000..2ad0f8b --- /dev/null +++ b/NuGet.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..e54e166 --- /dev/null +++ b/Readme.md @@ -0,0 +1,108 @@ + + +**Overview:** + +The goal of this system is to allow centralized backup of certain specified data (files and folders) into designated storage locations, inside internal network of the organization. + +Used technologies: **.NET**, **ASP.NET Core** SPA with **Angular2** + +*System overview diagram:* +![System Overview](misc/docs/images/system_overview.png) + +**Screenshots** + +![Dashboard by Admin](misc/docs/images/dashboard_admin_custom.png){:height="150px" width="200px"} +![BackupConfigurations List](misc/docs/images/backupconfigurations_list_custom.png){:height="150px" width="200px"} +![BackupConfiguration Edit](misc/docs/images/backupconfigurations_edit_custom.png){:height="150px" width="200px"} +![Logs List](misc/docs/images/logs_list_custom.png){:height="150px" width="200px"} +![Users List](misc/docs/images/users_list_custom.png){:height="150px" width="200px"} +![Dashboard by Anonymous](misc/docs/images/dashboard_anonymous_custom.png){:height="150px" width="200px"} +![Profile](misc/docs/images/profile_custom.png){:height="150px" width="200px"} +![Login](misc/docs/images/login_custom.png){:height="150px" width="200px"} + + + +**Quick Start:** +- check prerequisite: + - server: + - .NET runtime https://www.microsoft.com/net/download/framework + - .NET Core runtime https://www.microsoft.com/net/download/core#/runtime + - IIS server installed (works also with IIS Express) + - MSSQL (version 2012+) installed on machine (can be the express/community/dev) + - clients: + - .NET runtime https://www.microsoft.com/net/download/framework +- download releases: + - client: ... + - server: ... +- install server package on the server machine: + - follow the instructions to deploy on IIS from https://docs.microsoft.com/en-us/aspnet/core/publishing/iis + - update the ***appsettings.json*** file with necesary info: + - AdminEmail: to match your own admin email + - ***DefaultConnection*** connection string to point to an instance of MSSQL - used to store user membership data. + - ***BackupsConnectionString*** connection string to point to an instance of MSSQL - used to store application data. + - default admin user is **admin@admin** with password **Admin$0**. Use it on first app run and change the password and eventually grant Admin role to other users as well. +- install agents setup on the client machines + - configure "C:\Program Files (x86)\LanBackupAgent\LanBackupAgent.exe.config" file. + - change **webApiUrl** setting to match your server IP and port configured above. + - restart LanBackuAgent service in service console (*services.msc*). + + + +**Application architecture** +![Component Interactions](misc/docs/images/component_interactions.png) + + + +**Database schema** +![Db Schema](misc/docs/images/db_schema.png) + + + +**Development Start** +- verify **prerequisite**: + - Visual Studio 2015 with Update 3 (can be Community Edition https://go.microsoft.com/fwlink/?LinkId=691978) + - .NET SDK (installed with VS2015) + - .NET Core SDK https://www.microsoft.com/net/download/core#/sdk + - IIS Express (installed with VS2015) + - MSSQL (version 2012+) installed on machine (can be the express/community/dev) (https://www.microsoft.com/en-us/sql-server/sql-server-editions-express) +- **clone** this repo on your machine: + ``` + git clone
+ ``` +- open solution in Visual Studio, all solution packages are available online and normally should **restore** by themself when opening the solution, wait for all packages to be restored automatically. +- Let's **build** +- set **startup** project ***LanBackup.WebApp*** +- **RUN** the app (F5 or Ctrl+F5). +- Two databases defined in the project config file will be created automatically at the first run of the project. One database is for AspNetIdentity, the second is to hold app data. +- To configure Microsoft Azure **Application Insight** I recommend setting in project "LanBackup.WebApp" the ***user secret*** file with a structure like: + ``` + { + "clientSettings": { + "AdminEmail": "personal@personal", + "InstrumentationEnabled": true, + "InstrumentationKey": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" + }, + "ApplicationInsights": { + "InstrumentationKey": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" + } + } + ``` + here the "clientSettings" are specific for JS client side app (Angular2) + and the "ApplicationInsights" part is used on the ASP.NET CORE side +- You might want to configure file "***.\LanBackup\.vs\config\applicationhost.config***" with appropiate binding info : IP and port, if you wish to test it in your network + + + +**TODOs** +- Functional + - show logs filtered by computer IP + - paginated list with sorting and sort direction +- Deployment + - configure install and run in docker container +- Testing + - add more unit tests on webapi serverside + - add more integrations tests on webapi server side + - add more unit tests on angular client side + + + \ No newline at end of file diff --git a/global.json b/global.json new file mode 100644 index 0000000..9d09ab5 --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "projects": [ "src", "test" ], + "sdk": { + "version": "1.0.0-preview2-003131" + } +} diff --git a/misc/_stylecop/StyleCopeRules.ruleset b/misc/_stylecop/StyleCopeRules.ruleset new file mode 100644 index 0000000..a181ac0 --- /dev/null +++ b/misc/_stylecop/StyleCopeRules.ruleset @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/misc/design/Design.doc b/misc/design/Design.doc new file mode 100644 index 0000000..72426cf Binary files /dev/null and b/misc/design/Design.doc differ diff --git a/misc/design/Design.pdf b/misc/design/Design.pdf new file mode 100644 index 0000000..6bb20ec Binary files /dev/null and b/misc/design/Design.pdf differ diff --git a/misc/docs/images/backupconfigurations_edit_custom.png b/misc/docs/images/backupconfigurations_edit_custom.png new file mode 100644 index 0000000..ea63e61 Binary files /dev/null and b/misc/docs/images/backupconfigurations_edit_custom.png differ diff --git a/misc/docs/images/backupconfigurations_list_custom.png b/misc/docs/images/backupconfigurations_list_custom.png new file mode 100644 index 0000000..688547e Binary files /dev/null and b/misc/docs/images/backupconfigurations_list_custom.png differ diff --git a/misc/docs/images/component_interactions.png b/misc/docs/images/component_interactions.png new file mode 100644 index 0000000..d90bf99 Binary files /dev/null and b/misc/docs/images/component_interactions.png differ diff --git a/misc/docs/images/dashboard_admin_custom.png b/misc/docs/images/dashboard_admin_custom.png new file mode 100644 index 0000000..6897b4b Binary files /dev/null and b/misc/docs/images/dashboard_admin_custom.png differ diff --git a/misc/docs/images/dashboard_anonymous_custom.png b/misc/docs/images/dashboard_anonymous_custom.png new file mode 100644 index 0000000..8ef4d27 Binary files /dev/null and b/misc/docs/images/dashboard_anonymous_custom.png differ diff --git a/misc/docs/images/db_schema.png b/misc/docs/images/db_schema.png new file mode 100644 index 0000000..f654750 Binary files /dev/null and b/misc/docs/images/db_schema.png differ diff --git a/misc/docs/images/login_custom.png b/misc/docs/images/login_custom.png new file mode 100644 index 0000000..8cbf2f2 Binary files /dev/null and b/misc/docs/images/login_custom.png differ diff --git a/misc/docs/images/logs_list_custom.png b/misc/docs/images/logs_list_custom.png new file mode 100644 index 0000000..051ac25 Binary files /dev/null and b/misc/docs/images/logs_list_custom.png differ diff --git a/misc/docs/images/profile_custom.png b/misc/docs/images/profile_custom.png new file mode 100644 index 0000000..8db9822 Binary files /dev/null and b/misc/docs/images/profile_custom.png differ diff --git a/misc/docs/images/system_overview.png b/misc/docs/images/system_overview.png new file mode 100644 index 0000000..5a3ab2c Binary files /dev/null and b/misc/docs/images/system_overview.png differ diff --git a/misc/docs/images/users_list_custom.png b/misc/docs/images/users_list_custom.png new file mode 100644 index 0000000..fd2b61e Binary files /dev/null and b/misc/docs/images/users_list_custom.png differ diff --git a/misc/media/3dde7c96ec5ff7038408777aba39514b.ico.zip b/misc/media/3dde7c96ec5ff7038408777aba39514b.ico.zip new file mode 100644 index 0000000..6e26065 Binary files /dev/null and b/misc/media/3dde7c96ec5ff7038408777aba39514b.ico.zip differ diff --git a/misc/media/app_icon.png b/misc/media/app_icon.png new file mode 100644 index 0000000..2343671 Binary files /dev/null and b/misc/media/app_icon.png differ diff --git a/misc/media/app_icon.png.ico b/misc/media/app_icon.png.ico new file mode 100644 index 0000000..ab5c571 Binary files /dev/null and b/misc/media/app_icon.png.ico differ diff --git a/misc/media/favicon.ico b/misc/media/favicon.ico new file mode 100644 index 0000000..fc8ac4a Binary files /dev/null and b/misc/media/favicon.ico differ diff --git a/misc/media/icons/android-icon-144x144.png b/misc/media/icons/android-icon-144x144.png new file mode 100644 index 0000000..6375071 Binary files /dev/null and b/misc/media/icons/android-icon-144x144.png differ diff --git a/misc/media/icons/android-icon-192x192.png b/misc/media/icons/android-icon-192x192.png new file mode 100644 index 0000000..e36bd37 Binary files /dev/null and b/misc/media/icons/android-icon-192x192.png differ diff --git a/misc/media/icons/android-icon-36x36.png b/misc/media/icons/android-icon-36x36.png new file mode 100644 index 0000000..26adb4a Binary files /dev/null and b/misc/media/icons/android-icon-36x36.png differ diff --git a/misc/media/icons/android-icon-48x48.png b/misc/media/icons/android-icon-48x48.png new file mode 100644 index 0000000..91af4d0 Binary files /dev/null and b/misc/media/icons/android-icon-48x48.png differ diff --git a/misc/media/icons/android-icon-72x72.png b/misc/media/icons/android-icon-72x72.png new file mode 100644 index 0000000..4e836e8 Binary files /dev/null and b/misc/media/icons/android-icon-72x72.png differ diff --git a/misc/media/icons/android-icon-96x96.png b/misc/media/icons/android-icon-96x96.png new file mode 100644 index 0000000..e11d96b Binary files /dev/null and b/misc/media/icons/android-icon-96x96.png differ diff --git a/misc/media/icons/apple-icon-114x114.png b/misc/media/icons/apple-icon-114x114.png new file mode 100644 index 0000000..7b1479a Binary files /dev/null and b/misc/media/icons/apple-icon-114x114.png differ diff --git a/misc/media/icons/apple-icon-120x120.png b/misc/media/icons/apple-icon-120x120.png new file mode 100644 index 0000000..4502a13 Binary files /dev/null and b/misc/media/icons/apple-icon-120x120.png differ diff --git a/misc/media/icons/apple-icon-144x144.png b/misc/media/icons/apple-icon-144x144.png new file mode 100644 index 0000000..6375071 Binary files /dev/null and b/misc/media/icons/apple-icon-144x144.png differ diff --git a/misc/media/icons/apple-icon-152x152.png b/misc/media/icons/apple-icon-152x152.png new file mode 100644 index 0000000..c94d3fb Binary files /dev/null and b/misc/media/icons/apple-icon-152x152.png differ diff --git a/misc/media/icons/apple-icon-180x180.png b/misc/media/icons/apple-icon-180x180.png new file mode 100644 index 0000000..3b98ed3 Binary files /dev/null and b/misc/media/icons/apple-icon-180x180.png differ diff --git a/misc/media/icons/apple-icon-57x57.png b/misc/media/icons/apple-icon-57x57.png new file mode 100644 index 0000000..df22a4b Binary files /dev/null and b/misc/media/icons/apple-icon-57x57.png differ diff --git a/misc/media/icons/apple-icon-60x60.png b/misc/media/icons/apple-icon-60x60.png new file mode 100644 index 0000000..c7eeac4 Binary files /dev/null and b/misc/media/icons/apple-icon-60x60.png differ diff --git a/misc/media/icons/apple-icon-72x72.png b/misc/media/icons/apple-icon-72x72.png new file mode 100644 index 0000000..4e836e8 Binary files /dev/null and b/misc/media/icons/apple-icon-72x72.png differ diff --git a/misc/media/icons/apple-icon-76x76.png b/misc/media/icons/apple-icon-76x76.png new file mode 100644 index 0000000..0677d61 Binary files /dev/null and b/misc/media/icons/apple-icon-76x76.png differ diff --git a/misc/media/icons/apple-icon-precomposed.png b/misc/media/icons/apple-icon-precomposed.png new file mode 100644 index 0000000..1c96ed3 Binary files /dev/null and b/misc/media/icons/apple-icon-precomposed.png differ diff --git a/misc/media/icons/apple-icon.png b/misc/media/icons/apple-icon.png new file mode 100644 index 0000000..1c96ed3 Binary files /dev/null and b/misc/media/icons/apple-icon.png differ diff --git a/misc/media/icons/browserconfig.xml b/misc/media/icons/browserconfig.xml new file mode 100644 index 0000000..c554148 --- /dev/null +++ b/misc/media/icons/browserconfig.xml @@ -0,0 +1,2 @@ + +#ffffff \ No newline at end of file diff --git a/misc/media/icons/favicon-16x16.png b/misc/media/icons/favicon-16x16.png new file mode 100644 index 0000000..d5dd67d Binary files /dev/null and b/misc/media/icons/favicon-16x16.png differ diff --git a/misc/media/icons/favicon-32x32.png b/misc/media/icons/favicon-32x32.png new file mode 100644 index 0000000..43363c2 Binary files /dev/null and b/misc/media/icons/favicon-32x32.png differ diff --git a/misc/media/icons/favicon-96x96.png b/misc/media/icons/favicon-96x96.png new file mode 100644 index 0000000..e11d96b Binary files /dev/null and b/misc/media/icons/favicon-96x96.png differ diff --git a/misc/media/icons/favicon.ico b/misc/media/icons/favicon.ico new file mode 100644 index 0000000..fc8ac4a Binary files /dev/null and b/misc/media/icons/favicon.ico differ diff --git a/misc/media/icons/manifest.json b/misc/media/icons/manifest.json new file mode 100644 index 0000000..013d4a6 --- /dev/null +++ b/misc/media/icons/manifest.json @@ -0,0 +1,41 @@ +{ + "name": "App", + "icons": [ + { + "src": "\/android-icon-36x36.png", + "sizes": "36x36", + "type": "image\/png", + "density": "0.75" + }, + { + "src": "\/android-icon-48x48.png", + "sizes": "48x48", + "type": "image\/png", + "density": "1.0" + }, + { + "src": "\/android-icon-72x72.png", + "sizes": "72x72", + "type": "image\/png", + "density": "1.5" + }, + { + "src": "\/android-icon-96x96.png", + "sizes": "96x96", + "type": "image\/png", + "density": "2.0" + }, + { + "src": "\/android-icon-144x144.png", + "sizes": "144x144", + "type": "image\/png", + "density": "3.0" + }, + { + "src": "\/android-icon-192x192.png", + "sizes": "192x192", + "type": "image\/png", + "density": "4.0" + } + ] +} \ No newline at end of file diff --git a/misc/media/icons/ms-icon-144x144.png b/misc/media/icons/ms-icon-144x144.png new file mode 100644 index 0000000..6375071 Binary files /dev/null and b/misc/media/icons/ms-icon-144x144.png differ diff --git a/misc/media/icons/ms-icon-150x150.png b/misc/media/icons/ms-icon-150x150.png new file mode 100644 index 0000000..d50f4fc Binary files /dev/null and b/misc/media/icons/ms-icon-150x150.png differ diff --git a/misc/media/icons/ms-icon-310x310.png b/misc/media/icons/ms-icon-310x310.png new file mode 100644 index 0000000..c940e37 Binary files /dev/null and b/misc/media/icons/ms-icon-310x310.png differ diff --git a/misc/media/icons/ms-icon-70x70.png b/misc/media/icons/ms-icon-70x70.png new file mode 100644 index 0000000..20712ee Binary files /dev/null and b/misc/media/icons/ms-icon-70x70.png differ diff --git a/misc/media/license.rtf b/misc/media/license.rtf new file mode 100644 index 0000000..b95e553 --- /dev/null +++ b/misc/media/license.rtf @@ -0,0 +1,210 @@ +{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31506\stshfloch31506\stshfhich31506\stshfbi31507\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhimajor\f31502\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0302020204030204}Calibri Light;} +{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;} +{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f41\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f42\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\f44\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f45\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f46\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f47\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\f48\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f49\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f41\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f42\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\f44\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f45\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f46\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f47\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\f48\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f49\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f411\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f412\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;} +{\f414\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f415\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f416\fbidi \fswiss\fcharset177\fprq2 Calibri (Hebrew);}{\f417\fbidi \fswiss\fcharset178\fprq2 Calibri (Arabic);} +{\f418\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f419\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\fhimajor\f31528\fbidi \fswiss\fcharset238\fprq2 Calibri Light CE;}{\fhimajor\f31529\fbidi \fswiss\fcharset204\fprq2 Calibri Light Cyr;}{\fhimajor\f31531\fbidi \fswiss\fcharset161\fprq2 Calibri Light Greek;} +{\fhimajor\f31532\fbidi \fswiss\fcharset162\fprq2 Calibri Light Tur;}{\fhimajor\f31533\fbidi \fswiss\fcharset177\fprq2 Calibri Light (Hebrew);}{\fhimajor\f31534\fbidi \fswiss\fcharset178\fprq2 Calibri Light (Arabic);} +{\fhimajor\f31535\fbidi \fswiss\fcharset186\fprq2 Calibri Light Baltic;}{\fhimajor\f31536\fbidi \fswiss\fcharset163\fprq2 Calibri Light (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} +{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;} +{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;} +{\fhiminor\f31573\fbidi \fswiss\fcharset177\fprq2 Calibri (Hebrew);}{\fhiminor\f31574\fbidi \fswiss\fcharset178\fprq2 Calibri (Arabic);}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;} +{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}} +{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0; +\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\*\defchp \f31506\fs22 }{\*\defpap \ql \li0\ri0\sa160\sl259\slmult1 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\sa160\sl259\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 +\ltrch\fcs0 \f31506\fs22\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\* +\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa160\sl259\slmult1 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext11 \ssemihidden \sunhideused Normal Table;}} +{\*\rsidtbl \rsid1381853\rsid6624395\rsid10097776\rsid11094156\rsid12995017}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\author Claudiu Farcas} +{\operator Claudiu Farcas}{\creatim\yr2017\mo1\dy27\hr1\min13}{\revtim\yr2017\mo1\dy27\hr1\min13}{\version2}{\edmins0}{\nofpages1}{\nofwords5}{\nofchars29}{\nofcharsws33}{\vern23}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml} +}\paperw11907\paperh16840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect +\widowctrl\ftnbj\aenddoc\trackmoves0\trackformatting1\donotembedsysfont1\relyonvml0\donotembedlingdata0\grfdocevents0\validatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors1\noxlattoyen +\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin\dghspace110\dgvspace180\dghorigin1440\dgvorigin1440\dghshow2\dgvshow2 +\jexpand\viewkind1\viewscale120\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct +\asianbrkrule\rsidroot11094156\newtblstyruls\nogrowautofit\usenormstyforlist\noindnmbrts\felnbrelev\nocxsptable\indrlsweleven\noafcnsttbl\afelev\utinl\hwelev\spltpgpar\notcvasp\notbrkcnstfrctbl\notvatxbx\krnprsnet\cachedcolbal \nouicompat \fet0 +{\*\wgrffmtfilter 2450}\nofeaturethrottle1\ilfomacatclnup0\ltrpar \sectd \ltrsect\psz9\linex0\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6624395\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2 +\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6 +\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang +{\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri0\sa160\sl259\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 +\f31506\fs22\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid11094156 NO LICENSE FILE}{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid1381853 +\par }{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid11094156 FREE FOR EVERYONE +\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a +9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad +5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6 +b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0 +0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6 +a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f +c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512 +0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462 +a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865 +6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b +4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b +4757e8d3f729e245eb2b260a0238fd010000ffff0300504b030414000600080000002100b6f4679893070000c9200000160000007468656d652f7468656d652f +7468656d65312e786d6cec59cd8b1bc915bf07f23f347d97f5d5ad8fc1f2a24fcfda33b6b164873dd648a5eef2547789aad28cc56208de532e81c026e49085bd +ed21842cecc22eb9e48f31d8249b3f22afaa5bdd5552c99e191c3061463074977eefd5afde7bf5de53d5ddcf5e26d4bbc05c1096f6fcfa9d9aefe174ce16248d +7afeb3d9a4d2f13d2151ba4094a5b8e76fb0f03fbbf7eb5fdd454732c609f6403e1547a8e7c752ae8eaa5531876124eeb0154ee1bb25e30992f0caa3ea82a34b +d09bd06aa3566b55134452df4b51026a1f2f97648ebd9952e9dfdb2a1f53784da5500373caa74a35b6243476715e5708b11143cabd0b447b3eccb3609733fc52 +fa1e4542c2173dbfa6fffceabdbb5574940b517940d6909be8bf5c2e17589c37f49c3c3a2b260d823068f50bfd1a40e53e6edc1eb7c6ad429f06a0f91c569a71 +b175b61bc320c71aa0ecd1a17bd41e35eb16ded0dfdce3dc0fd5c7c26b50a63fd8c34f2643b0a285d7a00c1feee1c3417730b2f56b50866fede1dbb5fe28685b +fa3528a6243ddf43d7c25673b85d6d0159327aec8477c360d26ee4ca4b144443115d6a8a254be5a1584bd00bc6270050408a24493db959e1259a43140f112567 +9c7827248a21f056286502866b8ddaa4d684ffea13e827ed5174849121ad780113b137a4f87862cec94af6fc07a0d537206f7ffef9cdeb1fdfbcfee9cd575fbd +79fdf77c6eadca923b466964cafdf2dd1ffef3cd6fbd7ffff0ed2f5fff319b7a172f4cfcbbbffdeedd3ffef93ef5b0e2d2146ffff4fdbb1fbf7ffbe7dfffebaf +5f3bb4f7393a33e1339260e13dc297de5396c0021dfcf119bf9ec42c46c494e8a791402952b338f48f656ca11f6d10450edc00db767cce21d5b880f7d72f2cc2 +d398af2571687c182716f094313a60dc6985876a2ec3ccb3751ab927e76b13f714a10bd7dc43945a5e1eaf579063894be530c616cd2714a5124538c5d253dfb1 +738c1dabfb8210cbaea764ce99604be97d41bc01224e93ccc899154da5d03149c02f1b1741f0b7659bd3e7de8051d7aa47f8c246c2de40d4417e86a965c6fb68 +2d51e252394309350d7e8264ec2239ddf0b9891b0b099e8e3065de78818570c93ce6b05ec3e90f21cdb8dd7e4a37898de4929cbb749e20c64ce4889d0f6394ac +5cd829496313fbb938871045de13265df05366ef10f50e7e40e941773f27d872f787b3c133c8b026a53240d4376beef0e57dccacf89d6ee8126157aae9f3c44a +b17d4e9cd131584756689f604cd1255a60ec3dfbdcc160c05696cd4bd20f62c82ac7d815580f901dabea3dc5027a25d5dcece7c91322ac909de2881de073bad9 +493c1b9426881fd2fc08bc6eda7c0ca52e7105c0633a3f37818f08f480102f4ea33c16a0c308ee835a9fc4c82a60ea5db8e375c32dff5d658fc1be7c61d1b8c2 +be04197c6d1948eca6cc7b6d3343d49aa00c9819822ec3956e41c4727f29a28aab165b3be596f6a62ddd00dd91d5f42424fd6007b4d3fb84ffbbde073a8cb77f +f9c6b10f3e4ebfe3566c25ab6b763a8792c9f14e7f7308b7dbd50c195f904fbfa919a175fa04431dd9cf58b73dcd6d4fe3ffdff73487f6f36d2773a8dfb8ed64 +7ce8306e3b99fc70e5e3743265f3027d8d3af0c80e7af4b14f72f0d46749289dca0dc527421ffc08f83db398c0a092d3279eb838055cc5f0a8ca1c4c60e1228e +b48cc799fc0d91f134462b381daafb4a492472d591f0564cc0a1911e76ea5678ba4e4ed9223becacd7d5c16656590592e5782d2cc6e1a04a66e856bb3cc02bd4 +6bb6913e68dd1250b2d721614c6693683a48b4b783ca48fa58178ce620a157f65158741d2c3a4afdd6557b2c805ae115f8c1edc1cff49e1f06200242701e07cd +f942f92973f5d6bbda991fd3d3878c69450034d8db08283ddd555c0f2e4fad2e0bb52b78da2261849b4d425b46377822869fc17974aad1abd0b8aeafbba54b2d +7aca147a3e08ad9246bbf33e1637f535c8ede6069a9a9982a6de65cf6f35430899395af5fc251c1ac363b282d811ea3717a211dcbccc25cf36fc4d32cb8a0b39 +4222ce0cae934e960d122231f728497abe5a7ee1069aea1ca2b9d51b90103e59725d482b9f1a3970baed64bc5ce2b934dd6e8c284b67af90e1b35ce1fc568bdf +1cac24d91adc3d8d1797de195df3a708422c6cd795011744c0dd413db3e682c0655891c8caf8db294c79da356fa3740c65e388ae62945714339967709dca0b3a +faadb081f196af190c6a98242f8467912ab0a651ad6a5a548d8cc3c1aafb6121653923699635d3ca2aaa6abab39835c3b60cecd8f26645de60b53531e434b3c2 +67a97b37e576b7b96ea74f28aa0418bcb09fa3ea5ea12018d4cac92c6a8af17e1a56393b1fb56bc776811fa07695226164fdd656ed8edd8a1ae19c0e066f54f9 +416e376a6168b9ed2bb5a5f5adb979b1cdce5e40f2184197bba6526857c2c92e47d0104d754f92a50dd8222f65be35e0c95b73d2f3bfac85fd60d80887955a27 +1c57826650ab74c27eb3d20fc3667d1cd66ba341e31514161927f530bbb19fc00506dde4f7f67a7cefee3ed9ded1dc99b3a4caf4dd7c5513d777f7f5c6e1bb7b +8f40d2f9b2d598749bdd41abd26df627956034e854bac3d6a0326a0ddba3c9681876ba9357be77a1c141bf390c5ae34ea5551f0e2b41aba6e877ba9576d068f4 +8376bf330efaaff23606569ea58fdc16605ecdebde7f010000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d65 +2f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d36 +3f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e +3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d985 +0528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000000000 +0000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000000000 +000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019020000 +7468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d0014000600080000002100b6f4679893070000c92000001600000000000000 +000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027000000 +000000000000000000009d0a00007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000980b00000000} +{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d +617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169 +6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363 +656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e} +{\*\latentstyles\lsdstimax374\lsdlockeddef0\lsdsemihiddendef0\lsdunhideuseddef0\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 1; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 5; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 6;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 7;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 8;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 9; +\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 1;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 2;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 3; +\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 4;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 5;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 6; +\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 7;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 8;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 9;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal Indent; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footnote text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 header;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footer; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index heading;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 table of figures; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 envelope address;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 envelope return;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footnote reference;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation reference; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 line number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 page number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 endnote reference;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 endnote text; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 table of authorities;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 macro;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 toa heading;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 5;\lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Closing; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Signature;\lsdsemihidden1 \lsdunhideused1 \lsdpriority1 \lsdlocked0 Default Paragraph Font;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 4; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Message Header;\lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Salutation; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Date;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text First Indent;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text First Indent 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Note Heading; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Block Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Hyperlink;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 FollowedHyperlink;\lsdqformat1 \lsdpriority22 \lsdlocked0 Strong; +\lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Document Map;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Plain Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 E-mail Signature; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Top of Form;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Bottom of Form;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal (Web);\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Acronym; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Address;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Cite;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Code;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Definition; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Keyboard;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Preformatted;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Sample;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Typewriter; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Variable;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal Table;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation subject;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 No List; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Simple 1; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Simple 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Simple 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Classic 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Classic 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Classic 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Classic 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Colorful 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Colorful 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Colorful 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 6; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 7;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 8;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 6; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 7;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 8;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table 3D effects 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table 3D effects 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table 3D effects 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Contemporary;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Elegant;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Professional; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Subtle 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Subtle 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Web 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Web 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Web 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Balloon Text;\lsdpriority39 \lsdlocked0 Table Grid;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Theme;\lsdsemihidden1 \lsdlocked0 Placeholder Text; +\lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;\lsdpriority60 \lsdlocked0 Light Shading;\lsdpriority61 \lsdlocked0 Light List;\lsdpriority62 \lsdlocked0 Light Grid;\lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdpriority64 \lsdlocked0 Medium Shading 2; +\lsdpriority65 \lsdlocked0 Medium List 1;\lsdpriority66 \lsdlocked0 Medium List 2;\lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdpriority68 \lsdlocked0 Medium Grid 2;\lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdpriority70 \lsdlocked0 Dark List; +\lsdpriority71 \lsdlocked0 Colorful Shading;\lsdpriority72 \lsdlocked0 Colorful List;\lsdpriority73 \lsdlocked0 Colorful Grid;\lsdpriority60 \lsdlocked0 Light Shading Accent 1;\lsdpriority61 \lsdlocked0 Light List Accent 1; +\lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdsemihidden1 \lsdlocked0 Revision; +\lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1; +\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;\lsdpriority72 \lsdlocked0 Colorful List Accent 1; +\lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdpriority60 \lsdlocked0 Light Shading Accent 2;\lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2; +\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2; +\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;\lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdpriority72 \lsdlocked0 Colorful List Accent 2;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 2; +\lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdpriority61 \lsdlocked0 Light List Accent 3;\lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3; +\lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3; +\lsdpriority70 \lsdlocked0 Dark List Accent 3;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;\lsdpriority60 \lsdlocked0 Light Shading Accent 4; +\lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdpriority62 \lsdlocked0 Light Grid Accent 4;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 4; +\lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdpriority70 \lsdlocked0 Dark List Accent 4; +\lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;\lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdpriority60 \lsdlocked0 Light Shading Accent 5;\lsdpriority61 \lsdlocked0 Light List Accent 5; +\lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 5; +\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;\lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 5; +\lsdpriority72 \lsdlocked0 Colorful List Accent 5;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdpriority61 \lsdlocked0 Light List Accent 6;\lsdpriority62 \lsdlocked0 Light Grid Accent 6; +\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 6; +\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdpriority70 \lsdlocked0 Dark List Accent 6;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 6; +\lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;\lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis; +\lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;\lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdsemihidden1 \lsdunhideused1 \lsdpriority37 \lsdlocked0 Bibliography; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;\lsdpriority41 \lsdlocked0 Plain Table 1;\lsdpriority42 \lsdlocked0 Plain Table 2;\lsdpriority43 \lsdlocked0 Plain Table 3;\lsdpriority44 \lsdlocked0 Plain Table 4; +\lsdpriority45 \lsdlocked0 Plain Table 5;\lsdpriority40 \lsdlocked0 Grid Table Light;\lsdpriority46 \lsdlocked0 Grid Table 1 Light;\lsdpriority47 \lsdlocked0 Grid Table 2;\lsdpriority48 \lsdlocked0 Grid Table 3;\lsdpriority49 \lsdlocked0 Grid Table 4; +\lsdpriority50 \lsdlocked0 Grid Table 5 Dark;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 1;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 1; +\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 1;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 1;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 1;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 1; +\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 1;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 2;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 2;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 2; +\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 2;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 2;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 2;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 2; +\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 3;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 3;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 3;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 3; +\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 3;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 3;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 3;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 4; +\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 4;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 4;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 4;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 4; +\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 4;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 4;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 5;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 5; +\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 5;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 5;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 5; +\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 5;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 6;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 6; +\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 6;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 6; +\lsdpriority46 \lsdlocked0 List Table 1 Light;\lsdpriority47 \lsdlocked0 List Table 2;\lsdpriority48 \lsdlocked0 List Table 3;\lsdpriority49 \lsdlocked0 List Table 4;\lsdpriority50 \lsdlocked0 List Table 5 Dark; +\lsdpriority51 \lsdlocked0 List Table 6 Colorful;\lsdpriority52 \lsdlocked0 List Table 7 Colorful;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 1;\lsdpriority47 \lsdlocked0 List Table 2 Accent 1;\lsdpriority48 \lsdlocked0 List Table 3 Accent 1; +\lsdpriority49 \lsdlocked0 List Table 4 Accent 1;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 1;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 1;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 1; +\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 2;\lsdpriority47 \lsdlocked0 List Table 2 Accent 2;\lsdpriority48 \lsdlocked0 List Table 3 Accent 2;\lsdpriority49 \lsdlocked0 List Table 4 Accent 2; +\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 2;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 2;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 2;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 3; +\lsdpriority47 \lsdlocked0 List Table 2 Accent 3;\lsdpriority48 \lsdlocked0 List Table 3 Accent 3;\lsdpriority49 \lsdlocked0 List Table 4 Accent 3;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 3; +\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 3;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 3;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 4;\lsdpriority47 \lsdlocked0 List Table 2 Accent 4; +\lsdpriority48 \lsdlocked0 List Table 3 Accent 4;\lsdpriority49 \lsdlocked0 List Table 4 Accent 4;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 4;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 4; +\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 4;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 5;\lsdpriority47 \lsdlocked0 List Table 2 Accent 5;\lsdpriority48 \lsdlocked0 List Table 3 Accent 5; +\lsdpriority49 \lsdlocked0 List Table 4 Accent 5;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 5;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 5; +\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 List Table 2 Accent 6;\lsdpriority48 \lsdlocked0 List Table 3 Accent 6;\lsdpriority49 \lsdlocked0 List Table 4 Accent 6; +\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 6;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Mention; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Smart Hyperlink;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Hashtag;}}{\*\datastore 0105000002000000180000004d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000 +d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000e001 +8bcc2978d201feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file diff --git a/misc/webApi/swagger.json b/misc/webApi/swagger.json new file mode 100644 index 0000000..1cb7c99 --- /dev/null +++ b/misc/webApi/swagger.json @@ -0,0 +1 @@ +{"swagger":"2.0","info":{"version":"v1","title":"LanBackups API","description":"ASP.NET Core Web API for LAN Backup service","termsOfService":"None","contact":{"name":"Claudiu Farcas","url":"http://www.asp.net","email":""},"license":{"name":"Free as a bird","url":"http://url.com"}},"basePath":"/","paths":{"/api/BackupConfig":{"get":{"tags":["BackupConfig"],"summary":"retrieve all backup configurations","operationId":"ApiBackupConfigGet","consumes":[],"produces":["application/json"],"parameters":[{"name":"idx","in":"header","required":false,"type":"string"},{"name":"siz","in":"header","required":false,"type":"string"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/PaginatedList[BackupConfiguration,String]"}}},"deprecated":false},"post":{"tags":["BackupConfig"],"summary":"create backup configuration","operationId":"ApiBackupConfigPost","consumes":["application/json","text/json","application/json-patch+json"],"produces":["application/json"],"parameters":[{"name":"backup","in":"body","description":"","required":false,"schema":{"$ref":"#/definitions/BackupConfiguration"}}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/BackupConfiguration"}},"400":{"description":"Client Error","schema":{"$ref":"#/definitions/BackupConfiguration"}}},"deprecated":false}},"/api/BackupConfig/{id}":{"get":{"tags":["BackupConfig"],"summary":"retrieve backup configuration by ID","operationId":"ApiBackupConfigByIdGet","consumes":[],"produces":["application/json"],"parameters":[{"name":"id","in":"path","description":"","required":true,"type":"string"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/BackupConfiguration"}},"404":{"description":"Client Error","schema":{"$ref":"#/definitions/BackupConfiguration"}}},"deprecated":false},"put":{"tags":["BackupConfig"],"summary":"Update backup configuration","operationId":"ApiBackupConfigByIdPut","consumes":["application/json","text/json","application/json-patch+json"],"produces":["application/json"],"parameters":[{"name":"id","in":"path","description":"","required":true,"type":"string"},{"name":"backup","in":"body","description":"","required":false,"schema":{"$ref":"#/definitions/BackupConfiguration"}}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/BackupConfiguration"}},"400":{"description":"Client Error","schema":{"$ref":"#/definitions/BackupConfiguration"}}},"deprecated":false},"delete":{"tags":["BackupConfig"],"summary":"delete backup configuration by id","operationId":"ApiBackupConfigByIdDelete","consumes":[],"produces":["application/json"],"parameters":[{"name":"id","in":"path","description":"","required":true,"type":"string"}],"responses":{"200":{"description":"Success","schema":{"type":"string"}},"404":{"description":"Client Error","schema":{"type":"string"}}},"deprecated":false}},"/api/BackupConfig/client/{clientid}":{"get":{"tags":["BackupConfig"],"summary":"retrieve backup configuration by ID","operationId":"ApiBackupConfigClientByClientidGet","consumes":[],"produces":["application/json"],"parameters":[{"name":"clientid","in":"path","description":"","required":true,"type":"string"}],"responses":{"200":{"description":"Success","schema":{"type":"array","items":{"$ref":"#/definitions/BackupConfiguration"}}},"404":{"description":"Client Error","schema":{"type":"array","items":{"$ref":"#/definitions/BackupConfiguration"}}}},"deprecated":false}},"/api/Logs":{"get":{"tags":["Logs"],"summary":"retrieves paginated logs from DB","operationId":"ApiLogsGet","consumes":[],"produces":["application/json"],"parameters":[{"name":"idx","in":"header","description":"page index","required":false,"type":"string"},{"name":"siz","in":"header","description":"page size","required":false,"type":"string"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/PaginatedList[BackupLog,DateTime]"}}},"deprecated":false},"post":{"tags":["Logs"],"summary":"Create an entry in the logs","operationId":"ApiLogsPost","consumes":["application/json","text/json","application/json-patch+json"],"produces":["application/json"],"parameters":[{"name":"log","in":"body","description":"","required":false,"schema":{"$ref":"#/definitions/BackupLog"}}],"responses":{"200":{"description":"Success","schema":{"format":"int32","type":"integer"}},"400":{"description":"Client Error","schema":{"format":"int32","type":"integer"}}},"deprecated":false}},"/api/Logs/{id}":{"get":{"tags":["Logs"],"summary":"retrieves alog record by ID","operationId":"ApiLogsByIdGet","consumes":[],"produces":["application/json"],"parameters":[{"name":"id","in":"path","description":"","required":true,"type":"integer","format":"int32"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/BackupLog"}},"404":{"description":"Client Error","schema":{"$ref":"#/definitions/BackupLog"}}},"deprecated":false}},"/api/Logs/client/{clientid}":{"get":{"tags":["Logs"],"summary":"retrieve all logs of a clientIP","operationId":"ApiLogsClientByClientidGet","consumes":[],"produces":["application/json"],"parameters":[{"name":"clientid","in":"path","description":"","required":true,"type":"string"}],"responses":{"200":{"description":"Success","schema":{"type":"array","items":{"$ref":"#/definitions/BackupLog"}}},"404":{"description":"Client Error","schema":{"type":"array","items":{"$ref":"#/definitions/BackupLog"}}}},"deprecated":false}},"/api/Logs/config/{configurationid}":{"get":{"tags":["Logs"],"summary":"retrieves all logs of a specific configuration","operationId":"ApiLogsConfigByConfigurationidGet","consumes":[],"produces":["application/json"],"parameters":[{"name":"configurationid","in":"path","description":"","required":true,"type":"string"}],"responses":{"200":{"description":"Success","schema":{"type":"array","items":{"$ref":"#/definitions/BackupLog"}}},"404":{"description":"Client Error","schema":{"type":"array","items":{"$ref":"#/definitions/BackupLog"}}}},"deprecated":false}},"/api/Users/register":{"post":{"tags":["Users"],"operationId":"ApiUsersRegisterPost","consumes":["application/json","text/json","application/json-patch+json"],"produces":["application/json"],"parameters":[{"name":"dtouser","in":"body","required":false,"schema":{"$ref":"#/definitions/User"}}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/IdentityResult"}},"400":{"description":"Client Error","schema":{"$ref":"#/definitions/IdentityResult"}}},"deprecated":false}},"/api/Users/login":{"post":{"tags":["Users"],"operationId":"ApiUsersLoginPost","consumes":["application/json","text/json","application/json-patch+json"],"produces":[],"parameters":[{"name":"dtouser","in":"body","required":false,"schema":{"$ref":"#/definitions/User"}}],"responses":{"200":{"description":"Success"}},"deprecated":false}},"/api/Users/pwchange":{"post":{"tags":["Users"],"operationId":"ApiUsersPwchangePost","consumes":["application/json","text/json","application/json-patch+json"],"produces":[],"parameters":[{"name":"dtouser","in":"body","required":false,"schema":{"$ref":"#/definitions/User"}}],"responses":{"200":{"description":"Success"}},"deprecated":false}},"/api/Users/list":{"get":{"tags":["Users"],"operationId":"ApiUsersListGet","consumes":[],"produces":[],"responses":{"200":{"description":"Success"}},"deprecated":false},"post":{"tags":["Users"],"operationId":"ApiUsersListPost","consumes":["application/json","text/json","application/json-patch+json"],"produces":[],"parameters":[{"name":"user","in":"body","required":false,"schema":{"$ref":"#/definitions/User"}}],"responses":{"200":{"description":"Success"}},"deprecated":false}}},"definitions":{"PaginatedList[BackupConfiguration,String]":{"type":"object","properties":{"pi":{"format":"int32","type":"integer"},"tp":{"format":"int32","type":"integer"},"recs":{"type":"array","items":{"$ref":"#/definitions/BackupConfiguration"}},"hp":{"type":"boolean","readOnly":true},"hn":{"type":"boolean","readOnly":true}}},"BackupConfiguration":{"required":["clientIP"],"type":"object","properties":{"id":{"type":"string"},"rowVersion":{"format":"byte","type":"string"},"clientIP":{"pattern":"^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","type":"string"},"srcFolder":{"type":"string"},"srcUser":{"type":"string"},"srcPass":{"type":"string"},"destLanFolder":{"type":"string"},"destUser":{"type":"string"},"destPass":{"type":"string"},"isActive":{"type":"boolean"},"crontab":{"type":"string"}}},"PaginatedList[BackupLog,DateTime]":{"type":"object","properties":{"pi":{"format":"int32","type":"integer"},"tp":{"format":"int32","type":"integer"},"recs":{"type":"array","items":{"$ref":"#/definitions/BackupLog"}},"hp":{"type":"boolean","readOnly":true},"hn":{"type":"boolean","readOnly":true}}},"BackupLog":{"type":"object","properties":{"id":{"format":"int32","type":"integer"},"rowVersion":{"format":"byte","type":"string"},"clientIP":{"pattern":"^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","type":"string"},"configurationID":{"type":"string"},"description":{"type":"string"},"logError":{"type":"string"},"status":{"type":"string"},"dateTime":{"format":"date-time","type":"string"}}},"User":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"},"newPassword":{"type":"string"},"isAdmin":{"type":"boolean"},"succeeded":{"type":"boolean"},"isLockedOut":{"type":"boolean"}}},"IdentityResult":{"type":"object","properties":{"succeeded":{"type":"boolean","readOnly":true},"errors":{"type":"array","items":{"$ref":"#/definitions/IdentityError"},"readOnly":true}}},"IdentityError":{"type":"object","properties":{"code":{"type":"string"},"description":{"type":"string"}}}},"securityDefinitions":{}} \ No newline at end of file diff --git a/src/LanBackup.DataCore/BackupsContext.cs b/src/LanBackup.DataCore/BackupsContext.cs new file mode 100644 index 0000000..b35a32b --- /dev/null +++ b/src/LanBackup.DataCore/BackupsContext.cs @@ -0,0 +1,30 @@ +using LanBackup.ModelsCore; +using Microsoft.EntityFrameworkCore; + +namespace LanBackup.DataCore +{ + public class BackupsContext : DbContext + { + public BackupsContext(DbContextOptions options) : base(options) + { } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + //BackupConfiguration - entity + modelBuilder.Entity().ToTable("Backups"); + modelBuilder.Entity().Property(p => p.RowVersion) + .IsRowVersion() + .IsConcurrencyToken(); + modelBuilder.Entity().HasIndex(p => p.ClientIP); + + //BackupLog - entity + modelBuilder.Entity().Property(p => p.ID).ValueGeneratedOnAdd(); //equivalent of [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + modelBuilder.Entity().HasIndex(p => p.ClientIP); + modelBuilder.Entity().HasIndex(p => p.ConfigurationID); + + } + + public DbSet Backups { get; set; } + public DbSet Logs { get; set; } + } +} diff --git a/src/LanBackup.DataCore/DatabaseManager.cs b/src/LanBackup.DataCore/DatabaseManager.cs new file mode 100644 index 0000000..a1ee6ad --- /dev/null +++ b/src/LanBackup.DataCore/DatabaseManager.cs @@ -0,0 +1,84 @@ +using System.Collections.Generic; +using System.Linq; +using LanBackup.ModelsCore; + +namespace LanBackup.DataCore +{ + /// + /// Database manager class (repository) + /// + public class DatabaseManager + { + + private BackupsContext context; + + /// + /// constructor + /// + /// + public DatabaseManager(BackupsContext mcontext) + { + context = mcontext; + } + + /// + /// create a backup + /// + /// + /// the new backup ID + public string CreateBackupConfig(BackupConfiguration backup) + { + context.Backups.Add(backup); + context.SaveChanges(); + return backup.ID; + } + + /// + /// retrieve all backups + /// + /// + public IEnumerable GetBackupConfigs() + { + var list = context.Backups.ToList(); + return list; + } + + /// + /// gets the backup by ID + /// + /// backup ID + /// backup + public BackupConfiguration GetBackupConfig(string id) + { + return context.Backups.FirstOrDefault(b => b.ID == id); + } + + public IEnumerable GetBackupConfigByClient(string clientid) + { + return context.Backups.Where(b => b.ClientIP == clientid); + } + + /// + /// Update backup configuration + /// + /// + /// + public int UpdateBackupConfig(BackupConfiguration entity) + { + context.Backups.Update(entity); + return context.SaveChanges(); + } + + /// + /// delete backup configuration + /// + /// + /// + public int DeleteBackupConfig(string id) + { + BackupConfiguration entity = context.Backups.Find(id); + context.Backups.Remove(entity); + return context.SaveChanges(); + } + } +} diff --git a/src/LanBackup.DataCore/LanBackup.DataCore.xproj b/src/LanBackup.DataCore/LanBackup.DataCore.xproj new file mode 100644 index 0000000..76c6a09 --- /dev/null +++ b/src/LanBackup.DataCore/LanBackup.DataCore.xproj @@ -0,0 +1,19 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + b4144721-0f2c-4750-aba3-5238490a71ff + LanBackup.DataCore + .\obj + .\bin\ + v4.6.2 + + + 2.0 + + + \ No newline at end of file diff --git a/src/LanBackup.DataCore/Migrations/20170106103933_InitMigration.Designer.cs b/src/LanBackup.DataCore/Migrations/20170106103933_InitMigration.Designer.cs new file mode 100644 index 0000000..9050b4e --- /dev/null +++ b/src/LanBackup.DataCore/Migrations/20170106103933_InitMigration.Designer.cs @@ -0,0 +1,50 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using LanBackup.DataCore; + +namespace LanBackup.DataCore.Migrations +{ + [DbContext(typeof(BackupsContext))] + [Migration("20170106103933_InitMigration")] + partial class InitMigration + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { + modelBuilder + .HasAnnotation("ProductVersion", "1.1.0-rtm-22752") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("LanBackup.ModelsCore.BackupConfiguration", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("ClientIP") + .IsRequired(); + + b.Property("DestLanFolder"); + + b.Property("DestPass"); + + b.Property("DestUser"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("SrcFolder"); + + b.Property("SrcPass"); + + b.Property("SrcUser"); + + b.HasKey("ID"); + + b.ToTable("Backups"); + }); + } + } +} diff --git a/src/LanBackup.DataCore/Migrations/20170106103933_InitMigration.cs b/src/LanBackup.DataCore/Migrations/20170106103933_InitMigration.cs new file mode 100644 index 0000000..db480b3 --- /dev/null +++ b/src/LanBackup.DataCore/Migrations/20170106103933_InitMigration.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace LanBackup.DataCore.Migrations +{ + public partial class InitMigration : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Backups", + columns: table => new + { + ID = table.Column(nullable: false), + ClientIP = table.Column(nullable: false), + DestLanFolder = table.Column(nullable: true), + DestPass = table.Column(nullable: true), + DestUser = table.Column(nullable: true), + RowVersion = table.Column(rowVersion: true, nullable: true), + SrcFolder = table.Column(nullable: true), + SrcPass = table.Column(nullable: true), + SrcUser = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Backups", x => x.ID); + }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Backups"); + } + } +} diff --git a/src/LanBackup.DataCore/Migrations/20170109195131_ExtraFields.Designer.cs b/src/LanBackup.DataCore/Migrations/20170109195131_ExtraFields.Designer.cs new file mode 100644 index 0000000..f46c2b5 --- /dev/null +++ b/src/LanBackup.DataCore/Migrations/20170109195131_ExtraFields.Designer.cs @@ -0,0 +1,54 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using LanBackup.DataCore; + +namespace LanBackup.DataCore.Migrations +{ + [DbContext(typeof(BackupsContext))] + [Migration("20170109195131_ExtraFields")] + partial class ExtraFields + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { + modelBuilder + .HasAnnotation("ProductVersion", "1.1.0-rtm-22752") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("LanBackup.ModelsCore.BackupConfiguration", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("ClientIP") + .IsRequired(); + + b.Property("Crontab"); + + b.Property("DestLanFolder"); + + b.Property("DestPass"); + + b.Property("DestUser"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("SrcFolder"); + + b.Property("SrcPass"); + + b.Property("SrcUser"); + + b.HasKey("ID"); + + b.HasIndex("ClientIP"); + + b.ToTable("Backups"); + }); + } + } +} diff --git a/src/LanBackup.DataCore/Migrations/20170109195131_ExtraFields.cs b/src/LanBackup.DataCore/Migrations/20170109195131_ExtraFields.cs new file mode 100644 index 0000000..9cb00ba --- /dev/null +++ b/src/LanBackup.DataCore/Migrations/20170109195131_ExtraFields.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace LanBackup.DataCore.Migrations +{ + public partial class ExtraFields : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "ClientIP", + table: "Backups", + nullable: false); + + migrationBuilder.AddColumn( + name: "Crontab", + table: "Backups", + nullable: true); + + migrationBuilder.CreateIndex( + name: "IX_Backups_ClientIP", + table: "Backups", + column: "ClientIP"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_Backups_ClientIP", + table: "Backups"); + + migrationBuilder.DropColumn( + name: "Crontab", + table: "Backups"); + + migrationBuilder.AlterColumn( + name: "ClientIP", + table: "Backups", + nullable: false); + } + } +} diff --git a/src/LanBackup.DataCore/Migrations/20170110003346_LogsTable.Designer.cs b/src/LanBackup.DataCore/Migrations/20170110003346_LogsTable.Designer.cs new file mode 100644 index 0000000..54bd69d --- /dev/null +++ b/src/LanBackup.DataCore/Migrations/20170110003346_LogsTable.Designer.cs @@ -0,0 +1,83 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using LanBackup.DataCore; + +namespace LanBackup.DataCore.Migrations +{ + [DbContext(typeof(BackupsContext))] + [Migration("20170110003346_LogsTable")] + partial class LogsTable + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { + modelBuilder + .HasAnnotation("ProductVersion", "1.1.0-rtm-22752") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("LanBackup.ModelsCore.BackupConfiguration", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("ClientIP") + .IsRequired(); + + b.Property("Crontab"); + + b.Property("DestLanFolder"); + + b.Property("DestPass"); + + b.Property("DestUser"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("SrcFolder"); + + b.Property("SrcPass"); + + b.Property("SrcUser"); + + b.HasKey("ID"); + + b.HasIndex("ClientIP"); + + b.ToTable("Backups"); + }); + + modelBuilder.Entity("LanBackup.ModelsCore.BackupLog", b => + { + b.Property("ID") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClientIP"); + + b.Property("ConfigurationID"); + + b.Property("Description"); + + b.Property("Error"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("Status"); + + b.HasKey("ID"); + + b.HasIndex("ClientIP"); + + b.HasIndex("ConfigurationID"); + + b.ToTable("BackupLog"); + }); + } + } +} diff --git a/src/LanBackup.DataCore/Migrations/20170110003346_LogsTable.cs b/src/LanBackup.DataCore/Migrations/20170110003346_LogsTable.cs new file mode 100644 index 0000000..b519f52 --- /dev/null +++ b/src/LanBackup.DataCore/Migrations/20170110003346_LogsTable.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Metadata; + +namespace LanBackup.DataCore.Migrations +{ + public partial class LogsTable : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "BackupLog", + columns: table => new + { + ID = table.Column(nullable: false) + .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), + ClientIP = table.Column(nullable: true), + ConfigurationID = table.Column(nullable: true), + Description = table.Column(nullable: true), + Error = table.Column(nullable: true), + RowVersion = table.Column(rowVersion: true, nullable: true), + Status = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_BackupLog", x => x.ID); + }); + + migrationBuilder.CreateIndex( + name: "IX_BackupLog_ClientIP", + table: "BackupLog", + column: "ClientIP"); + + migrationBuilder.CreateIndex( + name: "IX_BackupLog_ConfigurationID", + table: "BackupLog", + column: "ConfigurationID"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "BackupLog"); + } + } +} diff --git a/src/LanBackup.DataCore/Migrations/20170110025655_MissedThings.Designer.cs b/src/LanBackup.DataCore/Migrations/20170110025655_MissedThings.Designer.cs new file mode 100644 index 0000000..e505991 --- /dev/null +++ b/src/LanBackup.DataCore/Migrations/20170110025655_MissedThings.Designer.cs @@ -0,0 +1,83 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using LanBackup.DataCore; + +namespace LanBackup.DataCore.Migrations +{ + [DbContext(typeof(BackupsContext))] + [Migration("20170110025655_MissedThings")] + partial class MissedThings + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { + modelBuilder + .HasAnnotation("ProductVersion", "1.1.0-rtm-22752") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("LanBackup.ModelsCore.BackupConfiguration", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("ClientIP") + .IsRequired(); + + b.Property("Crontab"); + + b.Property("DestLanFolder"); + + b.Property("DestPass"); + + b.Property("DestUser"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("SrcFolder"); + + b.Property("SrcPass"); + + b.Property("SrcUser"); + + b.HasKey("ID"); + + b.HasIndex("ClientIP"); + + b.ToTable("Backups"); + }); + + modelBuilder.Entity("LanBackup.ModelsCore.BackupLog", b => + { + b.Property("ID") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClientIP"); + + b.Property("ConfigurationID"); + + b.Property("Description"); + + b.Property("Error"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("Status"); + + b.HasKey("ID"); + + b.HasIndex("ClientIP"); + + b.HasIndex("ConfigurationID"); + + b.ToTable("Logs"); + }); + } + } +} diff --git a/src/LanBackup.DataCore/Migrations/20170110025655_MissedThings.cs b/src/LanBackup.DataCore/Migrations/20170110025655_MissedThings.cs new file mode 100644 index 0000000..a02ed3e --- /dev/null +++ b/src/LanBackup.DataCore/Migrations/20170110025655_MissedThings.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace LanBackup.DataCore.Migrations +{ + public partial class MissedThings : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropPrimaryKey( + name: "PK_BackupLog", + table: "BackupLog"); + + migrationBuilder.RenameTable( + name: "BackupLog", + newName: "Logs"); + + migrationBuilder.RenameIndex( + name: "IX_BackupLog_ConfigurationID", + table: "Logs", + newName: "IX_Logs_ConfigurationID"); + + migrationBuilder.RenameIndex( + name: "IX_BackupLog_ClientIP", + table: "Logs", + newName: "IX_Logs_ClientIP"); + + migrationBuilder.AddPrimaryKey( + name: "PK_Logs", + table: "Logs", + column: "ID"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropPrimaryKey( + name: "PK_Logs", + table: "Logs"); + + migrationBuilder.RenameTable( + name: "Logs", + newName: "BackupLog"); + + migrationBuilder.RenameIndex( + name: "IX_Logs_ConfigurationID", + table: "BackupLog", + newName: "IX_BackupLog_ConfigurationID"); + + migrationBuilder.RenameIndex( + name: "IX_Logs_ClientIP", + table: "BackupLog", + newName: "IX_BackupLog_ClientIP"); + + migrationBuilder.AddPrimaryKey( + name: "PK_BackupLog", + table: "BackupLog", + column: "ID"); + } + } +} diff --git a/src/LanBackup.DataCore/Migrations/20170114002049_ExtraFieldsAndValidation.Designer.cs b/src/LanBackup.DataCore/Migrations/20170114002049_ExtraFieldsAndValidation.Designer.cs new file mode 100644 index 0000000..776a7c1 --- /dev/null +++ b/src/LanBackup.DataCore/Migrations/20170114002049_ExtraFieldsAndValidation.Designer.cs @@ -0,0 +1,85 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using LanBackup.DataCore; + +namespace LanBackup.DataCore.Migrations +{ + [DbContext(typeof(BackupsContext))] + [Migration("20170114002049_ExtraFieldsAndValidation")] + partial class ExtraFieldsAndValidation + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { + modelBuilder + .HasAnnotation("ProductVersion", "1.1.0-rtm-22752") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("LanBackup.ModelsCore.BackupConfiguration", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("ClientIP") + .IsRequired(); + + b.Property("Crontab"); + + b.Property("DestLanFolder"); + + b.Property("DestPass"); + + b.Property("DestUser"); + + b.Property("IsActive"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("SrcFolder"); + + b.Property("SrcPass"); + + b.Property("SrcUser"); + + b.HasKey("ID"); + + b.HasIndex("ClientIP"); + + b.ToTable("Backups"); + }); + + modelBuilder.Entity("LanBackup.ModelsCore.BackupLog", b => + { + b.Property("ID") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClientIP"); + + b.Property("ConfigurationID"); + + b.Property("Description"); + + b.Property("Error"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("Status"); + + b.HasKey("ID"); + + b.HasIndex("ClientIP"); + + b.HasIndex("ConfigurationID"); + + b.ToTable("Logs"); + }); + } + } +} diff --git a/src/LanBackup.DataCore/Migrations/20170114002049_ExtraFieldsAndValidation.cs b/src/LanBackup.DataCore/Migrations/20170114002049_ExtraFieldsAndValidation.cs new file mode 100644 index 0000000..635fc1b --- /dev/null +++ b/src/LanBackup.DataCore/Migrations/20170114002049_ExtraFieldsAndValidation.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace LanBackup.DataCore.Migrations +{ + public partial class ExtraFieldsAndValidation : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "IsActive", + table: "Backups", + nullable: false, + defaultValue: false); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "IsActive", + table: "Backups"); + } + } +} diff --git a/src/LanBackup.DataCore/Migrations/20170114093121_AddDateTimeToLog.Designer.cs b/src/LanBackup.DataCore/Migrations/20170114093121_AddDateTimeToLog.Designer.cs new file mode 100644 index 0000000..d42a516 --- /dev/null +++ b/src/LanBackup.DataCore/Migrations/20170114093121_AddDateTimeToLog.Designer.cs @@ -0,0 +1,87 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using LanBackup.DataCore; + +namespace LanBackup.DataCore.Migrations +{ + [DbContext(typeof(BackupsContext))] + [Migration("20170114093121_AddDateTimeToLog")] + partial class AddDateTimeToLog + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { + modelBuilder + .HasAnnotation("ProductVersion", "1.1.0-rtm-22752") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("LanBackup.ModelsCore.BackupConfiguration", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("ClientIP") + .IsRequired(); + + b.Property("Crontab"); + + b.Property("DestLanFolder"); + + b.Property("DestPass"); + + b.Property("DestUser"); + + b.Property("IsActive"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("SrcFolder"); + + b.Property("SrcPass"); + + b.Property("SrcUser"); + + b.HasKey("ID"); + + b.HasIndex("ClientIP"); + + b.ToTable("Backups"); + }); + + modelBuilder.Entity("LanBackup.ModelsCore.BackupLog", b => + { + b.Property("ID") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClientIP"); + + b.Property("ConfigurationID"); + + b.Property("DateTime"); + + b.Property("Description"); + + b.Property("Error"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("Status"); + + b.HasKey("ID"); + + b.HasIndex("ClientIP"); + + b.HasIndex("ConfigurationID"); + + b.ToTable("Logs"); + }); + } + } +} diff --git a/src/LanBackup.DataCore/Migrations/20170114093121_AddDateTimeToLog.cs b/src/LanBackup.DataCore/Migrations/20170114093121_AddDateTimeToLog.cs new file mode 100644 index 0000000..6879140 --- /dev/null +++ b/src/LanBackup.DataCore/Migrations/20170114093121_AddDateTimeToLog.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace LanBackup.DataCore.Migrations +{ + public partial class AddDateTimeToLog : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "DateTime", + table: "Logs", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "DateTime", + table: "Logs"); + } + } +} diff --git a/src/LanBackup.DataCore/Migrations/20170114122456_ChangedFieldName.Designer.cs b/src/LanBackup.DataCore/Migrations/20170114122456_ChangedFieldName.Designer.cs new file mode 100644 index 0000000..5a39bfe --- /dev/null +++ b/src/LanBackup.DataCore/Migrations/20170114122456_ChangedFieldName.Designer.cs @@ -0,0 +1,87 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using LanBackup.DataCore; + +namespace LanBackup.DataCore.Migrations +{ + [DbContext(typeof(BackupsContext))] + [Migration("20170114122456_ChangedFieldName")] + partial class ChangedFieldName + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { + modelBuilder + .HasAnnotation("ProductVersion", "1.1.0-rtm-22752") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("LanBackup.ModelsCore.BackupConfiguration", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("ClientIP") + .IsRequired(); + + b.Property("Crontab"); + + b.Property("DestLanFolder"); + + b.Property("DestPass"); + + b.Property("DestUser"); + + b.Property("IsActive"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("SrcFolder"); + + b.Property("SrcPass"); + + b.Property("SrcUser"); + + b.HasKey("ID"); + + b.HasIndex("ClientIP"); + + b.ToTable("Backups"); + }); + + modelBuilder.Entity("LanBackup.ModelsCore.BackupLog", b => + { + b.Property("ID") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClientIP"); + + b.Property("ConfigurationID"); + + b.Property("DateTime"); + + b.Property("Description"); + + b.Property("LogError"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("Status"); + + b.HasKey("ID"); + + b.HasIndex("ClientIP"); + + b.HasIndex("ConfigurationID"); + + b.ToTable("Logs"); + }); + } + } +} diff --git a/src/LanBackup.DataCore/Migrations/20170114122456_ChangedFieldName.cs b/src/LanBackup.DataCore/Migrations/20170114122456_ChangedFieldName.cs new file mode 100644 index 0000000..cf06900 --- /dev/null +++ b/src/LanBackup.DataCore/Migrations/20170114122456_ChangedFieldName.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace LanBackup.DataCore.Migrations +{ + public partial class ChangedFieldName : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "Error", + table: "Logs", + newName: "LogError"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "LogError", + table: "Logs", + newName: "Error"); + } + } +} diff --git a/src/LanBackup.DataCore/Migrations/BackupsContextModelSnapshot.cs b/src/LanBackup.DataCore/Migrations/BackupsContextModelSnapshot.cs new file mode 100644 index 0000000..b67a51d --- /dev/null +++ b/src/LanBackup.DataCore/Migrations/BackupsContextModelSnapshot.cs @@ -0,0 +1,86 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using LanBackup.DataCore; + +namespace LanBackup.DataCore.Migrations +{ + [DbContext(typeof(BackupsContext))] + partial class BackupsContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { + modelBuilder + .HasAnnotation("ProductVersion", "1.1.0-rtm-22752") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("LanBackup.ModelsCore.BackupConfiguration", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("ClientIP") + .IsRequired(); + + b.Property("Crontab"); + + b.Property("DestLanFolder"); + + b.Property("DestPass"); + + b.Property("DestUser"); + + b.Property("IsActive"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("SrcFolder"); + + b.Property("SrcPass"); + + b.Property("SrcUser"); + + b.HasKey("ID"); + + b.HasIndex("ClientIP"); + + b.ToTable("Backups"); + }); + + modelBuilder.Entity("LanBackup.ModelsCore.BackupLog", b => + { + b.Property("ID") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClientIP"); + + b.Property("ConfigurationID"); + + b.Property("DateTime"); + + b.Property("Description"); + + b.Property("LogError"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("Status"); + + b.HasKey("ID"); + + b.HasIndex("ClientIP"); + + b.HasIndex("ConfigurationID"); + + b.ToTable("Logs"); + }); + } + } +} diff --git a/src/LanBackup.DataCore/Migrations/MigrationsContextFactory.cs b/src/LanBackup.DataCore/Migrations/MigrationsContextFactory.cs new file mode 100644 index 0000000..3f9653e --- /dev/null +++ b/src/LanBackup.DataCore/Migrations/MigrationsContextFactory.cs @@ -0,0 +1,23 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.Extensions.Configuration; +using System.IO; + +namespace LanBackup.DataCore.Migrations +{ + public class MigrationsContextFactory : IDbContextFactory + { + public BackupsContext Create(DbContextFactoryOptions foptions) + { + var config = new ConfigurationBuilder() + .SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile("appsettings.json") + .Build(); + + var options = new DbContextOptionsBuilder(); + options.UseSqlServer(config.GetConnectionString("BackupsConnectionString")); + + return new BackupsContext(options.Options); + } + } +} diff --git a/src/LanBackup.DataCore/Program.cs b/src/LanBackup.DataCore/Program.cs new file mode 100644 index 0000000..369255f --- /dev/null +++ b/src/LanBackup.DataCore/Program.cs @@ -0,0 +1,14 @@ +namespace LanBackup.DataCore +{ + /// + /// Start class + /// + public class Program + { + /// + /// Entry point + /// + /// arguments + public static void Main(string[] args) { } + } +} diff --git a/src/LanBackup.DataCore/Properties/AssemblyInfo.cs b/src/LanBackup.DataCore/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..341658f --- /dev/null +++ b/src/LanBackup.DataCore/Properties/AssemblyInfo.cs @@ -0,0 +1,19 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("LanBackup.DataCore")] +[assembly: AssemblyTrademark("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("b4144721-0f2c-4750-aba3-5238490a71ff")] diff --git a/src/LanBackup.DataCore/appsettings.json b/src/LanBackup.DataCore/appsettings.json new file mode 100644 index 0000000..e3eb32b --- /dev/null +++ b/src/LanBackup.DataCore/appsettings.json @@ -0,0 +1,13 @@ +{ + "ConnectionStrings": { + "BackupsConnectionString": "Server=(localdb)\\mssqllocaldb;Database=BackupsLAN;Trusted_Connection=True;" + }, + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/src/LanBackup.DataCore/project.json b/src/LanBackup.DataCore/project.json new file mode 100644 index 0000000..3262cc2 --- /dev/null +++ b/src/LanBackup.DataCore/project.json @@ -0,0 +1,41 @@ +{ + "version": "1.0.0-*", + + "buildOptions": { + "emitEntryPoint": true, + "copyToOutput": { + "includeFiles": "appsettings.json" + }, + "xmlDoc": true, + "additionalArguments": [ "/ruleset:../../misc/_stylecop/StyleCopeRules.ruleset", "/additionalfile:../../misc/_stylecop/stylecop.json" ] + }, + + "dependencies": { + "NETStandard.Library": "1.6.1", + "Microsoft.Extensions.Configuration.Json": "1.1.0", + "Microsoft.Extensions.Configuration.FileExtensions": "1.1.0", + "Microsoft.Extensions.Configuration": "1.1.0", + "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview4-final", + "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0", + "Microsoft.EntityFrameworkCore": "1.1.0", + "LanBackup.ModelsCore": "1.0.0-*", + "StyleCop.Analyzers": "1.1.0-beta001" + }, + + "tools": { + "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview4-final", + "Microsoft.EntityFrameworkCore.Tools.DotNet": "1.0.0-preview3-final" + }, + + "frameworks": { + "netcoreapp1.0": { + "dependencies": { + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.1.0" + } + } + } + } + +} diff --git a/src/LanBackup.ModelsCore/BackupConfiguration.cs b/src/LanBackup.ModelsCore/BackupConfiguration.cs new file mode 100644 index 0000000..4784397 --- /dev/null +++ b/src/LanBackup.ModelsCore/BackupConfiguration.cs @@ -0,0 +1,54 @@ +using System.ComponentModel.DataAnnotations; + +namespace LanBackup.ModelsCore +{ + public class BackupConfiguration + { + public BackupConfiguration() + { + } + + [Key] + public string ID { get; set; } + + + [Timestamp] + [ConcurrencyCheck] + public byte[] RowVersion { get; set; } + + + [RegularExpression(@"^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$")] + [Required] + [Display(Name = "Client IP")] + public string ClientIP { get; set; } + + [Display(Name = "Source folder")] + public string SrcFolder { get; set; } + + [Display(Name = "Source folder Username")] + public string SrcUser { get; set; } + + [Display(Name = "Source folder Password")] + public string SrcPass { get; set; } + + [Display(Name = "Destination LAN folder")] + public string DestLanFolder { get; set; } + + [Display(Name = "Destination folder Username")] + public string DestUser { get; set; } + + [Display(Name = "Destination folder Password")] + public string DestPass { get; set; } + + [Display(Name = "Is Backup Active")] + public bool IsActive { get; set; } + + + + //TODO - validate to be a CRONTAB expression + //[RegularExpression(@"^[A-Z]+[a-zA-Z''-'\s]*$")] + [Display(Name = "Crontab schedule expression")] + public string Crontab { get; set; } + + } +} diff --git a/src/LanBackup.ModelsCore/BackupLog.cs b/src/LanBackup.ModelsCore/BackupLog.cs new file mode 100644 index 0000000..a645f0d --- /dev/null +++ b/src/LanBackup.ModelsCore/BackupLog.cs @@ -0,0 +1,47 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace LanBackup.ModelsCore +{ + public class BackupLog + { + + public BackupLog() + { } + + + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int ID { get; set; } + + + [Timestamp] + [ConcurrencyCheck] + public byte[] RowVersion { get; set; } + + + [RegularExpression(@"^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$")] + [Display(Name = "Client IP")] + public string ClientIP { get; set; } + + [Display(Name = "Configuration IP")] + public string ConfigurationID { get; set; } + + [Display(Name = "Description")] + public string Description { get; set; } + + [Display(Name = "LogError")] + public string LogError { get; set; } + + [Display(Name = "Status")] + public string Status { get; set; } + + + [Display(Name = "DateTime")] + public DateTime DateTime { get; set; } + + + } + +} diff --git a/src/LanBackup.ModelsCore/LanBackup.ModelsCore.xproj b/src/LanBackup.ModelsCore/LanBackup.ModelsCore.xproj new file mode 100644 index 0000000..6bbefbd --- /dev/null +++ b/src/LanBackup.ModelsCore/LanBackup.ModelsCore.xproj @@ -0,0 +1,21 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + cdc21836-c111-4db4-96c1-a37128df2127 + LanBackup.ModelsCore + .\obj + .\bin\ + v4.6.2 + + + + 2.0 + + + diff --git a/src/LanBackup.ModelsCore/Properties/AssemblyInfo.cs b/src/LanBackup.ModelsCore/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..1ce8861 --- /dev/null +++ b/src/LanBackup.ModelsCore/Properties/AssemblyInfo.cs @@ -0,0 +1,19 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("LanBackup.ModelsCore")] +[assembly: AssemblyTrademark("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("cdc21836-c111-4db4-96c1-a37128df2127")] diff --git a/src/LanBackup.ModelsCore/project.json b/src/LanBackup.ModelsCore/project.json new file mode 100644 index 0000000..65034b1 --- /dev/null +++ b/src/LanBackup.ModelsCore/project.json @@ -0,0 +1,15 @@ +{ + "version": "1.0.0-*", + + "dependencies": { + "NETStandard.Library": "1.6.1", + "System.ComponentModel.Annotations": "4.3.0", + "Microsoft.EntityFrameworkCore": "1.1.0" + }, + + "frameworks": { + "netstandard1.6": { + "imports": "dnxcore50" + } + } +} diff --git a/src/LanBackup.WebApp/.dockerignore b/src/LanBackup.WebApp/.dockerignore new file mode 100644 index 0000000..63d337d --- /dev/null +++ b/src/LanBackup.WebApp/.dockerignore @@ -0,0 +1,2 @@ +docker-compose.yml +Dockerfile diff --git a/src/LanBackup.WebApp/.gitignore b/src/LanBackup.WebApp/.gitignore new file mode 100644 index 0000000..ded4b28 --- /dev/null +++ b/src/LanBackup.WebApp/.gitignore @@ -0,0 +1,248 @@ +/Properties/launchSettings.json + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +bin/ +Bin/ +obj/ +Obj/ + +# Visual Studio 2015 cache/options directory +.vs/ +/wwwroot/dist/** +/ClientApp/dist/** + +# Workaround for https://github.com/aspnet/JavaScriptServices/issues/235 +!/wwwroot/dist/_placeholder.txt +!/ClientApp/dist/_placeholder.txt + + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Microsoft Azure ApplicationInsights config file +ApplicationInsights.config + +# Windows Store app package directory +AppPackages/ +BundleArtifacts/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +orleans.codegen.cs + +# Workaround for https://github.com/aspnet/JavaScriptServices/issues/235 +/node_modules/** +!/node_modules/_placeholder.txt + +/yarn.lock + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe + +# FAKE - F# Make +.fake/ diff --git a/src/LanBackup.WebApp/.vscode/launch.json b/src/LanBackup.WebApp/.vscode/launch.json new file mode 100644 index 0000000..4bec0a4 --- /dev/null +++ b/src/LanBackup.WebApp/.vscode/launch.json @@ -0,0 +1,42 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": ".NET Core Launch (web)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + "program": "${workspaceRoot}\\bin\\Debug\\netcoreapp1.1\\aspa.dll", + "args": [], + "cwd": "${workspaceRoot}", + "stopAtEntry": false, + "internalConsoleOptions": "openOnSessionStart", + "launchBrowser": { + "enabled": true, + "args": "${auto-detect-url}", + "windows": { + "command": "cmd.exe", + "args": "/C start ${auto-detect-url}" + }, + "osx": { + "command": "open" + }, + "linux": { + "command": "xdg-open" + } + }, + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "sourceFileMap": { + "/Views": "${workspaceRoot}/Views" + } + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command.pickProcess}" + } + ] +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/.vscode/tasks.json b/src/LanBackup.WebApp/.vscode/tasks.json new file mode 100644 index 0000000..9cd37c1 --- /dev/null +++ b/src/LanBackup.WebApp/.vscode/tasks.json @@ -0,0 +1,16 @@ +{ + "version": "0.1.0", + "command": "dotnet", + "isShellCommand": true, + "args": [], + "tasks": [ + { + "taskName": "build", + "args": [ + "${workspaceRoot}\\project.json" + ], + "isBuildCommand": true, + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/app.module.ts b/src/LanBackup.WebApp/ClientApp/app/app.module.ts new file mode 100644 index 0000000..e8c33f4 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/app.module.ts @@ -0,0 +1,92 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import { UniversalModule } from 'angular2-universal'; +import { AppComponent } from './components/app/app.component' +import { NavMenuComponent } from './components/navmenu/navmenu.component'; +import { BackupsComponent } from './components/backups/backups.component'; +import { LoginComponent } from './components/login/login.component'; +import { ProfileComponent } from './components/profile/profile.component'; +import { LogsComponent } from './components/logs/logs.component'; +import { UsersComponent } from './components/users/users.component'; +import { DashboardComponent } from './components/dashboard/dashboard.component'; + + +import { WebApiService } from './services/webapi.service'; +import { AuthenticationService } from './services/authentication.service'; +import { Ng2PaginationModule } from './shared/ng2-pagination/ng2-pagination'; // <-- import the module +import { FormsModule } from '@angular/forms'; +import { AuthGuard } from './services/authguard'; +import { ModalComponent } from './shared/modal/modal.component'; +import { BrowserModule } from "@angular/platform-browser"; + +import { ToastyModule } from 'ng2-toasty'; + +import { MessageService } from './services/message.service'; +import { NotificationsService } from './services/notifications.service'; +import { AgentsService } from './services/agents.service'; + + +import { LoggerService } from './services/logger.service'; +import { Ng2SwitchComponent } from './shared/ng2-switch/ng2-switch'; +import { Progress } from './shared/progressbar/progress'; +import { Bar } from './shared/progressbar/bar'; +import { Progressbar } from './shared/progressbar/progressbar'; +import { AppInsightsModule } from 'ng2-appinsights'; + + +import { SharedModule } from './shared/global/SharedModule'; + + + +@NgModule({ + bootstrap: [AppComponent], + declarations: [ + AppComponent, + NavMenuComponent, + Progress, + Bar, + Progressbar, + BackupsComponent, + LoginComponent, + ProfileComponent, + ModalComponent, + Ng2SwitchComponent, + LogsComponent, + UsersComponent, + DashboardComponent + ], + imports: [ + UniversalModule, // Must be first import. This automatically imports BrowserModule, HttpModule, and JsonpModule too. + RouterModule.forRoot([ + { path: '', redirectTo: 'dashboard', pathMatch: 'full' }, + { path: 'dashboard', component: DashboardComponent }, + { path: 'backups', component: BackupsComponent }, + { path: 'logs', component: LogsComponent }, + { path: 'users', component: UsersComponent, canActivate: [AuthGuard] }, + { path: 'login', component: LoginComponent }, + { path: 'profile', component: ProfileComponent, canActivate: [AuthGuard] }, + { path: '**', redirectTo: 'dashboard' } + ]), + Ng2PaginationModule, + FormsModule, + ToastyModule.forRoot(), + AppInsightsModule, + SharedModule.forBrowser() + ], + providers: [ + LoggerService, + MessageService, + WebApiService, + AuthenticationService, + AuthGuard, + NotificationsService, + AgentsService + ] +}) +export class AppModule { + + public AppModule() { + console.log('AppModule'); + } + +} diff --git a/src/LanBackup.WebApp/ClientApp/app/bootswatch/css/bootstrap_yeti.css b/src/LanBackup.WebApp/ClientApp/app/bootswatch/css/bootstrap_yeti.css new file mode 100644 index 0000000..f90228f --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/bootswatch/css/bootstrap_yeti.css @@ -0,0 +1,7070 @@ +@import url("https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,300,700"); +/*! + * bootswatch v3.3.7 + * Homepage: http://bootswatch.com + * Copyright 2012-2016 Thomas Park + * Licensed under MIT + * Based on Bootstrap +*/ +/*! + * Bootstrap v3.3.7 (http://getbootstrap.com) + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ +/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ +html { + font-family: sans-serif; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; +} +body { + margin: 0; +} +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section, +summary { + display: block; +} +audio, +canvas, +progress, +video { + display: inline-block; + vertical-align: baseline; +} +audio:not([controls]) { + display: none; + height: 0; +} +[hidden], +template { + display: none; +} +a { + background-color: transparent; +} +a:active, +a:hover { + outline: 0; +} +abbr[title] { + border-bottom: 1px dotted; +} +b, +strong { + font-weight: bold; +} +dfn { + font-style: italic; +} +h1 { + font-size: 2em; + margin: 0.67em 0; +} +mark { + background: #ff0; + color: #000; +} +small { + font-size: 80%; +} +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} +sup { + top: -0.5em; +} +sub { + bottom: -0.25em; +} +img { + border: 0; +} +svg:not(:root) { + overflow: hidden; +} +figure { + margin: 1em 40px; +} +hr { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} +pre { + overflow: auto; +} +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} +button, +input, +optgroup, +select, +textarea { + color: inherit; + font: inherit; + margin: 0; +} +button { + overflow: visible; +} +button, +select { + text-transform: none; +} +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; +} +button[disabled], +html input[disabled] { + cursor: default; +} +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} +input { + line-height: normal; +} +input[type="checkbox"], +input[type="radio"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 0; +} +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} +input[type="search"] { + -webkit-appearance: textfield; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} +legend { + border: 0; + padding: 0; +} +textarea { + overflow: auto; +} +optgroup { + font-weight: bold; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +td, +th { + padding: 0; +} +/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ +@media print { + *, + *:before, + *:after { + background: transparent !important; + color: #000 !important; + -webkit-box-shadow: none !important; + box-shadow: none !important; + text-shadow: none !important; + } + a, + a:visited { + text-decoration: underline; + } + a[href]:after { + content: " (" attr(href) ")"; + } + abbr[title]:after { + content: " (" attr(title) ")"; + } + a[href^="#"]:after, + a[href^="javascript:"]:after { + content: ""; + } + pre, + blockquote { + border: 1px solid #999; + page-break-inside: avoid; + } + thead { + display: table-header-group; + } + tr, + img { + page-break-inside: avoid; + } + img { + max-width: 100% !important; + } + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + h2, + h3 { + page-break-after: avoid; + } + .navbar { + display: none; + } + .btn > .caret, + .dropup > .btn > .caret { + border-top-color: #000 !important; + } + .label { + border: 1px solid #000; + } + .table { + border-collapse: collapse !important; + } + .table td, + .table th { + background-color: #fff !important; + } + .table-bordered th, + .table-bordered td { + border: 1px solid #ddd !important; + } +} +@font-face { + font-family: 'Glyphicons Halflings'; + src: url('../fonts/glyphicons-halflings-regular.eot'); + src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg'); +} +.glyphicon { + position: relative; + top: 1px; + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: normal; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.glyphicon-asterisk:before { + content: "\002a"; +} +.glyphicon-plus:before { + content: "\002b"; +} +.glyphicon-euro:before, +.glyphicon-eur:before { + content: "\20ac"; +} +.glyphicon-minus:before { + content: "\2212"; +} +.glyphicon-cloud:before { + content: "\2601"; +} +.glyphicon-envelope:before { + content: "\2709"; +} +.glyphicon-pencil:before { + content: "\270f"; +} +.glyphicon-glass:before { + content: "\e001"; +} +.glyphicon-music:before { + content: "\e002"; +} +.glyphicon-search:before { + content: "\e003"; +} +.glyphicon-heart:before { + content: "\e005"; +} +.glyphicon-star:before { + content: "\e006"; +} +.glyphicon-star-empty:before { + content: "\e007"; +} +.glyphicon-user:before { + content: "\e008"; +} +.glyphicon-film:before { + content: "\e009"; +} +.glyphicon-th-large:before { + content: "\e010"; +} +.glyphicon-th:before { + content: "\e011"; +} +.glyphicon-th-list:before { + content: "\e012"; +} +.glyphicon-ok:before { + content: "\e013"; +} +.glyphicon-remove:before { + content: "\e014"; +} +.glyphicon-zoom-in:before { + content: "\e015"; +} +.glyphicon-zoom-out:before { + content: "\e016"; +} +.glyphicon-off:before { + content: "\e017"; +} +.glyphicon-signal:before { + content: "\e018"; +} +.glyphicon-cog:before { + content: "\e019"; +} +.glyphicon-trash:before { + content: "\e020"; +} +.glyphicon-home:before { + content: "\e021"; +} +.glyphicon-file:before { + content: "\e022"; +} +.glyphicon-time:before { + content: "\e023"; +} +.glyphicon-road:before { + content: "\e024"; +} +.glyphicon-download-alt:before { + content: "\e025"; +} +.glyphicon-download:before { + content: "\e026"; +} +.glyphicon-upload:before { + content: "\e027"; +} +.glyphicon-inbox:before { + content: "\e028"; +} +.glyphicon-play-circle:before { + content: "\e029"; +} +.glyphicon-repeat:before { + content: "\e030"; +} +.glyphicon-refresh:before { + content: "\e031"; +} +.glyphicon-list-alt:before { + content: "\e032"; +} +.glyphicon-lock:before { + content: "\e033"; +} +.glyphicon-flag:before { + content: "\e034"; +} +.glyphicon-headphones:before { + content: "\e035"; +} +.glyphicon-volume-off:before { + content: "\e036"; +} +.glyphicon-volume-down:before { + content: "\e037"; +} +.glyphicon-volume-up:before { + content: "\e038"; +} +.glyphicon-qrcode:before { + content: "\e039"; +} +.glyphicon-barcode:before { + content: "\e040"; +} +.glyphicon-tag:before { + content: "\e041"; +} +.glyphicon-tags:before { + content: "\e042"; +} +.glyphicon-book:before { + content: "\e043"; +} +.glyphicon-bookmark:before { + content: "\e044"; +} +.glyphicon-print:before { + content: "\e045"; +} +.glyphicon-camera:before { + content: "\e046"; +} +.glyphicon-font:before { + content: "\e047"; +} +.glyphicon-bold:before { + content: "\e048"; +} +.glyphicon-italic:before { + content: "\e049"; +} +.glyphicon-text-height:before { + content: "\e050"; +} +.glyphicon-text-width:before { + content: "\e051"; +} +.glyphicon-align-left:before { + content: "\e052"; +} +.glyphicon-align-center:before { + content: "\e053"; +} +.glyphicon-align-right:before { + content: "\e054"; +} +.glyphicon-align-justify:before { + content: "\e055"; +} +.glyphicon-list:before { + content: "\e056"; +} +.glyphicon-indent-left:before { + content: "\e057"; +} +.glyphicon-indent-right:before { + content: "\e058"; +} +.glyphicon-facetime-video:before { + content: "\e059"; +} +.glyphicon-picture:before { + content: "\e060"; +} +.glyphicon-map-marker:before { + content: "\e062"; +} +.glyphicon-adjust:before { + content: "\e063"; +} +.glyphicon-tint:before { + content: "\e064"; +} +.glyphicon-edit:before { + content: "\e065"; +} +.glyphicon-share:before { + content: "\e066"; +} +.glyphicon-check:before { + content: "\e067"; +} +.glyphicon-move:before { + content: "\e068"; +} +.glyphicon-step-backward:before { + content: "\e069"; +} +.glyphicon-fast-backward:before { + content: "\e070"; +} +.glyphicon-backward:before { + content: "\e071"; +} +.glyphicon-play:before { + content: "\e072"; +} +.glyphicon-pause:before { + content: "\e073"; +} +.glyphicon-stop:before { + content: "\e074"; +} +.glyphicon-forward:before { + content: "\e075"; +} +.glyphicon-fast-forward:before { + content: "\e076"; +} +.glyphicon-step-forward:before { + content: "\e077"; +} +.glyphicon-eject:before { + content: "\e078"; +} +.glyphicon-chevron-left:before { + content: "\e079"; +} +.glyphicon-chevron-right:before { + content: "\e080"; +} +.glyphicon-plus-sign:before { + content: "\e081"; +} +.glyphicon-minus-sign:before { + content: "\e082"; +} +.glyphicon-remove-sign:before { + content: "\e083"; +} +.glyphicon-ok-sign:before { + content: "\e084"; +} +.glyphicon-question-sign:before { + content: "\e085"; +} +.glyphicon-info-sign:before { + content: "\e086"; +} +.glyphicon-screenshot:before { + content: "\e087"; +} +.glyphicon-remove-circle:before { + content: "\e088"; +} +.glyphicon-ok-circle:before { + content: "\e089"; +} +.glyphicon-ban-circle:before { + content: "\e090"; +} +.glyphicon-arrow-left:before { + content: "\e091"; +} +.glyphicon-arrow-right:before { + content: "\e092"; +} +.glyphicon-arrow-up:before { + content: "\e093"; +} +.glyphicon-arrow-down:before { + content: "\e094"; +} +.glyphicon-share-alt:before { + content: "\e095"; +} +.glyphicon-resize-full:before { + content: "\e096"; +} +.glyphicon-resize-small:before { + content: "\e097"; +} +.glyphicon-exclamation-sign:before { + content: "\e101"; +} +.glyphicon-gift:before { + content: "\e102"; +} +.glyphicon-leaf:before { + content: "\e103"; +} +.glyphicon-fire:before { + content: "\e104"; +} +.glyphicon-eye-open:before { + content: "\e105"; +} +.glyphicon-eye-close:before { + content: "\e106"; +} +.glyphicon-warning-sign:before { + content: "\e107"; +} +.glyphicon-plane:before { + content: "\e108"; +} +.glyphicon-calendar:before { + content: "\e109"; +} +.glyphicon-random:before { + content: "\e110"; +} +.glyphicon-comment:before { + content: "\e111"; +} +.glyphicon-magnet:before { + content: "\e112"; +} +.glyphicon-chevron-up:before { + content: "\e113"; +} +.glyphicon-chevron-down:before { + content: "\e114"; +} +.glyphicon-retweet:before { + content: "\e115"; +} +.glyphicon-shopping-cart:before { + content: "\e116"; +} +.glyphicon-folder-close:before { + content: "\e117"; +} +.glyphicon-folder-open:before { + content: "\e118"; +} +.glyphicon-resize-vertical:before { + content: "\e119"; +} +.glyphicon-resize-horizontal:before { + content: "\e120"; +} +.glyphicon-hdd:before { + content: "\e121"; +} +.glyphicon-bullhorn:before { + content: "\e122"; +} +.glyphicon-bell:before { + content: "\e123"; +} +.glyphicon-certificate:before { + content: "\e124"; +} +.glyphicon-thumbs-up:before { + content: "\e125"; +} +.glyphicon-thumbs-down:before { + content: "\e126"; +} +.glyphicon-hand-right:before { + content: "\e127"; +} +.glyphicon-hand-left:before { + content: "\e128"; +} +.glyphicon-hand-up:before { + content: "\e129"; +} +.glyphicon-hand-down:before { + content: "\e130"; +} +.glyphicon-circle-arrow-right:before { + content: "\e131"; +} +.glyphicon-circle-arrow-left:before { + content: "\e132"; +} +.glyphicon-circle-arrow-up:before { + content: "\e133"; +} +.glyphicon-circle-arrow-down:before { + content: "\e134"; +} +.glyphicon-globe:before { + content: "\e135"; +} +.glyphicon-wrench:before { + content: "\e136"; +} +.glyphicon-tasks:before { + content: "\e137"; +} +.glyphicon-filter:before { + content: "\e138"; +} +.glyphicon-briefcase:before { + content: "\e139"; +} +.glyphicon-fullscreen:before { + content: "\e140"; +} +.glyphicon-dashboard:before { + content: "\e141"; +} +.glyphicon-paperclip:before { + content: "\e142"; +} +.glyphicon-heart-empty:before { + content: "\e143"; +} +.glyphicon-link:before { + content: "\e144"; +} +.glyphicon-phone:before { + content: "\e145"; +} +.glyphicon-pushpin:before { + content: "\e146"; +} +.glyphicon-usd:before { + content: "\e148"; +} +.glyphicon-gbp:before { + content: "\e149"; +} +.glyphicon-sort:before { + content: "\e150"; +} +.glyphicon-sort-by-alphabet:before { + content: "\e151"; +} +.glyphicon-sort-by-alphabet-alt:before { + content: "\e152"; +} +.glyphicon-sort-by-order:before { + content: "\e153"; +} +.glyphicon-sort-by-order-alt:before { + content: "\e154"; +} +.glyphicon-sort-by-attributes:before { + content: "\e155"; +} +.glyphicon-sort-by-attributes-alt:before { + content: "\e156"; +} +.glyphicon-unchecked:before { + content: "\e157"; +} +.glyphicon-expand:before { + content: "\e158"; +} +.glyphicon-collapse-down:before { + content: "\e159"; +} +.glyphicon-collapse-up:before { + content: "\e160"; +} +.glyphicon-log-in:before { + content: "\e161"; +} +.glyphicon-flash:before { + content: "\e162"; +} +.glyphicon-log-out:before { + content: "\e163"; +} +.glyphicon-new-window:before { + content: "\e164"; +} +.glyphicon-record:before { + content: "\e165"; +} +.glyphicon-save:before { + content: "\e166"; +} +.glyphicon-open:before { + content: "\e167"; +} +.glyphicon-saved:before { + content: "\e168"; +} +.glyphicon-import:before { + content: "\e169"; +} +.glyphicon-export:before { + content: "\e170"; +} +.glyphicon-send:before { + content: "\e171"; +} +.glyphicon-floppy-disk:before { + content: "\e172"; +} +.glyphicon-floppy-saved:before { + content: "\e173"; +} +.glyphicon-floppy-remove:before { + content: "\e174"; +} +.glyphicon-floppy-save:before { + content: "\e175"; +} +.glyphicon-floppy-open:before { + content: "\e176"; +} +.glyphicon-credit-card:before { + content: "\e177"; +} +.glyphicon-transfer:before { + content: "\e178"; +} +.glyphicon-cutlery:before { + content: "\e179"; +} +.glyphicon-header:before { + content: "\e180"; +} +.glyphicon-compressed:before { + content: "\e181"; +} +.glyphicon-earphone:before { + content: "\e182"; +} +.glyphicon-phone-alt:before { + content: "\e183"; +} +.glyphicon-tower:before { + content: "\e184"; +} +.glyphicon-stats:before { + content: "\e185"; +} +.glyphicon-sd-video:before { + content: "\e186"; +} +.glyphicon-hd-video:before { + content: "\e187"; +} +.glyphicon-subtitles:before { + content: "\e188"; +} +.glyphicon-sound-stereo:before { + content: "\e189"; +} +.glyphicon-sound-dolby:before { + content: "\e190"; +} +.glyphicon-sound-5-1:before { + content: "\e191"; +} +.glyphicon-sound-6-1:before { + content: "\e192"; +} +.glyphicon-sound-7-1:before { + content: "\e193"; +} +.glyphicon-copyright-mark:before { + content: "\e194"; +} +.glyphicon-registration-mark:before { + content: "\e195"; +} +.glyphicon-cloud-download:before { + content: "\e197"; +} +.glyphicon-cloud-upload:before { + content: "\e198"; +} +.glyphicon-tree-conifer:before { + content: "\e199"; +} +.glyphicon-tree-deciduous:before { + content: "\e200"; +} +.glyphicon-cd:before { + content: "\e201"; +} +.glyphicon-save-file:before { + content: "\e202"; +} +.glyphicon-open-file:before { + content: "\e203"; +} +.glyphicon-level-up:before { + content: "\e204"; +} +.glyphicon-copy:before { + content: "\e205"; +} +.glyphicon-paste:before { + content: "\e206"; +} +.glyphicon-alert:before { + content: "\e209"; +} +.glyphicon-equalizer:before { + content: "\e210"; +} +.glyphicon-king:before { + content: "\e211"; +} +.glyphicon-queen:before { + content: "\e212"; +} +.glyphicon-pawn:before { + content: "\e213"; +} +.glyphicon-bishop:before { + content: "\e214"; +} +.glyphicon-knight:before { + content: "\e215"; +} +.glyphicon-baby-formula:before { + content: "\e216"; +} +.glyphicon-tent:before { + content: "\26fa"; +} +.glyphicon-blackboard:before { + content: "\e218"; +} +.glyphicon-bed:before { + content: "\e219"; +} +.glyphicon-apple:before { + content: "\f8ff"; +} +.glyphicon-erase:before { + content: "\e221"; +} +.glyphicon-hourglass:before { + content: "\231b"; +} +.glyphicon-lamp:before { + content: "\e223"; +} +.glyphicon-duplicate:before { + content: "\e224"; +} +.glyphicon-piggy-bank:before { + content: "\e225"; +} +.glyphicon-scissors:before { + content: "\e226"; +} +.glyphicon-bitcoin:before { + content: "\e227"; +} +.glyphicon-btc:before { + content: "\e227"; +} +.glyphicon-xbt:before { + content: "\e227"; +} +.glyphicon-yen:before { + content: "\00a5"; +} +.glyphicon-jpy:before { + content: "\00a5"; +} +.glyphicon-ruble:before { + content: "\20bd"; +} +.glyphicon-rub:before { + content: "\20bd"; +} +.glyphicon-scale:before { + content: "\e230"; +} +.glyphicon-ice-lolly:before { + content: "\e231"; +} +.glyphicon-ice-lolly-tasted:before { + content: "\e232"; +} +.glyphicon-education:before { + content: "\e233"; +} +.glyphicon-option-horizontal:before { + content: "\e234"; +} +.glyphicon-option-vertical:before { + content: "\e235"; +} +.glyphicon-menu-hamburger:before { + content: "\e236"; +} +.glyphicon-modal-window:before { + content: "\e237"; +} +.glyphicon-oil:before { + content: "\e238"; +} +.glyphicon-grain:before { + content: "\e239"; +} +.glyphicon-sunglasses:before { + content: "\e240"; +} +.glyphicon-text-size:before { + content: "\e241"; +} +.glyphicon-text-color:before { + content: "\e242"; +} +.glyphicon-text-background:before { + content: "\e243"; +} +.glyphicon-object-align-top:before { + content: "\e244"; +} +.glyphicon-object-align-bottom:before { + content: "\e245"; +} +.glyphicon-object-align-horizontal:before { + content: "\e246"; +} +.glyphicon-object-align-left:before { + content: "\e247"; +} +.glyphicon-object-align-vertical:before { + content: "\e248"; +} +.glyphicon-object-align-right:before { + content: "\e249"; +} +.glyphicon-triangle-right:before { + content: "\e250"; +} +.glyphicon-triangle-left:before { + content: "\e251"; +} +.glyphicon-triangle-bottom:before { + content: "\e252"; +} +.glyphicon-triangle-top:before { + content: "\e253"; +} +.glyphicon-console:before { + content: "\e254"; +} +.glyphicon-superscript:before { + content: "\e255"; +} +.glyphicon-subscript:before { + content: "\e256"; +} +.glyphicon-menu-left:before { + content: "\e257"; +} +.glyphicon-menu-right:before { + content: "\e258"; +} +.glyphicon-menu-down:before { + content: "\e259"; +} +.glyphicon-menu-up:before { + content: "\e260"; +} +* { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +*:before, +*:after { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +html { + font-size: 10px; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} +body { + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 15px; + line-height: 1.4; + color: #222222; + background-color: #ffffff; +} +input, +button, +select, +textarea { + font-family: inherit; + font-size: inherit; + line-height: inherit; +} +a { + color: #008cba; + text-decoration: none; +} +a:hover, +a:focus { + color: #008cba; + text-decoration: underline; +} +a:focus { + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +figure { + margin: 0; +} +img { + vertical-align: middle; +} +.img-responsive, +.thumbnail > img, +.thumbnail a > img, +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + display: block; + max-width: 100%; + height: auto; +} +.img-rounded { + border-radius: 0; +} +.img-thumbnail { + padding: 4px; + line-height: 1.4; + background-color: #ffffff; + border: 1px solid #dddddd; + border-radius: 0; + -webkit-transition: all 0.2s ease-in-out; + -o-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; + display: inline-block; + max-width: 100%; + height: auto; +} +.img-circle { + border-radius: 50%; +} +hr { + margin-top: 21px; + margin-bottom: 21px; + border: 0; + border-top: 1px solid #dddddd; +} +.sr-only { + position: absolute; + width: 1px; + height: 1px; + margin: -1px; + padding: 0; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; +} +.sr-only-focusable:active, +.sr-only-focusable:focus { + position: static; + width: auto; + height: auto; + margin: 0; + overflow: visible; + clip: auto; +} +[role="button"] { + cursor: pointer; +} +h1, +h2, +h3, +h4, +h5, +h6, +.h1, +.h2, +.h3, +.h4, +.h5, +.h6 { + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-weight: 300; + line-height: 1.1; + color: inherit; +} +h1 small, +h2 small, +h3 small, +h4 small, +h5 small, +h6 small, +.h1 small, +.h2 small, +.h3 small, +.h4 small, +.h5 small, +.h6 small, +h1 .small, +h2 .small, +h3 .small, +h4 .small, +h5 .small, +h6 .small, +.h1 .small, +.h2 .small, +.h3 .small, +.h4 .small, +.h5 .small, +.h6 .small { + font-weight: normal; + line-height: 1; + color: #999999; +} +h1, +.h1, +h2, +.h2, +h3, +.h3 { + margin-top: 21px; + margin-bottom: 10.5px; +} +h1 small, +.h1 small, +h2 small, +.h2 small, +h3 small, +.h3 small, +h1 .small, +.h1 .small, +h2 .small, +.h2 .small, +h3 .small, +.h3 .small { + font-size: 65%; +} +h4, +.h4, +h5, +.h5, +h6, +.h6 { + margin-top: 10.5px; + margin-bottom: 10.5px; +} +h4 small, +.h4 small, +h5 small, +.h5 small, +h6 small, +.h6 small, +h4 .small, +.h4 .small, +h5 .small, +.h5 .small, +h6 .small, +.h6 .small { + font-size: 75%; +} +h1, +.h1 { + font-size: 39px; +} +h2, +.h2 { + font-size: 32px; +} +h3, +.h3 { + font-size: 26px; +} +h4, +.h4 { + font-size: 19px; +} +h5, +.h5 { + font-size: 15px; +} +h6, +.h6 { + font-size: 13px; +} +p { + margin: 0 0 10.5px; +} +.lead { + margin-bottom: 21px; + font-size: 17px; + font-weight: 300; + line-height: 1.4; +} +@media (min-width: 768px) { + .lead { + font-size: 22.5px; + } +} +small, +.small { + font-size: 80%; +} +mark, +.mark { + background-color: #fcf8e3; + padding: .2em; +} +.text-left { + text-align: left; +} +.text-right { + text-align: right; +} +.text-center { + text-align: center; +} +.text-justify { + text-align: justify; +} +.text-nowrap { + white-space: nowrap; +} +.text-lowercase { + text-transform: lowercase; +} +.text-uppercase { + text-transform: uppercase; +} +.text-capitalize { + text-transform: capitalize; +} +.text-muted { + color: #999999; +} +.text-primary { + color: #008cba; +} +a.text-primary:hover, +a.text-primary:focus { + color: #006687; +} +.text-success { + color: #43ac6a; +} +a.text-success:hover, +a.text-success:focus { + color: #358753; +} +.text-info { + color: #5bc0de; +} +a.text-info:hover, +a.text-info:focus { + color: #31b0d5; +} +.text-warning { + color: #e99002; +} +a.text-warning:hover, +a.text-warning:focus { + color: #b67102; +} +.text-danger { + color: #f04124; +} +a.text-danger:hover, +a.text-danger:focus { + color: #d32a0e; +} +.bg-primary { + color: #fff; + background-color: #008cba; +} +a.bg-primary:hover, +a.bg-primary:focus { + background-color: #006687; +} +.bg-success { + background-color: #dff0d8; +} +a.bg-success:hover, +a.bg-success:focus { + background-color: #c1e2b3; +} +.bg-info { + background-color: #d9edf7; +} +a.bg-info:hover, +a.bg-info:focus { + background-color: #afd9ee; +} +.bg-warning { + background-color: #fcf8e3; +} +a.bg-warning:hover, +a.bg-warning:focus { + background-color: #f7ecb5; +} +.bg-danger { + background-color: #f2dede; +} +a.bg-danger:hover, +a.bg-danger:focus { + background-color: #e4b9b9; +} +.page-header { + padding-bottom: 9.5px; + margin: 42px 0 21px; + border-bottom: 1px solid #dddddd; +} +ul, +ol { + margin-top: 0; + margin-bottom: 10.5px; +} +ul ul, +ol ul, +ul ol, +ol ol { + margin-bottom: 0; +} +.list-unstyled { + padding-left: 0; + list-style: none; +} +.list-inline { + padding-left: 0; + list-style: none; + margin-left: -5px; +} +.list-inline > li { + display: inline-block; + padding-left: 5px; + padding-right: 5px; +} +dl { + margin-top: 0; + margin-bottom: 21px; +} +dt, +dd { + line-height: 1.4; +} +dt { + font-weight: bold; +} +dd { + margin-left: 0; +} +@media (min-width: 768px) { + .dl-horizontal dt { + float: left; + width: 160px; + clear: left; + text-align: right; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + .dl-horizontal dd { + margin-left: 180px; + } +} +abbr[title], +abbr[data-original-title] { + cursor: help; + border-bottom: 1px dotted #999999; +} +.initialism { + font-size: 90%; + text-transform: uppercase; +} +blockquote { + padding: 10.5px 21px; + margin: 0 0 21px; + font-size: 18.75px; + border-left: 5px solid #dddddd; +} +blockquote p:last-child, +blockquote ul:last-child, +blockquote ol:last-child { + margin-bottom: 0; +} +blockquote footer, +blockquote small, +blockquote .small { + display: block; + font-size: 80%; + line-height: 1.4; + color: #6f6f6f; +} +blockquote footer:before, +blockquote small:before, +blockquote .small:before { + content: '\2014 \00A0'; +} +.blockquote-reverse, +blockquote.pull-right { + padding-right: 15px; + padding-left: 0; + border-right: 5px solid #dddddd; + border-left: 0; + text-align: right; +} +.blockquote-reverse footer:before, +blockquote.pull-right footer:before, +.blockquote-reverse small:before, +blockquote.pull-right small:before, +.blockquote-reverse .small:before, +blockquote.pull-right .small:before { + content: ''; +} +.blockquote-reverse footer:after, +blockquote.pull-right footer:after, +.blockquote-reverse small:after, +blockquote.pull-right small:after, +.blockquote-reverse .small:after, +blockquote.pull-right .small:after { + content: '\00A0 \2014'; +} +address { + margin-bottom: 21px; + font-style: normal; + line-height: 1.4; +} +code, +kbd, +pre, +samp { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; +} +code { + padding: 2px 4px; + font-size: 90%; + color: #c7254e; + background-color: #f9f2f4; + border-radius: 0; +} +kbd { + padding: 2px 4px; + font-size: 90%; + color: #ffffff; + background-color: #333333; + border-radius: 0; + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); +} +kbd kbd { + padding: 0; + font-size: 100%; + font-weight: bold; + -webkit-box-shadow: none; + box-shadow: none; +} +pre { + display: block; + padding: 10px; + margin: 0 0 10.5px; + font-size: 14px; + line-height: 1.4; + word-break: break-all; + word-wrap: break-word; + color: #333333; + background-color: #f5f5f5; + border: 1px solid #cccccc; + border-radius: 0; +} +pre code { + padding: 0; + font-size: inherit; + color: inherit; + white-space: pre-wrap; + background-color: transparent; + border-radius: 0; +} +.pre-scrollable { + max-height: 340px; + overflow-y: scroll; +} +.container { + margin-right: auto; + margin-left: auto; + padding-left: 15px; + padding-right: 15px; +} +@media (min-width: 768px) { + .container { + width: 750px; + } +} +@media (min-width: 992px) { + .container { + width: 970px; + } +} +@media (min-width: 1200px) { + .container { + width: 1170px; + } +} +.container-fluid { + margin-right: auto; + margin-left: auto; + padding-left: 15px; + padding-right: 15px; +} +.row { + margin-left: -15px; + margin-right: -15px; +} +.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { + position: relative; + min-height: 1px; + padding-left: 15px; + padding-right: 15px; +} +.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { + float: left; +} +.col-xs-12 { + width: 100%; +} +.col-xs-11 { + width: 91.66666667%; +} +.col-xs-10 { + width: 83.33333333%; +} +.col-xs-9 { + width: 75%; +} +.col-xs-8 { + width: 66.66666667%; +} +.col-xs-7 { + width: 58.33333333%; +} +.col-xs-6 { + width: 50%; +} +.col-xs-5 { + width: 41.66666667%; +} +.col-xs-4 { + width: 33.33333333%; +} +.col-xs-3 { + width: 25%; +} +.col-xs-2 { + width: 16.66666667%; +} +.col-xs-1 { + width: 8.33333333%; +} +.col-xs-pull-12 { + right: 100%; +} +.col-xs-pull-11 { + right: 91.66666667%; +} +.col-xs-pull-10 { + right: 83.33333333%; +} +.col-xs-pull-9 { + right: 75%; +} +.col-xs-pull-8 { + right: 66.66666667%; +} +.col-xs-pull-7 { + right: 58.33333333%; +} +.col-xs-pull-6 { + right: 50%; +} +.col-xs-pull-5 { + right: 41.66666667%; +} +.col-xs-pull-4 { + right: 33.33333333%; +} +.col-xs-pull-3 { + right: 25%; +} +.col-xs-pull-2 { + right: 16.66666667%; +} +.col-xs-pull-1 { + right: 8.33333333%; +} +.col-xs-pull-0 { + right: auto; +} +.col-xs-push-12 { + left: 100%; +} +.col-xs-push-11 { + left: 91.66666667%; +} +.col-xs-push-10 { + left: 83.33333333%; +} +.col-xs-push-9 { + left: 75%; +} +.col-xs-push-8 { + left: 66.66666667%; +} +.col-xs-push-7 { + left: 58.33333333%; +} +.col-xs-push-6 { + left: 50%; +} +.col-xs-push-5 { + left: 41.66666667%; +} +.col-xs-push-4 { + left: 33.33333333%; +} +.col-xs-push-3 { + left: 25%; +} +.col-xs-push-2 { + left: 16.66666667%; +} +.col-xs-push-1 { + left: 8.33333333%; +} +.col-xs-push-0 { + left: auto; +} +.col-xs-offset-12 { + margin-left: 100%; +} +.col-xs-offset-11 { + margin-left: 91.66666667%; +} +.col-xs-offset-10 { + margin-left: 83.33333333%; +} +.col-xs-offset-9 { + margin-left: 75%; +} +.col-xs-offset-8 { + margin-left: 66.66666667%; +} +.col-xs-offset-7 { + margin-left: 58.33333333%; +} +.col-xs-offset-6 { + margin-left: 50%; +} +.col-xs-offset-5 { + margin-left: 41.66666667%; +} +.col-xs-offset-4 { + margin-left: 33.33333333%; +} +.col-xs-offset-3 { + margin-left: 25%; +} +.col-xs-offset-2 { + margin-left: 16.66666667%; +} +.col-xs-offset-1 { + margin-left: 8.33333333%; +} +.col-xs-offset-0 { + margin-left: 0%; +} +@media (min-width: 768px) { + .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { + float: left; + } + .col-sm-12 { + width: 100%; + } + .col-sm-11 { + width: 91.66666667%; + } + .col-sm-10 { + width: 83.33333333%; + } + .col-sm-9 { + width: 75%; + } + .col-sm-8 { + width: 66.66666667%; + } + .col-sm-7 { + width: 58.33333333%; + } + .col-sm-6 { + width: 50%; + } + .col-sm-5 { + width: 41.66666667%; + } + .col-sm-4 { + width: 33.33333333%; + } + .col-sm-3 { + width: 25%; + } + .col-sm-2 { + width: 16.66666667%; + } + .col-sm-1 { + width: 8.33333333%; + } + .col-sm-pull-12 { + right: 100%; + } + .col-sm-pull-11 { + right: 91.66666667%; + } + .col-sm-pull-10 { + right: 83.33333333%; + } + .col-sm-pull-9 { + right: 75%; + } + .col-sm-pull-8 { + right: 66.66666667%; + } + .col-sm-pull-7 { + right: 58.33333333%; + } + .col-sm-pull-6 { + right: 50%; + } + .col-sm-pull-5 { + right: 41.66666667%; + } + .col-sm-pull-4 { + right: 33.33333333%; + } + .col-sm-pull-3 { + right: 25%; + } + .col-sm-pull-2 { + right: 16.66666667%; + } + .col-sm-pull-1 { + right: 8.33333333%; + } + .col-sm-pull-0 { + right: auto; + } + .col-sm-push-12 { + left: 100%; + } + .col-sm-push-11 { + left: 91.66666667%; + } + .col-sm-push-10 { + left: 83.33333333%; + } + .col-sm-push-9 { + left: 75%; + } + .col-sm-push-8 { + left: 66.66666667%; + } + .col-sm-push-7 { + left: 58.33333333%; + } + .col-sm-push-6 { + left: 50%; + } + .col-sm-push-5 { + left: 41.66666667%; + } + .col-sm-push-4 { + left: 33.33333333%; + } + .col-sm-push-3 { + left: 25%; + } + .col-sm-push-2 { + left: 16.66666667%; + } + .col-sm-push-1 { + left: 8.33333333%; + } + .col-sm-push-0 { + left: auto; + } + .col-sm-offset-12 { + margin-left: 100%; + } + .col-sm-offset-11 { + margin-left: 91.66666667%; + } + .col-sm-offset-10 { + margin-left: 83.33333333%; + } + .col-sm-offset-9 { + margin-left: 75%; + } + .col-sm-offset-8 { + margin-left: 66.66666667%; + } + .col-sm-offset-7 { + margin-left: 58.33333333%; + } + .col-sm-offset-6 { + margin-left: 50%; + } + .col-sm-offset-5 { + margin-left: 41.66666667%; + } + .col-sm-offset-4 { + margin-left: 33.33333333%; + } + .col-sm-offset-3 { + margin-left: 25%; + } + .col-sm-offset-2 { + margin-left: 16.66666667%; + } + .col-sm-offset-1 { + margin-left: 8.33333333%; + } + .col-sm-offset-0 { + margin-left: 0%; + } +} +@media (min-width: 992px) { + .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { + float: left; + } + .col-md-12 { + width: 100%; + } + .col-md-11 { + width: 91.66666667%; + } + .col-md-10 { + width: 83.33333333%; + } + .col-md-9 { + width: 75%; + } + .col-md-8 { + width: 66.66666667%; + } + .col-md-7 { + width: 58.33333333%; + } + .col-md-6 { + width: 50%; + } + .col-md-5 { + width: 41.66666667%; + } + .col-md-4 { + width: 33.33333333%; + } + .col-md-3 { + width: 25%; + } + .col-md-2 { + width: 16.66666667%; + } + .col-md-1 { + width: 8.33333333%; + } + .col-md-pull-12 { + right: 100%; + } + .col-md-pull-11 { + right: 91.66666667%; + } + .col-md-pull-10 { + right: 83.33333333%; + } + .col-md-pull-9 { + right: 75%; + } + .col-md-pull-8 { + right: 66.66666667%; + } + .col-md-pull-7 { + right: 58.33333333%; + } + .col-md-pull-6 { + right: 50%; + } + .col-md-pull-5 { + right: 41.66666667%; + } + .col-md-pull-4 { + right: 33.33333333%; + } + .col-md-pull-3 { + right: 25%; + } + .col-md-pull-2 { + right: 16.66666667%; + } + .col-md-pull-1 { + right: 8.33333333%; + } + .col-md-pull-0 { + right: auto; + } + .col-md-push-12 { + left: 100%; + } + .col-md-push-11 { + left: 91.66666667%; + } + .col-md-push-10 { + left: 83.33333333%; + } + .col-md-push-9 { + left: 75%; + } + .col-md-push-8 { + left: 66.66666667%; + } + .col-md-push-7 { + left: 58.33333333%; + } + .col-md-push-6 { + left: 50%; + } + .col-md-push-5 { + left: 41.66666667%; + } + .col-md-push-4 { + left: 33.33333333%; + } + .col-md-push-3 { + left: 25%; + } + .col-md-push-2 { + left: 16.66666667%; + } + .col-md-push-1 { + left: 8.33333333%; + } + .col-md-push-0 { + left: auto; + } + .col-md-offset-12 { + margin-left: 100%; + } + .col-md-offset-11 { + margin-left: 91.66666667%; + } + .col-md-offset-10 { + margin-left: 83.33333333%; + } + .col-md-offset-9 { + margin-left: 75%; + } + .col-md-offset-8 { + margin-left: 66.66666667%; + } + .col-md-offset-7 { + margin-left: 58.33333333%; + } + .col-md-offset-6 { + margin-left: 50%; + } + .col-md-offset-5 { + margin-left: 41.66666667%; + } + .col-md-offset-4 { + margin-left: 33.33333333%; + } + .col-md-offset-3 { + margin-left: 25%; + } + .col-md-offset-2 { + margin-left: 16.66666667%; + } + .col-md-offset-1 { + margin-left: 8.33333333%; + } + .col-md-offset-0 { + margin-left: 0%; + } +} +@media (min-width: 1200px) { + .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { + float: left; + } + .col-lg-12 { + width: 100%; + } + .col-lg-11 { + width: 91.66666667%; + } + .col-lg-10 { + width: 83.33333333%; + } + .col-lg-9 { + width: 75%; + } + .col-lg-8 { + width: 66.66666667%; + } + .col-lg-7 { + width: 58.33333333%; + } + .col-lg-6 { + width: 50%; + } + .col-lg-5 { + width: 41.66666667%; + } + .col-lg-4 { + width: 33.33333333%; + } + .col-lg-3 { + width: 25%; + } + .col-lg-2 { + width: 16.66666667%; + } + .col-lg-1 { + width: 8.33333333%; + } + .col-lg-pull-12 { + right: 100%; + } + .col-lg-pull-11 { + right: 91.66666667%; + } + .col-lg-pull-10 { + right: 83.33333333%; + } + .col-lg-pull-9 { + right: 75%; + } + .col-lg-pull-8 { + right: 66.66666667%; + } + .col-lg-pull-7 { + right: 58.33333333%; + } + .col-lg-pull-6 { + right: 50%; + } + .col-lg-pull-5 { + right: 41.66666667%; + } + .col-lg-pull-4 { + right: 33.33333333%; + } + .col-lg-pull-3 { + right: 25%; + } + .col-lg-pull-2 { + right: 16.66666667%; + } + .col-lg-pull-1 { + right: 8.33333333%; + } + .col-lg-pull-0 { + right: auto; + } + .col-lg-push-12 { + left: 100%; + } + .col-lg-push-11 { + left: 91.66666667%; + } + .col-lg-push-10 { + left: 83.33333333%; + } + .col-lg-push-9 { + left: 75%; + } + .col-lg-push-8 { + left: 66.66666667%; + } + .col-lg-push-7 { + left: 58.33333333%; + } + .col-lg-push-6 { + left: 50%; + } + .col-lg-push-5 { + left: 41.66666667%; + } + .col-lg-push-4 { + left: 33.33333333%; + } + .col-lg-push-3 { + left: 25%; + } + .col-lg-push-2 { + left: 16.66666667%; + } + .col-lg-push-1 { + left: 8.33333333%; + } + .col-lg-push-0 { + left: auto; + } + .col-lg-offset-12 { + margin-left: 100%; + } + .col-lg-offset-11 { + margin-left: 91.66666667%; + } + .col-lg-offset-10 { + margin-left: 83.33333333%; + } + .col-lg-offset-9 { + margin-left: 75%; + } + .col-lg-offset-8 { + margin-left: 66.66666667%; + } + .col-lg-offset-7 { + margin-left: 58.33333333%; + } + .col-lg-offset-6 { + margin-left: 50%; + } + .col-lg-offset-5 { + margin-left: 41.66666667%; + } + .col-lg-offset-4 { + margin-left: 33.33333333%; + } + .col-lg-offset-3 { + margin-left: 25%; + } + .col-lg-offset-2 { + margin-left: 16.66666667%; + } + .col-lg-offset-1 { + margin-left: 8.33333333%; + } + .col-lg-offset-0 { + margin-left: 0%; + } +} +table { + background-color: transparent; +} +caption { + padding-top: 8px; + padding-bottom: 8px; + color: #999999; + text-align: left; +} +th { + text-align: left; +} +.table { + width: 100%; + max-width: 100%; + margin-bottom: 21px; +} +.table > thead > tr > th, +.table > tbody > tr > th, +.table > tfoot > tr > th, +.table > thead > tr > td, +.table > tbody > tr > td, +.table > tfoot > tr > td { + padding: 8px; + line-height: 1.4; + vertical-align: top; + border-top: 1px solid #dddddd; +} +.table > thead > tr > th { + vertical-align: bottom; + border-bottom: 2px solid #dddddd; +} +.table > caption + thead > tr:first-child > th, +.table > colgroup + thead > tr:first-child > th, +.table > thead:first-child > tr:first-child > th, +.table > caption + thead > tr:first-child > td, +.table > colgroup + thead > tr:first-child > td, +.table > thead:first-child > tr:first-child > td { + border-top: 0; +} +.table > tbody + tbody { + border-top: 2px solid #dddddd; +} +.table .table { + background-color: #ffffff; +} +.table-condensed > thead > tr > th, +.table-condensed > tbody > tr > th, +.table-condensed > tfoot > tr > th, +.table-condensed > thead > tr > td, +.table-condensed > tbody > tr > td, +.table-condensed > tfoot > tr > td { + padding: 5px; +} +.table-bordered { + border: 1px solid #dddddd; +} +.table-bordered > thead > tr > th, +.table-bordered > tbody > tr > th, +.table-bordered > tfoot > tr > th, +.table-bordered > thead > tr > td, +.table-bordered > tbody > tr > td, +.table-bordered > tfoot > tr > td { + border: 1px solid #dddddd; +} +.table-bordered > thead > tr > th, +.table-bordered > thead > tr > td { + border-bottom-width: 2px; +} +.table-striped > tbody > tr:nth-of-type(odd) { + background-color: #f9f9f9; +} +.table-hover > tbody > tr:hover { + background-color: #f5f5f5; +} +table col[class*="col-"] { + position: static; + float: none; + display: table-column; +} +table td[class*="col-"], +table th[class*="col-"] { + position: static; + float: none; + display: table-cell; +} +.table > thead > tr > td.active, +.table > tbody > tr > td.active, +.table > tfoot > tr > td.active, +.table > thead > tr > th.active, +.table > tbody > tr > th.active, +.table > tfoot > tr > th.active, +.table > thead > tr.active > td, +.table > tbody > tr.active > td, +.table > tfoot > tr.active > td, +.table > thead > tr.active > th, +.table > tbody > tr.active > th, +.table > tfoot > tr.active > th { + background-color: #f5f5f5; +} +.table-hover > tbody > tr > td.active:hover, +.table-hover > tbody > tr > th.active:hover, +.table-hover > tbody > tr.active:hover > td, +.table-hover > tbody > tr:hover > .active, +.table-hover > tbody > tr.active:hover > th { + background-color: #e8e8e8; +} +.table > thead > tr > td.success, +.table > tbody > tr > td.success, +.table > tfoot > tr > td.success, +.table > thead > tr > th.success, +.table > tbody > tr > th.success, +.table > tfoot > tr > th.success, +.table > thead > tr.success > td, +.table > tbody > tr.success > td, +.table > tfoot > tr.success > td, +.table > thead > tr.success > th, +.table > tbody > tr.success > th, +.table > tfoot > tr.success > th { + background-color: #dff0d8; +} +.table-hover > tbody > tr > td.success:hover, +.table-hover > tbody > tr > th.success:hover, +.table-hover > tbody > tr.success:hover > td, +.table-hover > tbody > tr:hover > .success, +.table-hover > tbody > tr.success:hover > th { + background-color: #d0e9c6; +} +.table > thead > tr > td.info, +.table > tbody > tr > td.info, +.table > tfoot > tr > td.info, +.table > thead > tr > th.info, +.table > tbody > tr > th.info, +.table > tfoot > tr > th.info, +.table > thead > tr.info > td, +.table > tbody > tr.info > td, +.table > tfoot > tr.info > td, +.table > thead > tr.info > th, +.table > tbody > tr.info > th, +.table > tfoot > tr.info > th { + background-color: #d9edf7; +} +.table-hover > tbody > tr > td.info:hover, +.table-hover > tbody > tr > th.info:hover, +.table-hover > tbody > tr.info:hover > td, +.table-hover > tbody > tr:hover > .info, +.table-hover > tbody > tr.info:hover > th { + background-color: #c4e3f3; +} +.table > thead > tr > td.warning, +.table > tbody > tr > td.warning, +.table > tfoot > tr > td.warning, +.table > thead > tr > th.warning, +.table > tbody > tr > th.warning, +.table > tfoot > tr > th.warning, +.table > thead > tr.warning > td, +.table > tbody > tr.warning > td, +.table > tfoot > tr.warning > td, +.table > thead > tr.warning > th, +.table > tbody > tr.warning > th, +.table > tfoot > tr.warning > th { + background-color: #fcf8e3; +} +.table-hover > tbody > tr > td.warning:hover, +.table-hover > tbody > tr > th.warning:hover, +.table-hover > tbody > tr.warning:hover > td, +.table-hover > tbody > tr:hover > .warning, +.table-hover > tbody > tr.warning:hover > th { + background-color: #faf2cc; +} +.table > thead > tr > td.danger, +.table > tbody > tr > td.danger, +.table > tfoot > tr > td.danger, +.table > thead > tr > th.danger, +.table > tbody > tr > th.danger, +.table > tfoot > tr > th.danger, +.table > thead > tr.danger > td, +.table > tbody > tr.danger > td, +.table > tfoot > tr.danger > td, +.table > thead > tr.danger > th, +.table > tbody > tr.danger > th, +.table > tfoot > tr.danger > th { + background-color: #f2dede; +} +.table-hover > tbody > tr > td.danger:hover, +.table-hover > tbody > tr > th.danger:hover, +.table-hover > tbody > tr.danger:hover > td, +.table-hover > tbody > tr:hover > .danger, +.table-hover > tbody > tr.danger:hover > th { + background-color: #ebcccc; +} +.table-responsive { + overflow-x: auto; + min-height: 0.01%; +} +@media screen and (max-width: 767px) { + .table-responsive { + width: 100%; + margin-bottom: 15.75px; + overflow-y: hidden; + -ms-overflow-style: -ms-autohiding-scrollbar; + border: 1px solid #dddddd; + } + .table-responsive > .table { + margin-bottom: 0; + } + .table-responsive > .table > thead > tr > th, + .table-responsive > .table > tbody > tr > th, + .table-responsive > .table > tfoot > tr > th, + .table-responsive > .table > thead > tr > td, + .table-responsive > .table > tbody > tr > td, + .table-responsive > .table > tfoot > tr > td { + white-space: nowrap; + } + .table-responsive > .table-bordered { + border: 0; + } + .table-responsive > .table-bordered > thead > tr > th:first-child, + .table-responsive > .table-bordered > tbody > tr > th:first-child, + .table-responsive > .table-bordered > tfoot > tr > th:first-child, + .table-responsive > .table-bordered > thead > tr > td:first-child, + .table-responsive > .table-bordered > tbody > tr > td:first-child, + .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; + } + .table-responsive > .table-bordered > thead > tr > th:last-child, + .table-responsive > .table-bordered > tbody > tr > th:last-child, + .table-responsive > .table-bordered > tfoot > tr > th:last-child, + .table-responsive > .table-bordered > thead > tr > td:last-child, + .table-responsive > .table-bordered > tbody > tr > td:last-child, + .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; + } + .table-responsive > .table-bordered > tbody > tr:last-child > th, + .table-responsive > .table-bordered > tfoot > tr:last-child > th, + .table-responsive > .table-bordered > tbody > tr:last-child > td, + .table-responsive > .table-bordered > tfoot > tr:last-child > td { + border-bottom: 0; + } +} +fieldset { + padding: 0; + margin: 0; + border: 0; + min-width: 0; +} +legend { + display: block; + width: 100%; + padding: 0; + margin-bottom: 21px; + font-size: 22.5px; + line-height: inherit; + color: #333333; + border: 0; + border-bottom: 1px solid #e5e5e5; +} +label { + display: inline-block; + max-width: 100%; + margin-bottom: 5px; + font-weight: bold; +} +input[type="search"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +input[type="radio"], +input[type="checkbox"] { + margin: 4px 0 0; + margin-top: 1px \9; + line-height: normal; +} +input[type="file"] { + display: block; +} +input[type="range"] { + display: block; + width: 100%; +} +select[multiple], +select[size] { + height: auto; +} +input[type="file"]:focus, +input[type="radio"]:focus, +input[type="checkbox"]:focus { + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +output { + display: block; + padding-top: 9px; + font-size: 15px; + line-height: 1.4; + color: #6f6f6f; +} +.form-control { + display: block; + width: 100%; + height: 39px; + padding: 8px 12px; + font-size: 15px; + line-height: 1.4; + color: #6f6f6f; + background-color: #ffffff; + background-image: none; + border: 1px solid #cccccc; + border-radius: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; + -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; +} +.form-control:focus { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); +} +.form-control::-moz-placeholder { + color: #999999; + opacity: 1; +} +.form-control:-ms-input-placeholder { + color: #999999; +} +.form-control::-webkit-input-placeholder { + color: #999999; +} +.form-control::-ms-expand { + border: 0; + background-color: transparent; +} +.form-control[disabled], +.form-control[readonly], +fieldset[disabled] .form-control { + background-color: #eeeeee; + opacity: 1; +} +.form-control[disabled], +fieldset[disabled] .form-control { + cursor: not-allowed; +} +textarea.form-control { + height: auto; +} +input[type="search"] { + -webkit-appearance: none; +} +@media screen and (-webkit-min-device-pixel-ratio: 0) { + input[type="date"].form-control, + input[type="time"].form-control, + input[type="datetime-local"].form-control, + input[type="month"].form-control { + line-height: 39px; + } + input[type="date"].input-sm, + input[type="time"].input-sm, + input[type="datetime-local"].input-sm, + input[type="month"].input-sm, + .input-group-sm input[type="date"], + .input-group-sm input[type="time"], + .input-group-sm input[type="datetime-local"], + .input-group-sm input[type="month"] { + line-height: 36px; + } + input[type="date"].input-lg, + input[type="time"].input-lg, + input[type="datetime-local"].input-lg, + input[type="month"].input-lg, + .input-group-lg input[type="date"], + .input-group-lg input[type="time"], + .input-group-lg input[type="datetime-local"], + .input-group-lg input[type="month"] { + line-height: 60px; + } +} +.form-group { + margin-bottom: 15px; +} +.radio, +.checkbox { + position: relative; + display: block; + margin-top: 10px; + margin-bottom: 10px; +} +.radio label, +.checkbox label { + min-height: 21px; + padding-left: 20px; + margin-bottom: 0; + font-weight: normal; + cursor: pointer; +} +.radio input[type="radio"], +.radio-inline input[type="radio"], +.checkbox input[type="checkbox"], +.checkbox-inline input[type="checkbox"] { + position: absolute; + margin-left: -20px; + margin-top: 4px \9; +} +.radio + .radio, +.checkbox + .checkbox { + margin-top: -5px; +} +.radio-inline, +.checkbox-inline { + position: relative; + display: inline-block; + padding-left: 20px; + margin-bottom: 0; + vertical-align: middle; + font-weight: normal; + cursor: pointer; +} +.radio-inline + .radio-inline, +.checkbox-inline + .checkbox-inline { + margin-top: 0; + margin-left: 10px; +} +input[type="radio"][disabled], +input[type="checkbox"][disabled], +input[type="radio"].disabled, +input[type="checkbox"].disabled, +fieldset[disabled] input[type="radio"], +fieldset[disabled] input[type="checkbox"] { + cursor: not-allowed; +} +.radio-inline.disabled, +.checkbox-inline.disabled, +fieldset[disabled] .radio-inline, +fieldset[disabled] .checkbox-inline { + cursor: not-allowed; +} +.radio.disabled label, +.checkbox.disabled label, +fieldset[disabled] .radio label, +fieldset[disabled] .checkbox label { + cursor: not-allowed; +} +.form-control-static { + padding-top: 9px; + padding-bottom: 9px; + margin-bottom: 0; + min-height: 36px; +} +.form-control-static.input-lg, +.form-control-static.input-sm { + padding-left: 0; + padding-right: 0; +} +.input-sm { + height: 36px; + padding: 8px 12px; + font-size: 12px; + line-height: 1.5; + border-radius: 0; +} +select.input-sm { + height: 36px; + line-height: 36px; +} +textarea.input-sm, +select[multiple].input-sm { + height: auto; +} +.form-group-sm .form-control { + height: 36px; + padding: 8px 12px; + font-size: 12px; + line-height: 1.5; + border-radius: 0; +} +.form-group-sm select.form-control { + height: 36px; + line-height: 36px; +} +.form-group-sm textarea.form-control, +.form-group-sm select[multiple].form-control { + height: auto; +} +.form-group-sm .form-control-static { + height: 36px; + min-height: 33px; + padding: 9px 12px; + font-size: 12px; + line-height: 1.5; +} +.input-lg { + height: 60px; + padding: 16px 20px; + font-size: 19px; + line-height: 1.3333333; + border-radius: 0; +} +select.input-lg { + height: 60px; + line-height: 60px; +} +textarea.input-lg, +select[multiple].input-lg { + height: auto; +} +.form-group-lg .form-control { + height: 60px; + padding: 16px 20px; + font-size: 19px; + line-height: 1.3333333; + border-radius: 0; +} +.form-group-lg select.form-control { + height: 60px; + line-height: 60px; +} +.form-group-lg textarea.form-control, +.form-group-lg select[multiple].form-control { + height: auto; +} +.form-group-lg .form-control-static { + height: 60px; + min-height: 40px; + padding: 17px 20px; + font-size: 19px; + line-height: 1.3333333; +} +.has-feedback { + position: relative; +} +.has-feedback .form-control { + padding-right: 48.75px; +} +.form-control-feedback { + position: absolute; + top: 0; + right: 0; + z-index: 2; + display: block; + width: 39px; + height: 39px; + line-height: 39px; + text-align: center; + pointer-events: none; +} +.input-lg + .form-control-feedback, +.input-group-lg + .form-control-feedback, +.form-group-lg .form-control + .form-control-feedback { + width: 60px; + height: 60px; + line-height: 60px; +} +.input-sm + .form-control-feedback, +.input-group-sm + .form-control-feedback, +.form-group-sm .form-control + .form-control-feedback { + width: 36px; + height: 36px; + line-height: 36px; +} +.has-success .help-block, +.has-success .control-label, +.has-success .radio, +.has-success .checkbox, +.has-success .radio-inline, +.has-success .checkbox-inline, +.has-success.radio label, +.has-success.checkbox label, +.has-success.radio-inline label, +.has-success.checkbox-inline label { + color: #43ac6a; +} +.has-success .form-control { + border-color: #43ac6a; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-success .form-control:focus { + border-color: #358753; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #85d0a1; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #85d0a1; +} +.has-success .input-group-addon { + color: #43ac6a; + border-color: #43ac6a; + background-color: #dff0d8; +} +.has-success .form-control-feedback { + color: #43ac6a; +} +.has-warning .help-block, +.has-warning .control-label, +.has-warning .radio, +.has-warning .checkbox, +.has-warning .radio-inline, +.has-warning .checkbox-inline, +.has-warning.radio label, +.has-warning.checkbox label, +.has-warning.radio-inline label, +.has-warning.checkbox-inline label { + color: #e99002; +} +.has-warning .form-control { + border-color: #e99002; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-warning .form-control:focus { + border-color: #b67102; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #febc53; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #febc53; +} +.has-warning .input-group-addon { + color: #e99002; + border-color: #e99002; + background-color: #fcf8e3; +} +.has-warning .form-control-feedback { + color: #e99002; +} +.has-error .help-block, +.has-error .control-label, +.has-error .radio, +.has-error .checkbox, +.has-error .radio-inline, +.has-error .checkbox-inline, +.has-error.radio label, +.has-error.checkbox label, +.has-error.radio-inline label, +.has-error.checkbox-inline label { + color: #f04124; +} +.has-error .form-control { + border-color: #f04124; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-error .form-control:focus { + border-color: #d32a0e; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f79483; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f79483; +} +.has-error .input-group-addon { + color: #f04124; + border-color: #f04124; + background-color: #f2dede; +} +.has-error .form-control-feedback { + color: #f04124; +} +.has-feedback label ~ .form-control-feedback { + top: 26px; +} +.has-feedback label.sr-only ~ .form-control-feedback { + top: 0; +} +.help-block { + display: block; + margin-top: 5px; + margin-bottom: 10px; + color: #626262; +} +@media (min-width: 768px) { + .form-inline .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .form-inline .form-control-static { + display: inline-block; + } + .form-inline .input-group { + display: inline-table; + vertical-align: middle; + } + .form-inline .input-group .input-group-addon, + .form-inline .input-group .input-group-btn, + .form-inline .input-group .form-control { + width: auto; + } + .form-inline .input-group > .form-control { + width: 100%; + } + .form-inline .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio, + .form-inline .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio label, + .form-inline .checkbox label { + padding-left: 0; + } + .form-inline .radio input[type="radio"], + .form-inline .checkbox input[type="checkbox"] { + position: relative; + margin-left: 0; + } + .form-inline .has-feedback .form-control-feedback { + top: 0; + } +} +.form-horizontal .radio, +.form-horizontal .checkbox, +.form-horizontal .radio-inline, +.form-horizontal .checkbox-inline { + margin-top: 0; + margin-bottom: 0; + padding-top: 9px; +} +.form-horizontal .radio, +.form-horizontal .checkbox { + min-height: 30px; +} +.form-horizontal .form-group { + margin-left: -15px; + margin-right: -15px; +} +@media (min-width: 768px) { + .form-horizontal .control-label { + text-align: right; + margin-bottom: 0; + padding-top: 9px; + } +} +.form-horizontal .has-feedback .form-control-feedback { + right: 15px; +} +@media (min-width: 768px) { + .form-horizontal .form-group-lg .control-label { + padding-top: 17px; + font-size: 19px; + } +} +@media (min-width: 768px) { + .form-horizontal .form-group-sm .control-label { + padding-top: 9px; + font-size: 12px; + } +} +.btn { + display: inline-block; + margin-bottom: 0; + font-weight: normal; + text-align: center; + vertical-align: middle; + -ms-touch-action: manipulation; + touch-action: manipulation; + cursor: pointer; + background-image: none; + border: 1px solid transparent; + white-space: nowrap; + padding: 8px 12px; + font-size: 15px; + line-height: 1.4; + border-radius: 0; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.btn:focus, +.btn:active:focus, +.btn.active:focus, +.btn.focus, +.btn:active.focus, +.btn.active.focus { + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.btn:hover, +.btn:focus, +.btn.focus { + color: #333333; + text-decoration: none; +} +.btn:active, +.btn.active { + outline: 0; + background-image: none; + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} +.btn.disabled, +.btn[disabled], +fieldset[disabled] .btn { + cursor: not-allowed; + opacity: 0.65; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + box-shadow: none; +} +a.btn.disabled, +fieldset[disabled] a.btn { + pointer-events: none; +} +.btn-default { + color: #333333; + background-color: #e7e7e7; + border-color: #cccccc; +} +.btn-default:focus, +.btn-default.focus { + color: #333333; + background-color: #cecece; + border-color: #8c8c8c; +} +.btn-default:hover { + color: #333333; + background-color: #cecece; + border-color: #adadad; +} +.btn-default:active, +.btn-default.active, +.open > .dropdown-toggle.btn-default { + color: #333333; + background-color: #cecece; + border-color: #adadad; +} +.btn-default:active:hover, +.btn-default.active:hover, +.open > .dropdown-toggle.btn-default:hover, +.btn-default:active:focus, +.btn-default.active:focus, +.open > .dropdown-toggle.btn-default:focus, +.btn-default:active.focus, +.btn-default.active.focus, +.open > .dropdown-toggle.btn-default.focus { + color: #333333; + background-color: #bcbcbc; + border-color: #8c8c8c; +} +.btn-default:active, +.btn-default.active, +.open > .dropdown-toggle.btn-default { + background-image: none; +} +.btn-default.disabled:hover, +.btn-default[disabled]:hover, +fieldset[disabled] .btn-default:hover, +.btn-default.disabled:focus, +.btn-default[disabled]:focus, +fieldset[disabled] .btn-default:focus, +.btn-default.disabled.focus, +.btn-default[disabled].focus, +fieldset[disabled] .btn-default.focus { + background-color: #e7e7e7; + border-color: #cccccc; +} +.btn-default .badge { + color: #e7e7e7; + background-color: #333333; +} +.btn-primary { + color: #ffffff; + background-color: #008cba; + border-color: #0079a1; +} +.btn-primary:focus, +.btn-primary.focus { + color: #ffffff; + background-color: #006687; + border-color: #001921; +} +.btn-primary:hover { + color: #ffffff; + background-color: #006687; + border-color: #004b63; +} +.btn-primary:active, +.btn-primary.active, +.open > .dropdown-toggle.btn-primary { + color: #ffffff; + background-color: #006687; + border-color: #004b63; +} +.btn-primary:active:hover, +.btn-primary.active:hover, +.open > .dropdown-toggle.btn-primary:hover, +.btn-primary:active:focus, +.btn-primary.active:focus, +.open > .dropdown-toggle.btn-primary:focus, +.btn-primary:active.focus, +.btn-primary.active.focus, +.open > .dropdown-toggle.btn-primary.focus { + color: #ffffff; + background-color: #004b63; + border-color: #001921; +} +.btn-primary:active, +.btn-primary.active, +.open > .dropdown-toggle.btn-primary { + background-image: none; +} +.btn-primary.disabled:hover, +.btn-primary[disabled]:hover, +fieldset[disabled] .btn-primary:hover, +.btn-primary.disabled:focus, +.btn-primary[disabled]:focus, +fieldset[disabled] .btn-primary:focus, +.btn-primary.disabled.focus, +.btn-primary[disabled].focus, +fieldset[disabled] .btn-primary.focus { + background-color: #008cba; + border-color: #0079a1; +} +.btn-primary .badge { + color: #008cba; + background-color: #ffffff; +} +.btn-success { + color: #ffffff; + background-color: #43ac6a; + border-color: #3c9a5f; +} +.btn-success:focus, +.btn-success.focus { + color: #ffffff; + background-color: #358753; + border-color: #183e26; +} +.btn-success:hover { + color: #ffffff; + background-color: #358753; + border-color: #2b6e44; +} +.btn-success:active, +.btn-success.active, +.open > .dropdown-toggle.btn-success { + color: #ffffff; + background-color: #358753; + border-color: #2b6e44; +} +.btn-success:active:hover, +.btn-success.active:hover, +.open > .dropdown-toggle.btn-success:hover, +.btn-success:active:focus, +.btn-success.active:focus, +.open > .dropdown-toggle.btn-success:focus, +.btn-success:active.focus, +.btn-success.active.focus, +.open > .dropdown-toggle.btn-success.focus { + color: #ffffff; + background-color: #2b6e44; + border-color: #183e26; +} +.btn-success:active, +.btn-success.active, +.open > .dropdown-toggle.btn-success { + background-image: none; +} +.btn-success.disabled:hover, +.btn-success[disabled]:hover, +fieldset[disabled] .btn-success:hover, +.btn-success.disabled:focus, +.btn-success[disabled]:focus, +fieldset[disabled] .btn-success:focus, +.btn-success.disabled.focus, +.btn-success[disabled].focus, +fieldset[disabled] .btn-success.focus { + background-color: #43ac6a; + border-color: #3c9a5f; +} +.btn-success .badge { + color: #43ac6a; + background-color: #ffffff; +} +.btn-info { + color: #ffffff; + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info:focus, +.btn-info.focus { + color: #ffffff; + background-color: #31b0d5; + border-color: #1b6d85; +} +.btn-info:hover { + color: #ffffff; + background-color: #31b0d5; + border-color: #269abc; +} +.btn-info:active, +.btn-info.active, +.open > .dropdown-toggle.btn-info { + color: #ffffff; + background-color: #31b0d5; + border-color: #269abc; +} +.btn-info:active:hover, +.btn-info.active:hover, +.open > .dropdown-toggle.btn-info:hover, +.btn-info:active:focus, +.btn-info.active:focus, +.open > .dropdown-toggle.btn-info:focus, +.btn-info:active.focus, +.btn-info.active.focus, +.open > .dropdown-toggle.btn-info.focus { + color: #ffffff; + background-color: #269abc; + border-color: #1b6d85; +} +.btn-info:active, +.btn-info.active, +.open > .dropdown-toggle.btn-info { + background-image: none; +} +.btn-info.disabled:hover, +.btn-info[disabled]:hover, +fieldset[disabled] .btn-info:hover, +.btn-info.disabled:focus, +.btn-info[disabled]:focus, +fieldset[disabled] .btn-info:focus, +.btn-info.disabled.focus, +.btn-info[disabled].focus, +fieldset[disabled] .btn-info.focus { + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info .badge { + color: #5bc0de; + background-color: #ffffff; +} +.btn-warning { + color: #ffffff; + background-color: #e99002; + border-color: #d08002; +} +.btn-warning:focus, +.btn-warning.focus { + color: #ffffff; + background-color: #b67102; + border-color: #513201; +} +.btn-warning:hover { + color: #ffffff; + background-color: #b67102; + border-color: #935b01; +} +.btn-warning:active, +.btn-warning.active, +.open > .dropdown-toggle.btn-warning { + color: #ffffff; + background-color: #b67102; + border-color: #935b01; +} +.btn-warning:active:hover, +.btn-warning.active:hover, +.open > .dropdown-toggle.btn-warning:hover, +.btn-warning:active:focus, +.btn-warning.active:focus, +.open > .dropdown-toggle.btn-warning:focus, +.btn-warning:active.focus, +.btn-warning.active.focus, +.open > .dropdown-toggle.btn-warning.focus { + color: #ffffff; + background-color: #935b01; + border-color: #513201; +} +.btn-warning:active, +.btn-warning.active, +.open > .dropdown-toggle.btn-warning { + background-image: none; +} +.btn-warning.disabled:hover, +.btn-warning[disabled]:hover, +fieldset[disabled] .btn-warning:hover, +.btn-warning.disabled:focus, +.btn-warning[disabled]:focus, +fieldset[disabled] .btn-warning:focus, +.btn-warning.disabled.focus, +.btn-warning[disabled].focus, +fieldset[disabled] .btn-warning.focus { + background-color: #e99002; + border-color: #d08002; +} +.btn-warning .badge { + color: #e99002; + background-color: #ffffff; +} +.btn-danger { + color: #ffffff; + background-color: #f04124; + border-color: #ea2f10; +} +.btn-danger:focus, +.btn-danger.focus { + color: #ffffff; + background-color: #d32a0e; + border-color: #731708; +} +.btn-danger:hover { + color: #ffffff; + background-color: #d32a0e; + border-color: #b1240c; +} +.btn-danger:active, +.btn-danger.active, +.open > .dropdown-toggle.btn-danger { + color: #ffffff; + background-color: #d32a0e; + border-color: #b1240c; +} +.btn-danger:active:hover, +.btn-danger.active:hover, +.open > .dropdown-toggle.btn-danger:hover, +.btn-danger:active:focus, +.btn-danger.active:focus, +.open > .dropdown-toggle.btn-danger:focus, +.btn-danger:active.focus, +.btn-danger.active.focus, +.open > .dropdown-toggle.btn-danger.focus { + color: #ffffff; + background-color: #b1240c; + border-color: #731708; +} +.btn-danger:active, +.btn-danger.active, +.open > .dropdown-toggle.btn-danger { + background-image: none; +} +.btn-danger.disabled:hover, +.btn-danger[disabled]:hover, +fieldset[disabled] .btn-danger:hover, +.btn-danger.disabled:focus, +.btn-danger[disabled]:focus, +fieldset[disabled] .btn-danger:focus, +.btn-danger.disabled.focus, +.btn-danger[disabled].focus, +fieldset[disabled] .btn-danger.focus { + background-color: #f04124; + border-color: #ea2f10; +} +.btn-danger .badge { + color: #f04124; + background-color: #ffffff; +} +.btn-link { + color: #008cba; + font-weight: normal; + border-radius: 0; +} +.btn-link, +.btn-link:active, +.btn-link.active, +.btn-link[disabled], +fieldset[disabled] .btn-link { + background-color: transparent; + -webkit-box-shadow: none; + box-shadow: none; +} +.btn-link, +.btn-link:hover, +.btn-link:focus, +.btn-link:active { + border-color: transparent; +} +.btn-link:hover, +.btn-link:focus { + color: #008cba; + text-decoration: underline; + background-color: transparent; +} +.btn-link[disabled]:hover, +fieldset[disabled] .btn-link:hover, +.btn-link[disabled]:focus, +fieldset[disabled] .btn-link:focus { + color: #999999; + text-decoration: none; +} +.btn-lg, +.btn-group-lg > .btn { + padding: 16px 20px; + font-size: 19px; + line-height: 1.3333333; + border-radius: 0; +} +.btn-sm, +.btn-group-sm > .btn { + padding: 8px 12px; + font-size: 12px; + line-height: 1.5; + border-radius: 0; +} +.btn-xs, +.btn-group-xs > .btn { + padding: 4px 6px; + font-size: 12px; + line-height: 1.5; + border-radius: 0; +} +.btn-block { + display: block; + width: 100%; +} +.btn-block + .btn-block { + margin-top: 5px; +} +input[type="submit"].btn-block, +input[type="reset"].btn-block, +input[type="button"].btn-block { + width: 100%; +} +.fade { + opacity: 0; + -webkit-transition: opacity 0.15s linear; + -o-transition: opacity 0.15s linear; + transition: opacity 0.15s linear; +} +.fade.in { + opacity: 1; +} +.collapse { + display: none; +} +.collapse.in { + display: block; +} +tr.collapse.in { + display: table-row; +} +tbody.collapse.in { + display: table-row-group; +} +.collapsing { + position: relative; + height: 0; + overflow: hidden; + -webkit-transition-property: height, visibility; + -o-transition-property: height, visibility; + transition-property: height, visibility; + -webkit-transition-duration: 0.35s; + -o-transition-duration: 0.35s; + transition-duration: 0.35s; + -webkit-transition-timing-function: ease; + -o-transition-timing-function: ease; + transition-timing-function: ease; +} +.caret { + display: inline-block; + width: 0; + height: 0; + margin-left: 2px; + vertical-align: middle; + border-top: 4px dashed; + border-top: 4px solid \9; + border-right: 4px solid transparent; + border-left: 4px solid transparent; +} +.dropup, +.dropdown { + position: relative; +} +.dropdown-toggle:focus { + outline: 0; +} +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + list-style: none; + font-size: 15px; + text-align: left; + background-color: #ffffff; + border: 1px solid #cccccc; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 0; + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); + box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); + -webkit-background-clip: padding-box; + background-clip: padding-box; +} +.dropdown-menu.pull-right { + right: 0; + left: auto; +} +.dropdown-menu .divider { + height: 1px; + margin: 9.5px 0; + overflow: hidden; + background-color: rgba(0, 0, 0, 0.2); +} +.dropdown-menu > li > a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 1.4; + color: #555555; + white-space: nowrap; +} +.dropdown-menu > li > a:hover, +.dropdown-menu > li > a:focus { + text-decoration: none; + color: #262626; + background-color: #eeeeee; +} +.dropdown-menu > .active > a, +.dropdown-menu > .active > a:hover, +.dropdown-menu > .active > a:focus { + color: #ffffff; + text-decoration: none; + outline: 0; + background-color: #008cba; +} +.dropdown-menu > .disabled > a, +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + color: #999999; +} +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + text-decoration: none; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + cursor: not-allowed; +} +.open > .dropdown-menu { + display: block; +} +.open > a { + outline: 0; +} +.dropdown-menu-right { + left: auto; + right: 0; +} +.dropdown-menu-left { + left: 0; + right: auto; +} +.dropdown-header { + display: block; + padding: 3px 20px; + font-size: 12px; + line-height: 1.4; + color: #999999; + white-space: nowrap; +} +.dropdown-backdrop { + position: fixed; + left: 0; + right: 0; + bottom: 0; + top: 0; + z-index: 990; +} +.pull-right > .dropdown-menu { + right: 0; + left: auto; +} +.dropup .caret, +.navbar-fixed-bottom .dropdown .caret { + border-top: 0; + border-bottom: 4px dashed; + border-bottom: 4px solid \9; + content: ""; +} +.dropup .dropdown-menu, +.navbar-fixed-bottom .dropdown .dropdown-menu { + top: auto; + bottom: 100%; + margin-bottom: 2px; +} +@media (min-width: 768px) { + .navbar-right .dropdown-menu { + left: auto; + right: 0; + } + .navbar-right .dropdown-menu-left { + left: 0; + right: auto; + } +} +.btn-group, +.btn-group-vertical { + position: relative; + display: inline-block; + vertical-align: middle; +} +.btn-group > .btn, +.btn-group-vertical > .btn { + position: relative; + float: left; +} +.btn-group > .btn:hover, +.btn-group-vertical > .btn:hover, +.btn-group > .btn:focus, +.btn-group-vertical > .btn:focus, +.btn-group > .btn:active, +.btn-group-vertical > .btn:active, +.btn-group > .btn.active, +.btn-group-vertical > .btn.active { + z-index: 2; +} +.btn-group .btn + .btn, +.btn-group .btn + .btn-group, +.btn-group .btn-group + .btn, +.btn-group .btn-group + .btn-group { + margin-left: -1px; +} +.btn-toolbar { + margin-left: -5px; +} +.btn-toolbar .btn, +.btn-toolbar .btn-group, +.btn-toolbar .input-group { + float: left; +} +.btn-toolbar > .btn, +.btn-toolbar > .btn-group, +.btn-toolbar > .input-group { + margin-left: 5px; +} +.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { + border-radius: 0; +} +.btn-group > .btn:first-child { + margin-left: 0; +} +.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.btn-group > .btn:last-child:not(:first-child), +.btn-group > .dropdown-toggle:not(:first-child) { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.btn-group > .btn-group { + float: left; +} +.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child, +.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.btn-group .dropdown-toggle:active, +.btn-group.open .dropdown-toggle { + outline: 0; +} +.btn-group > .btn + .dropdown-toggle { + padding-left: 8px; + padding-right: 8px; +} +.btn-group > .btn-lg + .dropdown-toggle { + padding-left: 12px; + padding-right: 12px; +} +.btn-group.open .dropdown-toggle { + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} +.btn-group.open .dropdown-toggle.btn-link { + -webkit-box-shadow: none; + box-shadow: none; +} +.btn .caret { + margin-left: 0; +} +.btn-lg .caret { + border-width: 5px 5px 0; + border-bottom-width: 0; +} +.dropup .btn-lg .caret { + border-width: 0 5px 5px; +} +.btn-group-vertical > .btn, +.btn-group-vertical > .btn-group, +.btn-group-vertical > .btn-group > .btn { + display: block; + float: none; + width: 100%; + max-width: 100%; +} +.btn-group-vertical > .btn-group > .btn { + float: none; +} +.btn-group-vertical > .btn + .btn, +.btn-group-vertical > .btn + .btn-group, +.btn-group-vertical > .btn-group + .btn, +.btn-group-vertical > .btn-group + .btn-group { + margin-top: -1px; + margin-left: 0; +} +.btn-group-vertical > .btn:not(:first-child):not(:last-child) { + border-radius: 0; +} +.btn-group-vertical > .btn:first-child:not(:last-child) { + border-top-right-radius: 0; + border-top-left-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn:last-child:not(:first-child) { + border-top-right-radius: 0; + border-top-left-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.btn-group-justified { + display: table; + width: 100%; + table-layout: fixed; + border-collapse: separate; +} +.btn-group-justified > .btn, +.btn-group-justified > .btn-group { + float: none; + display: table-cell; + width: 1%; +} +.btn-group-justified > .btn-group .btn { + width: 100%; +} +.btn-group-justified > .btn-group .dropdown-menu { + left: auto; +} +[data-toggle="buttons"] > .btn input[type="radio"], +[data-toggle="buttons"] > .btn-group > .btn input[type="radio"], +[data-toggle="buttons"] > .btn input[type="checkbox"], +[data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] { + position: absolute; + clip: rect(0, 0, 0, 0); + pointer-events: none; +} +.input-group { + position: relative; + display: table; + border-collapse: separate; +} +.input-group[class*="col-"] { + float: none; + padding-left: 0; + padding-right: 0; +} +.input-group .form-control { + position: relative; + z-index: 2; + float: left; + width: 100%; + margin-bottom: 0; +} +.input-group .form-control:focus { + z-index: 3; +} +.input-group-lg > .form-control, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .btn { + height: 60px; + padding: 16px 20px; + font-size: 19px; + line-height: 1.3333333; + border-radius: 0; +} +select.input-group-lg > .form-control, +select.input-group-lg > .input-group-addon, +select.input-group-lg > .input-group-btn > .btn { + height: 60px; + line-height: 60px; +} +textarea.input-group-lg > .form-control, +textarea.input-group-lg > .input-group-addon, +textarea.input-group-lg > .input-group-btn > .btn, +select[multiple].input-group-lg > .form-control, +select[multiple].input-group-lg > .input-group-addon, +select[multiple].input-group-lg > .input-group-btn > .btn { + height: auto; +} +.input-group-sm > .form-control, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .btn { + height: 36px; + padding: 8px 12px; + font-size: 12px; + line-height: 1.5; + border-radius: 0; +} +select.input-group-sm > .form-control, +select.input-group-sm > .input-group-addon, +select.input-group-sm > .input-group-btn > .btn { + height: 36px; + line-height: 36px; +} +textarea.input-group-sm > .form-control, +textarea.input-group-sm > .input-group-addon, +textarea.input-group-sm > .input-group-btn > .btn, +select[multiple].input-group-sm > .form-control, +select[multiple].input-group-sm > .input-group-addon, +select[multiple].input-group-sm > .input-group-btn > .btn { + height: auto; +} +.input-group-addon, +.input-group-btn, +.input-group .form-control { + display: table-cell; +} +.input-group-addon:not(:first-child):not(:last-child), +.input-group-btn:not(:first-child):not(:last-child), +.input-group .form-control:not(:first-child):not(:last-child) { + border-radius: 0; +} +.input-group-addon, +.input-group-btn { + width: 1%; + white-space: nowrap; + vertical-align: middle; +} +.input-group-addon { + padding: 8px 12px; + font-size: 15px; + font-weight: normal; + line-height: 1; + color: #6f6f6f; + text-align: center; + background-color: #eeeeee; + border: 1px solid #cccccc; + border-radius: 0; +} +.input-group-addon.input-sm { + padding: 8px 12px; + font-size: 12px; + border-radius: 0; +} +.input-group-addon.input-lg { + padding: 16px 20px; + font-size: 19px; + border-radius: 0; +} +.input-group-addon input[type="radio"], +.input-group-addon input[type="checkbox"] { + margin-top: 0; +} +.input-group .form-control:first-child, +.input-group-addon:first-child, +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group > .btn, +.input-group-btn:first-child > .dropdown-toggle, +.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), +.input-group-btn:last-child > .btn-group:not(:last-child) > .btn { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.input-group-addon:first-child { + border-right: 0; +} +.input-group .form-control:last-child, +.input-group-addon:last-child, +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group > .btn, +.input-group-btn:last-child > .dropdown-toggle, +.input-group-btn:first-child > .btn:not(:first-child), +.input-group-btn:first-child > .btn-group:not(:first-child) > .btn { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.input-group-addon:last-child { + border-left: 0; +} +.input-group-btn { + position: relative; + font-size: 0; + white-space: nowrap; +} +.input-group-btn > .btn { + position: relative; +} +.input-group-btn > .btn + .btn { + margin-left: -1px; +} +.input-group-btn > .btn:hover, +.input-group-btn > .btn:focus, +.input-group-btn > .btn:active { + z-index: 2; +} +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group { + margin-right: -1px; +} +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group { + z-index: 2; + margin-left: -1px; +} +.nav { + margin-bottom: 0; + padding-left: 0; + list-style: none; +} +.nav > li { + position: relative; + display: block; +} +.nav > li > a { + position: relative; + display: block; + padding: 10px 15px; +} +.nav > li > a:hover, +.nav > li > a:focus { + text-decoration: none; + background-color: #eeeeee; +} +.nav > li.disabled > a { + color: #999999; +} +.nav > li.disabled > a:hover, +.nav > li.disabled > a:focus { + color: #999999; + text-decoration: none; + background-color: transparent; + cursor: not-allowed; +} +.nav .open > a, +.nav .open > a:hover, +.nav .open > a:focus { + background-color: #eeeeee; + border-color: #008cba; +} +.nav .nav-divider { + height: 1px; + margin: 9.5px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.nav > li > a > img { + max-width: none; +} +.nav-tabs { + border-bottom: 1px solid #dddddd; +} +.nav-tabs > li { + float: left; + margin-bottom: -1px; +} +.nav-tabs > li > a { + margin-right: 2px; + line-height: 1.4; + border: 1px solid transparent; + border-radius: 0 0 0 0; +} +.nav-tabs > li > a:hover { + border-color: #eeeeee #eeeeee #dddddd; +} +.nav-tabs > li.active > a, +.nav-tabs > li.active > a:hover, +.nav-tabs > li.active > a:focus { + color: #6f6f6f; + background-color: #ffffff; + border: 1px solid #dddddd; + border-bottom-color: transparent; + cursor: default; +} +.nav-tabs.nav-justified { + width: 100%; + border-bottom: 0; +} +.nav-tabs.nav-justified > li { + float: none; +} +.nav-tabs.nav-justified > li > a { + text-align: center; + margin-bottom: 5px; +} +.nav-tabs.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-tabs.nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs.nav-justified > li > a { + margin-right: 0; + border-radius: 0; +} +.nav-tabs.nav-justified > .active > a, +.nav-tabs.nav-justified > .active > a:hover, +.nav-tabs.nav-justified > .active > a:focus { + border: 1px solid #dddddd; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li > a { + border-bottom: 1px solid #dddddd; + border-radius: 0 0 0 0; + } + .nav-tabs.nav-justified > .active > a, + .nav-tabs.nav-justified > .active > a:hover, + .nav-tabs.nav-justified > .active > a:focus { + border-bottom-color: #ffffff; + } +} +.nav-pills > li { + float: left; +} +.nav-pills > li > a { + border-radius: 0; +} +.nav-pills > li + li { + margin-left: 2px; +} +.nav-pills > li.active > a, +.nav-pills > li.active > a:hover, +.nav-pills > li.active > a:focus { + color: #ffffff; + background-color: #008cba; +} +.nav-stacked > li { + float: none; +} +.nav-stacked > li + li { + margin-top: 2px; + margin-left: 0; +} +.nav-justified { + width: 100%; +} +.nav-justified > li { + float: none; +} +.nav-justified > li > a { + text-align: center; + margin-bottom: 5px; +} +.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs-justified { + border-bottom: 0; +} +.nav-tabs-justified > li > a { + margin-right: 0; + border-radius: 0; +} +.nav-tabs-justified > .active > a, +.nav-tabs-justified > .active > a:hover, +.nav-tabs-justified > .active > a:focus { + border: 1px solid #dddddd; +} +@media (min-width: 768px) { + .nav-tabs-justified > li > a { + border-bottom: 1px solid #dddddd; + border-radius: 0 0 0 0; + } + .nav-tabs-justified > .active > a, + .nav-tabs-justified > .active > a:hover, + .nav-tabs-justified > .active > a:focus { + border-bottom-color: #ffffff; + } +} +.tab-content > .tab-pane { + display: none; +} +.tab-content > .active { + display: block; +} +.nav-tabs .dropdown-menu { + margin-top: -1px; + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.navbar { + position: relative; + min-height: 45px; + margin-bottom: 21px; + border: 1px solid transparent; +} +@media (min-width: 768px) { + .navbar { + border-radius: 0; + } +} +@media (min-width: 768px) { + .navbar-header { + float: left; + } +} +.navbar-collapse { + overflow-x: visible; + padding-right: 15px; + padding-left: 15px; + border-top: 1px solid transparent; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); + -webkit-overflow-scrolling: touch; +} +.navbar-collapse.in { + overflow-y: auto; +} +@media (min-width: 768px) { + .navbar-collapse { + width: auto; + border-top: 0; + -webkit-box-shadow: none; + box-shadow: none; + } + .navbar-collapse.collapse { + display: block !important; + height: auto !important; + padding-bottom: 0; + overflow: visible !important; + } + .navbar-collapse.in { + overflow-y: visible; + } + .navbar-fixed-top .navbar-collapse, + .navbar-static-top .navbar-collapse, + .navbar-fixed-bottom .navbar-collapse { + padding-left: 0; + padding-right: 0; + } +} +.navbar-fixed-top .navbar-collapse, +.navbar-fixed-bottom .navbar-collapse { + max-height: 340px; +} +@media (max-device-width: 480px) and (orientation: landscape) { + .navbar-fixed-top .navbar-collapse, + .navbar-fixed-bottom .navbar-collapse { + max-height: 200px; + } +} +.container > .navbar-header, +.container-fluid > .navbar-header, +.container > .navbar-collapse, +.container-fluid > .navbar-collapse { + margin-right: -15px; + margin-left: -15px; +} +@media (min-width: 768px) { + .container > .navbar-header, + .container-fluid > .navbar-header, + .container > .navbar-collapse, + .container-fluid > .navbar-collapse { + margin-right: 0; + margin-left: 0; + } +} +.navbar-static-top { + z-index: 1000; + border-width: 0 0 1px; +} +@media (min-width: 768px) { + .navbar-static-top { + border-radius: 0; + } +} +.navbar-fixed-top, +.navbar-fixed-bottom { + position: fixed; + right: 0; + left: 0; + z-index: 1030; +} +@media (min-width: 768px) { + .navbar-fixed-top, + .navbar-fixed-bottom { + border-radius: 0; + } +} +.navbar-fixed-top { + top: 0; + border-width: 0 0 1px; +} +.navbar-fixed-bottom { + bottom: 0; + margin-bottom: 0; + border-width: 1px 0 0; +} +.navbar-brand { + float: left; + padding: 12px 15px; + font-size: 19px; + line-height: 21px; + height: 45px; +} +.navbar-brand:hover, +.navbar-brand:focus { + text-decoration: none; +} +.navbar-brand > img { + display: block; +} +@media (min-width: 768px) { + .navbar > .container .navbar-brand, + .navbar > .container-fluid .navbar-brand { + margin-left: -15px; + } +} +.navbar-toggle { + position: relative; + float: right; + margin-right: 15px; + padding: 9px 10px; + margin-top: 5.5px; + margin-bottom: 5.5px; + background-color: transparent; + background-image: none; + border: 1px solid transparent; + border-radius: 0; +} +.navbar-toggle:focus { + outline: 0; +} +.navbar-toggle .icon-bar { + display: block; + width: 22px; + height: 2px; + border-radius: 1px; +} +.navbar-toggle .icon-bar + .icon-bar { + margin-top: 4px; +} +@media (min-width: 768px) { + .navbar-toggle { + display: none; + } +} +.navbar-nav { + margin: 6px -15px; +} +.navbar-nav > li > a { + padding-top: 10px; + padding-bottom: 10px; + line-height: 21px; +} +@media (max-width: 767px) { + .navbar-nav .open .dropdown-menu { + position: static; + float: none; + width: auto; + margin-top: 0; + background-color: transparent; + border: 0; + -webkit-box-shadow: none; + box-shadow: none; + } + .navbar-nav .open .dropdown-menu > li > a, + .navbar-nav .open .dropdown-menu .dropdown-header { + padding: 5px 15px 5px 25px; + } + .navbar-nav .open .dropdown-menu > li > a { + line-height: 21px; + } + .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-nav .open .dropdown-menu > li > a:focus { + background-image: none; + } +} +@media (min-width: 768px) { + .navbar-nav { + float: left; + margin: 0; + } + .navbar-nav > li { + float: left; + } + .navbar-nav > li > a { + padding-top: 12px; + padding-bottom: 12px; + } +} +.navbar-form { + margin-left: -15px; + margin-right: -15px; + padding: 10px 15px; + border-top: 1px solid transparent; + border-bottom: 1px solid transparent; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + margin-top: 3px; + margin-bottom: 3px; +} +@media (min-width: 768px) { + .navbar-form .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .navbar-form .form-control-static { + display: inline-block; + } + .navbar-form .input-group { + display: inline-table; + vertical-align: middle; + } + .navbar-form .input-group .input-group-addon, + .navbar-form .input-group .input-group-btn, + .navbar-form .input-group .form-control { + width: auto; + } + .navbar-form .input-group > .form-control { + width: 100%; + } + .navbar-form .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .radio, + .navbar-form .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .radio label, + .navbar-form .checkbox label { + padding-left: 0; + } + .navbar-form .radio input[type="radio"], + .navbar-form .checkbox input[type="checkbox"] { + position: relative; + margin-left: 0; + } + .navbar-form .has-feedback .form-control-feedback { + top: 0; + } +} +@media (max-width: 767px) { + .navbar-form .form-group { + margin-bottom: 5px; + } + .navbar-form .form-group:last-child { + margin-bottom: 0; + } +} +@media (min-width: 768px) { + .navbar-form { + width: auto; + border: 0; + margin-left: 0; + margin-right: 0; + padding-top: 0; + padding-bottom: 0; + -webkit-box-shadow: none; + box-shadow: none; + } +} +.navbar-nav > li > .dropdown-menu { + margin-top: 0; + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { + margin-bottom: 0; + border-top-right-radius: 0; + border-top-left-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.navbar-btn { + margin-top: 3px; + margin-bottom: 3px; +} +.navbar-btn.btn-sm { + margin-top: 4.5px; + margin-bottom: 4.5px; +} +.navbar-btn.btn-xs { + margin-top: 11.5px; + margin-bottom: 11.5px; +} +.navbar-text { + margin-top: 12px; + margin-bottom: 12px; +} +@media (min-width: 768px) { + .navbar-text { + float: left; + margin-left: 15px; + margin-right: 15px; + } +} +@media (min-width: 768px) { + .navbar-left { + float: left !important; + } + .navbar-right { + float: right !important; + margin-right: -15px; + } + .navbar-right ~ .navbar-right { + margin-right: 0; + } +} +.navbar-default { + background-color: #333333; + border-color: #222222; +} +.navbar-default .navbar-brand { + color: #ffffff; +} +.navbar-default .navbar-brand:hover, +.navbar-default .navbar-brand:focus { + color: #ffffff; + background-color: transparent; +} +.navbar-default .navbar-text { + color: #ffffff; +} +.navbar-default .navbar-nav > li > a { + color: #ffffff; +} +.navbar-default .navbar-nav > li > a:hover, +.navbar-default .navbar-nav > li > a:focus { + color: #ffffff; + background-color: #272727; +} +.navbar-default .navbar-nav > .active > a, +.navbar-default .navbar-nav > .active > a:hover, +.navbar-default .navbar-nav > .active > a:focus { + color: #ffffff; + background-color: #272727; +} +.navbar-default .navbar-nav > .disabled > a, +.navbar-default .navbar-nav > .disabled > a:hover, +.navbar-default .navbar-nav > .disabled > a:focus { + color: #cccccc; + background-color: transparent; +} +.navbar-default .navbar-toggle { + border-color: transparent; +} +.navbar-default .navbar-toggle:hover, +.navbar-default .navbar-toggle:focus { + background-color: transparent; +} +.navbar-default .navbar-toggle .icon-bar { + background-color: #ffffff; +} +.navbar-default .navbar-collapse, +.navbar-default .navbar-form { + border-color: #222222; +} +.navbar-default .navbar-nav > .open > a, +.navbar-default .navbar-nav > .open > a:hover, +.navbar-default .navbar-nav > .open > a:focus { + background-color: #272727; + color: #ffffff; +} +@media (max-width: 767px) { + .navbar-default .navbar-nav .open .dropdown-menu > li > a { + color: #ffffff; + } + .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { + color: #ffffff; + background-color: #272727; + } + .navbar-default .navbar-nav .open .dropdown-menu > .active > a, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #ffffff; + background-color: #272727; + } + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #cccccc; + background-color: transparent; + } +} +.navbar-default .navbar-link { + color: #ffffff; +} +.navbar-default .navbar-link:hover { + color: #ffffff; +} +.navbar-default .btn-link { + color: #ffffff; +} +.navbar-default .btn-link:hover, +.navbar-default .btn-link:focus { + color: #ffffff; +} +.navbar-default .btn-link[disabled]:hover, +fieldset[disabled] .navbar-default .btn-link:hover, +.navbar-default .btn-link[disabled]:focus, +fieldset[disabled] .navbar-default .btn-link:focus { + color: #cccccc; +} +.navbar-inverse { + background-color: #008cba; + border-color: #006687; +} +.navbar-inverse .navbar-brand { + color: #ffffff; +} +.navbar-inverse .navbar-brand:hover, +.navbar-inverse .navbar-brand:focus { + color: #ffffff; + background-color: transparent; +} +.navbar-inverse .navbar-text { + color: #ffffff; +} +.navbar-inverse .navbar-nav > li > a { + color: #ffffff; +} +.navbar-inverse .navbar-nav > li > a:hover, +.navbar-inverse .navbar-nav > li > a:focus { + color: #ffffff; + background-color: #006687; +} +.navbar-inverse .navbar-nav > .active > a, +.navbar-inverse .navbar-nav > .active > a:hover, +.navbar-inverse .navbar-nav > .active > a:focus { + color: #ffffff; + background-color: #006687; +} +.navbar-inverse .navbar-nav > .disabled > a, +.navbar-inverse .navbar-nav > .disabled > a:hover, +.navbar-inverse .navbar-nav > .disabled > a:focus { + color: #444444; + background-color: transparent; +} +.navbar-inverse .navbar-toggle { + border-color: transparent; +} +.navbar-inverse .navbar-toggle:hover, +.navbar-inverse .navbar-toggle:focus { + background-color: transparent; +} +.navbar-inverse .navbar-toggle .icon-bar { + background-color: #ffffff; +} +.navbar-inverse .navbar-collapse, +.navbar-inverse .navbar-form { + border-color: #007196; +} +.navbar-inverse .navbar-nav > .open > a, +.navbar-inverse .navbar-nav > .open > a:hover, +.navbar-inverse .navbar-nav > .open > a:focus { + background-color: #006687; + color: #ffffff; +} +@media (max-width: 767px) { + .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { + border-color: #006687; + } + .navbar-inverse .navbar-nav .open .dropdown-menu .divider { + background-color: #006687; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { + color: #ffffff; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { + color: #ffffff; + background-color: #006687; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #ffffff; + background-color: #006687; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #444444; + background-color: transparent; + } +} +.navbar-inverse .navbar-link { + color: #ffffff; +} +.navbar-inverse .navbar-link:hover { + color: #ffffff; +} +.navbar-inverse .btn-link { + color: #ffffff; +} +.navbar-inverse .btn-link:hover, +.navbar-inverse .btn-link:focus { + color: #ffffff; +} +.navbar-inverse .btn-link[disabled]:hover, +fieldset[disabled] .navbar-inverse .btn-link:hover, +.navbar-inverse .btn-link[disabled]:focus, +fieldset[disabled] .navbar-inverse .btn-link:focus { + color: #444444; +} +.breadcrumb { + padding: 8px 15px; + margin-bottom: 21px; + list-style: none; + background-color: #f5f5f5; + border-radius: 0; +} +.breadcrumb > li { + display: inline-block; +} +.breadcrumb > li + li:before { + content: "/\00a0"; + padding: 0 5px; + color: #999999; +} +.breadcrumb > .active { + color: #333333; +} +.pagination { + display: inline-block; + padding-left: 0; + margin: 21px 0; + border-radius: 0; +} +.pagination > li { + display: inline; +} +.pagination > li > a, +.pagination > li > span { + position: relative; + float: left; + padding: 8px 12px; + line-height: 1.4; + text-decoration: none; + color: #008cba; + background-color: transparent; + border: 1px solid transparent; + margin-left: -1px; +} +.pagination > li:first-child > a, +.pagination > li:first-child > span { + margin-left: 0; + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.pagination > li:last-child > a, +.pagination > li:last-child > span { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.pagination > li > a:hover, +.pagination > li > span:hover, +.pagination > li > a:focus, +.pagination > li > span:focus { + z-index: 2; + color: #008cba; + background-color: #eeeeee; + border-color: transparent; +} +.pagination > .active > a, +.pagination > .active > span, +.pagination > .active > a:hover, +.pagination > .active > span:hover, +.pagination > .active > a:focus, +.pagination > .active > span:focus { + z-index: 3; + color: #ffffff; + background-color: #008cba; + border-color: transparent; + cursor: default; +} +.pagination > .disabled > span, +.pagination > .disabled > span:hover, +.pagination > .disabled > span:focus, +.pagination > .disabled > a, +.pagination > .disabled > a:hover, +.pagination > .disabled > a:focus { + color: #999999; + background-color: #ffffff; + border-color: transparent; + cursor: not-allowed; +} +.pagination-lg > li > a, +.pagination-lg > li > span { + padding: 16px 20px; + font-size: 19px; + line-height: 1.3333333; +} +.pagination-lg > li:first-child > a, +.pagination-lg > li:first-child > span { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.pagination-lg > li:last-child > a, +.pagination-lg > li:last-child > span { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.pagination-sm > li > a, +.pagination-sm > li > span { + padding: 8px 12px; + font-size: 12px; + line-height: 1.5; +} +.pagination-sm > li:first-child > a, +.pagination-sm > li:first-child > span { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.pagination-sm > li:last-child > a, +.pagination-sm > li:last-child > span { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.pager { + padding-left: 0; + margin: 21px 0; + list-style: none; + text-align: center; +} +.pager li { + display: inline; +} +.pager li > a, +.pager li > span { + display: inline-block; + padding: 5px 14px; + background-color: transparent; + border: 1px solid transparent; + border-radius: 3px; +} +.pager li > a:hover, +.pager li > a:focus { + text-decoration: none; + background-color: #eeeeee; +} +.pager .next > a, +.pager .next > span { + float: right; +} +.pager .previous > a, +.pager .previous > span { + float: left; +} +.pager .disabled > a, +.pager .disabled > a:hover, +.pager .disabled > a:focus, +.pager .disabled > span { + color: #999999; + background-color: transparent; + cursor: not-allowed; +} +.label { + display: inline; + padding: .2em .6em .3em; + font-size: 75%; + font-weight: bold; + line-height: 1; + color: #ffffff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: .25em; +} +a.label:hover, +a.label:focus { + color: #ffffff; + text-decoration: none; + cursor: pointer; +} +.label:empty { + display: none; +} +.btn .label { + position: relative; + top: -1px; +} +.label-default { + background-color: #999999; +} +.label-default[href]:hover, +.label-default[href]:focus { + background-color: #808080; +} +.label-primary { + background-color: #008cba; +} +.label-primary[href]:hover, +.label-primary[href]:focus { + background-color: #006687; +} +.label-success { + background-color: #43ac6a; +} +.label-success[href]:hover, +.label-success[href]:focus { + background-color: #358753; +} +.label-info { + background-color: #5bc0de; +} +.label-info[href]:hover, +.label-info[href]:focus { + background-color: #31b0d5; +} +.label-warning { + background-color: #e99002; +} +.label-warning[href]:hover, +.label-warning[href]:focus { + background-color: #b67102; +} +.label-danger { + background-color: #f04124; +} +.label-danger[href]:hover, +.label-danger[href]:focus { + background-color: #d32a0e; +} +.badge { + display: inline-block; + min-width: 10px; + padding: 3px 7px; + font-size: 12px; + font-weight: bold; + color: #ffffff; + line-height: 1; + vertical-align: middle; + white-space: nowrap; + text-align: center; + background-color: #008cba; + border-radius: 10px; +} +.badge:empty { + display: none; +} +.btn .badge { + position: relative; + top: -1px; +} +.btn-xs .badge, +.btn-group-xs > .btn .badge { + top: 0; + padding: 1px 5px; +} +a.badge:hover, +a.badge:focus { + color: #ffffff; + text-decoration: none; + cursor: pointer; +} +.list-group-item.active > .badge, +.nav-pills > .active > a > .badge { + color: #008cba; + background-color: #ffffff; +} +.list-group-item > .badge { + float: right; +} +.list-group-item > .badge + .badge { + margin-right: 5px; +} +.nav-pills > li > a > .badge { + margin-left: 3px; +} +.jumbotron { + padding-top: 30px; + padding-bottom: 30px; + margin-bottom: 30px; + color: inherit; + background-color: #fafafa; +} +.jumbotron h1, +.jumbotron .h1 { + color: inherit; +} +.jumbotron p { + margin-bottom: 15px; + font-size: 23px; + font-weight: 200; +} +.jumbotron > hr { + border-top-color: #e1e1e1; +} +.container .jumbotron, +.container-fluid .jumbotron { + border-radius: 0; + padding-left: 15px; + padding-right: 15px; +} +.jumbotron .container { + max-width: 100%; +} +@media screen and (min-width: 768px) { + .jumbotron { + padding-top: 48px; + padding-bottom: 48px; + } + .container .jumbotron, + .container-fluid .jumbotron { + padding-left: 60px; + padding-right: 60px; + } + .jumbotron h1, + .jumbotron .h1 { + font-size: 68px; + } +} +.thumbnail { + display: block; + padding: 4px; + margin-bottom: 21px; + line-height: 1.4; + background-color: #ffffff; + border: 1px solid #dddddd; + border-radius: 0; + -webkit-transition: border 0.2s ease-in-out; + -o-transition: border 0.2s ease-in-out; + transition: border 0.2s ease-in-out; +} +.thumbnail > img, +.thumbnail a > img { + margin-left: auto; + margin-right: auto; +} +a.thumbnail:hover, +a.thumbnail:focus, +a.thumbnail.active { + border-color: #008cba; +} +.thumbnail .caption { + padding: 9px; + color: #222222; +} +.alert { + padding: 15px; + margin-bottom: 21px; + border: 1px solid transparent; + border-radius: 0; +} +.alert h4 { + margin-top: 0; + color: inherit; +} +.alert .alert-link { + font-weight: bold; +} +.alert > p, +.alert > ul { + margin-bottom: 0; +} +.alert > p + p { + margin-top: 5px; +} +.alert-dismissable, +.alert-dismissible { + padding-right: 35px; +} +.alert-dismissable .close, +.alert-dismissible .close { + position: relative; + top: -2px; + right: -21px; + color: inherit; +} +.alert-success { + background-color: #43ac6a; + border-color: #3c9a5f; + color: #ffffff; +} +.alert-success hr { + border-top-color: #358753; +} +.alert-success .alert-link { + color: #e6e6e6; +} +.alert-info { + background-color: #5bc0de; + border-color: #3db5d8; + color: #ffffff; +} +.alert-info hr { + border-top-color: #2aabd2; +} +.alert-info .alert-link { + color: #e6e6e6; +} +.alert-warning { + background-color: #e99002; + border-color: #d08002; + color: #ffffff; +} +.alert-warning hr { + border-top-color: #b67102; +} +.alert-warning .alert-link { + color: #e6e6e6; +} +.alert-danger { + background-color: #f04124; + border-color: #ea2f10; + color: #ffffff; +} +.alert-danger hr { + border-top-color: #d32a0e; +} +.alert-danger .alert-link { + color: #e6e6e6; +} +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@-o-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +.progress { + overflow: hidden; + height: 21px; + margin-bottom: 21px; + background-color: #f5f5f5; + border-radius: 0; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); +} +.progress-bar { + float: left; + width: 0%; + height: 100%; + font-size: 12px; + line-height: 21px; + color: #ffffff; + text-align: center; + background-color: #008cba; + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -webkit-transition: width 0.6s ease; + -o-transition: width 0.6s ease; + transition: width 0.6s ease; +} +.progress-striped .progress-bar, +.progress-bar-striped { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + -webkit-background-size: 40px 40px; + background-size: 40px 40px; +} +.progress.active .progress-bar, +.progress-bar.active { + -webkit-animation: progress-bar-stripes 2s linear infinite; + -o-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; +} +.progress-bar-success { + background-color: #43ac6a; +} +.progress-striped .progress-bar-success { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-info { + background-color: #5bc0de; +} +.progress-striped .progress-bar-info { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-warning { + background-color: #e99002; +} +.progress-striped .progress-bar-warning { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-danger { + background-color: #f04124; +} +.progress-striped .progress-bar-danger { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.media { + margin-top: 15px; +} +.media:first-child { + margin-top: 0; +} +.media, +.media-body { + zoom: 1; + overflow: hidden; +} +.media-body { + width: 10000px; +} +.media-object { + display: block; +} +.media-object.img-thumbnail { + max-width: none; +} +.media-right, +.media > .pull-right { + padding-left: 10px; +} +.media-left, +.media > .pull-left { + padding-right: 10px; +} +.media-left, +.media-right, +.media-body { + display: table-cell; + vertical-align: top; +} +.media-middle { + vertical-align: middle; +} +.media-bottom { + vertical-align: bottom; +} +.media-heading { + margin-top: 0; + margin-bottom: 5px; +} +.media-list { + padding-left: 0; + list-style: none; +} +.list-group { + margin-bottom: 20px; + padding-left: 0; +} +.list-group-item { + position: relative; + display: block; + padding: 10px 15px; + margin-bottom: -1px; + background-color: #ffffff; + border: 1px solid #dddddd; +} +.list-group-item:first-child { + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.list-group-item:last-child { + margin-bottom: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +a.list-group-item, +button.list-group-item { + color: #555555; +} +a.list-group-item .list-group-item-heading, +button.list-group-item .list-group-item-heading { + color: #333333; +} +a.list-group-item:hover, +button.list-group-item:hover, +a.list-group-item:focus, +button.list-group-item:focus { + text-decoration: none; + color: #555555; + background-color: #f5f5f5; +} +button.list-group-item { + width: 100%; + text-align: left; +} +.list-group-item.disabled, +.list-group-item.disabled:hover, +.list-group-item.disabled:focus { + background-color: #eeeeee; + color: #999999; + cursor: not-allowed; +} +.list-group-item.disabled .list-group-item-heading, +.list-group-item.disabled:hover .list-group-item-heading, +.list-group-item.disabled:focus .list-group-item-heading { + color: inherit; +} +.list-group-item.disabled .list-group-item-text, +.list-group-item.disabled:hover .list-group-item-text, +.list-group-item.disabled:focus .list-group-item-text { + color: #999999; +} +.list-group-item.active, +.list-group-item.active:hover, +.list-group-item.active:focus { + z-index: 2; + color: #ffffff; + background-color: #008cba; + border-color: #008cba; +} +.list-group-item.active .list-group-item-heading, +.list-group-item.active:hover .list-group-item-heading, +.list-group-item.active:focus .list-group-item-heading, +.list-group-item.active .list-group-item-heading > small, +.list-group-item.active:hover .list-group-item-heading > small, +.list-group-item.active:focus .list-group-item-heading > small, +.list-group-item.active .list-group-item-heading > .small, +.list-group-item.active:hover .list-group-item-heading > .small, +.list-group-item.active:focus .list-group-item-heading > .small { + color: inherit; +} +.list-group-item.active .list-group-item-text, +.list-group-item.active:hover .list-group-item-text, +.list-group-item.active:focus .list-group-item-text { + color: #87e1ff; +} +.list-group-item-success { + color: #43ac6a; + background-color: #dff0d8; +} +a.list-group-item-success, +button.list-group-item-success { + color: #43ac6a; +} +a.list-group-item-success .list-group-item-heading, +button.list-group-item-success .list-group-item-heading { + color: inherit; +} +a.list-group-item-success:hover, +button.list-group-item-success:hover, +a.list-group-item-success:focus, +button.list-group-item-success:focus { + color: #43ac6a; + background-color: #d0e9c6; +} +a.list-group-item-success.active, +button.list-group-item-success.active, +a.list-group-item-success.active:hover, +button.list-group-item-success.active:hover, +a.list-group-item-success.active:focus, +button.list-group-item-success.active:focus { + color: #fff; + background-color: #43ac6a; + border-color: #43ac6a; +} +.list-group-item-info { + color: #5bc0de; + background-color: #d9edf7; +} +a.list-group-item-info, +button.list-group-item-info { + color: #5bc0de; +} +a.list-group-item-info .list-group-item-heading, +button.list-group-item-info .list-group-item-heading { + color: inherit; +} +a.list-group-item-info:hover, +button.list-group-item-info:hover, +a.list-group-item-info:focus, +button.list-group-item-info:focus { + color: #5bc0de; + background-color: #c4e3f3; +} +a.list-group-item-info.active, +button.list-group-item-info.active, +a.list-group-item-info.active:hover, +button.list-group-item-info.active:hover, +a.list-group-item-info.active:focus, +button.list-group-item-info.active:focus { + color: #fff; + background-color: #5bc0de; + border-color: #5bc0de; +} +.list-group-item-warning { + color: #e99002; + background-color: #fcf8e3; +} +a.list-group-item-warning, +button.list-group-item-warning { + color: #e99002; +} +a.list-group-item-warning .list-group-item-heading, +button.list-group-item-warning .list-group-item-heading { + color: inherit; +} +a.list-group-item-warning:hover, +button.list-group-item-warning:hover, +a.list-group-item-warning:focus, +button.list-group-item-warning:focus { + color: #e99002; + background-color: #faf2cc; +} +a.list-group-item-warning.active, +button.list-group-item-warning.active, +a.list-group-item-warning.active:hover, +button.list-group-item-warning.active:hover, +a.list-group-item-warning.active:focus, +button.list-group-item-warning.active:focus { + color: #fff; + background-color: #e99002; + border-color: #e99002; +} +.list-group-item-danger { + color: #f04124; + background-color: #f2dede; +} +a.list-group-item-danger, +button.list-group-item-danger { + color: #f04124; +} +a.list-group-item-danger .list-group-item-heading, +button.list-group-item-danger .list-group-item-heading { + color: inherit; +} +a.list-group-item-danger:hover, +button.list-group-item-danger:hover, +a.list-group-item-danger:focus, +button.list-group-item-danger:focus { + color: #f04124; + background-color: #ebcccc; +} +a.list-group-item-danger.active, +button.list-group-item-danger.active, +a.list-group-item-danger.active:hover, +button.list-group-item-danger.active:hover, +a.list-group-item-danger.active:focus, +button.list-group-item-danger.active:focus { + color: #fff; + background-color: #f04124; + border-color: #f04124; +} +.list-group-item-heading { + margin-top: 0; + margin-bottom: 5px; +} +.list-group-item-text { + margin-bottom: 0; + line-height: 1.3; +} +.panel { + margin-bottom: 21px; + background-color: #ffffff; + border: 1px solid transparent; + border-radius: 0; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); +} +.panel-body { + padding: 15px; +} +.panel-heading { + padding: 10px 15px; + border-bottom: 1px solid transparent; + border-top-right-radius: -1; + border-top-left-radius: -1; +} +.panel-heading > .dropdown .dropdown-toggle { + color: inherit; +} +.panel-title { + margin-top: 0; + margin-bottom: 0; + font-size: 17px; + color: inherit; +} +.panel-title > a, +.panel-title > small, +.panel-title > .small, +.panel-title > small > a, +.panel-title > .small > a { + color: inherit; +} +.panel-footer { + padding: 10px 15px; + background-color: #f5f5f5; + border-top: 1px solid #dddddd; + border-bottom-right-radius: -1; + border-bottom-left-radius: -1; +} +.panel > .list-group, +.panel > .panel-collapse > .list-group { + margin-bottom: 0; +} +.panel > .list-group .list-group-item, +.panel > .panel-collapse > .list-group .list-group-item { + border-width: 1px 0; + border-radius: 0; +} +.panel > .list-group:first-child .list-group-item:first-child, +.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child { + border-top: 0; + border-top-right-radius: -1; + border-top-left-radius: -1; +} +.panel > .list-group:last-child .list-group-item:last-child, +.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child { + border-bottom: 0; + border-bottom-right-radius: -1; + border-bottom-left-radius: -1; +} +.panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child { + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.panel-heading + .list-group .list-group-item:first-child { + border-top-width: 0; +} +.list-group + .panel-footer { + border-top-width: 0; +} +.panel > .table, +.panel > .table-responsive > .table, +.panel > .panel-collapse > .table { + margin-bottom: 0; +} +.panel > .table caption, +.panel > .table-responsive > .table caption, +.panel > .panel-collapse > .table caption { + padding-left: 15px; + padding-right: 15px; +} +.panel > .table:first-child, +.panel > .table-responsive:first-child > .table:first-child { + border-top-right-radius: -1; + border-top-left-radius: -1; +} +.panel > .table:first-child > thead:first-child > tr:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child { + border-top-left-radius: -1; + border-top-right-radius: -1; +} +.panel > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child { + border-top-left-radius: -1; +} +.panel > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child { + border-top-right-radius: -1; +} +.panel > .table:last-child, +.panel > .table-responsive:last-child > .table:last-child { + border-bottom-right-radius: -1; + border-bottom-left-radius: -1; +} +.panel > .table:last-child > tbody:last-child > tr:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child { + border-bottom-left-radius: -1; + border-bottom-right-radius: -1; +} +.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child { + border-bottom-left-radius: -1; +} +.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child { + border-bottom-right-radius: -1; +} +.panel > .panel-body + .table, +.panel > .panel-body + .table-responsive, +.panel > .table + .panel-body, +.panel > .table-responsive + .panel-body { + border-top: 1px solid #dddddd; +} +.panel > .table > tbody:first-child > tr:first-child th, +.panel > .table > tbody:first-child > tr:first-child td { + border-top: 0; +} +.panel > .table-bordered, +.panel > .table-responsive > .table-bordered { + border: 0; +} +.panel > .table-bordered > thead > tr > th:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:first-child, +.panel > .table-bordered > tbody > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, +.panel > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-bordered > thead > tr > td:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:first-child, +.panel > .table-bordered > tbody > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, +.panel > .table-bordered > tfoot > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; +} +.panel > .table-bordered > thead > tr > th:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:last-child, +.panel > .table-bordered > tbody > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, +.panel > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-bordered > thead > tr > td:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:last-child, +.panel > .table-bordered > tbody > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, +.panel > .table-bordered > tfoot > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; +} +.panel > .table-bordered > thead > tr:first-child > td, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > td, +.panel > .table-bordered > tbody > tr:first-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, +.panel > .table-bordered > thead > tr:first-child > th, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > th, +.panel > .table-bordered > tbody > tr:first-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { + border-bottom: 0; +} +.panel > .table-bordered > tbody > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, +.panel > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-bordered > tbody > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, +.panel > .table-bordered > tfoot > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { + border-bottom: 0; +} +.panel > .table-responsive { + border: 0; + margin-bottom: 0; +} +.panel-group { + margin-bottom: 21px; +} +.panel-group .panel { + margin-bottom: 0; + border-radius: 0; +} +.panel-group .panel + .panel { + margin-top: 5px; +} +.panel-group .panel-heading { + border-bottom: 0; +} +.panel-group .panel-heading + .panel-collapse > .panel-body, +.panel-group .panel-heading + .panel-collapse > .list-group { + border-top: 1px solid #dddddd; +} +.panel-group .panel-footer { + border-top: 0; +} +.panel-group .panel-footer + .panel-collapse .panel-body { + border-bottom: 1px solid #dddddd; +} +.panel-default { + border-color: #dddddd; +} +.panel-default > .panel-heading { + color: #333333; + background-color: #f5f5f5; + border-color: #dddddd; +} +.panel-default > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #dddddd; +} +.panel-default > .panel-heading .badge { + color: #f5f5f5; + background-color: #333333; +} +.panel-default > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #dddddd; +} +.panel-primary { + border-color: #008cba; +} +.panel-primary > .panel-heading { + color: #ffffff; + background-color: #008cba; + border-color: #008cba; +} +.panel-primary > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #008cba; +} +.panel-primary > .panel-heading .badge { + color: #008cba; + background-color: #ffffff; +} +.panel-primary > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #008cba; +} +.panel-success { + border-color: #3c9a5f; +} +.panel-success > .panel-heading { + color: #ffffff; + background-color: #43ac6a; + border-color: #3c9a5f; +} +.panel-success > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #3c9a5f; +} +.panel-success > .panel-heading .badge { + color: #43ac6a; + background-color: #ffffff; +} +.panel-success > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #3c9a5f; +} +.panel-info { + border-color: #3db5d8; +} +.panel-info > .panel-heading { + color: #ffffff; + background-color: #5bc0de; + border-color: #3db5d8; +} +.panel-info > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #3db5d8; +} +.panel-info > .panel-heading .badge { + color: #5bc0de; + background-color: #ffffff; +} +.panel-info > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #3db5d8; +} +.panel-warning { + border-color: #d08002; +} +.panel-warning > .panel-heading { + color: #ffffff; + background-color: #e99002; + border-color: #d08002; +} +.panel-warning > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #d08002; +} +.panel-warning > .panel-heading .badge { + color: #e99002; + background-color: #ffffff; +} +.panel-warning > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #d08002; +} +.panel-danger { + border-color: #ea2f10; +} +.panel-danger > .panel-heading { + color: #ffffff; + background-color: #f04124; + border-color: #ea2f10; +} +.panel-danger > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #ea2f10; +} +.panel-danger > .panel-heading .badge { + color: #f04124; + background-color: #ffffff; +} +.panel-danger > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #ea2f10; +} +.embed-responsive { + position: relative; + display: block; + height: 0; + padding: 0; + overflow: hidden; +} +.embed-responsive .embed-responsive-item, +.embed-responsive iframe, +.embed-responsive embed, +.embed-responsive object, +.embed-responsive video { + position: absolute; + top: 0; + left: 0; + bottom: 0; + height: 100%; + width: 100%; + border: 0; +} +.embed-responsive-16by9 { + padding-bottom: 56.25%; +} +.embed-responsive-4by3 { + padding-bottom: 75%; +} +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #fafafa; + border: 1px solid #e8e8e8; + border-radius: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); +} +.well blockquote { + border-color: #ddd; + border-color: rgba(0, 0, 0, 0.15); +} +.well-lg { + padding: 24px; + border-radius: 0; +} +.well-sm { + padding: 9px; + border-radius: 0; +} +.close { + float: right; + font-size: 22.5px; + font-weight: bold; + line-height: 1; + color: #ffffff; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.2; + filter: alpha(opacity=20); +} +.close:hover, +.close:focus { + color: #ffffff; + text-decoration: none; + cursor: pointer; + opacity: 0.5; + filter: alpha(opacity=50); +} +button.close { + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; +} +.modal-open { + overflow: hidden; +} +.modal { + display: none; + overflow: hidden; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1050; + -webkit-overflow-scrolling: touch; + outline: 0; +} +.modal.fade .modal-dialog { + -webkit-transform: translate(0, -25%); + -ms-transform: translate(0, -25%); + -o-transform: translate(0, -25%); + transform: translate(0, -25%); + -webkit-transition: -webkit-transform 0.3s ease-out; + -o-transition: -o-transform 0.3s ease-out; + transition: transform 0.3s ease-out; +} +.modal.in .modal-dialog { + -webkit-transform: translate(0, 0); + -ms-transform: translate(0, 0); + -o-transform: translate(0, 0); + transform: translate(0, 0); +} +.modal-open .modal { + overflow-x: hidden; + overflow-y: auto; +} +.modal-dialog { + position: relative; + width: auto; + margin: 10px; +} +.modal-content { + position: relative; + background-color: #ffffff; + border: 1px solid #999999; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 0; + -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + -webkit-background-clip: padding-box; + background-clip: padding-box; + outline: 0; +} +.modal-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + background-color: #000000; +} +.modal-backdrop.fade { + opacity: 0; + filter: alpha(opacity=0); +} +.modal-backdrop.in { + opacity: 0.5; + filter: alpha(opacity=50); +} +.modal-header { + padding: 15px; + border-bottom: 1px solid #e5e5e5; +} +.modal-header .close { + margin-top: -2px; +} +.modal-title { + margin: 0; + line-height: 1.4; +} +.modal-body { + position: relative; + padding: 20px; +} +.modal-footer { + padding: 20px; + text-align: right; + border-top: 1px solid #e5e5e5; +} +.modal-footer .btn + .btn { + margin-left: 5px; + margin-bottom: 0; +} +.modal-footer .btn-group .btn + .btn { + margin-left: -1px; +} +.modal-footer .btn-block + .btn-block { + margin-left: 0; +} +.modal-scrollbar-measure { + position: absolute; + top: -9999px; + width: 50px; + height: 50px; + overflow: scroll; +} +@media (min-width: 768px) { + .modal-dialog { + width: 600px; + margin: 30px auto; + } + .modal-content { + -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); + box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); + } + .modal-sm { + width: 300px; + } +} +@media (min-width: 992px) { + .modal-lg { + width: 900px; + } +} +.tooltip { + position: absolute; + z-index: 1070; + display: block; + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-style: normal; + font-weight: normal; + letter-spacing: normal; + line-break: auto; + line-height: 1.4; + text-align: left; + text-align: start; + text-decoration: none; + text-shadow: none; + text-transform: none; + white-space: normal; + word-break: normal; + word-spacing: normal; + word-wrap: normal; + font-size: 12px; + opacity: 0; + filter: alpha(opacity=0); +} +.tooltip.in { + opacity: 0.9; + filter: alpha(opacity=90); +} +.tooltip.top { + margin-top: -3px; + padding: 5px 0; +} +.tooltip.right { + margin-left: 3px; + padding: 0 5px; +} +.tooltip.bottom { + margin-top: 3px; + padding: 5px 0; +} +.tooltip.left { + margin-left: -3px; + padding: 0 5px; +} +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #ffffff; + text-align: center; + background-color: #333333; + border-radius: 0; +} +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-width: 5px 5px 0; + border-top-color: #333333; +} +.tooltip.top-left .tooltip-arrow { + bottom: 0; + right: 5px; + margin-bottom: -5px; + border-width: 5px 5px 0; + border-top-color: #333333; +} +.tooltip.top-right .tooltip-arrow { + bottom: 0; + left: 5px; + margin-bottom: -5px; + border-width: 5px 5px 0; + border-top-color: #333333; +} +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-width: 5px 5px 5px 0; + border-right-color: #333333; +} +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-width: 5px 0 5px 5px; + border-left-color: #333333; +} +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-width: 0 5px 5px; + border-bottom-color: #333333; +} +.tooltip.bottom-left .tooltip-arrow { + top: 0; + right: 5px; + margin-top: -5px; + border-width: 0 5px 5px; + border-bottom-color: #333333; +} +.tooltip.bottom-right .tooltip-arrow { + top: 0; + left: 5px; + margin-top: -5px; + border-width: 0 5px 5px; + border-bottom-color: #333333; +} +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1060; + display: none; + max-width: 276px; + padding: 1px; + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-style: normal; + font-weight: normal; + letter-spacing: normal; + line-break: auto; + line-height: 1.4; + text-align: left; + text-align: start; + text-decoration: none; + text-shadow: none; + text-transform: none; + white-space: normal; + word-break: normal; + word-spacing: normal; + word-wrap: normal; + font-size: 15px; + background-color: #333333; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #333333; + border: 1px solid transparent; + border-radius: 0; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); +} +.popover.top { + margin-top: -10px; +} +.popover.right { + margin-left: 10px; +} +.popover.bottom { + margin-top: 10px; +} +.popover.left { + margin-left: -10px; +} +.popover-title { + margin: 0; + padding: 8px 14px; + font-size: 15px; + background-color: #333333; + border-bottom: 1px solid #262626; + border-radius: -1 -1 0 0; +} +.popover-content { + padding: 9px 14px; +} +.popover > .arrow, +.popover > .arrow:after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.popover > .arrow { + border-width: 11px; +} +.popover > .arrow:after { + border-width: 10px; + content: ""; +} +.popover.top > .arrow { + left: 50%; + margin-left: -11px; + border-bottom-width: 0; + border-top-color: #000000; + border-top-color: rgba(0, 0, 0, 0.05); + bottom: -11px; +} +.popover.top > .arrow:after { + content: " "; + bottom: 1px; + margin-left: -10px; + border-bottom-width: 0; + border-top-color: #333333; +} +.popover.right > .arrow { + top: 50%; + left: -11px; + margin-top: -11px; + border-left-width: 0; + border-right-color: #000000; + border-right-color: rgba(0, 0, 0, 0.05); +} +.popover.right > .arrow:after { + content: " "; + left: 1px; + bottom: -10px; + border-left-width: 0; + border-right-color: #333333; +} +.popover.bottom > .arrow { + left: 50%; + margin-left: -11px; + border-top-width: 0; + border-bottom-color: #000000; + border-bottom-color: rgba(0, 0, 0, 0.05); + top: -11px; +} +.popover.bottom > .arrow:after { + content: " "; + top: 1px; + margin-left: -10px; + border-top-width: 0; + border-bottom-color: #333333; +} +.popover.left > .arrow { + top: 50%; + right: -11px; + margin-top: -11px; + border-right-width: 0; + border-left-color: #000000; + border-left-color: rgba(0, 0, 0, 0.05); +} +.popover.left > .arrow:after { + content: " "; + right: 1px; + border-right-width: 0; + border-left-color: #333333; + bottom: -10px; +} +.carousel { + position: relative; +} +.carousel-inner { + position: relative; + overflow: hidden; + width: 100%; +} +.carousel-inner > .item { + display: none; + position: relative; + -webkit-transition: 0.6s ease-in-out left; + -o-transition: 0.6s ease-in-out left; + transition: 0.6s ease-in-out left; +} +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + line-height: 1; +} +@media all and (transform-3d), (-webkit-transform-3d) { + .carousel-inner > .item { + -webkit-transition: -webkit-transform 0.6s ease-in-out; + -o-transition: -o-transform 0.6s ease-in-out; + transition: transform 0.6s ease-in-out; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-perspective: 1000px; + perspective: 1000px; + } + .carousel-inner > .item.next, + .carousel-inner > .item.active.right { + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + left: 0; + } + .carousel-inner > .item.prev, + .carousel-inner > .item.active.left { + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + left: 0; + } + .carousel-inner > .item.next.left, + .carousel-inner > .item.prev.right, + .carousel-inner > .item.active { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + left: 0; + } +} +.carousel-inner > .active, +.carousel-inner > .next, +.carousel-inner > .prev { + display: block; +} +.carousel-inner > .active { + left: 0; +} +.carousel-inner > .next, +.carousel-inner > .prev { + position: absolute; + top: 0; + width: 100%; +} +.carousel-inner > .next { + left: 100%; +} +.carousel-inner > .prev { + left: -100%; +} +.carousel-inner > .next.left, +.carousel-inner > .prev.right { + left: 0; +} +.carousel-inner > .active.left { + left: -100%; +} +.carousel-inner > .active.right { + left: 100%; +} +.carousel-control { + position: absolute; + top: 0; + left: 0; + bottom: 0; + width: 15%; + opacity: 0.5; + filter: alpha(opacity=50); + font-size: 20px; + color: #ffffff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); + background-color: rgba(0, 0, 0, 0); +} +.carousel-control.left { + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); + background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); + background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0.0001))); + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); +} +.carousel-control.right { + left: auto; + right: 0; + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); + background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); + background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.0001)), to(rgba(0, 0, 0, 0.5))); + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); +} +.carousel-control:hover, +.carousel-control:focus { + outline: 0; + color: #ffffff; + text-decoration: none; + opacity: 0.9; + filter: alpha(opacity=90); +} +.carousel-control .icon-prev, +.carousel-control .icon-next, +.carousel-control .glyphicon-chevron-left, +.carousel-control .glyphicon-chevron-right { + position: absolute; + top: 50%; + margin-top: -10px; + z-index: 5; + display: inline-block; +} +.carousel-control .icon-prev, +.carousel-control .glyphicon-chevron-left { + left: 50%; + margin-left: -10px; +} +.carousel-control .icon-next, +.carousel-control .glyphicon-chevron-right { + right: 50%; + margin-right: -10px; +} +.carousel-control .icon-prev, +.carousel-control .icon-next { + width: 20px; + height: 20px; + line-height: 1; + font-family: serif; +} +.carousel-control .icon-prev:before { + content: '\2039'; +} +.carousel-control .icon-next:before { + content: '\203a'; +} +.carousel-indicators { + position: absolute; + bottom: 10px; + left: 50%; + z-index: 15; + width: 60%; + margin-left: -30%; + padding-left: 0; + list-style: none; + text-align: center; +} +.carousel-indicators li { + display: inline-block; + width: 10px; + height: 10px; + margin: 1px; + text-indent: -999px; + border: 1px solid #ffffff; + border-radius: 10px; + cursor: pointer; + background-color: #000 \9; + background-color: rgba(0, 0, 0, 0); +} +.carousel-indicators .active { + margin: 0; + width: 12px; + height: 12px; + background-color: #ffffff; +} +.carousel-caption { + position: absolute; + left: 15%; + right: 15%; + bottom: 20px; + z-index: 10; + padding-top: 20px; + padding-bottom: 20px; + color: #ffffff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); +} +.carousel-caption .btn { + text-shadow: none; +} +@media screen and (min-width: 768px) { + .carousel-control .glyphicon-chevron-left, + .carousel-control .glyphicon-chevron-right, + .carousel-control .icon-prev, + .carousel-control .icon-next { + width: 30px; + height: 30px; + margin-top: -10px; + font-size: 30px; + } + .carousel-control .glyphicon-chevron-left, + .carousel-control .icon-prev { + margin-left: -10px; + } + .carousel-control .glyphicon-chevron-right, + .carousel-control .icon-next { + margin-right: -10px; + } + .carousel-caption { + left: 20%; + right: 20%; + padding-bottom: 30px; + } + .carousel-indicators { + bottom: 20px; + } +} +.clearfix:before, +.clearfix:after, +.dl-horizontal dd:before, +.dl-horizontal dd:after, +.container:before, +.container:after, +.container-fluid:before, +.container-fluid:after, +.row:before, +.row:after, +.form-horizontal .form-group:before, +.form-horizontal .form-group:after, +.btn-toolbar:before, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:before, +.btn-group-vertical > .btn-group:after, +.nav:before, +.nav:after, +.navbar:before, +.navbar:after, +.navbar-header:before, +.navbar-header:after, +.navbar-collapse:before, +.navbar-collapse:after, +.pager:before, +.pager:after, +.panel-body:before, +.panel-body:after, +.modal-header:before, +.modal-header:after, +.modal-footer:before, +.modal-footer:after { + content: " "; + display: table; +} +.clearfix:after, +.dl-horizontal dd:after, +.container:after, +.container-fluid:after, +.row:after, +.form-horizontal .form-group:after, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:after, +.nav:after, +.navbar:after, +.navbar-header:after, +.navbar-collapse:after, +.pager:after, +.panel-body:after, +.modal-header:after, +.modal-footer:after { + clear: both; +} +.center-block { + display: block; + margin-left: auto; + margin-right: auto; +} +.pull-right { + float: right !important; +} +.pull-left { + float: left !important; +} +.hide { + display: none !important; +} +.show { + display: block !important; +} +.invisible { + visibility: hidden; +} +.text-hide { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} +.hidden { + display: none !important; +} +.affix { + position: fixed; +} +@-ms-viewport { + width: device-width; +} +.visible-xs, +.visible-sm, +.visible-md, +.visible-lg { + display: none !important; +} +.visible-xs-block, +.visible-xs-inline, +.visible-xs-inline-block, +.visible-sm-block, +.visible-sm-inline, +.visible-sm-inline-block, +.visible-md-block, +.visible-md-inline, +.visible-md-inline-block, +.visible-lg-block, +.visible-lg-inline, +.visible-lg-inline-block { + display: none !important; +} +@media (max-width: 767px) { + .visible-xs { + display: block !important; + } + table.visible-xs { + display: table !important; + } + tr.visible-xs { + display: table-row !important; + } + th.visible-xs, + td.visible-xs { + display: table-cell !important; + } +} +@media (max-width: 767px) { + .visible-xs-block { + display: block !important; + } +} +@media (max-width: 767px) { + .visible-xs-inline { + display: inline !important; + } +} +@media (max-width: 767px) { + .visible-xs-inline-block { + display: inline-block !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm { + display: block !important; + } + table.visible-sm { + display: table !important; + } + tr.visible-sm { + display: table-row !important; + } + th.visible-sm, + td.visible-sm { + display: table-cell !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-block { + display: block !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline { + display: inline !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline-block { + display: inline-block !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md { + display: block !important; + } + table.visible-md { + display: table !important; + } + tr.visible-md { + display: table-row !important; + } + th.visible-md, + td.visible-md { + display: table-cell !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-block { + display: block !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline { + display: inline !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline-block { + display: inline-block !important; + } +} +@media (min-width: 1200px) { + .visible-lg { + display: block !important; + } + table.visible-lg { + display: table !important; + } + tr.visible-lg { + display: table-row !important; + } + th.visible-lg, + td.visible-lg { + display: table-cell !important; + } +} +@media (min-width: 1200px) { + .visible-lg-block { + display: block !important; + } +} +@media (min-width: 1200px) { + .visible-lg-inline { + display: inline !important; + } +} +@media (min-width: 1200px) { + .visible-lg-inline-block { + display: inline-block !important; + } +} +@media (max-width: 767px) { + .hidden-xs { + display: none !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .hidden-sm { + display: none !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .hidden-md { + display: none !important; + } +} +@media (min-width: 1200px) { + .hidden-lg { + display: none !important; + } +} +.visible-print { + display: none !important; +} +@media print { + .visible-print { + display: block !important; + } + table.visible-print { + display: table !important; + } + tr.visible-print { + display: table-row !important; + } + th.visible-print, + td.visible-print { + display: table-cell !important; + } +} +.visible-print-block { + display: none !important; +} +@media print { + .visible-print-block { + display: block !important; + } +} +.visible-print-inline { + display: none !important; +} +@media print { + .visible-print-inline { + display: inline !important; + } +} +.visible-print-inline-block { + display: none !important; +} +@media print { + .visible-print-inline-block { + display: inline-block !important; + } +} +@media print { + .hidden-print { + display: none !important; + } +} +.navbar { + border: none; + font-size: 13px; + font-weight: 300; +} +.navbar .navbar-toggle:hover .icon-bar { + background-color: #b3b3b3; +} +.navbar-collapse { + border-top-color: rgba(0, 0, 0, 0.2); + -webkit-box-shadow: none; + box-shadow: none; +} +.navbar .btn { + padding-top: 6px; + padding-bottom: 6px; +} +.navbar-form { + margin-top: 7px; + margin-bottom: 5px; +} +.navbar-form .form-control { + height: auto; + padding: 4px 6px; +} +.navbar-text { + margin: 12px 15px; + line-height: 21px; +} +.navbar .dropdown-menu { + border: none; +} +.navbar .dropdown-menu > li > a, +.navbar .dropdown-menu > li > a:focus { + background-color: transparent; + font-size: 13px; + font-weight: 300; +} +.navbar .dropdown-header { + color: rgba(255, 255, 255, 0.5); +} +.navbar-default .dropdown-menu { + background-color: #333333; +} +.navbar-default .dropdown-menu > li > a, +.navbar-default .dropdown-menu > li > a:focus { + color: #ffffff; +} +.navbar-default .dropdown-menu > li > a:hover, +.navbar-default .dropdown-menu > .active > a, +.navbar-default .dropdown-menu > .active > a:hover { + background-color: #272727; +} +.navbar-inverse .dropdown-menu { + background-color: #008cba; +} +.navbar-inverse .dropdown-menu > li > a, +.navbar-inverse .dropdown-menu > li > a:focus { + color: #ffffff; +} +.navbar-inverse .dropdown-menu > li > a:hover, +.navbar-inverse .dropdown-menu > .active > a, +.navbar-inverse .dropdown-menu > .active > a:hover { + background-color: #006687; +} +.btn { + padding: 8px 12px; +} +.btn-lg { + padding: 16px 20px; +} +.btn-sm { + padding: 8px 12px; +} +.btn-xs { + padding: 4px 6px; +} +.btn-group .btn ~ .dropdown-toggle { + padding-left: 16px; + padding-right: 16px; +} +.btn-group .dropdown-menu { + border-top-width: 0; +} +.btn-group.dropup .dropdown-menu { + border-top-width: 1px; + border-bottom-width: 0; + margin-bottom: 0; +} +.btn-group .dropdown-toggle.btn-default ~ .dropdown-menu { + background-color: #e7e7e7; + border-color: #cccccc; +} +.btn-group .dropdown-toggle.btn-default ~ .dropdown-menu > li > a { + color: #333333; +} +.btn-group .dropdown-toggle.btn-default ~ .dropdown-menu > li > a:hover { + background-color: #d3d3d3; +} +.btn-group .dropdown-toggle.btn-primary ~ .dropdown-menu { + background-color: #008cba; + border-color: #0079a1; +} +.btn-group .dropdown-toggle.btn-primary ~ .dropdown-menu > li > a { + color: #ffffff; +} +.btn-group .dropdown-toggle.btn-primary ~ .dropdown-menu > li > a:hover { + background-color: #006d91; +} +.btn-group .dropdown-toggle.btn-success ~ .dropdown-menu { + background-color: #43ac6a; + border-color: #3c9a5f; +} +.btn-group .dropdown-toggle.btn-success ~ .dropdown-menu > li > a { + color: #ffffff; +} +.btn-group .dropdown-toggle.btn-success ~ .dropdown-menu > li > a:hover { + background-color: #388f58; +} +.btn-group .dropdown-toggle.btn-info ~ .dropdown-menu { + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-group .dropdown-toggle.btn-info ~ .dropdown-menu > li > a { + color: #ffffff; +} +.btn-group .dropdown-toggle.btn-info ~ .dropdown-menu > li > a:hover { + background-color: #39b3d7; +} +.btn-group .dropdown-toggle.btn-warning ~ .dropdown-menu { + background-color: #e99002; + border-color: #d08002; +} +.btn-group .dropdown-toggle.btn-warning ~ .dropdown-menu > li > a { + color: #ffffff; +} +.btn-group .dropdown-toggle.btn-warning ~ .dropdown-menu > li > a:hover { + background-color: #c17702; +} +.btn-group .dropdown-toggle.btn-danger ~ .dropdown-menu { + background-color: #f04124; + border-color: #ea2f10; +} +.btn-group .dropdown-toggle.btn-danger ~ .dropdown-menu > li > a { + color: #ffffff; +} +.btn-group .dropdown-toggle.btn-danger ~ .dropdown-menu > li > a:hover { + background-color: #dc2c0f; +} +.lead { + color: #6f6f6f; +} +cite { + font-style: italic; +} +blockquote { + border-left-width: 1px; + color: #6f6f6f; +} +blockquote.pull-right { + border-right-width: 1px; +} +blockquote small { + font-size: 12px; + font-weight: 300; +} +table { + font-size: 12px; +} +label, +.control-label, +.help-block, +.checkbox, +.radio { + font-size: 12px; + font-weight: normal; +} +input[type="radio"], +input[type="checkbox"] { + margin-top: 1px; +} +.nav .open > a, +.nav .open > a:hover, +.nav .open > a:focus { + border-color: transparent; +} +.nav-tabs > li > a { + background-color: #e7e7e7; + color: #222222; +} +.nav-tabs .caret { + border-top-color: #222222; + border-bottom-color: #222222; +} +.nav-pills { + font-weight: 300; +} +.breadcrumb { + border: 1px solid #dddddd; + border-radius: 3px; + font-size: 10px; + font-weight: 300; + text-transform: uppercase; +} +.pagination { + font-size: 12px; + font-weight: 300; + color: #999999; +} +.pagination > li > a, +.pagination > li > span { + margin-left: 4px; + color: #999999; +} +.pagination > .active > a, +.pagination > .active > span { + color: #fff; +} +.pagination > li > a, +.pagination > li:first-child > a, +.pagination > li:last-child > a, +.pagination > li > span, +.pagination > li:first-child > span, +.pagination > li:last-child > span { + border-radius: 3px; +} +.pagination-lg > li > a, +.pagination-lg > li > span { + padding-left: 22px; + padding-right: 22px; +} +.pagination-sm > li > a, +.pagination-sm > li > span { + padding: 0 5px; +} +.pager { + font-size: 12px; + font-weight: 300; + color: #999999; +} +.list-group { + font-size: 12px; + font-weight: 300; +} +.close { + opacity: 0.4; + text-decoration: none; + text-shadow: none; +} +.close:hover, +.close:focus { + opacity: 1; +} +.alert { + font-size: 12px; + font-weight: 300; +} +.alert .alert-link { + font-weight: normal; + color: #fff; + text-decoration: underline; +} +.label { + padding-left: 1em; + padding-right: 1em; + border-radius: 0; + font-weight: 300; +} +.label-default { + background-color: #e7e7e7; + color: #333333; +} +.badge { + font-weight: 300; +} +.progress { + height: 22px; + padding: 2px; + background-color: #f6f6f6; + border: 1px solid #ccc; + -webkit-box-shadow: none; + box-shadow: none; +} +.dropdown-menu { + padding: 0; + margin-top: 0; + font-size: 12px; +} +.dropdown-menu > li > a { + padding: 12px 15px; +} +.dropdown-header { + padding-left: 15px; + padding-right: 15px; + font-size: 9px; + text-transform: uppercase; +} +.popover { + color: #fff; + font-size: 12px; + font-weight: 300; +} +.panel-heading, +.panel-footer { + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.panel-default .close { + color: #222222; +} +.modal .close { + color: #222222; +} diff --git a/src/LanBackup.WebApp/ClientApp/app/bootswatch/css/bootstrap_yeti.min.css b/src/LanBackup.WebApp/ClientApp/app/bootswatch/css/bootstrap_yeti.min.css new file mode 100644 index 0000000..cda7d4a --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/bootswatch/css/bootstrap_yeti.min.css @@ -0,0 +1,11 @@ +@import url("https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,300,700");/*! + * bootswatch v3.3.7 + * Homepage: http://bootswatch.com + * Copyright 2012-2016 Thomas Park + * Licensed under MIT + * Based on Bootstrap +*//*! + * Bootstrap v3.3.7 (http://getbootstrap.com) + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,*:before,*:after{background:transparent !important;color:#000 !important;-webkit-box-shadow:none !important;box-shadow:none !important;text-shadow:none !important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000 !important}.label{border:1px solid #000}.table{border-collapse:collapse !important}.table td,.table th{background-color:#fff !important}.table-bordered th,.table-bordered td{border:1px solid #ddd !important}}@font-face{font-family:'Glyphicons Halflings';src:url('../fonts/glyphicons-halflings-regular.eot');src:url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'),url('../fonts/glyphicons-halflings-regular.woff') format('woff'),url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-euro:before,.glyphicon-eur:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;color:#222222;background-color:#ffffff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#008cba;text-decoration:none}a:hover,a:focus{color:#008cba;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive,.thumbnail>img,.thumbnail a>img,.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:0}.img-thumbnail{padding:4px;line-height:1.4;background-color:#ffffff;border:1px solid #dddddd;border-radius:0;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:21px;margin-bottom:21px;border:0;border-top:1px solid #dddddd}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role="button"]{cursor:pointer}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:300;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:normal;line-height:1;color:#999999}h1,.h1,h2,.h2,h3,.h3{margin-top:21px;margin-bottom:10.5px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10.5px;margin-bottom:10.5px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:39px}h2,.h2{font-size:32px}h3,.h3{font-size:26px}h4,.h4{font-size:19px}h5,.h5{font-size:15px}h6,.h6{font-size:13px}p{margin:0 0 10.5px}.lead{margin-bottom:21px;font-size:17px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:22.5px}}small,.small{font-size:80%}mark,.mark{background-color:#fcf8e3;padding:.2em}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#999999}.text-primary{color:#008cba}a.text-primary:hover,a.text-primary:focus{color:#006687}.text-success{color:#43ac6a}a.text-success:hover,a.text-success:focus{color:#358753}.text-info{color:#5bc0de}a.text-info:hover,a.text-info:focus{color:#31b0d5}.text-warning{color:#e99002}a.text-warning:hover,a.text-warning:focus{color:#b67102}.text-danger{color:#f04124}a.text-danger:hover,a.text-danger:focus{color:#d32a0e}.bg-primary{color:#fff;background-color:#008cba}a.bg-primary:hover,a.bg-primary:focus{background-color:#006687}.bg-success{background-color:#dff0d8}a.bg-success:hover,a.bg-success:focus{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover,a.bg-info:focus{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover,a.bg-warning:focus{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover,a.bg-danger:focus{background-color:#e4b9b9}.page-header{padding-bottom:9.5px;margin:42px 0 21px;border-bottom:1px solid #dddddd}ul,ol{margin-top:0;margin-bottom:10.5px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none;margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-top:0;margin-bottom:21px}dt,dd{line-height:1.4}dt{font-weight:bold}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999999}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10.5px 21px;margin:0 0 21px;font-size:18.75px;border-left:5px solid #dddddd}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.4;color:#6f6f6f}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #dddddd;border-left:0;text-align:right}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}address{margin-bottom:21px;font-style:normal;line-height:1.4}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:0}kbd{padding:2px 4px;font-size:90%;color:#ffffff;background-color:#333333;border-radius:0;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.25)}kbd kbd{padding:0;font-size:100%;font-weight:bold;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:10px;margin:0 0 10.5px;font-size:14px;line-height:1.4;word-break:break-all;word-wrap:break-word;color:#333333;background-color:#f5f5f5;border:1px solid #cccccc;border-radius:0}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.row{margin-left:-15px;margin-right:-15px}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0%}@media (min-width:768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0%}}@media (min-width:992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0%}}@media (min-width:1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0%}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#999999;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:21px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.4;vertical-align:top;border-top:1px solid #dddddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #dddddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #dddddd}.table .table{background-color:#ffffff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #dddddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #dddddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*="col-"]{position:static;float:none;display:table-column}table td[class*="col-"],table th[class*="col-"]{position:static;float:none;display:table-cell}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}.table-responsive{overflow-x:auto;min-height:0.01%}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15.75px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #dddddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0;min-width:0}legend{display:block;width:100%;padding:0;margin-bottom:21px;font-size:22.5px;line-height:inherit;color:#333333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:bold}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type="file"]{display:block}input[type="range"]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:9px;font-size:15px;line-height:1.4;color:#6f6f6f}.form-control{display:block;width:100%;height:39px;padding:8px 12px;font-size:15px;line-height:1.4;color:#6f6f6f;background-color:#ffffff;background-image:none;border:1px solid #cccccc;border-radius:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6)}.form-control::-moz-placeholder{color:#999999;opacity:1}.form-control:-ms-input-placeholder{color:#999999}.form-control::-webkit-input-placeholder{color:#999999}.form-control::-ms-expand{border:0;background-color:transparent}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eeeeee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type="search"]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type="date"].form-control,input[type="time"].form-control,input[type="datetime-local"].form-control,input[type="month"].form-control{line-height:39px}input[type="date"].input-sm,input[type="time"].input-sm,input[type="datetime-local"].input-sm,input[type="month"].input-sm,.input-group-sm input[type="date"],.input-group-sm input[type="time"],.input-group-sm input[type="datetime-local"],.input-group-sm input[type="month"]{line-height:36px}input[type="date"].input-lg,input[type="time"].input-lg,input[type="datetime-local"].input-lg,input[type="month"].input-lg,.input-group-lg input[type="date"],.input-group-lg input[type="time"],.input-group-lg input[type="datetime-local"],.input-group-lg input[type="month"]{line-height:60px}}.form-group{margin-bottom:15px}.radio,.checkbox{position:relative;display:block;margin-top:10px;margin-bottom:10px}.radio label,.checkbox label{min-height:21px;padding-left:20px;margin-bottom:0;font-weight:normal;cursor:pointer}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{position:absolute;margin-left:-20px;margin-top:4px \9}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:normal;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"].disabled,input[type="checkbox"].disabled,fieldset[disabled] input[type="radio"],fieldset[disabled] input[type="checkbox"]{cursor:not-allowed}.radio-inline.disabled,.checkbox-inline.disabled,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.radio.disabled label,.checkbox.disabled label,fieldset[disabled] .radio label,fieldset[disabled] .checkbox label{cursor:not-allowed}.form-control-static{padding-top:9px;padding-bottom:9px;margin-bottom:0;min-height:36px}.form-control-static.input-lg,.form-control-static.input-sm{padding-left:0;padding-right:0}.input-sm{height:36px;padding:8px 12px;font-size:12px;line-height:1.5;border-radius:0}select.input-sm{height:36px;line-height:36px}textarea.input-sm,select[multiple].input-sm{height:auto}.form-group-sm .form-control{height:36px;padding:8px 12px;font-size:12px;line-height:1.5;border-radius:0}.form-group-sm select.form-control{height:36px;line-height:36px}.form-group-sm textarea.form-control,.form-group-sm select[multiple].form-control{height:auto}.form-group-sm .form-control-static{height:36px;min-height:33px;padding:9px 12px;font-size:12px;line-height:1.5}.input-lg{height:60px;padding:16px 20px;font-size:19px;line-height:1.3333333;border-radius:0}select.input-lg{height:60px;line-height:60px}textarea.input-lg,select[multiple].input-lg{height:auto}.form-group-lg .form-control{height:60px;padding:16px 20px;font-size:19px;line-height:1.3333333;border-radius:0}.form-group-lg select.form-control{height:60px;line-height:60px}.form-group-lg textarea.form-control,.form-group-lg select[multiple].form-control{height:auto}.form-group-lg .form-control-static{height:60px;min-height:40px;padding:17px 20px;font-size:19px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:48.75px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:39px;height:39px;line-height:39px;text-align:center;pointer-events:none}.input-lg+.form-control-feedback,.input-group-lg+.form-control-feedback,.form-group-lg .form-control+.form-control-feedback{width:60px;height:60px;line-height:60px}.input-sm+.form-control-feedback,.input-group-sm+.form-control-feedback,.form-group-sm .form-control+.form-control-feedback{width:36px;height:36px;line-height:36px}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline,.has-success.radio label,.has-success.checkbox label,.has-success.radio-inline label,.has-success.checkbox-inline label{color:#43ac6a}.has-success .form-control{border-color:#43ac6a;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-success .form-control:focus{border-color:#358753;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #85d0a1;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #85d0a1}.has-success .input-group-addon{color:#43ac6a;border-color:#43ac6a;background-color:#dff0d8}.has-success .form-control-feedback{color:#43ac6a}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline,.has-warning.radio label,.has-warning.checkbox label,.has-warning.radio-inline label,.has-warning.checkbox-inline label{color:#e99002}.has-warning .form-control{border-color:#e99002;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-warning .form-control:focus{border-color:#b67102;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #febc53;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #febc53}.has-warning .input-group-addon{color:#e99002;border-color:#e99002;background-color:#fcf8e3}.has-warning .form-control-feedback{color:#e99002}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline,.has-error.radio label,.has-error.checkbox label,.has-error.radio-inline label,.has-error.checkbox-inline label{color:#f04124}.has-error .form-control{border-color:#f04124;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-error .form-control:focus{border-color:#d32a0e;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #f79483;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #f79483}.has-error .input-group-addon{color:#f04124;border-color:#f04124;background-color:#f2dede}.has-error .form-control-feedback{color:#f04124}.has-feedback label~.form-control-feedback{top:26px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#626262}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn,.form-inline .input-group .form-control{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .radio label,.form-inline .checkbox label{padding-left:0}.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{margin-top:0;margin-bottom:0;padding-top:9px}.form-horizontal .radio,.form-horizontal .checkbox{min-height:30px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}@media (min-width:768px){.form-horizontal .control-label{text-align:right;margin-bottom:0;padding-top:9px}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:17px;font-size:19px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:9px;font-size:12px}}.btn{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:8px 12px;font-size:15px;line-height:1.4;border-radius:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn:focus,.btn:active:focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn.active.focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus,.btn.focus{color:#333333;text-decoration:none}.btn:active,.btn.active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;opacity:0.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333333;background-color:#e7e7e7;border-color:#cccccc}.btn-default:focus,.btn-default.focus{color:#333333;background-color:#cecece;border-color:#8c8c8c}.btn-default:hover{color:#333333;background-color:#cecece;border-color:#adadad}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{color:#333333;background-color:#cecece;border-color:#adadad}.btn-default:active:hover,.btn-default.active:hover,.open>.dropdown-toggle.btn-default:hover,.btn-default:active:focus,.btn-default.active:focus,.open>.dropdown-toggle.btn-default:focus,.btn-default:active.focus,.btn-default.active.focus,.open>.dropdown-toggle.btn-default.focus{color:#333333;background-color:#bcbcbc;border-color:#8c8c8c}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled.focus,.btn-default[disabled].focus,fieldset[disabled] .btn-default.focus{background-color:#e7e7e7;border-color:#cccccc}.btn-default .badge{color:#e7e7e7;background-color:#333333}.btn-primary{color:#ffffff;background-color:#008cba;border-color:#0079a1}.btn-primary:focus,.btn-primary.focus{color:#ffffff;background-color:#006687;border-color:#001921}.btn-primary:hover{color:#ffffff;background-color:#006687;border-color:#004b63}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{color:#ffffff;background-color:#006687;border-color:#004b63}.btn-primary:active:hover,.btn-primary.active:hover,.open>.dropdown-toggle.btn-primary:hover,.btn-primary:active:focus,.btn-primary.active:focus,.open>.dropdown-toggle.btn-primary:focus,.btn-primary:active.focus,.btn-primary.active.focus,.open>.dropdown-toggle.btn-primary.focus{color:#ffffff;background-color:#004b63;border-color:#001921}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled.focus,.btn-primary[disabled].focus,fieldset[disabled] .btn-primary.focus{background-color:#008cba;border-color:#0079a1}.btn-primary .badge{color:#008cba;background-color:#ffffff}.btn-success{color:#ffffff;background-color:#43ac6a;border-color:#3c9a5f}.btn-success:focus,.btn-success.focus{color:#ffffff;background-color:#358753;border-color:#183e26}.btn-success:hover{color:#ffffff;background-color:#358753;border-color:#2b6e44}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{color:#ffffff;background-color:#358753;border-color:#2b6e44}.btn-success:active:hover,.btn-success.active:hover,.open>.dropdown-toggle.btn-success:hover,.btn-success:active:focus,.btn-success.active:focus,.open>.dropdown-toggle.btn-success:focus,.btn-success:active.focus,.btn-success.active.focus,.open>.dropdown-toggle.btn-success.focus{color:#ffffff;background-color:#2b6e44;border-color:#183e26}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled.focus,.btn-success[disabled].focus,fieldset[disabled] .btn-success.focus{background-color:#43ac6a;border-color:#3c9a5f}.btn-success .badge{color:#43ac6a;background-color:#ffffff}.btn-info{color:#ffffff;background-color:#5bc0de;border-color:#46b8da}.btn-info:focus,.btn-info.focus{color:#ffffff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#ffffff;background-color:#31b0d5;border-color:#269abc}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{color:#ffffff;background-color:#31b0d5;border-color:#269abc}.btn-info:active:hover,.btn-info.active:hover,.open>.dropdown-toggle.btn-info:hover,.btn-info:active:focus,.btn-info.active:focus,.open>.dropdown-toggle.btn-info:focus,.btn-info:active.focus,.btn-info.active.focus,.open>.dropdown-toggle.btn-info.focus{color:#ffffff;background-color:#269abc;border-color:#1b6d85}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled.focus,.btn-info[disabled].focus,fieldset[disabled] .btn-info.focus{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#ffffff}.btn-warning{color:#ffffff;background-color:#e99002;border-color:#d08002}.btn-warning:focus,.btn-warning.focus{color:#ffffff;background-color:#b67102;border-color:#513201}.btn-warning:hover{color:#ffffff;background-color:#b67102;border-color:#935b01}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{color:#ffffff;background-color:#b67102;border-color:#935b01}.btn-warning:active:hover,.btn-warning.active:hover,.open>.dropdown-toggle.btn-warning:hover,.btn-warning:active:focus,.btn-warning.active:focus,.open>.dropdown-toggle.btn-warning:focus,.btn-warning:active.focus,.btn-warning.active.focus,.open>.dropdown-toggle.btn-warning.focus{color:#ffffff;background-color:#935b01;border-color:#513201}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled.focus,.btn-warning[disabled].focus,fieldset[disabled] .btn-warning.focus{background-color:#e99002;border-color:#d08002}.btn-warning .badge{color:#e99002;background-color:#ffffff}.btn-danger{color:#ffffff;background-color:#f04124;border-color:#ea2f10}.btn-danger:focus,.btn-danger.focus{color:#ffffff;background-color:#d32a0e;border-color:#731708}.btn-danger:hover{color:#ffffff;background-color:#d32a0e;border-color:#b1240c}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{color:#ffffff;background-color:#d32a0e;border-color:#b1240c}.btn-danger:active:hover,.btn-danger.active:hover,.open>.dropdown-toggle.btn-danger:hover,.btn-danger:active:focus,.btn-danger.active:focus,.open>.dropdown-toggle.btn-danger:focus,.btn-danger:active.focus,.btn-danger.active.focus,.open>.dropdown-toggle.btn-danger.focus{color:#ffffff;background-color:#b1240c;border-color:#731708}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled.focus,.btn-danger[disabled].focus,fieldset[disabled] .btn-danger.focus{background-color:#f04124;border-color:#ea2f10}.btn-danger .badge{color:#f04124;background-color:#ffffff}.btn-link{color:#008cba;font-weight:normal;border-radius:0}.btn-link,.btn-link:active,.btn-link.active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#008cba;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#999999;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:16px 20px;font-size:19px;line-height:1.3333333;border-radius:0}.btn-sm,.btn-group-sm>.btn{padding:8px 12px;font-size:12px;line-height:1.5;border-radius:0}.btn-xs,.btn-group-xs>.btn{padding:4px 6px;font-size:12px;line-height:1.5;border-radius:0}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-property:height, visibility;-o-transition-property:height, visibility;transition-property:height, visibility;-webkit-transition-duration:0.35s;-o-transition-duration:0.35s;transition-duration:0.35s;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid \9;border-right:4px solid transparent;border-left:4px solid transparent}.dropup,.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:15px;text-align:left;background-color:#ffffff;border:1px solid #cccccc;border:1px solid rgba(0,0,0,0.15);border-radius:0;-webkit-box-shadow:0 6px 12px rgba(0,0,0,0.175);box-shadow:0 6px 12px rgba(0,0,0,0.175);-webkit-background-clip:padding-box;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9.5px 0;overflow:hidden;background-color:rgba(0,0,0,0.2)}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:1.4;color:#555555;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{text-decoration:none;color:#262626;background-color:#eeeeee}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#ffffff;text-decoration:none;outline:0;background-color:#008cba}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#999999}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.4;color:#999999;white-space:nowrap}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px dashed;border-bottom:4px solid \9;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{left:auto;right:0}.navbar-right .dropdown-menu-left{left:0;right:auto}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{float:none;display:table-cell;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle="buttons"]>.btn input[type="radio"],[data-toggle="buttons"]>.btn-group>.btn input[type="radio"],[data-toggle="buttons"]>.btn input[type="checkbox"],[data-toggle="buttons"]>.btn-group>.btn input[type="checkbox"]{position:absolute;clip:rect(0, 0, 0, 0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*="col-"]{float:none;padding-left:0;padding-right:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:60px;padding:16px 20px;font-size:19px;line-height:1.3333333;border-radius:0}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:60px;line-height:60px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:36px;padding:8px 12px;font-size:12px;line-height:1.5;border-radius:0}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:36px;line-height:36px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:8px 12px;font-size:15px;font-weight:normal;line-height:1;color:#6f6f6f;text-align:center;background-color:#eeeeee;border:1px solid #cccccc;border-radius:0}.input-group-addon.input-sm{padding:8px 12px;font-size:12px;border-radius:0}.input-group-addon.input-lg{padding:16px 20px;font-size:19px;border-radius:0}.input-group-addon input[type="radio"],.input-group-addon input[type="checkbox"]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eeeeee}.nav>li.disabled>a{color:#999999}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#999999;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eeeeee;border-color:#008cba}.nav .nav-divider{height:1px;margin:9.5px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #dddddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.4;border:1px solid transparent;border-radius:0 0 0 0}.nav-tabs>li>a:hover{border-color:#eeeeee #eeeeee #dddddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#6f6f6f;background-color:#ffffff;border:1px solid #dddddd;border-bottom-color:transparent;cursor:default}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #dddddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #dddddd;border-radius:0 0 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#ffffff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:0}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#ffffff;background-color:#008cba}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #dddddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #dddddd;border-radius:0 0 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#ffffff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:45px;margin-bottom:21px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:0}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);-webkit-overflow-scrolling:touch}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block !important;height:auto !important;padding-bottom:0;overflow:visible !important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-left:0;padding-right:0}}.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:200px}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;padding:12px 15px;font-size:19px;line-height:21px;height:45px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:5.5px;margin-bottom:5.5px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:0}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:6px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:21px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:21px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:12px;padding-bottom:12px}}.navbar-form{margin-left:-15px;margin-right:-15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);margin-top:3px;margin-bottom:3px}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn,.navbar-form .input-group .form-control{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .radio label,.navbar-form .checkbox label{padding-left:0}.navbar-form .radio input[type="radio"],.navbar-form .checkbox input[type="checkbox"]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-right-radius:0;border-top-left-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:3px;margin-bottom:3px}.navbar-btn.btn-sm{margin-top:4.5px;margin-bottom:4.5px}.navbar-btn.btn-xs{margin-top:11.5px;margin-bottom:11.5px}.navbar-text{margin-top:12px;margin-bottom:12px}@media (min-width:768px){.navbar-text{float:left;margin-left:15px;margin-right:15px}}@media (min-width:768px){.navbar-left{float:left !important}.navbar-right{float:right !important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#333333;border-color:#222222}.navbar-default .navbar-brand{color:#ffffff}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#ffffff;background-color:transparent}.navbar-default .navbar-text{color:#ffffff}.navbar-default .navbar-nav>li>a{color:#ffffff}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#ffffff;background-color:#272727}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#ffffff;background-color:#272727}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#cccccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:transparent}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:transparent}.navbar-default .navbar-toggle .icon-bar{background-color:#ffffff}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#222222}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{background-color:#272727;color:#ffffff}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#ffffff}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#ffffff;background-color:#272727}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#ffffff;background-color:#272727}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#cccccc;background-color:transparent}}.navbar-default .navbar-link{color:#ffffff}.navbar-default .navbar-link:hover{color:#ffffff}.navbar-default .btn-link{color:#ffffff}.navbar-default .btn-link:hover,.navbar-default .btn-link:focus{color:#ffffff}.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:hover,.navbar-default .btn-link[disabled]:focus,fieldset[disabled] .navbar-default .btn-link:focus{color:#cccccc}.navbar-inverse{background-color:#008cba;border-color:#006687}.navbar-inverse .navbar-brand{color:#ffffff}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#ffffff;background-color:transparent}.navbar-inverse .navbar-text{color:#ffffff}.navbar-inverse .navbar-nav>li>a{color:#ffffff}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#ffffff;background-color:#006687}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#ffffff;background-color:#006687}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:transparent}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:transparent}.navbar-inverse .navbar-toggle .icon-bar{background-color:#ffffff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#007196}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background-color:#006687;color:#ffffff}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#006687}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#006687}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#ffffff}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#ffffff;background-color:#006687}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#ffffff;background-color:#006687}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444444;background-color:transparent}}.navbar-inverse .navbar-link{color:#ffffff}.navbar-inverse .navbar-link:hover{color:#ffffff}.navbar-inverse .btn-link{color:#ffffff}.navbar-inverse .btn-link:hover,.navbar-inverse .btn-link:focus{color:#ffffff}.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:hover,.navbar-inverse .btn-link[disabled]:focus,fieldset[disabled] .navbar-inverse .btn-link:focus{color:#444444}.breadcrumb{padding:8px 15px;margin-bottom:21px;list-style:none;background-color:#f5f5f5;border-radius:0}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{content:"/\00a0";padding:0 5px;color:#999999}.breadcrumb>.active{color:#333333}.pagination{display:inline-block;padding-left:0;margin:21px 0;border-radius:0}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:8px 12px;line-height:1.4;text-decoration:none;color:#008cba;background-color:transparent;border:1px solid transparent;margin-left:-1px}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:0;border-top-left-radius:0}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:0;border-top-right-radius:0}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{z-index:2;color:#008cba;background-color:#eeeeee;border-color:transparent}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:3;color:#ffffff;background-color:#008cba;border-color:transparent;cursor:default}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#999999;background-color:#ffffff;border-color:transparent;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:16px 20px;font-size:19px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:0;border-top-left-radius:0}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:0;border-top-right-radius:0}.pagination-sm>li>a,.pagination-sm>li>span{padding:8px 12px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:0;border-top-left-radius:0}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:0;border-top-right-radius:0}.pager{padding-left:0;margin:21px 0;list-style:none;text-align:center}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:transparent;border:1px solid transparent;border-radius:3px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eeeeee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#999999;background-color:transparent;cursor:not-allowed}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:bold;line-height:1;color:#ffffff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:hover,a.label:focus{color:#ffffff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#999999}.label-default[href]:hover,.label-default[href]:focus{background-color:#808080}.label-primary{background-color:#008cba}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#006687}.label-success{background-color:#43ac6a}.label-success[href]:hover,.label-success[href]:focus{background-color:#358753}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#e99002}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#b67102}.label-danger{background-color:#f04124}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#d32a0e}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:bold;color:#ffffff;line-height:1;vertical-align:middle;white-space:nowrap;text-align:center;background-color:#008cba;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge,.btn-group-xs>.btn .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#ffffff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#008cba;background-color:#ffffff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#fafafa}.jumbotron h1,.jumbotron .h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:23px;font-weight:200}.jumbotron>hr{border-top-color:#e1e1e1}.container .jumbotron,.container-fluid .jumbotron{border-radius:0;padding-left:15px;padding-right:15px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-left:60px;padding-right:60px}.jumbotron h1,.jumbotron .h1{font-size:68px}}.thumbnail{display:block;padding:4px;margin-bottom:21px;line-height:1.4;background-color:#ffffff;border:1px solid #dddddd;border-radius:0;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail>img,.thumbnail a>img{margin-left:auto;margin-right:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#008cba}.thumbnail .caption{padding:9px;color:#222222}.alert{padding:15px;margin-bottom:21px;border:1px solid transparent;border-radius:0}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:bold}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{background-color:#43ac6a;border-color:#3c9a5f;color:#ffffff}.alert-success hr{border-top-color:#358753}.alert-success .alert-link{color:#e6e6e6}.alert-info{background-color:#5bc0de;border-color:#3db5d8;color:#ffffff}.alert-info hr{border-top-color:#2aabd2}.alert-info .alert-link{color:#e6e6e6}.alert-warning{background-color:#e99002;border-color:#d08002;color:#ffffff}.alert-warning hr{border-top-color:#b67102}.alert-warning .alert-link{color:#e6e6e6}.alert-danger{background-color:#f04124;border-color:#ea2f10;color:#ffffff}.alert-danger hr{border-top-color:#d32a0e}.alert-danger .alert-link{color:#e6e6e6}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{overflow:hidden;height:21px;margin-bottom:21px;background-color:#f5f5f5;border-radius:0;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress-bar{float:left;width:0%;height:100%;font-size:12px;line-height:21px;color:#ffffff;text-align:center;background-color:#008cba;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-transition:width 0.6s ease;-o-transition:width 0.6s ease;transition:width 0.6s ease}.progress-striped .progress-bar,.progress-bar-striped{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress.active .progress-bar,.progress-bar.active{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#43ac6a}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-warning{background-color:#e99002}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-danger{background-color:#f04124}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{zoom:1;overflow:hidden}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-left,.media-right,.media-body{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{margin-bottom:20px;padding-left:0}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#ffffff;border:1px solid #dddddd}.list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}a.list-group-item,button.list-group-item{color:#555555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333333}a.list-group-item:hover,button.list-group-item:hover,a.list-group-item:focus,button.list-group-item:focus{text-decoration:none;color:#555555;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:hover,.list-group-item.disabled:focus{background-color:#eeeeee;color:#999999;cursor:not-allowed}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text{color:#999999}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{z-index:2;color:#ffffff;background-color:#008cba;border-color:#008cba}.list-group-item.active .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>.small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:hover .list-group-item-text,.list-group-item.active:focus .list-group-item-text{color:#87e1ff}.list-group-item-success{color:#43ac6a;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#43ac6a}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,button.list-group-item-success:hover,a.list-group-item-success:focus,button.list-group-item-success:focus{color:#43ac6a;background-color:#d0e9c6}a.list-group-item-success.active,button.list-group-item-success.active,a.list-group-item-success.active:hover,button.list-group-item-success.active:hover,a.list-group-item-success.active:focus,button.list-group-item-success.active:focus{color:#fff;background-color:#43ac6a;border-color:#43ac6a}.list-group-item-info{color:#5bc0de;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#5bc0de}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,button.list-group-item-info:hover,a.list-group-item-info:focus,button.list-group-item-info:focus{color:#5bc0de;background-color:#c4e3f3}a.list-group-item-info.active,button.list-group-item-info.active,a.list-group-item-info.active:hover,button.list-group-item-info.active:hover,a.list-group-item-info.active:focus,button.list-group-item-info.active:focus{color:#fff;background-color:#5bc0de;border-color:#5bc0de}.list-group-item-warning{color:#e99002;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#e99002}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,button.list-group-item-warning:hover,a.list-group-item-warning:focus,button.list-group-item-warning:focus{color:#e99002;background-color:#faf2cc}a.list-group-item-warning.active,button.list-group-item-warning.active,a.list-group-item-warning.active:hover,button.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus,button.list-group-item-warning.active:focus{color:#fff;background-color:#e99002;border-color:#e99002}.list-group-item-danger{color:#f04124;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#f04124}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,button.list-group-item-danger:hover,a.list-group-item-danger:focus,button.list-group-item-danger:focus{color:#f04124;background-color:#ebcccc}a.list-group-item-danger.active,button.list-group-item-danger.active,a.list-group-item-danger.active:hover,button.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus,button.list-group-item-danger.active:focus{color:#fff;background-color:#f04124;border-color:#f04124}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:21px;background-color:#ffffff;border:1px solid transparent;border-radius:0;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:-1;border-top-left-radius:-1}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:17px;color:inherit}.panel-title>a,.panel-title>small,.panel-title>.small,.panel-title>small>a,.panel-title>.small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #dddddd;border-bottom-right-radius:-1;border-bottom-left-radius:-1}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-right-radius:-1;border-top-left-radius:-1}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:-1;border-bottom-left-radius:-1}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.table,.panel>.table-responsive>.table,.panel>.panel-collapse>.table{margin-bottom:0}.panel>.table caption,.panel>.table-responsive>.table caption,.panel>.panel-collapse>.table caption{padding-left:15px;padding-right:15px}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-right-radius:-1;border-top-left-radius:-1}.panel>.table:first-child>thead:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child{border-top-left-radius:-1;border-top-right-radius:-1}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:-1}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:-1}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:-1;border-bottom-left-radius:-1}.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-left-radius:-1;border-bottom-right-radius:-1}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:-1}.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:-1}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #dddddd}.panel>.table>tbody:first-child>tr:first-child th,.panel>.table>tbody:first-child>tr:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{border:0;margin-bottom:0}.panel-group{margin-bottom:21px}.panel-group .panel{margin-bottom:0;border-radius:0}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.panel-body,.panel-group .panel-heading+.panel-collapse>.list-group{border-top:1px solid #dddddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #dddddd}.panel-default{border-color:#dddddd}.panel-default>.panel-heading{color:#333333;background-color:#f5f5f5;border-color:#dddddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#dddddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#dddddd}.panel-primary{border-color:#008cba}.panel-primary>.panel-heading{color:#ffffff;background-color:#008cba;border-color:#008cba}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#008cba}.panel-primary>.panel-heading .badge{color:#008cba;background-color:#ffffff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#008cba}.panel-success{border-color:#3c9a5f}.panel-success>.panel-heading{color:#ffffff;background-color:#43ac6a;border-color:#3c9a5f}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#3c9a5f}.panel-success>.panel-heading .badge{color:#43ac6a;background-color:#ffffff}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#3c9a5f}.panel-info{border-color:#3db5d8}.panel-info>.panel-heading{color:#ffffff;background-color:#5bc0de;border-color:#3db5d8}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#3db5d8}.panel-info>.panel-heading .badge{color:#5bc0de;background-color:#ffffff}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#3db5d8}.panel-warning{border-color:#d08002}.panel-warning>.panel-heading{color:#ffffff;background-color:#e99002;border-color:#d08002}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d08002}.panel-warning>.panel-heading .badge{color:#e99002;background-color:#ffffff}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d08002}.panel-danger{border-color:#ea2f10}.panel-danger>.panel-heading{color:#ffffff;background-color:#f04124;border-color:#ea2f10}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ea2f10}.panel-danger>.panel-heading .badge{color:#f04124;background-color:#ffffff}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ea2f10}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive iframe,.embed-responsive embed,.embed-responsive object,.embed-responsive video{position:absolute;top:0;left:0;bottom:0;height:100%;width:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#fafafa;border:1px solid #e8e8e8;border-radius:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-lg{padding:24px;border-radius:0}.well-sm{padding:9px;border-radius:0}.close{float:right;font-size:22.5px;font-weight:bold;line-height:1;color:#ffffff;text-shadow:0 1px 0 #ffffff;opacity:0.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#ffffff;text-decoration:none;cursor:pointer;opacity:0.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{display:none;overflow:hidden;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translate(0, -25%);-ms-transform:translate(0, -25%);-o-transform:translate(0, -25%);transform:translate(0, -25%);-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);-o-transform:translate(0, 0);transform:translate(0, 0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#ffffff;border:1px solid #999999;border:1px solid rgba(0,0,0,0.2);border-radius:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,0.5);box-shadow:0 3px 9px rgba(0,0,0,0.5);-webkit-background-clip:padding-box;background-clip:padding-box;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:0.5;filter:alpha(opacity=50)}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.4}.modal-body{position:relative;padding:20px}.modal-footer{padding:20px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.5);box-shadow:0 5px 15px rgba(0,0,0,0.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:normal;letter-spacing:normal;line-break:auto;line-height:1.4;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:12px;opacity:0;filter:alpha(opacity=0)}.tooltip.in{opacity:0.9;filter:alpha(opacity=90)}.tooltip.top{margin-top:-3px;padding:5px 0}.tooltip.right{margin-left:3px;padding:0 5px}.tooltip.bottom{margin-top:3px;padding:5px 0}.tooltip.left{margin-left:-3px;padding:0 5px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#ffffff;text-align:center;background-color:#333333;border-radius:0}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#333333}.tooltip.top-left .tooltip-arrow{bottom:0;right:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#333333}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#333333}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#333333}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#333333}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#333333}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#333333}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#333333}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:normal;letter-spacing:normal;line-break:auto;line-height:1.4;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:15px;background-color:#333333;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #333333;border:1px solid transparent;border-radius:0;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{margin:0;padding:8px 14px;font-size:15px;background-color:#333333;border-bottom:1px solid #262626;border-radius:-1 -1 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{border-width:10px;content:""}.popover.top>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#000000;border-top-color:rgba(0,0,0,0.05);bottom:-11px}.popover.top>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#333333}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#000000;border-right-color:rgba(0,0,0,0.05)}.popover.right>.arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#333333}.popover.bottom>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#000000;border-bottom-color:rgba(0,0,0,0.05);top:-11px}.popover.bottom>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#333333}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#000000;border-left-color:rgba(0,0,0,0.05)}.popover.left>.arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#333333;bottom:-10px}.carousel{position:relative}.carousel-inner{position:relative;overflow:hidden;width:100%}.carousel-inner>.item{display:none;position:relative;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.next,.carousel-inner>.item.active.right{-webkit-transform:translate3d(100%, 0, 0);transform:translate3d(100%, 0, 0);left:0}.carousel-inner>.item.prev,.carousel-inner>.item.active.left{-webkit-transform:translate3d(-100%, 0, 0);transform:translate3d(-100%, 0, 0);left:0}.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right,.carousel-inner>.item.active{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);left:0}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;left:0;bottom:0;width:15%;opacity:0.5;filter:alpha(opacity=50);font-size:20px;color:#ffffff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6);background-color:rgba(0,0,0,0)}.carousel-control.left{background-image:-webkit-linear-gradient(left, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-image:-o-linear-gradient(left, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-image:-webkit-gradient(linear, left top, right top, from(rgba(0,0,0,0.5)), to(rgba(0,0,0,0.0001)));background-image:linear-gradient(to right, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1)}.carousel-control.right{left:auto;right:0;background-image:-webkit-linear-gradient(left, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-image:-o-linear-gradient(left, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-image:-webkit-gradient(linear, left top, right top, from(rgba(0,0,0,0.0001)), to(rgba(0,0,0,0.5)));background-image:linear-gradient(to right, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1)}.carousel-control:hover,.carousel-control:focus{outline:0;color:#ffffff;text-decoration:none;opacity:0.9;filter:alpha(opacity=90)}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;margin-top:-10px;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%;margin-left:-10px}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%;margin-right:-10px}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;line-height:1;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;margin-left:-30%;padding-left:0;list-style:none;text-align:center}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;border:1px solid #ffffff;border-radius:10px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0)}.carousel-indicators .active{margin:0;width:12px;height:12px;background-color:#ffffff}.carousel-caption{position:absolute;left:15%;right:15%;bottom:20px;z-index:10;padding-top:20px;padding-bottom:20px;color:#ffffff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{left:20%;right:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after,.dl-horizontal dd:before,.dl-horizontal dd:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.btn-toolbar:before,.btn-toolbar:after,.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after,.pager:before,.pager:after,.panel-body:before,.panel-body:after,.modal-header:before,.modal-header:after,.modal-footer:before,.modal-footer:after{content:" ";display:table}.clearfix:after,.dl-horizontal dd:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after,.btn-toolbar:after,.btn-group-vertical>.btn-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after,.pager:after,.panel-body:after,.modal-header:after,.modal-footer:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right !important}.pull-left{float:left !important}.hide{display:none !important}.show{display:block !important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none !important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none !important}.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block{display:none !important}@media (max-width:767px){.visible-xs{display:block !important}table.visible-xs{display:table !important}tr.visible-xs{display:table-row !important}th.visible-xs,td.visible-xs{display:table-cell !important}}@media (max-width:767px){.visible-xs-block{display:block !important}}@media (max-width:767px){.visible-xs-inline{display:inline !important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block !important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block !important}table.visible-sm{display:table !important}tr.visible-sm{display:table-row !important}th.visible-sm,td.visible-sm{display:table-cell !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block !important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block !important}table.visible-md{display:table !important}tr.visible-md{display:table-row !important}th.visible-md,td.visible-md{display:table-cell !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block !important}}@media (min-width:1200px){.visible-lg{display:block !important}table.visible-lg{display:table !important}tr.visible-lg{display:table-row !important}th.visible-lg,td.visible-lg{display:table-cell !important}}@media (min-width:1200px){.visible-lg-block{display:block !important}}@media (min-width:1200px){.visible-lg-inline{display:inline !important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block !important}}@media (max-width:767px){.hidden-xs{display:none !important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none !important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none !important}}@media (min-width:1200px){.hidden-lg{display:none !important}}.visible-print{display:none !important}@media print{.visible-print{display:block !important}table.visible-print{display:table !important}tr.visible-print{display:table-row !important}th.visible-print,td.visible-print{display:table-cell !important}}.visible-print-block{display:none !important}@media print{.visible-print-block{display:block !important}}.visible-print-inline{display:none !important}@media print{.visible-print-inline{display:inline !important}}.visible-print-inline-block{display:none !important}@media print{.visible-print-inline-block{display:inline-block !important}}@media print{.hidden-print{display:none !important}}.navbar{border:none;font-size:13px;font-weight:300}.navbar .navbar-toggle:hover .icon-bar{background-color:#b3b3b3}.navbar-collapse{border-top-color:rgba(0,0,0,0.2);-webkit-box-shadow:none;box-shadow:none}.navbar .btn{padding-top:6px;padding-bottom:6px}.navbar-form{margin-top:7px;margin-bottom:5px}.navbar-form .form-control{height:auto;padding:4px 6px}.navbar-text{margin:12px 15px;line-height:21px}.navbar .dropdown-menu{border:none}.navbar .dropdown-menu>li>a,.navbar .dropdown-menu>li>a:focus{background-color:transparent;font-size:13px;font-weight:300}.navbar .dropdown-header{color:rgba(255,255,255,0.5)}.navbar-default .dropdown-menu{background-color:#333333}.navbar-default .dropdown-menu>li>a,.navbar-default .dropdown-menu>li>a:focus{color:#ffffff}.navbar-default .dropdown-menu>li>a:hover,.navbar-default .dropdown-menu>.active>a,.navbar-default .dropdown-menu>.active>a:hover{background-color:#272727}.navbar-inverse .dropdown-menu{background-color:#008cba}.navbar-inverse .dropdown-menu>li>a,.navbar-inverse .dropdown-menu>li>a:focus{color:#ffffff}.navbar-inverse .dropdown-menu>li>a:hover,.navbar-inverse .dropdown-menu>.active>a,.navbar-inverse .dropdown-menu>.active>a:hover{background-color:#006687}.btn{padding:8px 12px}.btn-lg{padding:16px 20px}.btn-sm{padding:8px 12px}.btn-xs{padding:4px 6px}.btn-group .btn~.dropdown-toggle{padding-left:16px;padding-right:16px}.btn-group .dropdown-menu{border-top-width:0}.btn-group.dropup .dropdown-menu{border-top-width:1px;border-bottom-width:0;margin-bottom:0}.btn-group .dropdown-toggle.btn-default~.dropdown-menu{background-color:#e7e7e7;border-color:#cccccc}.btn-group .dropdown-toggle.btn-default~.dropdown-menu>li>a{color:#333333}.btn-group .dropdown-toggle.btn-default~.dropdown-menu>li>a:hover{background-color:#d3d3d3}.btn-group .dropdown-toggle.btn-primary~.dropdown-menu{background-color:#008cba;border-color:#0079a1}.btn-group .dropdown-toggle.btn-primary~.dropdown-menu>li>a{color:#ffffff}.btn-group .dropdown-toggle.btn-primary~.dropdown-menu>li>a:hover{background-color:#006d91}.btn-group .dropdown-toggle.btn-success~.dropdown-menu{background-color:#43ac6a;border-color:#3c9a5f}.btn-group .dropdown-toggle.btn-success~.dropdown-menu>li>a{color:#ffffff}.btn-group .dropdown-toggle.btn-success~.dropdown-menu>li>a:hover{background-color:#388f58}.btn-group .dropdown-toggle.btn-info~.dropdown-menu{background-color:#5bc0de;border-color:#46b8da}.btn-group .dropdown-toggle.btn-info~.dropdown-menu>li>a{color:#ffffff}.btn-group .dropdown-toggle.btn-info~.dropdown-menu>li>a:hover{background-color:#39b3d7}.btn-group .dropdown-toggle.btn-warning~.dropdown-menu{background-color:#e99002;border-color:#d08002}.btn-group .dropdown-toggle.btn-warning~.dropdown-menu>li>a{color:#ffffff}.btn-group .dropdown-toggle.btn-warning~.dropdown-menu>li>a:hover{background-color:#c17702}.btn-group .dropdown-toggle.btn-danger~.dropdown-menu{background-color:#f04124;border-color:#ea2f10}.btn-group .dropdown-toggle.btn-danger~.dropdown-menu>li>a{color:#ffffff}.btn-group .dropdown-toggle.btn-danger~.dropdown-menu>li>a:hover{background-color:#dc2c0f}.lead{color:#6f6f6f}cite{font-style:italic}blockquote{border-left-width:1px;color:#6f6f6f}blockquote.pull-right{border-right-width:1px}blockquote small{font-size:12px;font-weight:300}table{font-size:12px}label,.control-label,.help-block,.checkbox,.radio{font-size:12px;font-weight:normal}input[type="radio"],input[type="checkbox"]{margin-top:1px}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{border-color:transparent}.nav-tabs>li>a{background-color:#e7e7e7;color:#222222}.nav-tabs .caret{border-top-color:#222222;border-bottom-color:#222222}.nav-pills{font-weight:300}.breadcrumb{border:1px solid #dddddd;border-radius:3px;font-size:10px;font-weight:300;text-transform:uppercase}.pagination{font-size:12px;font-weight:300;color:#999999}.pagination>li>a,.pagination>li>span{margin-left:4px;color:#999999}.pagination>.active>a,.pagination>.active>span{color:#fff}.pagination>li>a,.pagination>li:first-child>a,.pagination>li:last-child>a,.pagination>li>span,.pagination>li:first-child>span,.pagination>li:last-child>span{border-radius:3px}.pagination-lg>li>a,.pagination-lg>li>span{padding-left:22px;padding-right:22px}.pagination-sm>li>a,.pagination-sm>li>span{padding:0 5px}.pager{font-size:12px;font-weight:300;color:#999999}.list-group{font-size:12px;font-weight:300}.close{opacity:0.4;text-decoration:none;text-shadow:none}.close:hover,.close:focus{opacity:1}.alert{font-size:12px;font-weight:300}.alert .alert-link{font-weight:normal;color:#fff;text-decoration:underline}.label{padding-left:1em;padding-right:1em;border-radius:0;font-weight:300}.label-default{background-color:#e7e7e7;color:#333333}.badge{font-weight:300}.progress{height:22px;padding:2px;background-color:#f6f6f6;border:1px solid #ccc;-webkit-box-shadow:none;box-shadow:none}.dropdown-menu{padding:0;margin-top:0;font-size:12px}.dropdown-menu>li>a{padding:12px 15px}.dropdown-header{padding-left:15px;padding-right:15px;font-size:9px;text-transform:uppercase}.popover{color:#fff;font-size:12px;font-weight:300}.panel-heading,.panel-footer{border-top-right-radius:0;border-top-left-radius:0}.panel-default .close{color:#222222}.modal .close{color:#222222} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/bootswatch/fonts/glyphicons-halflings-regular.eot b/src/LanBackup.WebApp/ClientApp/app/bootswatch/fonts/glyphicons-halflings-regular.eot new file mode 100644 index 0000000..b93a495 Binary files /dev/null and b/src/LanBackup.WebApp/ClientApp/app/bootswatch/fonts/glyphicons-halflings-regular.eot differ diff --git a/src/LanBackup.WebApp/ClientApp/app/bootswatch/fonts/glyphicons-halflings-regular.svg b/src/LanBackup.WebApp/ClientApp/app/bootswatch/fonts/glyphicons-halflings-regular.svg new file mode 100644 index 0000000..94fb549 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/bootswatch/fonts/glyphicons-halflings-regular.svg @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/bootswatch/fonts/glyphicons-halflings-regular.ttf b/src/LanBackup.WebApp/ClientApp/app/bootswatch/fonts/glyphicons-halflings-regular.ttf new file mode 100644 index 0000000..1413fc6 Binary files /dev/null and b/src/LanBackup.WebApp/ClientApp/app/bootswatch/fonts/glyphicons-halflings-regular.ttf differ diff --git a/src/LanBackup.WebApp/ClientApp/app/bootswatch/fonts/glyphicons-halflings-regular.woff b/src/LanBackup.WebApp/ClientApp/app/bootswatch/fonts/glyphicons-halflings-regular.woff new file mode 100644 index 0000000..9e61285 Binary files /dev/null and b/src/LanBackup.WebApp/ClientApp/app/bootswatch/fonts/glyphicons-halflings-regular.woff differ diff --git a/src/LanBackup.WebApp/ClientApp/app/bootswatch/fonts/glyphicons-halflings-regular.woff2 b/src/LanBackup.WebApp/ClientApp/app/bootswatch/fonts/glyphicons-halflings-regular.woff2 new file mode 100644 index 0000000..64539b5 Binary files /dev/null and b/src/LanBackup.WebApp/ClientApp/app/bootswatch/fonts/glyphicons-halflings-regular.woff2 differ diff --git a/src/LanBackup.WebApp/ClientApp/app/components/app/app.component.css b/src/LanBackup.WebApp/ClientApp/app/components/app/app.component.css new file mode 100644 index 0000000..48b2036 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/components/app/app.component.css @@ -0,0 +1,73 @@ +body { + padding-top: 50px; +} + + +/*override pagination styles*/ +.pagination { + margin: 10px 5px 5px 10px; +} + + .pagination > li { + cursor: pointer; + } + + + +/*switch adjust*/ +.switchAdjust { + margin-top: 2px; +} + + +.mypointerlink { + cursor: pointer; +} + +.nounderline:hover { + text-decoration: none; +} + + +.progress { + margin: 0px; + padding: 0px; +} + +.tabledesc { + padding-top: 5px; + padding-bottom: 15px; +} + + + + +.navbar-default { + z-index: 1030; +} + + +.anyLoadingTable { + float: left +} +.spinnercontainer{ + float: none; + background-color: rgba(0, 0, 0, 0.10); + margin: 0; + height: 100%; + width: 100%; + text-align: center; + position: relative; +} +.myspinnerback { + height:100%; + min-height:100%; + width:100%; + float:left; + position:absolute; +} + +.myspinner { + top:45%; + position:relative; +} diff --git a/src/LanBackup.WebApp/ClientApp/app/components/app/app.component.html b/src/LanBackup.WebApp/ClientApp/app/components/app/app.component.html new file mode 100644 index 0000000..60f40ef --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/components/app/app.component.html @@ -0,0 +1,7 @@ + +
+
+ +
+
+ \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/components/app/app.component.ts b/src/LanBackup.WebApp/ClientApp/app/components/app/app.component.ts new file mode 100644 index 0000000..cd50162 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/components/app/app.component.ts @@ -0,0 +1,52 @@ +import { Component, OnInit, ViewEncapsulation } from '@angular/core'; +import { AuthenticationService } from '../../services/authentication.service'; +import { Observable } from 'rxjs/Observable'; + +import { MessageService, Messages } from '../../services/message.service'; +import { NotificationsService } from '../../services/notifications.service'; +import { LoggerService, Level } from '../../services/logger.service'; +import { AgentsService } from '../../services/agents.service'; +import { AppInsightsService } from 'ng2-appinsights'; + +import { GlobalRef } from '../../shared/global/global-ref'; + +@Component({ + selector: 'app', + templateUrl: './app.component.html', + styleUrls: [ + "../../../../node_modules/ng2-toasty/style-material.css" + , '../../bootswatch/css/bootstrap_yeti.min.css' + ,'./app.component.css' //THIS SHOULD BE LATS TO OVERRIDE OTHER GLOBAL STYLES + ], + encapsulation: ViewEncapsulation.None +}) +export class AppComponent implements OnInit { + + + instrumentationEnabled: boolean; + instrumentationKey: string; + + constructor( + private authService: AuthenticationService, + private _service: NotificationsService, + private messageService: MessageService, + private log: LoggerService, + private agentsService: AgentsService, + private appinsightsService: AppInsightsService, + private _global: GlobalRef + ) { + this.instrumentationEnabled = _global.nativeGlobal.clientSettings.instrumentationEnabled; + this.instrumentationKey = _global.nativeGlobal.clientSettings.instrumentationKey; + log.level = Level.DEBUG; + if (this.instrumentationEnabled) { + this.appinsightsService.Init({ + instrumentationKey: this.instrumentationKey // key obtained from clientSettings + }); + } + } + + ngOnInit() { + this.agentsService.refreshAgents(); + } + +} diff --git a/src/LanBackup.WebApp/ClientApp/app/components/dashboard/dashboard.component.css b/src/LanBackup.WebApp/ClientApp/app/components/dashboard/dashboard.component.css new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/components/dashboard/dashboard.component.css @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/components/dashboard/dashboard.component.html b/src/LanBackup.WebApp/ClientApp/app/components/dashboard/dashboard.component.html new file mode 100644 index 0000000..ad33faa --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/components/dashboard/dashboard.component.html @@ -0,0 +1,77 @@ +
+
+ + LanBackup Agents activity board + + +
+ + +
+ + +
+
+ Here you can monitor registered backup agents. +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
Computer IPConfig IDStatusProgressLast Report
{{agent.ip}}{{agent.configurationId ? agent.configurationId : '---'}}{{agent.statusType}}{{agent.statusDescription}} + + {{agent.statusPercent}}% + {{agent.statusDateTime | date: 'hh:mm:ss dd/MM/yyyy'}}
+ +
+
+
+ +
+
+
+ +
+ + + + + + + + +
+ +
diff --git a/src/LanBackup.WebApp/ClientApp/app/components/dashboard/dashboard.component.ts b/src/LanBackup.WebApp/ClientApp/app/components/dashboard/dashboard.component.ts new file mode 100644 index 0000000..ec38bd8 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/components/dashboard/dashboard.component.ts @@ -0,0 +1,81 @@ +import { Component, OnInit, Input, ViewChild, ChangeDetectorRef } from '@angular/core'; +import { StatusReportInfo } from '../../model/StatusReportInfo'; +import { SaveResult } from '../../model/SaveResult'; +import { PaginatedList } from '../../model/PaginatedList'; +import { WebApiService } from '../../services/webapi.service'; +import { Observable } from 'rxjs/Observable'; +import { AuthenticationService } from '../../services/authentication.service'; +import { ModalComponent } from '../../shared/modal/modal.component'; + +import { LoggerService } from '../../services/logger.service'; +import { ToastNotification, ToastType } from '../../services/notifications.service'; +import { MessageService, Messages } from '../../services/message.service'; +import { AgentsService } from '../../services/agents.service'; +import { Subscription } from 'rxjs/Subscription'; + + +@Component({ + selector: 'dashboard', + templateUrl: './dashboard.component.html', + styleUrls: ['./dashboard.component.css' + ] +}) +export class DashboardComponent implements OnInit { + + + private list: StatusReportInfo[] = []; // PaginatedList = new PaginatedList(null); + + type = 'info';//can be success, info, warning, danger + currentPage: number = 1; + pageSize: number = 5; + totalPages: number; + public isloading = false; + + private subscription: Subscription; + + + constructor( + private webApi: WebApiService, + private _service: AuthenticationService, + private messageService: MessageService, + private log: LoggerService, + private agentsService: AgentsService, + private changeDetectionRef: ChangeDetectorRef + ) { + this.subscription = this.messageService.subscribe(Messages.MESSAGE_REFRESHAGENTS, (payload) => { + //this.log.debug(payload); + this.list = payload as StatusReportInfo[]; + //trigger change detection + setTimeout(() => + //mark for detection change and refresh + this.changeDetectionRef.detectChanges() + , 10); + + this.isloading = false; + }); + } + + + showToast(toast: ToastNotification) { + this.messageService.broadcast(Messages.MESSAGE_NOTIFY, toast); + } + + + ngOnInit(): void { + this.list = this.agentsService.getAgents(); + } + + + doRefresh() { + this.isloading = true; + //force service refresh + this.agentsService.refreshAgents(); + } + + getPage(page: number) { + this.currentPage = page + this.totalPages = this.list.length; + } + + +} diff --git a/src/LanBackup.WebApp/ClientApp/app/components/login/login.component.css b/src/LanBackup.WebApp/ClientApp/app/components/login/login.component.css new file mode 100644 index 0000000..dde6ea1 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/components/login/login.component.css @@ -0,0 +1,47 @@ +body { + padding-top: 50px; +} +.pagetemplate { + padding: 50px 0px 15px; + text-align: left; +} +.panel-default { + margin-top:20px; +} + + + + + +.newbackup{ + float: right; + clear: both; +} + +.table-footer{ + padding: 0px; +} + +.pagination{ + margin: 5px 0px 0px; +} + +.tabledesc{ + margin: 10px 10px 25PX; +} + + + +.mytitle{ + padding-left: 20px; +} + +#myTabContent { + margin-top: 20px; +} + + +.form-horizontal .form-group{ + margin-left: 0px; + margin-right: 0px; +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/components/login/login.component.html b/src/LanBackup.WebApp/ClientApp/app/components/login/login.component.html new file mode 100644 index 0000000..62d8fbb --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/components/login/login.component.html @@ -0,0 +1,89 @@ +
+ + + +
+
+

Have an Account?

+
+
+
+ +
+
+ + + + + +
+
+ + +
+ +
+
+ +
+ + +
+ +
+
+

+ {{errorMsg}} +

+
+ + +
+
+ +
+ + + + +
+ +
+ + +
+ +
+
+
+ + +
+ +
+
+
+ + +
+ +
+
+

+ {{errorMsg}} +

+
+ + +
+ +
+
+
+
+
+ +
diff --git a/src/LanBackup.WebApp/ClientApp/app/components/login/login.component.ts b/src/LanBackup.WebApp/ClientApp/app/components/login/login.component.ts new file mode 100644 index 0000000..87445e8 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/components/login/login.component.ts @@ -0,0 +1,97 @@ +import { Component, OnInit, Input } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { Router } from '@angular/router'; +import { AuthenticationService, User } from '../../services/authentication.service'; + +import { LoggerService } from '../../services/logger.service'; +import { ToastNotification, ToastType } from '../../services/notifications.service'; +import { MessageService, Messages } from '../../services/message.service'; + + +@Component({ + selector: 'login', + templateUrl: './login.component.html', + styleUrls: ['./login.component.css'] +}) +export class LoginComponent implements OnInit { + + + public user = new User({ email: '', password: '', isAdmin: false }); + public errorMsg = ''; + public repassword = ''; + + constructor( + private _service: AuthenticationService, + private _router: Router, + private messageService: MessageService, + private log: LoggerService + ) { + } + + + + showToast(toast: ToastNotification) { + this.messageService.broadcast(Messages.MESSAGE_NOTIFY, toast); + } + + + ngOnInit(): void { + if (this._service.checkIsLoggedIn()) { + this.log.debug('oninit() navigate to root'); + this._router.navigate(['/']); + } + } + + + doLogin() { + this.log.debug("doLogin()"); + if (this.user.password.length > 0 && + this.user.email.length > 0) { + // + this._service.login(this.user, () => { + //data + }, err => { + this.showToast({ + title: "Login error", + body: err, + type: ToastType.error + }); + }); + } + } + + doRegister() { + this.log.debug("doRegister()"); + if (this.repassword.length > 0 && this.repassword == this.user.password && + this.user.email.length > 0) { + this._service.registerUser(this.user, () => { + //is registered + this.showToast({ + title: "Register success", + body: "The user has been created", + type: ToastType.success + }); + //navigate default to root + this._router.navigate(['/']);//to default or last url + }, + (err) => { + this.showToast({ + title: "Register error", + body: err.text(), + type: ToastType.error + }); + this.log.error(err); + }); + } + else { + this.showToast({ + title: "Invalid data", + body: "Some data not OK!", + type: ToastType.error + }); + } + } + + +} + diff --git a/src/LanBackup.WebApp/ClientApp/app/components/logs/logs.component.css b/src/LanBackup.WebApp/ClientApp/app/components/logs/logs.component.css new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/components/logs/logs.component.css @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/components/logs/logs.component.html b/src/LanBackup.WebApp/ClientApp/app/components/logs/logs.component.html new file mode 100644 index 0000000..5e3b179 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/components/logs/logs.component.html @@ -0,0 +1,70 @@ +
+
+ + Logs + + +
+ + +
+ + +
+ +
+ Here are all agents and operations logs.
+
+
+ + + +
+ + + + + + + + + + + + + + + + + + + +
DateTimeComputer IPDescriptionErrorStatus
{{logItem.dateTime | date: 'yyyy/MM/dd hh:mm:ss'}}{{logItem.clientIP}}{{logItem.description}}{{logItem.logError}}{{logItem.status}}
+
+
+
+ +
+
+
+
+ + + + + + +
+ + + +
+ diff --git a/src/LanBackup.WebApp/ClientApp/app/components/logs/logs.component.ts b/src/LanBackup.WebApp/ClientApp/app/components/logs/logs.component.ts new file mode 100644 index 0000000..555bf71 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/components/logs/logs.component.ts @@ -0,0 +1,67 @@ +import { Component, OnInit, Input, ViewChild } from '@angular/core'; +import { BackupConfiguration } from '../../model/BackupConfiguration'; +import { PaginatedList } from '../../model/PaginatedList'; +import { WebApiService } from '../../services/webapi.service'; +import { Observable } from 'rxjs/Observable'; +import { AuthenticationService } from '../../services/authentication.service'; +import { ModalComponent } from '../../shared/modal/modal.component'; +import { BackupLog } from '../../model/BackupLog'; + +import { LoggerService } from '../../services/logger.service'; +import { ToastNotification, ToastType } from '../../services/notifications.service'; +import { MessageService, Messages } from '../../services/message.service'; + + +@Component({ + selector: 'logs', + templateUrl: './logs.component.html', + styleUrls: ['./logs.component.css'] +}) +export class LogsComponent implements OnInit { + + + public list: PaginatedList = new PaginatedList(null); + + + currentPage: number = 1; + pageSize: number = 10; + totalPages: number; + isloading: boolean; + + + constructor( + private webApi: WebApiService, + private _service: AuthenticationService, + private messageService: MessageService, + private log: LoggerService + ) { } + + + ngOnInit(): void { + this.doRefresh(); + } + + + doRefresh() { + this.getPage(this.currentPage); + } + + + getPage(page: number) { + //this.log.debug('getting page: ' + page); + this.isloading = true; + this.webApi.getLogsPage(page, this.pageSize).subscribe( + (data) => { + setTimeout(() => { + this.list = data; + this.currentPage = page + this.totalPages = data.tp * this.pageSize; + this.isloading = false; + }, 400);//induced delay + }, + err => this.log.error(err) + ); + } + + +} diff --git a/src/LanBackup.WebApp/ClientApp/app/components/navmenu/navmenu.component.css b/src/LanBackup.WebApp/ClientApp/app/components/navmenu/navmenu.component.css new file mode 100644 index 0000000..ec3acae --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/components/navmenu/navmenu.component.css @@ -0,0 +1,34 @@ +body { + padding-top: 50px; +} +.pagetemplate { + padding: 15px 50px 15px; + text-align: left; +} + + +.newbackup{ + float: right; + clear: both; +} + +.table-footer{ + padding: 0px; +} + +.pagination{ + margin: 5px 0px 0px; +} + +.tabledesc{ + margin: 10px 10px 25PX; +} + + + +@media (max-width: 767px) { + /* On small screens, the nav menu spans the full width of the screen. Leave a space for it. */ + .body-content { + padding-top: 50px; + } +} diff --git a/src/LanBackup.WebApp/ClientApp/app/components/navmenu/navmenu.component.html b/src/LanBackup.WebApp/ClientApp/app/components/navmenu/navmenu.component.html new file mode 100644 index 0000000..2c18174 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/components/navmenu/navmenu.component.html @@ -0,0 +1,27 @@ + diff --git a/src/LanBackup.WebApp/ClientApp/app/components/navmenu/navmenu.component.ts b/src/LanBackup.WebApp/ClientApp/app/components/navmenu/navmenu.component.ts new file mode 100644 index 0000000..bb3f7b6 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/components/navmenu/navmenu.component.ts @@ -0,0 +1,45 @@ +import { Component, ChangeDetectorRef } from '@angular/core'; +import { AuthenticationService, User } from '../../services/authentication.service'; +import { MessageService, Messages } from '../../services/message.service'; +//import { AgentsService } from '../../services/agents.service'; +import { Subscription } from 'rxjs/Subscription'; +import { StatusReportInfo } from '../../model/StatusReportInfo'; + + +@Component({ + selector: 'nav-menu', + templateUrl: './navmenu.component.html', + styleUrls: ['./navmenu.component.css'], + //providers: [AuthenticationService] +}) +export class NavMenuComponent { + + private subscription: Subscription; + private agentsCount: number = 0; + + constructor( + private _authService: AuthenticationService, + //private agentsService: AgentsService, + private messageService: MessageService, + private changeDetectionRef: ChangeDetectorRef + ) { + this.subscription = this.messageService.subscribe(Messages.MESSAGE_REFRESHAGENTS, (payload) => { + let list = payload as StatusReportInfo[]; + this.agentsCount = list.length; + + setTimeout(() => + this.changeDetectionRef.detectChanges() + , 10); + }); + } + + + isLoggedIn() { + return this._authService.checkIsLoggedIn(); + } + + logOut() { + this._authService.logout(); + } + +} diff --git a/src/LanBackup.WebApp/ClientApp/app/components/profile/profile.component.css b/src/LanBackup.WebApp/ClientApp/app/components/profile/profile.component.css new file mode 100644 index 0000000..b413937 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/components/profile/profile.component.css @@ -0,0 +1,46 @@ +body { + padding-top: 50px; +} +.pagetemplate { + padding: 50px 0px 15px; + text-align: left; +} +.panel-default { + margin-top:20px; +} + + + + +.newbackup{ + float: right; + clear: both; +} + +.table-footer{ + padding: 0px; +} + +.pagination{ + margin: 5px 0px 0px; +} + +.tabledesc{ + margin: 10px 10px 25PX; +} + + + +.mytitle{ + padding-left: 20px; +} + +#myTabContent { + margin-top: 20px; +} + + +.form-horizontal .form-group{ + margin-left: 0px; + margin-right: 0px; +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/components/profile/profile.component.html b/src/LanBackup.WebApp/ClientApp/app/components/profile/profile.component.html new file mode 100644 index 0000000..873ba39 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/components/profile/profile.component.html @@ -0,0 +1,52 @@ +
+ + + +
+
+

Your profile - {{user.email}} {{isAdmin() ? " - (Admin)" : ''}}

+
+
+
+ +
+ +
+

+ Here you can change your password +

+
+ +
+ + +
+ +
+
+ +
+ + +
+ +
+
+ +

+ {{errorMsg}} +

+
+ + +
+ +
+ + +
+
+
+ + +
\ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/components/profile/profile.component.ts b/src/LanBackup.WebApp/ClientApp/app/components/profile/profile.component.ts new file mode 100644 index 0000000..00a149a --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/components/profile/profile.component.ts @@ -0,0 +1,85 @@ +import { Component, OnInit, Input } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { Router } from '@angular/router'; +import { AuthenticationService, User } from '../../services/authentication.service'; +import { WebApiService } from '../../services/webapi.service'; + +import { LoggerService } from '../../services/logger.service'; +import { ToastNotification, ToastType } from '../../services/notifications.service'; +import { MessageService, Messages } from '../../services/message.service'; + + +@Component({ + selector: 'profile', + templateUrl: './profile.component.html', + styleUrls: ['./profile.component.css'] +}) +export class ProfileComponent implements OnInit { + + + public user : User; + public errorMsg = ''; + public password: string = ''; + public repassword: string = ''; + + constructor( + private _service: AuthenticationService, + private _router: Router, + private _webApi: WebApiService, + private messageService: MessageService, + private log: LoggerService + ) { + } + + ngOnInit(): void { + this.user = this._service.getLoggedUser(); + } + + showToast(toast: ToastNotification) { + this.messageService.broadcast(Messages.MESSAGE_NOTIFY, toast); + } + + isAdmin() { + return this._service.checkIsAdmin(); + } + + doChangePassword() { + this.password = this.password.trim(); + this.repassword = this.repassword.trim(); + + let mpass = this.password.trim(); + let mrepass = this.repassword.trim(); + + if (this.user && this.user.email && + mpass.length > 0 && + mpass == mrepass) { + this.user.newpassword = mpass; + this._webApi.changePassword(this.user).subscribe((data) => { + if (data.succeeded) { + //notify pwd changed + this.showToast({ title: "Password change success", body: "Password has been changed!", type: ToastType.success }); + } + else { + //notify something not OK + this.showToast({ title: "Password change error", body: data.errors, type: ToastType.error }); + } + }, err => { + this.log.error(err); + //notify err + this.showToast({ title: "Password change error", body: err.text(), type: ToastType.error }); + }); + } + else if (mpass.length == 0) { + this.errorMsg = 'Password cannot be empty!'; + this.showToast({ title: "Error", body: this.errorMsg, type: ToastType.error }); + } + else { + this.errorMsg = 'Passwords does not match!'; + this.showToast({ title: "Error", body: this.errorMsg, type: ToastType.error }); + } + } + + + +} + diff --git a/src/LanBackup.WebApp/ClientApp/app/components/users/users.component.css b/src/LanBackup.WebApp/ClientApp/app/components/users/users.component.css new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/components/users/users.component.css @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/components/users/users.component.html b/src/LanBackup.WebApp/ClientApp/app/components/users/users.component.html new file mode 100644 index 0000000..9faeb8f --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/components/users/users.component.html @@ -0,0 +1,54 @@ +
+
Manage Admin Users
+ + +
+ + +
+
+ Here an Admin user can grant or revoke "Admin" role for other users.
+
+
+ + + +
+ + + + + + + + + + + + + +
User nameIs Admin
{{userItem.email}} +
+ + +
+
+
+ + + + + + +
+ + + +
+ diff --git a/src/LanBackup.WebApp/ClientApp/app/components/users/users.component.ts b/src/LanBackup.WebApp/ClientApp/app/components/users/users.component.ts new file mode 100644 index 0000000..9491e21 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/components/users/users.component.ts @@ -0,0 +1,101 @@ +import { Component, OnInit, Input, ViewChild } from '@angular/core'; +import { BackupConfiguration } from '../../model/BackupConfiguration'; +import { PaginatedList } from '../../model/PaginatedList'; +import { WebApiService } from '../../services/webapi.service'; +import { Observable } from 'rxjs/Observable'; +import { AuthenticationService } from '../../services/authentication.service'; + +import { User } from '../../services/authentication.service'; + +import { LoggerService } from '../../services/logger.service'; +import { ToastNotification, ToastType } from '../../services/notifications.service'; +import { MessageService, Messages } from '../../services/message.service'; + + +@Component({ + selector: 'logs', + templateUrl: './users.component.html', + styleUrls: ['./users.component.css'] +}) +export class UsersComponent implements OnInit { + + + public list: User[] = new Array(); + currentPage: number = 1; + pageSize: number = 10; + totalPages: number; + loading: boolean; + + + constructor( + private webApi: WebApiService, + private _service: AuthenticationService, + private messageService: MessageService, + private log: LoggerService + ) { } + + + ngOnInit(): void { + this.getPage(); + } + + + showToast(toast: ToastNotification) { + this.messageService.broadcast(Messages.MESSAGE_NOTIFY, toast); + } + + + getPage() { + //this.log.debug('getting page: ' + page); + this.loading = true; + this.webApi.getAllUsers().subscribe( + (data) => { + //this.log.debug('data: ' + JSON.stringify(data)); + this.list = data; + + this.totalPages = data.length;// data.tp * this.pageSize; + this.loading = false; + }, + err => this.log.error(err) + ); + } + + + toggleAdmin(user: User) { + let prevValue = user.isAdmin; + user.isAdmin = user.isAdmin ? false : true; + this.log.debug('Make user admin - ' + user.isAdmin); + return this.webApi.changeAdminRole(user).subscribe((data) => { + // + if (data.succeeded) { + this.showToast({ title: "User change success", body: `User ${user.email} has been ${user.isAdmin ? "promoted" : "revoked"}`, type: ToastType.success }); + } + else { + user.isAdmin = prevValue; + this.log.debug(data); + this.showToast({ title: "User change error", body: `The user ${user.email} cannot be changed!`, type: ToastType.error }); + } + }, err => { + this.log.error(err); + user.isAdmin = prevValue; + this.showToast({ title: "User change error", body: err, type: ToastType.error }); + }); + } + + isAllowedToChange(user: User) { + let isAdmin = this._service.checkIsAdmin(); + if (isAdmin) { + let currentUser = this._service.getLoggedUser(); + if (currentUser) { + if (currentUser.email == user.email) { + //not allowed to change your own password + return false; + } else { + return true;//only case to allow editing + } + } + } + return false; + } + +} diff --git a/src/LanBackup.WebApp/ClientApp/app/model/BackupConfiguration.ts b/src/LanBackup.WebApp/ClientApp/app/model/BackupConfiguration.ts new file mode 100644 index 0000000..958c504 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/model/BackupConfiguration.ts @@ -0,0 +1,17 @@ +export class BackupConfiguration { + id: string; + clientIP: string; + srcFolder: string; + srcUser: string; + srcPass: string; + destLanFolder: string; + destUser: string; + destPass: string; + crontab: string; + isActive: boolean; + rowVersion: string; + + constructor(data) { + Object.assign(this, data); + } +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/model/BackupLog.ts b/src/LanBackup.WebApp/ClientApp/app/model/BackupLog.ts new file mode 100644 index 0000000..c343035 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/model/BackupLog.ts @@ -0,0 +1,13 @@ +export class BackupLog { + iD: string; + clientIP: string; + configurationID: string; + description: string; + logError: string; + status: string; + dateTime: Date; + + constructor(data) { + Object.assign(this, data); + } +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/model/PaginatedList.ts b/src/LanBackup.WebApp/ClientApp/app/model/PaginatedList.ts new file mode 100644 index 0000000..c7d2f59 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/model/PaginatedList.ts @@ -0,0 +1,11 @@ +export class PaginatedList { + pi: number; + tp: number; + recs: T[]; + hp: boolean; + hn: boolean; + + constructor(data) { + Object.assign(this, data); + } +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/model/SaveResult.ts b/src/LanBackup.WebApp/ClientApp/app/model/SaveResult.ts new file mode 100644 index 0000000..723d417 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/model/SaveResult.ts @@ -0,0 +1,10 @@ +export class SaveResult { + _body: T; + status: string; + ok: string; + statusText: string; + + constructor(data) { + Object.assign(this, data); + } +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/model/SignInResult.ts b/src/LanBackup.WebApp/ClientApp/app/model/SignInResult.ts new file mode 100644 index 0000000..28f535d --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/model/SignInResult.ts @@ -0,0 +1,10 @@ +export class SignInResult { + succeeded: boolean; + isLockedOut: boolean; + isNotAllowed: boolean; + requiresTwoFactor: boolean; + + constructor(data) { + Object.assign(this, data); + } +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/model/StatusReportInfo.ts b/src/LanBackup.WebApp/ClientApp/app/model/StatusReportInfo.ts new file mode 100644 index 0000000..c4aa1bd --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/model/StatusReportInfo.ts @@ -0,0 +1,13 @@ +export class StatusReportInfo { + + iP: string; + configurationId: string; + statusType: number; + statusDescription: string; + statusPercent: number; + statusDateTime: Date; + + constructor(data) { + Object.assign(this, data); + } +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/services/AuthGuard.ts b/src/LanBackup.WebApp/ClientApp/app/services/AuthGuard.ts new file mode 100644 index 0000000..5fc2602 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/services/AuthGuard.ts @@ -0,0 +1,26 @@ +import { Injectable, Inject } from '@angular/core'; +import { CanActivate } from '@angular/router'; +import { Router } from '@angular/router'; +import { AuthenticationService } from './authentication.service'; + + +@Injectable() +export class AuthGuard implements CanActivate { + + auth: any = {}; + + constructor(private authService: AuthenticationService, private router: Router) { + + } + + canActivate() { + if (this.authService.checkIsLoggedIn()) { + //this.router.navigate(['/']); + return true; + } + else { + this.router.navigate(['/login']); + } + return false; + } +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/services/agents.service.ts b/src/LanBackup.WebApp/ClientApp/app/services/agents.service.ts new file mode 100644 index 0000000..8364e03 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/services/agents.service.ts @@ -0,0 +1,60 @@ +import { Injectable } from '@angular/core'; +import { WebApiService } from '../services/webapi.service'; +import { LoggerService } from './logger.service'; +import { StatusReportInfo } from '../model/StatusReportInfo'; +import { MessageService, Messages } from './message.service'; +import { Observable } from 'rxjs/Observable'; + + +@Injectable() +export class AgentsService { + + isLoaded: boolean; + agents: StatusReportInfo[] = []; + connectionState$: Observable; + + + constructor( + private webApi: WebApiService, + private messageService: MessageService, + private log: LoggerService, + + ) { + //wiring signalr + + this.log.debug('connecting to signalr'); + + let service = this; + let connection = $["hubConnection"](); // $.hubConnection(); + let contosoChatHubProxy = connection.createHubProxy('backupslan'); + //hook on client methos 'agentsRefresh' + contosoChatHubProxy.on('agentsRefresh', function (newagents) { + service.agents = newagents as StatusReportInfo[]; + service.messageService.broadcast(Messages.MESSAGE_REFRESHAGENTS, service.agents); + }); + connection.start().done(function () { + //service.log.debug('SignalR connected'); + }); + + } + + + + getAgents() { + if (!this.isLoaded) { + this.refreshAgents(); + } + return this.agents; + } + + refreshAgents() { + this.isLoaded = false; + this.webApi.getAgentsAll() + .subscribe(data => { + this.agents = data; + this.isLoaded = true; + this.messageService.broadcast(Messages.MESSAGE_REFRESHAGENTS, this.agents); + }); + } + +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/services/authentication.service.ts b/src/LanBackup.WebApp/ClientApp/app/services/authentication.service.ts new file mode 100644 index 0000000..3a6b511 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/services/authentication.service.ts @@ -0,0 +1,136 @@ +import { Injectable, Inject } from '@angular/core'; +import { Router } from '@angular/router'; +import { Location } from '@angular/common'; +import { isBrowser } from 'angular2-universal'; +import { Observable } from 'rxjs/Observable'; +import { RequestOptions, Request, RequestMethod } from '@angular/http'; +import { WebApiService } from './webapi.service'; + +import { LoggerService } from './logger.service'; + + +export class User { + + email: string; + password: string; + newpassword: string; + isAdmin: boolean; + succeeded: boolean; + isLockedOut: boolean; + errors: any; + + constructor(data) { + Object.assign(this, data); + } +} + + +@Injectable() +export class AuthenticationService { + + constructor( + private _router: Router, + private location: Location, + private webApi: WebApiService, + private log: LoggerService + ) { } + + + + + logout() { + localStorage.removeItem("user"); + this._router.navigate(['login']); + } + + login(user: User, success, error) { + + return this.webApi.loginUser(user) + .subscribe(data => { + if (data.succeeded) { + localStorage.setItem("user", btoa(JSON.stringify(data))); + this._router.navigate(['/']);//to default or last url + success(data); + } + else { + //clear + localStorage.removeItem("user"); + error(data.errors.map(err=>err.description)); + } + }, err => { + error(err); + }); + } + + registerUser(user: User, success, error) { + return this.webApi.registerUser(user) + .subscribe(data => { + if (data.succeeded) { + localStorage.setItem("user", btoa(JSON.stringify(data))); + //created and logged in + success(); + } + else { + //could not create + localStorage.removeItem("user"); + } + }, err => { + error(err); + }) + ; + } + + + + + + getLoggedUser(): User { + if (isBrowser) { + if (localStorage.getItem("user") === null) { + return null; + } + let _user: User = JSON.parse(atob(localStorage.getItem("user"))); + return _user; + } + return null; + } + + checkCredentials() { + if (isBrowser) { + if (localStorage.getItem("user") === null) { + this._router.navigate(['login']); + } + return true; + } + return false; + } + + checkIsAdmin() { + if (isBrowser) { + if (localStorage.getItem("user") != null) { + let _user: User = JSON.parse(atob(localStorage.getItem("user"))); + return _user && _user.isAdmin; + } + return false; + } + return false; + } + + checkIsLoggedIn() { + if (isBrowser) { + try { + if (localStorage.getItem("user") === null) { + return false; + } + return true; + } + catch (e) { + this.log.error('e: ' + e); + } + return false; + } + return false; + } + + +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/services/channel.service.ts b/src/LanBackup.WebApp/ClientApp/app/services/channel.service.ts new file mode 100644 index 0000000..9ae8817 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/services/channel.service.ts @@ -0,0 +1,256 @@ +import { Injectable, Inject } from "@angular/core"; +import { Subject } from "rxjs/Subject"; +import { Observable } from "rxjs/Observable"; +import * as $ from 'jquery' + +/** + * When SignalR runs it will add functions to the global $ variable + * that you use to create connections to the hub. However, in this + * class we won't want to depend on any global variables, so this + * class provides an abstraction away from using $ directly in here. + */ +export class SignalrWindow extends Window { + $: any; +} + +export enum ConnectionState { + Connecting = 1, + Connected = 2, + Reconnecting = 3, + Disconnected = 4 +} + +export class ChannelConfig { + url: string; + hubName: string; + channel: string; +} + +export class ChannelEvent { + Name: string; + ChannelName: string; + Timestamp: Date; + Data: any; + Json: string; + + constructor() { + this.Timestamp = new Date(); + } +} + +class ChannelSubject { + channel: string; + subject: Subject; +} + +/** + * ChannelService is a wrapper around the functionality that SignalR + * provides to expose the ideas of channels and events. With this service + * you can subscribe to specific channels (or groups in signalr speak) and + * use observables to react to specific events sent out on those channels. + */ +@Injectable() +export class ChannelService { + /** + * starting$ is an observable available to know if the signalr + * connection is ready or not. On a successful connection this + * stream will emit a value. + */ + starting$: Observable; + + /** + * connectionState$ provides the current state of the underlying + * connection as an observable stream. + */ + connectionState$: Observable; + + /** + * error$ provides a stream of any error messages that occur on the + * SignalR connection + */ + error$: Observable; + + // These are used to feed the public observables + // + private connectionStateSubject = new Subject(); + private startingSubject = new Subject(); + private errorSubject = new Subject(); + + // These are used to track the internal SignalR state + // + private hubConnection: any; + private hubProxy: any; + + // An internal array to track what channel subscriptions exist + // + private subjects = new Array(); + + constructor( + @Inject(SignalrWindow) private window: SignalrWindow, + @Inject("channel.config") private channelConfig: ChannelConfig + ) { + if (this.window.$ === undefined || this.window.$.hubConnection === undefined) { + throw new Error("The variable '$' or the .hubConnection() function are not defined...please check the SignalR scripts have been loaded properly"); + } + + // Set up our observables + // + this.connectionState$ = this.connectionStateSubject.asObservable(); + this.error$ = this.errorSubject.asObservable(); + this.starting$ = this.startingSubject.asObservable(); + + this.hubConnection = this.window.$.hubConnection(); + this.hubConnection.url = channelConfig.url; + this.hubProxy = this.hubConnection.createHubProxy(channelConfig.hubName); + + // Define handlers for the connection state events + // + this.hubConnection.stateChanged((state: any) => { + //console.log(state); + let newState = ConnectionState.Connecting; + + switch (state.newState) { + case this.window.$.signalR.connectionState.connecting: + newState = ConnectionState.Connecting; + break; + case this.window.$.signalR.connectionState.connected: + newState = ConnectionState.Connected; + break; + case this.window.$.signalR.connectionState.reconnecting: + newState = ConnectionState.Reconnecting; + break; + case this.window.$.signalR.connectionState.disconnected: + newState = ConnectionState.Disconnected; + break; + } + + // Push the new state on our subject + // + this.connectionStateSubject.next(newState); + }); + + // Define handlers for any errors + // + this.hubConnection.error((error: any) => { + // Push the error on our subject + // + this.errorSubject.next(error); + }); + + this.hubProxy.on("onEvent", (channel: string, ev: ChannelEvent) => { + console.log(`onEvent - ${channel} channel`, ev); + + // This method acts like a broker for incoming messages. We + // check the interal array of subjects to see if one exists + // for the channel this came in on, and then emit the event + // on it. Otherwise we ignore the message. + // + let channelSub = this.subjects.find((x: ChannelSubject) => { + return x.channel === channel; + }) as ChannelSubject; + + // If we found a subject then emit the event on it + // + if (channelSub !== undefined) { + return channelSub.subject.next(ev); + } + }); + } + + /** + * Start the SignalR connection. The starting$ stream will emit an + * event if the connection is established, otherwise it will emit an + * error. + */ + start(): void { + // Now we only want the connection started once, so we have a special + // starting$ observable that clients can subscribe to know know if + // if the startup sequence is done. + // + // If we just mapped the start() promise to an observable, then any time + // a client subscried to it the start sequence would be triggered + // again since it's a cold observable. + // + this.hubConnection.start() + .done(() => { + this.startingSubject.next(); + }) + .fail((error: any) => { + this.startingSubject.error(error); + }); + } + + /** + * Get an observable that will contain the data associated with a specific + * channel + * */ + sub(channel: string): Observable { + + // Try to find an observable that we already created for the requested + // channel + // + let channelSub = this.subjects.find((x: ChannelSubject) => { + return x.channel === channel; + }) as ChannelSubject; + + // If we already have one for this event, then just return it + // + if (channelSub !== undefined) { + console.log(`Found existing observable for ${channel} channel`) + return channelSub.subject.asObservable(); + } + + // + // If we're here then we don't already have the observable to provide the + // caller, so we need to call the server method to join the channel + // and then create an observable that the caller can use to received + // messages. + // + + // Now we just create our internal object so we can track this subject + // in case someone else wants it too + // + channelSub = new ChannelSubject(); + channelSub.channel = channel; + channelSub.subject = new Subject(); + this.subjects.push(channelSub); + + // Now SignalR is asynchronous, so we need to ensure the connection is + // established before we call any server methods. So we'll subscribe to + // the starting$ stream since that won't emit a value until the connection + // is ready + // + this.starting$.subscribe(() => { + this.hubProxy.invoke("Subscribe", channel) + .done(() => { + console.log(`Successfully subscribed to ${channel} channel`); + }) + .fail((error: any) => { + channelSub.subject.error(error); + }); + }, + (error: any) => { + channelSub.subject.error(error); + }); + + return channelSub.subject.asObservable(); + } + + // Not quite sure how to handle this (if at all) since there could be + // more than 1 caller subscribed to an observable we created + // + // unsubscribe(channel: string): Rx.Observable { + // this.observables = this.observables.filter((x: ChannelObservable) => { + // return x.channel === channel; + // }); + // } + + /** publish provides a way for calles to emit events on any channel. In a + * production app the server would ensure that only authorized clients can + * actually emit the message, but here we're not concerned about that. + */ + publish(ev: ChannelEvent): void { + this.hubProxy.invoke("Publish", ev); + } + +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/services/logger.service.ts b/src/LanBackup.WebApp/ClientApp/app/services/logger.service.ts new file mode 100644 index 0000000..e09b927 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/services/logger.service.ts @@ -0,0 +1,54 @@ +//inspired from +//https://github.com/code-chunks/angular2-logger/blob/master/app/core/logger.ts +import { Injectable } from '@angular/core'; + +const CONSOLE_DEBUG_METHOD = console["debug"] ? "debug" : "log"; + +//logging here +@Injectable() +export class LoggerService { + + constructor() { + this._level = Level.WARN; + } + + + error(message?: any, ...optionalParams: any[]) { + this.isErrorEnabled() && console.error.apply(console, arguments); + } + + warn(message?: any, ...optionalParams: any[]) { + this.isWarnEnabled() && console.warn.apply(console, arguments); + } + + info(message?: any, ...optionalParams: any[]) { + this.isInfoEnabled() && console.info.apply(console, arguments); + } + + debug(message?: any, ...optionalParams: any[]) { + this.isDebugEnabled() && (console)[CONSOLE_DEBUG_METHOD].apply(console, arguments); + } + + log(message?: any, ...optionalParams: any[]) { + this.isLogEnabled() && console.log.apply(console, arguments); + } + + + private _level: Level; + public Level: any = Level; + + get level(): Level { return this._level; } + + set level(level: Level) { + this._level = level; + } + + isErrorEnabled = (): boolean => this._level >= Level.ERROR; + isWarnEnabled = (): boolean => this._level >= Level.WARN; + isInfoEnabled = (): boolean => this._level >= Level.INFO; + isDebugEnabled = (): boolean => this._level >= Level.DEBUG; + isLogEnabled = (): boolean => this._level >= Level.LOG; + +} + +export enum Level { OFF = 0, ERROR = 1, WARN = 2, INFO = 3, DEBUG = 4, LOG = 5 } diff --git a/src/LanBackup.WebApp/ClientApp/app/services/message.service.ts b/src/LanBackup.WebApp/ClientApp/app/services/message.service.ts new file mode 100644 index 0000000..ffd9c2f --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/services/message.service.ts @@ -0,0 +1,36 @@ +import { Injectable } from '@angular/core'; +import { Subject } from 'rxjs/Subject'; +import { Subscription } from 'rxjs/Subscription'; +import 'rxjs/add/operator/filter' +import 'rxjs/add/operator/map' + + +type MessageCallback = (payload: any) => void; + +@Injectable() +export class MessageService { + private handler = new Subject(); + + broadcast(type: string, payload: any) { + this.handler.next({ type, payload }); + } + + subscribe(type: string, callback: MessageCallback): Subscription { + return this.handler + .filter(message => message.type === type) + .map(message => message.payload) + .subscribe(callback); + } +} + + +interface Message { + type: string; + payload: any; +} + +export class Messages { + static readonly MESSAGE_NOTIFY: string = 'notify'; + static readonly MESSAGE_REFRESHAGENTS: string = 'refreshagents'; + +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/services/notifications.service.ts b/src/LanBackup.WebApp/ClientApp/app/services/notifications.service.ts new file mode 100644 index 0000000..c342b4a --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/services/notifications.service.ts @@ -0,0 +1,80 @@ +import { Injectable, EventEmitter } from "@angular/core" +import { Observable } from "rxjs" +import { MessageService, Messages } from './message.service'; +import { Subscription } from 'rxjs/Subscription'; +import { LoggerService } from './logger.service'; +import { + ToastyService, + ToastOptions, ToastData, ToastyConfig +} from 'ng2-toasty'; + + + +@Injectable() +export class NotificationsService { + + private subscription: Subscription; + + constructor( + private messageService: MessageService, + private toastyService: ToastyService, + private toastConfig: ToastyConfig, + private log: LoggerService + ) { + toastConfig.theme = 'material'; + this.subscription = this.messageService.subscribe(Messages.MESSAGE_NOTIFY, (payload) => { + this.addToast(payload as ToastNotification); + }); + } + + + addToast(toastnotification: ToastNotification) { + var toastOptions: ToastOptions = { + title: toastnotification.title, + msg: toastnotification.body, + showClose: true, + timeout: 5000, + onAdd: (toast: ToastData) => { + this.log.debug('Toast ' + toast.id + ' has been added!'); + }, + onRemove: (toast: ToastData) => { + this.log.debug('Toast ' + toast.id + ' has been removed!'); + } + }; + //create notification + switch (toastnotification.type) { + case ToastType.success: + this.toastyService.success(toastOptions); + break; + case ToastType.error: + this.toastyService.error(toastOptions); + break; + case ToastType.warning: + this.toastyService.warning(toastOptions); + break; + case ToastType.info: + this.toastyService.info(toastOptions); + break; + default: + this.toastyService.default(toastOptions); + break; + } + } +} + + +//notification dto +export interface ToastNotification { + title: string + body: string + type: ToastType +} + +//notification type enumeration +export enum ToastType { + normal, + success, + warning, + error, + info +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/services/webapi.service.ts b/src/LanBackup.WebApp/ClientApp/app/services/webapi.service.ts new file mode 100644 index 0000000..a3fbf19 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/services/webapi.service.ts @@ -0,0 +1,204 @@ +import { Injectable } from '@angular/core'; +import { Http, Headers, RequestOptions, Response } from '@angular/http'; +import { Observable } from 'rxjs/Rx'; +import 'rxjs/add/operator/toPromise'; +//models +import { BackupConfiguration } from '../model/BackupConfiguration'; +import { BackupLog } from '../model/BackupLog'; +import { StatusReportInfo } from '../model/StatusReportInfo'; +import { User } from '../services/authentication.service'; +import { SaveResult } from '../model/SaveResult'; +import { SignInResult } from '../model/SignInResult'; + + +import { PaginatedList } from '../model/PaginatedList'; +import { LoggerService } from './logger.service'; + + + +@Injectable() +export class WebApiService { + public list: BackupConfiguration[]; + + constructor( + private http: Http, + private log: LoggerService + ) { + } + + + // ### REGION BACKUPS /// + + getBackupsAll(): Promise { + return this.http + .get('/api/backupconfig/') + .toPromise() + .then(response => response.json()) + .then(backups => Array.from(backups, b => new BackupConfiguration(b))) + .catch(error => this.log.error(error)); + } + + + getBackupsPage(idx: number, siz: number): Observable> { + let headers = new Headers({ + 'Content-Type': 'application/json', + 'idx': idx, + 'siz': siz + }); + let options = new RequestOptions({ headers: headers }); + return this.http + .get('/api/backupconfig', options) + .map((res: Response) => res.json()) + .catch(error => Observable.throw(error.text() || 'Server error')); + } + + + saveBackup(toSave: BackupConfiguration, isNew: boolean): Observable { + let headers = new Headers({ 'Content-Type': 'application/json' }); + let options = new RequestOptions({ headers: headers }); + if (isNew)//create + return this.http + .post('/api/backupconfig', toSave, options) + .map((res: Response) => res.json()) + .catch(error => Observable.throw(error.text() || 'Server error')); + else//update + return this.http + .put(`/api/backupconfig/${toSave.id}`, toSave, options) + .map((res: Response) => res.json()) + .catch(error => Observable.throw(error.text() || 'Server error') + ); + } + + + deleteBackup(toDelete: BackupConfiguration): Observable { + let headers = new Headers({ 'Content-Type': 'application/json' }); + let options = new RequestOptions({ headers: headers }); + return this.http + .delete(`/api/backupconfig/${toDelete.id}`, options) + .map((res: Response) => res.json()) + .catch(error => Observable.throw(error.text() || 'Server error')); + } + + + // ### END REGION BACKUPS /// + + + + + + + // ### REGION LOGS /// + + getLogsPage(idx: number, siz: number): Observable> { + let headers = new Headers({ + 'Content-Type': 'application/json', + 'idx': idx, + 'siz': siz + }); + let options = new RequestOptions({ headers: headers }); + return this.http + .get('/api/logs', options) + .map((res: Response) => res.json()) + .catch(error => Observable.throw(error.text() || 'Server error')); + } + + // ### END REGION LOGS /// + + + + + + + // ### REGION USER /// + + + loginUser(user: User): Observable { + let headers = new Headers({ + 'Content-Type': 'application/json' + }); + let options = new RequestOptions({ headers: headers }); + return this.http + .post('/api/users/login', user, options) + .map((res: Response) => res.json()) + .catch(error => { + this.log.error(error); + return Observable.throw(error || 'Server error') + } + ); + } + + registerUser(user: User): Observable { + let headers = new Headers({ + 'Content-Type': 'application/json' + }); + let options = new RequestOptions({ headers: headers }); + return this.http + .post('/api/users/register', user, options) + .map((res: Response) => res.json()) + .catch(error => { + this.log.error(error); + return Observable.throw(error || 'Server error') + } + ); + } + + changePassword(user: User): Observable { + let headers = new Headers({ + 'Content-Type': 'application/json' + }); + let options = new RequestOptions({ headers: headers }); + return this.http + .post('/api/users/pwchange', user, options) + .map((res: Response) => res.json()) + .catch(error => Observable.throw(error || 'Server error')); + } + + + getAllUsers(): Observable { + let headers = new Headers({ + 'Content-Type': 'application/json' + }); + let options = new RequestOptions({ headers: headers }); + return this.http + .get('/api/users/list', options) + .map((res: Response) => res.json()) + .catch(error => Observable.throw(error.text() || 'Server error')); + } + + + changeAdminRole(user: User): Observable { + let headers = new Headers({ + 'Content-Type': 'application/json' + }); + let options = new RequestOptions({ headers: headers }); + return this.http + .post('/api/users/list', user, options) + .map((res: Response) => res.json()) + .catch(error => { + this.log.error(error); + return Observable.throw(error || 'Server error') + } + ); + } + + + // ### END REGION USER /// + + + + // ### REGION SIGNALR /// + + getAgentsAll(): Observable { + return this.http + .get('/api/lanagents/') + .map((res: Response) => res.json()) + .catch(error => { + this.log.error(error); + return Observable.throw(error || 'Server error') + }); + } + + // ### ENDREGION SIGNALR /// + +} + diff --git a/src/LanBackup.WebApp/ClientApp/app/shared/global/SharedModule.ts b/src/LanBackup.WebApp/ClientApp/app/shared/global/SharedModule.ts new file mode 100644 index 0000000..44b8527 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/shared/global/SharedModule.ts @@ -0,0 +1,24 @@ + +import { NgModule, ModuleWithProviders } from '@angular/core'; +import { GlobalRef, BrowserGlobalRef, NodeGlobalRef } from './global-ref'; +@NgModule({}) +export class SharedModule { + + static forBrowser(): ModuleWithProviders { + return { + ngModule: SharedModule, + providers: [ + { provide: GlobalRef, useClass: BrowserGlobalRef } + ] + }; + } + + static forNode(): ModuleWithProviders { + return { + ngModule: SharedModule, + providers: [ + { provide: GlobalRef, useClass: NodeGlobalRef } + ] + }; + } +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/shared/global/global-ref.ts b/src/LanBackup.WebApp/ClientApp/app/shared/global/global-ref.ts new file mode 100644 index 0000000..a0079a8 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/shared/global/global-ref.ts @@ -0,0 +1,19 @@ +export interface MyGlobal { + clientSettings: { + admin_email: string, + instrumentationEnabled: boolean, + instrumentationKey: string + }; +} + +export abstract class GlobalRef { + abstract get nativeGlobal(): MyGlobal; +} + +export class BrowserGlobalRef extends GlobalRef { + get nativeGlobal(): MyGlobal { return window as MyGlobal; } +} + +export class NodeGlobalRef extends GlobalRef { + get nativeGlobal(): MyGlobal { return global as MyGlobal; } +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/shared/modal/modal.component.css b/src/LanBackup.WebApp/ClientApp/app/shared/modal/modal.component.css new file mode 100644 index 0000000..ef6632c --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/shared/modal/modal.component.css @@ -0,0 +1,39 @@ +.vertical-alignment-helper { + display:table; + height: 100%; + width: 100%; + pointer-events:none; +} +.vertical-align-center { + /* To center vertically */ + display: table-cell; + vertical-align: middle; + pointer-events:none; +} +.modal-content { + /* Bootstrap sets the size of the modal in the modal-dialog class, we need to inherit it */ + width:inherit; + height:inherit; + /* To center horizontally */ + margin: 0 auto; + pointer-events:all; +} + + +.fade-scale { + transform: scale(0.6); + opacity: 0; + -webkit-transition: all .25s linear; + -o-transition: all .25s linear; + transition: all .25s linear; +} + +.fade-scale.in { + opacity: 1; + transform: scale(1); +} + + +.modal{ + background: rgba(0,0,0,0.6); +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/shared/modal/modal.component.ts b/src/LanBackup.WebApp/ClientApp/app/shared/modal/modal.component.ts new file mode 100644 index 0000000..7e0e078 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/shared/modal/modal.component.ts @@ -0,0 +1,41 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-modal', + template: ` + + `, + styleUrls: ['./modal.component.css'] +}) +export class ModalComponent { + + public visible = false; + private visibleAnimate = false; + + public show(): void { + this.visible = true; + setTimeout(() => this.visibleAnimate = true); + } + + public hide(): void { + this.visibleAnimate = false; + setTimeout(() => this.visible = false, 300); + } +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/shared/ng2-pagination/ng2-pagination.ts b/src/LanBackup.WebApp/ClientApp/app/shared/ng2-pagination/ng2-pagination.ts new file mode 100644 index 0000000..b3dcfc6 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/shared/ng2-pagination/ng2-pagination.ts @@ -0,0 +1,24 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {PaginatePipe} from './paginate.pipe'; +import {PaginationService} from './pagination.service'; +import {PaginationControlsComponent} from './pagination-controls.component'; +import {PaginationControlsDirective} from './pagination-controls.directive'; + +export {PaginationInstance} from './pagination-instance'; +export {PaginationService} from './pagination.service'; +export {PaginationControlsComponent} from './pagination-controls.component'; +export {PaginationControlsDirective} from './pagination-controls.directive'; +export {PaginatePipe} from './paginate.pipe'; + +@NgModule({ + imports: [CommonModule], + declarations: [ + PaginatePipe, + PaginationControlsComponent, + PaginationControlsDirective + ], + providers: [PaginationService], + exports: [PaginatePipe, PaginationControlsComponent, PaginationControlsDirective] +}) +export class Ng2PaginationModule { } diff --git a/src/LanBackup.WebApp/ClientApp/app/shared/ng2-pagination/paginate.pipe.ts b/src/LanBackup.WebApp/ClientApp/app/shared/ng2-pagination/paginate.pipe.ts new file mode 100644 index 0000000..d41b962 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/shared/ng2-pagination/paginate.pipe.ts @@ -0,0 +1,137 @@ +import {Pipe} from "@angular/core"; +import {PaginationService} from "./pagination.service"; +import {PaginationInstance} from './pagination-instance'; + +const LARGE_NUMBER = Number.MAX_SAFE_INTEGER; + +interface PipeState { + collection: any[]; + size: number; + start: number; + end: number; + slice: any[]; +} + +@Pipe({ + name: 'paginate', + pure: false +}) +export class PaginatePipe { + + // store the values from the last time the pipe was invoked + private state: { [id: string]: PipeState } = {}; + + constructor(private service: PaginationService) { + } + + public transform(collection: any[], args: any): any { + + // When an observable is passed through the AsyncPipe, it will output + // `null` until the subscription resolves. In this case, we want to + // use the cached data from the `state` object to prevent the NgFor + // from flashing empty until the real values arrive. + if (args instanceof Array) { + // compatible with angular2 before beta16 + args = args[0]; + } + if (!(collection instanceof Array)) { + let _id = args.id || this.service.defaultId; + if (this.state[_id]) { + return this.state[_id].slice; + } else { + return collection; + } + } + + let serverSideMode = args.totalItems !== undefined; + let instance = this.createInstance(collection, args); + let id = instance.id; + let start, end; + let perPage = instance.itemsPerPage; + + this.service.register(instance); + + if (!serverSideMode && collection instanceof Array) { + perPage = +perPage || LARGE_NUMBER; + start = (instance.currentPage - 1) * perPage; + end = start + perPage; + + let isIdentical = this.stateIsIdentical(id, collection, start, end); + if (isIdentical) { + return this.state[id].slice; + } else { + let slice = collection.slice(start, end); + this.saveState(id, collection, slice, start, end); + this.service.change.emit(id); + return slice; + } + } + + // save the state for server-side collection to avoid null + // flash as new data loads. + this.saveState(id, collection, collection, start, end); + return collection; + } + + /** + * Create an PaginationInstance object, using defaults for any optional properties not supplied. + */ + private createInstance(collection: any[], args: any): PaginationInstance { + let config = args; + this.checkConfig(config); + + return { + id: config.id || this.service.defaultId(), + itemsPerPage: config.itemsPerPage || 0, + currentPage: config.currentPage || 1, + totalItems: config.totalItems || collection.length + }; + } + + /** + * Ensure the argument passed to the filter contains the required properties. + */ + private checkConfig(config: any): void { + const required = ['itemsPerPage', 'currentPage']; + + const missing = required.filter(prop => !config.hasOwnProperty(prop)); + if (0 < missing.length) { + throw new Error(`PaginatePipe: Argument is missing the following required properties: ${missing.join(', ')}`); + } + } + + /** + * To avoid returning a brand new array each time the pipe is run, we store the state of the sliced + * array for a given id. This means that the next time the pipe is run on this collection & id, we just + * need to check that the collection, start and end points are all identical, and if so, return the + * last sliced array. + */ + private saveState(id: string, collection: any[], slice: any[], start: number, end: number) { + this.state[id] = { + collection, + size: collection.length, + slice, + start, + end + }; + } + + /** + * For a given id, returns true if the collection, size, start and end values are identical. + */ + private stateIsIdentical(id: string, collection: any[], start: number, end: number): boolean { + let state = this.state[id]; + if (!state) { + return false; + } + let isMetaDataIdentical = state.size === collection.length && + state.start === start && + state.end === end; + + if(!isMetaDataIdentical) { + return false; + } + + return state.slice.every((element, index) => element === collection[start + index]); + } +} diff --git a/src/LanBackup.WebApp/ClientApp/app/shared/ng2-pagination/pagination-controls.component.ts b/src/LanBackup.WebApp/ClientApp/app/shared/ng2-pagination/pagination-controls.component.ts new file mode 100644 index 0000000..9c1a7ed --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/shared/ng2-pagination/pagination-controls.component.ts @@ -0,0 +1,41 @@ +import {Component, Input, Output, EventEmitter, ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core' +import {DEFAULT_TEMPLATE, DEFAULT_STYLES} from './template'; + +/** + * The default pagination controls component. Actually just a default implementation of a custom template. + */ +@Component({ + selector: 'pagination-controls', + template: DEFAULT_TEMPLATE, + styles: [DEFAULT_STYLES], + changeDetection: ChangeDetectionStrategy.OnPush, + encapsulation: ViewEncapsulation.None +}) +export class PaginationControlsComponent { + + @Input() id: string; + @Input() maxSize: number = 7; + @Input() + get directionLinks(): boolean { + return this._directionLinks; + } + set directionLinks(value: boolean) { + this._directionLinks = !!value && value !== 'false'; + } + @Input() + get autoHide(): boolean { + return this._autoHide; + } + set autoHide(value: boolean) { + this._autoHide = !!value && value !== 'false'; + } + @Input() previousLabel: string = 'Previous'; + @Input() nextLabel: string = 'Next'; + @Input() screenReaderPaginationLabel: string = 'Pagination'; + @Input() screenReaderPageLabel: string = 'page'; + @Input() screenReaderCurrentLabel: string = `You're on page`; + @Output() pageChange: EventEmitter = new EventEmitter(); + + private _directionLinks: boolean = true; + private _autoHide: boolean = false; +} diff --git a/src/LanBackup.WebApp/ClientApp/app/shared/ng2-pagination/pagination-controls.directive.ts b/src/LanBackup.WebApp/ClientApp/app/shared/ng2-pagination/pagination-controls.directive.ts new file mode 100644 index 0000000..09f0e0d --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/shared/ng2-pagination/pagination-controls.directive.ts @@ -0,0 +1,209 @@ +import {ChangeDetectorRef, Directive, EventEmitter, Input, Output} from '@angular/core'; +import {Subscription} from 'rxjs'; + +import {PaginationService} from './pagination.service'; +import {PaginationInstance} from './pagination-instance'; + +export interface Page { + label: string; + value: any; +} + +/** + * This directive is what powers all pagination controls components, including the default one. + * It exposes an API which is hooked up to the PaginationService to keep the PaginatePipe in sync + * with the pagination controls. + */ +@Directive({ + selector: 'pagination-template,[pagination-template]', + exportAs: 'paginationApi' +}) +export class PaginationControlsDirective { + @Input() id: string; + @Input() maxSize: number = 7; + @Output() pageChange: EventEmitter = new EventEmitter(); + pages: Page[] = []; + + private changeSub: Subscription; + + constructor(private service: PaginationService, + private changeDetectorRef: ChangeDetectorRef) { + this.changeSub = this.service.change + .subscribe(id => { + if (this.id === id) { + this.updatePageLinks(); + this.changeDetectorRef.markForCheck(); + this.changeDetectorRef.detectChanges(); + } + }); + } + + ngOnInit() { + if (this.id === undefined) { + this.id = this.service.defaultId(); + } + this.updatePageLinks(); + } + + ngOnChanges(changes: any) { + this.updatePageLinks(); + } + + ngOnDestroy() { + this.changeSub.unsubscribe(); + } + + /** + * Go to the previous page + */ + previous() { + if (this.getCurrent() - 1 > 0) { + this.setCurrent(this.getCurrent() - 1); + } + } + + /** + * Go to the next page + */ + next() { + if (this.getCurrent() < this.getLastPage()) { + this.setCurrent(this.getCurrent() + 1); + } + } + + /** + * Returns true if current page is first page + */ + isFirstPage(): boolean { + return this.getCurrent() === 1; + } + + /** + * Returns true if current page is last page + */ + isLastPage(): boolean { + return this.getLastPage() === this.getCurrent(); + } + + /** + * Set the current page number. + */ + setCurrent(page: number) { + if (this.getCurrent() != page) { + this.pageChange.emit(page); + } + } + + /** + * Get the current page number. + */ + getCurrent(): number { + return this.service.getCurrentPage(this.id); + } + + /** + * Returns the last page number + */ + getLastPage(): number { + let inst = this.service.getInstance(this.id); + if (inst.totalItems < 1) { + // when there are 0 or fewer (an error case) items, there are no "pages" as such, + // but it makes sense to consider a single, empty page as the last page. + return 1; + } + return Math.ceil(inst.totalItems / inst.itemsPerPage); + } + + /** + * Updates the page links and checks that the current page is valid. Should run whenever the + * PaginationService.change stream emits a value matching the current ID, or when any of the + * input values changes. + */ + private updatePageLinks() { + let inst = this.service.getInstance(this.id); + const correctedCurrentPage = this.outOfBoundCorrection(inst); + + if (correctedCurrentPage !== inst.currentPage) { + setTimeout(() => { + this.setCurrent(correctedCurrentPage); + this.pages = this.createPageArray(inst.currentPage, inst.itemsPerPage, inst.totalItems, this.maxSize); + }); + } else { + this.pages = this.createPageArray(inst.currentPage, inst.itemsPerPage, inst.totalItems, this.maxSize); + } + } + + /** + * Checks that the instance.currentPage property is within bounds for the current page range. + * If not, return a correct value for currentPage, or the current value if OK. + */ + private outOfBoundCorrection(instance: PaginationInstance): number { + const totalPages = Math.ceil(instance.totalItems / instance.itemsPerPage); + if (totalPages < instance.currentPage && 0 < totalPages) { + return totalPages; + } else if (instance.currentPage < 1) { + return 1; + } + + return instance.currentPage; + } + + /** + * Returns an array of Page objects to use in the pagination controls. + */ + private createPageArray(currentPage: number, itemsPerPage: number, totalItems: number, paginationRange: number): Page[] { + // paginationRange could be a string if passed from attribute, so cast to number. + paginationRange = +paginationRange; + let pages = []; + const totalPages = Math.ceil(totalItems / itemsPerPage); + const halfWay = Math.ceil(paginationRange / 2); + + const isStart = currentPage <= halfWay; + const isEnd = totalPages - halfWay < currentPage; + const isMiddle = !isStart && !isEnd; + + let ellipsesNeeded = paginationRange < totalPages; + let i = 1; + + while (i <= totalPages && i <= paginationRange) { + let label; + let pageNumber = this.calculatePageNumber(i, currentPage, paginationRange, totalPages); + let openingEllipsesNeeded = (i === 2 && (isMiddle || isEnd)); + let closingEllipsesNeeded = (i === paginationRange - 1 && (isMiddle || isStart)); + if (ellipsesNeeded && (openingEllipsesNeeded || closingEllipsesNeeded)) { + label = '...'; + } else { + label = pageNumber; + } + pages.push({ + label: label, + value: pageNumber + }); + i ++; + } + return pages; + } + + /** + * Given the position in the sequence of pagination links [i], + * figure out what page number corresponds to that position. + */ + private calculatePageNumber(i: number, currentPage: number, paginationRange: number, totalPages: number) { + let halfWay = Math.ceil(paginationRange / 2); + if (i === paginationRange) { + return totalPages; + } else if (i === 1) { + return i; + } else if (paginationRange < totalPages) { + if (totalPages - halfWay < currentPage) { + return totalPages - paginationRange + i; + } else if (halfWay < currentPage) { + return currentPage - halfWay + i; + } else { + return i; + } + } else { + return i; + } + } +} diff --git a/src/LanBackup.WebApp/ClientApp/app/shared/ng2-pagination/pagination-instance.ts b/src/LanBackup.WebApp/ClientApp/app/shared/ng2-pagination/pagination-instance.ts new file mode 100644 index 0000000..b200ea9 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/shared/ng2-pagination/pagination-instance.ts @@ -0,0 +1,24 @@ +export interface PaginationInstance { + /** + * An optional ID for the pagination instance. Only useful if you wish to + * have more than once instance at a time in a given component. + */ + id?: string; + /** + * The number of items per paginated page. + */ + itemsPerPage: number; + /** + * The current (active) page. + */ + currentPage: number; + /** + * The total number of items in the collection. Only useful when + * doing server-side paging, where the collection size is limited + * to a single page returned by the server API. + * + * For in-memory paging, this property should not be set, as it + * will be automatically set to the value of collection.length. + */ + totalItems?: number; +} diff --git a/src/LanBackup.WebApp/ClientApp/app/shared/ng2-pagination/pagination.service.ts b/src/LanBackup.WebApp/ClientApp/app/shared/ng2-pagination/pagination.service.ts new file mode 100644 index 0000000..5641efe --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/shared/ng2-pagination/pagination.service.ts @@ -0,0 +1,111 @@ +import {EventEmitter} from '@angular/core' +import {PaginationInstance} from './pagination-instance'; + +export class PaginationService { + + public change: EventEmitter = new EventEmitter(); + + private instances: { [id: string]: PaginationInstance } = {}; + private DEFAULT_ID = 'DEFAULT_PAGINATION_ID'; + + public defaultId(): string { return this.DEFAULT_ID } + + public register(instance: PaginationInstance) { + if (!instance.id) { + instance.id = this.DEFAULT_ID; + } + + if (!this.instances[instance.id]) { + this.instances[instance.id] = instance; + this.change.emit(instance.id); + } else { + let changed = this.updateInstance(instance); + if (changed) { + this.change.emit(instance.id); + } + } + } + + /** + * Check each property of the instance and update any that have changed. Return + * true if any changes were made, else return false. + */ + private updateInstance(instance: PaginationInstance): boolean { + let changed = false; + for (let prop in this.instances[instance.id]) { + if (instance[prop] !== this.instances[instance.id][prop]) { + this.instances[instance.id][prop] = instance[prop]; + changed = true; + } + } + return changed; + } + + /** + * Returns the current page number. + */ + public getCurrentPage(id: string): number { + if (this.instances[id]) { + return this.instances[id].currentPage; + } + } + + /** + * Sets the current page number. + */ + public setCurrentPage(id: string, page: number) { + if (this.instances[id]) { + let instance = this.instances[id]; + let maxPage = Math.ceil(instance.totalItems / instance.itemsPerPage); + if (page <= maxPage && 1 <= page) { + this.instances[id].currentPage = page; + this.change.emit(id); + } + } + } + + /** + * Sets the value of instance.totalItems + */ + public setTotalItems(id: string, totalItems: number) { + if (this.instances[id] && 0 <= totalItems) { + this.instances[id].totalItems = totalItems; + this.change.emit(id); + } + } + + /** + * Sets the value of instance.itemsPerPage. + */ + public setItemsPerPage(id: string, itemsPerPage: number) { + if (this.instances[id]) { + this.instances[id].itemsPerPage = itemsPerPage; + this.change.emit(id); + } + } + + /** + * Returns a clone of the pagination instance object matching the id. If no + * id specified, returns the instance corresponding to the default id. + */ + public getInstance(id: string = this.DEFAULT_ID): PaginationInstance { + if (this.instances[id]) { + return this.clone(this.instances[id]); + } + return {}; + } + + /** + * Perform a shallow clone of an object. + */ + private clone(obj: any): any { + var target = {}; + for (var i in obj) { + if (obj.hasOwnProperty(i)) { + target[i] = obj[i]; + } + } + return target; + } + +} diff --git a/src/LanBackup.WebApp/ClientApp/app/shared/ng2-pagination/template.ts b/src/LanBackup.WebApp/ClientApp/app/shared/ng2-pagination/template.ts new file mode 100644 index 0000000..74b85a2 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/shared/ng2-pagination/template.ts @@ -0,0 +1,99 @@ +/** + * The default template and styles for the pagination links are borrowed directly + * from Zurb Foundation 6: http://foundation.zurb.com/sites/docs/pagination.html + */ + +export const DEFAULT_TEMPLATE = ` + + + + `; + +export const DEFAULT_STYLES = ` +.ng2-pagination { + margin-left: 0; + margin-bottom: 1rem; } + .ng2-pagination::before, .ng2-pagination::after { + content: ' '; + display: table; } + .ng2-pagination::after { + clear: both; } + .ng2-pagination li { + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + margin-right: 0.0625rem; + cursor: pointer; + border-radius: 0; } + .ng2-pagination li { + cursor: pointer; + display: inline-block; } + .ng2-pagination a, + .ng2-pagination button { + color: #0a0a0a; + display: block; + padding: 0.1875rem 0.625rem; + border-radius: 0; } + .ng2-pagination a:hover, + .ng2-pagination button:hover { + background: #e6e6e6; } + .ng2-pagination .current { + padding: 0.1875rem 0.625rem; + background: #2199e8; + color: #fefefe; + cursor: default; } + .ng2-pagination .disabled { + padding: 0.1875rem 0.625rem; + color: #cacaca; + cursor: default; } + .ng2-pagination .disabled:hover { + background: transparent; } + .ng2-pagination .ellipsis::after { + content: '…'; + padding: 0.1875rem 0.625rem; + color: #0a0a0a; } + +.ng2-pagination .pagination-previous a::before, +.ng2-pagination .pagination-previous.disabled::before { + content: '«'; + display: inline-block; + margin-right: 0.5rem; } + +.ng2-pagination .pagination-next a::after, +.ng2-pagination .pagination-next.disabled::after { + content: '»'; + display: inline-block; + margin-left: 0.5rem; } + +.ng2-pagination .show-for-sr { + position: absolute !important; + width: 1px; + height: 1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); }`; diff --git a/src/LanBackup.WebApp/ClientApp/app/shared/ng2-switch/ng2-switch.ts b/src/LanBackup.WebApp/ClientApp/app/shared/ng2-switch/ng2-switch.ts new file mode 100644 index 0000000..d5a04ae --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/shared/ng2-switch/ng2-switch.ts @@ -0,0 +1,185 @@ +//https://github.com/yuyang041060120/angular2-ui-switch +// +import { Component, Input, Output, EventEmitter, HostListener, forwardRef } from '@angular/core'; +import { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms'; + +const UI_SWITCH_CONTROL_VALUE_ACCESSOR: any = { + provide: NG_VALUE_ACCESSOR, + useExisting: forwardRef(() => Ng2SwitchComponent), + multi: true +}; + +@Component({ + selector: 'ngSwitch', + template: ` + + + + + `, + styles: [` + .switch { + background: #f00; + border: 1px solid #dfdfdf; + position: relative; + display: inline-block; + box-sizing: content-box; + overflow: visible; + padding: 0; + margin: 0; + cursor: pointer; + box-shadow: rgb(223, 223, 223) 0 0 0 0 inset; + transition: 0.3s ease-out all; + -webkit-transition: 0.3s ease-out all; + } + + small { + border-radius: 10%; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); + position: absolute; + top: 0; + left: 0; + transition: 0.3s ease-out all; + -webkit-transition: 0.3s ease-out all; + } + + .switch-large { + width: 66px; + height: 40px; + border-radius: 4px; + } + + .switch-large small { + width: 40px; + height: 40px; + } + + .switch-medium { + width: 50px; + height: 30px; + border-radius: 3px; + } + + .switch-medium small { + width: 30px; + height: 30px; + } + + .switch-small { + width: 33px; + height: 20px; + border-radius: 2px; + } + + .switch-small small { + width: 20px; + height: 20px; + } + + .checked { + background: rgb(100, 189, 99); + border-color: rgb(100, 189, 99); + } + + .switch-large.checked small { + left: 26px; + } + + .switch-medium.checked small { + left: 20px; + } + + .switch-small.checked small { + left: 13px; + } + + .disabled { + opacity: .50; + cursor: not-allowed; + } + `], + providers: [UI_SWITCH_CONTROL_VALUE_ACCESSOR] +}) +export class Ng2SwitchComponent implements ControlValueAccessor { + private onTouchedCallback = (v: any) => { + }; + private onChangeCallback = (v: any) => { + }; + + private _checked: boolean; + private _disabled: boolean; + private _reverse: boolean; + + @Input() set checked(v: boolean) { + this._checked = v !== false; + } + + get checked() { + return this._checked; + } + + @Input() set disabled(v: boolean) { + this._disabled = v !== false; + }; + + get disabled() { + return this._disabled; + } + + @Input() set reverse(v: boolean) { + this._reverse = v !== false; + }; + + get reverse() { + return this._reverse; + } + + @Input() size: string = 'medium'; + @Output() change = new EventEmitter(); + @Input() color: string = 'rgb(100, 189, 99)'; + @Input() switchOffColor: string = ''; + @Input() switchColor: string = '#fff'; + defaultBgColor: string = '#fff'; + defaultBoColor: string = '#dfdfdf'; + + getColor(flag) { + if (flag === 'borderColor') return this.defaultBoColor; + if (flag === 'switchColor') { + if (this.reverse) return !this.checked ? this.switchColor : this.switchOffColor || this.switchColor; + return this.checked ? this.switchColor : this.switchOffColor || this.switchColor; + } + if (this.reverse) return !this.checked ? this.color : this.defaultBgColor; + return this.checked ? this.color : this.defaultBgColor; + } + + @HostListener('click') + onToggle() { + if (this.disabled) return; + this.checked = !this.checked; + this.change.emit(this.checked); + this.onChangeCallback(this.checked); + this.onTouchedCallback(this.checked); + } + + writeValue(obj: any): void { + if (obj !== this.checked) { + this.checked = !!obj; + } + } + + registerOnChange(fn: any) { + this.onChangeCallback = fn; + } + + registerOnTouched(fn: any) { + this.onTouchedCallback = fn; + } +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/shared/progressbar/bar.ts b/src/LanBackup.WebApp/ClientApp/app/shared/progressbar/bar.ts new file mode 100644 index 0000000..fc07f43 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/shared/progressbar/bar.ts @@ -0,0 +1,64 @@ +import { Component, OnInit, OnDestroy, Input, Host } from '@angular/core'; +//import { NgClass, NgStyle } from '@angular/common'; + +import { Progress } from './progress'; + +@Component({ + selector: 'bar, [bar]', + //directives: [NgClass, NgStyle], + template: ` +
+` +}) +export class Bar implements OnInit, OnDestroy { + @Input() public type: string; + + @Input() public get value(): number { + return this._value; + } + + public set value(v: number) { + if (!v && v !== 0) { + return; + } + this._value = v; + this.recalculatePercentage(); + } + + public percent: number = 0; + public transition: string; + + private _value: number; + + constructor( @Host() public progress: Progress) { + } + + ngOnInit() { + this.progress.addBar(this); + } + + ngOnDestroy() { + this.progress.removeBar(this); + } + + public recalculatePercentage() { + this.percent = +(100 * this.value / this.progress.max).toFixed(2); + + let totalPercentage = this.progress.bars.reduce(function (total, bar) { + return total + bar.percent; + }, 0); + + if (totalPercentage > 100) { + this.percent -= totalPercentage - 100; + } + } +} diff --git a/src/LanBackup.WebApp/ClientApp/app/shared/progressbar/progress.ts b/src/LanBackup.WebApp/ClientApp/app/shared/progressbar/progress.ts new file mode 100644 index 0000000..a3c489f --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/shared/progressbar/progress.ts @@ -0,0 +1,50 @@ +import { Directive, OnInit, Input, HostBinding } from '@angular/core'; +import { Bar } from './bar'; + +const progressConfig = { + animate: true, + max: 100 +}; + +@Directive({ selector: 'bs-progress, [progress]' }) +export class Progress implements OnInit { + @Input() public animate: boolean; + + @HostBinding('attr.max') + @Input() public get max(): number { + return this._max; + } + + @HostBinding('class') private addClass = 'progress'; + + public set max(v: number) { + this._max = v; + this.bars.forEach((bar: Bar) => { + bar.recalculatePercentage(); + }); + } + + public bars: Array = []; + + private _max: number; + + constructor() { + } + + ngOnInit() { + this.animate = this.animate !== false; + this.max = typeof this.max === 'number' ? this.max : progressConfig.max; + } + + + public addBar(bar: Bar) { + if (!this.animate) { + bar.transition = 'none'; + } + this.bars.push(bar); + } + + public removeBar(bar: Bar) { + this.bars.splice(this.bars.indexOf(bar), 1); + } +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/shared/progressbar/progressbar.ts b/src/LanBackup.WebApp/ClientApp/app/shared/progressbar/progressbar.ts new file mode 100644 index 0000000..7e36081 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/app/shared/progressbar/progressbar.ts @@ -0,0 +1,23 @@ +import { Component, Input } from '@angular/core'; +//import { NgClass, NgStyle } from '@angular/common'; + +import { Progress } from './progress'; +import { Bar } from './bar'; + +@Component({ + selector: 'progressbar, [progressbar]', + //directives: [Progress, Bar], + template: ` +
+ + + +
+ ` +}) +export class Progressbar { + @Input() private animate: boolean; + @Input() private max: number; + @Input() private type: string; + @Input() private value: number; +} diff --git a/src/LanBackup.WebApp/ClientApp/boot-client.ts b/src/LanBackup.WebApp/ClientApp/boot-client.ts new file mode 100644 index 0000000..b34b923 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/boot-client.ts @@ -0,0 +1,30 @@ +import 'angular2-universal-polyfills/browser'; +import { enableProdMode } from '@angular/core'; +import { platformUniversalDynamic } from 'angular2-universal'; +import { AppModule } from './app/app.module'; + +import * as $ from 'jquery'; +import 'bootstrap'; +//import { AppInsightsModule, AppInsightsService } from 'ng2-appinsights'; + +// Enable either Hot Module Reloading or production mode +if (module['hot']) { + module['hot'].accept(); + module['hot'].dispose(() => { platform.destroy(); }); +} else { + enableProdMode(); +} + +// Boot the application, either now or when the DOM content is loaded +const platform = platformUniversalDynamic(); +const bootApplication = () => { platform.bootstrapModule(AppModule); }; +if (document.readyState === 'complete') { + bootApplication(); +} else { + document.addEventListener('DOMContentLoaded', bootApplication); +} + +//var appIns: AppInsightsService = new AppInsightsService(''); +//appIns.Init({ +// instrumentationKey: '9f667285-ff2c-4626-a8da-1db518593323' //TODO - MOVE INTO A CONFIG FILE THAT SHOULD NOT BE COMMITED +//}); \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/boot-server.ts b/src/LanBackup.WebApp/ClientApp/boot-server.ts new file mode 100644 index 0000000..c29916f --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/boot-server.ts @@ -0,0 +1,33 @@ +import 'angular2-universal-polyfills'; +import 'zone.js'; +import { createServerRenderer, RenderResult } from 'aspnet-prerendering'; +import { enableProdMode } from '@angular/core'; +import { platformNodeDynamic } from 'angular2-universal'; +import { AppModule } from './app/app.module'; + +enableProdMode(); +const platform = platformNodeDynamic(); + +export default createServerRenderer(params => { + return new Promise((resolve, reject) => { + const requestZone = Zone.current.fork({ + name: 'angular-universal request', + properties: { + baseUrl: '/', + requestUrl: params.url, + originUrl: params.origin, + preboot: false, + document: '' + }, + onHandleError: (parentZone, currentZone, targetZone, error) => { + // If any error occurs while rendering the module, reject the whole operation + reject(error); + return true; + } + }); + + return requestZone.run>(() => platform.serializeModule(AppModule)).then(html => { + resolve({ html: html }); + }, reject); + }); +}); diff --git a/src/LanBackup.WebApp/ClientApp/dist/_placeholder.txt b/src/LanBackup.WebApp/ClientApp/dist/_placeholder.txt new file mode 100644 index 0000000..b22cc15 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/dist/_placeholder.txt @@ -0,0 +1,9 @@ +------------------------------------------------------------------ +Don't delete this file. Do include it in your source control repo. +------------------------------------------------------------------ + +This file exists as a workaround for https://github.com/dotnet/cli/issues/1396 +('dotnet publish' does not publish any directories that didn't exist or were +empty before the publish script started). + +Hopefully, this can be removed after the move to the new MSBuild. diff --git a/src/LanBackup.WebApp/ClientApp/test/boot-tests.ts b/src/LanBackup.WebApp/ClientApp/test/boot-tests.ts new file mode 100644 index 0000000..6121b04 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/test/boot-tests.ts @@ -0,0 +1,32 @@ +// Load required polyfills and testing libraries +import 'angular2-universal-polyfills'; +import 'zone.js/dist/long-stack-trace-zone'; +import 'zone.js/dist/proxy.js'; +import 'zone.js/dist/sync-test'; +import 'zone.js/dist/jasmine-patch'; +import 'zone.js/dist/async-test'; +import 'zone.js/dist/fake-async-test'; +import * as testing from '@angular/core/testing'; +import * as testingBrowser from '@angular/platform-browser-dynamic/testing'; + +// There's no typing for the `__karma__` variable. Just declare it as any +declare var __karma__: any; +declare var require: any; + +// Prevent Karma from running prematurely +__karma__.loaded = function () {}; + +// First, initialize the Angular testing environment +testing.getTestBed().initTestEnvironment( + testingBrowser.BrowserDynamicTestingModule, + testingBrowser.platformBrowserDynamicTesting() +); + +// Then we find all the tests +const context = require.context('../', true, /\.spec\.ts$/); + +// And load the modules +context.keys().map(context); + +// Finally, start Karma to run the tests +__karma__.start(); diff --git a/src/LanBackup.WebApp/ClientApp/test/karma.conf.js b/src/LanBackup.WebApp/ClientApp/test/karma.conf.js new file mode 100644 index 0000000..e8162c4 --- /dev/null +++ b/src/LanBackup.WebApp/ClientApp/test/karma.conf.js @@ -0,0 +1,25 @@ +// Karma configuration file, see link for more information +// https://karma-runner.github.io/0.13/config/configuration-file.html + +module.exports = function (config) { + config.set({ + basePath: '.', + frameworks: ['jasmine'], + files: [ + '../../wwwroot/dist/vendor.js', + './boot-tests.ts' + ], + preprocessors: { + './boot-tests.ts': ['webpack'] + }, + reporters: ['progress'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + singleRun: false, + webpack: require('../../webpack.config.js').filter(config => config.target !== 'node'), // Test against client bundle, because tests run in a browser + webpackMiddleware: { stats: 'errors-only' } + }); +}; diff --git a/src/LanBackup.WebApp/Controllers/API/BackupConfigController.cs b/src/LanBackup.WebApp/Controllers/API/BackupConfigController.cs new file mode 100644 index 0000000..00b3419 --- /dev/null +++ b/src/LanBackup.WebApp/Controllers/API/BackupConfigController.cs @@ -0,0 +1,220 @@ +using System.Collections.Generic; +using System.Linq; +using Microsoft.AspNetCore.Mvc; +using LanBackup.ModelsCore; +using LanBackup.DataCore; +using Microsoft.AspNetCore.Authorization; +using System.Threading.Tasks; +using System; +using AutoMapper; +using LanBackup.WebApp.Models.DTO; +using AutoMapper.QueryableExtensions; +using LanBackup.WebApp.Models.Telemetry; + +namespace LanBackup.WebApp.Controllers +{ + + /// + /// BackupConfig REST Web api controller for handling backup configurations + /// + [Authorize] + [Produces("application/json")] + [Route("api/[controller]")] + public class BackupConfigController : Controller + { + + private readonly IMapper mapper; + private BackupsContext _context; + private ITelemetryLogger telemetry; + + public BackupConfigController(IMapper mapper, BackupsContext context, ITelemetryLogger telemetry) + { + this.mapper = mapper; + this._context = context; + this.telemetry = telemetry; + } + + + /// + /// retrieve all backup configurations + /// + /// + [AllowAnonymous] + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), 200)] + [ProducesResponseType(typeof(PaginatedList), 200)] + public async Task Get([FromHeader] string idx, [FromHeader] string siz) + //public IEnumerable Get() + { + //return new DatabaseManager(_context).GetBackupConfigs(); + if (!string.IsNullOrEmpty(idx) && !string.IsNullOrEmpty(siz)) + { + return new OkObjectResult( + (await PaginatedList.CreateAsync(_context.Backups, Convert.ToInt32(idx), Convert.ToInt32(siz), o=>o.ClientIP, this.mapper)) + ); + } + return new OkObjectResult(_context.Backups.ProjectTo().ToList()); + } + + /// + /// retrieve backup configuration by ID + /// + /// + /// + [AllowAnonymous] + [HttpGet("{id}")] + [ProducesResponseType(typeof(BackupConfigurationDTO), 200)] + [ProducesResponseType(typeof(BackupConfigurationDTO), 404)] + public IActionResult Get(string id) + { + var res = new DatabaseManager(_context).GetBackupConfig(id); + if (res == null) + { + return NotFound(); + } + var mapped = mapper.Map(res); + return new ObjectResult(mapped); + } + + /// + /// retrieve backup configuration by ID + /// + /// + /// + [AllowAnonymous] + [HttpGet("client/{clientid}")] + [ProducesResponseType(typeof(IEnumerable), 200)] + [ProducesResponseType(typeof(IEnumerable), 404)] + public IActionResult GetByCient(string clientid) + { + var results = new DatabaseManager(_context).GetBackupConfigByClient(clientid); + if (results == null || results.Count() == 0) + return NotFound(); + var mapped = mapper.Map, IEnumerable>(results); + return new ObjectResult(mapped); + } + + + /// + /// create backup configuration + /// + /// + //[Authorize(Roles = "Admin")] + [AllowAnonymous] + [HttpPost] + [ProducesResponseType(typeof(BackupConfigurationDTO), 200)] + [ProducesResponseType(typeof(BackupConfigurationDTO), 400)] + public async Task Create([FromBody]BackupConfigurationDTO backupDTO) + { + if (ModelState.IsValid) + { + try + { + var backup = mapper.Map(backupDTO); + _context.Add(backup); + var res = await _context.SaveChangesAsync(); + if (res > 0) + { + var mapped = mapper.Map(backup); + return new ObjectResult(mapped); + } + } + catch (Exception ex) + { + this.telemetry.TrackException(ex); + return BadRequest( + new { message = ex.Message } + ); + } + } + else + { + string msg = string.Join("|", ModelState.Values.SelectMany(e => e.Errors).Select(s => s.ErrorMessage)); + return BadRequest(msg); + } + return BadRequest(); + } + + + /// + /// Update backup configuration + /// + /// + /// + /// affected records + //[Authorize(Roles = "Admin")] + [AllowAnonymous] + [HttpPut("{id}")] + [ProducesResponseType(typeof(BackupConfigurationDTO), 200)] + [ProducesResponseType(typeof(BackupConfigurationDTO), 400)] + public async Task Update(string id, [FromBody]BackupConfigurationDTO backupDTO) + { + if (id != backupDTO.ID) + { + return BadRequest("Ids do not match"); + } + if (ModelState.IsValid) + { + var backup = mapper.Map(backupDTO); + _context.Update(backup); + try + { + var res = await _context.SaveChangesAsync(); + if (res > 0) + { + var mapped = mapper.Map(backup); + return new ObjectResult(mapped);//retun back the updated object + } + } + catch (Exception ex) + { + this.telemetry.TrackException(ex); + return BadRequest( + new { message = ex.Message } + ); + + } + } + else + { + string msg = string.Join("|", ModelState.Values.SelectMany(e => e.Errors).Select(s => s.ErrorMessage)); + return BadRequest(msg); + } + return BadRequest(); + } + + /// + /// delete backup configuration by id + /// + /// + /// + //[Authorize(Roles = "Admin")] + [AllowAnonymous] + [HttpDelete("{id}")] + [ProducesResponseType(typeof(string), 200)] + [ProducesResponseType(typeof(string), 404)] + public async Task Delete(string id) + { + try + { + BackupConfiguration backup = _context.Backups.Find(id); + _context.Backups.Remove(backup); + var res = await _context.SaveChangesAsync(); + if (res > 0) + { + var mapped = mapper.Map(backup); + return new ObjectResult(mapped);//retun back old Object + } + return NotFound(id); + } + catch (Exception ex) + { + this.telemetry.TrackException(ex); + return BadRequest( + new { message = ex.Message } + ); + } + return NotFound(id); + } + } +} diff --git a/src/LanBackup.WebApp/Controllers/API/LogsController.cs b/src/LanBackup.WebApp/Controllers/API/LogsController.cs new file mode 100644 index 0000000..f720e54 --- /dev/null +++ b/src/LanBackup.WebApp/Controllers/API/LogsController.cs @@ -0,0 +1,168 @@ +using System.Collections.Generic; +using System.Linq; +using Microsoft.AspNetCore.Mvc; +using LanBackup.ModelsCore; +using LanBackup.DataCore; +using Microsoft.AspNetCore.Authorization; +using System.Threading.Tasks; +using System; +using LanBackup.WebApp.Models.DTO; +using AutoMapper; +using AutoMapper.QueryableExtensions; +using LanBackup.WebApp.Models.Telemetry; + +namespace LanBackup.WebApp.Controllers +{ + + /// + /// BackupLogs REST Web api controller for handling logs + /// + [Authorize] + [Produces("application/json")] + [Route("api/[controller]")] + public class LogsController : Controller + { + private readonly IMapper mapper; + private BackupsContext _context; + private ITelemetryLogger telemetry; + + + public LogsController(IMapper mapper, BackupsContext context, ITelemetryLogger telemetry) + { + this.mapper = mapper; + this._context = context; + this.telemetry = telemetry; + } + + + ///// + ///// retrieves all logs from DB + ///// + ///// + //[AllowAnonymous] + //[HttpGet] + //[ProducesResponseType(typeof(IEnumerable), 200)] + //public IActionResult Get() + //{ + // return new OkObjectResult(_context.Logs.ToList()); + // //return new ObjectResult(_context.Logs.ToList()); + //} + + + /// + /// retrieves paginated logs from DB + /// + /// page index + /// page size + /// + [AllowAnonymous] + [HttpGet] + //[HttpGet("{pageIndex}/{pageSize}")] + [ProducesResponseType(typeof(IEnumerable), 200)] + [ProducesResponseType(typeof(PaginatedList), 200)] + public async Task Get([FromHeader] string idx, [FromHeader] string siz) + { + //StringValues val1, val2; + //HttpContext.Request.Headers.TryGetValue("idx", out val1) && + //HttpContext.Request.Headers.TryGetValue("siz", out val2) + if (!string.IsNullOrEmpty(idx) && !string.IsNullOrEmpty(siz)) + { + return new OkObjectResult( + (await PaginatedList.CreateAsync(_context.Logs, Convert.ToInt32(idx), Convert.ToInt32(siz), (or)=> or.DateTime, this.mapper)) + ); + } + return new OkObjectResult(_context.Logs.ProjectTo().ToList()); + } + + + /// + /// retrieves alog record by ID + /// + /// + /// + [AllowAnonymous] + [HttpGet("{id}")] + [ProducesResponseType(typeof(BackupLogDTO), 200)] + [ProducesResponseType(typeof(BackupLogDTO), 404)] + public IActionResult Get(int id) + { + var result = _context.Logs.SingleOrDefault(p => p.ID == id); + if (result == null) + { + return NotFound(); + } + var mapped = mapper.Map(result); + return new OkObjectResult(mapped); + } + + + /// + /// retrieve all logs of a clientIP + /// + /// + /// + [AllowAnonymous] + [HttpGet("client/{clientid}")] + [ProducesResponseType(typeof(IEnumerable), 200)] + [ProducesResponseType(typeof(IEnumerable), 404)] + public IActionResult GetByCientID(string clientid) + { + var results = _context.Logs.Where(p => p.ClientIP == clientid).OrderByDescending(o => o.DateTime); + if (results == null || results.Count() == 0) + return NotFound(); + var mapped = mapper.Map, IEnumerable>(results); + return new OkObjectResult(mapped); + } + + + /// + /// retrieves all logs of a specific configuration + /// + /// + /// + [AllowAnonymous] + [HttpGet("config/{configurationid}")] + [ProducesResponseType(typeof(IEnumerable), 200)] + [ProducesResponseType(typeof(IEnumerable), 404)] + public IActionResult GetByConfigurationID(string configurationid) + { + var results = _context.Logs.Where(p => p.ConfigurationID == configurationid).OrderByDescending(o => o.DateTime); + if (results == null || results.Count() == 0) + return NotFound(); + var mapped = mapper.Map, IEnumerable>(results); + return new ObjectResult(mapped); + } + + + + //[EnableCors("AllowSpecificOrigin")] + /// + /// Create an entry in the logs + /// + /// + /// + [AllowAnonymous]//[Authorize(Roles = "Admin")] + [HttpPost] + [ProducesResponseType(typeof(int), 200)] + [ProducesResponseType(typeof(int), 400)] + public async Task Create([FromBody]BackupLog log) + { + if (ModelState.IsValid) + { + _context.Logs.Add(log); + var res = await _context.SaveChangesAsync(); + if (res >0 ) + return new ObjectResult(log.ID);//retun back the new ID + } + else + { + string msg = string.Join("|", ModelState.Values.SelectMany(e => e.Errors).Select(s => s.ErrorMessage)); + return BadRequest(msg); + } + return BadRequest(); + } + + + + } +} diff --git a/src/LanBackup.WebApp/Controllers/API/UsersController.cs b/src/LanBackup.WebApp/Controllers/API/UsersController.cs new file mode 100644 index 0000000..c9807b7 --- /dev/null +++ b/src/LanBackup.WebApp/Controllers/API/UsersController.cs @@ -0,0 +1,246 @@ +using LanBackup.WebApp.Data; +using LanBackup.WebApp.Models; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Identity.EntityFrameworkCore; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LanBackup.WebApp.Models.Telemetry; +using System.Net; + +namespace LanBackup.WebApp.Controllers +{ + /// + /// BackupConfig REST Web api controller for handling users + /// + [Authorize] + [Produces("application/json")] + [Route("api/[controller]")] + public class UsersController : Controller + { + + + private readonly UserManager _userManager; + private readonly SignInManager _signInManager; + private readonly ApplicationDbContext _appDbContext; + private ITelemetryLogger telemetry; + + + public UsersController( + ApplicationDbContext appDbContex, + UserManager userManager, + SignInManager signInManager, + ITelemetryLogger telemetry + ) + { + this.telemetry = telemetry; + _userManager = userManager; + _signInManager = signInManager; + _appDbContext = appDbContex; + } + + + + + [HttpPost("register")] + [AllowAnonymous] + [ProducesResponseType(typeof(IdentityResult), 200)] + [ProducesResponseType(typeof(IdentityResult), 400)] + public async Task Register([FromBody]User dtouser) + { + try + { + + dtouser.IsAdmin = false; + + var user = new ApplicationUser { UserName = dtouser.Email, Email = dtouser.Email }; + var result = await _userManager.CreateAsync(user, dtouser.Password); + if (result.Succeeded) + { + + //update is Admin + var adminRole = _appDbContext.Roles.FirstOrDefault(r => r.NormalizedName == "ADMIN"); + var iuser = _appDbContext.Users.FirstOrDefault(u => u.Email == dtouser.Email); + dtouser.IsAdmin = _appDbContext.UserRoles.FirstOrDefault(u => u.RoleId == adminRole.Id && u.UserId == iuser.Id) != null; + + await _signInManager.SignInAsync(user, isPersistent: false); + dtouser.Succeeded = true; + this.telemetry.TrackEvent("NewRegistration"); + return new ObjectResult(dtouser); + } + else + { + string msg = string.Join("|", result.Errors.Select(e => e.Description)); + return BadRequest(msg); + } + } + catch (Exception ex) + { + this.telemetry.TrackException(ex); + return BadRequest(ex.Message); + } + return BadRequest(); + } + + + + + [HttpPost("login")] + [AllowAnonymous] + [ProducesResponseType(typeof(User), 200)] + [ProducesResponseType(typeof(User), 400)] + public async Task Login([FromBody]User dtouser) + { + try + { + dtouser.Succeeded = false; + // This doesn't count login failures towards account lockout + // To enable password failures to trigger account lockout, set lockoutOnFailure: true + var result = await _signInManager.PasswordSignInAsync(dtouser.Email, dtouser.Password, isPersistent: false, lockoutOnFailure: false); + if (result.Succeeded) + { + dtouser.Succeeded = result.Succeeded; + dtouser.IsLockedOut = result.IsLockedOut; + + //update is Admin + var adminRole = _appDbContext.Roles.FirstOrDefault(r => r.NormalizedName == "ADMIN"); + var iuser = _appDbContext.Users.FirstOrDefault(u => u.Email == dtouser.Email); + dtouser.IsAdmin = _appDbContext.UserRoles.FirstOrDefault(u => u.RoleId == adminRole.Id && u.UserId == iuser.Id) != null; + + var user = new ApplicationUser { UserName = dtouser.Email, Email = dtouser.Email }; + + this.telemetry.TrackEvent("LoginSuccess"); + return Ok(dtouser); + } + else + { + this.telemetry.TrackEvent("LoginFailure"); + dtouser.Errors = new IdentityError[] { new IdentityError { Description = "Login failed" } }; + } + return Ok(dtouser); + } + catch (Exception ex) + { + this.telemetry.TrackException(ex); + return BadRequest(ex.Message); + } + } + + + + + + [HttpPost("pwchange")] + [AllowAnonymous] //TODO - allow only authenticated users to do the update + [ProducesResponseType(typeof(User), 200)] + [ProducesResponseType(typeof(string), 400)] + [ProducesResponseType(typeof(string), 401)] + public async Task ChangePasssword([FromBody]User dtouser) + { + try + { + var user = await _userManager.GetUserAsync(HttpContext.User); + if (user != null) + { + dtouser.Succeeded = false; + var result = await _userManager.ChangePasswordAsync(user, dtouser.Password, dtouser.NewPassword); + if (result.Succeeded) + { + dtouser.Succeeded = result.Succeeded; + dtouser.Errors = result.Errors.ToArray(); + await _signInManager.SignInAsync(user, isPersistent: false); + this.telemetry.TrackEvent("ChangePasswordSuccess"); + return Ok(dtouser); + } + else + { + this.telemetry.TrackEvent("ChangePasswordFailure"); + string msg = string.Join("|", result.Errors.Select(e => e.Description)); + return BadRequest(msg); + } + } + return StatusCode((int)HttpStatusCode.Unauthorized, "User not logged in");// Unauthorized(); + } + catch (Exception ex) + { + this.telemetry.TrackException(ex); + return BadRequest(ex.Message); + } + } + + + + + + [HttpGet("list")] + [AllowAnonymous] + [ProducesResponseType(typeof(IEnumerable), 200)] + public async Task Users() + { + var adminRole = _appDbContext.Roles.FirstOrDefault(r => r.NormalizedName == "ADMIN"); + List allusers = new List(); + foreach (var iuser in _appDbContext.Users) + { + var isAdmin = _appDbContext.UserRoles.FirstOrDefault(u => u.UserId == iuser.Id && u.RoleId == adminRole.Id) != null; + allusers.Add(new User() { Email = iuser.Email, IsAdmin = isAdmin }); + } + return Ok(allusers); + } + + + [HttpPost("list")] + [AllowAnonymous] + [ProducesResponseType(typeof(User), 200)] + public async Task ChangeAdminRole([FromBody] User user) + { + user.Succeeded = true; + try + { + var currUser = await _userManager.GetUserAsync(HttpContext.User); + if (currUser.Email != user.Email) + { + + var adminRole = _appDbContext.Roles.FirstOrDefault(r => r.NormalizedName == "ADMIN"); + var iuser = _appDbContext.Users.FirstOrDefault(u => u.Email == user.Email); + if (iuser != null) + { + var role = _appDbContext.UserRoles.FirstOrDefault(u => u.UserId == iuser.Id && u.RoleId == adminRole.Id); + if (role == null && user.IsAdmin) + { + //add + _appDbContext.UserRoles.Add(new IdentityUserRole() { RoleId = adminRole.Id, UserId = iuser.Id }); + await _appDbContext.SaveChangesAsync(); + } + if (role != null && !user.IsAdmin) + { + //remove + var ur = _appDbContext.UserRoles.FirstOrDefault(u => u.RoleId == adminRole.Id && u.UserId == iuser.Id); + if (ur != null) + _appDbContext.UserRoles.Remove(ur); + } + } + //success + this.telemetry.TrackEvent("ChangeAdminRole"); + } + else + { + //admin cannot deactivate himself + user.Succeeded = false; + user.Errors = new IdentityError[] { new IdentityError() { Description = "User cannot operate over himself" } }; + } + } + catch (Exception ex) + { + this.telemetry.TrackException(ex); + user.Succeeded = false; + user.Errors = new IdentityError[] { new IdentityError() { Description = ex.Message } }; + } + return Ok(user); + } + + + } +} diff --git a/src/LanBackup.WebApp/Controllers/HomeController.cs b/src/LanBackup.WebApp/Controllers/HomeController.cs new file mode 100644 index 0000000..2363819 --- /dev/null +++ b/src/LanBackup.WebApp/Controllers/HomeController.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace LanBackup.WebApp.Controllers +{ + public class HomeController : Controller + { + public IActionResult Index() + { + return View(); + } + + public IActionResult Error() + { + return View(); + } + } +} diff --git a/src/LanBackup.WebApp/Controllers/LanAgentsController.cs b/src/LanBackup.WebApp/Controllers/LanAgentsController.cs new file mode 100644 index 0000000..07ba93b --- /dev/null +++ b/src/LanBackup.WebApp/Controllers/LanAgentsController.cs @@ -0,0 +1,68 @@ +using System.Collections.Generic; +using LanBackup.Models; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Authorization; +using System.Threading.Tasks; +using System.Linq; +using System.Collections.Concurrent; +using System; + +namespace LanBackup.WebApp.Controllers +{ + [Produces("application/json")] + [Route("api/[controller]")] + public class LanAgentsController : Controller + { + + private const int MAXIMUM_ONLINE_DELAY = 15000; + private static ConcurrentDictionary liveAgents = new ConcurrentDictionary(); + + public bool UpdateAgentStatus(StatusReportInfo info) + { + liveAgents[info.IP] = info; + return true; + } + + + + /// + /// retrieve all backup configurations + /// + /// + [AllowAnonymous] + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), 200)] + public async Task Get() + { + return new OkObjectResult( liveAgents.Values.ToList()); + } + + //used internalyby SignalR + public IEnumerable GetAgents() { + return liveAgents.Values.ToList(); + } + + + /// + /// Refreshes online agents + /// + /// true if agents list updated + public bool RefreshOnlineAgents() { + var now = DateTime.UtcNow; + List toRemove = new List(); + foreach (var item in liveAgents) + { + if (now > item.Value.StatusDateTime + TimeSpan.FromMilliseconds(MAXIMUM_ONLINE_DELAY)) + toRemove.Add(item.Key); + } + foreach (var keyRemove in toRemove) + { + StatusReportInfo removed; + liveAgents.TryRemove(keyRemove, out removed); + } + return toRemove.Count > 0; + } + + + } +} diff --git a/src/LanBackup.WebApp/Controllers/PaginatedList.cs b/src/LanBackup.WebApp/Controllers/PaginatedList.cs new file mode 100644 index 0000000..819bbbb --- /dev/null +++ b/src/LanBackup.WebApp/Controllers/PaginatedList.cs @@ -0,0 +1,62 @@ +using AutoMapper; +using Microsoft.EntityFrameworkCore; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace LanBackup.WebApp.Controllers +{ + public class PaginatedList + { + [JsonProperty(PropertyName = "pi")] + public int PageIndex { get; private set; } + [JsonProperty(PropertyName = "tp")] + public int TotalPages { get; private set; } + [JsonProperty(PropertyName = "recs")] + public List Records { get; private set; } = new List(); + + public PaginatedList(List items, int count, int pageIndex, int pageSize) + { + PageIndex = pageIndex; + TotalPages = (int)Math.Ceiling(count / (double)pageSize); + Records.AddRange(items); + } + + [JsonProperty(PropertyName = "hp")] + public bool HasPreviousPage + { + get + { + return (PageIndex > 1); + } + } + + [JsonProperty(PropertyName = "hn")] + public bool HasNextPage + { + get + { + return (PageIndex < TotalPages); + } + } + + public static async Task> CreateAsync(IQueryable source, int pageIndex, int pageSize, Func order, IMapper mapper) + { + var count = await source.CountAsync(); + if (order != null) + { + var items = source.OrderByDescending(order).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList();// .ToListAsync(); + var mappedItems = mapper.Map, List>(items); + return new PaginatedList(mappedItems, count, pageIndex, pageSize); + } + else + { + var items = await source.Skip((pageIndex - 1) * pageSize).Take(pageSize).ToListAsync(); + var mappedItems = mapper.Map, List>(items); + return new PaginatedList(mappedItems, count, pageIndex, pageSize); + } + } + } +} diff --git a/src/LanBackup.WebApp/Data/ApplicationDbContext.cs b/src/LanBackup.WebApp/Data/ApplicationDbContext.cs new file mode 100644 index 0000000..e6cd909 --- /dev/null +++ b/src/LanBackup.WebApp/Data/ApplicationDbContext.cs @@ -0,0 +1,22 @@ +using Microsoft.AspNetCore.Identity.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using LanBackup.WebApp.Models; + +namespace LanBackup.WebApp.Data +{ + public class ApplicationDbContext : IdentityDbContext + { + public ApplicationDbContext(DbContextOptions options) + : base(options) + { + } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + // Customize the ASP.NET Identity model and override the defaults if needed. + // For example, you can rename the ASP.NET Identity table names and more. + // Add your customizations after calling base.OnModelCreating(builder); + } + } +} diff --git a/src/LanBackup.WebApp/Dockerfile b/src/LanBackup.WebApp/Dockerfile new file mode 100644 index 0000000..9a184fa --- /dev/null +++ b/src/LanBackup.WebApp/Dockerfile @@ -0,0 +1,16 @@ +FROM microsoft/dotnet:1.1.0-sdk-projectjson + +RUN apt-get update +RUN wget -qO- https://deb.nodesource.com/setup_4.x | bash - +RUN apt-get install -y build-essential nodejs + +COPY . /app + +WORKDIR /app + +RUN ["dotnet", "restore"] +RUN ["dotnet", "build"] + +EXPOSE 5000/tcp + +CMD ["dotnet", "run", "--server.urls", "http://*:5000"] diff --git a/src/LanBackup.WebApp/Extensions/ServiceCollectionExtensions.cs b/src/LanBackup.WebApp/Extensions/ServiceCollectionExtensions.cs new file mode 100644 index 0000000..9a8fa8e --- /dev/null +++ b/src/LanBackup.WebApp/Extensions/ServiceCollectionExtensions.cs @@ -0,0 +1,14 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; + +namespace LanBackup +{ + public static class ServiceCollectionExtensions + { + public static void AddEntityFramework(this IServiceCollection services, string sqlConnectionString) where T : DbContext + { + services.AddDbContext(options => + options.UseSqlServer(sqlConnectionString)); + } + } +} diff --git a/src/LanBackup.WebApp/Hubs/HubUserIdProvider.cs b/src/LanBackup.WebApp/Hubs/HubUserIdProvider.cs new file mode 100644 index 0000000..cd3fa0e --- /dev/null +++ b/src/LanBackup.WebApp/Hubs/HubUserIdProvider.cs @@ -0,0 +1,16 @@ +using System; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.SignalR; + +namespace LanBackup.WebApp.Hubs +{ + internal class HubUserIdProvider : IUserIdProvider + { + public string GetUserId(HttpRequest request) + { + string ip = request.Query["ip"]; + //request.HttpContext.User.Identity.Name; + return ip; + } + } +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/Hubs/LanBackupsHub.cs b/src/LanBackup.WebApp/Hubs/LanBackupsHub.cs new file mode 100644 index 0000000..52e4f40 --- /dev/null +++ b/src/LanBackup.WebApp/Hubs/LanBackupsHub.cs @@ -0,0 +1,55 @@ +using LanBackup.Models; +using LanBackup.WebApp.Controllers; +using Microsoft.AspNetCore.SignalR; +using Microsoft.AspNetCore.SignalR.Hubs; +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace LanBackup.Hubs +{ + [HubName("backupslan")] + public class LanBackupsHub : Hub + { + + private LanAgentsController _agents; + private Timer _cleanTimer; + + public LanBackupsHub( + LanAgentsController agents + ) + { + this._agents = agents; + _cleanTimer = new Timer(CheckOnlineAgents, null, TimeSpan.FromMilliseconds(5000), TimeSpan.FromMilliseconds(5000)); + } + + private void CheckOnlineAgents(object state) + { + if(this._agents.RefreshOnlineAgents()) + { + Clients.All.agentsRefresh(_agents.GetAgents()); + } + } + + + //calls from agents to server + public bool StatusReport(StatusReportInfo info) + { + _agents.UpdateAgentStatus(info); + Clients.All.agentsRefresh(_agents.GetAgents()); + return true; + } + + + //calls from server to agents + public void controlAgent(string agentId, string message) { //TODO - message can be configID, TEST_SOURCE or TEST DEST + Clients.Client(agentId).controlAgent(message); + } + + + + + + } + +} diff --git a/src/LanBackup.WebApp/LanBackup.WebApp.xproj b/src/LanBackup.WebApp/LanBackup.WebApp.xproj new file mode 100644 index 0000000..761894e --- /dev/null +++ b/src/LanBackup.WebApp/LanBackup.WebApp.xproj @@ -0,0 +1,20 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + true + + + + 315453e2-9c17-46f3-9ccc-2fc0688342c2 + LanBackup.WebApp + v4.5.2 + + + 2.0 + /subscriptions/4373ca20-c9dd-4d57-8d1f-21a91e7fb5d1/resourcegroups/Default-Web-WestEurope/providers/microsoft.insights/components/LANBackups + /subscriptions/4373ca20-c9dd-4d57-8d1f-21a91e7fb5d1/resourcegroups/Default-Web-WestEurope/providers/microsoft.insights/components/LANBackups + + + \ No newline at end of file diff --git a/src/LanBackup.WebApp/Middleware/IUserKeysRepository.cs b/src/LanBackup.WebApp/Middleware/IUserKeysRepository.cs new file mode 100644 index 0000000..ffca554 --- /dev/null +++ b/src/LanBackup.WebApp/Middleware/IUserKeysRepository.cs @@ -0,0 +1,9 @@ +using Microsoft.Extensions.Primitives; + +namespace LanBackup.WebApp.Middleware +{ + public interface IUserKeysRepository + { + bool CheckValidUserKey(StringValues stringValues); + } +} diff --git a/src/LanBackup.WebApp/Middleware/UserKeyValidatorsMiddleware.cs b/src/LanBackup.WebApp/Middleware/UserKeyValidatorsMiddleware.cs new file mode 100644 index 0000000..e5c948a --- /dev/null +++ b/src/LanBackup.WebApp/Middleware/UserKeyValidatorsMiddleware.cs @@ -0,0 +1,88 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Authentication; +using System; +using System.Security.Claims; +using System.Threading.Tasks; + +namespace LanBackup.WebApp.Middleware +{ + public class UserKeyValidatorsMiddleware + { + private readonly RequestDelegate _next; + private IUserKeysRepository _keysRepo { get; set; } + + public UserKeyValidatorsMiddleware(RequestDelegate next, IUserKeysRepository _repo) + { + _next = next; + _keysRepo = _repo; + } + + public async Task Invoke(HttpContext context) + { + if (!context.User.Identity.IsAuthenticated) + { + + if (context.Request.Headers.Keys.Contains("user-key") && + _keysRepo.CheckValidUserKey(context.Request.Headers["user-key"])) + { + + string userName = "LanBackupAgent"; + var usernameClaim = new Claim(ClaimTypes.Name, userName); + var identity = new ClaimsIdentity(new[] { usernameClaim }, "ApiKey"); + var principal = new ClaimsPrincipal(identity); + AuthenticationProperties prop = new AuthenticationProperties() + { + IsPersistent = true, + ExpiresUtc = DateTime.UtcNow.AddMilliseconds(1000) + }; + await context.Authentication.SignInAsync( + Startup.AuthenticationSchemeName + //"KeyValueMiddleware" + , principal); + } + else + { + if (context.Request.Path.ToString().Contains(@"/api/")) + { + context.Response.StatusCode = 401; //UnAuthorized + await context.Response.WriteAsync("{ err: 'unauthorized' }"); + return; + } + } + + + //if (!context.Request.Headers.Keys.Contains("user-key")) + //{ + // context.Response.StatusCode = 400; //Bad Request + // await context.Response.WriteAsync("User Key is missing"); + // return; + //} + //else + //{ + // if (!_keysRepo.CheckValidUserKey(context.Request.Headers["user-key"])) + // { + // context.Response.StatusCode = 401; //UnAuthorized + // await context.Response.WriteAsync("Invalid User Key"); + // return; + // } + //} + + } + + await _next.Invoke(context); + } + + } + + #region ExtensionMethod + public static class UserKeyValidatorsExtension + { + public static IApplicationBuilder ApplyUserKeyValidation(this IApplicationBuilder app) + { + app.UseMiddleware(); + return app; + } + } + #endregion +} diff --git a/src/LanBackup.WebApp/Middleware/UserKeysRepository.cs b/src/LanBackup.WebApp/Middleware/UserKeysRepository.cs new file mode 100644 index 0000000..0185113 --- /dev/null +++ b/src/LanBackup.WebApp/Middleware/UserKeysRepository.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.Extensions.Primitives; + +namespace LanBackup.WebApp.Middleware +{ + public class UserKeysRepository : IUserKeysRepository + { + + List _validKeys = new List() { + "12345" //TEST VALUE + }; + public bool CheckValidUserKey(StringValues key) + { + return _validKeys.Contains(key); + } + } +} diff --git a/src/LanBackup.WebApp/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs b/src/LanBackup.WebApp/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs new file mode 100644 index 0000000..a163c62 --- /dev/null +++ b/src/LanBackup.WebApp/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; + +namespace LanBackup.WebApp.Models.AccountViewModels +{ + public class ExternalLoginConfirmationViewModel + { + [Required] + [EmailAddress] + public string Email { get; set; } + } +} diff --git a/src/LanBackup.WebApp/Models/AccountViewModels/ForgotPasswordViewModel.cs b/src/LanBackup.WebApp/Models/AccountViewModels/ForgotPasswordViewModel.cs new file mode 100644 index 0000000..5fe8cf0 --- /dev/null +++ b/src/LanBackup.WebApp/Models/AccountViewModels/ForgotPasswordViewModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; + +namespace LanBackup.WebApp.Models.AccountViewModels +{ + public class ForgotPasswordViewModel + { + [Required] + [EmailAddress] + public string Email { get; set; } + } +} diff --git a/src/LanBackup.WebApp/Models/AccountViewModels/LoginViewModel.cs b/src/LanBackup.WebApp/Models/AccountViewModels/LoginViewModel.cs new file mode 100644 index 0000000..06789a1 --- /dev/null +++ b/src/LanBackup.WebApp/Models/AccountViewModels/LoginViewModel.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; + +namespace LanBackup.WebApp.Models.AccountViewModels +{ + public class LoginViewModel + { + [Required] + [EmailAddress] + public string Email { get; set; } + + [Required] + [DataType(DataType.Password)] + public string Password { get; set; } + + [Display(Name = "Remember me?")] + public bool RememberMe { get; set; } + } +} diff --git a/src/LanBackup.WebApp/Models/AccountViewModels/RegisterViewModel.cs b/src/LanBackup.WebApp/Models/AccountViewModels/RegisterViewModel.cs new file mode 100644 index 0000000..155d811 --- /dev/null +++ b/src/LanBackup.WebApp/Models/AccountViewModels/RegisterViewModel.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; + +namespace LanBackup.WebApp.Models.AccountViewModels +{ + public class RegisterViewModel + { + [Required] + [EmailAddress] + [Display(Name = "Email")] + public string Email { get; set; } + + [Required] + [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] + [DataType(DataType.Password)] + [Display(Name = "Password")] + public string Password { get; set; } + + [DataType(DataType.Password)] + [Display(Name = "Confirm password")] + [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] + public string ConfirmPassword { get; set; } + } +} diff --git a/src/LanBackup.WebApp/Models/AccountViewModels/ResetPasswordViewModel.cs b/src/LanBackup.WebApp/Models/AccountViewModels/ResetPasswordViewModel.cs new file mode 100644 index 0000000..2b3e28c --- /dev/null +++ b/src/LanBackup.WebApp/Models/AccountViewModels/ResetPasswordViewModel.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; + +namespace LanBackup.WebApp.Models.AccountViewModels +{ + public class ResetPasswordViewModel + { + [Required] + [EmailAddress] + public string Email { get; set; } + + [Required] + [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] + [DataType(DataType.Password)] + public string Password { get; set; } + + [DataType(DataType.Password)] + [Display(Name = "Confirm password")] + [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] + public string ConfirmPassword { get; set; } + + public string Code { get; set; } + } +} diff --git a/src/LanBackup.WebApp/Models/AccountViewModels/SendCodeViewModel.cs b/src/LanBackup.WebApp/Models/AccountViewModels/SendCodeViewModel.cs new file mode 100644 index 0000000..feab418 --- /dev/null +++ b/src/LanBackup.WebApp/Models/AccountViewModels/SendCodeViewModel.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc.Rendering; + +namespace LanBackup.WebApp.Models.AccountViewModels +{ + public class SendCodeViewModel + { + public string SelectedProvider { get; set; } + + public ICollection Providers { get; set; } + + public string ReturnUrl { get; set; } + + public bool RememberMe { get; set; } + } +} diff --git a/src/LanBackup.WebApp/Models/AccountViewModels/VerifyCodeViewModel.cs b/src/LanBackup.WebApp/Models/AccountViewModels/VerifyCodeViewModel.cs new file mode 100644 index 0000000..0d7d11d --- /dev/null +++ b/src/LanBackup.WebApp/Models/AccountViewModels/VerifyCodeViewModel.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; + +namespace LanBackup.WebApp.Models.AccountViewModels +{ + public class VerifyCodeViewModel + { + [Required] + public string Provider { get; set; } + + [Required] + public string Code { get; set; } + + public string ReturnUrl { get; set; } + + [Display(Name = "Remember this browser?")] + public bool RememberBrowser { get; set; } + + [Display(Name = "Remember me?")] + public bool RememberMe { get; set; } + } +} diff --git a/src/LanBackup.WebApp/Models/ApplicationUser.cs b/src/LanBackup.WebApp/Models/ApplicationUser.cs new file mode 100644 index 0000000..b93798c --- /dev/null +++ b/src/LanBackup.WebApp/Models/ApplicationUser.cs @@ -0,0 +1,9 @@ +using Microsoft.AspNetCore.Identity.EntityFrameworkCore; + +namespace LanBackup.WebApp.Models +{ + // Add profile data for application users by adding properties to the ApplicationUser class + public class ApplicationUser : IdentityUser + { + } +} diff --git a/src/LanBackup.WebApp/Models/Automapper/MappingProfile.cs b/src/LanBackup.WebApp/Models/Automapper/MappingProfile.cs new file mode 100644 index 0000000..feb5161 --- /dev/null +++ b/src/LanBackup.WebApp/Models/Automapper/MappingProfile.cs @@ -0,0 +1,16 @@ +using AutoMapper; +using LanBackup.WebApp.Models.DTO; +using LanBackup.ModelsCore; + +namespace LanBackup.WebApp +{ + public class MappingProfile : Profile + { + public MappingProfile() + { + // map your objects + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + } + } +} diff --git a/src/LanBackup.WebApp/Models/ClientSettings/ClientConfiguration.cs b/src/LanBackup.WebApp/Models/ClientSettings/ClientConfiguration.cs new file mode 100644 index 0000000..4c82f0a --- /dev/null +++ b/src/LanBackup.WebApp/Models/ClientSettings/ClientConfiguration.cs @@ -0,0 +1,19 @@ +using Microsoft.Extensions.Configuration; + +namespace LanBackup.WebApp.Models +{ + public class ClientConfiguration + { + + public ClientSettingsData ClientSettings { get; set; } + + public ClientConfiguration(IConfigurationRoot conf) + { + this.ClientSettings = conf.GetSection("clientSettings").Get(); + } + + public static ClientConfiguration Instance { get; set; } + + + } +} diff --git a/src/LanBackup.WebApp/Models/ClientSettings/ClientSettingsData.cs b/src/LanBackup.WebApp/Models/ClientSettings/ClientSettingsData.cs new file mode 100644 index 0000000..569842c --- /dev/null +++ b/src/LanBackup.WebApp/Models/ClientSettings/ClientSettingsData.cs @@ -0,0 +1,9 @@ +namespace LanBackup.WebApp.Models +{ + public class ClientSettingsData + { + public string AdminEmail{ get; set; } + public bool InstrumentationEnabled { get; set; } + public string InstrumentationKey { get; set; } + } +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/Models/DTO/BackupConfigurationDTO.cs b/src/LanBackup.WebApp/Models/DTO/BackupConfigurationDTO.cs new file mode 100644 index 0000000..50313bc --- /dev/null +++ b/src/LanBackup.WebApp/Models/DTO/BackupConfigurationDTO.cs @@ -0,0 +1,27 @@ +using System.ComponentModel.DataAnnotations; + +namespace LanBackup.WebApp.Models.DTO +{ + public class BackupConfigurationDTO + { + + public BackupConfigurationDTO() + { + } + + public string ID { get; set; } + public byte[] RowVersion { get; set; } + [RegularExpression(@"^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$")] + [Required] + public string ClientIP { get; set; } + public string SrcFolder { get; set; } + public string SrcUser { get; set; } + public string SrcPass { get; set; } + public string DestLanFolder { get; set; } + public string DestUser { get; set; } + public string DestPass { get; set; } + public bool IsActive { get; set; } + public string Crontab { get; set; } + + } +} diff --git a/src/LanBackup.WebApp/Models/DTO/BackupLogDTO.cs b/src/LanBackup.WebApp/Models/DTO/BackupLogDTO.cs new file mode 100644 index 0000000..0c7dd11 --- /dev/null +++ b/src/LanBackup.WebApp/Models/DTO/BackupLogDTO.cs @@ -0,0 +1,23 @@ +using System; +using System.ComponentModel.DataAnnotations; + +namespace LanBackup.WebApp.Models.DTO +{ + public class BackupLogDTO + { + + public BackupLogDTO() + { } + + public int ID { get; set; } + public byte[] RowVersion { get; set; } + [RegularExpression(@"^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$")] + public string ClientIP { get; set; } + public string ConfigurationID { get; set; } + public string Description { get; set; } + public string LogError { get; set; } + public string Status { get; set; } + public DateTime DateTime { get; set; } + + } +} diff --git a/src/LanBackup.WebApp/Models/DTO/StatusReportInfo.cs b/src/LanBackup.WebApp/Models/DTO/StatusReportInfo.cs new file mode 100644 index 0000000..db4877d --- /dev/null +++ b/src/LanBackup.WebApp/Models/DTO/StatusReportInfo.cs @@ -0,0 +1,38 @@ +using Newtonsoft.Json; +using System; + +namespace LanBackup.Models +{ + //[Json] + public class StatusReportInfo + { + [JsonProperty(PropertyName ="ip")] + public string IP { get; set; } + + [JsonProperty(PropertyName = "configurationId")] + public string ConfigurationId { get; set; } + + [JsonProperty(PropertyName = "statusType")] + public StatusType StatusType { get; set; } + + [JsonProperty(PropertyName = "statusDescription")] + public string StatusDescription { get; set; } + + [JsonProperty(PropertyName = "statusPercent")] + public int StatusPercent { get; set; } = -1; + + [JsonProperty(PropertyName = "statusDateTime")] + public DateTime StatusDateTime { get; set; } + } + + + public enum StatusType + { + Idle, + Starting, + CopyFolders, + CopyFiles, + Error + } + +} diff --git a/src/LanBackup.WebApp/Models/DTO/User.cs b/src/LanBackup.WebApp/Models/DTO/User.cs new file mode 100644 index 0000000..bae1d61 --- /dev/null +++ b/src/LanBackup.WebApp/Models/DTO/User.cs @@ -0,0 +1,19 @@ +using System.Collections.Generic; +using Microsoft.AspNetCore.Identity; + +namespace LanBackup.WebApp.Models +{ + public class User + { + public IdentityError[] Errors; + + public string Email { get; set; } + public string Password { get; set; } + public string NewPassword { get; set; } + public bool IsAdmin { get; set; } + public bool Succeeded { get; set; } + public bool IsLockedOut { get; set; } + + + } +} diff --git a/src/LanBackup.WebApp/Models/ManageViewModels/AddPhoneNumberViewModel.cs b/src/LanBackup.WebApp/Models/ManageViewModels/AddPhoneNumberViewModel.cs new file mode 100644 index 0000000..7b5a46b --- /dev/null +++ b/src/LanBackup.WebApp/Models/ManageViewModels/AddPhoneNumberViewModel.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; + +namespace LanBackup.WebApp.Models.ManageViewModels +{ + public class AddPhoneNumberViewModel + { + [Required] + [Phone] + [Display(Name = "Phone number")] + public string PhoneNumber { get; set; } + } +} diff --git a/src/LanBackup.WebApp/Models/ManageViewModels/ChangePasswordViewModel.cs b/src/LanBackup.WebApp/Models/ManageViewModels/ChangePasswordViewModel.cs new file mode 100644 index 0000000..b7ed6cf --- /dev/null +++ b/src/LanBackup.WebApp/Models/ManageViewModels/ChangePasswordViewModel.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; + +namespace LanBackup.WebApp.Models.ManageViewModels +{ + public class ChangePasswordViewModel + { + [Required] + [DataType(DataType.Password)] + [Display(Name = "Current password")] + public string OldPassword { get; set; } + + [Required] + [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] + [DataType(DataType.Password)] + [Display(Name = "New password")] + public string NewPassword { get; set; } + + [DataType(DataType.Password)] + [Display(Name = "Confirm new password")] + [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] + public string ConfirmPassword { get; set; } + } +} diff --git a/src/LanBackup.WebApp/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs b/src/LanBackup.WebApp/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs new file mode 100644 index 0000000..4ae4ccb --- /dev/null +++ b/src/LanBackup.WebApp/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc.Rendering; + +namespace LanBackup.WebApp.Models.ManageViewModels +{ + public class ConfigureTwoFactorViewModel + { + public string SelectedProvider { get; set; } + + public ICollection Providers { get; set; } + } +} diff --git a/src/LanBackup.WebApp/Models/ManageViewModels/FactorViewModel.cs b/src/LanBackup.WebApp/Models/ManageViewModels/FactorViewModel.cs new file mode 100644 index 0000000..8af4d61 --- /dev/null +++ b/src/LanBackup.WebApp/Models/ManageViewModels/FactorViewModel.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace LanBackup.WebApp.Models.ManageViewModels +{ + public class FactorViewModel + { + public string Purpose { get; set; } + } +} diff --git a/src/LanBackup.WebApp/Models/ManageViewModels/IndexViewModel.cs b/src/LanBackup.WebApp/Models/ManageViewModels/IndexViewModel.cs new file mode 100644 index 0000000..9f2da09 --- /dev/null +++ b/src/LanBackup.WebApp/Models/ManageViewModels/IndexViewModel.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Identity; + +namespace LanBackup.WebApp.Models.ManageViewModels +{ + public class IndexViewModel + { + public bool HasPassword { get; set; } + + public IList Logins { get; set; } + + public string PhoneNumber { get; set; } + + public bool TwoFactor { get; set; } + + public bool BrowserRemembered { get; set; } + } +} diff --git a/src/LanBackup.WebApp/Models/ManageViewModels/ManageLoginsViewModel.cs b/src/LanBackup.WebApp/Models/ManageViewModels/ManageLoginsViewModel.cs new file mode 100644 index 0000000..fe941ff --- /dev/null +++ b/src/LanBackup.WebApp/Models/ManageViewModels/ManageLoginsViewModel.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http.Authentication; +using Microsoft.AspNetCore.Identity; + +namespace LanBackup.WebApp.Models.ManageViewModels +{ + public class ManageLoginsViewModel + { + public IList CurrentLogins { get; set; } + + public IList OtherLogins { get; set; } + } +} diff --git a/src/LanBackup.WebApp/Models/ManageViewModels/RemoveLoginViewModel.cs b/src/LanBackup.WebApp/Models/ManageViewModels/RemoveLoginViewModel.cs new file mode 100644 index 0000000..0e0aaa4 --- /dev/null +++ b/src/LanBackup.WebApp/Models/ManageViewModels/RemoveLoginViewModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; + +namespace LanBackup.WebApp.Models.ManageViewModels +{ + public class RemoveLoginViewModel + { + public string LoginProvider { get; set; } + public string ProviderKey { get; set; } + } +} diff --git a/src/LanBackup.WebApp/Models/ManageViewModels/SetPasswordViewModel.cs b/src/LanBackup.WebApp/Models/ManageViewModels/SetPasswordViewModel.cs new file mode 100644 index 0000000..5974a38 --- /dev/null +++ b/src/LanBackup.WebApp/Models/ManageViewModels/SetPasswordViewModel.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; + +namespace LanBackup.WebApp.Models.ManageViewModels +{ + public class SetPasswordViewModel + { + [Required] + [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] + [DataType(DataType.Password)] + [Display(Name = "New password")] + public string NewPassword { get; set; } + + [DataType(DataType.Password)] + [Display(Name = "Confirm new password")] + [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] + public string ConfirmPassword { get; set; } + } +} diff --git a/src/LanBackup.WebApp/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs b/src/LanBackup.WebApp/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs new file mode 100644 index 0000000..193427e --- /dev/null +++ b/src/LanBackup.WebApp/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; + +namespace LanBackup.WebApp.Models.ManageViewModels +{ + public class VerifyPhoneNumberViewModel + { + [Required] + public string Code { get; set; } + + [Required] + [Phone] + [Display(Name = "Phone number")] + public string PhoneNumber { get; set; } + } +} diff --git a/src/LanBackup.WebApp/Models/Telemetry/ITelemetryLogger.cs b/src/LanBackup.WebApp/Models/Telemetry/ITelemetryLogger.cs new file mode 100644 index 0000000..69eb7bd --- /dev/null +++ b/src/LanBackup.WebApp/Models/Telemetry/ITelemetryLogger.cs @@ -0,0 +1,10 @@ +using System; + +namespace LanBackup.WebApp.Models.Telemetry +{ + public interface ITelemetryLogger + { + void TrackException(Exception ex); + void TrackEvent(string v); + } +} diff --git a/src/LanBackup.WebApp/Models/Telemetry/TelemetryLogger.cs b/src/LanBackup.WebApp/Models/Telemetry/TelemetryLogger.cs new file mode 100644 index 0000000..2092111 --- /dev/null +++ b/src/LanBackup.WebApp/Models/Telemetry/TelemetryLogger.cs @@ -0,0 +1,26 @@ +using Microsoft.ApplicationInsights; +using System; + +namespace LanBackup.WebApp.Models.Telemetry +{ + public class TelemetryLogger : ITelemetryLogger + { + private TelemetryClient _telemetryClient; + + public TelemetryLogger(TelemetryClient telemetryClient) + { + this._telemetryClient = telemetryClient; + } + + public void TrackEvent(string eventmsg) + { + this._telemetryClient.TrackEvent(eventmsg); + } + + public void TrackException(Exception ex) + { + this._telemetryClient.TrackException(ex); + } + } + +} diff --git a/src/LanBackup.WebApp/NuGet.config b/src/LanBackup.WebApp/NuGet.config new file mode 100644 index 0000000..826a1f9 --- /dev/null +++ b/src/LanBackup.WebApp/NuGet.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/LanBackup.WebApp/Program.cs b/src/LanBackup.WebApp/Program.cs new file mode 100644 index 0000000..0daf72b --- /dev/null +++ b/src/LanBackup.WebApp/Program.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; + +namespace LanBackup.WebApp +{ + public class Program + { + public static void Main(string[] args) + { + var config = new ConfigurationBuilder() + .AddCommandLine(args) + .AddEnvironmentVariables(prefix: "ASPNETCORE_") + .Build(); + + var host = new WebHostBuilder() + .UseConfiguration(config) + .UseKestrel() + .UseContentRoot(Directory.GetCurrentDirectory()) + .UseIISIntegration() + .UseStartup() + .Build(); + + host.Run(); + } + } +} diff --git a/src/LanBackup.WebApp/Properties/PublishProfiles/LocalTestISS-publish.ps1 b/src/LanBackup.WebApp/Properties/PublishProfiles/LocalTestISS-publish.ps1 new file mode 100644 index 0000000..c4b80bf --- /dev/null +++ b/src/LanBackup.WebApp/Properties/PublishProfiles/LocalTestISS-publish.ps1 @@ -0,0 +1,19 @@ +[cmdletbinding(SupportsShouldProcess=$true)] +param($publishProperties=@{}, $packOutput, $pubProfilePath) + +# to learn more about this file visit https://go.microsoft.com/fwlink/?LinkId=524327 + +try{ + if ($publishProperties['ProjectGuid'] -eq $null){ + $publishProperties['ProjectGuid'] = '315453e2-9c17-46f3-9ccc-2fc0688342c2' + } + + $publishModulePath = Join-Path (Split-Path $MyInvocation.MyCommand.Path) 'publish-module.psm1' + Import-Module $publishModulePath -DisableNameChecking -Force + + # call Publish-AspNet to perform the publish operation + Publish-AspNet -publishProperties $publishProperties -packOutput $packOutput -pubProfilePath $pubProfilePath +} +catch{ + "An error occurred during publish.`n{0}" -f $_.Exception.Message | Write-Error +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/Properties/PublishProfiles/publish-module.psm1 b/src/LanBackup.WebApp/Properties/PublishProfiles/publish-module.psm1 new file mode 100644 index 0000000..adc6ada --- /dev/null +++ b/src/LanBackup.WebApp/Properties/PublishProfiles/publish-module.psm1 @@ -0,0 +1,1231 @@ +# WARNING: DO NOT MODIFY this file. Visual Studio will override it. +param() + +$script:AspNetPublishHandlers = @{} + +<# +These settings can be overridden with environment variables. +The name of the environment variable should use "Publish" as a +prefix and the names below. For example: + + $env:PublishMSDeployUseChecksum = $true +#> +$global:AspNetPublishSettings = New-Object -TypeName PSCustomObject @{ + MsdeployDefaultProperties = @{ + 'MSDeployUseChecksum'=$false + 'SkipExtraFilesOnServer'=$true + 'retryAttempts' = 20 + 'EnableMSDeployBackup' = $false + 'DeleteExistingFiles' = $false + 'AllowUntrustedCertificate'= $false + 'MSDeployPackageContentFoldername'='website\' + 'EnvironmentName' = 'Production' + 'AuthType'='Basic' + 'MSDeployPublishMethod'='WMSVC' + } +} + +function InternalOverrideSettingsFromEnv{ + [cmdletbinding()] + param( + [Parameter(Position=0)] + [object[]]$settings = ($global:AspNetPublishSettings,$global:AspNetPublishSettings.MsdeployDefaultProperties), + + [Parameter(Position=1)] + [string]$prefix = 'Publish' + ) + process{ + foreach($settingsObj in $settings){ + if($settingsObj -eq $null){ + continue + } + + $settingNames = $null + if($settingsObj -is [hashtable]){ + $settingNames = $settingsObj.Keys + } + else{ + $settingNames = ($settingsObj | Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty Name) + + } + + foreach($name in @($settingNames)){ + $fullname = ('{0}{1}' -f $prefix,$name) + if(Test-Path "env:$fullname"){ + $settingsObj.$name = ((get-childitem "env:$fullname").Value) + } + } + } + } +} + +InternalOverrideSettingsFromEnv -prefix 'Publish' -settings $global:AspNetPublishSettings,$global:AspNetPublishSettings.MsdeployDefaultProperties + +function Register-AspnetPublishHandler{ + [cmdletbinding()] + param( + [Parameter(Mandatory=$true,Position=0)] + $name, + [Parameter(Mandatory=$true,Position=1)] + [ScriptBlock]$handler, + [switch]$force + ) + process{ + if(!($script:AspNetPublishHandlers[$name]) -or $force ){ + 'Adding handler for [{0}]' -f $name | Write-Verbose + $script:AspNetPublishHandlers[$name] = $handler + } + elseif(!($force)){ + 'Ignoring call to Register-AspnetPublishHandler for [name={0}], because a handler with that name exists and -force was not passed.' -f $name | Write-Verbose + } + } +} + +function Get-AspnetPublishHandler{ + [cmdletbinding()] + param( + [Parameter(Mandatory=$true,Position=0)] + $name + ) + process{ + $foundHandler = $script:AspNetPublishHandlers[$name] + + if(!$foundHandler){ + throw ('AspnetPublishHandler with name "{0}" was not found' -f $name) + } + + $foundHandler + } +} + +function GetInternal-ExcludeFilesArg{ + [cmdletbinding()] + param( + $publishProperties + ) + process{ + $excludeFiles = $publishProperties['ExcludeFiles'] + foreach($exclude in $excludeFiles){ + if($exclude){ + [string]$objName = $exclude['objectname'] + + if([string]::IsNullOrEmpty($objName)){ + $objName = 'filePath' + } + + $excludePath = $exclude['absolutepath'] + + # output the result to the return list + ('-skip:objectName={0},absolutePath=''{1}''' -f $objName, $excludePath) + } + } + } +} + +function GetInternal-ReplacementsMSDeployArgs{ + [cmdletbinding()] + param( + $publishProperties + ) + process{ + foreach($replace in ($publishProperties['Replacements'])){ + if($replace){ + $typeValue = $replace['type'] + if(!$typeValue){ $typeValue = 'TextFile' } + + $file = $replace['file'] + $match = $replace['match'] + $newValue = $replace['newValue'] + + if($file -and $match -and $newValue){ + $setParam = ('-setParam:type={0},scope={1},match={2},value={3}' -f $typeValue,$file, $match,$newValue) + 'Adding setparam [{0}]' -f $setParam | Write-Verbose + + # return it + $setParam + } + else{ + 'Skipping replacement because its missing a required value.[file="{0}",match="{1}",newValue="{2}"]' -f $file,$match,$newValue | Write-Verbose + } + } + } + } +} + +<# +.SYNOPSIS +Returns an array of msdeploy arguments that are used across different providers. +For example this will handle useChecksum, AppOffline etc. +This will also add default properties if they are missing. +#> +function GetInternal-SharedMSDeployParametersFrom{ + [cmdletbinding()] + param( + [Parameter(Mandatory=$true,Position=0)] + [HashTable]$publishProperties, + [Parameter(Mandatory=$true,Position=1)] + [System.IO.FileInfo]$packOutput + ) + process{ + $sharedArgs = New-Object psobject -Property @{ + ExtraArgs = @() + DestFragment = '' + EFMigrationData = @{} + } + + # add default properties if they are missing + foreach($propName in $global:AspNetPublishSettings.MsdeployDefaultProperties.Keys){ + if($publishProperties["$propName"] -eq $null){ + $defValue = $global:AspNetPublishSettings.MsdeployDefaultProperties["$propName"] + 'Adding default property to publishProperties ["{0}"="{1}"]' -f $propName,$defValue | Write-Verbose + $publishProperties["$propName"] = $defValue + } + } + + if($publishProperties['MSDeployUseChecksum'] -eq $true){ + $sharedArgs.ExtraArgs += '-usechecksum' + } + + if($publishProperties['EnableMSDeployAppOffline'] -eq $true){ + $sharedArgs.ExtraArgs += '-enablerule:AppOffline' + } + + if($publishProperties['WebPublishMethod'] -eq 'MSDeploy'){ + if($publishProperties['SkipExtraFilesOnServer'] -eq $true){ + $sharedArgs.ExtraArgs += '-enableRule:DoNotDeleteRule' + } + } + + if($publishProperties['WebPublishMethod'] -eq 'FileSystem'){ + if($publishProperties['DeleteExistingFiles'] -eq $false){ + $sharedArgs.ExtraArgs += '-enableRule:DoNotDeleteRule' + } + } + + if($publishProperties['retryAttempts']){ + $sharedArgs.ExtraArgs += ('-retryAttempts:{0}' -f ([int]$publishProperties['retryAttempts'])) + } + + if($publishProperties['EncryptWebConfig'] -eq $true){ + $sharedArgs.ExtraArgs += '-EnableRule:EncryptWebConfig' + } + + if($publishProperties['EnableMSDeployBackup'] -eq $false){ + $sharedArgs.ExtraArgs += '-disablerule:BackupRule' + } + + if($publishProperties['AllowUntrustedCertificate'] -eq $true){ + $sharedArgs.ExtraArgs += '-allowUntrusted' + } + + # add excludes + $sharedArgs.ExtraArgs += (GetInternal-ExcludeFilesArg -publishProperties $publishProperties) + # add replacements + $sharedArgs.ExtraArgs += (GetInternal-ReplacementsMSDeployArgs -publishProperties $publishProperties) + + # add EF Migration + if (($publishProperties['EfMigrations'] -ne $null) -and $publishProperties['EfMigrations'].Count -gt 0){ + if (!(Test-Path -Path $publishProperties['ProjectPath'])) { + throw 'ProjectPath property needs to be defined in the pubxml for EF migration.' + } + try { + # generate T-SQL files + $EFSqlFiles = GenerateInternal-EFMigrationScripts -projectPath $publishProperties['ProjectPath'] -packOutput $packOutput -EFMigrations $publishProperties['EfMigrations'] + $sharedArgs.EFMigrationData.Add('EFSqlFiles',$EFSqlFiles) + } + catch { + throw ('An error occurred while generating EF migrations. {0} {1}' -f $_.Exception,(Get-PSCallStack)) + } + } + # add connection string update + if (($publishProperties['DestinationConnectionStrings'] -ne $null) -and $publishProperties['DestinationConnectionStrings'].Count -gt 0) { + try { + # create/update appsettings.[environment].json + GenerateInternal-AppSettingsFile -packOutput $packOutput -environmentName $publishProperties['EnvironmentName'] -connectionStrings $publishProperties['DestinationConnectionStrings'] + } + catch { + throw ('An error occurred while generating the publish appsettings file. {0} {1}' -f $_.Exception,(Get-PSCallStack)) + } + } + + if(-not [string]::IsNullOrWhiteSpace($publishProperties['ProjectGuid'])) { + AddInternal-ProjectGuidToWebConfig -publishProperties $publishProperties -packOutput $packOutput + } + + # return the args + $sharedArgs + } +} + +<# +.SYNOPSIS +This will publish the folder based on the properties in $publishProperties + +.PARAMETER publishProperties +This is a hashtable containing the publish properties. See the examples here for more info on how to use this parameter. + +.PARAMETER packOutput +The folder path to the output of the dnu publish command. This folder contains the files +that will be published. + +.PARAMETER pubProfilePath +Path to a publish profile (.pubxml file) to import publish properties from. If the same property exists in +publishProperties and the publish profile then publishProperties will win. + +.EXAMPLE + Publish-AspNet -packOutput $packOutput -publishProperties @{ + 'WebPublishMethod'='MSDeploy' + 'MSDeployServiceURL'='contoso.scm.azurewebsites.net:443';` + 'DeployIisAppPath'='contoso';'Username'='$contoso';'Password'="$env:PublishPwd"} + +.EXAMPLE +Publish-AspNet -packOutput $packOutput -publishProperties @{ + 'WebPublishMethod'='FileSystem' + 'publishUrl'="$publishDest" + } + +.EXAMPLE +Publish-AspNet -packOutput $packOutput -publishProperties @{ + 'WebPublishMethod'='MSDeploy' + 'MSDeployServiceURL'='contoso.scm.azurewebsites.net:443';` +'DeployIisAppPath'='contoso';'Username'='$contoso';'Password'="$env:PublishPwd" + 'ExcludeFiles'=@( + @{'absolutepath'='test.txt'}, + @{'absolutepath'='references.js'} +)} + +.EXAMPLE +Publish-AspNet -packOutput $packOutput -publishProperties @{ + 'WebPublishMethod'='FileSystem' + 'publishUrl'="$publishDest" + 'ExcludeFiles'=@( + @{'absolutepath'='test.txt'}, + @{'absolutepath'='_references.js'}) + 'Replacements' = @( + @{'file'='test.txt$';'match'='REPLACEME';'newValue'='updatedValue'}) + } + +Publish-AspNet -packOutput $packOutput -publishProperties @{ + 'WebPublishMethod'='FileSystem' + 'publishUrl'="$publishDest" + 'ExcludeFiles'=@( + @{'absolutepath'='test.txt'}, + @{'absolutepath'='c:\\full\\path\\ok\\as\\well\\_references.js'}) + 'Replacements' = @( + @{'file'='test.txt$';'match'='REPLACEME';'newValue'='updatedValue'}) + } + +.EXAMPLE +Publish-AspNet -packOutput $packOutput -publishProperties @{ + 'WebPublishMethod'='FileSystem' + 'publishUrl'="$publishDest" + 'EnableMSDeployAppOffline'='true' + 'AppOfflineTemplate'='offline-template.html' + 'MSDeployUseChecksum'='true' +} +#> +function Publish-AspNet{ + param( + [Parameter(Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] + [hashtable]$publishProperties = @{}, + + [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] + [System.IO.FileInfo]$packOutput, + + [Parameter(Position=2,ValueFromPipelineByPropertyName=$true)] + [System.IO.FileInfo]$pubProfilePath + ) + process{ + if($publishProperties['WebPublishMethodOverride']){ + 'Overriding publish method from $publishProperties[''WebPublishMethodOverride''] to [{0}]' -f ($publishProperties['WebPublishMethodOverride']) | Write-Verbose + $publishProperties['WebPublishMethod'] = $publishProperties['WebPublishMethodOverride'] + } + + if(-not [string]::IsNullOrWhiteSpace($pubProfilePath)){ + $profileProperties = Get-PropertiesFromPublishProfile -filepath $pubProfilePath + foreach($key in $profileProperties.Keys){ + if(-not ($publishProperties.ContainsKey($key))){ + 'Adding properties from publish profile [''{0}''=''{1}'']' -f $key,$profileProperties[$key] | Write-Verbose + $publishProperties.Add($key,$profileProperties[$key]) + } + } + } + + if(!([System.IO.Path]::IsPathRooted($packOutput))){ + $packOutput = [System.IO.Path]::GetFullPath((Join-Path $pwd $packOutput)) + } + + $pubMethod = $publishProperties['WebPublishMethod'] + 'Publishing with publish method [{0}]' -f $pubMethod | Write-Output + + # get the handler based on WebPublishMethod, and call it. + &(Get-AspnetPublishHandler -name $pubMethod) $publishProperties $packOutput + } +} + +<# +.SYNOPSIS + +Inputs: + +Example of $xmlDocument: '' +Example of $providerDataArray: + + [System.Collections.ArrayList]$providerDataArray = @() + + $iisAppSourceKeyValue=@{"iisApp" = @{"path"='c:\temp\pathtofiles';"appOfflineTemplate" ='offline-template.html'}} + $providerDataArray.Add($iisAppSourceKeyValue) + + $dbfullsqlKeyValue=@{"dbfullsql" = @{"path"="c:\Temp\PathToSqlFile"}} + $providerDataArray.Add($dbfullsqlKeyValue) + + $dbfullsqlKeyValue=@{"dbfullsql" = @{"path"="c:\Temp\PathToSqlFile2"}} + $providerDataArray.Add($dbfullsqlKeyValue) + + Manifest File content: + + + + + + +#> +function AddInternal-ProviderDataToManifest { + [cmdletbinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [XML]$xmlDocument, + [Parameter(Position=1)] + [System.Collections.ArrayList]$providerDataArray + ) + process { + $siteNode = $xmlDocument.SelectSingleNode("/sitemanifest") + if ($siteNode -eq $null) { + throw 'sitemanifest element is missing in the xml object' + } + foreach ($providerData in $providerDataArray) { + foreach ($providerName in $providerData.Keys) { + $providerValue = $providerData[$providerName] + $xmlNode = $xmlDocument.CreateElement($providerName) + foreach ($providerValueKey in $providerValue.Keys) { + $xmlNode.SetAttribute($providerValueKey, $providerValue[$providerValueKey]) | Out-Null + } + $siteNode.AppendChild($xmlNode) | Out-Null + } + } + } +} + +function AddInternal-ProjectGuidToWebConfig { + [cmdletbinding()] + param( + [Parameter(Position=0)] + [HashTable]$publishProperties, + [Parameter(Position=1)] + [System.IO.FileInfo]$packOutput + ) + process { + try { + [Reflection.Assembly]::LoadWithPartialName("System.Xml.Linq") | Out-Null + $webConfigPath = Join-Path $packOutput 'web.config' + $projectGuidCommentValue = 'ProjectGuid: {0}' -f $publishProperties['ProjectGuid'] + $xDoc = [System.Xml.Linq.XDocument]::Load($webConfigPath) + $allNodes = $xDoc.DescendantNodes() + $projectGuidComment = $allNodes | Where-Object { $_.NodeType -eq [System.Xml.XmlNodeType]::Comment -and $_.Value -eq $projectGuidCommentValue } | Select -First 1 + if($projectGuidComment -ne $null) { + if($publishProperties['IgnoreProjectGuid'] -eq $true) { + $projectGuidComment.Remove() | Out-Null + $xDoc.Save($webConfigPath) | Out-Null + } + } + else { + if(-not ($publishProperties['IgnoreProjectGuid'] -eq $true)) { + $projectGuidComment = New-Object -TypeName System.Xml.Linq.XComment -ArgumentList $projectGuidCommentValue + $xDoc.LastNode.AddAfterSelf($projectGuidComment) | Out-Null + $xDoc.Save($webConfigPath) | Out-Null + } + } + } + catch { + } + } +} + +<# +.SYNOPSIS + +Example of $EFMigrations: + $EFMigrations = @{'CarContext'='Car Context ConnectionString';'MovieContext'='Movie Context Connection String'} + +#> + +function GenerateInternal-EFMigrationScripts { + [cmdletbinding()] + param( + [Parameter(Mandatory=$true,Position=0)] + [System.IO.FileInfo]$projectPath, + [Parameter(Mandatory=$true,Position=1)] + [System.IO.FileInfo]$packOutput, + [Parameter(Position=2)] + [HashTable]$EFMigrations + ) + process { + $files = @{} + $dotnetExePath = GetInternal-DotNetExePath + foreach ($dbContextName in $EFMigrations.Keys) { + try + { + $tempDir = GetInternal-PublishTempPath -packOutput $packOutput + $efScriptFile = Join-Path $tempDir ('{0}.sql' -f $dbContextName) + $arg = ('ef migrations script --idempotent --output {0} --context {1}' -f + $efScriptFile, + $dbContextName) + + Execute-Command $dotnetExePath $arg $projectPath | Out-Null + if (Test-Path -Path $efScriptFile) { + if (!($files.ContainsKey($dbContextName))) { + $files.Add($dbContextName, $efScriptFile) | Out-Null + } + } + } + catch + { + throw 'error occured when executing dotnet.exe to generate EF T-SQL file' + } + } + # return files object + $files + } +} + +<# +.SYNOPSIS + +Example of $connectionStrings: + $connectionStrings = @{'DefaultConnection'='Default ConnectionString';'CarConnection'='Car Connection String'} + +#> +function GenerateInternal-AppSettingsFile { + [cmdletbinding()] + param( + [Parameter(Mandatory = $true,Position=0)] + [System.IO.FileInfo]$packOutput, + [Parameter(Mandatory = $true,Position=1)] + [string]$environmentName, + [Parameter(Position=2)] + [HashTable]$connectionStrings + ) + process { + $configProdJsonFile = 'appsettings.{0}.json' -f $environmentName + $configProdJsonFilePath = Join-Path -Path $packOutput -ChildPath $configProdJsonFile + + if ([string]::IsNullOrEmpty($configProdJsonFilePath)) { + throw ('The path of {0} is empty' -f $configProdJsonFilePath) + } + + if(!(Test-Path -Path $configProdJsonFilePath)) { + # create new file + '{}' | out-file -encoding utf8 -filePath $configProdJsonFilePath -Force + } + + $jsonObj = ConvertFrom-Json -InputObject (Get-Content -Path $configProdJsonFilePath -Raw) + # update when there exists one or more connection strings + if ($connectionStrings -ne $null) { + foreach ($name in $connectionStrings.Keys) { + #check for hierarchy style + if ($jsonObj.ConnectionStrings.$name) { + $jsonObj.ConnectionStrings.$name = $connectionStrings[$name] + continue + } + #check for horizontal style + $horizontalName = 'ConnectionStrings.{0}:' -f $name + if ($jsonObj.$horizontalName) { + $jsonObj.$horizontalName = $connectionStrings[$name] + continue + } + # create new one + if (!($jsonObj.ConnectionStrings)) { + $contentForDefaultConnection = '{}' + $jsonObj | Add-Member -name 'ConnectionStrings' -value (ConvertFrom-Json -InputObject $contentForDefaultConnection) -MemberType NoteProperty | Out-Null + } + if (!($jsonObj.ConnectionStrings.$name)) { + $jsonObj.ConnectionStrings | Add-Member -name $name -value $connectionStrings[$name] -MemberType NoteProperty | Out-Null + } + } + } + + $jsonObj | ConvertTo-Json | out-file -encoding utf8 -filePath $configProdJsonFilePath -Force + + #return the path of config.[environment].json + $configProdJsonFilePath + } +} + +<# +.SYNOPSIS + +Inputs: +Example of $providerDataArray: + + [System.Collections.ArrayList]$providerDataArray = @() + + $iisAppSourceKeyValue=@{"iisApp" = @{"path"='c:\temp\pathtofiles';"appOfflineTemplate" ='offline-template.html'}} + $providerDataArray.Add($iisAppSourceKeyValue) + + $dbfullsqlKeyValue=@{"dbfullsql" = @{"path"="c:\Temp\PathToSqlFile"}} + $providerDataArray.Add($dbfullsqlKeyValue) + + $dbfullsqlKeyValue=@{"dbfullsql" = @{"path"="c:\Temp\PathToSqlFile2"}} + $providerDataArray.Add($dbfullsqlKeyValue) + + Manifest File content: + + + + + + + +#> + +function GenerateInternal-ManifestFile { + [cmdletbinding()] + param( + [Parameter(Mandatory=$true,Position=0)] + [System.IO.FileInfo]$packOutput, + [Parameter(Mandatory=$true,Position=1)] + $publishProperties, + [Parameter(Mandatory=$true,Position=2)] + [System.Collections.ArrayList]$providerDataArray, + [Parameter(Mandatory=$true,Position=3)] + [ValidateNotNull()] + $manifestFileName + ) + process{ + $xmlDocument = [xml]'' + AddInternal-ProviderDataToManifest -xmlDocument $xmlDocument -providerDataArray $providerDataArray | Out-Null + $publishTempDir = GetInternal-PublishTempPath -packOutput $packOutput + $XMLFile = Join-Path $publishTempDir $manifestFileName + $xmlDocument.OuterXml | out-file -encoding utf8 -filePath $XMLFile -Force + + # return + [System.IO.FileInfo]$XMLFile + } +} + +function GetInternal-PublishTempPath { + [cmdletbinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [System.IO.FileInfo]$packOutput + ) + process { + $tempDir = [io.path]::GetTempPath() + $packOutputFolderName = Split-Path $packOutput -Leaf + $publishTempDir = [io.path]::combine($tempDir,'PublishTemp','obj',$packOutputFolderName) + if (!(Test-Path -Path $publishTempDir)) { + New-Item -Path $publishTempDir -type directory | Out-Null + } + # return + [System.IO.FileInfo]$publishTempDir + } +} + +function Publish-AspNetMSDeploy{ + param( + [Parameter(Mandatory = $true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] + $publishProperties, + [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] + $packOutput + ) + process{ + if($publishProperties){ + $publishPwd = $publishProperties['Password'] + + $sharedArgs = GetInternal-SharedMSDeployParametersFrom -publishProperties $publishProperties -packOutput $packOutput + $iisAppPath = $publishProperties['DeployIisAppPath'] + + # create source manifest + + # e.g + # + # + # + # + # + # + + [System.Collections.ArrayList]$providerDataArray = @() + $iisAppValues = @{"path"=$packOutput}; + $iisAppSourceKeyValue=@{"iisApp" = $iisAppValues} + $providerDataArray.Add($iisAppSourceKeyValue) | Out-Null + + if ($sharedArgs.EFMigrationData -ne $null -and $sharedArgs.EFMigrationData.Contains('EFSqlFiles')) { + foreach ($sqlFile in $sharedArgs.EFMigrationData['EFSqlFiles'].Values) { + $dbFullSqlSourceKeyValue=@{"dbFullSql" = @{"path"=$sqlFile}} + $providerDataArray.Add($dbFullSqlSourceKeyValue) | Out-Null + } + } + + [System.IO.FileInfo]$sourceXMLFile = GenerateInternal-ManifestFile -packOutput $packOutput -publishProperties $publishProperties -providerDataArray $providerDataArray -manifestFileName 'SourceManifest.xml' + + $providerDataArray.Clear() | Out-Null + # create destination manifest + + # e.g + # + # + # + # + # + + $iisAppValues = @{"path"=$iisAppPath}; + if(-not [string]::IsNullOrWhiteSpace($publishProperties['AppOfflineTemplate'])){ + $iisAppValues.Add("appOfflineTemplate", $publishProperties['AppOfflineTemplate']) | Out-Null + } + + $iisAppDestinationKeyValue=@{"iisApp" = $iisAppValues} + $providerDataArray.Add($iisAppDestinationKeyValue) | Out-Null + + if ($publishProperties['EfMigrations'] -ne $null -and $publishProperties['EfMigrations'].Count -gt 0) { + foreach ($connectionString in $publishProperties['EfMigrations'].Values) { + $dbFullSqlDestinationKeyValue=@{"dbFullSql" = @{"path"=$connectionString}} + $providerDataArray.Add($dbFullSqlDestinationKeyValue) | Out-Null + } + } + + + [System.IO.FileInfo]$destXMLFile = GenerateInternal-ManifestFile -packOutput $packOutput -publishProperties $publishProperties -providerDataArray $providerDataArray -manifestFileName 'DestinationManifest.xml' + + <# + "C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" + -source:manifest='C:\Users\testuser\AppData\Local\Temp\PublishTemp\obj\SourceManifest.xml' + -dest:manifest='C:\Users\testuser\AppData\Local\Temp\PublishTemp\obj\DestManifest.xml',ComputerName='https://contoso.scm.azurewebsites.net/msdeploy.axd',UserName='$contoso',Password='',IncludeAcls='False',AuthType='Basic' + -verb:sync + -enableRule:DoNotDeleteRule + -retryAttempts=2" + #> + + if(-not [string]::IsNullOrWhiteSpace($publishProperties['MSDeployPublishMethod'])){ + $serviceMethod = $publishProperties['MSDeployPublishMethod'] + } + + $msdeployComputerName= InternalNormalize-MSDeployUrl -serviceUrl $publishProperties['MSDeployServiceURL'] -siteName $iisAppPath -serviceMethod $publishProperties['MSDeployPublishMethod'] + if($publishProperties['UseMSDeployServiceURLAsIs'] -eq $true){ + $msdeployComputerName = $publishProperties['MSDeployServiceURL'] + } + + $publishArgs = @() + #use manifest to publish + $publishArgs += ('-source:manifest=''{0}''' -f $sourceXMLFile.FullName) + $publishArgs += ('-dest:manifest=''{0}'',ComputerName=''{1}'',UserName=''{2}'',Password=''{3}'',IncludeAcls=''False'',AuthType=''{4}''{5}' -f + $destXMLFile.FullName, + $msdeployComputerName, + $publishProperties['UserName'], + $publishPwd, + $publishProperties['AuthType'], + $sharedArgs.DestFragment) + $publishArgs += '-verb:sync' + $publishArgs += $sharedArgs.ExtraArgs + + $command = '"{0}" {1}' -f (Get-MSDeploy),($publishArgs -join ' ') + + if (! [String]::IsNullOrEmpty($publishPwd)) { + $command.Replace($publishPwd,'{PASSWORD-REMOVED-FROM-LOG}') | Print-CommandString + } + Execute-Command -exePath (Get-MSDeploy) -arguments ($publishArgs -join ' ') + } + else{ + throw 'publishProperties is empty, cannot publish' + } + } +} + +function Escape-TextForRegularExpressions{ + [cmdletbinding()] + param( + [Parameter(Position=0,Mandatory=$true)] + [string]$text + ) + process{ + [regex]::Escape($text) + } +} + +function Publish-AspNetMSDeployPackage{ + param( + [Parameter(Mandatory = $true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] + $publishProperties, + [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] + $packOutput + ) + process{ + if($publishProperties){ + $packageDestinationFilepath = $publishProperties['DesktopBuildPackageLocation'] + + if(!$packageDestinationFilepath){ + throw ('The package destination property (DesktopBuildPackageLocation) was not found in the publish properties') + } + + if(!([System.IO.Path]::IsPathRooted($packageDestinationFilepath))){ + $packageDestinationFilepath = [System.IO.Path]::GetFullPath((Join-Path $pwd $packageDestinationFilepath)) + } + + # if the dir doesn't exist create it + $pkgDir = ((new-object -typename System.IO.FileInfo($packageDestinationFilepath)).Directory) + if(!(Test-Path -Path $pkgDir)) { + New-Item $pkgDir -type Directory | Out-Null + } + + <# + "C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" + -source:manifest='C:\Users\testuser\AppData\Local\Temp\PublishTemp\obj\SourceManifest.xml' + -dest:package=c:\temp\path\contosoweb.zip + -verb:sync + -enableRule:DoNotDeleteRule + -retryAttempts=2 + #> + + $sharedArgs = GetInternal-SharedMSDeployParametersFrom -publishProperties $publishProperties -packOutput $packOutput + + # create source manifest + + # e.g + # + # + # + # + + [System.Collections.ArrayList]$providerDataArray = @() + $iisAppSourceKeyValue=@{"iisApp" = @{"path"=$packOutput}} + $providerDataArray.Add($iisAppSourceKeyValue) | Out-Null + + [System.IO.FileInfo]$sourceXMLFile = GenerateInternal-ManifestFile -packOutput $packOutput -publishProperties $publishProperties -providerDataArray $providerDataArray -manifestFileName 'SourceManifest.xml' + + $publishArgs = @() + $publishArgs += ('-source:manifest=''{0}''' -f $sourceXMLFile.FullName) + $publishArgs += ('-dest:package=''{0}''' -f $packageDestinationFilepath) + $publishArgs += '-verb:sync' + $packageContentFolder = $publishProperties['MSDeployPackageContentFoldername'] + if(!$packageContentFolder){ $packageContentFolder = 'website' } + $publishArgs += ('-replace:match=''{0}'',replace=''{1}''' -f (Escape-TextForRegularExpressions $packOutput), $packageContentFolder ) + $publishArgs += $sharedArgs.ExtraArgs + + $command = '"{0}" {1}' -f (Get-MSDeploy),($publishArgs -join ' ') + $command | Print-CommandString + Execute-Command -exePath (Get-MSDeploy) -arguments ($publishArgs -join ' ') + } + else{ + throw 'publishProperties is empty, cannot publish' + } + } +} + +function Publish-AspNetFileSystem{ + param( + [Parameter(Mandatory = $true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] + $publishProperties, + [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] + $packOutput + ) + process{ + $pubOut = $publishProperties['publishUrl'] + + if([string]::IsNullOrWhiteSpace($pubOut)){ + throw ('publishUrl is a required property for FileSystem publish but it was empty.') + } + + # if it's a relative path then update it to a full path + if(!([System.IO.Path]::IsPathRooted($pubOut))){ + $pubOut = [System.IO.Path]::GetFullPath((Join-Path $pwd $pubOut)) + $publishProperties['publishUrl'] = "$pubOut" + } + + 'Publishing files to {0}' -f $pubOut | Write-Output + + # we use msdeploy.exe because it supports incremental publish/skips/replacements/etc + # msdeploy.exe -verb:sync -source:manifest='C:\Users\testuser\AppData\Local\Temp\PublishTemp\obj\SourceManifest.xml' -dest:manifest='C:\Users\testuser\AppData\Local\Temp\PublishTemp\obj\DestManifest.xml' + + $sharedArgs = GetInternal-SharedMSDeployParametersFrom -publishProperties $publishProperties -packOutput $packOutput + + # create source manifest + + # e.g + # + # + # + # + + [System.Collections.ArrayList]$providerDataArray = @() + $contentPathValues = @{"path"=$packOutput}; + $contentPathSourceKeyValue=@{"contentPath" = $contentPathValues} + $providerDataArray.Add($contentPathSourceKeyValue) | Out-Null + + [System.IO.FileInfo]$sourceXMLFile = GenerateInternal-ManifestFile -packOutput $packOutput -publishProperties $publishProperties -providerDataArray $providerDataArray -manifestFileName 'SourceManifest.xml' + + $providerDataArray.Clear() | Out-Null + # create destination manifest + + # e.g + # + # + # + $contentPathValues = @{"path"=$publishProperties['publishUrl']}; + if(-not [string]::IsNullOrWhiteSpace($publishProperties['AppOfflineTemplate'])){ + $contentPathValues.Add("appOfflineTemplate", $publishProperties['AppOfflineTemplate']) | Out-Null + } + $contentPathDestinationKeyValue=@{"contentPath" = $contentPathValues} + $providerDataArray.Add($contentPathDestinationKeyValue) | Out-Null + + [System.IO.FileInfo]$destXMLFile = GenerateInternal-ManifestFile -packOutput $packOutput -publishProperties $publishProperties -providerDataArray $providerDataArray -manifestFileName 'DestinationManifest.xml' + + $publishArgs = @() + $publishArgs += ('-source:manifest=''{0}''' -f $sourceXMLFile.FullName) + $publishArgs += ('-dest:manifest=''{0}''{1}' -f $destXMLFile.FullName, $sharedArgs.DestFragment) + $publishArgs += '-verb:sync' + $publishArgs += $sharedArgs.ExtraArgs + + $command = '"{0}" {1}' -f (Get-MSDeploy),($publishArgs -join ' ') + $command | Print-CommandString + Execute-Command -exePath (Get-MSDeploy) -arguments ($publishArgs -join ' ') + + # copy sql script to script folder + if (($sharedArgs.EFMigrationData['EFSqlFiles'] -ne $null) -and ($sharedArgs.EFMigrationData['EFSqlFiles'].Count -gt 0)) { + $scriptsDir = Join-Path $pubOut 'efscripts' + + if (!(Test-Path -Path $scriptsDir)) { + New-Item -Path $scriptsDir -type directory | Out-Null + } + + foreach ($sqlFile in $sharedArgs.EFMigrationData['EFSqlFiles'].Values) { + Copy-Item $sqlFile -Destination $scriptsDir -Force -Recurse | Out-Null + } + } + } +} + +<# +.SYNOPSIS + This can be used to read a publish profile to extract the property values into a hashtable. + +.PARAMETER filepath + Path to the publish profile to get the properties from. Currenlty this only supports reading + .pubxml files. + +.EXAMPLE + Get-PropertiesFromPublishProfile -filepath c:\projects\publish\devpublish.pubxml +#> +function Get-PropertiesFromPublishProfile{ + [cmdletbinding()] + param( + [Parameter(Position=0,Mandatory=$true)] + [ValidateNotNull()] + [ValidateScript({Test-Path $_})] + [System.IO.FileInfo]$filepath + ) + begin{ + Add-Type -AssemblyName System.Core + Add-Type -AssemblyName Microsoft.Build + } + process{ + 'Reading publish properties from profile [{0}]' -f $filepath | Write-Verbose + # use MSBuild to get the project and read properties + $projectCollection = (New-Object Microsoft.Build.Evaluation.ProjectCollection) + if(!([System.IO.Path]::IsPathRooted($filepath))){ + $filepath = [System.IO.Path]::GetFullPath((Join-Path $pwd $filepath)) + } + $project = ([Microsoft.Build.Construction.ProjectRootElement]::Open([string]$filepath.Fullname, $projectCollection)) + + $properties = @{} + foreach($property in $project.Properties){ + $properties[$property.Name]=$property.Value + } + + $properties + } +} + +function Print-CommandString{ + [cmdletbinding()] + param( + [Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)] + $command + ) + process{ + 'Executing command [{0}]' -f $command | Write-Output + } +} + +function Execute-CommandString{ + [cmdletbinding()] + param( + [Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)] + [string[]]$command, + + [switch] + $useInvokeExpression, + + [switch] + $ignoreErrors + ) + process{ + foreach($cmdToExec in $command){ + 'Executing command [{0}]' -f $cmdToExec | Write-Verbose + if($useInvokeExpression){ + try { + Invoke-Expression -Command $cmdToExec + } + catch { + if(-not $ignoreErrors){ + $msg = ('The command [{0}] exited with exception [{1}]' -f $cmdToExec, $_.ToString()) + throw $msg + } + } + } + else { + cmd.exe /D /C $cmdToExec + + if(-not $ignoreErrors -and ($LASTEXITCODE -ne 0)){ + $msg = ('The command [{0}] exited with code [{1}]' -f $cmdToExec, $LASTEXITCODE) + throw $msg + } + } + } + } +} + +function Execute-Command { + [cmdletbinding()] + param( + [Parameter(Mandatory = $true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] + [String]$exePath, + [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] + [String]$arguments, + [Parameter(Position=2)] + [System.IO.FileInfo]$workingDirectory + ) + process{ + $psi = New-Object -TypeName System.Diagnostics.ProcessStartInfo + $psi.CreateNoWindow = $true + $psi.UseShellExecute = $false + $psi.RedirectStandardOutput = $true + $psi.RedirectStandardError=$true + $psi.FileName = $exePath + $psi.Arguments = $arguments + if($workingDirectory -and (Test-Path -Path $workingDirectory)) { + $psi.WorkingDirectory = $workingDirectory + } + + $process = New-Object -TypeName System.Diagnostics.Process + $process.StartInfo = $psi + $process.EnableRaisingEvents=$true + + # Register the event handler for error + $stdErrEvent = Register-ObjectEvent -InputObject $process -EventName 'ErrorDataReceived' -Action { + if (! [String]::IsNullOrEmpty($EventArgs.Data)) { + $EventArgs.Data | Write-Error + } + } + + # Starting process. + $process.Start() | Out-Null + $process.BeginErrorReadLine() | Out-Null + $output = $process.StandardOutput.ReadToEnd() + $process.WaitForExit() | Out-Null + $output | Write-Output + + # UnRegister the event handler for error + Unregister-Event -SourceIdentifier $stdErrEvent.Name | Out-Null + } +} + + +function GetInternal-DotNetExePath { + process { + $dotnetinstallpath = $env:dotnetinstallpath + if (!$dotnetinstallpath) { + $DotNetRegItem = Get-ItemProperty -Path 'hklm:\software\dotnet\setup\' + if ($env:DOTNET_HOME) { + $dotnetinstallpath = Join-Path $env:DOTNET_HOME -ChildPath 'dotnet.exe' + } + elseif ($DotNetRegItem -and $DotNetRegItem.InstallDir){ + $dotnetinstallpath = Join-Path $DotNetRegItem.InstallDir -ChildPath 'dotnet.exe' + } + } + if (!(Test-Path $dotnetinstallpath)) { + throw 'Unable to find dotnet.exe, please install it and try again' + } + # return + [System.IO.FileInfo]$dotnetinstallpath + } +} + +function Get-MSDeploy{ + [cmdletbinding()] + param() + process{ + $installPath = $env:msdeployinstallpath + + if(!$installPath){ + $keysToCheck = @('hklm:\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\3','hklm:\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\2','hklm:\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1') + + foreach($keyToCheck in $keysToCheck){ + if(Test-Path $keyToCheck){ + $installPath = (Get-itemproperty $keyToCheck -Name InstallPath -ErrorAction SilentlyContinue | select -ExpandProperty InstallPath -ErrorAction SilentlyContinue) + } + + if($installPath){ + break; + } + } + } + + if(!$installPath){ + throw "Unable to find msdeploy.exe, please install it and try again" + } + + [string]$msdInstallLoc = (join-path $installPath 'msdeploy.exe') + + "Found msdeploy.exe at [{0}]" -f $msdInstallLoc | Write-Verbose + + $msdInstallLoc + } +} + +function InternalNormalize-MSDeployUrl{ + [cmdletbinding()] + param( + [Parameter(Position=0,Mandatory=$true)] + [string]$serviceUrl, + + [string] $siteName, + + [ValidateSet('WMSVC','RemoteAgent','InProc')] + [string]$serviceMethod = 'WMSVC' + ) + process{ + $tempUrl = $serviceUrl + $resultUrl = $serviceUrl + + $httpsStr = 'https://' + $httpStr = 'http://' + $msdeployAxd = 'msdeploy.axd' + + if(-not [string]::IsNullOrWhiteSpace($serviceUrl)){ + if([string]::Compare($serviceMethod,'WMSVC',[StringComparison]::OrdinalIgnoreCase) -eq 0){ + # if no http or https then add one + if(-not ($serviceUrl.StartsWith($httpStr,[StringComparison]::OrdinalIgnoreCase) -or + $serviceUrl.StartsWith($httpsStr,[StringComparison]::OrdinalIgnoreCase)) ){ + + $serviceUrl = [string]::Concat($httpsStr,$serviceUrl.TrimStart()) + } + [System.Uri]$serviceUri = New-Object -TypeName 'System.Uri' $serviceUrl + [System.UriBuilder]$serviceUriBuilder = New-Object -TypeName 'System.UriBuilder' $serviceUrl + + # if it's https and the port was not passed in override it to 8172 + if( ([string]::Compare('https',$serviceUriBuilder.Scheme,[StringComparison]::OrdinalIgnoreCase) -eq 0) -and + -not $serviceUrl.Contains((':{0}' -f $serviceUriBuilder.Port)) ) { + $serviceUriBuilder.Port = 8172 + } + + # if no path then add one + if([string]::Compare('/',$serviceUriBuilder.Path,[StringComparison]::OrdinalIgnoreCase) -eq 0){ + $serviceUriBuilder.Path = $msdeployAxd + } + + if ([string]::IsNullOrEmpty($serviceUriBuilder.Query) -and -not([string]::IsNullOrEmpty($siteName))) + { + $serviceUriBuilder.Query = "site=" + $siteName; + } + + $resultUrl = $serviceUriBuilder.Uri.AbsoluteUri + } + elseif([string]::Compare($serviceMethod,'RemoteAgent',[StringComparison]::OrdinalIgnoreCase) -eq 0){ + [System.UriBuilder]$serviceUriBuilder = New-Object -TypeName 'System.UriBuilder' $serviceUrl + # http://{computername}/MSDEPLOYAGENTSERVICE + # remote agent must use http + $serviceUriBuilder.Scheme = 'http' + $serviceUriBuilder.Path = '/MSDEPLOYAGENTSERVICE' + + $resultUrl = $serviceUriBuilder.Uri.AbsoluteUri + } + else{ + # see if it's for localhost + [System.Uri]$serviceUri = New-Object -TypeName 'System.Uri' $serviceUrl + $resultUrl = $serviceUri.AbsoluteUri + } + } + + # return the result to the caller + $resultUrl + } +} + +function InternalRegister-AspNetKnownPublishHandlers{ + [cmdletbinding()] + param() + process{ + 'Registering MSDeploy handler' | Write-Verbose + Register-AspnetPublishHandler -name 'MSDeploy' -force -handler { + [cmdletbinding()] + param( + [Parameter(Mandatory = $true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] + $publishProperties, + [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] + $packOutput + ) + + Publish-AspNetMSDeploy -publishProperties $publishProperties -packOutput $packOutput + } + + 'Registering MSDeploy package handler' | Write-Verbose + Register-AspnetPublishHandler -name 'Package' -force -handler { + [cmdletbinding()] + param( + [Parameter(Mandatory = $true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] + $publishProperties, + [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] + $packOutput + ) + + Publish-AspNetMSDeployPackage -publishProperties $publishProperties -packOutput $packOutput + } + + 'Registering FileSystem handler' | Write-Verbose + Register-AspnetPublishHandler -name 'FileSystem' -force -handler { + [cmdletbinding()] + param( + [Parameter(Mandatory = $true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] + $publishProperties, + [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] + $packOutput + ) + + Publish-AspNetFileSystem -publishProperties $publishProperties -packOutput $packOutput + } + } +} + +<# +.SYNOPSIS + Used for testing purposes only. +#> +function InternalReset-AspNetPublishHandlers{ + [cmdletbinding()] + param() + process{ + $script:AspNetPublishHandlers = @{} + InternalRegister-AspNetKnownPublishHandlers + } +} + +Export-ModuleMember -function Get-*,Publish-*,Register-*,Enable-* +if($env:IsDeveloperMachine){ + # you can set the env var to expose all functions to importer. easy for development. + # this is required for executing pester test cases, it's set by build.ps1 + Export-ModuleMember -function * +} + +# register the handlers so that Publish-AspNet can be called +InternalRegister-AspNetKnownPublishHandlers + diff --git a/src/LanBackup.WebApp/Properties/PublishProfiles/wd_package-publish.ps1 b/src/LanBackup.WebApp/Properties/PublishProfiles/wd_package-publish.ps1 new file mode 100644 index 0000000..c4b80bf --- /dev/null +++ b/src/LanBackup.WebApp/Properties/PublishProfiles/wd_package-publish.ps1 @@ -0,0 +1,19 @@ +[cmdletbinding(SupportsShouldProcess=$true)] +param($publishProperties=@{}, $packOutput, $pubProfilePath) + +# to learn more about this file visit https://go.microsoft.com/fwlink/?LinkId=524327 + +try{ + if ($publishProperties['ProjectGuid'] -eq $null){ + $publishProperties['ProjectGuid'] = '315453e2-9c17-46f3-9ccc-2fc0688342c2' + } + + $publishModulePath = Join-Path (Split-Path $MyInvocation.MyCommand.Path) 'publish-module.psm1' + Import-Module $publishModulePath -DisableNameChecking -Force + + # call Publish-AspNet to perform the publish operation + Publish-AspNet -publishProperties $publishProperties -packOutput $packOutput -pubProfilePath $pubProfilePath +} +catch{ + "An error occurred during publish.`n{0}" -f $_.Exception.Message | Write-Error +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/Service References/Application Insights/ConnectedService.json b/src/LanBackup.WebApp/Service References/Application Insights/ConnectedService.json new file mode 100644 index 0000000..59f38a0 --- /dev/null +++ b/src/LanBackup.WebApp/Service References/Application Insights/ConnectedService.json @@ -0,0 +1,7 @@ +{ + "ProviderId": "Microsoft.ApplicationInsights.ConnectedService.ConnectedServiceProvider", + "Version": "7.17.119.9", + "GettingStartedDocument": { + "Uri": "https://go.microsoft.com/fwlink/?LinkID=798432" + } +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/Services/IEmailSender.cs b/src/LanBackup.WebApp/Services/IEmailSender.cs new file mode 100644 index 0000000..8fd4d31 --- /dev/null +++ b/src/LanBackup.WebApp/Services/IEmailSender.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace LanBackup.WebApp.Services +{ + public interface IEmailSender + { + Task SendEmailAsync(string email, string subject, string message); + } +} diff --git a/src/LanBackup.WebApp/Services/ISmsSender.cs b/src/LanBackup.WebApp/Services/ISmsSender.cs new file mode 100644 index 0000000..03fa0bb --- /dev/null +++ b/src/LanBackup.WebApp/Services/ISmsSender.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace LanBackup.WebApp.Services +{ + public interface ISmsSender + { + Task SendSmsAsync(string number, string message); + } +} diff --git a/src/LanBackup.WebApp/Services/MessageServices.cs b/src/LanBackup.WebApp/Services/MessageServices.cs new file mode 100644 index 0000000..10ae0f6 --- /dev/null +++ b/src/LanBackup.WebApp/Services/MessageServices.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace LanBackup.WebApp.Services +{ + // This class is used by the application to send Email and SMS + // when you turn on two-factor authentication in ASP.NET Identity. + // For more details see this link http://go.microsoft.com/fwlink/?LinkID=532713 + public class AuthMessageSender : IEmailSender, ISmsSender + { + public Task SendEmailAsync(string email, string subject, string message) + { + // Plug in your email service here to send an email. + return Task.FromResult(0); + } + + public Task SendSmsAsync(string number, string message) + { + // Plug in your SMS service here to send a text message. + return Task.FromResult(0); + } + } +} diff --git a/src/LanBackup.WebApp/Startup.cs b/src/LanBackup.WebApp/Startup.cs new file mode 100644 index 0000000..f820c0c --- /dev/null +++ b/src/LanBackup.WebApp/Startup.cs @@ -0,0 +1,286 @@ +using System; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.SpaServices.Webpack; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using LanBackup.WebApp.Data; +using Microsoft.EntityFrameworkCore; +using LanBackup.DataCore; +using LanBackup.WebApp.Models; +using Microsoft.AspNetCore.Identity.EntityFrameworkCore; +using LanBackup.WebApp.Services; +using Microsoft.AspNetCore.Identity; +using Swashbuckle.Swagger.Model; +using Microsoft.Extensions.PlatformAbstractions; +using System.IO; +using Microsoft.AspNetCore.SignalR; +using LanBackup.WebApp.Hubs; +using LanBackup.WebApp.Middleware; +using System.Linq; +using AutoMapper; +using LanBackup.ModelsCore; +using LanBackup.WebApp.Models.DTO; +using LanBackup.WebApp.Controllers; +using Microsoft.AspNetCore.Http; +using LanBackup.WebApp.Models.Telemetry; + +namespace LanBackup.WebApp +{ + public class Startup + { + + public const string AuthenticationSchemeName = "MyAuthScheme"; + + public Startup(IHostingEnvironment env) + { + var builder = new ConfigurationBuilder() + .SetBasePath(env.ContentRootPath) + .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) + .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) + .AddEnvironmentVariables(); + + if (env.IsDevelopment()) + { + // For more details on using the user secret store see http://go.microsoft.com/fwlink/?LinkID=532709 + builder.AddUserSecrets(); + builder.AddApplicationInsightsSettings(developerMode: true); + } + + builder.AddEnvironmentVariables(); + Configuration = builder.Build(); + + } + + public IConfigurationRoot Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + + //AppInsighttelemetry + services.AddApplicationInsightsTelemetry(Configuration); + + //conf telemetry logger + services.AddSingleton(); + + //client config + ClientConfiguration.Instance = new ClientConfiguration(this.Configuration); + services.AddSingleton(ClientConfiguration.Instance); + + //db contexts + services.AddEntityFramework(Configuration.GetConnectionString("DefaultConnection")); + services.AddEntityFramework(Configuration.GetConnectionString("BackupsConnectionString")); + + //custom user key storage + services.AddSingleton(); + + services.AddIdentity(op => + { + op.User.RequireUniqueEmail = true; + }) + .AddEntityFrameworkStores() + .AddDefaultTokenProviders(); + + // Add framework services. + services.AddMvc(); + //Add Automapper + services.AddAutoMapper(typeof(Startup)); + + + services.AddScoped(); + services.AddSingleton(); + services.AddSignalR(options => + { + options.Hubs.EnableJavaScriptProxies = true; + options.Hubs.EnableDetailedErrors = true; + options.EnableJSONP = true; + }); + + // Add application services. + services.AddTransient(); + services.AddTransient(); + + // Inject an implementation of ISwaggerProvider with defaulted settings applied + services.AddSwaggerGen(); + services.ConfigureSwaggerGen(options => + { + options.SingleApiVersion(new Info + { + Version = "v1", + Title = "LanBackups API", + Description = "ASP.NET Core Web API for LAN Backup service", + TermsOfService = "None", + Contact = new Contact { Name = "HouseOfSoftware Ltd", Email = "", Url = "http://www.asp.net" }, + License = new License { Name = "Free", Url = "http://url.com" } + }); + //Determine base path for the application. + var basePath = PlatformServices.Default.Application.ApplicationBasePath; + //Set the comments path for the swagger json and ui. + var xmlPath = Path.Combine(basePath, "LanBackup.WebApp.xml"); + options.IncludeXmlComments(xmlPath); + }); + + //Add the CORS services + services.AddCors(); + + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + { + + //configure loggers + loggerFactory.AddConsole(Configuration.GetSection("Logging")); + loggerFactory.AddDebug(); + loggerFactory.AddFile(Configuration["FileLogging:Path"]); + + // Add Application Insights monitoring to the request pipeline as a very first middleware. + app.UseApplicationInsightsRequestTelemetry(); + + //conf CORS + app.UseCors(builder => builder.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod()); + //// Shows UseCors with CorsPolicyBuilder. + //app.UseCors(builder => + // builder.WithOrigins("http://example.com")); + + + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + + app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions + { + HotModuleReplacement = true + }); + } + else + { + app.UseExceptionHandler("/Home/Error"); + } + // Add Application Insights exceptions handling to the request pipeline. - after error page and any other error handling middleware: + app.UseApplicationInsightsExceptionTelemetry(); + + + app.UseStaticFiles(); + + + app.UseIdentity(); + //app.UseCookieAuthentication(new CookieAuthenticationOptions() + //{ + // AuthenticationScheme = Startup.AuthenticationSchemeName, + // AutomaticAuthenticate = true + // //AutomaticChallenge = true, + // //SlidingExpiration = true, + // //ExpireTimeSpan = TimeSpan.FromMilliseconds(5000) + //}); + //app.ApplyUserKeyValidation();//custom keys authentication + + + + + app.UseWebSockets(); + app.UseSignalR("/signalr"); + + + app.UseMvcWithDefaultRoute(); + // Enable middleware to serve generated Swagger as a JSON endpoint + app.UseSwagger(); + // Enable middleware to serve swagger-ui assets (HTML, JS, CSS etc.) + app.UseSwaggerUi(); + + + app.UseMvc(routes => + { + routes.MapRoute( + name: "default", + template: "{controller=Home}/{action=Index}/{id?}"); + + routes.MapSpaFallbackRoute( + name: "spa-fallback", + defaults: new { controller = "Home", action = "Index" }); + }); + + + + + + RolesData.SeedDbWithData(app.ApplicationServices).Wait(); + + } + + } + + + + + public static class RolesData + { + private static readonly string[] Roles = new string[] { + "Admin", + //"Editor", + //"Subscriber" + }; + private static readonly string[] Users = new string[] { + "admin@admin", + "user0@user0", + }; + private static readonly string[] Passwords = new string[] { + "Admin$0", + "User$0", + }; + private static readonly string[] AdminUsers = new string[] { + "admin@admin", + }; + + public static async Task SeedDbWithData(IServiceProvider serviceProvider) + { + using (var serviceScope = serviceProvider.GetRequiredService().CreateScope()) + { + var dbApp = serviceScope.ServiceProvider.GetService(); + await dbApp.Database.EnsureCreatedAsync(); + + var dbIdentity = serviceScope.ServiceProvider.GetService(); + + if (await dbIdentity.Database.EnsureCreatedAsync()) + { + using (var roleManager = serviceProvider.GetRequiredService>()) + { + foreach (var role in Roles) + { + if (!await roleManager.RoleExistsAsync(role)) + { + await roleManager.CreateAsync(new IdentityRole(role)); + } + } + } + + using (var uManager = serviceProvider.GetRequiredService>()) + { + for (int i = 0; i < Users.Length; i++) + { + var userEmail = Users[i]; + var user = new ApplicationUser { UserName = userEmail, Email = userEmail }; + var resUserCreate = await uManager.CreateAsync(user, Passwords[i]); + if (resUserCreate.Succeeded) + { + if (AdminUsers.ToList().Contains(userEmail)) + { + await uManager.AddToRolesAsync(user, Roles); + } + } + else + { + throw new ArgumentException(resUserCreate.Errors.Select(s=> s.Description).ToArray().Aggregate((current, next) => current + ", " + next)); + } + } + } + } + } + } + } + +} diff --git a/src/LanBackup.WebApp/Views/Home/Index.cshtml b/src/LanBackup.WebApp/Views/Home/Index.cshtml new file mode 100644 index 0000000..ad88818 --- /dev/null +++ b/src/LanBackup.WebApp/Views/Home/Index.cshtml @@ -0,0 +1,12 @@ +@{ + ViewData["Title"] = "Home Page"; +} + +@*disabled server side prerendering due some components need browser on initialization*@ +@*Loading...*@ + + + +@section scripts { + +} diff --git a/src/LanBackup.WebApp/Views/Shared/Error.cshtml b/src/LanBackup.WebApp/Views/Shared/Error.cshtml new file mode 100644 index 0000000..473b35d --- /dev/null +++ b/src/LanBackup.WebApp/Views/Shared/Error.cshtml @@ -0,0 +1,6 @@ +@{ + ViewData["Title"] = "Error"; +} + +

Error.

+

An error occurred while processing your request.

diff --git a/src/LanBackup.WebApp/Views/Shared/_Layout.cshtml b/src/LanBackup.WebApp/Views/Shared/_Layout.cshtml new file mode 100644 index 0000000..019148b --- /dev/null +++ b/src/LanBackup.WebApp/Views/Shared/_Layout.cshtml @@ -0,0 +1,59 @@ + + + + + + + @ViewData["Title"] - LAN Backup + + + + + + + + + + + + + @RenderBody() + + + + @RenderSection("scripts", required: false) + + @*needed for signalR to work*@ + + + @*signalR JS proxy - we dont use it*@ + @**@ + + + @*fix issue with navbar not collapsing after menu clicked/selected*@ + + + + + diff --git a/src/LanBackup.WebApp/Views/_ViewImports.cshtml b/src/LanBackup.WebApp/Views/_ViewImports.cshtml new file mode 100644 index 0000000..0bc4733 --- /dev/null +++ b/src/LanBackup.WebApp/Views/_ViewImports.cshtml @@ -0,0 +1,6 @@ +@using LanBackup.WebApp +@using LanBackup.WebApp.Models +@inject Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration TelemetryConfiguration +@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers" +@addTagHelper "*, Microsoft.AspNetCore.SpaServices" +@addTagHelper "*, Microsoft.ApplicationInsights" diff --git a/src/LanBackup.WebApp/Views/_ViewStart.cshtml b/src/LanBackup.WebApp/Views/_ViewStart.cshtml new file mode 100644 index 0000000..820a2f6 --- /dev/null +++ b/src/LanBackup.WebApp/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "_Layout"; +} diff --git a/src/LanBackup.WebApp/appsettings.json b/src/LanBackup.WebApp/appsettings.json new file mode 100644 index 0000000..7da27ba --- /dev/null +++ b/src/LanBackup.WebApp/appsettings.json @@ -0,0 +1,25 @@ +{ + "clientSettings": { + "AdminEmail": "admin@admin", + "InstrumentationEnabled": false, + "InstrumentationKey": "YOUR_OWN_KEY" + }, + "ConnectionStrings": { + "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-LanBackup.WebApp-d5f6c3b5-64d7-4d41-8000-1e69f75536f7;Trusted_Connection=True;MultipleActiveResultSets=true", + "BackupsConnectionString": "Server=(localdb)\\mssqllocaldb;Database=BackupsLAN;Trusted_Connection=True;" + }, + "FileLogging": { + "Path": "logs/lanbackup_{Date}.log" + }, + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + }, + "ApplicationInsights": { + "InstrumentationKey": "YOUR_OWN_KEY" + } +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/global.json b/src/LanBackup.WebApp/global.json new file mode 100644 index 0000000..5a3dc98 --- /dev/null +++ b/src/LanBackup.WebApp/global.json @@ -0,0 +1,3 @@ +{ + "sdk": { "version": "1.0.0-preview2-1-003177" } +} diff --git a/src/LanBackup.WebApp/package.json b/src/LanBackup.WebApp/package.json new file mode 100644 index 0000000..4723d83 --- /dev/null +++ b/src/LanBackup.WebApp/package.json @@ -0,0 +1,71 @@ +{ + "name": "LanBackupWebApp", + "version": "0.0.0", + "scripts": { + "test": "karma start ClientApp/test/karma.conf.js" + }, + "dependencies": { + "@angular/common": "2.0.2", + "@angular/compiler": "2.0.2", + "@angular/core": "2.0.2", + "@angular/forms": "2.0.2", + "@angular/http": "2.0.2", + "@angular/platform-browser": "2.0.2", + "@angular/platform-browser-dynamic": "2.0.2", + "@angular/platform-server": "2.0.2", + "@angular/router": "3.0.2", + "@types/node": "^6.0.42", + "angular-cron-jobs": "^3.2.0", + "angular2-platform-node": "~2.0.11", + "angular2-template-loader": "^0.6.0", + "angular2-universal": "~2.0.11", + "angular2-universal-polyfills": "~2.0.11", + "aspnet-prerendering": "^2.0.0", + "aspnet-webpack": "^1.0.26", + "bootstrap": "^3.3.7", + "css": "^2.2.1", + "css-loader": "^0.26.1", + "es6-shim": "^0.35.1", + "event-source-polyfill": "^0.0.7", + "expose-loader": "^0.7.1", + "extract-text-webpack-plugin": "^1.0.1", + "file-loader": "^0.9.0", + "font-awesome": "^4.7.0", + "html-loader": "^0.4.4", + "isomorphic-fetch": "^2.2.1", + "jquery": "^2.2.1", + "json-loader": "^0.5.4", + "jw-bootstrap-switch-ng2": "0.0.7", + "ng2-appinsights": "^0.3.0", + "ng2-toasty": "^2.2.2", + "node-noop": "^1.0.0", + "preboot": "^4.5.2", + "raw-loader": "^0.5.1", + "rxjs": "5.0.0-beta.12", + "style-loader": "^0.13.1", + "to-string-loader": "^1.1.5", + "ts-loader": "^0.8.2", + "typescript": "^2.0.3", + "url-loader": "^0.5.7", + "webpack": "^1.14.0", + "webpack-hot-middleware": "^2.15.0", + "webpack-merge": "^2.4.0", + "zone.js": "^0.6.25" + }, + "devDependencies": { + "@types/chai": "^3.4.34", + "@types/jasmine": "^2.5.37", + "chai": "^3.5.0", + "jasmine-core": "^2.5.2", + "karma": "^1.3.0", + "karma-chai": "^0.1.0", + "karma-chrome-launcher": "^2.0.0", + "karma-cli": "^1.0.1", + "karma-jasmine": "^1.0.2", + "karma-webpack": "^1.8.0", + "tslint": "^3.15.1", + "typescript": "^2.0.0", + "typings": "^1.3.2", + "webpack-dev-server": "^1.16.2" + } +} diff --git a/src/LanBackup.WebApp/project.json b/src/LanBackup.WebApp/project.json new file mode 100644 index 0000000..11a5d32 --- /dev/null +++ b/src/LanBackup.WebApp/project.json @@ -0,0 +1,99 @@ +{ + + "userSecretsId": "aspnet-LanBackup.WebApp-d5f6c3b5-64d7-4d41-8000-1e69f75536f7", + + "dependencies": { + "Microsoft.NETCore.App": { + "version": "1.1.0", + "type": "platform" + }, + "Microsoft.AspNetCore.Diagnostics": "1.1.0", + "Microsoft.AspNetCore.Mvc": "1.1.0", + "Microsoft.AspNetCore.SignalR.Server": "0.2.0-*", + "Microsoft.AspNetCore.WebSockets": "0.2.0-*", + "Microsoft.AspNetCore.Razor.Tools": { + "version": "1.0.0-preview2-final", + "type": "build" + }, + "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0", + "Microsoft.AspNetCore.Server.Kestrel": "1.1.0", + "Microsoft.AspNetCore.SpaServices": "1.1.0-*", + "Microsoft.AspNetCore.StaticFiles": "1.1.0", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0", + "Microsoft.Extensions.Configuration.Json": "1.1.0", + "Microsoft.Extensions.Configuration.CommandLine": "1.1.0", + "Microsoft.Extensions.Logging": "1.1.0", + "Microsoft.Extensions.Logging.Console": "1.1.0", + "Microsoft.Extensions.Logging.Debug": "1.1.0", + "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0", + "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0", + "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview4-final", + "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0", + "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0", + "Swashbuckle": "6.0.0-beta902", + "Serilog.Extensions.Logging.File": "1.0.0", + "LanBackup.ModelsCore": "1.0.0-*", + "LanBackup.DataCore": "1.0.0-*", + "AutoMapper": "5.2.0", + "AutoMapper.Extensions.Microsoft.DependencyInjection": "1.2.0", + "Microsoft.ApplicationInsights.AspNetCore": "2.0.0", + "Microsoft.ApplicationInsights.JavaScript": "1.0.7-build00691" + }, + + "tools": { + "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final", + "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final", + "Microsoft.DotNet.Watcher.Tools": "1.0.0-preview2-final" + }, + + "frameworks": { + "netcoreapp1.1": { + "imports": [ + "dotnet5.6", + "portable-net45+win8" + ] + } + }, + + "buildOptions": { + "emitEntryPoint": true, + "preserveCompilationContext": true, + "compile": { + "exclude": [ "node_modules" ] + }, + "xmlDoc": true + }, + + "runtimeOptions": { + "configProperties": { + "System.GC.Server": true + } + }, + + "publishOptions": { + "include": [ + "appsettings.json", + "ClientApp/dist", + "Views", + "web.config", + "wwwroot" + ], + "exclude": [ + "wwwroot/dist/*.map" + ] + }, + + "scripts": { + "prepublish": [ + "npm install", + "node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js --env.prod", + "node node_modules/webpack/bin/webpack.js --env.prod" + ], + "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ], + "start": "dotnet run environment=development" + }, + + "tooling": { + "defaultNamespace": "LanBackup.WebApp" + } +} diff --git a/src/LanBackup.WebApp/stats.json b/src/LanBackup.WebApp/stats.json new file mode 100644 index 0000000..e69de29 diff --git a/src/LanBackup.WebApp/tsconfig.json b/src/LanBackup.WebApp/tsconfig.json new file mode 100644 index 0000000..94b22fc --- /dev/null +++ b/src/LanBackup.WebApp/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "moduleResolution": "node", + "target": "es5", + "sourceMap": true, + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "skipDefaultLibCheck": true, + "lib": [ "es6", "dom" ], + "types": [ "node" ] + }, + "exclude": [ "bin", "node_modules" ], + "atom": { "rewriteTsconfig": false } +} diff --git a/src/LanBackup.WebApp/typings.json b/src/LanBackup.WebApp/typings.json new file mode 100644 index 0000000..a2a5df7 --- /dev/null +++ b/src/LanBackup.WebApp/typings.json @@ -0,0 +1,5 @@ +{ + "globalDependencies": { + "jquery": "registry:dt/jquery#1.10.0+20170104155652" + } +} diff --git a/src/LanBackup.WebApp/typings/globals/jquery/index.d.ts b/src/LanBackup.WebApp/typings/globals/jquery/index.d.ts new file mode 100644 index 0000000..234d3d5 --- /dev/null +++ b/src/LanBackup.WebApp/typings/globals/jquery/index.d.ts @@ -0,0 +1,3747 @@ +// Generated by typings +// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/e8761854cdadd8a71a91c228ad69bb0a20b7956e/jquery/index.d.ts +interface JQueryAjaxSettings { + /** + * The content type sent in the request header that tells the server what kind of response it will accept in return. If the accepts setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. + */ + accepts?: any; + /** + * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success(). + */ + async?: boolean; + /** + * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request. + */ + beforeSend? (jqXHR: JQueryXHR, settings: JQueryAjaxSettings): any; + /** + * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET. + */ + cache?: boolean; + /** + * A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. + */ + complete? (jqXHR: JQueryXHR, textStatus: string): any; + /** + * An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. (version added: 1.5) + */ + contents?: { [key: string]: any; }; + //According to jQuery.ajax source code, ajax's option actually allows contentType to set to "false" + // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/742 + /** + * When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. + */ + contentType?: any; + /** + * This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). + */ + context?: any; + /** + * An object containing dataType-to-dataType converters. Each converter's value is a function that returns the transformed value of the response. (version added: 1.5) + */ + converters?: { [key: string]: any; }; + /** + * If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain. (version added: 1.5) + */ + crossDomain?: boolean; + /** + * Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be key-value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below). + */ + data?: any; + /** + * A function to be used to handle the raw response data of XMLHttpRequest.This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter. + */ + dataFilter? (data: any, ty: any): any; + /** + * The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). + */ + dataType?: string; + /** + * A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event. + */ + error? (jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any; + /** + * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events. + */ + global?: boolean; + /** + * An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, but its default XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from within the beforeSend function. (version added: 1.5) + */ + headers?: { [key: string]: any; }; + /** + * Allow the request to be successful only if the response has changed since the last request. This is done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data. + */ + ifModified?: boolean; + /** + * Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. (version added: 1.5.1) + */ + isLocal?: boolean; + /** + * Override the callback function name in a jsonp request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" } + */ + jsonp?: any; + /** + * Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function. + */ + jsonpCallback?: any; + /** + * The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). (version added: 1.9.0) + */ + method?: string; + /** + * A MIME type to override the XHR MIME type. (version added: 1.5.1) + */ + mimeType?: string; + /** + * A password to be used with XMLHttpRequest in response to an HTTP access authentication request. + */ + password?: string; + /** + * By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, set this option to false. + */ + processData?: boolean; + /** + * Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script. + */ + scriptCharset?: string; + /** + * An object of numeric HTTP codes and functions to be called when the response has the corresponding code. f the request is successful, the status code functions take the same parameters as the success callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback. (version added: 1.5) + */ + statusCode?: { [key: string]: any; }; + /** + * A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. + */ + success? (data: any, textStatus: string, jqXHR: JQueryXHR): any; + /** + * Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period. + */ + timeout?: number; + /** + * Set this to true if you wish to use the traditional style of parameter serialization. + */ + traditional?: boolean; + /** + * The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers. + */ + type?: string; + /** + * A string containing the URL to which the request is sent. + */ + url?: string; + /** + * A username to be used with XMLHttpRequest in response to an HTTP access authentication request. + */ + username?: string; + /** + * Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or enhancements to the factory. + */ + xhr?: any; + /** + * An object of fieldName-fieldValue pairs to set on the native XHR object. For example, you can use it to set withCredentials to true for cross-domain requests if needed. In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ should you require the use of it. (version added: 1.5.1) + */ + xhrFields?: { [key: string]: any; }; +} + +/** + * Interface for the jqXHR object + * @see {@link https://api.jquery.com/jQuery.ajax/#jqXHR} + */ +interface JQueryXHR extends XMLHttpRequest, JQueryPromise { + /** + * The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header. As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5). + */ + overrideMimeType(mimeType: string): any; + /** + * Cancel the request. + * + * @param statusText A string passed as the textStatus parameter for the done callback. Default value: "canceled" + */ + abort(statusText?: string): void; + /** + * Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details. + */ + then(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => R|JQueryPromise, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise; + /** + * Property containing the parsed response if the response content type is json + */ + responseJSON?: any; + /** + * A function to be called if the request fails. + */ + error(xhr: JQueryXHR, textStatus: string, errorThrown: string): void; +} + +/** + * Interface for the JQuery callback + * @see {@link https://api.jquery.com/category/callbacks-object/} + */ +interface JQueryCallback { + /** + * Add a callback or a collection of callbacks to a callback list. + * + * @param callbacks A function, or array of functions, that are to be added to the callback list. + * @see {@link https://api.jquery.com/callbacks.add/} + */ + add(callbacks: Function): JQueryCallback; + /** + * Add a callback or a collection of callbacks to a callback list. + * + * @param callbacks A function, or array of functions, that are to be added to the callback list. + * @see {@link https://api.jquery.com/callbacks.add/} + */ + add(callbacks: Function[]): JQueryCallback; + + /** + * Disable a callback list from doing anything more. + * @see {@link https://api.jquery.com/callbacks.disable/} + */ + disable(): JQueryCallback; + + /** + * Determine if the callbacks list has been disabled. + * @see {@link https://api.jquery.com/callbacks.disabled/} + */ + disabled(): boolean; + + /** + * Remove all of the callbacks from a list. + * @see {@link https://api.jquery.com/callbacks.empty/} + */ + empty(): JQueryCallback; + + /** + * Call all of the callbacks with the given arguments + * + * @param arguments The argument or list of arguments to pass back to the callback list. + * @see {@link https://api.jquery.com/callbacks.fire/} + */ + fire(...arguments: any[]): JQueryCallback; + + /** + * Determine if the callbacks have already been called at least once. + * @see {@link https://api.jquery.com/callbacks.fired/} + */ + fired(): boolean; + + /** + * Call all callbacks in a list with the given context and arguments. + * + * @param context A reference to the context in which the callbacks in the list should be fired. + * @param arguments An argument, or array of arguments, to pass to the callbacks in the list. + * @see {@link https://api.jquery.com/callbacks.fireWith/} + */ + fireWith(context?: any, args?: any[]): JQueryCallback; + + /** + * Determine whether a supplied callback is in a list + * + * @param callback The callback to search for. + * @see {@link https://api.jquery.com/callbacks.has/} + */ + has(callback: Function): boolean; + + /** + * Lock a callback list in its current state. + * @see {@link https://api.jquery.com/callbacks.lock/} + */ + lock(): JQueryCallback; + + /** + * Determine if the callbacks list has been locked. + * @see {@link https://api.jquery.com/callbacks.locked/} + */ + locked(): boolean; + + /** + * Remove a callback or a collection of callbacks from a callback list. + * + * @param callbacks A function, or array of functions, that are to be removed from the callback list. + * @see {@link https://api.jquery.com/callbacks.remove/} + */ + remove(callbacks: Function): JQueryCallback; + /** + * Remove a callback or a collection of callbacks from a callback list. + * + * @param callbacks A function, or array of functions, that are to be removed from the callback list. + * @see {@link https://api.jquery.com/callbacks.remove/} + */ + remove(callbacks: Function[]): JQueryCallback; +} + +/** + * Allows jQuery Promises to interop with non-jQuery promises + */ +interface JQueryGenericPromise { + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @see {@link https://api.jquery.com/deferred.then/#deferred-then-doneFilter-failFilter-progressFilter} + */ + then(doneFilter: (value?: T, ...values: any[]) => U|JQueryPromise, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; + + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @see {@link https://api.jquery.com/deferred.then/#deferred-then-doneFilter-failFilter-progressFilter} + */ + then(doneFilter: (value?: T, ...values: any[]) => void, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; +} + +/** + * Interface for the JQuery promise/deferred callbacks + */ +interface JQueryPromiseCallback { + (value?: T, ...args: any[]): void; +} + +interface JQueryPromiseOperator { + (callback1: JQueryPromiseCallback|JQueryPromiseCallback[], ...callbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; +} + +/** + * Interface for the JQuery promise, part of callbacks + * @see {@link https://api.jquery.com/category/deferred-object/} + */ +interface JQueryPromise extends JQueryGenericPromise { + /** + * Determine the current state of a Deferred object. + * @see {@link https://api.jquery.com/deferred.state/} + */ + state(): string; + /** + * Add handlers to be called when the Deferred object is either resolved or rejected. + * + * @param alwaysCallback1 A function, or array of functions, that is called when the Deferred is resolved or rejected. + * @param alwaysCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. + * @see {@link https://api.jquery.com/deferred.always/} + */ + always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; + /** + * Add handlers to be called when the Deferred object is resolved. + * + * @param doneCallback1 A function, or array of functions, that are called when the Deferred is resolved. + * @param doneCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. + * @see {@link https://api.jquery.com/deferred.done/} + */ + done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; + /** + * Add handlers to be called when the Deferred object is rejected. + * + * @param failCallback1 A function, or array of functions, that are called when the Deferred is rejected. + * @param failCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. + * @see {@link https://api.jquery.com/deferred.fail/} + */ + fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; + /** + * Add handlers to be called when the Deferred object generates progress notifications. + * + * @param progressCallback1 A function, or array of functions, to be called when the Deferred generates progress notifications. + * @param progressCallbackN Optional additional functions, or arrays of functions, to be called when the Deferred generates progress notifications. + * @see {@link https://api.jquery.com/deferred.progress/} + */ + progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; + + // Deprecated - given no typings + pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; + + /** + * Return a Deferred's Promise object. + * + * @param target Object onto which the promise methods have to be attached + * @see {@link https://api.jquery.com/deferred.promise/} + */ + promise(target?: any): JQueryPromise; +} + +/** + * Interface for the JQuery deferred, part of callbacks + * @see {@link https://api.jquery.com/category/deferred-object/} + */ +interface JQueryDeferred extends JQueryGenericPromise { + /** + * Determine the current state of a Deferred object. + * @see {@link https://api.jquery.com/deferred.state/} + */ + state(): string; + /** + * Add handlers to be called when the Deferred object is either resolved or rejected. + * + * @param alwaysCallback1 A function, or array of functions, that is called when the Deferred is resolved or rejected. + * @param alwaysCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. + * @see {@link https://api.jquery.com/deferred.always/} + */ + always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + /** + * Add handlers to be called when the Deferred object is resolved. + * + * @param doneCallback1 A function, or array of functions, that are called when the Deferred is resolved. + * @param doneCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. + * @see {@link https://api.jquery.com/deferred.done/} + */ + done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + /** + * Add handlers to be called when the Deferred object is rejected. + * + * @param failCallback1 A function, or array of functions, that are called when the Deferred is rejected. + * @param failCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. + * @see {@link https://api.jquery.com/deferred.fail/} + */ + fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + /** + * Add handlers to be called when the Deferred object generates progress notifications. + * + * @param progressCallback1 A function, or array of functions, to be called when the Deferred generates progress notifications. + * @param progressCallbackN Optional additional functions, or arrays of functions, to be called when the Deferred generates progress notifications. + * @see {@link https://api.jquery.com/deferred.progress/} + */ + progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + + /** + * Call the progressCallbacks on a Deferred object with the given args. + * + * @param args Optional arguments that are passed to the progressCallbacks. + * @see {@link https://api.jquery.com/deferred.notify/} + */ + notify(value?: any, ...args: any[]): JQueryDeferred; + + /** + * Call the progressCallbacks on a Deferred object with the given context and args. + * + * @param context Context passed to the progressCallbacks as the this object. + * @param args Optional arguments that are passed to the progressCallbacks. + * @see {@link https://api.jquery.com/deferred.notifyWith/} + */ + notifyWith(context: any, args?: any[]): JQueryDeferred; + + /** + * Reject a Deferred object and call any failCallbacks with the given args. + * + * @param args Optional arguments that are passed to the failCallbacks. + * @see {@link https://api.jquery.com/deferred.reject/} + */ + reject(value?: any, ...args: any[]): JQueryDeferred; + /** + * Reject a Deferred object and call any failCallbacks with the given context and args. + * + * @param context Context passed to the failCallbacks as the this object. + * @param args An optional array of arguments that are passed to the failCallbacks. + * @see {@link https://api.jquery.com/deferred.rejectWith/} + */ + rejectWith(context: any, args?: any[]): JQueryDeferred; + + /** + * Resolve a Deferred object and call any doneCallbacks with the given args. + * + * @param value First argument passed to doneCallbacks. + * @param args Optional subsequent arguments that are passed to the doneCallbacks. + * @see {@link https://api.jquery.com/deferred.resolve/} + */ + resolve(value?: T, ...args: any[]): JQueryDeferred; + + /** + * Resolve a Deferred object and call any doneCallbacks with the given context and args. + * + * @param context Context passed to the doneCallbacks as the this object. + * @param args An optional array of arguments that are passed to the doneCallbacks. + * @see {@link https://api.jquery.com/deferred.resolveWith/} + */ + resolveWith(context: any, args?: T[]): JQueryDeferred; + + /** + * Return a Deferred's Promise object. + * + * @param target Object onto which the promise methods have to be attached + * @see {@link https://api.jquery.com/deferred.promise/} + */ + promise(target?: any): JQueryPromise; + + // Deprecated - given no typings + pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; +} + +/** + * Interface of the JQuery extension of the W3C event object + * @see {@link https://api.jquery.com/category/events/event-object/} + */ +interface BaseJQueryEventObject extends Event { + /** + * The current DOM element within the event bubbling phase. + * @see {@link https://api.jquery.com/event.currentTarget/} + */ + currentTarget: Element; + /** + * An optional object of data passed to an event method when the current executing handler is bound. + * @see {@link https://api.jquery.com/event.data/} + */ + data: any; + /** + * The element where the currently-called jQuery event handler was attached. + * @see {@link https://api.jquery.com/event.delegateTarget/} + */ + delegateTarget: Element; + /** + * Returns whether event.preventDefault() was ever called on this event object. + * @see {@link https://api.jquery.com/event.isDefaultPrevented/} + */ + isDefaultPrevented(): boolean; + /** + * Returns whether event.stopImmediatePropagation() was ever called on this event object. + * @see {@link https://api.jquery.com/event.isImmediatePropagationStopped/} + */ + isImmediatePropagationStopped(): boolean; + /** + * Returns whether event.stopPropagation() was ever called on this event object. + * @see {@link https://api.jquery.com/event.isPropagationStopped/} + */ + isPropagationStopped(): boolean; + /** + * The namespace specified when the event was triggered. + * @see {@link https://api.jquery.com/event.namespace/} + */ + namespace: string; + /** + * The browser's original Event object. + * @see {@link https://api.jquery.com/category/events/event-object/} + */ + originalEvent: Event; + /** + * If this method is called, the default action of the event will not be triggered. + * @see {@link https://api.jquery.com/event.preventDefault/} + */ + preventDefault(): any; + /** + * The other DOM element involved in the event, if any. + * @see {@link https://api.jquery.com/event.relatedTarget/} + */ + relatedTarget: Element; + /** + * The last value returned by an event handler that was triggered by this event, unless the value was undefined. + * @see {@link https://api.jquery.com/event.result/} + */ + result: any; + /** + * Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree. + * @see {@link https://api.jquery.com/event.stopImmediatePropagation/} + */ + stopImmediatePropagation(): void; + /** + * Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event. + * @see {@link https://api.jquery.com/event.stopPropagation/} + */ + stopPropagation(): void; + /** + * The DOM element that initiated the event. + * @see {@link https://api.jquery.com/event.target/} + */ + target: Element; + /** + * The mouse position relative to the left edge of the document. + * @see {@link https://api.jquery.com/event.pageX/} + */ + pageX: number; + /** + * The mouse position relative to the top edge of the document. + * @see {@link https://api.jquery.com/event.pageY/} + */ + pageY: number; + /** + * For key or mouse events, this property indicates the specific key or button that was pressed. + * @see {@link https://api.jquery.com/event.which/} + */ + which: number; + /** + * Indicates whether the META key was pressed when the event fired. + * @see {@link https://api.jquery.com/event.metaKey/} + */ + metaKey: boolean; +} + +interface JQueryInputEventObject extends BaseJQueryEventObject { + altKey: boolean; + ctrlKey: boolean; + metaKey: boolean; + shiftKey: boolean; +} + +interface JQueryMouseEventObject extends JQueryInputEventObject { + button: number; + clientX: number; + clientY: number; + offsetX: number; + offsetY: number; + pageX: number; + pageY: number; + screenX: number; + screenY: number; +} + +interface JQueryKeyEventObject extends JQueryInputEventObject { + char: any; + charCode: number; + key: any; + keyCode: number; +} + +interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{ +} + +/** + * A collection of properties that represent the presence of different browser features or bugs. + * + * Intended for jQuery's internal use; specific properties may be removed when they are no longer needed internally + * to improve page startup performance. For your own project's feature-detection needs, we strongly recommend the + * use of an external library such as {@link http://modernizr.com/|Modernizr} instead of dependency on properties + * in jQuery.support. + * + * @deprecated since version 1.9 + */ +interface JQuerySupport { + ajax?: boolean; + boxModel?: boolean; + changeBubbles?: boolean; + checkClone?: boolean; + checkOn?: boolean; + cors?: boolean; + cssFloat?: boolean; + hrefNormalized?: boolean; + htmlSerialize?: boolean; + leadingWhitespace?: boolean; + noCloneChecked?: boolean; + noCloneEvent?: boolean; + opacity?: boolean; + optDisabled?: boolean; + optSelected?: boolean; + scriptEval? (): boolean; + style?: boolean; + submitBubbles?: boolean; + tbody?: boolean; +} + +interface JQueryParam { + /** + * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + * + * @param obj An array or object to serialize. + */ + (obj: any): string; + + /** + * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + * + * @param obj An array or object to serialize. + * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. + */ + (obj: any, traditional: boolean): string; +} + +/** + * The interface used to construct jQuery events (with $.Event). It is + * defined separately instead of inline in JQueryStatic to allow + * overriding the construction function with specific strings + * returning specific event objects. + */ +interface JQueryEventConstructor { + (name: string, eventProperties?: any): JQueryEventObject; + new (name: string, eventProperties?: any): JQueryEventObject; +} + +/** + * The interface used to specify coordinates. + */ +interface JQueryCoordinates { + left: number; + top: number; +} + +/** + * Elements in the array returned by serializeArray() + */ +interface JQuerySerializeArrayElement { + name: string; + value: string; +} + +/** + * @see {@link https://api.jquery.com/animate/} + */ +interface JQueryAnimationOptions { + /** + * A string or number determining how long the animation will run. + */ + duration?: any; + /** + * A string indicating which easing function to use for the transition. + */ + easing?: string; + /** + * A function to call once the animation is complete. + */ + complete?: Function; + /** + * A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set. + */ + step?: (now: number, tween: any) => any; + /** + * A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. (version added: 1.8) + */ + progress?: (animation: JQueryPromise, progress: number, remainingMs: number) => any; + /** + * A function to call when the animation begins. (version added: 1.8) + */ + start?: (animation: JQueryPromise) => any; + /** + * A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8) + */ + done?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; + /** + * A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8) + */ + fail?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; + /** + * A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected). (version added: 1.8) + */ + always?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; + /** + * A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it. + */ + queue?: any; + /** + * A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4) + */ + specialEasing?: Object; +} + +interface JQueryEasingFunction { + ( percent: number ): number; +} + +interface JQueryEasingFunctions { + [ name: string ]: JQueryEasingFunction; + linear: JQueryEasingFunction; + swing: JQueryEasingFunction; +} + +/** + * Static members of jQuery (those on $ and jQuery themselves) + * + * @see {@link https://api.jquery.com/Types/#jQuery} + */ +interface JQueryStatic { + + /** + * Perform an asynchronous HTTP (Ajax) request. + * + * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). + * @see {@link https://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings} + */ + ajax(settings: JQueryAjaxSettings): JQueryXHR; + /** + * Perform an asynchronous HTTP (Ajax) request. + * + * @param url A string containing the URL to which the request is sent. + * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). + * @see {@link https://api.jquery.com/jQuery.ajax/#jQuery-ajax-url-settings} + */ + ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR; + + /** + * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). + * + * @param dataTypes An optional string containing one or more space-separated dataTypes + * @param handler A handler to set default values for future Ajax requests. + * @see {@link https://api.jquery.com/jQuery.ajaxPrefilter/} + */ + ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; + /** + * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). + * + * @param handler A handler to set default values for future Ajax requests. + * @see {@link https://api.jquery.com/jQuery.ajaxPrefilter/} + */ + ajaxPrefilter(handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; + + ajaxSettings: JQueryAjaxSettings; + + /** + * Set default values for future Ajax requests. Its use is not recommended. + * + * @param options A set of key/value pairs that configure the default Ajax request. All options are optional. + * @see {@link https://api.jquery.com/jQuery.ajaxSetup/} + */ + ajaxSetup(options: JQueryAjaxSettings): void; + + /** + * Load data from the server using a HTTP GET request. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). + * @see {@link https://api.jquery.com/jQuery.get/#jQuery-get-url-data-success-dataType} + */ + get(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + /** + * Load data from the server using a HTTP GET request. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). + * @see {@link https://api.jquery.com/jQuery.get/#jQuery-get-url-data-success-dataType} + */ + get(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + /** + * Load data from the server using a HTTP GET request. + * + * @param settings The JQueryAjaxSettings to be used for the request + * @see {@link https://api.jquery.com/jQuery.get/#jQuery-get-settings} + */ + get(settings : JQueryAjaxSettings): JQueryXHR; + /** + * Load JSON-encoded data from the server using a GET HTTP request. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. + * @see {@link https://api.jquery.com/jQuery.getJSON/} + */ + getJSON(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; + /** + * Load JSON-encoded data from the server using a GET HTTP request. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. + * @see {@link https://api.jquery.com/jQuery.getJSON/} + */ + getJSON(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; + /** + * Load a JavaScript file from the server using a GET HTTP request, then execute it. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. + * @see {@link https://api.jquery.com/jQuery.getScript/} + */ + getScript(url: string, success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; + + /** + * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + * + * @see {@link https://api.jquery.com/jQuery.param/} + */ + param: JQueryParam; + + /** + * Load data from the server using a HTTP POST request. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + * @see {@link https://api.jquery.com/jQuery.post/#jQuery-post-url-data-success-dataType} + */ + post(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + /** + * Load data from the server using a HTTP POST request. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + * @see {@link https://api.jquery.com/jQuery.post/#jQuery-post-url-data-success-dataType} + */ + post(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + /** + * Load data from the server using a HTTP POST request. + * + * @param settings The JQueryAjaxSettings to be used for the request + * @see {@link https://api.jquery.com/jQuery.post/#jQuery-post-settings} + */ + post(settings : JQueryAjaxSettings): JQueryXHR; + /** + * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. + * + * @param flags An optional list of space-separated flags that change how the callback list behaves. + * @see {@link https://api.jquery.com/jQuery.Callbacks/} + */ + Callbacks(flags?: string): JQueryCallback; + + /** + * Holds or releases the execution of jQuery's ready event. + * + * @param hold Indicates whether the ready hold is being requested or released + * @see {@link https://api.jquery.com/jQuery.holdReady/} + */ + holdReady(hold: boolean): void; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param selector A string containing a selector expression + * @param context A DOM Element, Document, or jQuery to use as context + * @see {@link https://api.jquery.com/jQuery/#jQuery-selector-context} + */ + (selector: string, context?: Element|JQuery): JQuery; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param element A DOM element to wrap in a jQuery object. + * @see {@link https://api.jquery.com/jQuery/#jQuery-element} + */ + (element: Element): JQuery; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param elementArray An array containing a set of DOM elements to wrap in a jQuery object. + * @see {@link https://api.jquery.com/jQuery/#jQuery-elementArray} + */ + (elementArray: Element[]): JQuery; + + /** + * Binds a function to be executed when the DOM has finished loading. + * + * @param callback A function to execute after the DOM is ready. + * @see {@link https://api.jquery.com/jQuery/#jQuery-callback} + */ + (callback: (jQueryAlias?: JQueryStatic) => any): JQuery; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param object A plain object to wrap in a jQuery object. + * @see {@link https://api.jquery.com/jQuery/#jQuery-object} + */ + (object: {}): JQuery; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param object An existing jQuery object to clone. + * @see {@link https://api.jquery.com/jQuery/#jQuery-object} + */ + (object: JQuery): JQuery; + + /** + * Specify a function to execute when the DOM is fully loaded. + * @see {@link https://api.jquery.com/jQuery/#jQuery} + */ + (): JQuery; + + /** + * Creates DOM elements on the fly from the provided string of raw HTML. + * + * @param html A string of HTML to create on the fly. Note that this parses HTML, not XML. + * @param ownerDocument A document in which the new elements will be created. + * @see {@link https://api.jquery.com/jQuery/#jQuery-html-ownerDocument} + */ + (html: string, ownerDocument?: Document): JQuery; + + /** + * Creates DOM elements on the fly from the provided string of raw HTML. + * + * @param html A string defining a single, standalone, HTML element (e.g.
or
). + * @param attributes An object of attributes, events, and methods to call on the newly-created element. + * @see {@link https://api.jquery.com/jQuery/#jQuery-html-attributes} + */ + (html: string, attributes: Object): JQuery; + + /** + * Relinquish jQuery's control of the $ variable. + * + * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). + * @see {@link https://api.jquery.com/jQuery.noConflict/} + */ + noConflict(removeAll?: boolean): JQueryStatic; + + /** + * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. + * + * @param deferreds One or more Deferred objects, or plain JavaScript objects. + * @see {@link https://api.jquery.com/jQuery.when/} + */ + when(...deferreds: Array/* as JQueryDeferred */>): JQueryPromise; + + /** + * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties. + * @see {@link https://api.jquery.com/jQuery.cssHooks/} + */ + cssHooks: { [key: string]: any; }; + + /** + * An object containing all CSS properties that may be used without a unit. The .css() method uses this object to see if it may append px to unitless values. + * @see {@link https://api.jquery.com/jQuery.cssNumber/} + */ + cssNumber: any; + + /** + * Store arbitrary data associated with the specified element. Returns the value that was set. + * + * @param element The DOM element to associate with the data. + * @param key A string naming the piece of data to set. + * @param value The new data value. + * @see {@link https://api.jquery.com/jQuery.data/#jQuery-data-element-key-value} + */ + data(element: Element, key: string, value: T): T; + /** + * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. + * + * @param element The DOM element to associate with the data. + * @param key A string naming the piece of data to set. + * @see {@link https://api.jquery.com/jQuery.data/#jQuery-data-element-key} + */ + data(element: Element, key: string): any; + /** + * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. + * + * @param element The DOM element to associate with the data. + * @see {@link https://api.jquery.com/jQuery.data/#jQuery-data-element} + */ + data(element: Element): any; + + /** + * Execute the next function on the queue for the matched element. + * + * @param element A DOM element from which to remove and execute a queued function. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @see {@link https://api.jquery.com/jQuery.dequeue/} + */ + dequeue(element: Element, queueName?: string): void; + + /** + * Determine whether an element has any jQuery data associated with it. + * + * @param element A DOM element to be checked for data. + * @see {@link https://api.jquery.com/jQuery.hasData/} + */ + hasData(element: Element): boolean; + + /** + * Show the queue of functions to be executed on the matched element. + * + * @param element A DOM element to inspect for an attached queue. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @see {@link https://api.jquery.com/jQuery.queue/#jQuery-queue-element-queueName} + */ + queue(element: Element, queueName?: string): any[]; + /** + * Manipulate the queue of functions to be executed on the matched element. + * + * @param element A DOM element where the array of queued functions is attached. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param newQueue An array of functions to replace the current queue contents. + * @see {@link https://api.jquery.com/jQuery.queue/#jQuery-queue-element-queueName-newQueue} + */ + queue(element: Element, queueName: string, newQueue: Function[]): JQuery; + /** + * Manipulate the queue of functions to be executed on the matched element. + * + * @param element A DOM element on which to add a queued function. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param callback The new function to add to the queue. + * @see {@link https://api.jquery.com/jQuery.queue/#jQuery-queue-element-queueName-callback} + */ + queue(element: Element, queueName: string, callback: Function): JQuery; + + /** + * Remove a previously-stored piece of data. + * + * @param element A DOM element from which to remove data. + * @param name A string naming the piece of data to remove. + * @see {@link https://api.jquery.com/jQuery.removeData/} + */ + removeData(element: Element, name?: string): JQuery; + + /** + * A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function. + * + * @param beforeStart A function that is called just before the constructor returns. + * @see {@link https://api.jquery.com/jQuery.Deferred/} + */ + Deferred(beforeStart?: (deferred: JQueryDeferred) => any): JQueryDeferred; + + /** + * Effects + */ + + easing: JQueryEasingFunctions; + + fx: { + tick: () => void; + /** + * The rate (in milliseconds) at which animations fire. + * @see {@link https://api.jquery.com/jQuery.fx.interval/} + */ + interval: number; + stop: () => void; + speeds: { slow: number; fast: number; }; + /** + * Globally disable all animations. + * @see {@link https://api.jquery.com/jQuery.fx.off/} + */ + off: boolean; + step: any; + }; + + /** + * Takes a function and returns a new one that will always have a particular context. + * + * @param func The function whose context will be changed. + * @param context The object to which the context (this) of the function should be set. + * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. + * @see {@link https://api.jquery.com/jQuery.proxy/#jQuery-proxy-function-context-additionalArguments} + */ + proxy(func: (...args: any[]) => any, context: Object, ...additionalArguments: any[]): any; + /** + * Takes a function and returns a new one that will always have a particular context. + * + * @param context The object to which the context (this) of the function should be set. + * @param name The name of the function whose context will be changed (should be a property of the context object). + * @param additionalArguments Any number of arguments to be passed to the function named in the name argument. + * @see {@link https://api.jquery.com/jQuery.proxy/#jQuery-proxy-context-name-additionalArguments} + */ + proxy(context: Object, name: string, ...additionalArguments: any[]): any; + + Event: JQueryEventConstructor; + + /** + * Takes a string and throws an exception containing it. + * + * @param message The message to send out. + * @see {@link https://api.jquery.com/jQuery.error/} + */ + error(message: any): JQuery; + + expr: any; + fn: any; //TODO: Decide how we want to type this + + isReady: boolean; + + // Properties + support: JQuerySupport; + + /** + * Check to see if a DOM element is a descendant of another DOM element. + * + * @param container The DOM element that may contain the other element. + * @param contained The DOM element that may be contained by (a descendant of) the other element. + * @see {@link https://api.jquery.com/jQuery.contains/} + */ + contains(container: Element, contained: Element): boolean; + + /** + * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. + * + * @param collection The object or array to iterate over. + * @param callback The function that will be executed on every object. + * @see {@link https://api.jquery.com/jQuery.each/#jQuery-each-array-callback} + */ + each( + collection: T[], + callback: (indexInArray: number, valueOfElement: T) => any + ): any; + + /** + * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. + * + * @param collection The object or array to iterate over. + * @param callback The function that will be executed on every object. + * @see {@link https://api.jquery.com/jQuery.each/#jQuery-each-object-callback} + */ + each( + collection: any, + callback: (indexInArray: any, valueOfElement: any) => any + ): any; + + /** + * Merge the contents of two or more objects together into the first object. + * + * @param target An object that will receive the new properties if additional objects are passed in or that will extend the jQuery namespace if it is the sole argument. + * @param object1 An object containing additional properties to merge in. + * @param objectN Additional objects containing properties to merge in. + * @see {@link https://api.jquery.com/jQuery.extend/#jQuery-extend-target-object1-objectN} + */ + extend(target: any, object1?: any, ...objectN: any[]): any; + /** + * Merge the contents of two or more objects together into the first object. + * + * @param deep If true, the merge becomes recursive (aka. deep copy). + * @param target The object to extend. It will receive the new properties. + * @param object1 An object containing additional properties to merge in. + * @param objectN Additional objects containing properties to merge in. + * @see {@link https://api.jquery.com/jQuery.extend/#jQuery-extend-deep-target-object1-objectN} + */ + extend(deep: boolean, target: any, object1?: any, ...objectN: any[]): any; + + /** + * Execute some JavaScript code globally. + * + * @param code The JavaScript code to execute. + * @see {@link https://api.jquery.com/jQuery.globalEval/} + */ + globalEval(code: string): any; + + /** + * Finds the elements of an array which satisfy a filter function. The original array is not affected. + * + * @param array The array to search through. + * @param func The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object. + * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false. + * @see {@link https://api.jquery.com/jQuery.grep/} + */ + grep(array: T[], func: (elementOfArray?: T, indexInArray?: number) => boolean, invert?: boolean): T[]; + + /** + * Search for a specified value within an array and return its index (or -1 if not found). + * + * @param value The value to search for. + * @param array An array through which to search. + * @param fromIndex The index of the array at which to begin the search. The default is 0, which will search the whole array. + * @see {@link https://api.jquery.com/jQuery.inArray/} + */ + inArray(value: T, array: T[], fromIndex?: number): number; + + /** + * Determine whether the argument is an array. + * + * @param obj Object to test whether or not it is an array. + * @see {@link https://api.jquery.com/jQuery.isArray/} + */ + isArray(obj: any): boolean; + /** + * Check to see if an object is empty (contains no enumerable properties). + * + * @param obj The object that will be checked to see if it's empty. + * @see {@link https://api.jquery.com/jQuery.isEmptyObject/} + */ + isEmptyObject(obj: any): boolean; + /** + * Determine if the argument passed is a JavaScript function object. + * + * @param obj Object to test whether or not it is a function. + * @see {@link https://api.jquery.com/jQuery.isFunction/} + */ + isFunction(obj: any): boolean; + /** + * Determines whether its argument is a number. + * + * @param value The value to be tested. + * @see {@link https://api.jquery.com/jQuery.isNumeric/} + */ + isNumeric(value: any): boolean; + /** + * Check to see if an object is a plain object (created using "{}" or "new Object"). + * + * @param obj The object that will be checked to see if it's a plain object. + * @see {@link https://api.jquery.com/jQuery.isPlainObject/} + */ + isPlainObject(obj: any): boolean; + /** + * Determine whether the argument is a window. + * + * @param obj Object to test whether or not it is a window. + * @see {@link https://api.jquery.com/jQuery.isWindow/} + */ + isWindow(obj: any): boolean; + /** + * Check to see if a DOM node is within an XML document (or is an XML document). + * + * @param node The DOM node that will be checked to see if it's in an XML document. + * @see {@link https://api.jquery.com/jQuery.isXMLDoc/} + */ + isXMLDoc(node: Node): boolean; + + /** + * Convert an array-like object into a true JavaScript array. + * + * @param obj Any object to turn into a native Array. + * @see {@link https://api.jquery.com/jQuery.makeArray/} + */ + makeArray(obj: any): any[]; + + /** + * Translate all items in an array or object to new array of items. + * + * @param array The Array to translate. + * @param callback The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object. + * @see {@link https://api.jquery.com/jQuery.map/#jQuery-map-array-callback} + */ + map(array: T[], callback: (elementOfArray?: T, indexInArray?: number) => U): U[]; + /** + * Translate all items in an array or object to new array of items. + * + * @param arrayOrObject The Array or Object to translate. + * @param callback The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object. + * @see {@link https://api.jquery.com/jQuery.map/#jQuery-map-object-callback} + */ + map(arrayOrObject: any, callback: (value?: any, indexOrKey?: any) => any): any; + + /** + * Merge the contents of two arrays together into the first array. + * + * @param first The first array to merge, the elements of second added. + * @param second The second array to merge into the first, unaltered. + * @see {@link https://api.jquery.com/jQuery.merge/} + */ + merge(first: T[], second: T[]): T[]; + + /** + * An empty function. + * @see {@link https://api.jquery.com/jQuery.noop/} + */ + noop(): any; + + /** + * Return a number representing the current time. + * @see {@link https://api.jquery.com/jQuery.now/} + */ + now(): number; + + /** + * Takes a well-formed JSON string and returns the resulting JavaScript object. + * + * @param json The JSON string to parse. + * @see {@link https://api.jquery.com/jQuery.parseJSON/} + */ + parseJSON(json: string): any; + + /** + * Parses a string into an XML document. + * + * @param data a well-formed XML string to be parsed + * @see {@link https://api.jquery.com/jQuery.parseXML/} + */ + parseXML(data: string): XMLDocument; + + /** + * Remove the whitespace from the beginning and end of a string. + * + * @param str Remove the whitespace from the beginning and end of a string. + * @see {@link https://api.jquery.com/jQuery.trim/} + */ + trim(str: string): string; + + /** + * Determine the internal JavaScript [[Class]] of an object. + * + * @param obj Object to get the internal JavaScript [[Class]] of. + * @see {@link https://api.jquery.com/jQuery.type/} + */ + type(obj: any): string; + + /** + * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers. + * + * @param array The Array of DOM elements. + * @see {@link https://api.jquery.com/jQuery.unique/} + */ + unique(array: Element[]): Element[]; + + /** + * Parses a string into an array of DOM nodes. + * + * @param data HTML string to be parsed + * @param context DOM element to serve as the context in which the HTML fragment will be created + * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string + * @see {@link https://api.jquery.com/jQuery.parseHTML/} + */ + parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[]; + + /** + * Parses a string into an array of DOM nodes. + * + * @param data HTML string to be parsed + * @param context DOM element to serve as the context in which the HTML fragment will be created + * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string + * @see {@link https://api.jquery.com/jQuery.parseHTML/} + */ + parseHTML(data: string, context?: Document, keepScripts?: boolean): any[]; +} + +/** + * The jQuery instance members + * + * @see {@link https://api.jquery.com/Types/#jQuery} + */ +interface JQuery { + /** + * Register a handler to be called when Ajax requests complete. This is an AjaxEvent. + * + * @param handler The function to be invoked. + * @see {@link https://api.jquery.com/ajaxComplete/} + */ + ajaxComplete(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: any) => any): JQuery; + /** + * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. + * + * @param handler The function to be invoked. + * @see {@link https://api.jquery.com/ajaxError/} + */ + ajaxError(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxSettings: JQueryAjaxSettings, thrownError: any) => any): JQuery; + /** + * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. + * + * @param handler The function to be invoked. + * @see {@link https://api.jquery.com/ajaxSend/} + */ + ajaxSend(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxOptions: JQueryAjaxSettings) => any): JQuery; + /** + * Register a handler to be called when the first Ajax request begins. This is an Ajax Event. + * + * @param handler The function to be invoked. + * @see {@link https://api.jquery.com/ajaxStart/} + */ + ajaxStart(handler: () => any): JQuery; + /** + * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. + * + * @param handler The function to be invoked. + * @see {@link https://api.jquery.com/ajaxStop/} + */ + ajaxStop(handler: () => any): JQuery; + /** + * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. + * + * @param handler The function to be invoked. + * @see {@link https://api.jquery.com/ajaxSuccess/} + */ + ajaxSuccess(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: JQueryAjaxSettings) => any): JQuery; + + /** + * Load data from the server and place the returned HTML into the matched element. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param complete A callback function that is executed when the request completes. + * @see {@link https://api.jquery.com/load/} + */ + load(url: string, data?: string|Object, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery; + + /** + * Encode a set of form elements as a string for submission. + * @see {@link https://api.jquery.com/serialize/} + */ + serialize(): string; + /** + * Encode a set of form elements as an array of names and values. + * @see {@link https://api.jquery.com/serializeArray/} + */ + serializeArray(): JQuerySerializeArrayElement[]; + + /** + * Adds the specified class(es) to each of the set of matched elements. + * + * @param className One or more space-separated classes to be added to the class attribute of each matched element. + * @see {@link https://api.jquery.com/addClass/#addClass-className} + */ + addClass(className: string): JQuery; + /** + * Adds the specified class(es) to each of the set of matched elements. + * + * @param func A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set. + * @see {@link https://api.jquery.com/addClass/#addClass-function} + */ + addClass(func: (index: number, className: string) => string): JQuery; + + /** + * Add the previous set of elements on the stack to the current set, optionally filtered by a selector. + * @see {@link https://api.jquery.com/addBack/} + */ + addBack(selector?: string): JQuery; + + /** + * Get the value of an attribute for the first element in the set of matched elements. + * + * @param attributeName The name of the attribute to get. + * @see {@link https://api.jquery.com/attr/#attr-attributeName} + */ + attr(attributeName: string): string; + /** + * Set one or more attributes for the set of matched elements. + * + * @param attributeName The name of the attribute to set. + * @param value A value to set for the attribute. If this is `null`, the attribute will be deleted. + * @see {@link https://api.jquery.com/attr/#attr-attributeName-value} + */ + attr(attributeName: string, value: string|number|null): JQuery; + /** + * Set one or more attributes for the set of matched elements. + * + * @param attributeName The name of the attribute to set. + * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments. + * @see {@link https://api.jquery.com/attr/#attr-attributeName-function} + */ + attr(attributeName: string, func: (index: number, attr: string) => string|number): JQuery; + /** + * Set one or more attributes for the set of matched elements. + * + * @param attributes An object of attribute-value pairs to set. + * @see {@link https://api.jquery.com/attr/#attr-attributes} + */ + attr(attributes: Object): JQuery; + + /** + * Determine whether any of the matched elements are assigned the given class. + * + * @param className The class name to search for. + * @see {@link https://api.jquery.com/hasClass/} + */ + hasClass(className: string): boolean; + + /** + * Get the HTML contents of the first element in the set of matched elements. + * @see {@link https://api.jquery.com/html/#html} + */ + html(): string; + /** + * Set the HTML contents of each element in the set of matched elements. + * + * @param htmlString A string of HTML to set as the content of each matched element. + * @see {@link https://api.jquery.com/html/#html-htmlString} + */ + html(htmlString: string): JQuery; + /** + * Set the HTML contents of each element in the set of matched elements. + * + * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. + * @see {@link https://api.jquery.com/html/#html-function} + */ + html(func: (index: number, oldhtml: string) => string): JQuery; + + /** + * Get the value of a property for the first element in the set of matched elements. + * + * @param propertyName The name of the property to get. + * @see {@link https://api.jquery.com/prop/#prop-propertyName} + */ + prop(propertyName: string): any; + /** + * Set one or more properties for the set of matched elements. + * + * @param propertyName The name of the property to set. + * @param value A value to set for the property. + * @see {@link https://api.jquery.com/prop/#prop-propertyName-value} + */ + prop(propertyName: string, value: string|number|boolean): JQuery; + /** + * Set one or more properties for the set of matched elements. + * + * @param properties An object of property-value pairs to set. + * @see {@link https://api.jquery.com/prop/#prop-properties} + */ + prop(properties: Object): JQuery; + /** + * Set one or more properties for the set of matched elements. + * + * @param propertyName The name of the property to set. + * @param func A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element. + * @see {@link https://api.jquery.com/prop/#prop-propertyName-function} + */ + prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): JQuery; + + /** + * Remove an attribute from each element in the set of matched elements. + * + * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes. + * @see {@link https://api.jquery.com/removeAttr/} + */ + removeAttr(attributeName: string): JQuery; + + /** + * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. + * + * @param className One or more space-separated classes to be removed from the class attribute of each matched element. + * @see {@link https://api.jquery.com/removeClass/#removeClass-className} + */ + removeClass(className?: string): JQuery; + /** + * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. + * + * @param func A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments. + * @see {@link https://api.jquery.com/removeClass/#removeClass-function} + */ + removeClass(func: (index: number, className: string) => string): JQuery; + + /** + * Remove a property for the set of matched elements. + * + * @param propertyName The name of the property to remove. + * @see {@link https://api.jquery.com/removeProp/} + */ + removeProp(propertyName: string): JQuery; + + /** + * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. + * + * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set. + * @param swtch A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed. + * @see {@link https://api.jquery.com/toggleClass/#toggleClass-className} + */ + toggleClass(className: string, swtch?: boolean): JQuery; + /** + * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. + * + * @param swtch A boolean value to determine whether the class should be added or removed. + * @see {@link https://api.jquery.com/toggleClass/#toggleClass-state} + */ + toggleClass(swtch?: boolean): JQuery; + /** + * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. + * + * @param func A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the switch as arguments. + * @param swtch A boolean value to determine whether the class should be added or removed. + * @see {@link https://api.jquery.com/toggleClass/#toggleClass-function-state} + */ + toggleClass(func: (index: number, className: string, swtch: boolean) => string, swtch?: boolean): JQuery; + + /** + * Get the current value of the first element in the set of matched elements. + * @see {@link https://api.jquery.com/val/#val} + */ + val(): any; + /** + * Set the value of each element in the set of matched elements. + * + * @param value A string of text, an array of strings or number corresponding to the value of each matched element to set as selected/checked. + * @see {@link https://api.jquery.com/val/#val-value} + */ + val(value: string|string[]|number): JQuery; + /** + * Set the value of each element in the set of matched elements. + * + * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. + * @see {@link https://api.jquery.com/val/#val-function} + */ + val(func: (index: number, value: string) => string): JQuery; + + /** + * Get the value of style properties for the first element in the set of matched elements. + * + * @param propertyName A CSS property. + * @see {@link https://api.jquery.com/css/#css-propertyName} + */ + css(propertyName: string): string; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param propertyName A CSS property name. + * @param value A value to set for the property. + * @see {@link https://api.jquery.com/css/#css-propertyName-value} + */ + css(propertyName: string, value: string|number): JQuery; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param propertyName A CSS property name. + * @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. + * @see {@link https://api.jquery.com/css/#css-propertyName-function} + */ + css(propertyName: string, value: (index: number, value: string) => string|number): JQuery; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param properties An object of property-value pairs to set. + * @see {@link https://api.jquery.com/css/#css-properties} + */ + css(properties: Object): JQuery; + + /** + * Get the current computed height for the first element in the set of matched elements. + * @see {@link https://api.jquery.com/height/#height} + */ + height(): number; + /** + * Set the CSS height of every matched element. + * + * @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string). + * @see {@link https://api.jquery.com/height/#height-value} + */ + height(value: number|string): JQuery; + /** + * Set the CSS height of every matched element. + * + * @param func A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set. + * @see {@link https://api.jquery.com/height/#height-function} + */ + height(func: (index: number, height: number) => number|string): JQuery; + + /** + * Get the current computed height for the first element in the set of matched elements, including padding but not border. + * @see {@link https://api.jquery.com/innerHeight/#innerHeight} + */ + innerHeight(): number; + + /** + * Sets the inner height on elements in the set of matched elements, including padding but not border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + * @see {@link https://api.jquery.com/innerHeight/#innerHeight-value} + */ + innerHeight(value: number|string): JQuery; + + /** + * Get the current computed width for the first element in the set of matched elements, including padding but not border. + * @see {@link https://api.jquery.com/innerWidth/#innerWidth} + */ + innerWidth(): number; + + /** + * Sets the inner width on elements in the set of matched elements, including padding but not border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + * @see {@link https://api.jquery.com/innerWidth/#innerWidth-value} + */ + innerWidth(value: number|string): JQuery; + + /** + * Get the current coordinates of the first element in the set of matched elements, relative to the document. + * @see {@link https://api.jquery.com/offset/#offset} + */ + offset(): JQueryCoordinates; + /** + * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. + * + * @param coordinates An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. + * @see {@link https://api.jquery.com/offset/#offset-coordinates} + */ + offset(coordinates: JQueryCoordinates): JQuery; + /** + * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. + * + * @param func A function to return the coordinates to set. Receives the index of the element in the collection as the first argument and the current coordinates as the second argument. The function should return an object with the new top and left properties. + * @see {@link https://api.jquery.com/offset/#offset-function} + */ + offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): JQuery; + + /** + * Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements. + * + * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. + * @see {@link https://api.jquery.com/outerHeight/#outerHeight-includeMargin} + */ + outerHeight(includeMargin?: boolean): number; + + /** + * Sets the outer height on elements in the set of matched elements, including padding and border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + * @see {@link https://api.jquery.com/outerHeight/#outerHeight-value} + */ + outerHeight(value: number|string): JQuery; + + /** + * Get the current computed width for the first element in the set of matched elements, including padding and border. + * + * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. + * @see {@link https://api.jquery.com/outerWidth/#outerWidth-includeMargin} + */ + outerWidth(includeMargin?: boolean): number; + + /** + * Sets the outer width on elements in the set of matched elements, including padding and border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + * @see {@link https://api.jquery.com/outerWidth/#outerWidth-value} + */ + outerWidth(value: number|string): JQuery; + + /** + * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. + * @see {@link https://api.jquery.com/position/} + */ + position(): JQueryCoordinates; + + /** + * Get the current horizontal position of the scroll bar for the first element in the set of matched elements or set the horizontal position of the scroll bar for every matched element. + * @see {@link https://api.jquery.com/scrollLeft/#scrollLeft} + */ + scrollLeft(): number; + /** + * Set the current horizontal position of the scroll bar for each of the set of matched elements. + * + * @param value An integer indicating the new position to set the scroll bar to. + * @see {@link https://api.jquery.com/scrollLeft/#scrollLeft-value} + */ + scrollLeft(value: number): JQuery; + + /** + * Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element. + * @see {@link https://api.jquery.com/scrollTop/#scrollTop} + */ + scrollTop(): number; + /** + * Set the current vertical position of the scroll bar for each of the set of matched elements. + * + * @param value An integer indicating the new position to set the scroll bar to. + * @see {@link https://api.jquery.com/scrollTop/#scrollTop-value} + */ + scrollTop(value: number): JQuery; + + /** + * Get the current computed width for the first element in the set of matched elements. + * @see {@link https://api.jquery.com/width/#width} + */ + width(): number; + /** + * Set the CSS width of each element in the set of matched elements. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + * @see {@link https://api.jquery.com/width/#width-value} + */ + width(value: number|string): JQuery; + /** + * Set the CSS width of each element in the set of matched elements. + * + * @param func A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set. + * @see {@link https://api.jquery.com/width/#width-function} + */ + width(func: (index: number, width: number) => number|string): JQuery; + + /** + * Remove from the queue all items that have not yet been run. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @see {@link https://api.jquery.com/clearQueue/} + */ + clearQueue(queueName?: string): JQuery; + + /** + * Store arbitrary data associated with the matched elements. + * + * @param key A string naming the piece of data to set. + * @param value The new data value; it can be any JavaScript type including Array or Object. + * @see {@link https://api.jquery.com/data/#data-key-value} + */ + data(key: string, value: any): JQuery; + /** + * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. + * + * @param key Name of the data stored. + * @see {@link https://api.jquery.com/data/#data-key} + */ + data(key: string): any; + /** + * Store arbitrary data associated with the matched elements. + * + * @param obj An object of key-value pairs of data to update. + * @see {@link https://api.jquery.com/data/#data-obj} + */ + data(obj: { [key: string]: any; }): JQuery; + /** + * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. + * @see {@link https://api.jquery.com/data/#data} + */ + data(): any; + + /** + * Execute the next function on the queue for the matched elements. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @see {@link https://api.jquery.com/dequeue/} + */ + dequeue(queueName?: string): JQuery; + + /** + * Remove a previously-stored piece of data. + * + * @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete. + * @see {@link https://api.jquery.com/removeData/#removeData-name} + */ + removeData(name: string): JQuery; + /** + * Remove a previously-stored piece of data. + * + * @param list An array of strings naming the pieces of data to delete. + * @see {@link https://api.jquery.com/removeData/#removeData-list} + */ + removeData(list: string[]): JQuery; + /** + * Remove all previously-stored piece of data. + * @see {@link https://api.jquery.com/removeData/} + */ + removeData(): JQuery; + + /** + * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished. + * + * @param type The type of queue that needs to be observed. (default: fx) + * @param target Object onto which the promise methods have to be attached + * @see {@link https://api.jquery.com/promise/} + */ + promise(type?: string, target?: Object): JQueryPromise; + + /** + * Perform a custom animation of a set of CSS properties. + * + * @param properties An object of CSS properties and values that the animation will move toward. + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + * @see {@link https://api.jquery.com/animate/#animate-properties-duration-easing-complete} + */ + animate(properties: Object, duration?: string|number, complete?: Function): JQuery; + /** + * Perform a custom animation of a set of CSS properties. + * + * @param properties An object of CSS properties and values that the animation will move toward. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. (default: swing) + * @param complete A function to call once the animation is complete. + * @see {@link https://api.jquery.com/animate/#animate-properties-duration-easing-complete} + */ + animate(properties: Object, duration?: string|number, easing?: string, complete?: Function): JQuery; + /** + * Perform a custom animation of a set of CSS properties. + * + * @param properties An object of CSS properties and values that the animation will move toward. + * @param options A map of additional options to pass to the method. + * @see {@link https://api.jquery.com/animate/#animate-properties-options} + */ + animate(properties: Object, options: JQueryAnimationOptions): JQuery; + + /** + * Set a timer to delay execution of subsequent items in the queue. + * + * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @see {@link https://api.jquery.com/delay/} + */ + delay(duration: number, queueName?: string): JQuery; + + /** + * Display the matched elements by fading them to opaque. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + * @see {@link https://api.jquery.com/fadeIn/#fadeIn-duration-complete} + */ + fadeIn(duration?: number|string, complete?: Function): JQuery; + /** + * Display the matched elements by fading them to opaque. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + * @see {@link https://api.jquery.com/fadeIn/#fadeIn-duration-easing-complete} + */ + fadeIn(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display the matched elements by fading them to opaque. + * + * @param options A map of additional options to pass to the method. + * @see {@link https://api.jquery.com/fadeIn/#fadeIn-options} + */ + fadeIn(options: JQueryAnimationOptions): JQuery; + + /** + * Hide the matched elements by fading them to transparent. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + * @see {@link https://api.jquery.com/fadeOut/#fadeOut-duration-complete} + */ + fadeOut(duration?: number|string, complete?: Function): JQuery; + /** + * Hide the matched elements by fading them to transparent. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + * @see {@link https://api.jquery.com/fadeOut/#fadeOut-duration-easing-complete} + */ + fadeOut(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Hide the matched elements by fading them to transparent. + * + * @param options A map of additional options to pass to the method. + * @see {@link https://api.jquery.com/fadeOut/#fadeOut-options} + */ + fadeOut(options: JQueryAnimationOptions): JQuery; + + /** + * Adjust the opacity of the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param opacity A number between 0 and 1 denoting the target opacity. + * @param complete A function to call once the animation is complete. + * @see {@link https://api.jquery.com/fadeTo/#fadeTo-duration-opacity-complete} + */ + fadeTo(duration: string|number, opacity: number, complete?: Function): JQuery; + /** + * Adjust the opacity of the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param opacity A number between 0 and 1 denoting the target opacity. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + * @see {@link https://api.jquery.com/fadeTo/#fadeTo-duration-opacity-easing-complete} + */ + fadeTo(duration: string|number, opacity: number, easing?: string, complete?: Function): JQuery; + + /** + * Display or hide the matched elements by animating their opacity. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + * @see {@link https://api.jquery.com/fadeToggle/#fadeToggle-duration-easing-complete} + */ + fadeToggle(duration?: number|string, complete?: Function): JQuery; + /** + * Display or hide the matched elements by animating their opacity. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + * @see {@link https://api.jquery.com/fadeToggle/#fadeToggle-duration-easing-complete} + */ + fadeToggle(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display or hide the matched elements by animating their opacity. + * + * @param options A map of additional options to pass to the method. + * @see {@link https://api.jquery.com/fadeToggle/#fadeToggle-options} + */ + fadeToggle(options: JQueryAnimationOptions): JQuery; + + /** + * Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements. + * + * @param queue The name of the queue in which to stop animations. + * @see {@link https://api.jquery.com/finish/} + */ + finish(queue?: string): JQuery; + + /** + * Hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + * @see {@link https://api.jquery.com/hide/#hide} + */ + hide(duration?: number|string, complete?: Function): JQuery; + /** + * Hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + * @see {@link https://api.jquery.com/hide/#hide-duration-easing-complete} + */ + hide(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Hide the matched elements. + * + * @param options A map of additional options to pass to the method. + * @see {@link https://api.jquery.com/hide/#hide-options} + */ + hide(options: JQueryAnimationOptions): JQuery; + + /** + * Display the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + * @see {@link https://api.jquery.com/show/#show} + */ + show(duration?: number|string, complete?: Function): JQuery; + /** + * Display the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + * @see {@link https://api.jquery.com/show/#show-duration-easing-complete} + */ + show(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display the matched elements. + * + * @param options A map of additional options to pass to the method. + * @see {@link https://api.jquery.com/show/#show-options} + */ + show(options: JQueryAnimationOptions): JQuery; + + /** + * Display the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + * @see {@link https://api.jquery.com/slideDown/#slideDown-duration-complete} + */ + slideDown(duration?: number|string, complete?: Function): JQuery; + /** + * Display the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + * @see {@link https://api.jquery.com/slideDown/#slideDown-duration-easing-complete} + */ + slideDown(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display the matched elements with a sliding motion. + * + * @param options A map of additional options to pass to the method. + * @see {@link https://api.jquery.com/slideDown/#slideDown-options} + */ + slideDown(options: JQueryAnimationOptions): JQuery; + + /** + * Display or hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + * @see {@link https://api.jquery.com/slideToggle/#slideToggle-duration-complete} + */ + slideToggle(duration?: number|string, complete?: Function): JQuery; + /** + * Display or hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + * @see {@link https://api.jquery.com/slideToggle/#slideToggle-duration-easing-complete} + */ + slideToggle(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display or hide the matched elements with a sliding motion. + * + * @param options A map of additional options to pass to the method. + * @see {@link https://api.jquery.com/slideToggle/#slideToggle-options} + */ + slideToggle(options: JQueryAnimationOptions): JQuery; + + /** + * Hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + * @see {@link https://api.jquery.com/slideUp/#slideUp-duration-complete} + */ + slideUp(duration?: number|string, complete?: Function): JQuery; + /** + * Hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + * @see {@link https://api.jquery.com/slideUp/#slideUp-duration-easing-complete} + */ + slideUp(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Hide the matched elements with a sliding motion. + * + * @param options A map of additional options to pass to the method. + * @see {@link https://api.jquery.com/slideUp/#slideUp-options} + */ + slideUp(options: JQueryAnimationOptions): JQuery; + + /** + * Stop the currently-running animation on the matched elements. + * + * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. + * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. + * @see {@link https://api.jquery.com/stop/#stop-clearQueue-jumpToEnd} + */ + stop(clearQueue?: boolean, jumpToEnd?: boolean): JQuery; + /** + * Stop the currently-running animation on the matched elements. + * + * @param queue The name of the queue in which to stop animations. + * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. + * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. + * @see {@link https://api.jquery.com/stop/#stop-queue-clearQueue-jumpToEnd} + */ + stop(queue?: string, clearQueue?: boolean, jumpToEnd?: boolean): JQuery; + + /** + * Display or hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + * @see {@link https://api.jquery.com/toggle/#toggle-duration-complete} + */ + toggle(duration?: number|string, complete?: Function): JQuery; + /** + * Display or hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + * @see {@link https://api.jquery.com/toggle/#toggle-duration-easing-complete} + */ + toggle(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display or hide the matched elements. + * + * @param options A map of additional options to pass to the method. + * @see {@link https://api.jquery.com/toggle/#toggle-options} + */ + toggle(options: JQueryAnimationOptions): JQuery; + /** + * Display or hide the matched elements. + * + * @param showOrHide A Boolean indicating whether to show or hide the elements. + * @see {@link https://api.jquery.com/toggle/#toggle-display} + */ + toggle(showOrHide: boolean): JQuery; + + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/bind/#bind-eventType-eventData-handler} + */ + bind(eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/bind/#bind-eventType-eventData-handler} + */ + bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param eventData An object containing data that will be passed to the event handler. + * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. + * @see {@link https://api.jquery.com/bind/#bind-eventType-eventData-preventBubble} + */ + bind(eventType: string, eventData: any, preventBubble: boolean): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. + * @see {@link https://api.jquery.com/bind/#bind-eventType-eventData-preventBubble} + */ + bind(eventType: string, preventBubble: boolean): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param events An object containing one or more DOM event types and functions to execute for them. + * @see {@link https://api.jquery.com/bind/#bind-events} + */ + bind(events: any): JQuery; + + /** + * Trigger the "blur" event on an element + * @see {@link https://api.jquery.com/blur/#blur} + */ + blur(): JQuery; + /** + * Bind an event handler to the "blur" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/blur/#blur-handler} + */ + blur(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "blur" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/blur/#blur-eventData-handler} + */ + blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "change" event on an element. + * @see {@link https://api.jquery.com/change/#change} + */ + change(): JQuery; + /** + * Bind an event handler to the "change" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/change/#change-handler} + */ + change(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "change" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/change/#change-eventData-handler} + */ + change(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "click" event on an element. + * @see {@link https://api.jquery.com/click/#click} + */ + click(): JQuery; + /** + * Bind an event handler to the "click" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/click/#click-handler} + */ + click(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "click" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/click/#click-eventData-handler} + */ + click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "contextmenu" event on an element. + * @see {@link https://api.jquery.com/contextmenu/#contextmenu} + */ + contextmenu(): JQuery; + /** + * Bind an event handler to the "contextmenu" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/contextmenu/#contextmenu-handler} + */ + contextmenu(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "contextmenu" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/contextmenu/#contextmenu-eventData-handler} + */ + contextmenu(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "dblclick" event on an element. + * @see {@link https://api.jquery.com/dblclick/#dblclick} + */ + dblclick(): JQuery; + /** + * Bind an event handler to the "dblclick" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/dblclick/#dblclick-handler} + */ + dblclick(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "dblclick" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/dblclick/#dblclick-eventData-handler} + */ + dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements. + * @see {@link https://api.jquery.com/delegate/#delegate-selector-eventType-handler} + */ + delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements. + * @see {@link https://api.jquery.com/delegate/#delegate-selector-eventType-eventData-handler} + */ + delegate(selector: any, eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "focus" event on an element. + * @see {@link https://api.jquery.com/focus/#focus} + */ + focus(): JQuery; + /** + * Bind an event handler to the "focus" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/focus/#focus-handler} + */ + focus(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "focus" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/focus/#focus-eventData-handler} + */ + focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "focusin" event on an element. + * @see {@link https://api.jquery.com/focusin/#focusin} + */ + focusin(): JQuery; + /** + * Bind an event handler to the "focusin" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/focusin/#focusin-handler} + */ + focusin(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "focusin" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/focusin/#focusin-eventData-handler} + */ + focusin(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "focusout" event on an element. + * @see {@link https://api.jquery.com/focusout/#focusout} + */ + focusout(): JQuery; + /** + * Bind an event handler to the "focusout" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/focusout/#focusout-handler} + */ + focusout(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "focusout" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/focusout/#focusout-eventData-handler} + */ + focusout(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements. + * + * @param handlerIn A function to execute when the mouse pointer enters the element. + * @param handlerOut A function to execute when the mouse pointer leaves the element. + * @see {@link https://api.jquery.com/hover/#hover-handlerIn-handlerOut} + */ + hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements. + * + * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element. + * @see {@link https://api.jquery.com/hover/#hover-handlerInOut} + */ + hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "keydown" event on an element. + * @see {@link https://api.jquery.com/keydown/#keydown} + */ + keydown(): JQuery; + /** + * Bind an event handler to the "keydown" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/keydown/#keydown-handler} + */ + keydown(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; + /** + * Bind an event handler to the "keydown" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/keydown/#keydown-eventData-handler} + */ + keydown(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; + + /** + * Trigger the "keypress" event on an element. + * @see {@link https://api.jquery.com/keypress/#keypress} + */ + keypress(): JQuery; + /** + * Bind an event handler to the "keypress" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/keypress/#keypress-handler} + */ + keypress(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; + /** + * Bind an event handler to the "keypress" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/keypress/#keypress-eventData-handler} + */ + keypress(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; + + /** + * Trigger the "keyup" event on an element. + * @see {@link https://api.jquery.com/keyup/#keyup} + */ + keyup(): JQuery; + /** + * Bind an event handler to the "keyup" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/keyup/#keyup-handler} + */ + keyup(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; + /** + * Bind an event handler to the "keyup" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/keyup/#keyup-eventData-handler} + */ + keyup(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; + + /** + * Bind an event handler to the "load" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/load/} + */ + load(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "load" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/load/} + */ + load(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "mousedown" event on an element. + * @see {@link https://api.jquery.com/mousedown/#mousedown} + */ + mousedown(): JQuery; + /** + * Bind an event handler to the "mousedown" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/mousedown/#mousedown-handler} + */ + mousedown(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mousedown" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/mousedown/#mousedown-eventData-handler} + */ + mousedown(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseenter" event on an element. + * @see {@link https://api.jquery.com/mouseenter/#mouseenter} + */ + mouseenter(): JQuery; + /** + * Bind an event handler to be fired when the mouse enters an element. + * + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/mouseenter/#mouseenter-handler} + */ + mouseenter(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to be fired when the mouse enters an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/mouseenter/#mouseenter-eventData-handler} + */ + mouseenter(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseleave" event on an element. + * @see {@link https://api.jquery.com/mouseleave/#mouseleave} + */ + mouseleave(): JQuery; + /** + * Bind an event handler to be fired when the mouse leaves an element. + * + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/mouseleave/#mouseleave-handler} + */ + mouseleave(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to be fired when the mouse leaves an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/mouseleave/#mouseleave-eventData-handler} + */ + mouseleave(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mousemove" event on an element. + * @see {@link https://api.jquery.com/mousemove/#mousemove} + */ + mousemove(): JQuery; + /** + * Bind an event handler to the "mousemove" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/mousemove/#mousemove-handler} + */ + mousemove(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mousemove" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/mousemove/#mousemove-eventData-handler} + */ + mousemove(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseout" event on an element. + * @see {@link https://api.jquery.com/mouseout/#mouseout} + */ + mouseout(): JQuery; + /** + * Bind an event handler to the "mouseout" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/mouseout/#mouseout-handler} + */ + mouseout(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mouseout" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/mouseout/#mouseout-eventData-handler} + */ + mouseout(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseover" event on an element. + * @see {@link https://api.jquery.com/mouseover/#mouseover} + */ + mouseover(): JQuery; + /** + * Bind an event handler to the "mouseover" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/mouseover/#mouseover-handler} + */ + mouseover(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mouseover" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/mouseover/#mouseover-eventData-handler} + */ + mouseover(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseup" event on an element. + * @see {@link https://api.jquery.com/mouseup/#mouseup} + */ + mouseup(): JQuery; + /** + * Bind an event handler to the "mouseup" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/mouseup/#mouseup-handler} + */ + mouseup(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mouseup" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/mouseup/#mouseup-eventData-handler} + */ + mouseup(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Remove an event handler. + * @see {@link https://api.jquery.com/off/#off} + */ + off(): JQuery; + /** + * Remove an event handler. + * + * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". + * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. + * @param handler A handler function previously attached for the event(s), or the special value false. + * @see {@link https://api.jquery.com/off/#off-events-selector-handler} + */ + off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove an event handler. + * + * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". + * @param handler A handler function previously attached for the event(s), or the special value false. Takes handler with extra args that can be attached with on(). + * @see {@link https://api.jquery.com/off/#off-events-selector-handler} + */ + off(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; + /** + * Remove an event handler. + * + * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". + * @param handler A handler function previously attached for the event(s), or the special value false. + * @see {@link https://api.jquery.com/off/#off-events-selector-handler} + */ + off(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove an event handler. + * + * @param events An object where the string keys represent one or more space-separated event types and optional namespaces, and the values represent handler functions previously attached for the event(s). + * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. + * @see {@link https://api.jquery.com/off/#off-events-selector} + */ + off(events: { [key: string]: any; }, selector?: string): JQuery; + + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. Rest parameter args is for optional parameters passed to jQuery.trigger(). Note that the actual parameters on the event handler function must be marked as optional (? syntax). + * @see {@link https://api.jquery.com/on/#on-events-selector-data-handler} + */ + on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + * @see {@link https://api.jquery.com/on/#on-events-selector-data-handler} + */ + on(events: string, data : any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + * @see {@link https://api.jquery.com/on/#on-events-selector-data-handler} + */ + on(events: string, selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + * @see {@link https://api.jquery.com/on/#on-events-selector-data-handler} + */ + on(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event occurs. + * @see {@link https://api.jquery.com/on/#on-events-selector-data} + */ + on(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param data Data to be passed to the handler in event.data when an event occurs. + * @see {@link https://api.jquery.com/on/#on-events-selector-data} + */ + on(events: { [key: string]: any; }, data?: any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute at the time the event is triggered. + * @see {@link https://api.jquery.com/one/#one-events-data-handler} + */ + one(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. + * @param data An object containing data that will be passed to the event handler. + * @param handler A function to execute at the time the event is triggered. + * @see {@link https://api.jquery.com/one/#one-events-data-handler} + */ + one(events: string, data: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + * @see {@link https://api.jquery.com/one/#one-events-selector-data-handler} + */ + one(events: string, selector: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + * @see {@link https://api.jquery.com/one/#one-events-selector-data-handler} + */ + one(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event occurs. + * @see {@link https://api.jquery.com/one/#one-events-selector-data} + */ + one(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param data Data to be passed to the handler in event.data when an event occurs. + * @see {@link https://api.jquery.com/one/#one-events-selector-data} + */ + one(events: { [key: string]: any; }, data?: any): JQuery; + + + /** + * Specify a function to execute when the DOM is fully loaded. + * + * @param handler A function to execute after the DOM is ready. + * @see {@link https://api.jquery.com/ready/} + */ + ready(handler: (jQueryAlias?: JQueryStatic) => any): JQuery; + + /** + * Trigger the "resize" event on an element. + * @see {@link https://api.jquery.com/resize/#resize} + */ + resize(): JQuery; + /** + * Bind an event handler to the "resize" JavaScript event. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/resize/#resize-handler} + */ + resize(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "resize" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/resize/#resize-eventData-handler} + */ + resize(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "scroll" event on an element. + * @see {@link https://api.jquery.com/scroll/#scroll} + */ + scroll(): JQuery; + /** + * Bind an event handler to the "scroll" JavaScript event. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/scroll/#scroll-handler} + */ + scroll(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "scroll" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/scroll/#scroll-eventData-handler} + */ + scroll(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "select" event on an element. + * @see {@link https://api.jquery.com/select/#select} + */ + select(): JQuery; + /** + * Bind an event handler to the "select" JavaScript event. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/select/#select-handler} + */ + select(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "select" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/select/#select-eventData-handler} + */ + select(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "submit" event on an element. + * @see {@link https://api.jquery.com/submit/#submit} + */ + submit(): JQuery; + /** + * Bind an event handler to the "submit" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/submit/#submit-handler} + */ + submit(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "submit" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/submit/#submit-eventData-handler} + */ + submit(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Execute all handlers and behaviors attached to the matched elements for the given event type. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param extraParameters Additional parameters to pass along to the event handler. + * @see {@link https://api.jquery.com/trigger/#trigger-eventType-extraParameters} + */ + trigger(eventType: string, extraParameters?: any[]|Object): JQuery; + /** + * Execute all handlers and behaviors attached to the matched elements for the given event type. + * + * @param event A jQuery.Event object. + * @param extraParameters Additional parameters to pass along to the event handler. + * @see {@link https://api.jquery.com/trigger/#trigger-event-extraParameters} + */ + trigger(event: JQueryEventObject, extraParameters?: any[]|Object): JQuery; + + /** + * Execute all handlers attached to an element for an event. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param extraParameters An array of additional parameters to pass along to the event handler. + * @see {@link https://api.jquery.com/triggerHandler/#triggerHandler-eventType-extraParameters} + */ + triggerHandler(eventType: string, ...extraParameters: any[]): Object; + + /** + * Execute all handlers attached to an element for an event. + * + * @param event A jQuery.Event object. + * @param extraParameters An array of additional parameters to pass along to the event handler. + * @see {@link https://api.jquery.com/triggerHandler/#triggerHandler-event-extraParameters} + */ + triggerHandler(event: JQueryEventObject, ...extraParameters: any[]): Object; + + /** + * Remove a previously-attached event handler from the elements. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param handler The function that is to be no longer executed. + * @see {@link https://api.jquery.com/unbind/#unbind-eventType-handler} + */ + unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove a previously-attached event handler from the elements. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param fls Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ). + * @see {@link https://api.jquery.com/unbind/#unbind-eventType-false} + */ + unbind(eventType: string, fls: boolean): JQuery; + /** + * Remove a previously-attached event handler from the elements. + * + * @param evt A JavaScript event object as passed to an event handler. + * @see {@link https://api.jquery.com/unbind/#unbind-event} + */ + unbind(evt: any): JQuery; + + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * @see {@link https://api.jquery.com/undelegate/#undelegate} + */ + undelegate(): JQuery; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * + * @param selector A selector which will be used to filter the event results. + * @param eventType A string containing a JavaScript event type, such as "click" or "keydown" + * @param handler A function to execute at the time the event is triggered. + * @see {@link https://api.jquery.com/undelegate/#undelegate-selector-eventType} + */ + undelegate(selector: string, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * + * @param selector A selector which will be used to filter the event results. + * @param events An object of one or more event types and previously bound functions to unbind from them. + * @see {@link https://api.jquery.com/undelegate/#undelegate-selector-events} + */ + undelegate(selector: string, events: Object): JQuery; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * + * @param namespace A string containing a namespace to unbind all events from. + * @see {@link https://api.jquery.com/undelegate/#undelegate-namespace} + */ + undelegate(namespace: string): JQuery; + + /** + * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) + * + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/unload/#unload-handler} + */ + unload(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) + * + * @param eventData A plain object of data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/unload/#unload-eventData-handler} + */ + unload(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. (DEPRECATED from v1.10) + * @see {@link https://api.jquery.com/context/} + */ + context: Element; + + jquery: string; + + /** + * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) + * + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/error/#error-handler} + */ + error(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) + * + * @param eventData A plain object of data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/error/#error-eventData-handler} + */ + error(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Add a collection of DOM elements onto the jQuery stack. + * + * @param elements An array of elements to push onto the stack and make into a new jQuery object. + * @see {@link https://api.jquery.com/pushStack/#pushStack-elements} + */ + pushStack(elements: any[]): JQuery; + /** + * Add a collection of DOM elements onto the jQuery stack. + * + * @param elements An array of elements to push onto the stack and make into a new jQuery object. + * @param name The name of a jQuery method that generated the array of elements. + * @param arguments The arguments that were passed in to the jQuery method (for serialization). + * @see {@link https://api.jquery.com/pushStack/#pushStack-elements-name-arguments} + */ + pushStack(elements: any[], name: string, arguments: any[]): JQuery; + + /** + * Insert content, specified by the parameter, after each element in the set of matched elements. + * + * @param content1 HTML string, DOM element, DocumentFragment, array of elements, or jQuery object to insert after each element in the set of matched elements. + * @param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements. + * @see {@link https://api.jquery.com/after/#after-content-content} + */ + after(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, after each element in the set of matched elements. + * + * @param func A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + * @see {@link https://api.jquery.com/after/#after-function} + */ + after(func: (index: number, html: string) => string|Element|JQuery): JQuery; + + /** + * Insert content, specified by the parameter, to the end of each element in the set of matched elements. + * + * @param content1 DOM element, DocumentFragment, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements. + * @param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements. + * @see {@link https://api.jquery.com/append/#append-content-content} + */ + append(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, to the end of each element in the set of matched elements. + * + * @param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. + * @see {@link https://api.jquery.com/append/#append-function} + */ + append(func: (index: number, html: string) => string|Element|JQuery): JQuery; + + /** + * Insert every element in the set of matched elements to the end of the target. + * + * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter. + * @see {@link https://api.jquery.com/appendTo/} + */ + appendTo(target: JQuery|any[]|Element|string): JQuery; + + /** + * Insert content, specified by the parameter, before each element in the set of matched elements. + * + * @param content1 HTML string, DOM element, DocumentFragment, array of elements, or jQuery object to insert before each element in the set of matched elements. + * @param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements. + * @see {@link https://api.jquery.com/before/#before-content-content} + */ + before(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, before each element in the set of matched elements. + * + * @param func A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + * @see {@link https://api.jquery.com/before/#before-function} + */ + before(func: (index: number, html: string) => string|Element|JQuery): JQuery; + + /** + * Create a deep copy of the set of matched elements. + * + * @param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false. + * @param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false). + * @see {@link https://api.jquery.com/clone/} + */ + clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): JQuery; + + /** + * Remove the set of matched elements from the DOM. + * + * @param selector A selector expression that filters the set of matched elements to be removed. + * @see {@link https://api.jquery.com/detach/} + */ + detach(selector?: string): JQuery; + + /** + * Remove all child nodes of the set of matched elements from the DOM. + * @see {@link https://api.jquery.com/empty/} + */ + empty(): JQuery; + + /** + * Insert every element in the set of matched elements after the target. + * + * @param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter. + * @see {@link https://api.jquery.com/insertAfter/} + */ + insertAfter(target: JQuery|any[]|Element|Text|string): JQuery; + + /** + * Insert every element in the set of matched elements before the target. + * + * @param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter. + * @see {@link https://api.jquery.com/insertBefore/} + */ + insertBefore(target: JQuery|any[]|Element|Text|string): JQuery; + + /** + * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. + * + * @param content1 DOM element, DocumentFragment, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements. + * @param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements. + * @see {@link https://api.jquery.com/prepend/#prepend-content-content} + */ + prepend(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. + * + * @param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. + * @see {@link https://api.jquery.com/prepend/#prepend-function} + */ + prepend(func: (index: number, html: string) => string|Element|JQuery): JQuery; + + /** + * Insert every element in the set of matched elements to the beginning of the target. + * + * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter. + * @see {@link https://api.jquery.com/prependTo/} + */ + prependTo(target: JQuery|any[]|Element|string): JQuery; + + /** + * Remove the set of matched elements from the DOM. + * + * @param selector A selector expression that filters the set of matched elements to be removed. + * @see {@link https://api.jquery.com/remove/} + */ + remove(selector?: string): JQuery; + + /** + * Replace each target element with the set of matched elements. + * + * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace. + * @see {@link https://api.jquery.com/replaceAll/} + */ + replaceAll(target: JQuery|any[]|Element|string): JQuery; + + /** + * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. + * + * @param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object. + * @see {@link https://api.jquery.com/replaceWith/#replaceWith-newContent} + */ + replaceWith(newContent: JQuery|any[]|Element|Text|string): JQuery; + /** + * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. + * + * @param func A function that returns content with which to replace the set of matched elements. + * @see {@link https://api.jquery.com/replaceWith/#replaceWith-function} + */ + replaceWith(func: () => Element|JQuery): JQuery; + + /** + * Get the combined text contents of each element in the set of matched elements, including their descendants. + * @see {@link https://api.jquery.com/text/#text} + */ + text(): string; + /** + * Set the content of each element in the set of matched elements to the specified text. + * + * @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will be converted to a String representation. + * @see {@link https://api.jquery.com/text/#text-text} + */ + text(text: string|number|boolean): JQuery; + /** + * Set the content of each element in the set of matched elements to the specified text. + * + * @param func A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments. + * @see {@link https://api.jquery.com/text/#text-function} + */ + text(func: (index: number, text: string) => string): JQuery; + + /** + * Retrieve all the elements contained in the jQuery set, as an array. + * @name toArray + * @see {@link https://api.jquery.com/toArray/} + */ + toArray(): HTMLElement[]; + + /** + * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. + * @see {@link https://api.jquery.com/unwrap/} + */ + unwrap(): JQuery; + + /** + * Wrap an HTML structure around each element in the set of matched elements. + * + * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. + * @see {@link https://api.jquery.com/wrap/#wrap-wrappingElement} + */ + wrap(wrappingElement: JQuery|Element|string): JQuery; + /** + * Wrap an HTML structure around each element in the set of matched elements. + * + * @param func A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + * @see {@link https://api.jquery.com/wrap/#wrap-function} + */ + wrap(func: (index: number) => string|JQuery): JQuery; + + /** + * Wrap an HTML structure around all elements in the set of matched elements. + * + * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. + * @see {@link https://api.jquery.com/wrapAll/#wrapAll-wrappingElement} + */ + wrapAll(wrappingElement: JQuery|Element|string): JQuery; + /** + * Wrap an HTML structure around all elements in the set of matched elements. + * + * @param func A callback function returning the HTML content or jQuery object to wrap around all the matched elements. Within the function, this refers to the first element in the set. + * @see {@link https://api.jquery.com/wrapAll/#wrapAll-function} + */ + wrapAll(func: (index: number) => string): JQuery; + + /** + * Wrap an HTML structure around the content of each element in the set of matched elements. + * + * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements. + * @see {@link https://api.jquery.com/wrapInner/#wrapInner-wrappingElement} + */ + wrapInner(wrappingElement: JQuery|Element|string): JQuery; + /** + * Wrap an HTML structure around the content of each element in the set of matched elements. + * + * @param func A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + * @see {@link https://api.jquery.com/wrapInner/#wrapInner-function} + */ + wrapInner(func: (index: number) => string): JQuery; + + /** + * Iterate over a jQuery object, executing a function for each matched element. + * + * @param func A function to execute for each matched element. + * @see {@link https://api.jquery.com/each/} + */ + each(func: (index: number, elem: Element) => any): JQuery; + + /** + * Retrieve one of the elements matched by the jQuery object. + * + * @param index A zero-based integer indicating which element to retrieve. + * @see {@link https://api.jquery.com/get/#get-index} + */ + get(index: number): HTMLElement; + /** + * Retrieve the elements matched by the jQuery object. + * @alias toArray + * @see {@link https://api.jquery.com/get/#get} + */ + get(): HTMLElement[]; + + /** + * Search for a given element from among the matched elements. + * @see {@link https://api.jquery.com/index/#index} + */ + index(): number; + /** + * Search for a given element from among the matched elements. + * + * @param selector A selector representing a jQuery collection in which to look for an element. + * @see {@link https://api.jquery.com/index/#index-selector} + */ + index(selector: string|JQuery|Element): number; + + /** + * The number of elements in the jQuery object. + * @see {@link https://api.jquery.com/length/} + */ + length: number; + /** + * A selector representing selector passed to jQuery(), if any, when creating the original set. + * version deprecated: 1.7, removed: 1.9 + * @see {@link https://api.jquery.com/selector/} + */ + selector: string; + [index: string]: any; + [index: number]: HTMLElement; + + /** + * Add elements to the set of matched elements. + * + * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements. + * @param context The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method. + * @see {@link https://api.jquery.com/add/#add-selector} + */ + add(selector: string, context?: Element): JQuery; + /** + * Add elements to the set of matched elements. + * + * @param elements One or more elements to add to the set of matched elements. + * @see {@link https://api.jquery.com/add/#add-elements} + */ + add(...elements: Element[]): JQuery; + /** + * Add elements to the set of matched elements. + * + * @param html An HTML fragment to add to the set of matched elements. + * @see {@link https://api.jquery.com/add/#add-html} + */ + add(html: string): JQuery; + /** + * Add elements to the set of matched elements. + * + * @param obj An existing jQuery object to add to the set of matched elements. + * @see {@link https://api.jquery.com/add/#add-selection} + */ + add(obj: JQuery): JQuery; + + /** + * Get the children of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/children/} + */ + children(selector?: string): JQuery; + + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param selector A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/closest/#closest-selector} + */ + closest(selector: string): JQuery; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param selector A string containing a selector expression to match elements against. + * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. + * @see {@link https://api.jquery.com/closest/#closest-selector-context} + */ + closest(selector: string, context?: Element): JQuery; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param obj A jQuery object to match elements against. + * @see {@link https://api.jquery.com/closest/#closest-selection} + */ + closest(obj: JQuery): JQuery; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param element An element to match elements against. + * @see {@link https://api.jquery.com/closest/#closest-element} + */ + closest(element: Element): JQuery; + + /** + * Get an array of all the elements and selectors matched against the current element up through the DOM tree. + * + * @param selectors An array or string containing a selector expression to match elements against (can also be a jQuery object). + * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. + * @see {@link https://api.jquery.com/closest/#closest-selectors-context} + */ + closest(selectors: any, context?: Element): any[]; + + /** + * Get the children of each element in the set of matched elements, including text and comment nodes. + * @see {@link https://api.jquery.com/contents/} + */ + contents(): JQuery; + + /** + * End the most recent filtering operation in the current chain and return the set of matched elements to its previous state. + * @see {@link https://api.jquery.com/end/} + */ + end(): JQuery; + + /** + * Reduce the set of matched elements to the one at the specified index. + * + * @param index An integer indicating the 0-based position of the element. OR An integer indicating the position of the element, counting backwards from the last element in the set. + * @see {@link https://api.jquery.com/eq/} + */ + eq(index: number): JQuery; + + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param selector A string containing a selector expression to match the current set of elements against. + * @see {@link https://api.jquery.com/filter/#filter-selector} + */ + filter(selector: string): JQuery; + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param func A function used as a test for each element in the set. this is the current DOM element. + * @see {@link https://api.jquery.com/filter/#filter-function} + */ + filter(func: (index: number, element: Element) => any): JQuery; + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param element An element to match the current set of elements against. + * @see {@link https://api.jquery.com/filter/#filter-elements} + */ + filter(element: Element): JQuery; + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param obj An existing jQuery object to match the current set of elements against. + * @see {@link https://api.jquery.com/filter/#filter-selection} + */ + filter(obj: JQuery): JQuery; + + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + * + * @param selector A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/find/#find-selector} + */ + find(selector: string): JQuery; + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + * + * @param element An element to match elements against. + * @see {@link https://api.jquery.com/find/#find-element} + */ + find(element: Element): JQuery; + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + * + * @param obj A jQuery object to match elements against. + * @see {@link https://api.jquery.com/find/#find-element} + */ + find(obj: JQuery): JQuery; + + /** + * Reduce the set of matched elements to the first in the set. + * @see {@link https://api.jquery.com/first/} + */ + first(): JQuery; + + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * + * @param selector A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/has/#has-selector} + */ + has(selector: string): JQuery; + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * + * @param contained A DOM element to match elements against. + * @see {@link https://api.jquery.com/has/#has-contained} + */ + has(contained: Element): JQuery; + + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param selector A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/is/#is-selector} + */ + is(selector: string): boolean; + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param func A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element. + * @see {@link https://api.jquery.com/is/#is-function} + */ + is(func: (index: number, element: Element) => boolean): boolean; + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param obj An existing jQuery object to match the current set of elements against. + * @see {@link https://api.jquery.com/is/#is-selection} + */ + is(obj: JQuery): boolean; + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param elements One or more elements to match the current set of elements against. + * @see {@link https://api.jquery.com/is/#is-elements} + */ + is(elements: any): boolean; + + /** + * Reduce the set of matched elements to the final one in the set. + * @see {@link https://api.jquery.com/last/} + */ + last(): JQuery; + + /** + * Pass each element in the current matched set through a function, producing a new jQuery object containing the return values. + * + * @param callback A function object that will be invoked for each element in the current set. + * @see {@link https://api.jquery.com/map/} + */ + map(callback: (index: number, domElement: Element) => any): JQuery; + + /** + * Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector. + * + * @param selector A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/next/} + */ + next(selector?: string): JQuery; + + /** + * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/nextAll/} + */ + nextAll(selector?: string): JQuery; + + /** + * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. + * + * @param selector A string containing a selector expression to indicate where to stop matching following sibling elements. + * @param filter A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/nextUntil/#nextUntil-selector-filter} + */ + nextUntil(selector?: string, filter?: string): JQuery; + /** + * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. + * + * @param element A DOM node or jQuery object indicating where to stop matching following sibling elements. + * @param filter A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/nextUntil/#nextUntil-element-filter} + */ + nextUntil(element?: Element, filter?: string): JQuery; + /** + * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. + * + * @param obj A DOM node or jQuery object indicating where to stop matching following sibling elements. + * @param filter A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/nextUntil/#nextUntil-element-filter} + */ + nextUntil(obj?: JQuery, filter?: string): JQuery; + + /** + * Remove elements from the set of matched elements. + * + * @param selector A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/not/#not-selector} + */ + not(selector: string): JQuery; + /** + * Remove elements from the set of matched elements. + * + * @param func A function used as a test for each element in the set. this is the current DOM element. + * @see {@link https://api.jquery.com/not/#not-function} + */ + not(func: (index: number, element: Element) => boolean): JQuery; + /** + * Remove elements from the set of matched elements. + * + * @param elements One or more DOM elements to remove from the matched set. + * @see {@link https://api.jquery.com/not/#not-selection} + */ + not(elements: Element|Element[]): JQuery; + /** + * Remove elements from the set of matched elements. + * + * @param obj An existing jQuery object to match the current set of elements against. + * @see {@link https://api.jquery.com/not/#not-selection} + */ + not(obj: JQuery): JQuery; + + /** + * Get the closest ancestor element that is positioned. + * @see {@link https://api.jquery.com/offsetParent/} + */ + offsetParent(): JQuery; + + /** + * Get the parent of each element in the current set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/parent/} + */ + parent(selector?: string): JQuery; + + /** + * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/parents/} + */ + parents(selector?: string): JQuery; + + /** + * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param selector A string containing a selector expression to indicate where to stop matching ancestor elements. + * @param filter A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/parentsUntil/#parentsUntil-selector-filter} + */ + parentsUntil(selector?: string, filter?: string): JQuery; + /** + * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param element A DOM node or jQuery object indicating where to stop matching ancestor elements. + * @param filter A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/parentsUntil/#parentsUntil-element-filter} + */ + parentsUntil(element?: Element, filter?: string): JQuery; + /** + * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param obj A DOM node or jQuery object indicating where to stop matching ancestor elements. + * @param filter A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/parentsUntil/#parentsUntil-element-filter} + */ + parentsUntil(obj?: JQuery, filter?: string): JQuery; + + /** + * Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/prev/} + */ + prev(selector?: string): JQuery; + + /** + * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/prevAll/} + */ + prevAll(selector?: string): JQuery; + + /** + * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param selector A string containing a selector expression to indicate where to stop matching preceding sibling elements. + * @param filter A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/prevUntil/#prevUntil-selector-filter} + */ + prevUntil(selector?: string, filter?: string): JQuery; + /** + * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param element A DOM node or jQuery object indicating where to stop matching preceding sibling elements. + * @param filter A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/prevUntil/#prevUntil-element-filter} + */ + prevUntil(element?: Element, filter?: string): JQuery; + /** + * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param obj A DOM node or jQuery object indicating where to stop matching preceding sibling elements. + * @param filter A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/prevUntil/#prevUntil-element-filter} + */ + prevUntil(obj?: JQuery, filter?: string): JQuery; + + /** + * Get the siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/siblings/} + */ + siblings(selector?: string): JQuery; + + /** + * Reduce the set of matched elements to a subset specified by a range of indices. + * + * @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative, it indicates an offset from the end of the set. + * @param end An integer indicating the 0-based position at which the elements stop being selected. If negative, it indicates an offset from the end of the set. If omitted, the range continues until the end of the set. + * @see {@link https://api.jquery.com/slice/} + */ + slice(start: number, end?: number): JQuery; + + /** + * Show the queue of functions to be executed on the matched elements. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @see {@link https://api.jquery.com/queue/#queue-queueName} + */ + queue(queueName?: string): any[]; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param newQueue An array of functions to replace the current queue contents. + * @see {@link https://api.jquery.com/queue/#queue-queueName-newQueue} + */ + queue(newQueue: Function[]): JQuery; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param callback The new function to add to the queue, with a function to call that will dequeue the next item. + * @see {@link https://api.jquery.com/queue/#queue-queueName-callback} + */ + queue(callback: Function): JQuery; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param newQueue An array of functions to replace the current queue contents. + * @see {@link https://api.jquery.com/queue/#queue-queueName-newQueue} + */ + queue(queueName: string, newQueue: Function[]): JQuery; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param callback The new function to add to the queue, with a function to call that will dequeue the next item. + * @see {@link https://api.jquery.com/queue/#queue-queueName-callback} + */ + queue(queueName: string, callback: Function): JQuery; +} +declare module "jquery" { + export = $; +} +declare var jQuery: JQueryStatic; +declare var $: JQueryStatic; diff --git a/src/LanBackup.WebApp/typings/globals/jquery/typings.json b/src/LanBackup.WebApp/typings/globals/jquery/typings.json new file mode 100644 index 0000000..85034d9 --- /dev/null +++ b/src/LanBackup.WebApp/typings/globals/jquery/typings.json @@ -0,0 +1,8 @@ +{ + "resolution": "main", + "tree": { + "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/e8761854cdadd8a71a91c228ad69bb0a20b7956e/jquery/index.d.ts", + "raw": "registry:dt/jquery#1.10.0+20170104155652", + "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/e8761854cdadd8a71a91c228ad69bb0a20b7956e/jquery/index.d.ts" + } +} diff --git a/src/LanBackup.WebApp/typings/index.d.ts b/src/LanBackup.WebApp/typings/index.d.ts new file mode 100644 index 0000000..b0eee22 --- /dev/null +++ b/src/LanBackup.WebApp/typings/index.d.ts @@ -0,0 +1 @@ +/// diff --git a/src/LanBackup.WebApp/web.config b/src/LanBackup.WebApp/web.config new file mode 100644 index 0000000..a8d6672 --- /dev/null +++ b/src/LanBackup.WebApp/web.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/src/LanBackup.WebApp/webpack.config.js b/src/LanBackup.WebApp/webpack.config.js new file mode 100644 index 0000000..5314288 --- /dev/null +++ b/src/LanBackup.WebApp/webpack.config.js @@ -0,0 +1,77 @@ +var isDevBuild = true;// process.argv.indexOf('--env.prod') < 0; +var path = require('path'); +var webpack = require('webpack'); +var merge = require('webpack-merge'); + +// Configuration in common to both client-side and server-side bundles +var sharedConfig = { + context: __dirname, + resolve: { extensions: [ '', '.js', '.ts' ] }, + output: { + filename: '[name].js', + publicPath: '/dist/' // Webpack dev middleware, if enabled, handles requests for this URL prefix + }, + module: { + loaders: [ + { test: /\.ts$/, include: /ClientApp/, loaders: ['ts-loader?silent=true', 'angular2-template-loader'] }, + { test: /\.html$/, loader: 'html-loader?minimize=false' }, + { + test: /\.css$/, + loader: 'to-string-loader!css-loader'//, + }, + //font awesome + { test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url-loader?limit=10000&minetype=application/font-woff" }, + { test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader" }, + // + { test: /\.(png|jpg|jpeg|gif|svg)$/, loader: 'url-loader', query: { limit: 25000 } }, + { test: /\.json$/, loader: 'json-loader' } + ] + } +}; + +// Configuration for client-side bundle suitable for running in browsers +var clientBundleOutputDir = './wwwroot/dist'; +var clientBundleConfig = merge(sharedConfig, { + entry: { 'main-client': './ClientApp/boot-client.ts' }, + output: { path: path.join(__dirname, clientBundleOutputDir) }, + plugins: [ + new webpack.DllReferencePlugin({ + context: __dirname, + manifest: require('./wwwroot/dist/vendor-manifest.json') + }) + ].concat(isDevBuild ? [ + // Plugins that apply in development builds only + new webpack.SourceMapDevToolPlugin({ + filename: '[file].map', // Remove this line if you prefer inline source maps + moduleFilenameTemplate: path.relative(clientBundleOutputDir, '[resourcePath]') // Point sourcemap entries to the original file locations on disk + }) + ] : [ + // Plugins that apply in production builds only + new webpack.optimize.OccurenceOrderPlugin(), + new webpack.optimize.UglifyJsPlugin() + ]), + devtool: 'source-map' +}); + +// Configuration for server-side (prerendering) bundle suitable for running in Node +var serverBundleConfig = merge(sharedConfig, { + resolve: { packageMains: ['main'] }, + entry: { 'main-server': './ClientApp/boot-server.ts' }, + plugins: [ + new webpack.DllReferencePlugin({ + context: __dirname, + manifest: require('./ClientApp/dist/vendor-manifest.json'), + sourceType: 'commonjs2', + name: './vendor' + }) + ], + output: { + libraryTarget: 'commonjs', + path: path.join(__dirname, './ClientApp/dist') + }, + target: 'node', + devtool: 'source-map' + //devtool: 'inline-source-map' +}); + +module.exports = [clientBundleConfig, serverBundleConfig]; diff --git a/src/LanBackup.WebApp/webpack.config.vendor.js b/src/LanBackup.WebApp/webpack.config.vendor.js new file mode 100644 index 0000000..a401f8d --- /dev/null +++ b/src/LanBackup.WebApp/webpack.config.vendor.js @@ -0,0 +1,91 @@ +var isDevBuild = process.argv.indexOf('--env.prod') < 0; +var path = require('path'); +var webpack = require('webpack'); +var ExtractTextPlugin = require('extract-text-webpack-plugin'); +var merge = require('webpack-merge'); +var extractCSS = new ExtractTextPlugin('vendor.css'); + +var sharedConfig = { + resolve: { extensions: [ '', '.js' ] }, + module: { + loaders: [ + { test: /\.json$/, loader: require.resolve('json-loader') }, + { test: /\.(png|woff|woff2|eot|ttf|svg)(\?|$)/, loader: 'url-loader?limit=100000' } + ] + }, + entry: { + vendor: [ + '@angular/common', + '@angular/compiler', + '@angular/core', + '@angular/http', + '@angular/platform-browser', + '@angular/platform-browser-dynamic', + '@angular/router', + '@angular/platform-server', + 'angular2-universal', + 'angular2-universal-polyfills', + 'bootstrap', + 'bootstrap/dist/css/bootstrap.css', + 'font-awesome/css/font-awesome.css', + 'es6-shim', + 'es6-promise', + 'event-source-polyfill', + 'jquery', + 'zone.js', + 'ng2-toasty', + 'ng2-appinsights' + ] + }, + output: { + publicPath: '/dist/', + filename: '[name].js', + library: '[name]_[hash]' + }, + plugins: [ + new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' }), // Maps these identifiers to the jQuery package (because Bootstrap expects it to be a global variable) + new webpack.ContextReplacementPlugin(/\@angular\b.*\b(bundles|linker)/, path.join(__dirname, './ClientApp')), // Workaround for https://github.com/angular/angular/issues/11580 + new webpack.IgnorePlugin(/^vertx$/), // Workaround for https://github.com/stefanpenner/es6-promise/issues/100 + new webpack.NormalModuleReplacementPlugin(/\/iconv-loader$/, require.resolve('node-noop')), // Workaround for https://github.com/andris9/encoding/issues/16 + ] +}; + +var clientBundleConfig = merge(sharedConfig, { + output: { path: path.join(__dirname, 'wwwroot', 'dist') }, + module: { + loaders: [ + { test: /\.css(\?|$)/, loader: extractCSS.extract(['css-loader']) } + ] + }, + plugins: [ + extractCSS, + new webpack.DllPlugin({ + path: path.join(__dirname, 'wwwroot', 'dist', '[name]-manifest.json'), + name: '[name]_[hash]' + }) + ].concat(isDevBuild ? [] : [ + new webpack.optimize.OccurenceOrderPlugin(), + new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }) + ]) +}); + +var serverBundleConfig = merge(sharedConfig, { + target: 'node', + resolve: { packageMains: ['main'] }, + output: { + path: path.join(__dirname, 'ClientApp', 'dist'), + libraryTarget: 'commonjs2', + }, + module: { + loaders: [ { test: /\.css(\?|$)/, loader: 'to-string-loader!css-loader' } ] + }, + entry: { vendor: ['aspnet-prerendering'] }, + plugins: [ + new webpack.DllPlugin({ + path: path.join(__dirname, 'ClientApp', 'dist', '[name]-manifest.json'), + name: '[name]_[hash]' + }) + ] +}); + +module.exports = [clientBundleConfig, serverBundleConfig]; diff --git a/src/LanBackup.WebApp/wwwroot/android-icon-144x144.png b/src/LanBackup.WebApp/wwwroot/android-icon-144x144.png new file mode 100644 index 0000000..6375071 Binary files /dev/null and b/src/LanBackup.WebApp/wwwroot/android-icon-144x144.png differ diff --git a/src/LanBackup.WebApp/wwwroot/android-icon-192x192.png b/src/LanBackup.WebApp/wwwroot/android-icon-192x192.png new file mode 100644 index 0000000..e36bd37 Binary files /dev/null and b/src/LanBackup.WebApp/wwwroot/android-icon-192x192.png differ diff --git a/src/LanBackup.WebApp/wwwroot/android-icon-36x36.png b/src/LanBackup.WebApp/wwwroot/android-icon-36x36.png new file mode 100644 index 0000000..26adb4a Binary files /dev/null and b/src/LanBackup.WebApp/wwwroot/android-icon-36x36.png differ diff --git a/src/LanBackup.WebApp/wwwroot/android-icon-48x48.png b/src/LanBackup.WebApp/wwwroot/android-icon-48x48.png new file mode 100644 index 0000000..91af4d0 Binary files /dev/null and b/src/LanBackup.WebApp/wwwroot/android-icon-48x48.png differ diff --git a/src/LanBackup.WebApp/wwwroot/android-icon-72x72.png b/src/LanBackup.WebApp/wwwroot/android-icon-72x72.png new file mode 100644 index 0000000..4e836e8 Binary files /dev/null and b/src/LanBackup.WebApp/wwwroot/android-icon-72x72.png differ diff --git a/src/LanBackup.WebApp/wwwroot/android-icon-96x96.png b/src/LanBackup.WebApp/wwwroot/android-icon-96x96.png new file mode 100644 index 0000000..e11d96b Binary files /dev/null and b/src/LanBackup.WebApp/wwwroot/android-icon-96x96.png differ diff --git a/src/LanBackup.WebApp/wwwroot/dist/_placeholder.txt b/src/LanBackup.WebApp/wwwroot/dist/_placeholder.txt new file mode 100644 index 0000000..b22cc15 --- /dev/null +++ b/src/LanBackup.WebApp/wwwroot/dist/_placeholder.txt @@ -0,0 +1,9 @@ +------------------------------------------------------------------ +Don't delete this file. Do include it in your source control repo. +------------------------------------------------------------------ + +This file exists as a workaround for https://github.com/dotnet/cli/issues/1396 +('dotnet publish' does not publish any directories that didn't exist or were +empty before the publish script started). + +Hopefully, this can be removed after the move to the new MSBuild. diff --git a/src/LanBackup.WebApp/wwwroot/favicon.ico b/src/LanBackup.WebApp/wwwroot/favicon.ico new file mode 100644 index 0000000..fc8ac4a Binary files /dev/null and b/src/LanBackup.WebApp/wwwroot/favicon.ico differ diff --git a/src/LanBackup.WebApp/wwwroot/manifest.json b/src/LanBackup.WebApp/wwwroot/manifest.json new file mode 100644 index 0000000..1eca9d5 --- /dev/null +++ b/src/LanBackup.WebApp/wwwroot/manifest.json @@ -0,0 +1,41 @@ +{ + "name": "LanBackup", + "icons": [ + { + "src": "\/android-icon-36x36.png", + "sizes": "36x36", + "type": "image\/png", + "density": "0.75" + }, + { + "src": "\/android-icon-48x48.png", + "sizes": "48x48", + "type": "image\/png", + "density": "1.0" + }, + { + "src": "\/android-icon-72x72.png", + "sizes": "72x72", + "type": "image\/png", + "density": "1.5" + }, + { + "src": "\/android-icon-96x96.png", + "sizes": "96x96", + "type": "image\/png", + "density": "2.0" + }, + { + "src": "\/android-icon-144x144.png", + "sizes": "144x144", + "type": "image\/png", + "density": "3.0" + }, + { + "src": "\/android-icon-192x192.png", + "sizes": "192x192", + "type": "image\/png", + "density": "4.0" + } + ] +} \ No newline at end of file diff --git a/src/LanBackupAgent/App.config b/src/LanBackupAgent/App.config new file mode 100644 index 0000000..1244ed3 --- /dev/null +++ b/src/LanBackupAgent/App.config @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/LanBackupAgent/Controllers/BackgroundRefreshController.cs b/src/LanBackupAgent/Controllers/BackgroundRefreshController.cs new file mode 100644 index 0000000..c86411b --- /dev/null +++ b/src/LanBackupAgent/Controllers/BackgroundRefreshController.cs @@ -0,0 +1,198 @@ +using Hangfire; +using Hangfire.SQLite; +using LanBackupAgent.WebApi; +using NLog; +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using System.Timers; +using TinyMessenger; +using LanBackupAgent.Models; +using LanBackupAgent.Message; + +namespace LanBackupAgent.Utils +{ + public class BackgroundRefreshController : IDisposable + { + + private ILogger logger; + private ITinyMessengerHub messenger; + private WebApiService webapi; + + public const int WEBAPI_REFRESH_BACKUPS_TIME = 120000; //miliseconds for backups refresh from webapi + + + #region WebApi + private System.Timers.Timer timerRefreshFromWebApi = new System.Timers.Timer(); + #endregion + + #region Hangfire + private BackgroundJobServer hangfireServer; + #endregion + + + + public BackgroundRefreshController( + ILogger mlogger, + ITinyMessengerHub mmessenger, + WebApiService mwebapi + ) + { + this.logger = mlogger; + this.messenger = mmessenger; + this.webapi = mwebapi; + + this.messenger.Subscribe(Stop); + logger.Trace("BackgroundRefreshController instance initialized"); + } + + internal void Start() + { + ConfigureHangfire(); + ConfigureRefresWebApiTimer(); + } + + private void ConfigureHangfire() + { + string file = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "local_backups.db3"); + string sqlconn = $"Data Source={file};Version=3;"; + + GlobalConfiguration.Configuration.UseSQLiteStorage(sqlconn); + + var options = new BackgroundJobServerOptions + { + // This is the default value + SchedulePollingInterval = TimeSpan.FromSeconds(5), + WorkerCount = 1// FORCE ONE BACKUP at one time - so they will be performed serial one by one + }; + hangfireServer = new BackgroundJobServer(options); + + JobStorage.Current?.GetMonitoringApi()?.PurgeJobs(); + TimerRefreshFromWebApi_Elapsed(null, null); + } + + private void ConfigureRefresWebApiTimer() + { + //start retry timer for WebAPi refresh + timerRefreshFromWebApi = new System.Timers.Timer(); + timerRefreshFromWebApi.Interval = WEBAPI_REFRESH_BACKUPS_TIME; + timerRefreshFromWebApi.Elapsed += TimerRefreshFromWebApi_Elapsed; ; + timerRefreshFromWebApi.Start(); + + logger.Trace("WebApi timer configured"); + } + + private async void TimerRefreshFromWebApi_Elapsed(object sender, ElapsedEventArgs e) + { + try + { + logger.Trace(string.Format("WebApi refresh at {0}", DateTime.Now.ToString("o"))); + + List activeJobs = new List(); + var result = await webapi.LoadBackupConfigurations(); + if (result != null) + { + foreach (var item in result) + { + try + { + string jobId = $"{item.Id}";// _{Convert.ToBase64String(item.RowVersion)}"; + if (item.IsActive.Value) + { + //RecurringJob. + var recJob = JobStorage.Current.GetMonitoringApi().JobDetails(jobId); + //RecurringJob.AddOrUpdate(jobId, () => LanCopyFileJob(item), item.Crontab); + if (recJob == null) + { + RecurringJob.AddOrUpdate(jobId, () => DoCopyJob(item), item.Crontab); + } + activeJobs.Add(jobId); + RecurringJob.Trigger(jobId); + } + else + { + //stopping inactive + var recJob = JobStorage.Current.GetMonitoringApi().JobDetails(jobId); + if (recJob != null) + { + RecurringJob.RemoveIfExists(jobId); + } + } + } + catch (Exception ex) + { + logger.Error($"Reccuring jobs refresh failed: {ex}"); + //report error to webAPI + webapi.LogActivity(item.Id, $"Reccuring jobs refresh failed -({item.Id})- see Err", ex.Message, "ERR"); + } + } + } + //TODO - purge ofphan jobs + //JobStorage.Current.GetMonitoringApi().PurgeOrfanJobsExceptList(activeJobs); + } + catch (Exception ex) + { + logger.Error($"ERR WebApi refresh: {ex}"); + //report error to webAPI + webapi.LogActivity(string.Empty, "Reccuring jobs refresh final failed - see Err", ex.Message, "ERR"); + } + } + + + //MUST BE STATIC so it can be called from Hangfire + public static string DoCopyJob(BackupConfiguration item) + { + string result = string.Empty; + try + { + result = DI.Container.GetInstance().StartLanCopyFileJob(item); + } + catch (Exception ex) + { + var logger = DI.Container.GetInstance(); + logger.Error(ex, "DoCopyJoberror:"); + } + return result; + } + + public void Stop(StopMessage msg) + { + //cleanup disposable resources + if (timerRefreshFromWebApi != null) + { + timerRefreshFromWebApi.Stop(); + timerRefreshFromWebApi.Dispose(); + } + if (hangfireServer != null) + { + hangfireServer.SendStop(); + hangfireServer.Dispose(); + } + logger.Trace("LanCopyController Stopped"); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + + + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (timerRefreshFromWebApi != null) + { + timerRefreshFromWebApi.Dispose(); + } + if (hangfireServer != null) + { + hangfireServer.Dispose(); + } + } + } + } +} diff --git a/src/LanBackupAgent/Controllers/LanCopyController.cs b/src/LanBackupAgent/Controllers/LanCopyController.cs new file mode 100644 index 0000000..4a6275e --- /dev/null +++ b/src/LanBackupAgent/Controllers/LanCopyController.cs @@ -0,0 +1,437 @@ +using System; +using LanBackupAgent.Models; +using NLog; +using LanBackupAgent.WebApi; +using TinyMessenger; +using System.Collections.Concurrent; +using System.Threading; +using System.IO; +using System.Security.Principal; +using SimpleImpersonation; +using LanBackupAgent.Message; +using LanBackup.Models; +using System.Linq; +using LanBackupAgent.Controllers; + +namespace LanBackupAgent.Utils +{ + public class LanCopyController + { + + private ILogger logger; + private ITinyMessengerHub messenger; + private WebApiService webapi; + private Exception externalError; + private Network networkUtil; + + + /// + /// used to signal a forced exception + /// + private bool forceExceptionalStop; + + + /// + /// used to queue and sync copy jobs between threads + /// + ConcurrentQueue myCollection; + + /// + /// maximum items in the copy queue - must test to find the best value + /// + const int queueTHRESHOLD = 30; + + /// + /// buffer size for copy operations - must test to find the best value + /// + const int bufferSize = 5*65536; + + + + private long dirCount = 0; long fileCount = 0; + + + + public LanCopyController( + ILogger mlogger, + ITinyMessengerHub mmessenger, + WebApiService mwebapi, + Network networkUtil + ) + { + this.logger = mlogger; + this.messenger = mmessenger; + this.webapi = mwebapi; + this.networkUtil = networkUtil; + + this.messenger.Subscribe(Stop); + logger.Trace("LanCopyController instance initialized"); + } + + public string StartLanCopyFileJob(BackupConfiguration item) + { + string jobId = $"{item.Id}";// _{Convert.ToBase64String(item.RowVersion)}"; + Exception localEx = null; + try + { + var msg = $"({item.Id}) - START"; + logger.Debug(msg); + webapi.LogActivity(item.Id, msg, string.Empty, "OK"); + ReportAgentStatus(StatusType.Starting, $"Starting copy operation - ({item.Id})", 0, item.Id); + + if (item.SrcUser.IndexOf(@"@") < 0) + throw new ArgumentException("Source user must be in format john@computer"); + if (item.DestUser.IndexOf(@"@") < 0) + throw new ArgumentException("Destination user must be in format john@computer"); + + + string domainSrc = item.SrcUser.Substring(item.SrcUser.IndexOf(@"@") + 1); + string usernameSrc = item.SrcUser.Substring(0, item.SrcUser.IndexOf(@"@")); + string domainDest = item.DestUser.Substring(item.DestUser.IndexOf(@"@") + 1); + string usernameDest = item.DestUser.Substring(0, item.DestUser.IndexOf(@"@")); + + Exception outEx; + if (!CopyFolderAndFilesWithImpersonation(item.Id, item.SrcFolder, domainSrc, usernameSrc, item.SrcPass, + item.DestLanFolder, domainDest, usernameDest, item.DestPass, out outEx)) + { + if (outEx != null) + { + localEx = outEx; + logger.Error($"CopyFolderAndFilesWithImpersonation ERR : {outEx}"); + ReportAgentStatus(StatusType.Error, "Error... " + outEx.Message, 100); + } + } + else + { + ReportAgentStatus(StatusType.Idle, $"Finished - ({item.Id})...", 100); + } + } + catch (Exception ex) + { + localEx = ex; + logger.Error($"Background job ERR : {ex}"); + ReportAgentStatus(StatusType.Error, $"Error - ({item.Id}) - " + ex.Message, 0); + } + finally + { + var msg = $"({item.Id}) - END"; + logger.Debug(msg); + webapi.LogActivity(item.Id, msg, localEx != null ? localEx.Message : string.Empty, localEx != null ? "ERR" : "OK"); + } + + + return jobId; + } + + private void ReportAgentStatus(StatusType type, string desc, int percent, string configId = "") + { + var obj = new StatusReport("", new StatusReportInfo() + { + IP = networkUtil.GetLocalIPAddress(), + ConfigurationId = configId, + StatusType = type, + StatusDateTime = DateTime.UtcNow, + StatusPercent = percent, + StatusDescription = desc + }); + ThreadPool.QueueUserWorkItem((msg) => { + this.messenger.Publish(msg as StatusReport); + }, obj); + } + + + + + + + /// + /// Copy the source folder content into a destination folder + /// + /// source folder + /// destination folder + /// true if success + private bool CopyFolderAndFilesWithImpersonation(string configID, string srcPath, string domainSrc, string userSrc, string passSrc, + string destPath, string domainDest, string userDest, string passDest, out Exception outEx) + { + outEx = null; + myCollection = new ConcurrentQueue(); + + byte[] buffer = new byte[bufferSize]; + bool finished = false; + Exception srcError = null; + Exception destError = null; + Thread thSource = new Thread(() => + { + try + { + //FileLogging.Log($"begin thSrc.", LogLevel.Info); + using (Impersonation.LogonUser(domainSrc, userSrc, passSrc, LogonType.Network))//LogonType.Interactive + { + WindowsIdentity wid_current = WindowsIdentity.GetCurrent(); + //FileLogging.Log($"impersonated thSrc. {wid_current.Name}", LogLevel.Info); + //scan all of the directories + var lstDirectories = Directory.GetDirectories(srcPath, "*", SearchOption.AllDirectories); + dirCount = lstDirectories.LongCount(); + foreach (string dirPath in lstDirectories) + { + CopyOperation coFolder = new CopyOperation + { + Operation = OperationType.WriteFolder, + Argument = dirPath.Replace(srcPath, string.Empty) + }; + FillQueue(myCollection, queueTHRESHOLD, destError, coFolder); + if (forceExceptionalStop) + return; + //FileLogging.Log($"q-d: {coFolder.Argument}", LogLevel.Info); + } + //scan all files + var lstFiles = Directory.GetFiles(srcPath, "*.*", SearchOption.AllDirectories); + fileCount = lstFiles.LongCount(); + foreach (string newPath in lstFiles) + { + using (FileStream fs = File.Open(newPath, FileMode.Open, FileAccess.Read, FileShare.Delete | FileShare.Read)) + { + int readB; + long offset = 0; + while ((readB = fs.Read(buffer, 0, bufferSize)) > 0) + { + CopyOperation coFile = new CopyOperation + { + Operation = OperationType.WriteFile, + Argument = newPath.Replace(srcPath, string.Empty), + Offset = offset, + Content = buffer.SubArray(0, readB) + }; + FillQueue(myCollection, queueTHRESHOLD, destError, coFile); + if (forceExceptionalStop) + return; + //FileLogging.Log($"q-f: {coFile.Argument} - {coFile.Offset}", LogLevel.Info); + offset += readB; + } + } + } + //YEY! + finished = true; + + //wic.Undo(); + } + } + catch (Exception err) + { + srcError = err; + forceExceptionalStop = true; + finished = true; + } + }); + + + Thread thDest = new Thread(() => + { + try + { + //FileLogging.Log($"begin thDest.", LogLevel.Info); + Thread.Sleep(200); + + long dirIndex = 0, fileIndex = 0; + string lastFile = string.Empty; + DateTime lastSent = DateTime.MinValue; + int copyPercent; + using (Impersonation.LogonUser(domainDest, userDest, passDest, LogonType.NewCredentials))//LogonType.NewCredentials + { + WindowsIdentity wid_current = WindowsIdentity.GetCurrent(); + //FileLogging.Log($"impersonated thDest. {wid_current.Name}", LogLevel.Info); + while (!finished || myCollection.Count > 0) + { + while (myCollection.Count == 0 && !forceExceptionalStop) + { + Thread.Sleep(100); + } + if (forceExceptionalStop) + return; + + CopyOperation item = null; + if (myCollection.TryDequeue(out item)) + { + switch (item.Operation) + { + case OperationType.WriteFolder: + string newFolder = UncCombine(destPath, item.Argument); + Directory.CreateDirectory(newFolder); + dirIndex++; + break; + case OperationType.WriteFile: + string destFile = UncCombine(destPath, item.Argument); + using (var fs = ((item.Offset == 0) && File.Exists(destFile)) ? File.Create(destFile) : File.OpenWrite(destFile)) + { + fs.Seek(item.Offset, SeekOrigin.Begin); + fs.Write(item.Content, 0, item.Content.Length); + } + if (destFile != lastFile) + { + fileIndex++; + lastFile = destFile; + } + break; + default: + break; + } + //update report status + DateTime now = DateTime.UtcNow; + if ( now > lastSent) + { + copyPercent = Convert.ToInt32( 20 * (dirCount > 0 ? (double)dirIndex / dirCount : 1) + 80 * (fileCount > 0 ? (double)fileIndex / fileCount : 1) ); + lastSent = now + TimeSpan.FromMilliseconds(SignalRController.SIGNALR_REFRESH_INTERVAL); + ReportAgentStatus(item.Operation == OperationType.WriteFolder ? StatusType.CopyFolders : StatusType.CopyFiles, + item.Operation == OperationType.WriteFolder ? $"Copy folders in progress {dirIndex}/{dirCount} ..." : $"Copy files in progress {fileIndex}/{fileCount} ..." + , copyPercent, configID); + } + } + else + { + throw new ArgumentException("Could not extract item from queue"); + } + } + + } + } + catch (Exception err) + { + destError = err; + forceExceptionalStop = true; + } + }); + + //clear exception + forceExceptionalStop = false; + + thDest.Start(); + thSource.Start(); + + //wait to complete or fail + thSource.Join(); + thDest.Join(); + + + myCollection = new ConcurrentQueue(); + + + if (srcError != null) + { + outEx = srcError; + logger.Error($"srcErr: {srcError}"); + return false; + } + if (destError != null) + { + outEx = destError; + logger.Error($"destErr: {destError}"); + return false; + } + if (externalError != null) + { + outEx = externalError; + logger.Debug($"externalError: {destError}"); + return false; + } + + + logger.Error($"LAN Copy completed!"); + + return true; + } + + + + /// + /// helper function for adding items in the copy queue + /// + /// + /// + /// + /// + private void FillQueue(ConcurrentQueue myCollection, int queueTHRESHOLD, Exception destError, CopyOperation coFolder) + { + if (destError != null) + throw new ArgumentException("Thread Copy Destination has failed", destError); + + while (myCollection.Count > queueTHRESHOLD) + { + if (forceExceptionalStop) + return; + + Thread.Sleep(100); + } + + myCollection.Enqueue(coFolder); + } + + + /// + /// Helper function to combine Unc paths + /// + /// + /// + /// + private string UncCombine(string startPath, string endPath) + { + while (startPath.EndsWith(@"\")) + startPath = startPath.Substring(0, startPath.Length - 1); + while (endPath.StartsWith(@"\")) + endPath = endPath.Substring(1); + return startPath + @"\" + endPath; + } + + + + + private void Stop(StopMessage obj) + { + //signal stop + externalError = new ApplicationException("Stop processing invoked by the service"); + forceExceptionalStop = true; + //cleanup disposable resources + + } + + } + + + + + + + + + + /// + /// helper class used in quing and sync copy operation between threads + /// + internal class CopyOperation + { + /// + /// Operation type - can be either Write Folder or Write File + /// + public OperationType Operation { get; internal set; } + + /// + /// partial folder or file path + /// + public string Argument { get; internal set; } + public byte[] Content { get; internal set; } + public long Offset { get; internal set; } + + } + + /// + /// helper enumeration for copy operation type + /// + internal enum OperationType + { + WriteFolder, + WriteFile + } + + + + +} diff --git a/src/LanBackupAgent/Controllers/SignalRController.cs b/src/LanBackupAgent/Controllers/SignalRController.cs new file mode 100644 index 0000000..aa2d5a2 --- /dev/null +++ b/src/LanBackupAgent/Controllers/SignalRController.cs @@ -0,0 +1,293 @@ +using LanBackup.Models; +using LanBackupAgent.Message; +using LanBackupAgent.Utils; +using Microsoft.AspNet.SignalR.Client; +using Newtonsoft.Json; +using NLog; +using System; +using System.Configuration; +using System.Net; +using System.Net.Http; +using System.Net.WebSockets; +using System.Threading; +using System.Threading.Tasks; +using System.Timers; +using TinyMessenger; + +namespace LanBackupAgent.Controllers +{ + public class SignalRController : IDisposable + { + + //TODO - move these in config file + const string SIGNALR_HUBNAME = "backupslan"; + public const int SIGNALR_REFRESH_INTERVAL = 1500; + public const int SIGNALR_REFRESH_INTERVAL_IDLE = 10000; //used for retry and ping (when idle) + + + private ILogger logger; + private ITinyMessengerHub messenger; + private string webapiUrlBase; + private Network networkUtil; + private bool isWorkInProgress; + + #region SignalR Hub + HubConnection connSignalR; + private DateTime connSignalrClosedOn; + IHubProxy hubSignalr; + private System.Timers.Timer timerRetryPingSignalR = new System.Timers.Timer(); + #endregion + + + public SignalRController( + string mwebapiUrlBase, + ILogger mlogger, + ITinyMessengerHub mmessenger, + Network networkUtil + ) + { + this.webapiUrlBase = mwebapiUrlBase; + this.logger = mlogger; + this.messenger = mmessenger; + this.networkUtil = networkUtil; + this.messenger.Subscribe(DoStop); + this.messenger.Subscribe(DoStatus); + logger.Trace("SignalRController instance initialized"); + } + + public async Task Start() + { + logger.Trace("SignalRController Starting"); + await ConfigureSignalR(); + ConfigureTimers(); + logger.Trace("SignalRController Started"); + return true; + } + + private async Task ConfigureSignalR() + { + string webApiUrl = ConfigurationManager.AppSettings["webApiUrl"]; + string hubAddress = webApiUrl + "/signalr"; + logger.Trace($"Starting SignalR Client on: {hubAddress}"); + connSignalR = new HubConnection(hubAddress, useDefaultUrl: false); + connSignalR.Error += (err) => + { + if (err is WebSocketException) + { + return; + } + logger.Error($"Err: {err}"); + }; + connSignalR.Closed += () => + { + logger.Info($"Connection closed."); + connSignalrClosedOn = DateTime.Now; + }; + connSignalR.ConnectionSlow += () => + { + //TODO - log the issue + }; + connSignalR.Reconnected += () => + { + //TODO - check for overdue/due backups on the server + }; + + hubSignalr = connSignalR.CreateHubProxy(SIGNALR_HUBNAME); + hubSignalr.On("controlAgent", data => //Waiting control signal from server signalr + { + logger.Trace($"controlAgent data: {data}"); + //scheduler + ThreadPool.QueueUserWorkItem((par) => + { + try + { + DateTime recDate = (DateTime)par; + //TODO - something to do by the server command + } + catch (Exception ex) + { + logger.Error($"ERR scheduler: {ex}"); + } + }, DateTime.Now); + }); + + await TryStartSignalR(); + } + + + + + #region Timer for retry + + private void ConfigureTimers() + { + //start retry timer for SignalR + timerRetryPingSignalR.Interval = SIGNALR_REFRESH_INTERVAL_IDLE; + timerRetryPingSignalR.Elapsed += TimerRetryPingSignalR_Elapsed; + timerRetryPingSignalR.Start(); + + logger.Trace("Timers configured"); + } + + + private async void TimerRetryPingSignalR_Elapsed(object sender, ElapsedEventArgs e) + { + try + { + if (connSignalR != null) + { + //retry + if (connSignalR.State == ConnectionState.Disconnected) + { + if((DateTime.Now - connSignalrClosedOn).TotalSeconds > 5) //retry after 5 seconds + await TryStartSignalR(); + } + else if (connSignalR.State == ConnectionState.Connected) + { + //send ping signal when IDLE + if(!isWorkInProgress) + { + // IDLE ping signalr - i'm online! + ReadyIdlePing(); + } + } + } + } + catch (Exception ex) + { + logger.Error($"ERR TimerRetrySignalR: {ex}"); + } + } + + + /// + /// signal thet agent is online + /// + private void ReadyIdlePing() + { + this.messenger.Publish(new StatusReport("", new StatusReportInfo() + { + IP = networkUtil.GetLocalIPAddress(), + ConfigurationId = string.Empty, + StatusType = StatusType.Idle, + StatusDateTime = DateTime.UtcNow, + StatusPercent = 0, + StatusDescription = $"Ready ..." + })); + } + + public async Task TryStartSignalR() + { + try + { + logger.Info($"Trying ro connect ..."); + await connSignalR.Start(); + // hello to signalr - i'm online! + ReadyIdlePing(); + } + catch (HttpRequestException hex) + { + if (hex.InnerException is WebException) + { + WebException wex = hex.InnerException as WebException; + if (wex.Status == WebExceptionStatus.ConnectFailure) + { + //ignore this err + } + else + { + logger.Error($"ERR WebException HResult: {wex.HResult}"); + logger.Error($"ERR WebException Status: {wex.Status}"); + logger.Error($"ERR WebException Message: {wex.Message}"); + } + } + } + catch (Exception ex) + { + logger.Error($"ERR Start SignalR: {ex}"); + } + } + + #endregion Timer for retry + + + + #region SignalR actions + private void DoStop(StopMessage obj) + { + //cleanup disposable resources + if (timerRetryPingSignalR != null) + { + timerRetryPingSignalR.Stop(); + timerRetryPingSignalR.Dispose(); + } + if (connSignalR != null) + { + connSignalR.Stop(); + connSignalR.Dispose(); + } + + logger.Trace("SignalRController Stopped"); + } + + + private void DoStatus(StatusReport obj) + { + try + { + this.isWorkInProgress = (obj.Info.StatusType != StatusType.Idle); + + if (connSignalR != null) + { + logger.Warn($"DoStatus {JsonConvert.SerializeObject(obj)}"); + if (connSignalR != null && connSignalR.State == ConnectionState.Connected) + { + hubSignalr.Invoke("StatusReport", obj.Info); + } + else + { + //connection not open + } + }else + { + logger.Warn($"Warn SignalR DoStatus: connection null"); + } + } + catch (Exception ex) + { + logger.Error($"ERR SignalR DoStatus: {ex}"); + } + + } + + #endregion SignalR actions + + + + #region IDisposable + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (timerRetryPingSignalR != null) + { + timerRetryPingSignalR.Dispose(); + } + if (connSignalR != null) + { + connSignalR.Dispose(); + } + } + } + + #endregion IDisposable + + } +} diff --git a/src/LanBackupAgent/GlobalSuppressions.cs b/src/LanBackupAgent/GlobalSuppressions.cs new file mode 100644 index 0000000..8c7bc97 Binary files /dev/null and b/src/LanBackupAgent/GlobalSuppressions.cs differ diff --git a/src/LanBackupAgent/LanBackupAgent.csproj b/src/LanBackupAgent/LanBackupAgent.csproj new file mode 100644 index 0000000..74cda96 --- /dev/null +++ b/src/LanBackupAgent/LanBackupAgent.csproj @@ -0,0 +1,202 @@ + + + + + Debug + AnyCPU + {CB7EE867-93E8-43E3-9EEE-9068AED1DE6C} + Exe + Properties + LanBackupAgent + LanBackupAgent + v4.6.2 + 512 + true + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + app_icon.png.ico + + + + ..\..\packages\ColoredConsole.0.5.0\lib\net45\ColoredConsole.dll + True + + + ..\..\packages\Dapper.1.42\lib\net45\Dapper.dll + True + + + ..\..\packages\Hangfire.Core.1.6.8\lib\net45\Hangfire.Core.dll + True + + + ..\..\packages\Hangfire.SQLite.1.1.1.0\lib\net45\Hangfire.SQLite.dll + True + + + ..\..\packages\Microsoft.AspNet.SignalR.Client.2.2.1\lib\net45\Microsoft.AspNet.SignalR.Client.dll + True + + + ..\..\packages\Microsoft.Rest.ClientRuntime.2.3.4\lib\net45\Microsoft.Rest.ClientRuntime.dll + True + + + ..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll + True + + + ..\..\packages\NLog.4.4.1\lib\net45\NLog.dll + True + + + ..\..\packages\Owin.1.0\lib\net40\Owin.dll + True + + + ..\..\packages\SimpleImpersonation.2.0.1\lib\net40-Client\SimpleImpersonation.dll + True + + + ..\..\packages\SimpleInjector.3.3.2\lib\net45\SimpleInjector.dll + True + + + + + + ..\..\packages\System.Data.SQLite.Core.1.0.104.0\lib\net46\System.Data.SQLite.dll + True + + + + + + + + + + + + ..\..\packages\Topshelf.4.0.3\lib\net452\Topshelf.dll + True + + + ..\..\packages\Topshelf.NLog.4.0.3\lib\net452\Topshelf.NLog.dll + True + + + + + Models\StatusReportInfo.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + nlog.config + + + nlog.config + + + Designer + + + + + + False + .NET Framework 3.5 SP1 + false + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + + \ No newline at end of file diff --git a/src/LanBackupAgent/LanBackupAgentService.cs b/src/LanBackupAgent/LanBackupAgentService.cs new file mode 100644 index 0000000..d7cc249 --- /dev/null +++ b/src/LanBackupAgent/LanBackupAgentService.cs @@ -0,0 +1,51 @@ +using LanBackupAgent.Controllers; +using LanBackupAgent.Message; +using LanBackupAgent.Utils; +using Microsoft.AspNet.SignalR.Client; +using NLog; +using System; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using System.Timers; +using TinyMessenger; + +namespace LanBackupAgent +{ + public class LanBackupAgentService + { + + private ILogger logger; + ITinyMessengerHub messenger; + + + public LanBackupAgentService(ILogger mlogger, ITinyMessengerHub mmessenger) + { + this.logger = mlogger; + this.messenger = mmessenger; + } + + public async Task Start() + { + logger.Info("Started"); + + //START LOGIC + DI.Container.GetInstance().Start(); + await DI.Container.GetInstance().Start(); + + return true; + } + + + + + public bool Stop() + { + //STOP LOGIC + logger.Info("Stopping signal received ..."); + messenger.Publish(new StopMessage("STOP")); + + return true; + } + } +} diff --git a/src/LanBackupAgent/LanBackups API/ILanBackupsAPI.cs b/src/LanBackupAgent/LanBackups API/ILanBackupsAPI.cs new file mode 100644 index 0000000..b1d3b56 --- /dev/null +++ b/src/LanBackupAgent/LanBackups API/ILanBackupsAPI.cs @@ -0,0 +1,243 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace LanBackupAgent +{ + using System; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using Newtonsoft.Json; + using Microsoft.Rest; + using Models; + + /// + /// ASP.NET Core Web API for LAN Backup service + /// + public partial interface ILanBackupsAPI : IDisposable + { + /// + /// The base URI of the service. + /// + Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Subscription credentials which uniquely identify client + /// subscription. + /// + ServiceClientCredentials Credentials { get; } + + + /// + /// retrieve all backup configurations + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> ApiBackupConfigGetWithHttpMessagesAsync(string idx = default(string), string siz = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// create backup configuration + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> ApiBackupConfigPostWithHttpMessagesAsync(BackupConfiguration backup = default(BackupConfiguration), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// retrieve backup configuration by ID + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> ApiBackupConfigByIdGetWithHttpMessagesAsync(string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Update backup configuration + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> ApiBackupConfigByIdPutWithHttpMessagesAsync(string id, BackupConfiguration backup = default(BackupConfiguration), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// delete backup configuration by id + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> ApiBackupConfigByIdDeleteWithHttpMessagesAsync(string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// retrieve backup configuration by ID + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ApiBackupConfigClientByClientidGetWithHttpMessagesAsync(string clientid, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// retrieves paginated logs from DB + /// + /// + /// page index + /// + /// + /// page size + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> ApiLogsGetWithHttpMessagesAsync(string idx = default(string), string siz = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Create an entry in the logs + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> ApiLogsPostWithHttpMessagesAsync(BackupLog log = default(BackupLog), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// retrieves alog record by ID + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> ApiLogsByIdGetWithHttpMessagesAsync(int id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// retrieve all logs of a clientIP + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ApiLogsClientByClientidGetWithHttpMessagesAsync(string clientid, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// retrieves all logs of a specific configuration + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ApiLogsConfigByConfigurationidGetWithHttpMessagesAsync(string configurationid, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> ApiUsersRegisterPostWithHttpMessagesAsync(User dtouser = default(User), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task ApiUsersLoginPostWithHttpMessagesAsync(User dtouser = default(User), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task ApiUsersPwchangePostWithHttpMessagesAsync(User dtouser = default(User), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task ApiUsersListGetWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task ApiUsersListPostWithHttpMessagesAsync(User user = default(User), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + } +} diff --git a/src/LanBackupAgent/LanBackups API/LanBackupsAPI.cs b/src/LanBackupAgent/LanBackups API/LanBackupsAPI.cs new file mode 100644 index 0000000..c601d6c --- /dev/null +++ b/src/LanBackupAgent/LanBackups API/LanBackupsAPI.cs @@ -0,0 +1,2339 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace LanBackupAgent +{ + using System; + using System.Linq; + using System.Collections.Generic; + using System.Diagnostics; + using System.Net; + using System.Net.Http; + using System.Net.Http.Headers; + using System.Text; + using System.Text.RegularExpressions; + using System.Threading; + using System.Threading.Tasks; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using Models; + + /// + /// ASP.NET Core Web API for LAN Backup service + /// + public partial class LanBackupsAPI : ServiceClient, ILanBackupsAPI + { + /// + /// The base URI of the service. + /// + public Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + public JsonSerializerSettings SerializationSettings { get; private set; } + + internal Task> ApiBackupConfigClientByClientidGetAsync(string localIp, object cancellationToken) + { + throw new NotImplementedException(); + } + + /// + /// Gets or sets json deserialization settings. + /// + public JsonSerializerSettings DeserializationSettings { get; private set; } + + /// + /// Subscription credentials which uniquely identify client subscription. + /// + public ServiceClientCredentials Credentials { get; private set; } + + /// + /// Initializes a new instance of the LanBackupsAPI class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected LanBackupsAPI(params DelegatingHandler[] handlers) : base(handlers) + { + this.Initialize(); + } + + /// + /// Initializes a new instance of the LanBackupsAPI class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected LanBackupsAPI(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + this.Initialize(); + } + + /// + /// Initializes a new instance of the LanBackupsAPI class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected LanBackupsAPI(Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new ArgumentNullException("baseUri"); + } + this.BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the LanBackupsAPI class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected LanBackupsAPI(Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new ArgumentNullException("baseUri"); + } + this.BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the LanBackupsAPI class. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + public LanBackupsAPI(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new ArgumentNullException("credentials"); + } + this.Credentials = credentials; + if (this.Credentials != null) + { + this.Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the LanBackupsAPI class. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + public LanBackupsAPI(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new ArgumentNullException("credentials"); + } + this.Credentials = credentials; + if (this.Credentials != null) + { + this.Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the LanBackupsAPI class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + public LanBackupsAPI(Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new ArgumentNullException("credentials"); + } + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) + { + this.Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the LanBackupsAPI class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + public LanBackupsAPI(Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new ArgumentNullException("credentials"); + } + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) + { + this.Credentials.InitializeServiceClient(this); + } + } + + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + /// + /// Initializes client properties. + /// + private void Initialize() + { + this.BaseUri = new Uri("http://localhost/"); + SerializationSettings = new JsonSerializerSettings + { + Formatting = Formatting.Indented, + DateFormatHandling = DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = DateTimeZoneHandling.Utc, + NullValueHandling = NullValueHandling.Ignore, + ReferenceLoopHandling = ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + DeserializationSettings = new JsonSerializerSettings + { + DateFormatHandling = DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = DateTimeZoneHandling.Utc, + NullValueHandling = NullValueHandling.Ignore, + ReferenceLoopHandling = ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + CustomInitialize(); + } + /// + /// retrieve all backup configurations + /// + /// + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ApiBackupConfigGetWithHttpMessagesAsync(string idx = default(string), string siz = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("idx", idx); + tracingParameters.Add("siz", siz); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ApiBackupConfigGet", tracingParameters); + } + // Construct URL + var _baseUrl = this.BaseUri.AbsoluteUri; + var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "api/BackupConfig").ToString(); + // Create HTTP transport objects + HttpRequestMessage _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new Uri(_url); + // Set Headers + if (idx != null) + { + if (_httpRequest.Headers.Contains("idx")) + { + _httpRequest.Headers.Remove("idx"); + } + _httpRequest.Headers.TryAddWithoutValidation("idx", idx); + } + if (siz != null) + { + if (_httpRequest.Headers.Contains("siz")) + { + _httpRequest.Headers.Remove("siz"); + } + _httpRequest.Headers.TryAddWithoutValidation("siz", siz); + } + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (this.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// create backup configuration + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ApiBackupConfigPostWithHttpMessagesAsync(BackupConfiguration backup = default(BackupConfiguration), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (backup != null) + { + backup.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("backup", backup); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ApiBackupConfigPost", tracingParameters); + } + // Construct URL + var _baseUrl = this.BaseUri.AbsoluteUri; + var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "api/BackupConfig").ToString(); + // Create HTTP transport objects + HttpRequestMessage _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new Uri(_url); + // Set Headers + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(backup != null) + { + _requestContent = SafeJsonConvert.SerializeObject(backup, this.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 400) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 400) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// retrieve backup configuration by ID + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ApiBackupConfigByIdGetWithHttpMessagesAsync(string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "id"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("id", id); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ApiBackupConfigByIdGet", tracingParameters); + } + // Construct URL + var _baseUrl = this.BaseUri.AbsoluteUri; + var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "api/BackupConfig/{id}").ToString(); + _url = _url.Replace("{id}", Uri.EscapeDataString(id)); + // Create HTTP transport objects + HttpRequestMessage _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new Uri(_url); + // Set Headers + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (this.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 404) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 404) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update backup configuration + /// + /// + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ApiBackupConfigByIdPutWithHttpMessagesAsync(string id, BackupConfiguration backup = default(BackupConfiguration), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "id"); + } + if (backup != null) + { + backup.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("id", id); + tracingParameters.Add("backup", backup); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ApiBackupConfigByIdPut", tracingParameters); + } + // Construct URL + var _baseUrl = this.BaseUri.AbsoluteUri; + var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "api/BackupConfig/{id}").ToString(); + _url = _url.Replace("{id}", Uri.EscapeDataString(id)); + // Create HTTP transport objects + HttpRequestMessage _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new Uri(_url); + // Set Headers + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(backup != null) + { + _requestContent = SafeJsonConvert.SerializeObject(backup, this.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 400) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 400) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// delete backup configuration by id + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ApiBackupConfigByIdDeleteWithHttpMessagesAsync(string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "id"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("id", id); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ApiBackupConfigByIdDelete", tracingParameters); + } + // Construct URL + var _baseUrl = this.BaseUri.AbsoluteUri; + var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "api/BackupConfig/{id}").ToString(); + _url = _url.Replace("{id}", Uri.EscapeDataString(id)); + // Create HTTP transport objects + HttpRequestMessage _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new Uri(_url); + // Set Headers + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (this.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 404) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 404) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// retrieve backup configuration by ID + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ApiBackupConfigClientByClientidGetWithHttpMessagesAsync(string clientid, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (clientid == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clientid"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("clientid", clientid); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ApiBackupConfigClientByClientidGet", tracingParameters); + } + // Construct URL + var _baseUrl = this.BaseUri.AbsoluteUri; + var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "api/BackupConfig/client/{clientid}").ToString(); + _url = _url.Replace("{clientid}", Uri.EscapeDataString(clientid)); + // Create HTTP transport objects + HttpRequestMessage _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new Uri(_url); + // Set Headers + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (this.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 404) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 404) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// retrieves paginated logs from DB + /// + /// + /// page index + /// + /// + /// page size + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ApiLogsGetWithHttpMessagesAsync(string idx = default(string), string siz = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("idx", idx); + tracingParameters.Add("siz", siz); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ApiLogsGet", tracingParameters); + } + // Construct URL + var _baseUrl = this.BaseUri.AbsoluteUri; + var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "api/Logs").ToString(); + // Create HTTP transport objects + HttpRequestMessage _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new Uri(_url); + // Set Headers + if (idx != null) + { + if (_httpRequest.Headers.Contains("idx")) + { + _httpRequest.Headers.Remove("idx"); + } + _httpRequest.Headers.TryAddWithoutValidation("idx", idx); + } + if (siz != null) + { + if (_httpRequest.Headers.Contains("siz")) + { + _httpRequest.Headers.Remove("siz"); + } + _httpRequest.Headers.TryAddWithoutValidation("siz", siz); + } + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (this.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create an entry in the logs + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ApiLogsPostWithHttpMessagesAsync(BackupLog log = default(BackupLog), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (log != null) + { + log.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("log", log); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ApiLogsPost", tracingParameters); + } + // Construct URL + var _baseUrl = this.BaseUri.AbsoluteUri; + var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "api/Logs").ToString(); + // Create HTTP transport objects + HttpRequestMessage _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new Uri(_url); + // Set Headers + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(log != null) + { + _requestContent = SafeJsonConvert.SerializeObject(log, this.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 400) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 400) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// retrieves alog record by ID + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ApiLogsByIdGetWithHttpMessagesAsync(int id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("id", id); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ApiLogsByIdGet", tracingParameters); + } + // Construct URL + var _baseUrl = this.BaseUri.AbsoluteUri; + var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "api/Logs/{id}").ToString(); + _url = _url.Replace("{id}", Uri.EscapeDataString(SafeJsonConvert.SerializeObject(id, this.SerializationSettings).Trim('"'))); + // Create HTTP transport objects + HttpRequestMessage _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new Uri(_url); + // Set Headers + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (this.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 404) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 404) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// retrieve all logs of a clientIP + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ApiLogsClientByClientidGetWithHttpMessagesAsync(string clientid, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (clientid == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clientid"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("clientid", clientid); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ApiLogsClientByClientidGet", tracingParameters); + } + // Construct URL + var _baseUrl = this.BaseUri.AbsoluteUri; + var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "api/Logs/client/{clientid}").ToString(); + _url = _url.Replace("{clientid}", Uri.EscapeDataString(clientid)); + // Create HTTP transport objects + HttpRequestMessage _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new Uri(_url); + // Set Headers + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (this.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 404) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 404) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// retrieves all logs of a specific configuration + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ApiLogsConfigByConfigurationidGetWithHttpMessagesAsync(string configurationid, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (configurationid == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationid"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("configurationid", configurationid); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ApiLogsConfigByConfigurationidGet", tracingParameters); + } + // Construct URL + var _baseUrl = this.BaseUri.AbsoluteUri; + var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "api/Logs/config/{configurationid}").ToString(); + _url = _url.Replace("{configurationid}", Uri.EscapeDataString(configurationid)); + // Create HTTP transport objects + HttpRequestMessage _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new Uri(_url); + // Set Headers + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (this.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 404) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 404) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ApiUsersRegisterPostWithHttpMessagesAsync(User dtouser = default(User), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("dtouser", dtouser); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ApiUsersRegisterPost", tracingParameters); + } + // Construct URL + var _baseUrl = this.BaseUri.AbsoluteUri; + var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "api/Users/register").ToString(); + // Create HTTP transport objects + HttpRequestMessage _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new Uri(_url); + // Set Headers + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(dtouser != null) + { + _requestContent = SafeJsonConvert.SerializeObject(dtouser, this.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 400) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 400) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task ApiUsersLoginPostWithHttpMessagesAsync(User dtouser = default(User), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("dtouser", dtouser); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ApiUsersLoginPost", tracingParameters); + } + // Construct URL + var _baseUrl = this.BaseUri.AbsoluteUri; + var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "api/Users/login").ToString(); + // Create HTTP transport objects + HttpRequestMessage _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new Uri(_url); + // Set Headers + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(dtouser != null) + { + _requestContent = SafeJsonConvert.SerializeObject(dtouser, this.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task ApiUsersPwchangePostWithHttpMessagesAsync(User dtouser = default(User), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("dtouser", dtouser); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ApiUsersPwchangePost", tracingParameters); + } + // Construct URL + var _baseUrl = this.BaseUri.AbsoluteUri; + var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "api/Users/pwchange").ToString(); + // Create HTTP transport objects + HttpRequestMessage _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new Uri(_url); + // Set Headers + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(dtouser != null) + { + _requestContent = SafeJsonConvert.SerializeObject(dtouser, this.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task ApiUsersListGetWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ApiUsersListGet", tracingParameters); + } + // Construct URL + var _baseUrl = this.BaseUri.AbsoluteUri; + var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "api/Users/list").ToString(); + // Create HTTP transport objects + HttpRequestMessage _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new Uri(_url); + // Set Headers + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (this.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task ApiUsersListPostWithHttpMessagesAsync(User user = default(User), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("user", user); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ApiUsersListPost", tracingParameters); + } + // Construct URL + var _baseUrl = this.BaseUri.AbsoluteUri; + var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "api/Users/list").ToString(); + // Create HTTP transport objects + HttpRequestMessage _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new Uri(_url); + // Set Headers + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(user != null) + { + _requestContent = SafeJsonConvert.SerializeObject(user, this.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/LanBackupAgent/LanBackups API/LanBackupsAPIExtensions.cs b/src/LanBackupAgent/LanBackups API/LanBackupsAPIExtensions.cs new file mode 100644 index 0000000..06b27dc --- /dev/null +++ b/src/LanBackupAgent/LanBackups API/LanBackupsAPIExtensions.cs @@ -0,0 +1,503 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace LanBackupAgent +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + using Microsoft.Rest; + using Models; + + /// + /// Extension methods for LanBackupsAPI. + /// + public static partial class LanBackupsAPIExtensions + { + /// + /// retrieve all backup configurations + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + public static PaginatedListBackupConfigurationString ApiBackupConfigGet(this ILanBackupsAPI operations, string idx = default(string), string siz = default(string)) + { + return Task.Factory.StartNew(s => ((ILanBackupsAPI)s).ApiBackupConfigGetAsync(idx, siz), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// retrieve all backup configurations + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task ApiBackupConfigGetAsync(this ILanBackupsAPI operations, string idx = default(string), string siz = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ApiBackupConfigGetWithHttpMessagesAsync(idx, siz, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// create backup configuration + /// + /// + /// The operations group for this extension method. + /// + /// + /// + public static BackupConfiguration ApiBackupConfigPost(this ILanBackupsAPI operations, BackupConfiguration backup = default(BackupConfiguration)) + { + return Task.Factory.StartNew(s => ((ILanBackupsAPI)s).ApiBackupConfigPostAsync(backup), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// create backup configuration + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task ApiBackupConfigPostAsync(this ILanBackupsAPI operations, BackupConfiguration backup = default(BackupConfiguration), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ApiBackupConfigPostWithHttpMessagesAsync(backup, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// retrieve backup configuration by ID + /// + /// + /// The operations group for this extension method. + /// + /// + /// + public static BackupConfiguration ApiBackupConfigByIdGet(this ILanBackupsAPI operations, string id) + { + return Task.Factory.StartNew(s => ((ILanBackupsAPI)s).ApiBackupConfigByIdGetAsync(id), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// retrieve backup configuration by ID + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task ApiBackupConfigByIdGetAsync(this ILanBackupsAPI operations, string id, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ApiBackupConfigByIdGetWithHttpMessagesAsync(id, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update backup configuration + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + public static BackupConfiguration ApiBackupConfigByIdPut(this ILanBackupsAPI operations, string id, BackupConfiguration backup = default(BackupConfiguration)) + { + return Task.Factory.StartNew(s => ((ILanBackupsAPI)s).ApiBackupConfigByIdPutAsync(id, backup), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Update backup configuration + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task ApiBackupConfigByIdPutAsync(this ILanBackupsAPI operations, string id, BackupConfiguration backup = default(BackupConfiguration), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ApiBackupConfigByIdPutWithHttpMessagesAsync(id, backup, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// delete backup configuration by id + /// + /// + /// The operations group for this extension method. + /// + /// + /// + public static object ApiBackupConfigByIdDelete(this ILanBackupsAPI operations, string id) + { + return Task.Factory.StartNew(s => ((ILanBackupsAPI)s).ApiBackupConfigByIdDeleteAsync(id), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// delete backup configuration by id + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task ApiBackupConfigByIdDeleteAsync(this ILanBackupsAPI operations, string id, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ApiBackupConfigByIdDeleteWithHttpMessagesAsync(id, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// retrieve backup configuration by ID + /// + /// + /// The operations group for this extension method. + /// + /// + /// + public static IList ApiBackupConfigClientByClientidGet(this ILanBackupsAPI operations, string clientid) + { + return Task.Factory.StartNew(s => ((ILanBackupsAPI)s).ApiBackupConfigClientByClientidGetAsync(clientid), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// retrieve backup configuration by ID + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task> ApiBackupConfigClientByClientidGetAsync(this ILanBackupsAPI operations, string clientid, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ApiBackupConfigClientByClientidGetWithHttpMessagesAsync(clientid, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// retrieves paginated logs from DB + /// + /// + /// The operations group for this extension method. + /// + /// + /// page index + /// + /// + /// page size + /// + public static PaginatedListBackupLogDateTime ApiLogsGet(this ILanBackupsAPI operations, string idx = default(string), string siz = default(string)) + { + return Task.Factory.StartNew(s => ((ILanBackupsAPI)s).ApiLogsGetAsync(idx, siz), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// retrieves paginated logs from DB + /// + /// + /// The operations group for this extension method. + /// + /// + /// page index + /// + /// + /// page size + /// + /// + /// The cancellation token. + /// + public static async Task ApiLogsGetAsync(this ILanBackupsAPI operations, string idx = default(string), string siz = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ApiLogsGetWithHttpMessagesAsync(idx, siz, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create an entry in the logs + /// + /// + /// The operations group for this extension method. + /// + /// + /// + public static object ApiLogsPost(this ILanBackupsAPI operations, BackupLog log = default(BackupLog)) + { + return Task.Factory.StartNew(s => ((ILanBackupsAPI)s).ApiLogsPostAsync(log), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Create an entry in the logs + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task ApiLogsPostAsync(this ILanBackupsAPI operations, BackupLog log = default(BackupLog), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ApiLogsPostWithHttpMessagesAsync(log, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// retrieves alog record by ID + /// + /// + /// The operations group for this extension method. + /// + /// + /// + public static BackupLog ApiLogsByIdGet(this ILanBackupsAPI operations, int id) + { + return Task.Factory.StartNew(s => ((ILanBackupsAPI)s).ApiLogsByIdGetAsync(id), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// retrieves alog record by ID + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task ApiLogsByIdGetAsync(this ILanBackupsAPI operations, int id, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ApiLogsByIdGetWithHttpMessagesAsync(id, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// retrieve all logs of a clientIP + /// + /// + /// The operations group for this extension method. + /// + /// + /// + public static IList ApiLogsClientByClientidGet(this ILanBackupsAPI operations, string clientid) + { + return Task.Factory.StartNew(s => ((ILanBackupsAPI)s).ApiLogsClientByClientidGetAsync(clientid), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// retrieve all logs of a clientIP + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task> ApiLogsClientByClientidGetAsync(this ILanBackupsAPI operations, string clientid, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ApiLogsClientByClientidGetWithHttpMessagesAsync(clientid, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// retrieves all logs of a specific configuration + /// + /// + /// The operations group for this extension method. + /// + /// + /// + public static IList ApiLogsConfigByConfigurationidGet(this ILanBackupsAPI operations, string configurationid) + { + return Task.Factory.StartNew(s => ((ILanBackupsAPI)s).ApiLogsConfigByConfigurationidGetAsync(configurationid), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// retrieves all logs of a specific configuration + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task> ApiLogsConfigByConfigurationidGetAsync(this ILanBackupsAPI operations, string configurationid, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ApiLogsConfigByConfigurationidGetWithHttpMessagesAsync(configurationid, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// The operations group for this extension method. + /// + /// + /// + public static IdentityResult ApiUsersRegisterPost(this ILanBackupsAPI operations, User dtouser = default(User)) + { + return Task.Factory.StartNew(s => ((ILanBackupsAPI)s).ApiUsersRegisterPostAsync(dtouser), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task ApiUsersRegisterPostAsync(this ILanBackupsAPI operations, User dtouser = default(User), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ApiUsersRegisterPostWithHttpMessagesAsync(dtouser, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// The operations group for this extension method. + /// + /// + /// + public static void ApiUsersLoginPost(this ILanBackupsAPI operations, User dtouser = default(User)) + { + Task.Factory.StartNew(s => ((ILanBackupsAPI)s).ApiUsersLoginPostAsync(dtouser), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task ApiUsersLoginPostAsync(this ILanBackupsAPI operations, User dtouser = default(User), CancellationToken cancellationToken = default(CancellationToken)) + { + await operations.ApiUsersLoginPostWithHttpMessagesAsync(dtouser, null, cancellationToken).ConfigureAwait(false); + } + + /// + /// The operations group for this extension method. + /// + /// + /// + public static void ApiUsersPwchangePost(this ILanBackupsAPI operations, User dtouser = default(User)) + { + Task.Factory.StartNew(s => ((ILanBackupsAPI)s).ApiUsersPwchangePostAsync(dtouser), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task ApiUsersPwchangePostAsync(this ILanBackupsAPI operations, User dtouser = default(User), CancellationToken cancellationToken = default(CancellationToken)) + { + await operations.ApiUsersPwchangePostWithHttpMessagesAsync(dtouser, null, cancellationToken).ConfigureAwait(false); + } + + /// + /// The operations group for this extension method. + /// + public static void ApiUsersListGet(this ILanBackupsAPI operations) + { + Task.Factory.StartNew(s => ((ILanBackupsAPI)s).ApiUsersListGetAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task ApiUsersListGetAsync(this ILanBackupsAPI operations, CancellationToken cancellationToken = default(CancellationToken)) + { + await operations.ApiUsersListGetWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false); + } + + /// + /// The operations group for this extension method. + /// + /// + /// + public static void ApiUsersListPost(this ILanBackupsAPI operations, User user = default(User)) + { + Task.Factory.StartNew(s => ((ILanBackupsAPI)s).ApiUsersListPostAsync(user), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task ApiUsersListPostAsync(this ILanBackupsAPI operations, User user = default(User), CancellationToken cancellationToken = default(CancellationToken)) + { + await operations.ApiUsersListPostWithHttpMessagesAsync(user, null, cancellationToken).ConfigureAwait(false); + } + + } +} diff --git a/src/LanBackupAgent/LanBackups API/Models/BackupConfiguration.cs b/src/LanBackupAgent/LanBackups API/Models/BackupConfiguration.cs new file mode 100644 index 0000000..a13128d --- /dev/null +++ b/src/LanBackupAgent/LanBackups API/Models/BackupConfiguration.cs @@ -0,0 +1,112 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace LanBackupAgent.Models +{ + using System; + using System.Linq; + using System.Collections.Generic; + using Newtonsoft.Json; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + + public partial class BackupConfiguration + { + /// + /// Initializes a new instance of the BackupConfiguration class. + /// + public BackupConfiguration() { } + + /// + /// Initializes a new instance of the BackupConfiguration class. + /// + public BackupConfiguration(string clientIP, string id = default(string), byte[] rowVersion = default(byte[]), string srcFolder = default(string), string srcUser = default(string), string srcPass = default(string), string destLanFolder = default(string), string destUser = default(string), string destPass = default(string), bool? isActive = default(bool?), string crontab = default(string)) + { + Id = id; + RowVersion = rowVersion; + ClientIP = clientIP; + SrcFolder = srcFolder; + SrcUser = srcUser; + SrcPass = srcPass; + DestLanFolder = destLanFolder; + DestUser = destUser; + DestPass = destPass; + IsActive = isActive; + Crontab = crontab; + } + + /// + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// + [JsonProperty(PropertyName = "rowVersion")] + public byte[] RowVersion { get; set; } + + /// + /// + [JsonProperty(PropertyName = "clientIP")] + public string ClientIP { get; set; } + + /// + /// + [JsonProperty(PropertyName = "srcFolder")] + public string SrcFolder { get; set; } + + /// + /// + [JsonProperty(PropertyName = "srcUser")] + public string SrcUser { get; set; } + + /// + /// + [JsonProperty(PropertyName = "srcPass")] + public string SrcPass { get; set; } + + /// + /// + [JsonProperty(PropertyName = "destLanFolder")] + public string DestLanFolder { get; set; } + + /// + /// + [JsonProperty(PropertyName = "destUser")] + public string DestUser { get; set; } + + /// + /// + [JsonProperty(PropertyName = "destPass")] + public string DestPass { get; set; } + + /// + /// + [JsonProperty(PropertyName = "isActive")] + public bool? IsActive { get; set; } + + /// + /// + [JsonProperty(PropertyName = "crontab")] + public string Crontab { get; set; } + + /// + /// Validate the object. Throws ValidationException if validation fails. + /// + public virtual void Validate() + { + if (ClientIP == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ClientIP"); + } + if (this.ClientIP != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(this.ClientIP, "^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$")) + { + throw new ValidationException(ValidationRules.Pattern, "ClientIP", "^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$"); + } + } + } + } +} diff --git a/src/LanBackupAgent/LanBackups API/Models/BackupLog.cs b/src/LanBackupAgent/LanBackups API/Models/BackupLog.cs new file mode 100644 index 0000000..df1bb2a --- /dev/null +++ b/src/LanBackupAgent/LanBackups API/Models/BackupLog.cs @@ -0,0 +1,90 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace LanBackupAgent.Models +{ + using System; + using System.Linq; + using System.Collections.Generic; + using Newtonsoft.Json; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + + public partial class BackupLog + { + /// + /// Initializes a new instance of the BackupLog class. + /// + public BackupLog() { } + + /// + /// Initializes a new instance of the BackupLog class. + /// + public BackupLog(int? id = default(int?), byte[] rowVersion = default(byte[]), string clientIP = default(string), string configurationID = default(string), string description = default(string), string logError = default(string), string status = default(string), DateTime? dateTime = default(DateTime?)) + { + Id = id; + RowVersion = rowVersion; + ClientIP = clientIP; + ConfigurationID = configurationID; + Description = description; + LogError = logError; + Status = status; + DateTime = dateTime; + } + + /// + /// + [JsonProperty(PropertyName = "id")] + public int? Id { get; set; } + + /// + /// + [JsonProperty(PropertyName = "rowVersion")] + public byte[] RowVersion { get; set; } + + /// + /// + [JsonProperty(PropertyName = "clientIP")] + public string ClientIP { get; set; } + + /// + /// + [JsonProperty(PropertyName = "configurationID")] + public string ConfigurationID { get; set; } + + /// + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// + [JsonProperty(PropertyName = "logError")] + public string LogError { get; set; } + + /// + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// + [JsonProperty(PropertyName = "dateTime")] + public DateTime? DateTime { get; set; } + + /// + /// Validate the object. Throws ValidationException if validation fails. + /// + public virtual void Validate() + { + if (this.ClientIP != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(this.ClientIP, "^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$")) + { + throw new ValidationException(ValidationRules.Pattern, "ClientIP", "^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$"); + } + } + } + } +} diff --git a/src/LanBackupAgent/LanBackups API/Models/IdentityError.cs b/src/LanBackupAgent/LanBackups API/Models/IdentityError.cs new file mode 100644 index 0000000..0f83ba6 --- /dev/null +++ b/src/LanBackupAgent/LanBackups API/Models/IdentityError.cs @@ -0,0 +1,41 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace LanBackupAgent.Models +{ + using System; + using System.Linq; + using System.Collections.Generic; + using Newtonsoft.Json; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + + public partial class IdentityError + { + /// + /// Initializes a new instance of the IdentityError class. + /// + public IdentityError() { } + + /// + /// Initializes a new instance of the IdentityError class. + /// + public IdentityError(string code = default(string), string description = default(string)) + { + Code = code; + Description = description; + } + + /// + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + } +} diff --git a/src/LanBackupAgent/LanBackups API/Models/IdentityResult.cs b/src/LanBackupAgent/LanBackups API/Models/IdentityResult.cs new file mode 100644 index 0000000..94cfa4a --- /dev/null +++ b/src/LanBackupAgent/LanBackups API/Models/IdentityResult.cs @@ -0,0 +1,41 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace LanBackupAgent.Models +{ + using System; + using System.Linq; + using System.Collections.Generic; + using Newtonsoft.Json; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + + public partial class IdentityResult + { + /// + /// Initializes a new instance of the IdentityResult class. + /// + public IdentityResult() { } + + /// + /// Initializes a new instance of the IdentityResult class. + /// + public IdentityResult(bool? succeeded = default(bool?), IList errors = default(IList)) + { + Succeeded = succeeded; + Errors = errors; + } + + /// + /// + [JsonProperty(PropertyName = "succeeded")] + public bool? Succeeded { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "errors")] + public IList Errors { get; private set; } + + } +} diff --git a/src/LanBackupAgent/LanBackups API/Models/PaginatedListBackupConfigurationString.cs b/src/LanBackupAgent/LanBackups API/Models/PaginatedListBackupConfigurationString.cs new file mode 100644 index 0000000..7538cfa --- /dev/null +++ b/src/LanBackupAgent/LanBackups API/Models/PaginatedListBackupConfigurationString.cs @@ -0,0 +1,61 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace LanBackupAgent.Models +{ + using System; + using System.Linq; + using System.Collections.Generic; + using Newtonsoft.Json; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + + public partial class PaginatedListBackupConfigurationString + { + /// + /// Initializes a new instance of the + /// PaginatedListBackupConfigurationString class. + /// + public PaginatedListBackupConfigurationString() { } + + /// + /// Initializes a new instance of the + /// PaginatedListBackupConfigurationString class. + /// + public PaginatedListBackupConfigurationString(int? pi = default(int?), int? tp = default(int?), IList recs = default(IList), bool? hp = default(bool?), bool? hn = default(bool?)) + { + Pi = pi; + Tp = tp; + Recs = recs; + Hp = hp; + Hn = hn; + } + + /// + /// + [JsonProperty(PropertyName = "pi")] + public int? Pi { get; set; } + + /// + /// + [JsonProperty(PropertyName = "tp")] + public int? Tp { get; set; } + + /// + /// + [JsonProperty(PropertyName = "recs")] + public IList Recs { get; set; } + + /// + /// + [JsonProperty(PropertyName = "hp")] + public bool? Hp { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "hn")] + public bool? Hn { get; private set; } + + } +} diff --git a/src/LanBackupAgent/LanBackups API/Models/PaginatedListBackupLogDateTime.cs b/src/LanBackupAgent/LanBackups API/Models/PaginatedListBackupLogDateTime.cs new file mode 100644 index 0000000..795b89e --- /dev/null +++ b/src/LanBackupAgent/LanBackups API/Models/PaginatedListBackupLogDateTime.cs @@ -0,0 +1,61 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace LanBackupAgent.Models +{ + using System; + using System.Linq; + using System.Collections.Generic; + using Newtonsoft.Json; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + + public partial class PaginatedListBackupLogDateTime + { + /// + /// Initializes a new instance of the PaginatedListBackupLogDateTime + /// class. + /// + public PaginatedListBackupLogDateTime() { } + + /// + /// Initializes a new instance of the PaginatedListBackupLogDateTime + /// class. + /// + public PaginatedListBackupLogDateTime(int? pi = default(int?), int? tp = default(int?), IList recs = default(IList), bool? hp = default(bool?), bool? hn = default(bool?)) + { + Pi = pi; + Tp = tp; + Recs = recs; + Hp = hp; + Hn = hn; + } + + /// + /// + [JsonProperty(PropertyName = "pi")] + public int? Pi { get; set; } + + /// + /// + [JsonProperty(PropertyName = "tp")] + public int? Tp { get; set; } + + /// + /// + [JsonProperty(PropertyName = "recs")] + public IList Recs { get; set; } + + /// + /// + [JsonProperty(PropertyName = "hp")] + public bool? Hp { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "hn")] + public bool? Hn { get; private set; } + + } +} diff --git a/src/LanBackupAgent/LanBackups API/Models/User.cs b/src/LanBackupAgent/LanBackups API/Models/User.cs new file mode 100644 index 0000000..075e741 --- /dev/null +++ b/src/LanBackupAgent/LanBackups API/Models/User.cs @@ -0,0 +1,65 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace LanBackupAgent.Models +{ + using System; + using System.Linq; + using System.Collections.Generic; + using Newtonsoft.Json; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + + public partial class User + { + /// + /// Initializes a new instance of the User class. + /// + public User() { } + + /// + /// Initializes a new instance of the User class. + /// + public User(string email = default(string), string password = default(string), string newPassword = default(string), bool? isAdmin = default(bool?), bool? succeeded = default(bool?), bool? isLockedOut = default(bool?)) + { + Email = email; + Password = password; + NewPassword = newPassword; + IsAdmin = isAdmin; + Succeeded = succeeded; + IsLockedOut = isLockedOut; + } + + /// + /// + [JsonProperty(PropertyName = "email")] + public string Email { get; set; } + + /// + /// + [JsonProperty(PropertyName = "password")] + public string Password { get; set; } + + /// + /// + [JsonProperty(PropertyName = "newPassword")] + public string NewPassword { get; set; } + + /// + /// + [JsonProperty(PropertyName = "isAdmin")] + public bool? IsAdmin { get; set; } + + /// + /// + [JsonProperty(PropertyName = "succeeded")] + public bool? Succeeded { get; set; } + + /// + /// + [JsonProperty(PropertyName = "isLockedOut")] + public bool? IsLockedOut { get; set; } + + } +} diff --git a/src/LanBackupAgent/Message/StatusReport.cs b/src/LanBackupAgent/Message/StatusReport.cs new file mode 100644 index 0000000..5bad547 --- /dev/null +++ b/src/LanBackupAgent/Message/StatusReport.cs @@ -0,0 +1,14 @@ +using LanBackup.Models; +using TinyMessenger; + +namespace LanBackupAgent.Message +{ + public class StatusReport : TinyMessageBase + { + public StatusReportInfo Info { get; set; } + public StatusReport(string sender, StatusReportInfo msg) : base(sender) + { + this.Info = msg; + } + } +} diff --git a/src/LanBackupAgent/Message/StopMessage.cs b/src/LanBackupAgent/Message/StopMessage.cs new file mode 100644 index 0000000..75804bd --- /dev/null +++ b/src/LanBackupAgent/Message/StopMessage.cs @@ -0,0 +1,11 @@ +using TinyMessenger; + +namespace LanBackupAgent.Message +{ + public class StopMessage : TinyMessageBase + { + public StopMessage(string msg) : base(msg) + { + } + } +} \ No newline at end of file diff --git a/src/LanBackupAgent/NLog.xsd b/src/LanBackupAgent/NLog.xsd new file mode 100644 index 0000000..bbbacc4 --- /dev/null +++ b/src/LanBackupAgent/NLog.xsd @@ -0,0 +1,2723 @@ + + + + + + + + + + + + + + + Watch config file for changes and reload automatically. + + + + + Print internal NLog messages to the console. Default value is: false + + + + + Print internal NLog messages to the console error output. Default value is: false + + + + + Write internal NLog messages to the specified file. + + + + + Log level threshold for internal log messages. Default value is: Info. + + + + + Global log level threshold for application log messages. Messages below this level won't be logged.. + + + + + Pass NLog internal exceptions to the application. Default value is: false. + + + + + Write internal NLog messages to the the System.Diagnostics.Trace. Default value is: false + + + + + + + + + + + + + + Make all targets within this section asynchronous (creates additional threads but the calling thread isn't blocked by any target writes). + + + + + + + + + + + + + + + + + Prefix for targets/layout renderers/filters/conditions loaded from this assembly. + + + + + Load NLog extensions from the specified file (*.dll) + + + + + Load NLog extensions from the specified assembly. Assembly name should be fully qualified. + + + + + + + + + + Name of the logger. May include '*' character which acts like a wildcard. Allowed forms are: *, Name, *Name, Name* and *Name* + + + + + Comma separated list of levels that this rule matches. + + + + + Minimum level that this rule matches. + + + + + Maximum level that this rule matches. + + + + + Level that this rule matches. + + + + + Comma separated list of target names. + + + + + Ignore further rules if this one matches. + + + + + Enable or disable logging rule. Disabled rules are ignored. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the file to be included. The name is relative to the name of the current config file. + + + + + Ignore any errors in the include file. + + + + + + + Variable name. + + + + + Variable value. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Number of log events that should be processed in a batch by the lazy writer thread. + + + + + Action to be taken when the lazy writer thread request queue count exceeds the set limit. + + + + + Limit on the number of requests in the lazy writer thread request queue. + + + + + Time in milliseconds to sleep between batches. + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Condition expression. Log events who meet this condition will cause a flush on the wrapped target. + + + + + + + + + + + + + + + + + Name of the target. + + + + + Number of log events to be buffered. + + + + + Timeout (in milliseconds) after which the contents of buffer will be flushed if there's no write in the specified period of time. Use -1 to disable timed flushes. + + + + + Indicates whether to use sliding timeout. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Encoding to be used. + + + + + Instance of that is used to format log messages. + + + + + End of line value if a newline is appended at the end of log message . + + + + + Maximum message size in bytes. + + + + + Indicates whether to append newline at the end of log message. + + + + + Action that should be taken if the will be more connections than . + + + + + Action that should be taken if the message is larger than maxMessageSize. + + + + + Indicates whether to keep connection open whenever possible. + + + + + Size of the connection cache (number of connections which are kept alive). + + + + + Maximum current connections. 0 = no maximum. + + + + + Network address. + + + + + Maximum queue size. + + + + + Indicates whether to include source info (file name and line number) in the information sent over the network. + + + + + NDC item separator. + + + + + Indicates whether to include stack contents. + + + + + Indicates whether to include call site (class and method name) in the information sent over the network. + + + + + AppInfo field. By default it's the friendly name of the current AppDomain. + + + + + Indicates whether to include NLog-specific extensions to log4j schema. + + + + + Indicates whether to include dictionary contents. + + + + + + + + + + + + + + + + + + + + + + + + + + + Layout that should be use to calcuate the value for the parameter. + + + + + Viewer parameter name. + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether to use default row highlighting rules. + + + + + Indicates whether to auto-check if the console is available. - Disables console writing if Environment.UserInteractive = False (Windows Service) - Disables console writing if Console Standard Input is not available (Non-Console-App) + + + + + The encoding for writing messages to the . + + + + + Indicates whether the error stream (stderr) should be used instead of the output stream (stdout). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Condition that must be met in order to set the specified foreground and background color. + + + + + Background color. + + + + + Foreground color. + + + + + + + + + + + + + + + + Indicates whether to ignore case when comparing texts. + + + + + Regular expression to be matched. You must specify either text or regex. + + + + + Text to be matched. You must specify either text or regex. + + + + + Indicates whether to match whole words only. + + + + + Compile the ? This can improve the performance, but at the costs of more memory usage. If false, the Regex Cache is used. + + + + + Background color. + + + + + Foreground color. + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether to send the log messages to the standard error instead of the standard output. + + + + + Indicates whether to auto-check if the console is available - Disables console writing if Environment.UserInteractive = False (Windows Service) - Disables console writing if Console Standard Input is not available (Non-Console-App) + + + + + The encoding for writing messages to the . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Connection string. When provided, it overrides the values specified in DBHost, DBUserName, DBPassword, DBDatabase. + + + + + Name of the connection string (as specified in <connectionStrings> configuration section. + + + + + Database name. If the ConnectionString is not provided this value will be used to construct the "Database=" part of the connection string. + + + + + Database host name. If the ConnectionString is not provided this value will be used to construct the "Server=" part of the connection string. + + + + + Database password. If the ConnectionString is not provided this value will be used to construct the "Password=" part of the connection string. + + + + + Name of the database provider. + + + + + Database user name. If the ConnectionString is not provided this value will be used to construct the "User ID=" part of the connection string. + + + + + Indicates whether to keep the database connection open between the log events. + + + + + Obsolete - value will be ignored! The logging code always runs outside of transaction. Gets or sets a value indicating whether to use database transactions. Some data providers require this. + + + + + Connection string using for installation and uninstallation. If not provided, regular ConnectionString is being used. + + + + + Text of the SQL command to be run on each log level. + + + + + Type of the SQL command to be run on each log level. + + + + + + + + + + + + + + + + + + + + + + + Type of the command. + + + + + Connection string to run the command against. If not provided, connection string from the target is used. + + + + + Indicates whether to ignore failures. + + + + + Command text. + + + + + + + + + + + + + + Layout that should be use to calcuate the value for the parameter. + + + + + Database parameter name. + + + + + Database parameter precision. + + + + + Database parameter scale. + + + + + Database parameter size. + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + Layout that renders event Category. + + + + + Layout that renders event ID. + + + + + Name of the Event Log to write to. This can be System, Application or any user-defined name. + + + + + Name of the machine on which Event Log service is running. + + + + + Value to be used as the event Source. + + + + + Action to take if the message is larger than the option. + + + + + Optional entrytype. When not set, or when not convertable to then determined by + + + + + Message length limit to write to the Event Log. + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Indicates whether to return to the first target after any successful write. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + File encoding. + + + + + Line ending mode. + + + + + Way file archives are numbered. + + + + + Name of the file to be used for an archive. + + + + + Indicates whether to automatically archive log files every time the specified time passes. + + + + + Size in bytes above which log files will be automatically archived. Warning: combining this with isn't supported. We cannot create multiple archive files, if they should have the same name. Choose: + + + + + Indicates whether to compress archive files into the zip archive format. + + + + + Maximum number of archive files that should be kept. + + + + + Gets or set a value indicating whether a managed file stream is forced, instead of using the native implementation. + + + + + Is the an absolute or relative path? + + + + + Cleanup invalid values in a filename, e.g. slashes in a filename. If set to true, this can impact the performance of massive writes. If set to false, nothing gets written when the filename is wrong. + + + + + Is the an absolute or relative path? + + + + + Value indicationg whether file creation calls should be synchronized by a system global mutex. + + + + + Indicates whether the footer should be written only when the file is archived. + + + + + Name of the file to write to. + + + + + Value specifying the date format to use when archiving files. + + + + + Indicates whether to archive old log file on startup. + + + + + Indicates whether to create directories if they do not exist. + + + + + Indicates whether to enable log file(s) to be deleted. + + + + + File attributes (Windows only). + + + + + Indicates whether to delete old log file on startup. + + + + + Indicates whether to replace file contents on each write instead of appending log message at the end. + + + + + Indicates whether concurrent writes to the log file by multiple processes on the same host. + + + + + Indicates whether to keep log file open instead of opening and closing it on each logging event. + + + + + Maximum number of log filenames that should be stored as existing. + + + + + Indicates whether concurrent writes to the log file by multiple processes on different network hosts. + + + + + Number of files to be kept open. Setting this to a higher value may improve performance in a situation where a single File target is writing to many files (such as splitting by level or by logger). + + + + + Maximum number of seconds that files are kept open. If this number is negative the files are not automatically closed after a period of inactivity. + + + + + Log file buffer size in bytes. + + + + + Indicates whether to automatically flush the file buffers after each log message. + + + + + Delay in milliseconds to wait before attempting to write to the file again. + + + + + Number of times the write is appended on the file before NLog discards the log message. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Condition expression. Log events who meet this condition will be forwarded to the wrapped target. + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Windows domain name to change context to. + + + + + Required impersonation level. + + + + + Type of the logon provider. + + + + + Logon Type. + + + + + User account password. + + + + + Indicates whether to revert to the credentials of the process instead of impersonating another user. + + + + + Username to change context to. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Interval in which messages will be written up to the number of messages. + + + + + Maximum allowed number of messages written per . + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Endpoint address. + + + + + Name of the endpoint configuration in WCF configuration file. + + + + + Indicates whether to use a WCF service contract that is one way (fire and forget) or two way (request-reply) + + + + + Client ID. + + + + + Indicates whether to include per-event properties in the payload sent to the server. + + + + + Indicates whether to use binary message encoding. + + + + + + + + + + + + + + Layout that should be use to calculate the value for the parameter. + + + + + Name of the parameter. + + + + + Type of the parameter. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether to send message as HTML instead of plain text. + + + + + Encoding to be used for sending e-mail. + + + + + Indicates whether to add new lines between log entries. + + + + + CC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + + + Recipients' email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + + + BCC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + + + Mail message body (repeated for each log message send in one mail). + + + + + Mail subject. + + + + + Sender's email address (e.g. joe@domain.com). + + + + + Indicates whether NewLine characters in the body should be replaced with tags. + + + + + Priority used for sending mails. + + + + + Indicates the SMTP client timeout. + + + + + SMTP Server to be used for sending. + + + + + SMTP Authentication mode. + + + + + Username used to connect to SMTP server (used when SmtpAuthentication is set to "basic"). + + + + + Password used to authenticate against SMTP server (used when SmtpAuthentication is set to "basic"). + + + + + Indicates whether SSL (secure sockets layer) should be used when communicating with SMTP server. + + + + + Port number that SMTP Server is listening on. + + + + + Indicates whether the default Settings from System.Net.MailSettings should be used. + + + + + Folder where applications save mail messages to be processed by the local SMTP server. + + + + + Specifies how outgoing email messages will be handled. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + Encoding to be used when writing text to the queue. + + + + + Indicates whether to use the XML format when serializing message. This will also disable creating queues. + + + + + Indicates whether to check if a queue exists before writing to it. + + + + + Indicates whether to create the queue if it doesn't exists. + + + + + Label to associate with each message. + + + + + Name of the queue to write to. + + + + + Indicates whether to use recoverable messages (with guaranteed delivery). + + + + + + + + + + + + + + + + + Name of the target. + + + + + Class name. + + + + + Method name. The method must be public and static. Use the AssemblyQualifiedName , https://msdn.microsoft.com/en-us/library/system.type.assemblyqualifiedname(v=vs.110).aspx e.g. + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + Encoding to be used. + + + + + End of line value if a newline is appended at the end of log message . + + + + + Maximum message size in bytes. + + + + + Indicates whether to append newline at the end of log message. + + + + + Action that should be taken if the will be more connections than . + + + + + Action that should be taken if the message is larger than maxMessageSize. + + + + + Network address. + + + + + Size of the connection cache (number of connections which are kept alive). + + + + + Indicates whether to keep connection open whenever possible. + + + + + Maximum current connections. 0 = no maximum. + + + + + Maximum queue size. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Encoding to be used. + + + + + Instance of that is used to format log messages. + + + + + End of line value if a newline is appended at the end of log message . + + + + + Maximum message size in bytes. + + + + + Indicates whether to append newline at the end of log message. + + + + + Action that should be taken if the will be more connections than . + + + + + Action that should be taken if the message is larger than maxMessageSize. + + + + + Indicates whether to keep connection open whenever possible. + + + + + Size of the connection cache (number of connections which are kept alive). + + + + + Maximum current connections. 0 = no maximum. + + + + + Network address. + + + + + Maximum queue size. + + + + + Indicates whether to include source info (file name and line number) in the information sent over the network. + + + + + NDC item separator. + + + + + Indicates whether to include stack contents. + + + + + Indicates whether to include call site (class and method name) in the information sent over the network. + + + + + AppInfo field. By default it's the friendly name of the current AppDomain. + + + + + Indicates whether to include NLog-specific extensions to log4j schema. + + + + + Indicates whether to include dictionary contents. + + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + Indicates whether to perform layout calculation. + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Indicates whether performance counter should be automatically created. + + + + + Name of the performance counter category. + + + + + Counter help text. + + + + + Name of the performance counter. + + + + + Performance counter type. + + + + + The value by which to increment the counter. + + + + + Performance counter instance name. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Default filter to be applied when no specific rule matches. + + + + + + + + + + + + + Condition to be tested. + + + + + Resulting filter to be applied when the condition matches. + + + + + + + + + + + + Name of the target. + + + + + + + + + + + + + + + Name of the target. + + + + + Number of times to repeat each log message. + + + + + + + + + + + + + + + + Name of the target. + + + + + Number of retries that should be attempted on the wrapped target in case of a failure. + + + + + Time to wait between retries in milliseconds. + + + + + + + + + + + + + + Name of the target. + + + + + + + + + + + + + + Name of the target. + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Should we include the BOM (Byte-order-mark) for UTF? Influences the property. This will only work for UTF-8. + + + + + Encoding. + + + + + Value whether escaping be done according to the old NLog style (Very non-standard) + + + + + Value whether escaping be done according to Rfc3986 (Supports Internationalized Resource Identifiers - IRIs) + + + + + Web service method name. Only used with Soap. + + + + + Web service namespace. Only used with Soap. + + + + + Protocol to be used when calling web service. + + + + + Web service URL. + + + + + Name of the root XML element, if POST of XML document chosen. If so, this property must not be null. (see and ). + + + + + (optional) root namespace of the XML document, if POST of XML document chosen. (see and ). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Footer layout. + + + + + Header layout. + + + + + Body layout (can be repeated multiple times). + + + + + Custom column delimiter value (valid when ColumnDelimiter is set to 'Custom'). + + + + + Column delimiter. + + + + + Quote Character. + + + + + Quoting mode. + + + + + Indicates whether CVS should include header. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Layout of the column. + + + + + Name of the column. + + + + + + + + + + + + + + + + List of property names to exclude when is true + + + + + Option to include all properties from the log events + + + + + Option to render the empty object value {} + + + + + Option to suppress the extra spaces in the output json + + + + + + + + + + + + + + Determines wether or not this attribute will be Json encoded. + + + + + Layout that will be rendered as the attribute's value. + + + + + Name of the attribute. + + + + + + + + + + + + + + Footer layout. + + + + + Header layout. + + + + + Body layout (can be repeated multiple times). + + + + + + + + + + + + + + + + + + + + + Layout text. + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Condition expression. + + + + + + + + + + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + Substring to be matched. + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + String to compare the layout to. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + Substring to be matched. + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + String to compare the layout to. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/LanBackupAgent/Program.cs b/src/LanBackupAgent/Program.cs new file mode 100644 index 0000000..f901e7b --- /dev/null +++ b/src/LanBackupAgent/Program.cs @@ -0,0 +1,108 @@ +using LanBackupAgent.Utils; +using LanBackupAgent.WebApi; +using LanBackupAgent.Controllers; +using NLog; +using SimpleInjector; +using System; +using System.Configuration; +using TinyMessenger; +using Topshelf; + +namespace LanBackupAgent +{ + class Program + { + + static ILogger logger; + static TinyMessengerHub messenger; + static Network network; + + public static void Main() + { + + //conf logger + logger = LogManager.GetCurrentClassLogger(); + messenger = new TinyMessengerHub(); + + AppDomain currentDomain = AppDomain.CurrentDomain; + currentDomain.UnhandledException += CurrentDomain_UnhandledException; + + + //setup DI container + // Register individual components + DI.Container.Register(() => logger, Lifestyle.Singleton); + DI.Container.Register(() => messenger, Lifestyle.Singleton); + network = new Network(logger); + DI.Container.Register(() => network, Lifestyle.Singleton); + DI.Container.Register(Lifestyle.Transient); + string webApiUrl = ConfigurationManager.AppSettings["webApiUrl"]; + WebApiService api = new WebApiService(webApiUrl, logger, messenger); + DI.Container.Register(() => api, Lifestyle.Singleton); + SignalRController signarl = new SignalRController(webApiUrl, logger, messenger, network); + DI.Container.Register(() => signarl, Lifestyle.Singleton); + DI.Container.Register(Lifestyle.Transient); + logger.Trace("DI initialized"); + + + + logger.Trace("Starting service"); + HostFactory.Run(x => + { + //use NLog logger + x.UseNLog(); + + x.Service(s => + { + s.ConstructUsing(name => new LanBackupAgentService(logger, messenger)); + s.WhenStarted(async tc => await tc.Start()); + s.WhenStopped(tc => tc.Stop()); + }); + x.RunAsNetworkService(); + x.StartAutomatically(); // Start the service automatically + + x.SetDescription("LanBackup Agent Service"); + x.SetDisplayName("LanBackup Agent"); + //recommended that service names not contains spaces or other whitespace characters. + x.SetServiceName("LanBackupAgent"); + + + x.EnableServiceRecovery(r => + { + //you can have up to three of these + //r.RestartComputer(5, "message"); + r.RestartService(1);//minutes for restart + //the last one will act for all subsequent failures + //r.RunProgram(7, "ping google.com"); + + //should this be true for crashed or non-zero exits + r.OnCrashOnly(); + + //number of days until the error count resets + r.SetResetPeriod(1); + }); + + + //x.BeforeInstall(() => { ... }); + //x.AfterInstall(() => { ... }); + //x.BeforeUninstall(() => { ... }); + //x.AfterUninstall(() => { ... }); + + x.OnException(ex => + { + // Do something with the exception + logger.Error(ex, "LanBackup Agent service Error: "); + }); + + }); + logger.Trace("Program DONE!"); + } + + private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) + { + var logger = DI.Container.GetInstance(); + logger.Fatal($"Global exception: {e.ExceptionObject}"); + } + + } + +} diff --git a/src/LanBackupAgent/Properties/AssemblyInfo.cs b/src/LanBackupAgent/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..28fb721 --- /dev/null +++ b/src/LanBackupAgent/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("LanBackupAgent")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("LanBackupAgent")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("cb7ee867-93e8-43e3-9eee-9068aed1de6c")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/LanBackupAgent/Utils/DI.cs b/src/LanBackupAgent/Utils/DI.cs new file mode 100644 index 0000000..1636e30 --- /dev/null +++ b/src/LanBackupAgent/Utils/DI.cs @@ -0,0 +1,10 @@ +using SimpleInjector; + +namespace LanBackupAgent +{ + public static class DI + { + //the DI container + public static Container Container { get; set; } = new Container(); + } +} diff --git a/src/LanBackupAgent/Utils/Extensions.cs b/src/LanBackupAgent/Utils/Extensions.cs new file mode 100644 index 0000000..a411ea4 --- /dev/null +++ b/src/LanBackupAgent/Utils/Extensions.cs @@ -0,0 +1,27 @@ +using System; + +namespace LanBackupAgent +{ + public static class Extensions + { + + + /// + /// extension function for substracting an array + /// + /// + /// + /// + /// + /// + public static T[] SubArray(this T[] data, int index, int length) + { + T[] result = new T[length]; + Array.Copy(data, index, result, 0, length); + return result; + } + + + + } +} diff --git a/src/LanBackupAgent/Utils/HangfireExtensions.cs b/src/LanBackupAgent/Utils/HangfireExtensions.cs new file mode 100644 index 0000000..04d65f4 --- /dev/null +++ b/src/LanBackupAgent/Utils/HangfireExtensions.cs @@ -0,0 +1,56 @@ +using Hangfire; +using Hangfire.Storage; +using Hangfire.Storage.Monitoring; +using System; +using System.Collections.Generic; + +namespace LanBackupAgent.Utils +{ + public static class HangfireExtensions + { + public static void PurgeJobs(this IMonitoringApi monitor) + { + var toDelete = new List(); + + foreach (QueueWithTopEnqueuedJobsDto queue in monitor.Queues()) + { + for (var i = 0; i < Math.Ceiling(queue.Length / 1000d); i++) + { + monitor.EnqueuedJobs(queue.Name, 1000 * i, 1000) + .ForEach(x => toDelete.Add(x.Key)); + } + } + + foreach (var jobId in toDelete) + { + BackgroundJob.Delete(jobId); + } + } + + public static void PurgeOrfanJobsExceptList(this IMonitoringApi monitor, List exceptions) + { + var toDelete = new List(); + + foreach (QueueWithTopEnqueuedJobsDto queue in monitor.Queues()) + { + for (var i = 0; i < Math.Ceiling(queue.Length / 1000d); i++) + { + monitor.EnqueuedJobs(queue.Name, 1000 * i, 1000) + .ForEach(x => + { + if (!exceptions.Contains(x.Key)) + toDelete.Add(x.Key); + else + Console.WriteLine("x.Key " + x.Key + " remains."); + } + ); + } + } + + foreach (var jobId in toDelete) + { + BackgroundJob.Delete(jobId); + } + } + } +} diff --git a/src/LanBackupAgent/Utils/NativeMethods.cs b/src/LanBackupAgent/Utils/NativeMethods.cs new file mode 100644 index 0000000..949b0de --- /dev/null +++ b/src/LanBackupAgent/Utils/NativeMethods.cs @@ -0,0 +1,13 @@ +using System; +using System.Runtime.InteropServices; + +namespace LanBackupAgent.Utils +{ + public class NativeMethods + { + + [DllImport("advapi32.DLL", SetLastError = true, CharSet=CharSet.Unicode)] + private static extern int LogonUser(string lpszUsername, string lpszDomain, string lpszPassword, int dwLogonType, int dwLogonProvider, ref IntPtr phToken); + + } +} diff --git a/src/LanBackupAgent/Utils/Network.cs b/src/LanBackupAgent/Utils/Network.cs new file mode 100644 index 0000000..47741af --- /dev/null +++ b/src/LanBackupAgent/Utils/Network.cs @@ -0,0 +1,75 @@ +using NLog; +using System.Net; +using System.Net.NetworkInformation; +using System.Net.Sockets; + +namespace LanBackupAgent.Utils +{ + public class Network + { + + private string localIP = string.Empty; + ILogger logger; + + public Network(ILogger mlogger) { + this.logger = mlogger; + logger.Trace("Network instance initialized"); + } + + public string GetLocalIPAddress() + { + if (string.IsNullOrEmpty(localIP)) + { + UnicastIPAddressInformation mostSuitableIp = null; + + var networkInterfaces = NetworkInterface.GetAllNetworkInterfaces(); + + foreach (var network in networkInterfaces) + { + if (network.OperationalStatus != OperationalStatus.Up) + continue; + + var properties = network.GetIPProperties(); + + if (properties.GatewayAddresses.Count == 0) + continue; + + foreach (var address in properties.UnicastAddresses) + { + if (address.Address.AddressFamily != AddressFamily.InterNetwork) + continue; + + if (IPAddress.IsLoopback(address.Address)) + continue; + + if (!address.IsDnsEligible) + { + if (mostSuitableIp == null) + mostSuitableIp = address; + continue; + } + + // The best IP is the IP got from DHCP server + if (address.PrefixOrigin != PrefixOrigin.Dhcp) + { + if (mostSuitableIp == null || !mostSuitableIp.IsDnsEligible) + mostSuitableIp = address; + continue; + } + + localIP = address.Address.ToString(); + } + } + if (string.IsNullOrEmpty(localIP)) + { + localIP = mostSuitableIp != null + ? mostSuitableIp.Address.ToString() + : string.Empty; + } + } + logger.Trace($"Network instance IP: {localIP}"); + return localIP; + } + + } +} diff --git a/src/LanBackupAgent/Utils/TinyMessenger.cs b/src/LanBackupAgent/Utils/TinyMessenger.cs new file mode 100644 index 0000000..eb63373 --- /dev/null +++ b/src/LanBackupAgent/Utils/TinyMessenger.cs @@ -0,0 +1,793 @@ +//=============================================================================== +// TinyIoC - TinyMessenger +// +// A simple messenger/event aggregator. +// +// http://hg.grumpydev.com/tinyioc +//=============================================================================== +// Copyright © Steven Robbins. All rights reserved. +// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY +// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT +// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE. +//=============================================================================== + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace TinyMessenger +{ + #region Message Types / Interfaces + /// + /// A TinyMessage to be published/delivered by TinyMessenger + /// + public interface ITinyMessage + { + /// + /// The sender of the message, or null if not supported by the message implementation. + /// + object Sender { get; } + } + + /// + /// Base class for messages that provides weak refrence storage of the sender + /// + public abstract class TinyMessageBase : ITinyMessage + { + /// + /// Store a WeakReference to the sender just in case anyone is daft enough to + /// keep the message around and prevent the sender from being collected. + /// + private WeakReference _Sender; + public object Sender + { + get + { + return (_Sender == null) ? null : _Sender.Target; + } + } + + /// + /// Initializes a new instance of the MessageBase class. + /// + /// Message sender (usually "this") + public TinyMessageBase(object sender) + { + if (sender == null) + throw new ArgumentNullException("sender"); + + _Sender = new WeakReference(sender); + } + } + + /// + /// Generic message with user specified content + /// + /// Content type to store + public class GenericTinyMessage : TinyMessageBase + { + /// + /// Contents of the message + /// + public TContent Content { get; protected set; } + + /// + /// Create a new instance of the GenericTinyMessage class. + /// + /// Message sender (usually "this") + /// Contents of the message + public GenericTinyMessage(object sender, TContent content) + : base(sender) + { + Content = content; + } + } + + /// + /// Basic "cancellable" generic message + /// + /// Content type to store + public class CancellableGenericTinyMessage : TinyMessageBase + { + /// + /// Cancel action + /// + public Action Cancel { get; protected set; } + + /// + /// Contents of the message + /// + public TContent Content { get; protected set; } + + /// + /// Create a new instance of the CancellableGenericTinyMessage class. + /// + /// Message sender (usually "this") + /// Contents of the message + /// Action to call for cancellation + public CancellableGenericTinyMessage(object sender, TContent content, Action cancelAction) + : base(sender) + { + if (cancelAction == null) + throw new ArgumentNullException("cancelAction"); + + Content = content; + Cancel = cancelAction; + } + } + + /// + /// Represents an active subscription to a message + /// + public sealed class TinyMessageSubscriptionToken : IDisposable + { + private WeakReference _Hub; + private Type _MessageType; + + /// + /// Initializes a new instance of the TinyMessageSubscriptionToken class. + /// + public TinyMessageSubscriptionToken(ITinyMessengerHub hub, Type messageType) + { + if (hub == null) + throw new ArgumentNullException("hub"); + + if (!typeof(ITinyMessage).IsAssignableFrom(messageType)) + throw new ArgumentOutOfRangeException("messageType"); + + _Hub = new WeakReference(hub); + _MessageType = messageType; + } + + public void Dispose() + { + if (_Hub.IsAlive) + { + var hub = _Hub.Target as ITinyMessengerHub; + + if (hub != null) + { + var unsubscribeMethod = typeof(ITinyMessengerHub).GetMethod("Unsubscribe", new Type[] {typeof(TinyMessageSubscriptionToken)}); + unsubscribeMethod = unsubscribeMethod.MakeGenericMethod(_MessageType); + unsubscribeMethod.Invoke(hub, new object[] {this}); + } + } + + GC.SuppressFinalize(this); + } + } + + /// + /// Represents a message subscription + /// + public interface ITinyMessageSubscription + { + /// + /// Token returned to the subscribed to reference this subscription + /// + TinyMessageSubscriptionToken SubscriptionToken { get; } + + /// + /// Whether delivery should be attempted. + /// + /// Message that may potentially be delivered. + /// True - ok to send, False - should not attempt to send + bool ShouldAttemptDelivery(ITinyMessage message); + + /// + /// Deliver the message + /// + /// Message to deliver + void Deliver(ITinyMessage message); + } + + /// + /// Message proxy definition. + /// + /// A message proxy can be used to intercept/alter messages and/or + /// marshall delivery actions onto a particular thread. + /// + public interface ITinyMessageProxy + { + void Deliver(ITinyMessage message, ITinyMessageSubscription subscription); + } + + /// + /// Default "pass through" proxy. + /// + /// Does nothing other than deliver the message. + /// + public sealed class DefaultTinyMessageProxy : ITinyMessageProxy + { + private static readonly DefaultTinyMessageProxy _Instance = new DefaultTinyMessageProxy(); + + static DefaultTinyMessageProxy() + { + } + + /// + /// Singleton instance of the proxy. + /// + public static DefaultTinyMessageProxy Instance + { + get + { + return _Instance; + } + } + + private DefaultTinyMessageProxy() + { + } + + public void Deliver(ITinyMessage message, ITinyMessageSubscription subscription) + { + subscription.Deliver(message); + } + } + #endregion + + #region Exceptions + /// + /// Thrown when an exceptions occurs while subscribing to a message type + /// + [Serializable] + public class TinyMessengerSubscriptionException : Exception + { + private const string ERROR_TEXT = "Unable to add subscription for {0} : {1}"; + + public TinyMessengerSubscriptionException(Type messageType, string reason) + : base(String.Format(ERROR_TEXT, messageType, reason)) + { + + } + + public TinyMessengerSubscriptionException(Type messageType, string reason, Exception innerException) + : base(String.Format(ERROR_TEXT, messageType, reason), innerException) + { + + } + } + #endregion + + #region Hub Interface + /// + /// Messenger hub responsible for taking subscriptions/publications and delivering of messages. + /// + public interface ITinyMessengerHub + { + /// + /// Subscribe to a message type with the given destination and delivery action. + /// All references are held with WeakReferences + /// + /// All messages of this type will be delivered. + /// + /// Type of message + /// Action to invoke when message is delivered + /// TinyMessageSubscription used to unsubscribing + TinyMessageSubscriptionToken Subscribe(Action deliveryAction) where TMessage : class, ITinyMessage; + + /// + /// Subscribe to a message type with the given destination and delivery action. + /// Messages will be delivered via the specified proxy. + /// All references (apart from the proxy) are held with WeakReferences + /// + /// All messages of this type will be delivered. + /// + /// Type of message + /// Action to invoke when message is delivered + /// Proxy to use when delivering the messages + /// TinyMessageSubscription used to unsubscribing + TinyMessageSubscriptionToken Subscribe(Action deliveryAction, ITinyMessageProxy proxy) where TMessage : class, ITinyMessage; + + /// + /// Subscribe to a message type with the given destination and delivery action. + /// + /// All messages of this type will be delivered. + /// + /// Type of message + /// Action to invoke when message is delivered + /// Use strong references to destination and deliveryAction + /// TinyMessageSubscription used to unsubscribing + TinyMessageSubscriptionToken Subscribe(Action deliveryAction, bool useStrongReferences) where TMessage : class, ITinyMessage; + + /// + /// Subscribe to a message type with the given destination and delivery action. + /// Messages will be delivered via the specified proxy. + /// + /// All messages of this type will be delivered. + /// + /// Type of message + /// Action to invoke when message is delivered + /// Use strong references to destination and deliveryAction + /// Proxy to use when delivering the messages + /// TinyMessageSubscription used to unsubscribing + TinyMessageSubscriptionToken Subscribe(Action deliveryAction, bool useStrongReferences, ITinyMessageProxy proxy) where TMessage : class, ITinyMessage; + + /// + /// Subscribe to a message type with the given destination and delivery action with the given filter. + /// All references are held with WeakReferences + /// + /// Only messages that "pass" the filter will be delivered. + /// + /// Type of message + /// Action to invoke when message is delivered + /// TinyMessageSubscription used to unsubscribing + TinyMessageSubscriptionToken Subscribe(Action deliveryAction, Func messageFilter) where TMessage : class, ITinyMessage; + + /// + /// Subscribe to a message type with the given destination and delivery action with the given filter. + /// Messages will be delivered via the specified proxy. + /// All references (apart from the proxy) are held with WeakReferences + /// + /// Only messages that "pass" the filter will be delivered. + /// + /// Type of message + /// Action to invoke when message is delivered + /// Proxy to use when delivering the messages + /// TinyMessageSubscription used to unsubscribing + TinyMessageSubscriptionToken Subscribe(Action deliveryAction, Func messageFilter, ITinyMessageProxy proxy) where TMessage : class, ITinyMessage; + + /// + /// Subscribe to a message type with the given destination and delivery action with the given filter. + /// All references are held with WeakReferences + /// + /// Only messages that "pass" the filter will be delivered. + /// + /// Type of message + /// Action to invoke when message is delivered + /// Use strong references to destination and deliveryAction + /// TinyMessageSubscription used to unsubscribing + TinyMessageSubscriptionToken Subscribe(Action deliveryAction, Func messageFilter, bool useStrongReferences) where TMessage : class, ITinyMessage; + + /// + /// Subscribe to a message type with the given destination and delivery action with the given filter. + /// Messages will be delivered via the specified proxy. + /// All references are held with WeakReferences + /// + /// Only messages that "pass" the filter will be delivered. + /// + /// Type of message + /// Action to invoke when message is delivered + /// Use strong references to destination and deliveryAction + /// Proxy to use when delivering the messages + /// TinyMessageSubscription used to unsubscribing + TinyMessageSubscriptionToken Subscribe(Action deliveryAction, Func messageFilter, bool useStrongReferences, ITinyMessageProxy proxy) where TMessage : class, ITinyMessage; + + /// + /// Unsubscribe from a particular message type. + /// + /// Does not throw an exception if the subscription is not found. + /// + /// Type of message + /// Subscription token received from Subscribe + void Unsubscribe(TinyMessageSubscriptionToken subscriptionToken) where TMessage : class, ITinyMessage; + + /// + /// Publish a message to any subscribers + /// + /// Type of message + /// Message to deliver + void Publish(TMessage message) where TMessage : class, ITinyMessage; + + /// + /// Publish a message to any subscribers asynchronously + /// + /// Type of message + /// Message to deliver + void PublishAsync(TMessage message) where TMessage : class, ITinyMessage; + + /// + /// Publish a message to any subscribers asynchronously + /// + /// Type of message + /// Message to deliver + /// AsyncCallback called on completion + void PublishAsync(TMessage message, AsyncCallback callback) where TMessage : class, ITinyMessage; + } + #endregion + + #region Hub Implementation + /// + /// Messenger hub responsible for taking subscriptions/publications and delivering of messages. + /// + public sealed class TinyMessengerHub : ITinyMessengerHub + { + #region Private Types and Interfaces + private class WeakTinyMessageSubscription : ITinyMessageSubscription + where TMessage : class, ITinyMessage + { + protected TinyMessageSubscriptionToken _SubscriptionToken; + protected WeakReference _DeliveryAction; + protected WeakReference _MessageFilter; + + public TinyMessageSubscriptionToken SubscriptionToken + { + get { return _SubscriptionToken; } + } + + public bool ShouldAttemptDelivery(ITinyMessage message) + { + if (!(message is TMessage)) + return false; + + if (!_DeliveryAction.IsAlive) + return false; + + if (!_MessageFilter.IsAlive) + return false; + + return ((Func)_MessageFilter.Target).Invoke(message as TMessage); + } + + public void Deliver(ITinyMessage message) + { + if (!(message is TMessage)) + throw new ArgumentException("Message is not the correct type"); + + if (!_DeliveryAction.IsAlive) + return; + + ((Action)_DeliveryAction.Target).Invoke(message as TMessage); + } + + /// + /// Initializes a new instance of the WeakTinyMessageSubscription class. + /// + /// Destination object + /// Delivery action + /// Filter function + public WeakTinyMessageSubscription(TinyMessageSubscriptionToken subscriptionToken, Action deliveryAction, Func messageFilter) + { + if (subscriptionToken == null) + throw new ArgumentNullException("subscriptionToken"); + + if (deliveryAction == null) + throw new ArgumentNullException("deliveryAction"); + + if (messageFilter == null) + throw new ArgumentNullException("messageFilter"); + + _SubscriptionToken = subscriptionToken; + _DeliveryAction = new WeakReference(deliveryAction); + _MessageFilter = new WeakReference(messageFilter); + } + } + + private class StrongTinyMessageSubscription : ITinyMessageSubscription + where TMessage : class, ITinyMessage + { + protected TinyMessageSubscriptionToken _SubscriptionToken; + protected Action _DeliveryAction; + protected Func _MessageFilter; + + public TinyMessageSubscriptionToken SubscriptionToken + { + get { return _SubscriptionToken; } + } + + public bool ShouldAttemptDelivery(ITinyMessage message) + { + if (!(message is TMessage)) + return false; + + return _MessageFilter.Invoke(message as TMessage); + } + + public void Deliver(ITinyMessage message) + { + if (!(message is TMessage)) + throw new ArgumentException("Message is not the correct type"); + + _DeliveryAction.Invoke(message as TMessage); + } + + /// + /// Initializes a new instance of the TinyMessageSubscription class. + /// + /// Destination object + /// Delivery action + /// Filter function + public StrongTinyMessageSubscription(TinyMessageSubscriptionToken subscriptionToken, Action deliveryAction, Func messageFilter) + { + if (subscriptionToken == null) + throw new ArgumentNullException("subscriptionToken"); + + if (deliveryAction == null) + throw new ArgumentNullException("deliveryAction"); + + if (messageFilter == null) + throw new ArgumentNullException("messageFilter"); + + _SubscriptionToken = subscriptionToken; + _DeliveryAction = deliveryAction; + _MessageFilter = messageFilter; + } + } + #endregion + + #region Subscription dictionary + private class SubscriptionItem + { + public ITinyMessageProxy Proxy { get; private set; } + public ITinyMessageSubscription Subscription { get; private set; } + + public SubscriptionItem(ITinyMessageProxy proxy, ITinyMessageSubscription subscription) + { + Proxy = proxy; + Subscription = subscription; + } + } + + private readonly object _SubscriptionsPadlock = new object(); + private readonly Dictionary> _Subscriptions = new Dictionary>(); + #endregion + + #region Public API + /// + /// Subscribe to a message type with the given destination and delivery action. + /// All references are held with strong references + /// + /// All messages of this type will be delivered. + /// + /// Type of message + /// Action to invoke when message is delivered + /// TinyMessageSubscription used to unsubscribing + public TinyMessageSubscriptionToken Subscribe(Action deliveryAction) where TMessage : class, ITinyMessage + { + return AddSubscriptionInternal(deliveryAction, (m) => true, true, DefaultTinyMessageProxy.Instance); + } + + /// + /// Subscribe to a message type with the given destination and delivery action. + /// Messages will be delivered via the specified proxy. + /// All references (apart from the proxy) are held with strong references + /// + /// All messages of this type will be delivered. + /// + /// Type of message + /// Action to invoke when message is delivered + /// Proxy to use when delivering the messages + /// TinyMessageSubscription used to unsubscribing + public TinyMessageSubscriptionToken Subscribe(Action deliveryAction, ITinyMessageProxy proxy) where TMessage : class, ITinyMessage + { + return AddSubscriptionInternal(deliveryAction, (m) => true, true, proxy); + } + + /// + /// Subscribe to a message type with the given destination and delivery action. + /// + /// All messages of this type will be delivered. + /// + /// Type of message + /// Action to invoke when message is delivered + /// Use strong references to destination and deliveryAction + /// TinyMessageSubscription used to unsubscribing + public TinyMessageSubscriptionToken Subscribe(Action deliveryAction, bool useStrongReferences) where TMessage : class, ITinyMessage + { + return AddSubscriptionInternal(deliveryAction, (m) => true, useStrongReferences, DefaultTinyMessageProxy.Instance); + } + + /// + /// Subscribe to a message type with the given destination and delivery action. + /// Messages will be delivered via the specified proxy. + /// + /// All messages of this type will be delivered. + /// + /// Type of message + /// Action to invoke when message is delivered + /// Use strong references to destination and deliveryAction + /// Proxy to use when delivering the messages + /// TinyMessageSubscription used to unsubscribing + public TinyMessageSubscriptionToken Subscribe(Action deliveryAction, bool useStrongReferences, ITinyMessageProxy proxy) where TMessage : class, ITinyMessage + { + return AddSubscriptionInternal(deliveryAction, (m) => true, useStrongReferences, proxy); + } + + /// + /// Subscribe to a message type with the given destination and delivery action with the given filter. + /// All references are held with WeakReferences + /// + /// Only messages that "pass" the filter will be delivered. + /// + /// Type of message + /// Action to invoke when message is delivered + /// TinyMessageSubscription used to unsubscribing + public TinyMessageSubscriptionToken Subscribe(Action deliveryAction, Func messageFilter) where TMessage : class, ITinyMessage + { + return AddSubscriptionInternal(deliveryAction, messageFilter, true, DefaultTinyMessageProxy.Instance); + } + + /// + /// Subscribe to a message type with the given destination and delivery action with the given filter. + /// Messages will be delivered via the specified proxy. + /// All references (apart from the proxy) are held with WeakReferences + /// + /// Only messages that "pass" the filter will be delivered. + /// + /// Type of message + /// Action to invoke when message is delivered + /// Proxy to use when delivering the messages + /// TinyMessageSubscription used to unsubscribing + public TinyMessageSubscriptionToken Subscribe(Action deliveryAction, Func messageFilter, ITinyMessageProxy proxy) where TMessage : class, ITinyMessage + { + return AddSubscriptionInternal(deliveryAction, messageFilter, true, proxy); + } + + /// + /// Subscribe to a message type with the given destination and delivery action with the given filter. + /// All references are held with WeakReferences + /// + /// Only messages that "pass" the filter will be delivered. + /// + /// Type of message + /// Action to invoke when message is delivered + /// Use strong references to destination and deliveryAction + /// TinyMessageSubscription used to unsubscribing + public TinyMessageSubscriptionToken Subscribe(Action deliveryAction, Func messageFilter, bool useStrongReferences) where TMessage : class, ITinyMessage + { + return AddSubscriptionInternal(deliveryAction, messageFilter, useStrongReferences, DefaultTinyMessageProxy.Instance); + } + + /// + /// Subscribe to a message type with the given destination and delivery action with the given filter. + /// Messages will be delivered via the specified proxy. + /// All references are held with WeakReferences + /// + /// Only messages that "pass" the filter will be delivered. + /// + /// Type of message + /// Action to invoke when message is delivered + /// Use strong references to destination and deliveryAction + /// Proxy to use when delivering the messages + /// TinyMessageSubscription used to unsubscribing + public TinyMessageSubscriptionToken Subscribe(Action deliveryAction, Func messageFilter, bool useStrongReferences, ITinyMessageProxy proxy) where TMessage : class, ITinyMessage + { + return AddSubscriptionInternal(deliveryAction, messageFilter, useStrongReferences, proxy); + } + + /// + /// Unsubscribe from a particular message type. + /// + /// Does not throw an exception if the subscription is not found. + /// + /// Type of message + /// Subscription token received from Subscribe + public void Unsubscribe(TinyMessageSubscriptionToken subscriptionToken) where TMessage : class, ITinyMessage + { + RemoveSubscriptionInternal(subscriptionToken); + } + + /// + /// Publish a message to any subscribers + /// + /// Type of message + /// Message to deliver + public void Publish(TMessage message) where TMessage : class, ITinyMessage + { + PublishInternal(message); + } + + /// + /// Publish a message to any subscribers asynchronously + /// + /// Type of message + /// Message to deliver + public void PublishAsync(TMessage message) where TMessage : class, ITinyMessage + { + PublishAsyncInternal(message, null); + } + + /// + /// Publish a message to any subscribers asynchronously + /// + /// Type of message + /// Message to deliver + /// AsyncCallback called on completion + public void PublishAsync(TMessage message, AsyncCallback callback) where TMessage : class, ITinyMessage + { + PublishAsyncInternal(message, callback); + } + #endregion + + #region Internal Methods + private TinyMessageSubscriptionToken AddSubscriptionInternal(Action deliveryAction, Func messageFilter, bool strongReference, ITinyMessageProxy proxy) + where TMessage : class, ITinyMessage + { + if (deliveryAction == null) + throw new ArgumentNullException("deliveryAction"); + + if (messageFilter == null) + throw new ArgumentNullException("messageFilter"); + + if (proxy == null) + throw new ArgumentNullException("proxy"); + + lock (_SubscriptionsPadlock) + { + List currentSubscriptions; + + if (!_Subscriptions.TryGetValue(typeof(TMessage), out currentSubscriptions)) + { + currentSubscriptions = new List(); + _Subscriptions[typeof(TMessage)] = currentSubscriptions; + } + + var subscriptionToken = new TinyMessageSubscriptionToken(this, typeof(TMessage)); + + ITinyMessageSubscription subscription; + if (strongReference) + subscription = new StrongTinyMessageSubscription(subscriptionToken, deliveryAction, messageFilter); + else + subscription = new WeakTinyMessageSubscription(subscriptionToken, deliveryAction, messageFilter); + + currentSubscriptions.Add(new SubscriptionItem(proxy, subscription)); + + return subscriptionToken; + } + } + + private void RemoveSubscriptionInternal(TinyMessageSubscriptionToken subscriptionToken) + where TMessage : class, ITinyMessage + { + if (subscriptionToken == null) + throw new ArgumentNullException("subscriptionToken"); + + lock (_SubscriptionsPadlock) + { + List currentSubscriptions; + if (!_Subscriptions.TryGetValue(typeof(TMessage), out currentSubscriptions)) + return; + + var currentlySubscribed = (from sub in currentSubscriptions + where object.ReferenceEquals(sub.Subscription.SubscriptionToken, subscriptionToken) + select sub).ToList(); + + currentlySubscribed.ForEach(sub => currentSubscriptions.Remove(sub)); + } + } + + private void PublishInternal(TMessage message) + where TMessage : class, ITinyMessage + { + if (message == null) + throw new ArgumentNullException("message"); + + List currentlySubscribed; + lock (_SubscriptionsPadlock) + { + List currentSubscriptions; + if (!_Subscriptions.TryGetValue(typeof(TMessage), out currentSubscriptions)) + return; + + currentlySubscribed = (from sub in currentSubscriptions + where sub.Subscription.ShouldAttemptDelivery(message) + select sub).ToList(); + } + + currentlySubscribed.ForEach(sub => + { + try + { + sub.Proxy.Deliver(message, sub.Subscription); + } + catch (Exception) + { + // Ignore any errors and carry on + // TODO - add to a list of erroring subs and remove them? + } + }); + } + + private void PublishAsyncInternal(TMessage message, AsyncCallback callback) where TMessage : class, ITinyMessage + { + Action publishAction = () => { PublishInternal(message); }; + + publishAction.BeginInvoke(callback, null); + } + #endregion + } + #endregion +} diff --git a/src/LanBackupAgent/WebApi/WebApiService.cs b/src/LanBackupAgent/WebApi/WebApiService.cs new file mode 100644 index 0000000..e2dd70d --- /dev/null +++ b/src/LanBackupAgent/WebApi/WebApiService.cs @@ -0,0 +1,143 @@ +using LanBackupAgent.Message; +using LanBackupAgent.Models; +using LanBackupAgent.Utils; +using Microsoft.Rest; +using NLog; +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using TinyMessenger; + +namespace LanBackupAgent.WebApi +{ + public class WebApiService + { + private ILogger logger; + private ITinyMessengerHub messenger; + private string webapiUrlBase; + + public WebApiService(string mwebapiUrlBase, + ILogger mlogger, + ITinyMessengerHub mmessenger + ) + { + this.webapiUrlBase = mwebapiUrlBase; + this.logger = mlogger; + this.messenger = mmessenger; + + this.messenger.Subscribe(Stop); + logger.Trace("WebApiService instance initialized"); + } + + private void Stop(StopMessage obj) + { + //TODO - implement cancelation + } + + public async Task> LoadBackupConfigurations() + { + IList result = new List(); + try + { + LanBackupsAPI api = getApi(); + //retrieve own backup configurations + string localIp = DI.Container.GetInstance().GetLocalIPAddress(); + result = await api.ApiBackupConfigClientByClientidGetAsync(localIp); + + if (result != null) + { + logger.Info($"loadBackupConfigurations WebApi, response: {result.Count} configurations."); + } + else + { + logger.Info($"loadBackupConfigurations WebApi, response: NO configurations."); + } + } + catch (HttpRequestException hex) + { + if (hex.InnerException is WebException) + { + WebException wex = hex.InnerException as WebException; + if (wex.Status == WebExceptionStatus.ConnectFailure) + { + //ignore this err + } + else + { + logger.Error($"ERR WebException HResult: {wex.HResult}"); + logger.Error($"ERR WebException Status: {wex.Status}"); + logger.Error($"ERR WebException Message: {wex.Message}"); + } + } + } + catch (Exception ex) + { + logger.Error($"loadBackupConfigurations ERROR: {ex}"); + } + return result; + } + + + + public async void LogActivity(string backupId, string message, string error, string status) + { + try + { + LanBackupsAPI api = getApi(); + // submit activity status + var log = new BackupLog() + { + ClientIP = DI.Container.GetInstance().GetLocalIPAddress(), + Status = status, + Description = message, + LogError = error, + DateTime = DateTime.UtcNow + }; + var result = await api.ApiLogsPostAsync(log); + + logger.Info($"Log sent to WebApi, response ID: {result}"); + } + catch (HttpRequestException hex) + { + if (hex.InnerException is WebException) + { + WebException wex = hex.InnerException as WebException; + if (wex.Status == WebExceptionStatus.ConnectFailure) + { + //ignore this err + } + else + { + logger.Error($"ERR WebException HResult: {wex.HResult}"); + logger.Error($"ERR WebException Status: {wex.Status}"); + logger.Error($"ERR WebException Message: {wex.Message}"); + } + } + } + catch (Exception ex) + { + logger.Error($"WebApi ERROR: {ex}"); + } + + } + + + + #region helper + + private LanBackupsAPI getApi() + { + string webApiUrl = webapiUrlBase; + var credentials = new TokenCredentials(""); + LanBackupsAPI api = new LanBackupsAPI(new Uri( + webApiUrl + ), credentials); + return api; + } + + #endregion helper + + } +} diff --git a/src/LanBackupAgent/app_icon.png.ico b/src/LanBackupAgent/app_icon.png.ico new file mode 100644 index 0000000..ab5c571 Binary files /dev/null and b/src/LanBackupAgent/app_icon.png.ico differ diff --git a/src/LanBackupAgent/nlog.Debug.config b/src/LanBackupAgent/nlog.Debug.config new file mode 100644 index 0000000..dd82eec --- /dev/null +++ b/src/LanBackupAgent/nlog.Debug.config @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/src/LanBackupAgent/nlog.Release.config b/src/LanBackupAgent/nlog.Release.config new file mode 100644 index 0000000..d17e673 --- /dev/null +++ b/src/LanBackupAgent/nlog.Release.config @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/src/LanBackupAgent/nlog.config b/src/LanBackupAgent/nlog.config new file mode 100644 index 0000000..cd35770 --- /dev/null +++ b/src/LanBackupAgent/nlog.config @@ -0,0 +1,16 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/LanBackupAgent/packages.config b/src/LanBackupAgent/packages.config new file mode 100644 index 0000000..7454fea --- /dev/null +++ b/src/LanBackupAgent/packages.config @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/LanBackupAgentSetup/LanBackupAgentSetup.wax b/src/LanBackupAgentSetup/LanBackupAgentSetup.wax new file mode 100644 index 0000000..b7a399f Binary files /dev/null and b/src/LanBackupAgentSetup/LanBackupAgentSetup.wax differ diff --git a/src/LanBackupAgentSetup/LanBackupAgentSetup.wixproj b/src/LanBackupAgentSetup/LanBackupAgentSetup.wixproj new file mode 100644 index 0000000..d8ea090 --- /dev/null +++ b/src/LanBackupAgentSetup/LanBackupAgentSetup.wixproj @@ -0,0 +1,63 @@ + + + + Debug + x86 + 3.10 + f530020f-0df2-49b8-9401-1c1c282077f5 + 2.0 + LanBackupAgentSetup + Package + $(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets + $(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets + + + bin\$(Configuration)\ + obj\$(Configuration)\ + Debug + + + bin\$(Configuration)\ + obj\$(Configuration)\ + + + + + + + + + + + + + + + $(WixExtDir)\WixUtilExtension.dll + WixUtilExtension + + + $(WixExtDir)\WixUIExtension.dll + WixUIExtension + + + + + LanBackupAgent + {cb7ee867-93e8-43e3-9eee-9068aed1de6c} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + + + + + \ No newline at end of file diff --git a/src/LanBackupAgentSetup/Product.wxs b/src/LanBackupAgentSetup/Product.wxs new file mode 100644 index 0000000..85495f4 --- /dev/null +++ b/src/LanBackupAgentSetup/Product.wxs @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/LanBackupAgentSetup/app_icon.ico b/src/LanBackupAgentSetup/app_icon.ico new file mode 100644 index 0000000..ab5c571 Binary files /dev/null and b/src/LanBackupAgentSetup/app_icon.ico differ diff --git a/src/LanBackupAgentSetup/license.rtf b/src/LanBackupAgentSetup/license.rtf new file mode 100644 index 0000000..32562ed --- /dev/null +++ b/src/LanBackupAgentSetup/license.rtf @@ -0,0 +1,210 @@ +{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31506\stshfloch31506\stshfhich31506\stshfbi31507\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhimajor\f31502\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0302020204030204}Calibri Light;} +{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;} +{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f41\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f42\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\f44\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f45\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f46\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f47\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\f48\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f49\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f41\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f42\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\f44\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f45\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f46\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f47\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\f48\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f49\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f411\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f412\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;} +{\f414\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f415\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f416\fbidi \fswiss\fcharset177\fprq2 Calibri (Hebrew);}{\f417\fbidi \fswiss\fcharset178\fprq2 Calibri (Arabic);} +{\f418\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f419\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\fhimajor\f31528\fbidi \fswiss\fcharset238\fprq2 Calibri Light CE;}{\fhimajor\f31529\fbidi \fswiss\fcharset204\fprq2 Calibri Light Cyr;}{\fhimajor\f31531\fbidi \fswiss\fcharset161\fprq2 Calibri Light Greek;} +{\fhimajor\f31532\fbidi \fswiss\fcharset162\fprq2 Calibri Light Tur;}{\fhimajor\f31533\fbidi \fswiss\fcharset177\fprq2 Calibri Light (Hebrew);}{\fhimajor\f31534\fbidi \fswiss\fcharset178\fprq2 Calibri Light (Arabic);} +{\fhimajor\f31535\fbidi \fswiss\fcharset186\fprq2 Calibri Light Baltic;}{\fhimajor\f31536\fbidi \fswiss\fcharset163\fprq2 Calibri Light (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} +{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;} +{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;} +{\fhiminor\f31573\fbidi \fswiss\fcharset177\fprq2 Calibri (Hebrew);}{\fhiminor\f31574\fbidi \fswiss\fcharset178\fprq2 Calibri (Arabic);}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;} +{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}} +{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0; +\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\*\defchp \f31506\fs22 }{\*\defpap \ql \li0\ri0\sa160\sl259\slmult1 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\sa160\sl259\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 +\ltrch\fcs0 \f31506\fs22\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\* +\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa160\sl259\slmult1 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext11 \ssemihidden \sunhideused Normal Table;}} +{\*\rsidtbl \rsid1381853\rsid6624395\rsid10097776\rsid11094156\rsid12995017}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\author CF} +{\operator CF}{\creatim\yr2017\mo1\dy27\hr1\min13}{\revtim\yr2017\mo1\dy27\hr1\min13}{\version2}{\edmins0}{\nofpages1}{\nofwords5}{\nofchars29}{\nofcharsws33}{\vern23}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml} +}\paperw11907\paperh16840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect +\widowctrl\ftnbj\aenddoc\trackmoves0\trackformatting1\donotembedsysfont1\relyonvml0\donotembedlingdata0\grfdocevents0\validatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors1\noxlattoyen +\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin\dghspace110\dgvspace180\dghorigin1440\dgvorigin1440\dghshow2\dgvshow2 +\jexpand\viewkind1\viewscale120\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct +\asianbrkrule\rsidroot11094156\newtblstyruls\nogrowautofit\usenormstyforlist\noindnmbrts\felnbrelev\nocxsptable\indrlsweleven\noafcnsttbl\afelev\utinl\hwelev\spltpgpar\notcvasp\notbrkcnstfrctbl\notvatxbx\krnprsnet\cachedcolbal \nouicompat \fet0 +{\*\wgrffmtfilter 2450}\nofeaturethrottle1\ilfomacatclnup0\ltrpar \sectd \ltrsect\psz9\linex0\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6624395\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2 +\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6 +\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang +{\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri0\sa160\sl259\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 +\f31506\fs22\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid11094156 NO LICENSE FILE}{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid1381853 +\par }{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid11094156 FREE FOR EVERYONE +\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a +9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad +5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6 +b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0 +0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6 +a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f +c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512 +0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462 +a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865 +6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b +4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b +4757e8d3f729e245eb2b260a0238fd010000ffff0300504b030414000600080000002100b6f4679893070000c9200000160000007468656d652f7468656d652f +7468656d65312e786d6cec59cd8b1bc915bf07f23f347d97f5d5ad8fc1f2a24fcfda33b6b164873dd648a5eef2547789aad28cc56208de532e81c026e49085bd +ed21842cecc22eb9e48f31d8249b3f22afaa5bdd5552c99e191c3061463074977eefd5afde7bf5de53d5ddcf5e26d4bbc05c1096f6fcfa9d9aefe174ce16248d +7afeb3d9a4d2f13d2151ba4094a5b8e76fb0f03fbbf7eb5fdd454732c609f6403e1547a8e7c752ae8eaa5531876124eeb0154ee1bb25e30992f0caa3ea82a34b +d09bd06aa3566b55134452df4b51026a1f2f97648ebd9952e9dfdb2a1f53784da5500373caa74a35b6243476715e5708b11143cabd0b447b3eccb3609733fc52 +fa1e4542c2173dbfa6fffceabdbb5574940b517940d6909be8bf5c2e17589c37f49c3c3a2b260d823068f50bfd1a40e53e6edc1eb7c6ad429f06a0f91c569a71 +b175b61bc320c71aa0ecd1a17bd41e35eb16ded0dfdce3dc0fd5c7c26b50a63fd8c34f2643b0a285d7a00c1feee1c3417730b2f56b50866fede1dbb5fe28685b +fa3528a6243ddf43d7c25673b85d6d0159327aec8477c360d26ee4ca4b144443115d6a8a254be5a1584bd00bc6270050408a24493db959e1259a43140f112567 +9c7827248a21f056286502866b8ddaa4d684ffea13e827ed5174849121ad780113b137a4f87862cec94af6fc07a0d537206f7ffef9cdeb1fdfbcfee9cd575fbd +79fdf77c6eadca923b466964cafdf2dd1ffef3cd6fbd7ffff0ed2f5fff319b7a172f4cfcbbbffdeedd3ffef93ef5b0e2d2146ffff4fdbb1fbf7ffbe7dfffebaf +5f3bb4f7393a33e1339260e13dc297de5396c0021dfcf119bf9ec42c46c494e8a791402952b338f48f656ca11f6d10450edc00db767cce21d5b880f7d72f2cc2 +d398af2571687c182716f094313a60dc6985876a2ec3ccb3751ab927e76b13f714a10bd7dc43945a5e1eaf579063894be530c616cd2714a5124538c5d253dfb1 +738c1dabfb8210cbaea764ce99604be97d41bc01224e93ccc899154da5d03149c02f1b1741f0b7659bd3e7de8051d7aa47f8c246c2de40d4417e86a965c6fb68 +2d51e252394309350d7e8264ec2239ddf0b9891b0b099e8e3065de78818570c93ce6b05ec3e90f21cdb8dd7e4a37898de4929cbb749e20c64ce4889d0f6394ac +5cd829496313fbb938871045de13265df05366ef10f50e7e40e941773f27d872f787b3c133c8b026a53240d4376beef0e57dccacf89d6ee8126157aae9f3c44a +b17d4e9cd131584756689f604cd1255a60ec3dfbdcc160c05696cd4bd20f62c82ac7d815580f901dabea3dc5027a25d5dcece7c91322ac909de2881de073bad9 +493c1b9426881fd2fc08bc6eda7c0ca52e7105c0633a3f37818f08f480102f4ea33c16a0c308ee835a9fc4c82a60ea5db8e375c32dff5d658fc1be7c61d1b8c2 +be04197c6d1948eca6cc7b6d3343d49aa00c9819822ec3956e41c4727f29a28aab165b3be596f6a62ddd00dd91d5f42424fd6007b4d3fb84ffbbde073a8cb77f +f9c6b10f3e4ebfe3566c25ab6b763a8792c9f14e7f7308b7dbd50c195f904fbfa919a175fa04431dd9cf58b73dcd6d4fe3ffdff73487f6f36d2773a8dfb8ed64 +7ce8306e3b99fc70e5e3743265f3027d8d3af0c80e7af4b14f72f0d46749289dca0dc527421ffc08f83db398c0a092d3279eb838055cc5f0a8ca1c4c60e1228e +b48cc799fc0d91f134462b381daafb4a492472d591f0564cc0a1911e76ea5678ba4e4ed9223becacd7d5c16656590592e5782d2cc6e1a04a66e856bb3cc02bd4 +6bb6913e68dd1250b2d721614c6693683a48b4b783ca48fa58178ce620a157f65158741d2c3a4afdd6557b2c805ae115f8c1edc1cff49e1f06200242701e07cd +f942f92973f5d6bbda991fd3d3878c69450034d8db08283ddd555c0f2e4fad2e0bb52b78da2261849b4d425b46377822869fc17974aad1abd0b8aeafbba54b2d +7aca147a3e08ad9246bbf33e1637f535c8ede6069a9a9982a6de65cf6f35430899395af5fc251c1ac363b282d811ea3717a211dcbccc25cf36fc4d32cb8a0b39 +4222ce0cae934e960d122231f728497abe5a7ee1069aea1ca2b9d51b90103e59725d482b9f1a3970baed64bc5ce2b934dd6e8c284b67af90e1b35ce1fc568bdf +1cac24d91adc3d8d1797de195df3a708422c6cd795011744c0dd413db3e682c0655891c8caf8db294c79da356fa3740c65e388ae62945714339967709dca0b3a +faadb081f196af190c6a98242f8467912ab0a651ad6a5a548d8cc3c1aafb6121653923699635d3ca2aaa6abab39835c3b60cecd8f26645de60b53531e434b3c2 +67a97b37e576b7b96ea74f28aa0418bcb09fa3ea5ea12018d4cac92c6a8af17e1a56393b1fb56bc776811fa07695226164fdd656ed8edd8a1ae19c0e066f54f9 +416e376a6168b9ed2bb5a5f5adb979b1cdce5e40f2184197bba6526857c2c92e47d0104d754f92a50dd8222f65be35e0c95b73d2f3bfac85fd60d80887955a27 +1c57826650ab74c27eb3d20fc3667d1cd66ba341e31514161927f530bbb19fc00506dde4f7f67a7cefee3ed9ded1dc99b3a4caf4dd7c5513d777f7f5c6e1bb7b +8f40d2f9b2d598749bdd41abd26df627956034e854bac3d6a0326a0ddba3c9681876ba9357be77a1c141bf390c5ae34ea5551f0e2b41aba6e877ba9576d068f4 +8376bf330efaaff23606569ea58fdc16605ecdebde7f010000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d65 +2f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d36 +3f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e +3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d985 +0528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000000000 +0000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000000000 +000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019020000 +7468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d0014000600080000002100b6f4679893070000c92000001600000000000000 +000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027000000 +000000000000000000009d0a00007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000980b00000000} +{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d +617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169 +6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363 +656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e} +{\*\latentstyles\lsdstimax374\lsdlockeddef0\lsdsemihiddendef0\lsdunhideuseddef0\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 1; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 5; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 6;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 7;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 8;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 9; +\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 1;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 2;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 3; +\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 4;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 5;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 6; +\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 7;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 8;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 9;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal Indent; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footnote text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 header;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footer; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index heading;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 table of figures; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 envelope address;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 envelope return;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footnote reference;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation reference; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 line number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 page number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 endnote reference;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 endnote text; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 table of authorities;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 macro;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 toa heading;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 5;\lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Closing; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Signature;\lsdsemihidden1 \lsdunhideused1 \lsdpriority1 \lsdlocked0 Default Paragraph Font;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 4; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Message Header;\lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Salutation; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Date;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text First Indent;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text First Indent 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Note Heading; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Block Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Hyperlink;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 FollowedHyperlink;\lsdqformat1 \lsdpriority22 \lsdlocked0 Strong; +\lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Document Map;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Plain Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 E-mail Signature; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Top of Form;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Bottom of Form;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal (Web);\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Acronym; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Address;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Cite;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Code;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Definition; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Keyboard;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Preformatted;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Sample;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Typewriter; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Variable;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal Table;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation subject;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 No List; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Simple 1; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Simple 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Simple 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Classic 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Classic 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Classic 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Classic 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Colorful 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Colorful 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Colorful 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 6; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 7;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 8;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 6; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 7;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 8;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table 3D effects 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table 3D effects 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table 3D effects 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Contemporary;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Elegant;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Professional; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Subtle 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Subtle 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Web 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Web 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Web 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Balloon Text;\lsdpriority39 \lsdlocked0 Table Grid;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Theme;\lsdsemihidden1 \lsdlocked0 Placeholder Text; +\lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;\lsdpriority60 \lsdlocked0 Light Shading;\lsdpriority61 \lsdlocked0 Light List;\lsdpriority62 \lsdlocked0 Light Grid;\lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdpriority64 \lsdlocked0 Medium Shading 2; +\lsdpriority65 \lsdlocked0 Medium List 1;\lsdpriority66 \lsdlocked0 Medium List 2;\lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdpriority68 \lsdlocked0 Medium Grid 2;\lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdpriority70 \lsdlocked0 Dark List; +\lsdpriority71 \lsdlocked0 Colorful Shading;\lsdpriority72 \lsdlocked0 Colorful List;\lsdpriority73 \lsdlocked0 Colorful Grid;\lsdpriority60 \lsdlocked0 Light Shading Accent 1;\lsdpriority61 \lsdlocked0 Light List Accent 1; +\lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdsemihidden1 \lsdlocked0 Revision; +\lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1; +\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;\lsdpriority72 \lsdlocked0 Colorful List Accent 1; +\lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdpriority60 \lsdlocked0 Light Shading Accent 2;\lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2; +\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2; +\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;\lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdpriority72 \lsdlocked0 Colorful List Accent 2;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 2; +\lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdpriority61 \lsdlocked0 Light List Accent 3;\lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3; +\lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3; +\lsdpriority70 \lsdlocked0 Dark List Accent 3;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;\lsdpriority60 \lsdlocked0 Light Shading Accent 4; +\lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdpriority62 \lsdlocked0 Light Grid Accent 4;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 4; +\lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdpriority70 \lsdlocked0 Dark List Accent 4; +\lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;\lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdpriority60 \lsdlocked0 Light Shading Accent 5;\lsdpriority61 \lsdlocked0 Light List Accent 5; +\lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 5; +\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;\lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 5; +\lsdpriority72 \lsdlocked0 Colorful List Accent 5;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdpriority61 \lsdlocked0 Light List Accent 6;\lsdpriority62 \lsdlocked0 Light Grid Accent 6; +\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 6; +\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdpriority70 \lsdlocked0 Dark List Accent 6;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 6; +\lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;\lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis; +\lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;\lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdsemihidden1 \lsdunhideused1 \lsdpriority37 \lsdlocked0 Bibliography; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;\lsdpriority41 \lsdlocked0 Plain Table 1;\lsdpriority42 \lsdlocked0 Plain Table 2;\lsdpriority43 \lsdlocked0 Plain Table 3;\lsdpriority44 \lsdlocked0 Plain Table 4; +\lsdpriority45 \lsdlocked0 Plain Table 5;\lsdpriority40 \lsdlocked0 Grid Table Light;\lsdpriority46 \lsdlocked0 Grid Table 1 Light;\lsdpriority47 \lsdlocked0 Grid Table 2;\lsdpriority48 \lsdlocked0 Grid Table 3;\lsdpriority49 \lsdlocked0 Grid Table 4; +\lsdpriority50 \lsdlocked0 Grid Table 5 Dark;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 1;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 1; +\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 1;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 1;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 1;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 1; +\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 1;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 2;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 2;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 2; +\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 2;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 2;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 2;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 2; +\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 3;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 3;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 3;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 3; +\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 3;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 3;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 3;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 4; +\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 4;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 4;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 4;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 4; +\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 4;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 4;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 5;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 5; +\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 5;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 5;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 5; +\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 5;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 6;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 6; +\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 6;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 6; +\lsdpriority46 \lsdlocked0 List Table 1 Light;\lsdpriority47 \lsdlocked0 List Table 2;\lsdpriority48 \lsdlocked0 List Table 3;\lsdpriority49 \lsdlocked0 List Table 4;\lsdpriority50 \lsdlocked0 List Table 5 Dark; +\lsdpriority51 \lsdlocked0 List Table 6 Colorful;\lsdpriority52 \lsdlocked0 List Table 7 Colorful;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 1;\lsdpriority47 \lsdlocked0 List Table 2 Accent 1;\lsdpriority48 \lsdlocked0 List Table 3 Accent 1; +\lsdpriority49 \lsdlocked0 List Table 4 Accent 1;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 1;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 1;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 1; +\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 2;\lsdpriority47 \lsdlocked0 List Table 2 Accent 2;\lsdpriority48 \lsdlocked0 List Table 3 Accent 2;\lsdpriority49 \lsdlocked0 List Table 4 Accent 2; +\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 2;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 2;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 2;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 3; +\lsdpriority47 \lsdlocked0 List Table 2 Accent 3;\lsdpriority48 \lsdlocked0 List Table 3 Accent 3;\lsdpriority49 \lsdlocked0 List Table 4 Accent 3;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 3; +\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 3;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 3;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 4;\lsdpriority47 \lsdlocked0 List Table 2 Accent 4; +\lsdpriority48 \lsdlocked0 List Table 3 Accent 4;\lsdpriority49 \lsdlocked0 List Table 4 Accent 4;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 4;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 4; +\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 4;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 5;\lsdpriority47 \lsdlocked0 List Table 2 Accent 5;\lsdpriority48 \lsdlocked0 List Table 3 Accent 5; +\lsdpriority49 \lsdlocked0 List Table 4 Accent 5;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 5;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 5; +\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 List Table 2 Accent 6;\lsdpriority48 \lsdlocked0 List Table 3 Accent 6;\lsdpriority49 \lsdlocked0 List Table 4 Accent 6; +\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 6;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Mention; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Smart Hyperlink;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Hashtag;}}{\*\datastore 0105000002000000180000004d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000 +d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000e001 +8bcc2978d201feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file diff --git a/test/LanBackup.WebAppSpa.Tests/IntegrationTests/ApiLogsControllerTests.cs b/test/LanBackup.WebAppSpa.Tests/IntegrationTests/ApiLogsControllerTests.cs new file mode 100644 index 0000000..6e7544f --- /dev/null +++ b/test/LanBackup.WebAppSpa.Tests/IntegrationTests/ApiLogsControllerTests.cs @@ -0,0 +1,173 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Threading.Tasks; +using Xunit; +using Xunit.Abstractions; +using Microsoft.Data.Sqlite; +using Microsoft.EntityFrameworkCore; +using LanBackup.DataCore; +using LanBackup.ModelsCore; +using LanBackup.WebApp.Controllers; +using Microsoft.AspNetCore.Mvc; +using AutoMapper; +using LanBackup.WebApp.Models.Telemetry; +using LanBackup.WebApp.Models.DTO; + +namespace LanBackup.WebApp.Tests.IntegrationTests +{ + public class ApiLogsControllerTests : IClassFixture> + { + + private readonly HttpClient _client; + private ITestOutputHelper _output; + private ITelemetryLogger _tele; + + public ApiLogsControllerTests(TestFixture fixture, ITestOutputHelper output) + { + _output = output; + _client = fixture.Client; + + Mapper.Initialize(cfg => cfg.AddProfiles(typeof(LanBackup.WebApp.Startup))); + + _tele = new MockTelemetry(); + + } + + + + + [Fact] + public async Task GetAllLogRecords() + { + // Arrange + + // Act + var response = await _client.GetAsync("/api/logs"); + + // Assert + response.EnsureSuccessStatusCode(); + var jsonStr = await response.Content.ReadAsStringAsync(); + var logList = JsonConvert.DeserializeObject>(jsonStr); + + Assert.NotEmpty(logList); + } + + + + + + + + + #region SqliteInMemory DB tests + + [Fact] + public async void WithSqliteInmemoryTestMethod() + { + using (var mctx = new GetSqliteMemoryContext().GetContext()) + { + var service = new LogsController(Mapper.Instance, mctx, _tele); + var res = Assert.IsType(await service.Get(null, null)); + var val1 = Assert.IsType>(res.Value); + + Assert.Equal(5, val1.Count()); + } + } + + + [Fact] + public async void GetByIdWithSqliteInmemoryTestMethod() + { + + using (var mctx = new GetSqliteMemoryContext().GetContext()) + { + var recId = 1; + var service = new LogsController(Mapper.Instance, mctx, _tele); + + var res = Assert.IsType(service.Get(recId)); + var val1 = Assert.IsType(res.Value); + + Assert.NotNull(val1); + + var res2 = Assert.IsType(service.Get(10000)); + } + + } + + + [Fact] + public async void GetByClientIdWithSqliteInmemoryTestMethod() + { + + using (var mctx = new GetSqliteMemoryContext().GetContext()) + { + var clientId = "192.168.1.100"; + var service = new LogsController(Mapper.Instance, mctx, _tele); + + var res = Assert.IsType(service.GetByCientID(clientId)); + var val1 = Assert.IsType>(res.Value); + + Assert.Equal(2, val1.Count()); + } + + } + + + + + private class GetSqliteMemoryContext : IDisposable + { + private SqliteConnection connection; + private BackupsContext _context; + private DbContextOptions options; + + public GetSqliteMemoryContext() + { + connection = new SqliteConnection("DataSource=:memory:"); + connection.Open(); + + options = new DbContextOptionsBuilder() + .UseSqlite(connection) + .Options; + + // Create the schema in the database + using (var context = new BackupsContext(options)) + { + context.Database.EnsureCreated(); + } + + // Insert seed data into the database using one instance of the context + using (var context = new BackupsContext(options)) + { + int id = 1; + context.Add(new BackupLog { ClientIP = "192.168.1.100", Description = $"Playing with some test data {Guid.NewGuid()}", Status = "OK", ID = id++ }); + context.Add(new BackupLog { ClientIP = "192.168.1.100", Description = $"Playing with some test data {Guid.NewGuid()}", Status = "OK", ID = id++ }); + context.Add(new BackupLog { ClientIP = "192.168.1.101", Description = $"Playing with some test data {Guid.NewGuid()}", Status = "OK", ID = id++ }); + context.Add(new BackupLog { ClientIP = "192.168.1.102", Description = $"Playing with some test data {Guid.NewGuid()}", Status = "OK", ID = id++ }); + context.Add(new BackupLog { ClientIP = "192.168.1.103", Description = $"Playing with some test data {Guid.NewGuid()}", Status = "OK", ID = id++ }); + context.SaveChanges(); + } + _context = new BackupsContext(options); + } + + public void Dispose() + { + _context.Dispose(); + connection.Close(); + connection.Dispose(); + } + + internal BackupsContext GetContext() + { + return _context; + } + } + + + #endregion + } +} diff --git a/test/LanBackup.WebAppSpa.Tests/IntegrationTests/HomeControllerTests.cs b/test/LanBackup.WebAppSpa.Tests/IntegrationTests/HomeControllerTests.cs new file mode 100644 index 0000000..6d414f3 --- /dev/null +++ b/test/LanBackup.WebAppSpa.Tests/IntegrationTests/HomeControllerTests.cs @@ -0,0 +1,16 @@ +using System.Net.Http; +using Xunit; + +namespace LanBackup.WebApp.Tests.IntegrationTests +{ + public class HomeControllerTests : IClassFixture> + { + private readonly HttpClient _client; + + public HomeControllerTests(TestFixture fixture) + { + _client = fixture.Client; + } + + } +} diff --git a/test/LanBackup.WebAppSpa.Tests/IntegrationTests/MssqlTests.cs b/test/LanBackup.WebAppSpa.Tests/IntegrationTests/MssqlTests.cs new file mode 100644 index 0000000..5044ab7 --- /dev/null +++ b/test/LanBackup.WebAppSpa.Tests/IntegrationTests/MssqlTests.cs @@ -0,0 +1,68 @@ +using LanBackup.DataCore; +using LanBackup.ModelsCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Linq; +using Xunit; + +namespace LanBackup.WebApp.Tests.IntegrationTests +{ + public class MssqlTests : IDisposable + { + + + BackupsContext _context; + + public MssqlTests() + { + var serviceProvider = new ServiceCollection() + .AddEntityFrameworkSqlServer() + .BuildServiceProvider(); + + var builder = new DbContextOptionsBuilder(); + + builder.UseSqlServer($"Server=(localdb)\\mssqllocaldb;Database=lanbackup_db_{Guid.NewGuid()};Trusted_Connection=True;MultipleActiveResultSets=true") + .UseInternalServiceProvider(serviceProvider); + + _context = new BackupsContext(builder.Options); + _context.Database.EnsureCreated(); + //_context.Database.Migrate(); + } + public void Dispose() + { + _context.Database.EnsureDeleted(); + } + + + + + + + #region MSSQL server integration tests + + [Trait("Category", "DbIntegration")] + [Fact] + public async void MssqlTestMethod() + { + + //Add some monsters before querying + _context.Add(new BackupLog { ClientIP = "192.168.1.100", Description = $"Playing with some test data {Guid.NewGuid()}", Status = "OK"}); + _context.Add(new BackupLog { ClientIP = "192.168.1.100", Description = $"Playing with some test data {Guid.NewGuid()}", Status = "OK"}); + _context.Add(new BackupLog { ClientIP = "192.168.1.101", Description = $"Playing with some test data {Guid.NewGuid()}", Status = "OK"}); + _context.Add(new BackupLog { ClientIP = "192.168.1.102", Description = $"Playing with some test data {Guid.NewGuid()}", Status = "OK"}); + _context.Add(new BackupLog { ClientIP = "192.168.1.103", Description = $"Playing with some test data {Guid.NewGuid()}", Status = "OK"}); + _context.SaveChanges(); + //Execute the query + var res = _context.Logs.FromSql("SELECT ID, Description, ClientIP, ConfigurationID, LogError, Status, DateTime, RowVersion FROM Logs").ToList(); + //Verify the results + Assert.Equal(5, res.Count()); + + } + + + #endregion + + + } +} diff --git a/test/LanBackup.WebAppSpa.Tests/IntegrationTests/TestFixture.cs b/test/LanBackup.WebAppSpa.Tests/IntegrationTests/TestFixture.cs new file mode 100644 index 0000000..3f22bfe --- /dev/null +++ b/test/LanBackup.WebAppSpa.Tests/IntegrationTests/TestFixture.cs @@ -0,0 +1,101 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.TestHost; +using System; +using System.IO; +using System.Net.Http; +using Microsoft.Extensions.PlatformAbstractions; +using System.Reflection; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.AspNetCore.Mvc.ApplicationParts; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.AspNetCore.Mvc.ViewComponents; + +namespace LanBackup.WebApp.Tests +{ + public class TestFixture : IDisposable + { + + private const string SolutionName = "LanBackup.sln"; + + private readonly TestServer _server; + public HttpClient Client; + + public TestFixture() : this(Path.Combine("src")) + { + } + + protected TestFixture(string solutionRelativeTargetProjectParentDir) + { + var startupAssembly = typeof(TStartup).GetTypeInfo().Assembly; + var contentRoot = GetProjectPath(solutionRelativeTargetProjectParentDir, startupAssembly); + + var builder = new WebHostBuilder() + .UseContentRoot(contentRoot) + .ConfigureServices(InitializeServices) + .UseEnvironment("Development") + .UseStartup(typeof(TStartup)); + + _server = new TestServer(builder); + + Client = _server.CreateClient(); + } + + + public void Dispose() + { + Client.Dispose(); + _server.Dispose(); + } + + protected virtual void InitializeServices(IServiceCollection services) + { + var startupAssembly = typeof(TStartup).GetTypeInfo().Assembly; + + // Inject a custom application part manager. Overrides AddMvcCore() because that uses TryAdd(). + var manager = new ApplicationPartManager(); + manager.ApplicationParts.Add(new AssemblyPart(startupAssembly)); + + manager.FeatureProviders.Add(new ControllerFeatureProvider()); + manager.FeatureProviders.Add(new ViewComponentFeatureProvider()); + + services.AddSingleton(manager); + } + + /// + /// Gets the full path to the target project path that we wish to test + /// + /// + /// The parent directory of the target project. + /// e.g. src, samples, test, or test/Websites + /// + /// The target project's assembly. + /// The full path to the target project. + private static string GetProjectPath(string solutionRelativePath, Assembly startupAssembly) + { + // Get name of the target project which we want to test + var projectName = startupAssembly.GetName().Name; + + // Get currently executing test project path + var applicationBasePath = PlatformServices.Default.Application.ApplicationBasePath; + + // Find the folder which contains the solution file. We then use this information to find the target + // project which we want to test. + var directoryInfo = new DirectoryInfo(applicationBasePath); + do + { + var solutionFileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, SolutionName)); + if (solutionFileInfo.Exists) + { + return Path.GetFullPath(Path.Combine(directoryInfo.FullName, solutionRelativePath, projectName)); + } + + directoryInfo = directoryInfo.Parent; + } + while (directoryInfo.Parent != null); + + throw new Exception($"Solution root could not be located using application root {applicationBasePath}."); + } + + + } +} diff --git a/test/LanBackup.WebAppSpa.Tests/LanBackup.WebAppSpa.Tests.xproj b/test/LanBackup.WebAppSpa.Tests/LanBackup.WebAppSpa.Tests.xproj new file mode 100644 index 0000000..6643bf6 --- /dev/null +++ b/test/LanBackup.WebAppSpa.Tests/LanBackup.WebAppSpa.Tests.xproj @@ -0,0 +1,21 @@ + + + + 14.0.25420 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + f124a292-3711-4fd1-9c54-63d5cf613d37 + LanBackup.WebAppSpa.Tests + .\obj + .\bin\ + + + 2.0 + + + + + + \ No newline at end of file diff --git a/test/LanBackup.WebAppSpa.Tests/Mock/MockTelemetry.cs b/test/LanBackup.WebAppSpa.Tests/Mock/MockTelemetry.cs new file mode 100644 index 0000000..4b9bef2 --- /dev/null +++ b/test/LanBackup.WebAppSpa.Tests/Mock/MockTelemetry.cs @@ -0,0 +1,18 @@ +using System; +using LanBackup.WebApp.Models.Telemetry; + +namespace LanBackup.WebApp.Tests.IntegrationTests +{ + internal class MockTelemetry : ITelemetryLogger + { + public void TrackEvent(string eventmsg) + { + //DO NOTHING + } + + public void TrackException(Exception ex) + { + //DO NOTHING + } + } +} \ No newline at end of file diff --git a/test/LanBackup.WebAppSpa.Tests/TestOutputHelperExtender.cs b/test/LanBackup.WebAppSpa.Tests/TestOutputHelperExtender.cs new file mode 100644 index 0000000..b967521 --- /dev/null +++ b/test/LanBackup.WebAppSpa.Tests/TestOutputHelperExtender.cs @@ -0,0 +1,14 @@ +using System; +using Xunit.Abstractions; + +namespace LanBackup.WebApp.Tests +{ + public static class TestOutputHelperExtender + { + public static void Log(this ITestOutputHelper output, string msg) + { + output.WriteLine(msg); + Console.WriteLine(msg); + } + } +} diff --git a/test/LanBackup.WebAppSpa.Tests/appsettings.json b/test/LanBackup.WebAppSpa.Tests/appsettings.json new file mode 100644 index 0000000..85e0c1c --- /dev/null +++ b/test/LanBackup.WebAppSpa.Tests/appsettings.json @@ -0,0 +1,14 @@ +{ + "ConnectionStrings": { + "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-LanBackup.WebApp-d5f6c3b5-64d7-4d41-8000-1e69f75536f7;Trusted_Connection=True;MultipleActiveResultSets=true", + "BackupsConnectionString": "Server=(localdb)\\mssqllocaldb;Database=BackupsLAN;Trusted_Connection=True;" + }, + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/test/LanBackup.WebAppSpa.Tests/project.json b/test/LanBackup.WebAppSpa.Tests/project.json new file mode 100644 index 0000000..531b81a --- /dev/null +++ b/test/LanBackup.WebAppSpa.Tests/project.json @@ -0,0 +1,41 @@ +{ + "version": "1.0.0-*", + "buildOptions": { + "debugType": "portable", + "copyToOutput": { + "includeFiles": [ + "appsettings.json", + "xunit.runner.json" + ] + } + }, + "dependencies": { + "System.Runtime.Serialization.Primitives": "4.3.0", + "xunit": "2.2.0-beta4-build3444", + "dotnet-test-xunit": "2.2.0-preview2-build1029", + "Microsoft.DotNet.InternalAbstractions": "1.0.1-beta-003206", + "Microsoft.AspNetCore.TestHost": "1.1.0", + "Microsoft.AspNetCore.Http.Abstractions": "1.1.0", + "Microsoft.Data.Sqlite": "1.0.0", + "Microsoft.EntityFrameworkCore.Sqlite": "1.0.1", + "FluentAssertions": "4.18.0", + "LanBackup.WebApp": "1.0.0-*", + "Moq": "4.6.38-alpha", + "System.Diagnostics.TraceSource": "4.0.0" + }, + "testRunner": "xunit", + "frameworks": { + "netcoreapp1.1": { + "dependencies": { + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.1.0" + } + }, + "imports": [ + "dotnet5.4", + "portable-net451+win8" + ] + } + } +} diff --git a/test/LanBackup.WebAppSpa.Tests/result.xml b/test/LanBackup.WebAppSpa.Tests/result.xml new file mode 100644 index 0000000..f2f2e46 --- /dev/null +++ b/test/LanBackup.WebAppSpa.Tests/result.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/test/LanBackup.WebAppSpa.Tests/xunit.runner.json b/test/LanBackup.WebAppSpa.Tests/xunit.runner.json new file mode 100644 index 0000000..4bdaa98 --- /dev/null +++ b/test/LanBackup.WebAppSpa.Tests/xunit.runner.json @@ -0,0 +1,3 @@ +{ + "diagnosticMessages": true +}