-
-
-
-
-
+
-
-
- @for (int i = 0; i < max; i++)
- {
- foreach (var item in Model.Nodes)
- {
-
- }
- }
+
@section scripts{
-
+
diff --git a/projects/IoTCenter/Views/Home/Node.cshtml b/projects/IoTCenter/Views/Home/Node.cshtml
index cd0e99d3..c93c70c3 100644
--- a/projects/IoTCenter/Views/Home/Node.cshtml
+++ b/projects/IoTCenter/Views/Home/Node.cshtml
@@ -1,135 +1,25 @@
-@inject IConfiguration cfg
-@{
- Layout = null;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@HtmlTitle | @cfg["name"]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+@model Node
+
+@section scripts{
-
-
-
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/projects/IoTCenter/Views/Home/Nodes.cshtml b/projects/IoTCenter/Views/Home/Nodes.cshtml
new file mode 100644
index 00000000..9860020c
--- /dev/null
+++ b/projects/IoTCenter/Views/Home/Nodes.cshtml
@@ -0,0 +1,75 @@
+@{
+ ViewData["IsHomePage"] = true;
+}
+
+@section scripts{
+
+
+}
\ No newline at end of file
diff --git a/projects/IoTCenter/Views/Home/Product.cshtml b/projects/IoTCenter/Views/Home/Product.cshtml
index cd0e99d3..922573df 100644
--- a/projects/IoTCenter/Views/Home/Product.cshtml
+++ b/projects/IoTCenter/Views/Home/Product.cshtml
@@ -1,135 +1 @@
-@inject IConfiguration cfg
-@{
- Layout = null;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@HtmlTitle | @cfg["name"]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+@model Product
\ No newline at end of file
diff --git a/projects/IoTCenter/Views/Shared/_Menu.cshtml b/projects/IoTCenter/Views/Shared/_Menu.cshtml
new file mode 100644
index 00000000..ff418daf
--- /dev/null
+++ b/projects/IoTCenter/Views/Shared/_Menu.cshtml
@@ -0,0 +1,23 @@
+
+@functions{
+ public string GetClass(string action,string controller)
+ {
+ if (this.ViewContext.RouteData.Values["action"].ToString()==action&&
+ this.ViewContext.RouteData.Values["controller"].ToString()==controller)
+ {
+ return "active";
+ }
+ return "";
+ }
+}
\ No newline at end of file
diff --git a/projects/IoTCenter/appsettings.json b/projects/IoTCenter/appsettings.json
index aa0c6373..5d0318be 100644
--- a/projects/IoTCenter/appsettings.json
+++ b/projects/IoTCenter/appsettings.json
@@ -1,5 +1,5 @@
{
- "version": "1.0.0-rc.12",
+ "version": "1.0.0-rc.20",
"Logging": {
"LogLevel": {
"Default": "Warning",
diff --git a/projects/IoTCenter/configuration.db b/projects/IoTCenter/configuration.db
index 5dfd78e15c56e8f2d7a91005eb4387e56a299f63..7cfdb231d9ab410bb455e726685b8301e7f9e2f1 100644
GIT binary patch
delta 93
zcmV~$u@!_s2nE0%jJ1c)g20B03$Z0wiY57;sbyUOH*;V2_59XTk-;A2v$tqyYFREY
lMIWgoBNE7BJB-x1LXJIpLX1X}3Wv
;
k5K$0n3S#S3t9RBSfLmBPshJKWp`IEvWg;$ak00;$1D0$TzyJUM
diff --git a/projects/IoTCenter/iotcenter.db b/projects/IoTCenter/iotcenter.db
index 52f429349a2876d8e12d449b3050754b41db70c4..ee5f209ce58b74e492d3a6c93a30b06f09a03550 100644
GIT binary patch
delta 38
qcmZozpx6LJEsQNpEzB(}Ev#GEsyvwXG_==vumLgq_8Je47Ipv#Bn=S&
delta 38
qcmZozpx6LJEsQNpEzB(}Ev#GEsyvulH@DY#umLgq_8Je47Ipv!u?-CX
diff --git a/projects/IoTCenter/wwwroot/node.html b/projects/IoTCenter/wwwroot/node.html
index 80c46d66..77bdc211 100644
--- a/projects/IoTCenter/wwwroot/node.html
+++ b/projects/IoTCenter/wwwroot/node.html
@@ -815,25 +815,50 @@
connection.on('Connected', function (id) {
connectionId = id;
});
- connection.on("UpdateDevice", (message) => {
- var newDevice = JSON.parse(message);
- if (newDevice.NodeId === vm.ViewModel.Id) {
- var update = false;
- for (var i = 0; i < vm.ViewModel.Devices.length; i++) {
- if (vm.ViewModel.Devices[i].Number == newDevice.Number) {
- update = true;
- break;
- }
- }
- if (update) {
- vm.ViewModel.Devices.splice(i, 1, newDevice);
- }
- else {
- vm.ViewModel.Devices.push(newDevice);
+ //connection.on("UpdateDevice", (message) => {
+ // var newDevice = JSON.parse(message);
+ // if (newDevice.NodeId === vm.ViewModel.Id) {
+ // var update = false;
+ // for (var i = 0; i < vm.ViewModel.Devices.length; i++) {
+ // if (vm.ViewModel.Devices[i].Number == newDevice.Number) {
+ // update = true;
+ // break;
+ // }
+ // }
+ // if (update) {
+ // vm.ViewModel.Devices.splice(i, 1, newDevice);
+ // }
+ // else {
+ // vm.ViewModel.Devices.push(newDevice);
+ // }
+ // }
+ //});
+ connection.on("ServerToClient", function (method, json, from) {
+ console.log(method + ':' + json);
+ if (method == 'DataEntityInserted' ||
+ method == 'DataEntityUpdated') {
+ var data = JSON.parse(json);
+ var device = Enumerable.from(vm.ViewModel.Devices).firstOrDefault(function (o) { return o.Id === data.DeviceId; })
+ if (device) {
+ update(device.Data, data);
}
}
});
-
+ }
+ function update(list, item) {
+ var update = false;
+ for (var i = 0; i < list.length; i++) {
+ if (list[i].Id == item.Id) {
+ update = true;
+ break;
+ }
+ }
+ if (update) {
+ list.splice(i, 1, item);
+ }
+ else {
+ list.push(item);
+ }
}