Changeset - 6a5a15855897
[Not reviewed]
version_5
0 5 0
Dennis Fink - 10 years ago 2015-08-26 18:32:29
dennis.fink@c3l.lu
Remove status from model

tor_status was renamed to status. Because people are only interested in if the
tor process is actually running!
5 files changed with 5 insertions and 16 deletions:
0 comments (0 inline, 0 general)
ennstatus/api/model.py
Show inline comments
 
@@ -87,7 +87,6 @@ class Server:
 
        self.name = kwargs['name']
 
        self.type = kwargs['type']
 
        self.status = kwargs.get('status')
 
        self.tor_status = kwargs.get('tor_status')
 
        self.fingerprint = kwargs['fingerprint']
 
        self.last_updated = kwargs['last_updated']
 
        self.country = kwargs['country']
 
@@ -235,7 +234,5 @@ class Server:
 

	
 
        if delta.seconds >= 3600:
 
            self.status = False
 
            self.tor_status = False
 
            return False
 
        else:
 
            return True
 
        elif delta.seconds >= 600:
 
            self.status = None
ennstatus/api/schema/server.json
Show inline comments
 
@@ -9,9 +9,6 @@
 
        "status": {
 
            "$ref": "#/definitions/status_data"
 
        },
 
        "tor_status": {
 
            "$ref": "#/definitions/status_data"
 
        },
 
        "country": {
 
            "type": "string",
 
            "enum": [
 
@@ -108,7 +105,6 @@
 
    "required": [
 
        "name",
 
        "status",
 
        "tor_status",
 
        "last_updated",
 
        "country",
 
        "fingerprint",
ennstatus/api/views.py
Show inline comments
 
@@ -61,7 +61,6 @@ def update():
 
    data['last_updated'] = strict_rfc3339.timestamp_to_rfc3339_utcoffset(
 
        datetime.utcnow().timestamp()
 
    )
 
    data['status'] = True
 

	
 
    try:
 
        server = Server.from_json(json.dumps(data))
ennstatus/templates/api/export/xml/server.xml
Show inline comments
 
@@ -2,7 +2,6 @@
 
    <type>{{ server.type }}</type>
 
    <name>{{ server.name }}</name>
 
    <status>{{ server.status }}</status>
 
    <tor_status>{{ server.tor_status }}</tor_status>
 
    <country>{{ server.country }}</country>
 
    <last_updated>{{ server.last_updated }}</last_updated>
 
    <fingerprint>{{ serverfingerprint }}</fingerprint>
ennstatus/templates/status/macros.html
Show inline comments
 
@@ -50,9 +50,9 @@
 

	
 
{% macro create_server_table(server_type, servers) %}
 
  {% if server_type in ('exit', 'relay') %}
 
    {% set headers = ('#', 'Name', 'IP', 'IP6', 'Server Status', 'Tor Status', 'Country', 'Fingerprint', 'Last Updated <noscript>(UTC)</noscript>') %}
 
    {% set headers = ('#', 'Name', 'IP', 'IP6', 'Tor Status', 'Country', 'Fingerprint', 'Last Updated <noscript>(UTC)</noscript>') %}
 
  {% else %}
 
    {% set headers = ('#', 'Name', 'Server Status', 'Tor Status', 'Country', 'Fingerprint', 'OBFS', 'FTEProxy', 'Flashproxy', 'meek', 'Last Updated <noscript>(UTC)</noscript>') %}
 
    {% set headers = ('#', 'Name', 'Tor Status', 'Country', 'Fingerprint', 'OBFS', 'FTEProxy', 'Flashproxy', 'meek', 'Last Updated <noscript>(UTC)</noscript>') %}
 
  {% endif %}
 
  <h2>{{ server_type|title }}</h2>
 
  <table class="table table-bordered table-striped sortable">
 
@@ -80,9 +80,7 @@
 
              {% endif %}
 
            </td>
 
          {% endif %}
 
          {% for status in (server.status, server.tor_status) %}
 
            <td>{{ colorize_status(status) }}</td>
 
          {% endfor %}
 
          <td>{{ colorize_status(server.status) }}</td>
 
          <td>{{ create_country(server.country) }}</td>
 
          <td>{{ create_fingerprint(server.fingerprint, server.type) }}</td>
 
          {% if server_type == 'bridge' %}
0 comments (0 inline, 0 general)