diff --git a/Api/main.go b/Api/main.go index e08f55a..caf47ed 100644 --- a/Api/main.go +++ b/Api/main.go @@ -18,6 +18,7 @@ func main() { func initializeRoutes(r *gin.Engine) { r.POST("/data", src.CreateData) + r.PUT("/data/:id", src.CreateEnvironmentData) } func getPort() string { diff --git a/Api/src/controller.go b/Api/src/controller.go index 3e3ac65..226de58 100644 --- a/Api/src/controller.go +++ b/Api/src/controller.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "net/http" + "strconv" "time" "github.com/gin-gonic/gin" @@ -21,7 +22,7 @@ func CreateData(c *gin.Context) { println(err.Error()) c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) } else { - doc := data.toBSON() + doc := data.toBSONOld() fmt.Printf("T:%f H:%f\n", data.Temp, data.Humidity) _, err := dbCollection.InsertOne(context.TODO(), doc) @@ -33,8 +34,39 @@ func CreateData(c *gin.Context) { } } } +func CreateEnvironmentData(c *gin.Context) { + var data EnvironmentData + if err := c.ShouldBindJSON(&data); err != nil { + println(err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) + } else { + uintID, err := strconv.ParseUint(c.Param("id"), 10, 64) + if err != nil { + c.JSON(http.StatusNotFound, "") + } else { + doc := data.toBSON(uintID) + fmt.Printf("T:%f H:%f\n", data.Temp, data.Humidity) + _, err := dbCollection.InsertOne(context.TODO(), doc) + if err != nil { + println(err.Error()) + c.JSON(http.StatusInternalServerError, "") + } else { + c.JSON(http.StatusOK, "") + } + } + } +} -func (data *EnvironmentData) toBSON() bson.M { +func (data *EnvironmentData) toBSON(id uint64) bson.M { + fmt.Printf("%d", id) + return bson.M{"Temperature": data.Temp, + "Humidity": data.Humidity, + "ApiID": int64(id), + "Time": time.Now().UTC(), + } +} + +func (data *EnvironmentData) toBSONOld() bson.M { return bson.M{"Temperature": data.Temp, "Humidity": data.Humidity, diff --git a/ManagementPage/ManagementPage/Database/MongoDbClient.cs b/ManagementPage/ManagementPage/Database/MongoDbClient.cs index 65be3db..5128470 100644 --- a/ManagementPage/ManagementPage/Database/MongoDbClient.cs +++ b/ManagementPage/ManagementPage/Database/MongoDbClient.cs @@ -9,6 +9,7 @@ namespace ManagementPage.Database { private const string _collectionName = "Main"; private const string _accountsCollectionName = "Accounts"; + private const string _deviceCollectionName = "Devices"; private const string _databaseName = "Environment"; private const string _uri = "mongodb://192.168.0.159:27017"; @@ -17,6 +18,8 @@ namespace ManagementPage.Database public IMongoCollection Collection { get; private set; } public IMongoCollection AccountsCollection { get; private set; } + public IMongoCollection DeviceCollection { get; private set; } + public MongoDbClient() { _client = new MongoClient(_uri); @@ -28,6 +31,7 @@ namespace ManagementPage.Database Collection = _database.GetCollection(_collectionName); AccountsCollection = _database.GetCollection(_accountsCollectionName); + DeviceCollection = _database.GetCollection(_deviceCollectionName); } } } diff --git a/ManagementPage/ManagementPage/Models/DataSet.cs b/ManagementPage/ManagementPage/Models/DataSet.cs index c761952..60b095a 100644 --- a/ManagementPage/ManagementPage/Models/DataSet.cs +++ b/ManagementPage/ManagementPage/Models/DataSet.cs @@ -2,8 +2,6 @@ { public class DataSet { - - public DateTime x { get; set; } public double y { get; set; } } diff --git a/ManagementPage/ManagementPage/Models/DeviceData.cs b/ManagementPage/ManagementPage/Models/DeviceData.cs new file mode 100644 index 0000000..65921d1 --- /dev/null +++ b/ManagementPage/ManagementPage/Models/DeviceData.cs @@ -0,0 +1,25 @@ +using MongoDB.Bson.Serialization.Attributes; +using MongoDB.Bson; + +namespace ManagementPage.Models +{ + public class DeviceData + { + [BsonId] + public ObjectId _id { get; set; } + + public string Name { get; set; } + + public string Passcode { get; set; } + + public Int64 ApiID { get; set; } + + [BsonConstructor] + public DeviceData(string name, string passcode, Int64 apiID) + { + Name = name; + Passcode = passcode; + ApiID = apiID; + } + } +} diff --git a/ManagementPage/ManagementPage/Models/EnvironmentData.cs b/ManagementPage/ManagementPage/Models/EnvironmentData.cs index ac567e5..422bffd 100644 --- a/ManagementPage/ManagementPage/Models/EnvironmentData.cs +++ b/ManagementPage/ManagementPage/Models/EnvironmentData.cs @@ -9,6 +9,9 @@ namespace ManagementPage.Models [BsonId] public ObjectId _id { get; set; } + [JsonPropertyName("apiID")] + public Int64 ApiID { get; set; } + [JsonPropertyName("h")] public double Humidity { get; set; } [JsonPropertyName("t")] @@ -18,10 +21,12 @@ namespace ManagementPage.Models public DateTime Time { get; set; } [BsonConstructor] - public EnvironmentData(double humidity, double temperature) + public EnvironmentData(Int64 apiId, double humidity, double temperature, DateTime time) { + ApiID = apiId; Humidity = humidity; Temperature = temperature; + Time = time; } } } \ No newline at end of file diff --git a/ManagementPage/ManagementPage/Pages/DevicePage.cshtml b/ManagementPage/ManagementPage/Pages/DevicePage.cshtml new file mode 100644 index 0000000..4b96737 --- /dev/null +++ b/ManagementPage/ManagementPage/Pages/DevicePage.cshtml @@ -0,0 +1,28 @@ +@page "{id}" +@model ManagementPage.Pages.DevicePageModel +@{ + ViewData["Title"] = "DevicePage"; +} + +
+

@Model.device.Name

+

Current Conditions

+
+ Temp: @Model.data.LastOrDefault()?.Temperature.ToString("N1") +
+
+ Humidity: @Model.data.LastOrDefault()?.Humidity.ToString("N1") +
+
+
+ +
+ + + + \ No newline at end of file diff --git a/ManagementPage/ManagementPage/Pages/DevicePage.cshtml.cs b/ManagementPage/ManagementPage/Pages/DevicePage.cshtml.cs new file mode 100644 index 0000000..91efc9d --- /dev/null +++ b/ManagementPage/ManagementPage/Pages/DevicePage.cshtml.cs @@ -0,0 +1,67 @@ +using ManagementPage.Database; +using ManagementPage.Models; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; +using MongoDB.Bson; +using MongoDB.Driver; + +namespace ManagementPage.Pages +{ + [Authorize] + public class DevicePageModel : PageModel + { + public List data; + public List humidity; + public List temperature; + public DeviceData device; + + private readonly MongoDbClient _dbClient; + + public DevicePageModel(MongoDbClient dbClient) + { + data = new List(); + humidity = new List(); + temperature = new List(); + _dbClient = dbClient; + } + + public async Task OnGetAsync() + { + var deviceId = 0l ; + try + { + var idString = (string?)RouteData.Values.Where(k => k.Key == "id")?.First().Value; + if (idString == null) + { + throw new NullReferenceException(); + } + + deviceId = (Int64)UInt64.Parse(idString); + } + catch + { + return NotFound(); + } + + var filter = new BsonDocument("ApiID", deviceId); + device = await _dbClient.DeviceCollection.Find(filter).FirstOrDefaultAsync(); + + FindOptions options = new FindOptions + { + Limit = 100, + NoCursorTimeout = false + }; + + using var cursor = await _dbClient.Collection.FindAsync(filter, options); + data.AddRange(await cursor.ToListAsync()); + foreach (var item in data) + { + humidity.Add(new DataSet() { x = item.Time, y = item.Humidity }); + temperature.Add(new DataSet() { x = item.Time, y = item.Temperature }); + } + + return Page(); + } + } +} diff --git a/ManagementPage/ManagementPage/Pages/Logout.cshtml b/ManagementPage/ManagementPage/Pages/Logout.cshtml new file mode 100644 index 0000000..0790666 --- /dev/null +++ b/ManagementPage/ManagementPage/Pages/Logout.cshtml @@ -0,0 +1,4 @@ +@page +@model ManagementPage.Pages.LogoutModel +@{ +} \ No newline at end of file diff --git a/ManagementPage/ManagementPage/Pages/Logout.cshtml.cs b/ManagementPage/ManagementPage/Pages/Logout.cshtml.cs new file mode 100644 index 0000000..16b4424 --- /dev/null +++ b/ManagementPage/ManagementPage/Pages/Logout.cshtml.cs @@ -0,0 +1,19 @@ +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Authentication.Cookies; +using Microsoft.AspNetCore.Authentication.OpenIdConnect; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; +using System.Web; + +namespace ManagementPage.Pages +{ + public class LogoutModel : PageModel + { + + public async Task OnGet() + { + await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); + await HttpContext.SignOutAsync(OpenIdConnectDefaults.AuthenticationScheme); + } + } +} \ No newline at end of file diff --git a/ManagementPage/ManagementPage/Pages/Shared/_Layout.cshtml b/ManagementPage/ManagementPage/Pages/Shared/_Layout.cshtml index 24d704d..4ed66ee 100644 --- a/ManagementPage/ManagementPage/Pages/Shared/_Layout.cshtml +++ b/ManagementPage/ManagementPage/Pages/Shared/_Layout.cshtml @@ -4,8 +4,10 @@ @ViewData["Title"] - ManagementPage - + + +
@@ -24,10 +26,18 @@ - + @if (User.Identity != null && User.Identity.IsAuthenticated) + { + + } @@ -44,8 +54,8 @@ - - + + @await RenderSectionAsync("Scripts", required: false) diff --git a/ManagementPage/ManagementPage/Pages/UserHome.cshtml b/ManagementPage/ManagementPage/Pages/UserHome.cshtml index 3ac7c2d..35646bd 100644 --- a/ManagementPage/ManagementPage/Pages/UserHome.cshtml +++ b/ManagementPage/ManagementPage/Pages/UserHome.cshtml @@ -1,28 +1,60 @@ @page @model ManagementPage.Pages.UserHomeModel @{ - ViewData["Title"] = "UserPage"; + ViewData["Title"] = "UserPage"; }

