tBKwtWS vor 7 Jahren
Ursprung
Commit
56c6f8fb3e

+ 2 - 0
irc/commands/statistics.py

@@ -162,6 +162,8 @@ def do_command(self, connection, event):
                     connection.action(replyto, "has never seen " + red + trigger.split()[1] + reset + ".")
                 elif command.split()[1] == event.source.nick.lower():
                     connection.action(replyto, "holds up a mirror to " + event.source.nick + ".")
+                elif "!" in command.split()[1] and "@" in command.split()[1]:
+                    connection.privmsg(replyto, "The looks more like a hostname then a nickname to me.")
                 else:
                     record = self.db.one("SELECT last_act_type, last_act_datetime, last_act_channel, last_act, last_act_auxiliary, away, away_reason FROM users WHERE LOWER(name)='" + command.split()[1] + "' AND network='" + self.network + "'")
                     if command.split()[1] == connection.get_nickname().lower():

+ 6 - 4
irc/common/log.py

@@ -1,11 +1,13 @@
+from datetime import datetime
+
 def info(message):
-    print("INFO: " + str(message))
+    print("INFO " + str(datetime.now()) + " " + str(message))
 
 def notice(message):
-    print("NOTICE: " + str(message))
+    print("NOTICE " + str(datetime.now()) + " " + str(message))
 
 def warning(message):
-    print("WARNING: " + str(message))
+    print("WARNING " + str(datetime.now()) + " " + str(message))
 
 def error(message):
-    print("ERROR: " + str(message))
+    print("ERROR " + str(datetime.now()) + " " + str(message))

+ 1 - 1
irc/events/on_join.py

@@ -54,7 +54,7 @@ def process_event(self, connection, event):
         message = "Welcome back in " + red + event.target + reset + ", " + red + event.source.nick + reset + ". To turn of greetings, type " + blue + "!stopgreet" + reset + "."
     if joins == 5:
         if self.channels[event.target].has_key():   # Channel has a password.
-            message = "Welcome back again " + red + event.source.nick + reset + ". To automaticly join this channel type " + blue + "/ns ajoin " + reset + "ADD " + red + event.source.nick + " " + event.target + reset + italic + " password"
+            message = "Welcome back again " + red + event.source.nick + reset + ". To automaticly join this channel type " + blue + "/ns ajoin " + reset + "ADD " + red + event.target + reset + italic + " password"
         else:   # Channel does not have a password.
             message = "Welcome back again " + red + event.source.nick + reset + ". To automaticly join this channel type " + blue + "/ns ajoin " + reset + "ADD " + red + event.source.nick + " " + event.target
     if joins < 100 and str(joins)[-1:] == "0":

+ 11 - 11
webgui/stats/templates/stats/networks.html

@@ -47,41 +47,41 @@
         <section class="ui basic text segment container">
             <div class="ui basic segment">
                 <div class="ui celled selection link list">
-                    {% for network in networks %}
-                        <a class="item" href="{% url 'stats:network' network.name %}">
+                    {% for network in networkslist.items %}
+                        <a class="item" href="{% url 'stats:network' network.0 %}">
                             <div class="right floated content">
                                 <div class="ui horizontal list">
-                                    {% if network.password %}
+                                    {% if network.1.password %}
                                         <div class="item">
                                             <i class="green privacy icon" title="NickServ password saved"></i>
                                         </div>
                                     {% endif %}
-                                    {% if network.use_ssl %}
+                                    {% if network.1.usessl %}
                                         <div class="item">
                                             <i class="green lock icon" title="Encrypted connection"></i>
                                         </div>
                                     {% endif %}
                                     <div class="item">
                                         <i class="hashtag icon"></i>
-                                            {{ network.channelcount }}
+                                            {{ network.1.channelcount }}
                                     </div>
                                     <div class="item">
                                         <i class="users icon"></i>
-                                            {{ network.usercount }}
+                                            {{ network.1.usercount }}
                                     </div>
                                     <div class="item">
                                         <i class="comments outline icon"></i>
-                                            {{ network.messagecount }}
+                                            {{ network.1.messagecount }}
                                     </div>
                                 </div>
                             </div>
                             <i class="middle aligned server icon"></i>
                             <div class="content">
                                 <div class="header">
-                                    <div class="content" href="{% url 'stats:network' network.name %}">{{ network.name }}</div>
+                                    <div class="content" href="{% url 'stats:network' network.0 %}">{{ network.0 }}</div>
                                 </div>
                                 <div class="description">
-                                    {{ network.host }}:{{ network.port }}
+                                    {{ network.1.host }}:{{ network.1.port }}
                                 </div>
                             </div>
                         </a>
@@ -90,8 +90,8 @@
             </div>
         </section>
     </article>
-    <div class="ui container">
-        <article class="ui stackable cards">
+    <div class="ui segment">
+        <article class="ui centered stackable cards">
             <script type="text/javascript">
                 google.charts.load("current", {packages:["corechart"]});
                 google.charts.setOnLoadCallback(drawChart0);

+ 6 - 1
webgui/stats/views.py

@@ -15,7 +15,12 @@ def networks(request):
     totalusers = convert_units.shorten_number(len(users))
     networkslist = {}
     for network in networks:
-        networkslist[network.name] = {'' 'channelcount': 0, 'usercount': 0, 'messagecount': 0, 'xpspentcount': 0, 'coinspentcount': 0, 'coingivencount': 0}
+        networkslist[network.name] = {'channelcount': 0, 'usercount': 0, 'messagecount': 0, 'xpspentcount': 0, 'coinspentcount': 0, 'coingivencount': 0}
+        networkslist[network.name]['host'] = network.host
+        networkslist[network.name]['port'] = network.port
+        networkslist[network.name]['usessl'] = network.use_ssl
+        if network.password:
+            networkslist[network.name]['password'] = True
     isxpspent = False
     for user in users:
         networkslist[user.network.name]['usercount'] += 1