Joch
Joch
CC#
Created by Joch on 1/28/2024 in #help
Blazor Data/Fetch Request.
Hi all, Im new to blazor, i used to work in asp.net web api as backend, vue as front end via spa and asp net razor pages( I don't know that to call this it like a mvc web app) Just wondering if i need to use rest, even i can get the data using service or repository and inject to page or component? Also if i using this, how do i monitor data Request, like i used to monitor data via dev tools > network tab. Edit: im using blazor web app in .net 8. Many thanks guys.
8 replies
CC#
Created by Joch on 9/27/2023 in #help
❔ SignalR
Hi, Seeking for help. hehehe , i don't know if this correct way to implement signal in js without trigger. i used interval to call the hub. i dont know the correct way.
sorry for my english grammar. Thanks
"use strict";


/*
1 sec = 1000 millisecond
*/
var MILLS = 1000;
var SECONDS = 5;
var MILL_IN_MINS = SECONDS * MILLS

var isAlreadyShowAlert = false;
var connection = new signalR.HubConnectionBuilder()
.withUrl("/SessionCheck")
.withAutomaticReconnect()
.build();

connection.on("ResponseSession", function (isLogout) {
if (isLogout && !isAlreadyShowAlert) {
alert("Session Forced to Logout.")
document.getElementById("logout").click();
isAlreadyShowAlert = true;
}

});

connection.start().then(function () {
console.log("signalR Start");
checkSession();
}).catch(function (err) {
console.error(err.toString());
});

function checkSession() {
var empCode = localStorage.getItem("user.empcode")
if (empCode !== "test") {
setInterval(function () {
connection.invoke("CheckSession", empCode).catch(function (err) {
console.error(err.toString());
});
}, MILL_IN_MINS)
}
}
"use strict";


/*
1 sec = 1000 millisecond
*/
var MILLS = 1000;
var SECONDS = 5;
var MILL_IN_MINS = SECONDS * MILLS

var isAlreadyShowAlert = false;
var connection = new signalR.HubConnectionBuilder()
.withUrl("/SessionCheck")
.withAutomaticReconnect()
.build();

connection.on("ResponseSession", function (isLogout) {
if (isLogout && !isAlreadyShowAlert) {
alert("Session Forced to Logout.")
document.getElementById("logout").click();
isAlreadyShowAlert = true;
}

});

connection.start().then(function () {
console.log("signalR Start");
checkSession();
}).catch(function (err) {
console.error(err.toString());
});

function checkSession() {
var empCode = localStorage.getItem("user.empcode")
if (empCode !== "test") {
setInterval(function () {
connection.invoke("CheckSession", empCode).catch(function (err) {
console.error(err.toString());
});
}, MILL_IN_MINS)
}
}
119 replies
CC#
Created by Joch on 2/15/2023 in #help
✅ spike/load testing with multiple user login
Hello im having a trouble to find a testing for load/spike, with multiple user, my web app is using identity which will get the user role and username in context.users The problem is i cant find the best tools for this. I tried k6 but i dont know how make lo multi user ,i also tried puppeeter. Thanks.
8 replies