I need help urgently.
Am running a hotspot service in my cafe and my customers are complaining bitter that they don’t know when their time is about to finish for them to round up their job.
So, how can i configure the hotspot to ALERT users once their uptime limit is below 5minutes? and an option for them to recharge or add additional credit unit to the existing one before the hotspot log them Out.
Or, if your users can be convinced to keep the status page open, use that coupled with JavaScript to show alert boxes. Below some basic HTML that should achieve that (not particularly tested, and I’m not particularly good with JS):
<html>
<head>
<meta http-equiv="refresh" content="300">
<script language="JavaScript">
<!--
function calculateSecondsLeft(timeLeft) {
regex = /^(\d+d)?(\d+h)?(\d+m)?(\d+s)?$/;
result = regex.exec(timeLeft);
secondsLeft = 0;
for(index = 1; index <= 4; index++) {
if(result[index]) {
regex = /^(\d+)[dhms]$/;
parts = regex.exec(result[index]);
numericPart = parts[1];
switch(index) {
case 1:
secondsLeft += numericPart * 86400;
break;
case 2:
secondsLeft += numericPart * 3600;
break;
case 3:
secondsLeft += numericPart * 60;
break;
case 4:
secondsLeft += numericPart * 1;
}
}
}
if(secondsLeft < 600) {
alert("You have less than 10 minutes left on your account!");
}
}
//-->
</script>
</head>
<body onLoad="calculateSecondsLeft('$(session-timeout)')">
Time left: $(session-timeout)
</body>
</html>
Other option is to create some tiny application which uses MikroTik API and check for user status…
And offer that application on Your HotSpot login page…
I do not think, this might work. Because ads are displayed only in pre-defined cycles. And changes to the ads-cycle are only recognized after log-out of the user.
function alertUser()
{
var timeLeft = Number($(session-time-left-secs))
if (timeLeft < 60)
{
alert("Your session is about to expire. You have one minute to save your progress!")
}
}
then you can either put that in the body tag as onload=“alertUser()” or use this in the head tag
this can be done if status.html not closed by hotspot user.
you can modified the status.html, each time status.html refreshed, check “session-time-left-secs”
if “session-time-left-secs” less than your threshold, display an alert using javascript.
this is what we all are using and none is getting head way as to the pop up comming up when time left is certain level set! Can you give more details regarding your setup?
I have set up over 20 hotspot and managing them currently and all require this feature.
Is mikrotik actually concerned about our request most time? This topic has been on running to two years now but nothing is said nor done about it by Mikrotik Moderator
Sorry guys had a look at the hotspot i created for a customer and It only displays the notifier all the time and not as requested when it reach last 5 minutes.
Does the status page remains on top of all webpages as one browse the internet? What I can see is, it either go to the background while checking other pages or minimised and the users might not be mindfull of the time running and all of a sudden get disconected before they go to check. This is what we are trying to avoid, being disconected at the middle of an important transaction, message or filling form.
Did you do any thing extra from the normal status page that pop up upon login in?