Init
- aggiunto un po di tutto comeil progetto del prof
This commit is contained in:
43
SeniorAssistant/Views/Home/Heartbeat.cshtml
Normal file
43
SeniorAssistant/Views/Home/Heartbeat.cshtml
Normal file
@@ -0,0 +1,43 @@
|
||||
@model IEnumerable<Heartbeat>
|
||||
@{
|
||||
ViewBag.Title = "Hello Razor";
|
||||
}
|
||||
|
||||
<div id="grid"></div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
var baseUrl = "@Url.Content("~/api/heartbeat/")";
|
||||
|
||||
$("#grid").kendoGrid({
|
||||
dataSource: {
|
||||
transport: {
|
||||
read: { url: baseUrl, type: "GET" }
|
||||
},
|
||||
serverPaging: false,
|
||||
serverSorting: false,
|
||||
batch: false,
|
||||
schema: {
|
||||
model: {
|
||||
id: "username",
|
||||
fields: {
|
||||
username: { type: "string" },
|
||||
time: { type: "date" },
|
||||
value: {type: "number" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
scrollable: true,
|
||||
sortable: true,
|
||||
filterable: true,
|
||||
editable: false,
|
||||
columns: [
|
||||
{ field: "username", title: "Username" },
|
||||
{ field: "time", title: "Date/Time", format: "{0:dd/MM/yyyy HH:mm}" },
|
||||
{ field: "value", title: "Heartbeats" }
|
||||
]
|
||||
});
|
||||
})
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user