diff --git a/projects/Demo/Demo/wwwroot/index.html b/projects/Demo/Demo/wwwroot/index.html index e8b74d19..f85866af 100644 --- a/projects/Demo/Demo/wwwroot/index.html +++ b/projects/Demo/Demo/wwwroot/index.html @@ -23,7 +23,7 @@ - + {{vm.Title}} @@ -165,7 +165,7 @@ - {{device.Name||device.DisplayName}} + {{device.DisplayName||device.Name}} {{getData(device,"温度")}} @@ -193,7 +193,7 @@ - {{device.Name||device.DisplayName}} + {{device.DisplayName||device.Name}} {{getData(device,"状态")}} @@ -208,11 +208,16 @@ - {{device.Name||device.DisplayName}} + {{device.DisplayName||device.Name}} {{getData(device,"计算机名")}} + + 开 + 截图 + 关 + @@ -223,7 +228,7 @@ - {{device.Name||device.DisplayName}} + {{device.DisplayName||device.Name}} IP {{getData(device,"IP")}} @@ -242,7 +247,7 @@ - {{device.Name||device.DisplayName}} + {{device.DisplayName||device.Name}} {{getData(device,"状态")}} @@ -273,7 +278,7 @@ - {{device.Name||device.DisplayName}} + {{device.DisplayName||device.Name}} @@ -301,7 +306,7 @@ - {{device.Name||device.DisplayName}} + {{device.DisplayName||device.Name}} @@ -329,7 +334,7 @@ - {{device.Name||device.DisplayName}} + {{device.DisplayName||device.Name}} @@ -365,7 +370,7 @@ - {{device.Name||device.DisplayName}} + {{device.DisplayName||device.Name}} @@ -401,7 +406,7 @@ - {{device.Name||device.DisplayName}} + {{device.DisplayName||device.Name}} @@ -429,7 +434,7 @@ - {{device.Name||device.DisplayName}} + {{device.DisplayName||device.Name}} @@ -457,7 +462,7 @@ - {{device.Name||device.DisplayName}} + {{device.DisplayName||device.Name}} @@ -485,7 +490,7 @@ - {{device.Name||device.DisplayName}} + {{device.DisplayName||device.Name}} @@ -511,7 +516,7 @@ - {{device.Name||device.DisplayName}} + {{device.DisplayName||device.Name}} @@ -530,7 +535,7 @@ - {{device.Name||device.DisplayName}} + {{device.DisplayName||device.Name}} @@ -556,7 +561,7 @@ - {{device.Name||device.DisplayName}} + {{device.DisplayName||device.Name}} 截图 @@ -570,8 +575,50 @@ - + + 属性{{Device.Data.length}} + + + + + + info + + {{data.Name}} + + + {{data.Value}} + + + + {{data.Unit}} + + + + {{data.Description}} + + + + + + + + + 操作{{Device.Apis.length}} + + + + + info + + {{api.Name}} + + + + + + diff --git a/projects/Demo/Demo/wwwroot/js/app.js b/projects/Demo/Demo/wwwroot/js/app.js index 7a9fc4c3..a859c79b 100644 Binary files a/projects/Demo/Demo/wwwroot/js/app.js and b/projects/Demo/Demo/wwwroot/js/app.js differ diff --git a/projects/IoTCenter/Controllers/AppController.cs b/projects/IoTCenter/Controllers/AppController.cs index e590f607..f3fe4110 100644 --- a/projects/IoTCenter/Controllers/AppController.cs +++ b/projects/IoTCenter/Controllers/AppController.cs @@ -47,5 +47,15 @@ namespace IoTCenter.Controllers .FirstOrDefault(o => o.Number == number); return Json(model, new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }); } + + public IActionResult GetDevice(string token, string number) + { + var userName = this._jwtHelper.GetPayload(token)["UserName"].ToString(); + var model = this._deviceRepo.ReadOnlyTable() + .Include(o => o.Data) + .Include(o => o.Apis).ThenInclude(o => o.Parameters) + .FirstOrDefault(o => o.Number == number); + return Json(model, new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }); + } } } \ No newline at end of file