Hi @Model.name

+
+
+ @foreach (var item in @Model.data) + { +
+
+
@item.Name
+

+

Current conditions:

+
Temperature @Model.currentEnvironment[@item.ApiID].Temperature
+
Humidity @Model.currentEnvironment[@item.ApiID].Humidity
+

+ Details +
+
+ } -
-

Current Conditions

-
- Temp: @Model.data.Last().Temperature.ToString("N1") -
-
- Humidity: @Model.data.Last().Humidity.ToString("N1") +
+
+
New Item
+

Register a new device

+ +
+
+
+ + - - - - \ No newline at end of file diff --git a/ManagementPage/ManagementPage/Pages/UserHome.cshtml.cs b/ManagementPage/ManagementPage/Pages/UserHome.cshtml.cs index 3d07e7e..71310fc 100644 --- a/ManagementPage/ManagementPage/Pages/UserHome.cshtml.cs +++ b/ManagementPage/ManagementPage/Pages/UserHome.cshtml.cs @@ -5,8 +5,6 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using MongoDB.Bson; -using MongoDB.Bson.IO; -using MongoDB.Bson.Serialization; using MongoDB.Driver; using System.Security.Claims; @@ -16,19 +14,27 @@ namespace ManagementPage.Pages [Authorize] public class UserHomeModel : PageModel { - public List data; - public List humidity; - public List temperature; + public List data; + public Dictionary currentEnvironment; public string name; private readonly MongoDbClient _dbClient; + public class NewDeviceModel + { + public string Name { get; set; } + public string Passcode { get; set; } + } + + [BindProperty] + public NewDeviceModel NewDevice { get; set; } + public UserHomeModel(MongoDbClient dbClient) { - data = new List(); - humidity = new List(); - temperature = new List(); + data = new List(); + currentEnvironment = new Dictionary(); _dbClient = dbClient; + NewDevice = new NewDeviceModel(); } public async Task OnGetAsync() @@ -38,18 +44,30 @@ namespace ManagementPage.Pages var id = await binder.GetLocalAccount(User.FindFirstValue(ClaimTypes.NameIdentifier)); name = User.FindFirstValue(ClaimTypes.GivenName); - FindOptions options = new FindOptions - { - Limit = 100, - NoCursorTimeout = false - }; - using var cursor = await _dbClient.Collection.FindAsync(new BsonDocument(), options); - data.AddRange(await cursor.ToListAsync()); + using var cursor = await _dbClient.DeviceCollection.FindAsync(new BsonDocument()); + data = cursor.ToList(); + + foreach (var item in data) { - humidity.Add(new DataSet() { x = item.Time, y = item.Humidity }); - temperature.Add(new DataSet() { x = item.Time, y = item.Temperature }); + var filter = new BsonDocument("ApiID", item.ApiID); + var envData = await _dbClient.Collection.Find(filter).FirstOrDefaultAsync(); + envData ??= new EnvironmentData(item.ApiID, 0, 0, DateTime.UtcNow); + currentEnvironment.Add(item.ApiID, envData); } } + + public async Task OnPostAsync() + { + if (!ModelState.IsValid) + { + return Page(); + } + var id = BitConverter.ToInt64(Guid.NewGuid().ToByteArray(),4); + var device = new DeviceData(NewDevice.Name, NewDevice.Passcode, id); + await _dbClient.DeviceCollection.InsertOneAsync(device); + + return Page(); + } } } diff --git a/ManagementPage/ManagementPage/wwwroot/css/open-iconic/FONT-LICENSE b/ManagementPage/ManagementPage/wwwroot/css/open-iconic/FONT-LICENSE new file mode 100644 index 0000000..a1dc03f --- /dev/null +++ b/ManagementPage/ManagementPage/wwwroot/css/open-iconic/FONT-LICENSE @@ -0,0 +1,86 @@ +SIL OPEN FONT LICENSE Version 1.1 + +Copyright (c) 2014 Waybury + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/ManagementPage/ManagementPage/wwwroot/css/open-iconic/ICON-LICENSE b/ManagementPage/ManagementPage/wwwroot/css/open-iconic/ICON-LICENSE new file mode 100644 index 0000000..2199f4a --- /dev/null +++ b/ManagementPage/ManagementPage/wwwroot/css/open-iconic/ICON-LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Waybury + +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. \ No newline at end of file diff --git a/ManagementPage/ManagementPage/wwwroot/css/open-iconic/README.md b/ManagementPage/ManagementPage/wwwroot/css/open-iconic/README.md new file mode 100644 index 0000000..6b810e4 --- /dev/null +++ b/ManagementPage/ManagementPage/wwwroot/css/open-iconic/README.md @@ -0,0 +1,114 @@ +[Open Iconic v1.1.1](http://useiconic.com/open) +=========== + +### Open Iconic is the open source sibling of [Iconic](http://useiconic.com). It is a hyper-legible collection of 223 icons with a tiny footprint—ready to use with Bootstrap and Foundation. [View the collection](http://useiconic.com/open#icons) + + + +## What's in Open Iconic? + +* 223 icons designed to be legible down to 8 pixels +* Super-light SVG files - 61.8 for the entire set +* SVG sprite—the modern replacement for icon fonts +* Webfont (EOT, OTF, SVG, TTF, WOFF), PNG and WebP formats +* Webfont stylesheets (including versions for Bootstrap and Foundation) in CSS, LESS, SCSS and Stylus formats +* PNG and WebP raster images in 8px, 16px, 24px, 32px, 48px and 64px. + + +## Getting Started + +#### For code samples and everything else you need to get started with Open Iconic, check out our [Icons](http://useiconic.com/open#icons) and [Reference](http://useiconic.com/open#reference) sections. + +### General Usage + +#### Using Open Iconic's SVGs + +We like SVGs and we think they're the way to display icons on the web. Since Open Iconic are just basic SVGs, we suggest you display them like you would any other image (don't forget the `alt` attribute). + +``` +icon name +``` + +#### Using Open Iconic's SVG Sprite + +Open Iconic also comes in a SVG sprite which allows you to display all the icons in the set with a single request. It's like an icon font, without being a hack. + +Adding an icon from an SVG sprite is a little different than what you're used to, but it's still a piece of cake. *Tip: To make your icons easily style able, we suggest adding a general class to the* `` *tag and a unique class name for each different icon in the* `` *tag.* + +``` + + + +``` + +Sizing icons only needs basic CSS. All the icons are in a square format, so just set the `` tag with equal width and height dimensions. + +``` +.icon { + width: 16px; + height: 16px; +} +``` + +Coloring icons is even easier. All you need to do is set the `fill` rule on the `` tag. + +``` +.icon-account-login { + fill: #f00; +} +``` + +To learn more about SVG Sprites, read [Chris Coyier's guide](http://css-tricks.com/svg-sprites-use-better-icon-fonts/). + +#### Using Open Iconic's Icon Font... + + +##### …with Bootstrap + +You can find our Bootstrap stylesheets in `font/css/open-iconic-bootstrap.{css, less, scss, styl}` + + +``` + +``` + + +``` + +``` + +##### …with Foundation + +You can find our Foundation stylesheets in `font/css/open-iconic-foundation.{css, less, scss, styl}` + +``` + +``` + + +``` + +``` + +##### …on its own + +You can find our default stylesheets in `font/css/open-iconic.{css, less, scss, styl}` + +``` + +``` + +``` + +``` + + +## License + +### Icons + +All code (including SVG markup) is under the [MIT License](http://opensource.org/licenses/MIT). + +### Fonts + +All fonts are under the [SIL Licensed](http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web). diff --git a/ManagementPage/ManagementPage/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css b/ManagementPage/ManagementPage/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css new file mode 100644 index 0000000..4664f2e --- /dev/null +++ b/ManagementPage/ManagementPage/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css @@ -0,0 +1 @@ +@font-face{font-family:Icons;src:url(../fonts/open-iconic.eot);src:url(../fonts/open-iconic.eot?#iconic-sm) format('embedded-opentype'),url(../fonts/open-iconic.woff) format('woff'),url(../fonts/open-iconic.ttf) format('truetype'),url(../fonts/open-iconic.otf) format('opentype'),url(../fonts/open-iconic.svg#iconic-sm) format('svg');font-weight:400;font-style:normal}.oi{position:relative;top:1px;display:inline-block;speak:none;font-family:Icons;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.oi:empty:before{width:1em;text-align:center;box-sizing:content-box}.oi.oi-align-center:before{text-align:center}.oi.oi-align-left:before{text-align:left}.oi.oi-align-right:before{text-align:right}.oi.oi-flip-horizontal:before{-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.oi.oi-flip-vertical:before{-webkit-transform:scale(1,-1);-ms-transform:scale(-1,1);transform:scale(1,-1)}.oi.oi-flip-horizontal-vertical:before{-webkit-transform:scale(-1,-1);-ms-transform:scale(-1,1);transform:scale(-1,-1)}.oi-account-login:before{content:'\e000'}.oi-account-logout:before{content:'\e001'}.oi-action-redo:before{content:'\e002'}.oi-action-undo:before{content:'\e003'}.oi-align-center:before{content:'\e004'}.oi-align-left:before{content:'\e005'}.oi-align-right:before{content:'\e006'}.oi-aperture:before{content:'\e007'}.oi-arrow-bottom:before{content:'\e008'}.oi-arrow-circle-bottom:before{content:'\e009'}.oi-arrow-circle-left:before{content:'\e00a'}.oi-arrow-circle-right:before{content:'\e00b'}.oi-arrow-circle-top:before{content:'\e00c'}.oi-arrow-left:before{content:'\e00d'}.oi-arrow-right:before{content:'\e00e'}.oi-arrow-thick-bottom:before{content:'\e00f'}.oi-arrow-thick-left:before{content:'\e010'}.oi-arrow-thick-right:before{content:'\e011'}.oi-arrow-thick-top:before{content:'\e012'}.oi-arrow-top:before{content:'\e013'}.oi-audio-spectrum:before{content:'\e014'}.oi-audio:before{content:'\e015'}.oi-badge:before{content:'\e016'}.oi-ban:before{content:'\e017'}.oi-bar-chart:before{content:'\e018'}.oi-basket:before{content:'\e019'}.oi-battery-empty:before{content:'\e01a'}.oi-battery-full:before{content:'\e01b'}.oi-beaker:before{content:'\e01c'}.oi-bell:before{content:'\e01d'}.oi-bluetooth:before{content:'\e01e'}.oi-bold:before{content:'\e01f'}.oi-bolt:before{content:'\e020'}.oi-book:before{content:'\e021'}.oi-bookmark:before{content:'\e022'}.oi-box:before{content:'\e023'}.oi-briefcase:before{content:'\e024'}.oi-british-pound:before{content:'\e025'}.oi-browser:before{content:'\e026'}.oi-brush:before{content:'\e027'}.oi-bug:before{content:'\e028'}.oi-bullhorn:before{content:'\e029'}.oi-calculator:before{content:'\e02a'}.oi-calendar:before{content:'\e02b'}.oi-camera-slr:before{content:'\e02c'}.oi-caret-bottom:before{content:'\e02d'}.oi-caret-left:before{content:'\e02e'}.oi-caret-right:before{content:'\e02f'}.oi-caret-top:before{content:'\e030'}.oi-cart:before{content:'\e031'}.oi-chat:before{content:'\e032'}.oi-check:before{content:'\e033'}.oi-chevron-bottom:before{content:'\e034'}.oi-chevron-left:before{content:'\e035'}.oi-chevron-right:before{content:'\e036'}.oi-chevron-top:before{content:'\e037'}.oi-circle-check:before{content:'\e038'}.oi-circle-x:before{content:'\e039'}.oi-clipboard:before{content:'\e03a'}.oi-clock:before{content:'\e03b'}.oi-cloud-download:before{content:'\e03c'}.oi-cloud-upload:before{content:'\e03d'}.oi-cloud:before{content:'\e03e'}.oi-cloudy:before{content:'\e03f'}.oi-code:before{content:'\e040'}.oi-cog:before{content:'\e041'}.oi-collapse-down:before{content:'\e042'}.oi-collapse-left:before{content:'\e043'}.oi-collapse-right:before{content:'\e044'}.oi-collapse-up:before{content:'\e045'}.oi-command:before{content:'\e046'}.oi-comment-square:before{content:'\e047'}.oi-compass:before{content:'\e048'}.oi-contrast:before{content:'\e049'}.oi-copywriting:before{content:'\e04a'}.oi-credit-card:before{content:'\e04b'}.oi-crop:before{content:'\e04c'}.oi-dashboard:before{content:'\e04d'}.oi-data-transfer-download:before{content:'\e04e'}.oi-data-transfer-upload:before{content:'\e04f'}.oi-delete:before{content:'\e050'}.oi-dial:before{content:'\e051'}.oi-document:before{content:'\e052'}.oi-dollar:before{content:'\e053'}.oi-double-quote-sans-left:before{content:'\e054'}.oi-double-quote-sans-right:before{content:'\e055'}.oi-double-quote-serif-left:before{content:'\e056'}.oi-double-quote-serif-right:before{content:'\e057'}.oi-droplet:before{content:'\e058'}.oi-eject:before{content:'\e059'}.oi-elevator:before{content:'\e05a'}.oi-ellipses:before{content:'\e05b'}.oi-envelope-closed:before{content:'\e05c'}.oi-envelope-open:before{content:'\e05d'}.oi-euro:before{content:'\e05e'}.oi-excerpt:before{content:'\e05f'}.oi-expand-down:before{content:'\e060'}.oi-expand-left:before{content:'\e061'}.oi-expand-right:before{content:'\e062'}.oi-expand-up:before{content:'\e063'}.oi-external-link:before{content:'\e064'}.oi-eye:before{content:'\e065'}.oi-eyedropper:before{content:'\e066'}.oi-file:before{content:'\e067'}.oi-fire:before{content:'\e068'}.oi-flag:before{content:'\e069'}.oi-flash:before{content:'\e06a'}.oi-folder:before{content:'\e06b'}.oi-fork:before{content:'\e06c'}.oi-fullscreen-enter:before{content:'\e06d'}.oi-fullscreen-exit:before{content:'\e06e'}.oi-globe:before{content:'\e06f'}.oi-graph:before{content:'\e070'}.oi-grid-four-up:before{content:'\e071'}.oi-grid-three-up:before{content:'\e072'}.oi-grid-two-up:before{content:'\e073'}.oi-hard-drive:before{content:'\e074'}.oi-header:before{content:'\e075'}.oi-headphones:before{content:'\e076'}.oi-heart:before{content:'\e077'}.oi-home:before{content:'\e078'}.oi-image:before{content:'\e079'}.oi-inbox:before{content:'\e07a'}.oi-infinity:before{content:'\e07b'}.oi-info:before{content:'\e07c'}.oi-italic:before{content:'\e07d'}.oi-justify-center:before{content:'\e07e'}.oi-justify-left:before{content:'\e07f'}.oi-justify-right:before{content:'\e080'}.oi-key:before{content:'\e081'}.oi-laptop:before{content:'\e082'}.oi-layers:before{content:'\e083'}.oi-lightbulb:before{content:'\e084'}.oi-link-broken:before{content:'\e085'}.oi-link-intact:before{content:'\e086'}.oi-list-rich:before{content:'\e087'}.oi-list:before{content:'\e088'}.oi-location:before{content:'\e089'}.oi-lock-locked:before{content:'\e08a'}.oi-lock-unlocked:before{content:'\e08b'}.oi-loop-circular:before{content:'\e08c'}.oi-loop-square:before{content:'\e08d'}.oi-loop:before{content:'\e08e'}.oi-magnifying-glass:before{content:'\e08f'}.oi-map-marker:before{content:'\e090'}.oi-map:before{content:'\e091'}.oi-media-pause:before{content:'\e092'}.oi-media-play:before{content:'\e093'}.oi-media-record:before{content:'\e094'}.oi-media-skip-backward:before{content:'\e095'}.oi-media-skip-forward:before{content:'\e096'}.oi-media-step-backward:before{content:'\e097'}.oi-media-step-forward:before{content:'\e098'}.oi-media-stop:before{content:'\e099'}.oi-medical-cross:before{content:'\e09a'}.oi-menu:before{content:'\e09b'}.oi-microphone:before{content:'\e09c'}.oi-minus:before{content:'\e09d'}.oi-monitor:before{content:'\e09e'}.oi-moon:before{content:'\e09f'}.oi-move:before{content:'\e0a0'}.oi-musical-note:before{content:'\e0a1'}.oi-paperclip:before{content:'\e0a2'}.oi-pencil:before{content:'\e0a3'}.oi-people:before{content:'\e0a4'}.oi-person:before{content:'\e0a5'}.oi-phone:before{content:'\e0a6'}.oi-pie-chart:before{content:'\e0a7'}.oi-pin:before{content:'\e0a8'}.oi-play-circle:before{content:'\e0a9'}.oi-plus:before{content:'\e0aa'}.oi-power-standby:before{content:'\e0ab'}.oi-print:before{content:'\e0ac'}.oi-project:before{content:'\e0ad'}.oi-pulse:before{content:'\e0ae'}.oi-puzzle-piece:before{content:'\e0af'}.oi-question-mark:before{content:'\e0b0'}.oi-rain:before{content:'\e0b1'}.oi-random:before{content:'\e0b2'}.oi-reload:before{content:'\e0b3'}.oi-resize-both:before{content:'\e0b4'}.oi-resize-height:before{content:'\e0b5'}.oi-resize-width:before{content:'\e0b6'}.oi-rss-alt:before{content:'\e0b7'}.oi-rss:before{content:'\e0b8'}.oi-script:before{content:'\e0b9'}.oi-share-boxed:before{content:'\e0ba'}.oi-share:before{content:'\e0bb'}.oi-shield:before{content:'\e0bc'}.oi-signal:before{content:'\e0bd'}.oi-signpost:before{content:'\e0be'}.oi-sort-ascending:before{content:'\e0bf'}.oi-sort-descending:before{content:'\e0c0'}.oi-spreadsheet:before{content:'\e0c1'}.oi-star:before{content:'\e0c2'}.oi-sun:before{content:'\e0c3'}.oi-tablet:before{content:'\e0c4'}.oi-tag:before{content:'\e0c5'}.oi-tags:before{content:'\e0c6'}.oi-target:before{content:'\e0c7'}.oi-task:before{content:'\e0c8'}.oi-terminal:before{content:'\e0c9'}.oi-text:before{content:'\e0ca'}.oi-thumb-down:before{content:'\e0cb'}.oi-thumb-up:before{content:'\e0cc'}.oi-timer:before{content:'\e0cd'}.oi-transfer:before{content:'\e0ce'}.oi-trash:before{content:'\e0cf'}.oi-underline:before{content:'\e0d0'}.oi-vertical-align-bottom:before{content:'\e0d1'}.oi-vertical-align-center:before{content:'\e0d2'}.oi-vertical-align-top:before{content:'\e0d3'}.oi-video:before{content:'\e0d4'}.oi-volume-high:before{content:'\e0d5'}.oi-volume-low:before{content:'\e0d6'}.oi-volume-off:before{content:'\e0d7'}.oi-warning:before{content:'\e0d8'}.oi-wifi:before{content:'\e0d9'}.oi-wrench:before{content:'\e0da'}.oi-x:before{content:'\e0db'}.oi-yen:before{content:'\e0dc'}.oi-zoom-in:before{content:'\e0dd'}.oi-zoom-out:before{content:'\e0de'} \ No newline at end of file diff --git a/ManagementPage/ManagementPage/wwwroot/css/open-iconic/font/fonts/open-iconic.eot b/ManagementPage/ManagementPage/wwwroot/css/open-iconic/font/fonts/open-iconic.eot new file mode 100644 index 0000000..f98177d Binary files /dev/null and b/ManagementPage/ManagementPage/wwwroot/css/open-iconic/font/fonts/open-iconic.eot differ diff --git a/ManagementPage/ManagementPage/wwwroot/css/open-iconic/font/fonts/open-iconic.otf b/ManagementPage/ManagementPage/wwwroot/css/open-iconic/font/fonts/open-iconic.otf new file mode 100644 index 0000000..f6bd684 Binary files /dev/null and b/ManagementPage/ManagementPage/wwwroot/css/open-iconic/font/fonts/open-iconic.otf differ diff --git a/ManagementPage/ManagementPage/wwwroot/css/open-iconic/font/fonts/open-iconic.svg b/ManagementPage/ManagementPage/wwwroot/css/open-iconic/font/fonts/open-iconic.svg new file mode 100644 index 0000000..32b2c4e --- /dev/null +++ b/ManagementPage/ManagementPage/wwwroot/css/open-iconic/font/fonts/open-iconic.svg @@ -0,0 +1,543 @@ + + + + + +Created by FontForge 20120731 at Tue Jul 1 20:39:22 2014 + By P.J. Onori +Created by P.J. Onori with FontForge 2.0 (http://fontforge.sf.net) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ManagementPage/ManagementPage/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf b/ManagementPage/ManagementPage/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf new file mode 100644 index 0000000..fab6048 Binary files /dev/null and b/ManagementPage/ManagementPage/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf differ diff --git a/ManagementPage/ManagementPage/wwwroot/css/open-iconic/font/fonts/open-iconic.woff b/ManagementPage/ManagementPage/wwwroot/css/open-iconic/font/fonts/open-iconic.woff new file mode 100644 index 0000000..f930998 Binary files /dev/null and b/ManagementPage/ManagementPage/wwwroot/css/open-iconic/font/fonts/open-iconic.woff differ diff --git a/ManagementPage/ManagementPage/wwwroot/css/site.css b/ManagementPage/ManagementPage/wwwroot/css/site.css index 41726e4..0f1445c 100644 --- a/ManagementPage/ManagementPage/wwwroot/css/site.css +++ b/ManagementPage/ManagementPage/wwwroot/css/site.css @@ -1,6 +1,10 @@ /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification for details on configuring this project to bundle and minify static web assets. */ +body { + font-family: 'Quicksand', serif; +} + a.navbar-brand { white-space: normal; text-align: center; diff --git a/ManagementPage/ManagementPage/wwwroot/js/temperature_chart.js b/ManagementPage/ManagementPage/wwwroot/js/temperature_chart.js index e611098..2d9795c 100644 --- a/ManagementPage/ManagementPage/wwwroot/js/temperature_chart.js +++ b/ManagementPage/ManagementPage/wwwroot/js/temperature_chart.js @@ -12,11 +12,11 @@ function CreateChart(ctx, temp, humidity) { }, { label: "Humidity", - //data: [23, 24, 25], fill: false, borderColor: 'rgb(55, 55, 255)', data: humidity, - tension: 0.1 + tension: 0.1, + yAxisID: "humid" } ] }; @@ -24,7 +24,7 @@ function CreateChart(ctx, temp, humidity) { const config = { type: 'line', data: data, - options: {} + options: { maintainAspectRatio: true } }; return tempChart = new Chart(ctx, config);