Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 2.0.0 #4

Merged
merged 5 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2019-2024 Patryk Kisielewski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
6 changes: 3 additions & 3 deletions SmartHome-Server/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
</configuration>
</configuration>
13 changes: 10 additions & 3 deletions SmartHome-Server/HttpServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Net;
using System.IO;
using System.Web;
using Microsoft.AspNetCore.StaticFiles;

namespace SmartHome_Server
{
Expand Down Expand Up @@ -57,8 +58,13 @@ private void NewRequest(object _context)
string path = "files"+request.Url.AbsolutePath;
if(request.Url.AbsolutePath == "/")
{
path += "index.html";
} else if(request.Url.AbsolutePath == "/plan")
path += "plan.html";
}
else if (request.Url.AbsolutePath == "/dashboard")
{
path = "files/index.html";
}
else if(request.Url.AbsolutePath == "/plan")
{
path += ".html";
}
Expand Down Expand Up @@ -95,7 +101,8 @@ private void NewRequest(object _context)
if (File.Exists(path))
{
responseBytes = File.ReadAllBytes(path);
response.ContentType = MimeMapping.GetMimeMapping(path);
new FileExtensionContentTypeProvider().TryGetContentType(path, out string contentType);
response.ContentType = contentType;
}
else
{
Expand Down
23 changes: 0 additions & 23 deletions SmartHome-Server/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// Ogólne informacje o zestawie są kontrolowane poprzez następujący
// zestaw atrybutów. Zmień wartości tych atrybutów, aby zmodyfikować informacje
// powiązane z zestawem.
[assembly: AssemblyTitle("SmartHome-Server")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SmartHome-Server")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -21,16 +11,3 @@

// Następujący identyfikator GUID jest identyfikatorem biblioteki typów w przypadku udostępnienia tego projektu w modelu COM
[assembly: Guid("470cb9c4-98e0-481f-8b86-667a193d3afb")]

// Informacje o wersji zestawu zawierają następujące cztery wartości:
//
// Wersja główna
// Wersja pomocnicza
// Numer kompilacji
// Rewizja
//
// Możesz określić wszystkie wartości lub użyć domyślnych numerów kompilacji i poprawki
// przy użyciu symbolu „*”, tak jak pokazano poniżej:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
74 changes: 16 additions & 58 deletions SmartHome-Server/SmartHome-Server.csproj
Original file line number Diff line number Diff line change
@@ -1,65 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{470CB9C4-98E0-481F-8B86-667A193D3AFB}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>SmartHome_Server</RootNamespace>
<AssemblyName>SmartHome-Server</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AssemblyTitle>SmartHome-Server</AssemblyTitle>
<Product>SmartHome-Server</Product>
<Copyright>Copyright © 2019-2024</Copyright>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Actions.cs" />
<Compile Include="Global.cs" />
<Compile Include="HttpServer.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Response.cs" />
<Compile Include="Serial.cs" />
<Compile Include="SmartHome.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="files\index.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand All @@ -86,5 +38,11 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
<PackageReference Include="Microsoft.AspNetCore.SystemWebAdapters" Version="1.3.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.IO.Ports" Version="8.0.0" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions SmartHome-Server/files/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
<img src="smart_home_small.png" class="separator">Patryk Kisielewski
<img src="smart_home_small.png" class="separator">Uniwersytet Mikołaja Kopernika w Toruniu
<img src="smart_home_small.png" class="separator">Wydział Matematyki i Informatyki
<img src="smart_home_small.png" class="separator">19. Toruński Festiwal Nauki i Sztuki
<img src="smart_home_small.png" class="separator">Piątek, 26 kwietnia 2019
<img src="smart_home_small.png" class="separator">22. Toruński Festiwal Nauki i Sztuki
<img src="smart_home_small.png" class="separator">Niedziela, 21 kwietnia 2024
<img src="smart_home_small.png" class="separator">
</marquee></div>
</body>
Expand Down
4 changes: 0 additions & 4 deletions SmartHome-Server/packages.config

This file was deleted.

13 changes: 9 additions & 4 deletions SmartHome.sln
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.329
# Visual Studio Version 17
VisualStudioVersion = 17.9.34728.123
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartHome-Server", "SmartHome-Server\SmartHome-Server.csproj", "{470CB9C4-98E0-481F-8B86-667A193D3AFB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SmartHome-Server", "SmartHome-Server\SmartHome-Server.csproj", "{470CB9C4-98E0-481F-8B86-667A193D3AFB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Elementy rozwiązania", "Elementy rozwiązania", "{3CFD0799-E60A-4376-8A85-6A830A9EA4FD}"
ProjectSection(SolutionItems) = preProject
LICENSE = LICENSE
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down