Skip to content

Commit

Permalink
groupHub prefered
Browse files Browse the repository at this point in the history
  • Loading branch information
BloodShop committed Nov 28, 2022
1 parent 42f2eab commit 7948044
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 76 deletions.
96 changes: 47 additions & 49 deletions Views/Calls/Details.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@model PetShopProj.Models.Call

@model Call
@{
ViewBag.Title = "Details";
}
Expand All @@ -12,52 +11,51 @@
<title>Details</title>
</head>
<body>

<div>
<h4>Call</h4>
<hr />
<dl class="row">
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Name)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Name)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Email)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Email)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Problem)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Problem)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.CallTime)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.CallTime)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Answered)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Answered)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.AnswerTime)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.AnswerTime)
</dd>
</dl>
</div>
<div>
<a asp-action="Edit" asp-route-id="@Model?.Id">Edit</a> |
<a asp-action="Index">Back to List</a>
</div>
<div>
<h4>Call</h4>
<hr />
<dl class="row">
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Name)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Name)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Email)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Email)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Problem)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Problem)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.CallTime)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.CallTime)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Answered)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Answered)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.AnswerTime)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.AnswerTime)
</dd>
</dl>
</div>
<div>
<a asp-action="Edit" asp-route-id="@Model?.Id">Edit</a> |
<a asp-action="Index">Back to List</a>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion Views/Calls/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</thead>
<tbody id="logBody"></tbody>
</table>
@*<div id="theWarning" class="alert alert-warning hide"></div>*@
<div id="theWarning" class="alert alert-warning hide"></div>
</div>
</body>
</html>
1 change: 1 addition & 0 deletions log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -714,3 +714,4 @@ System.InvalidOperationException: Unable to resolve service for type 'PetShopPro
2022-11-28 18:25:44.234 +02:00 [WRN] Failed to determine the https port for redirect.
2022-11-28 18:59:17.466 +02:00 [WRN] Failed to determine the https port for redirect.
2022-11-28 19:01:02.411 +02:00 [WRN] Failed to determine the https port for redirect.
2022-11-28 19:07:32.139 +02:00 [WRN] Failed to determine the https port for redirect.
17 changes: 4 additions & 13 deletions wwwroot/js/call-center-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,12 @@
})
.catch(err => console.error(err.toString()));

connection.on("NewCallReceivedAsync", newCall => {
addCall(newCall);
});
connection.on("CallEditedAsync", editCall => {
editCall(newCall);
});
connection.on("NewCallReceivedAsync", newCall => addCall(newCall));
connection.on("CallEditedAsync", editCall => editCall(newCall));


$logBody.on("click", ".delete-button", function () {
deleteCall(this);
});

$logBody.on("click", ".edit-button", function () {
editCall(this);
});
$logBody.on("click", ".delete-button", () => deleteCall(this));
$logBody.on("click", ".edit-button", () => editCall(this));


function addCalls() {
Expand Down
21 changes: 8 additions & 13 deletions wwwroot/js/calls-center.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
$(() => {
LoadCallsData();

let calls = [];
let $logBody = $("#logBody");
//let $theWarning = $("#theWarning");
let $theWarning = $("#theWarning");
$theWarning.hide();

var connection = new signalR.HubConnectionBuilder().withUrl("/callcenter").build();
connection.start()
Expand All @@ -14,15 +13,9 @@ $(() => {
})
.catch(err => console.error(err.toString()));

connection.on("NewCallReceivedAsync", function() {
LoadCallsData();
});
connection.on("CallDeletedAsync", function () {
LoadCallsData();
});
connection.on("CallEditedAsync", function () {
LoadCallsData();
});
connection.on("NewCallReceivedAsync", () => LoadCallsData());
connection.on("CallDeletedAsync", () => LoadCallsData());
connection.on("CallEditedAsync", () => LoadCallsData());

function LoadCallsData() {
var tr = '';
Expand All @@ -46,8 +39,10 @@ $(() => {
$("#logBody").html(tr);
},
error: (error) => {
$theWarning.text("Failed to get calls...");
$theWarning.show();
console.log(error)
}
});
}
});
});

0 comments on commit 7948044

Please sign in to comment.