/
ivan
/
ModMas
Обзор
Документация
Войти
/
ivan
/
ModMas
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
ModuleMaster/usercontrols/alerter.ascx
74 строки
3 KB
i.krivokon
Initial commit
13 мар 2026, 13:49
13 мар 2026, 13:49
00d9fb6
Код
Авторство
О чём код?
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="alerter.ascx.vb" Inherits="UserControls_alerter" %> <style> .alerter div { border: 1px solid black; max-height: 100px; overflow-y: scroll; padding: 2px; background-color: white; color: navy; } .alerter td { vertical-align : top; } </style> <table style="width: 60%; margin: 0 auto;" class="alerter"> <tr> <td><span id="logLabel">Log:</span> <div id="logWrapper"> <ul id="log"></ul> </div> </td> <td>Activity: <div id="activityWrapper"> <ul id="activity"></ul> </div> </td> </tr> </table> <!--Script references. --> <!--Reference json to support old browsers.--> <script type="text/javascript" src="../Scripts/json2.js"></script> <!--Reference the jQuery library. --> <script type="text/javascript" src="../Scripts/jquery-1.9.1.min.js"></script> <!--Reference the SignalR library. --> <script type="text/javascript" src="../Scripts/jquery.signalR-2.0.3.min.js"></script> <!--Reference the autogenerated SignalR hub script. --> <script type="text/javascript" src="../signalr/hubs"></script> <!--Add script to update the page and send messages.--> <script type="text/javascript"> $(function () { // Declare a proxy to reference the hub. var chat = $.connection.chatHub; // Create a function that the hub can call to broadcast messages. chat.client.log = function (message) { //$('#log').html(message); var dt = new Date(); var time = dt.getHours() + ":" + dt.getMinutes() + ":" + dt.getSeconds(); //$('#log').append('<li><strong>' + time + '</strong>: ' + message + '</li>'); $('#log').html('<li class="logRecord">' + time + ': ' + message + '</li>' + $('#log').html()); var cnt = 0; $(".logRecord").each(function () { if (cnt > 20) { //alert($(this).text()); $(this).remove(); } cnt = cnt + 1; //alert($(this).text() + cnt); }) $("#logLabel").text("Log (" + $(".logRecord").length + "):"); }; chat.client.activity = function (message) { var dt = new Date(); var time = dt.getHours() + ":" + dt.getMinutes() + ":" + dt.getSeconds(); $('#activity').html('<li>' + time + ': ' + message + '</li>'); }; // Start the connection. $.connection.hub.logging = true; $.connection.hub.start({ transport: ['webSockets', 'serverSentEvents', 'foreverFrame', 'longPolling'] }).done(function () { }); }); </script>