##// END OF EJS Templates
Prototipo de Servidor ABS concluido en SIR
Renato Huallpa -
r387:227ac5447d6c
parent child
Show More
@@ -0,0 +1,19
1 from django.core.management.base import BaseCommand
2
3
4 class Command(BaseCommand):
5 """
6 Restart experiment every night at 05:00 am.
7 Example:
8 manage.py restart_experiment
9 """
10 def handle(self, *args, **options):
11 print("Hola")
12
13 # def main():
14 # print("Hola")
15
16 # if __name__=='__main__':
17 # main()
18
19
@@ -1,33 +1,33
1 1
2 2 REDIS_HOST=radarsys-redis
3 3 REDIS_PORT=6300
4 4 POSTGRES_PORT_5432_TCP_ADDR=radarsys-postgres
5 5 POSTGRES_PORT_5432_TCP_PORT=5432
6 6 #POSTGRES_HOST=postgres
7 7 POSTGRES_HOST=localhost
8 8 POSTGRES_USER=docker
9 9 POSTGRES_PASSWORD=docker
10 10 POSTGRES_DB=radarsys
11 11
12 12 # DB_NAME=radarsys
13 13 # DB_USER=docker
14 14 # DB_PASSWORD=docker
15 15 PGDATA=/var/lib/postgresql/data
16 16 LC_ALL=C.UTF-8
17 17 TZ=America/Lima
18 18 DOCKER_DATA=/data/dockers/radarsys/
19 19 LOCAL_IP=192.168.1.128
20 20
21 # MQTT_SERVER=10.10.10.200
22 MQTT_SERVER = 192.168.100.5
21 MQTT_SERVER=10.10.10.200
22 # MQTT_SERVER = 192.168.100.5
23 23 MQTT_PORT = 1883
24 24 MQTT_KEEPALIVE = 3660
25 25
26 26 MQTT_USER_ATRAD=atrad
27 27 MQTT_PASSWORD_ATRAD = atrad
28 28 MQTT_USER = abs
29 29 MQTT_PASSWORD = abs
30 30 MQTT_CLIENT_ID= abs_id
31 31 TOPIC_ABS=abs/beams
32 32 TOPIC_ABS_ACK=abs/beams_ack
33 33 TOPIC_ABS_CHANGE=abs/change_beam
@@ -1,416 +1,425
1 1 {% extends "dev_conf.html" %} {% load static %} {% load django_bootstrap5 %} {% load main_tags %}
2 2 {% block extra-head %}
3 3 <style>
4 4 .abs {
5 5 width: auto;
6 6 display: inline-block;
7 7 text-align: center;
8 8 }
9 9
10 10 .abs td {
11 11 padding: 4px;
12 12 }
13 13
14 14 .module td {
15 15 padding: 4px 15px 4px 15px;
16 16 font-weight: bold;
17 17 border: 1px solid
18 18 }
19 19
20 20 .legend {
21 21 margin-left: 15px;
22 22 display: inline-block;
23 23 border: 2px solid;
24 24 vertical-align: top;
25 25 }
26 26
27 27 .legend th {
28 28 border-bottom: 1px dashed;
29 29 font-weight: bold;
30 30 vertical-align: center;
31 31 text-align: center;
32 32 }
33 33
34 34 .legend td {
35 35 padding: 2px;
36 36 text-align: center;
37 37 font-weight: bold;
38 38 }
39 39
40 40 </style>
41 41 {% endblock %}
42 42
43 43
44 44 {% block extra-menu-actions %}
45 45 <li>
46 46 <a href="{{ dev_conf.get_absolute_url_plot }}" target="_blank">
47 47 <span class="far fa-image" aria-hidden="true"></span> View Patterns </a>
48 48 </li>
49 49 {% endblock %}
50 50
51 51
52 52 {% block extra-content %}
53 53 <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
54 54 <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/socket.io/4.4.1/socket.io.min.js">
55 55 </script>
56 56
57 57
58 58 {% if beams %}
59 59 <h4>Beams:</h4>
60 60 <div class="container">
61 61 <ul class="nav nav-pills">
62 62 {% for beam in beams %}
63 63 <li class="nav-item">
64 64 <a {%if beam.pk == active_beam %} class="nav-link active" {% else %} class="nav-link" {% endif %} data-toggle="pill" href="#menu{{forloop.counter}}">{{forloop.counter}}</a>
65 65 </li>
66 66 {% endfor %}
67 67 </ul>
68 68
69 69 <div class="tab-content">
70 70 {% for beam in beams %}
71 71 <div id="menu{{forloop.counter}}" class="tab-pane fade {%if beam.pk == active_beam %}in active show{% endif %}">
72 72 <h3>{%if beam.pk == active_beam %}Active Beam: {%endif%}{{beam.name}}</h3>
73 73 <table id="abs_pattern{{forloop.counter}}" class="abs">
74 74 <tr>
75 75 <td>
76 76 <b>North Quarter</b>
77 77 <table class="module">
78 78 <tr>
79 79 <td title='{{module_messages.1}}'><span id="1" {%if beam.pk == active_beam %} {{color_status.1}} {%endif%}>{{beam.get_upvalues.0}}</span></td>
80 80 <td title='{{module_messages.2}}'><span id="2" {%if beam.pk == active_beam %} {{color_status.2}} {%endif%}>{{beam.get_upvalues.1}}</span></td>
81 81 <td title='{{module_messages.3}}'><span id="3" {%if beam.pk == active_beam %} {{color_status.3}} {%endif%}>{{beam.get_upvalues.2}}</span></td>
82 82 <td title='{{module_messages.4}}'><span id="4" {%if beam.pk == active_beam %} {{color_status.4}} {%endif%}>{{beam.get_upvalues.3}}</span></td>
83 83 </tr>
84 84 <tr>
85 <td title='{{module_messages.1}}'><span id="1" {%if beam.pk == active_beam %} {{color_status.1}} {%endif%}>{{beam.get_downvalues.0}}</span></td>
86 <td title='{{module_messages.2}}'><span id="2" {%if beam.pk == active_beam %} {{color_status.2}} {%endif%}>{{beam.get_downvalues.1}}</span></td>
87 <td title='{{module_messages.3}}'> <span id="3" {%if beam.pk == active_beam %} {{color_status.3}} {%endif%}>{{beam.get_downvalues.2}}</span></td>
88 <td title='{{module_messages.4}}'> <span id="4" {%if beam.pk == active_beam %} {{color_status.4}} {%endif%}>{{beam.get_downvalues.3}}</span></td>
85 <td title='{{module_messages.1}}'><span id="101" {%if beam.pk == active_beam %} {{color_status.1}} {%endif%}>{{beam.get_downvalues.0}}</span></td>
86 <td title='{{module_messages.2}}'><span id="102" {%if beam.pk == active_beam %} {{color_status.2}} {%endif%}>{{beam.get_downvalues.1}}</span></td>
87 <td title='{{module_messages.3}}'> <span id="103" {%if beam.pk == active_beam %} {{color_status.3}} {%endif%}>{{beam.get_downvalues.2}}</span></td>
88 <td title='{{module_messages.4}}'> <span id="104" {%if beam.pk == active_beam %} {{color_status.4}} {%endif%}>{{beam.get_downvalues.3}}</span></td>
89 89 </tr>
90 90 <tr>
91 91 <td title='{{module_messages.9}}'> <span id="9" {%if beam.pk == active_beam %} {{color_status.9}} {%endif%}>{{beam.get_upvalues.8}}</span></td>
92 92 <td title='{{module_messages.10}}'><span id="10" {%if beam.pk == active_beam %} {{color_status.10}} {%endif%}>{{beam.get_upvalues.9}}</span></td>
93 93 <td title='{{module_messages.11}}'><span id="11" {%if beam.pk == active_beam %} {{color_status.11}} {%endif%}>{{beam.get_upvalues.10}}</span></td>
94 94 <td title='{{module_messages.12}}'><span id="12" {%if beam.pk == active_beam %} {{color_status.12}} {%endif%}>{{beam.get_upvalues.11}}</span></td>
95 95 </tr>
96 96 <tr>
97 <td title='{{module_messages.9}}'> <span id="9" {%if beam.pk == active_beam %} {{color_status.9}} {%endif%}>{{beam.get_downvalues.8}}</span></td>
98 <td title='{{module_messages.10}}'><span id="10" {%if beam.pk == active_beam %} {{color_status.10}} {%endif%}>{{beam.get_downvalues.9}}</span></td>
99 <td title='{{module_messages.11}}'><span id="11" {%if beam.pk == active_beam %} {{color_status.11}} {%endif%}>{{beam.get_downvalues.10}}</span></td>
100 <td title='{{module_messages.12}}'><span id="12" {%if beam.pk == active_beam %} {{color_status.12}} {%endif%}>{{beam.get_downvalues.11}}</span></td>
97 <td title='{{module_messages.9}}'> <span id="109" {%if beam.pk == active_beam %} {{color_status.9}} {%endif%}>{{beam.get_downvalues.8}}</span></td>
98 <td title='{{module_messages.10}}'><span id="110" {%if beam.pk == active_beam %} {{color_status.10}} {%endif%}>{{beam.get_downvalues.9}}</span></td>
99 <td title='{{module_messages.11}}'><span id="111" {%if beam.pk == active_beam %} {{color_status.11}} {%endif%}>{{beam.get_downvalues.10}}</span></td>
100 <td title='{{module_messages.12}}'><span id="112" {%if beam.pk == active_beam %} {{color_status.12}} {%endif%}>{{beam.get_downvalues.11}}</span></td>
101 101 </tr>
102 102 <tr>
103 103 <td title='{{module_messages.17}}'><span id="17" {%if beam.pk == active_beam %} {{color_status.17}} {%endif%}>{{beam.get_upvalues.16}}</span></td>
104 104 <td title='{{module_messages.18}}'><span id="18" {%if beam.pk == active_beam %} {{color_status.18}} {%endif%}>{{beam.get_upvalues.17}}</span></td>
105 105 <td title='{{module_messages.19}}'><span id="19" {%if beam.pk == active_beam %} {{color_status.19}} {%endif%}>{{beam.get_upvalues.18}}</span></td>
106 106 <td title='{{module_messages.20}}'><span id="20" {%if beam.pk == active_beam %} {{color_status.20}} {%endif%}>{{beam.get_upvalues.19}}</span></td>
107 107 </tr>
108 108 <tr>
109 <td title='{{module_messages.17}}'><span id="17" {%if beam.pk == active_beam %} {{color_status.17}} {%endif%}>{{beam.get_downvalues.16}}</span></td>
110 <td title='{{module_messages.18}}'><span id="18" {%if beam.pk == active_beam %} {{color_status.18}} {%endif%}>{{beam.get_downvalues.17}}</span></td>
111 <td title='{{module_messages.19}}'><span id="19" {%if beam.pk == active_beam %} {{color_status.19}} {%endif%}>{{beam.get_downvalues.18}}</span></td>
112 <td title='{{module_messages.20}}'><span id="20" {%if beam.pk == active_beam %} {{color_status.20}} {%endif%}>{{beam.get_downvalues.19}}</span></td>
109 <td title='{{module_messages.17}}'><span id="117" {%if beam.pk == active_beam %} {{color_status.17}} {%endif%}>{{beam.get_downvalues.16}}</span></td>
110 <td title='{{module_messages.18}}'><span id="118" {%if beam.pk == active_beam %} {{color_status.18}} {%endif%}>{{beam.get_downvalues.17}}</span></td>
111 <td title='{{module_messages.19}}'><span id="119" {%if beam.pk == active_beam %} {{color_status.19}} {%endif%}>{{beam.get_downvalues.18}}</span></td>
112 <td title='{{module_messages.20}}'><span id="120" {%if beam.pk == active_beam %} {{color_status.20}} {%endif%}>{{beam.get_downvalues.19}}</span></td>
113 113 </tr>
114 114 <tr>
115 115 <td title='{{module_messages.25}}'><span id="25" {%if beam.pk == active_beam %} {{color_status.25}} {%endif%}>{{beam.get_upvalues.24}}</span></td>
116 116 <td title='{{module_messages.26}}'><span id="26" {%if beam.pk == active_beam %} {{color_status.26}} {%endif%}>{{beam.get_upvalues.25}}</span></td>
117 117 <td title='{{module_messages.27}}'><span id="27" {%if beam.pk == active_beam %} {{color_status.27}} {%endif%}>{{beam.get_upvalues.26}}</span></td>
118 118 <td title='{{module_messages.28}}'><span id="28" {%if beam.pk == active_beam %} {{color_status.28}} {%endif%}>{{beam.get_upvalues.27}}</span></td>
119 119 </tr>
120 120 <tr>
121 <td title='{{module_messages.25}}'><span id="25" {%if beam.pk == active_beam %} {{color_status.25}} {%endif%}>{{beam.get_downvalues.24}}</span></td>
122 <td title='{{module_messages.26}}'><span id="26" {%if beam.pk == active_beam %} {{color_status.26}} {%endif%}>{{beam.get_downvalues.25}}</span></td>
123 <td title='{{module_messages.27}}'><span id="27" {%if beam.pk == active_beam %} {{color_status.27}} {%endif%}>{{beam.get_downvalues.26}}</span></td>
124 <td title='{{module_messages.28}}'><span id="28" {%if beam.pk == active_beam %} {{color_status.28}} {%endif%}>{{beam.get_downvalues.27}}</span></td>
121 <td title='{{module_messages.25}}'><span id="125" {%if beam.pk == active_beam %} {{color_status.25}} {%endif%}>{{beam.get_downvalues.24}}</span></td>
122 <td title='{{module_messages.26}}'><span id="126" {%if beam.pk == active_beam %} {{color_status.26}} {%endif%}>{{beam.get_downvalues.25}}</span></td>
123 <td title='{{module_messages.27}}'><span id="127" {%if beam.pk == active_beam %} {{color_status.27}} {%endif%}>{{beam.get_downvalues.26}}</span></td>
124 <td title='{{module_messages.28}}'><span id="128" {%if beam.pk == active_beam %} {{color_status.28}} {%endif%}>{{beam.get_downvalues.27}}</span></td>
125 125 </tr>
126 126 </table>
127 127 </td>
128 128 <td>
129 129 <b>East Quarter</b>
130 130 <table class="module">
131 131 <tr>
132 132 <td title='{{module_messages.5}}'> <span id="5" {%if beam.pk == active_beam %} {{color_status.5}} {%endif%}>{{beam.get_upvalues.4}}</span></td>
133 133 <td title='{{module_messages.6}}'> <span id="6" {%if beam.pk == active_beam %} {{color_status.6}} {%endif%}>{{beam.get_upvalues.5}}</span></td>
134 134 <td title='{{module_messages.7}}'> <span id="7" {%if beam.pk == active_beam %} {{color_status.7}} {%endif%}>{{beam.get_upvalues.6}}</span></td>
135 135 <td title='{{module_messages.8}}'> <span id="8" {%if beam.pk == active_beam %} {{color_status.8}} {%endif%}>{{beam.get_upvalues.7}}</span></td>
136 136 </tr>
137 137 <tr>
138 <td title='{{module_messages.5}}'> <span id="5" {%if beam.pk == active_beam %} {{color_status.5}} {%endif%}>{{beam.get_downvalues.4}}</span></td>
139 <td title='{{module_messages.6}}'> <span id="6" {%if beam.pk == active_beam %} {{color_status.6}} {%endif%}>{{beam.get_downvalues.5}}</span></td>
140 <td title='{{module_messages.7}}'> <span id="7" {%if beam.pk == active_beam %} {{color_status.7}} {%endif%}>{{beam.get_downvalues.6}}</span></td>
141 <td title='{{module_messages.8}}'> <span id="8" {%if beam.pk == active_beam %} {{color_status.8}} {%endif%}>{{beam.get_downvalues.7}}</span></td>
138 <td title='{{module_messages.5}}'> <span id="105" {%if beam.pk == active_beam %} {{color_status.5}} {%endif%}>{{beam.get_downvalues.4}}</span></td>
139 <td title='{{module_messages.6}}'> <span id="106" {%if beam.pk == active_beam %} {{color_status.6}} {%endif%}>{{beam.get_downvalues.5}}</span></td>
140 <td title='{{module_messages.7}}'> <span id="107" {%if beam.pk == active_beam %} {{color_status.7}} {%endif%}>{{beam.get_downvalues.6}}</span></td>
141 <td title='{{module_messages.8}}'> <span id="108" {%if beam.pk == active_beam %} {{color_status.8}} {%endif%}>{{beam.get_downvalues.7}}</span></td>
142 142 </tr>
143 143 <tr>
144 144 <td title='{{module_messages.13}}'><span id="13" {%if beam.pk == active_beam %} {{color_status.13}} {%endif%}>{{beam.get_upvalues.12}}</span></td>
145 145 <td title='{{module_messages.14}}'><span id="14" {%if beam.pk == active_beam %} {{color_status.14}} {%endif%}>{{beam.get_upvalues.13}}</span></td>
146 146 <td title='{{module_messages.15}}'><span id="15" {%if beam.pk == active_beam %} {{color_status.15}} {%endif%}>{{beam.get_upvalues.14}}</span></td>
147 147 <td title='{{module_messages.16}}'><span id="16" {%if beam.pk == active_beam %} {{color_status.16}} {%endif%}>{{beam.get_upvalues.15}}</span></td>
148 148 </tr>
149 149 <tr>
150 <td title='{{module_messages.13}}'><span id="13" {%if beam.pk == active_beam %} {{color_status.13}} {%endif%}>{{beam.get_downvalues.12}}</span></td>
151 <td title='{{module_messages.14}}'><span id="14" {%if beam.pk == active_beam %} {{color_status.14}} {%endif%}>{{beam.get_downvalues.13}}</span></td>
152 <td title='{{module_messages.15}}'><span id="15" {%if beam.pk == active_beam %} {{color_status.15}} {%endif%}>{{beam.get_downvalues.14}}</span></td>
153 <td title='{{module_messages.16}}'><span id="16" {%if beam.pk == active_beam %} {{color_status.16}} {%endif%}>{{beam.get_downvalues.15}}</span></td>
150 <td title='{{module_messages.13}}'><span id="113" {%if beam.pk == active_beam %} {{color_status.13}} {%endif%}>{{beam.get_downvalues.12}}</span></td>
151 <td title='{{module_messages.14}}'><span id="114" {%if beam.pk == active_beam %} {{color_status.14}} {%endif%}>{{beam.get_downvalues.13}}</span></td>
152 <td title='{{module_messages.15}}'><span id="115" {%if beam.pk == active_beam %} {{color_status.15}} {%endif%}>{{beam.get_downvalues.14}}</span></td>
153 <td title='{{module_messages.16}}'><span id="116" {%if beam.pk == active_beam %} {{color_status.16}} {%endif%}>{{beam.get_downvalues.15}}</span></td>
154 154 </tr>
155 155 <tr>
156 156 <td title='{{module_messages.21}}'><span id="21" {%if beam.pk == active_beam %} {{color_status.21}} {%endif%}>{{beam.get_upvalues.20}}</span></td>
157 157 <td title='{{module_messages.22}}'><span id="22" {%if beam.pk == active_beam %} {{color_status.22}} {%endif%}>{{beam.get_upvalues.21}}</span></td>
158 158 <td title='{{module_messages.23}}'><span id="23" {%if beam.pk == active_beam %} {{color_status.23}} {%endif%}>{{beam.get_upvalues.22}}</span></td>
159 159 <td title='{{module_messages.24}}'><span id="24" {%if beam.pk == active_beam %} {{color_status.24}} {%endif%}>{{beam.get_upvalues.23}}</span></td>
160 160 </tr>
161 161 <tr>
162 <td title='{{module_messages.21}}'><span id="21" {%if beam.pk == active_beam %} {{color_status.21}} {%endif%}>{{beam.get_downvalues.20}}</span></td>
163 <td title='{{module_messages.22}}'><span id="22" {%if beam.pk == active_beam %} {{color_status.22}} {%endif%}>{{beam.get_downvalues.21}}</span></td>
164 <td title='{{module_messages.23}}'><span id="23" {%if beam.pk == active_beam %} {{color_status.23}} {%endif%}>{{beam.get_downvalues.22}}</span></td>
165 <td title='{{module_messages.24}}'><span id="24" {%if beam.pk == active_beam %} {{color_status.24}} {%endif%}>{{beam.get_downvalues.23}}</span></td>
162 <td title='{{module_messages.21}}'><span id="121" {%if beam.pk == active_beam %} {{color_status.21}} {%endif%}>{{beam.get_downvalues.20}}</span></td>
163 <td title='{{module_messages.22}}'><span id="122" {%if beam.pk == active_beam %} {{color_status.22}} {%endif%}>{{beam.get_downvalues.21}}</span></td>
164 <td title='{{module_messages.23}}'><span id="123" {%if beam.pk == active_beam %} {{color_status.23}} {%endif%}>{{beam.get_downvalues.22}}</span></td>
165 <td title='{{module_messages.24}}'><span id="124" {%if beam.pk == active_beam %} {{color_status.24}} {%endif%}>{{beam.get_downvalues.23}}</span></td>
166 166 </tr>
167 167 <tr>
168 168 <td title='{{module_messages.29}}'><span id="29" {%if beam.pk == active_beam %} {{color_status.29}} {%endif%}>{{beam.get_upvalues.28}}</span></td>
169 169 <td title='{{module_messages.30}}'><span id="30" {%if beam.pk == active_beam %} {{color_status.30}} {%endif%}>{{beam.get_upvalues.29}}</span></td>
170 170 <td title='{{module_messages.31}}'><span id="31" {%if beam.pk == active_beam %} {{color_status.31}} {%endif%}>{{beam.get_upvalues.30}}</span></td>
171 171 <td title='{{module_messages.32}}'><span id="32" {%if beam.pk == active_beam %} {{color_status.32}} {%endif%}>{{beam.get_upvalues.31}}</span></td>
172 172 </tr>
173 173 <tr>
174 <td title='{{module_messages.29}}'><span id="29" {%if beam.pk == active_beam %} {{color_status.29}} {%endif%}>{{beam.get_downvalues.28}}</span></td>
175 <td title='{{module_messages.30}}'><span id="30" {%if beam.pk == active_beam %} {{color_status.30}} {%endif%}>{{beam.get_downvalues.29}}</span></td>
176 <td title='{{module_messages.31}}'><span id="31" {%if beam.pk == active_beam %} {{color_status.31}} {%endif%}>{{beam.get_downvalues.30}}</span></td>
177 <td title='{{module_messages.32}}'><span id="32" {%if beam.pk == active_beam %} {{color_status.32}} {%endif%}>{{beam.get_downvalues.31}}</span></td>
174 <td title='{{module_messages.29}}'><span id="129" {%if beam.pk == active_beam %} {{color_status.29}} {%endif%}>{{beam.get_downvalues.28}}</span></td>
175 <td title='{{module_messages.30}}'><span id="130" {%if beam.pk == active_beam %} {{color_status.30}} {%endif%}>{{beam.get_downvalues.29}}</span></td>
176 <td title='{{module_messages.31}}'><span id="131" {%if beam.pk == active_beam %} {{color_status.31}} {%endif%}>{{beam.get_downvalues.30}}</span></td>
177 <td title='{{module_messages.32}}'><span id="132" {%if beam.pk == active_beam %} {{color_status.32}} {%endif%}>{{beam.get_downvalues.31}}</span></td>
178 178 </tr>
179 179 </table>
180 180 </td>
181 181 </tr>
182 182 <tr>
183 183 <td>
184 184 <b>West Quarter</b>
185 185 <table class="module">
186 186 <tr>
187 187 <td title='{{module_messages.33}}'><span id="33" {%if beam.pk == active_beam %} {{color_status.33}} {%endif%}>{{beam.get_upvalues.32}}</span></td>
188 188 <td title='{{module_messages.34}}'><span id="34" {%if beam.pk == active_beam %} {{color_status.34}} {%endif%}>{{beam.get_upvalues.33}}</span></td>
189 189 <td title='{{module_messages.35}}'><span id="35" {%if beam.pk == active_beam %} {{color_status.35}} {%endif%}>{{beam.get_upvalues.34}}</span></td>
190 190 <td title='{{module_messages.36}}'><span id="36" {%if beam.pk == active_beam %} {{color_status.36}} {%endif%}>{{beam.get_upvalues.35}}</span></td>
191 191 </tr>
192 192 <tr>
193 <td title='{{module_messages.33}}'><span id="33" {%if beam.pk == active_beam %} {{color_status.33}} {%endif%}>{{beam.get_downvalues.32}}</span></td>
194 <td title='{{module_messages.34}}'><span id="34" {%if beam.pk == active_beam %} {{color_status.34}} {%endif%}>{{beam.get_downvalues.33}}</span></td>
195 <td title='{{module_messages.35}}'><span id="35" {%if beam.pk == active_beam %} {{color_status.35}} {%endif%}>{{beam.get_downvalues.34}}</span></td>
196 <td title='{{module_messages.36}}'><span id="36" {%if beam.pk == active_beam %} {{color_status.36}} {%endif%}>{{beam.get_downvalues.35}}</span></td>
193 <td title='{{module_messages.33}}'><span id="133" {%if beam.pk == active_beam %} {{color_status.33}} {%endif%}>{{beam.get_downvalues.32}}</span></td>
194 <td title='{{module_messages.34}}'><span id="134" {%if beam.pk == active_beam %} {{color_status.34}} {%endif%}>{{beam.get_downvalues.33}}</span></td>
195 <td title='{{module_messages.35}}'><span id="135" {%if beam.pk == active_beam %} {{color_status.35}} {%endif%}>{{beam.get_downvalues.34}}</span></td>
196 <td title='{{module_messages.36}}'><span id="136" {%if beam.pk == active_beam %} {{color_status.36}} {%endif%}>{{beam.get_downvalues.35}}</span></td>
197 197 </tr>
198 198 <tr>
199 199 <td title='{{module_messages.41}}'><span id="41" {%if beam.pk == active_beam %} {{color_status.41}} {%endif%}>{{beam.get_upvalues.40}}</span></td>
200 200 <td title='{{module_messages.42}}'><span id="42" {%if beam.pk == active_beam %} {{color_status.42}} {%endif%}>{{beam.get_upvalues.41}}</span></td>
201 201 <td title='{{module_messages.43}}'><span id="43" {%if beam.pk == active_beam %} {{color_status.43}} {%endif%}>{{beam.get_upvalues.42}}</span></td>
202 202 <td title='{{module_messages.44}}'><span id="44" {%if beam.pk == active_beam %} {{color_status.44}} {%endif%}>{{beam.get_upvalues.43}}</span></td>
203 203 </tr>
204 204 <tr>
205 <td title='{{module_messages.41}}'><span id="41" {%if beam.pk == active_beam %} {{color_status.41}} {%endif%}>{{beam.get_downvalues.40}}</span></td>
206 <td title='{{module_messages.42}}'><span id="42" {%if beam.pk == active_beam %} {{color_status.42}} {%endif%}>{{beam.get_downvalues.41}}</span></td>
207 <td title='{{module_messages.43}}'><span id="43" {%if beam.pk == active_beam %} {{color_status.43}} {%endif%}>{{beam.get_downvalues.42}}</span></td>
208 <td title='{{module_messages.44}}'><span id="44" {%if beam.pk == active_beam %} {{color_status.44}} {%endif%}>{{beam.get_downvalues.43}}</span></td>
205 <td title='{{module_messages.41}}'><span id="141" {%if beam.pk == active_beam %} {{color_status.41}} {%endif%}>{{beam.get_downvalues.40}}</span></td>
206 <td title='{{module_messages.42}}'><span id="142" {%if beam.pk == active_beam %} {{color_status.42}} {%endif%}>{{beam.get_downvalues.41}}</span></td>
207 <td title='{{module_messages.43}}'><span id="143" {%if beam.pk == active_beam %} {{color_status.43}} {%endif%}>{{beam.get_downvalues.42}}</span></td>
208 <td title='{{module_messages.44}}'><span id="144" {%if beam.pk == active_beam %} {{color_status.44}} {%endif%}>{{beam.get_downvalues.43}}</span></td>
209 209 </tr>
210 210 <tr>
211 211 <td title='{{module_messages.49}}'><span id="49" {%if beam.pk == active_beam %} {{color_status.49}} {%endif%}>{{beam.get_upvalues.48}}</span></td>
212 212 <td title='{{module_messages.51}}'><span id="50" {%if beam.pk == active_beam %} {{color_status.50}} {%endif%}>{{beam.get_upvalues.49}}</span></td>
213 213 <td title='{{module_messages.52}}'><span id="51" {%if beam.pk == active_beam %} {{color_status.51}} {%endif%}>{{beam.get_upvalues.50}}</span></td>
214 214 <td title='{{module_messages.53}}'><span id="52" {%if beam.pk == active_beam %} {{color_status.52}} {%endif%}>{{beam.get_upvalues.51}}</span></td>
215 215 </tr>
216 216 <tr>
217 <td title='{{module_messages.49}}'><span id="49" {%if beam.pk == active_beam %} {{color_status.49}} {%endif%}>{{beam.get_downvalues.48}}</span></td>
218 <td title='{{module_messages.50}}'><span id="50" {%if beam.pk == active_beam %} {{color_status.50}} {%endif%}>{{beam.get_downvalues.49}}</span></td>
219 <td title='{{module_messages.51}}'><span id="51" {%if beam.pk == active_beam %} {{color_status.51}} {%endif%}>{{beam.get_downvalues.50}}</span></td>
220 <td title='{{module_messages.52}}'><span id="52" {%if beam.pk == active_beam %} {{color_status.52}} {%endif%}>{{beam.get_downvalues.51}}</span></td>
217 <td title='{{module_messages.49}}'><span id="149" {%if beam.pk == active_beam %} {{color_status.49}} {%endif%}>{{beam.get_downvalues.48}}</span></td>
218 <td title='{{module_messages.50}}'><span id="150" {%if beam.pk == active_beam %} {{color_status.50}} {%endif%}>{{beam.get_downvalues.49}}</span></td>
219 <td title='{{module_messages.51}}'><span id="151" {%if beam.pk == active_beam %} {{color_status.51}} {%endif%}>{{beam.get_downvalues.50}}</span></td>
220 <td title='{{module_messages.52}}'><span id="152" {%if beam.pk == active_beam %} {{color_status.52}} {%endif%}>{{beam.get_downvalues.51}}</span></td>
221 221 </tr>
222 222 <tr>
223 223 <td title='{{module_messages.57}}'><span id="57" {%if beam.pk == active_beam %} {{color_status.57}} {%endif%}>{{beam.get_upvalues.56}}</span></td>
224 224 <td title='{{module_messages.58}}'><span id="58" {%if beam.pk == active_beam %} {{color_status.58}} {%endif%}>{{beam.get_upvalues.57}}</span></td>
225 225 <td title='{{module_messages.59}}'><span id="59" {%if beam.pk == active_beam %} {{color_status.59}} {%endif%}>{{beam.get_upvalues.58}}</span></td>
226 226 <td title='{{module_messages.60}}'><span id="60" {%if beam.pk == active_beam %} {{color_status.60}} {%endif%}>{{beam.get_upvalues.59}}</span></td>
227 227 </tr>
228 228 <tr>
229 <td title='{{module_messages.57}}'><span id="57" {%if beam.pk == active_beam %} {{color_status.57}} {%endif%}>{{beam.get_downvalues.56}}</span></td>
230 <td title='{{module_messages.58}}'><span id="58" {%if beam.pk == active_beam %} {{color_status.58}} {%endif%}>{{beam.get_downvalues.57}}</span></td>
231 <td title='{{module_messages.59}}'><span id="59" {%if beam.pk == active_beam %} {{color_status.59}} {%endif%}>{{beam.get_downvalues.58}}</span></td>
232 <td title='{{module_messages.60}}'><span id="60" {%if beam.pk == active_beam %} {{color_status.60}} {%endif%}>{{beam.get_downvalues.59}}</span></td>
229 <td title='{{module_messages.57}}'><span id="157" {%if beam.pk == active_beam %} {{color_status.57}} {%endif%}>{{beam.get_downvalues.56}}</span></td>
230 <td title='{{module_messages.58}}'><span id="158" {%if beam.pk == active_beam %} {{color_status.58}} {%endif%}>{{beam.get_downvalues.57}}</span></td>
231 <td title='{{module_messages.59}}'><span id="159" {%if beam.pk == active_beam %} {{color_status.59}} {%endif%}>{{beam.get_downvalues.58}}</span></td>
232 <td title='{{module_messages.60}}'><span id="160" {%if beam.pk == active_beam %} {{color_status.60}} {%endif%}>{{beam.get_downvalues.59}}</span></td>
233 233 </tr>
234 234 </table>
235 235 </td>
236 236 <td>
237 237 <b>South Quarter</b>
238 238 <table class="module">
239 239 <tr>
240 240 <td title='{{module_messages.37}}'><span id="37" {%if beam.pk == active_beam %} {{color_status.37}} {%endif%}>{{beam.get_upvalues.36}}</span></td>
241 241 <td title='{{module_messages.38}}'><span id="38" {%if beam.pk == active_beam %} {{color_status.38}} {%endif%}>{{beam.get_upvalues.37}}</span></td>
242 242 <td title='{{module_messages.39}}'><span id="39" {%if beam.pk == active_beam %} {{color_status.39}} {%endif%}>{{beam.get_upvalues.38}}</span></td>
243 243 <td title='{{module_messages.40}}'><span id="40" {%if beam.pk == active_beam %} {{color_status.40}} {%endif%}>{{beam.get_upvalues.39}}</span></td>
244 244 </tr>
245 245 <tr>
246 <td title='{{module_messages.37}}'><span id="37" {%if beam.pk == active_beam %} {{color_status.37}} {%endif%}>{{beam.get_downvalues.36}}</span></td>
247 <td title='{{module_messages.38}}'><span id="38" {%if beam.pk == active_beam %} {{color_status.38}} {%endif%}>{{beam.get_downvalues.37}}</span></td>
248 <td title='{{module_messages.39}}'><span id="39" {%if beam.pk == active_beam %} {{color_status.39}} {%endif%}>{{beam.get_downvalues.38}}</span></td>
249 <td title='{{module_messages.40}}'><span id="40" {%if beam.pk == active_beam %} {{color_status.40}} {%endif%}>{{beam.get_downvalues.39}}</span></td>
246 <td title='{{module_messages.37}}'><span id="137" {%if beam.pk == active_beam %} {{color_status.37}} {%endif%}>{{beam.get_downvalues.36}}</span></td>
247 <td title='{{module_messages.38}}'><span id="138" {%if beam.pk == active_beam %} {{color_status.38}} {%endif%}>{{beam.get_downvalues.37}}</span></td>
248 <td title='{{module_messages.39}}'><span id="139" {%if beam.pk == active_beam %} {{color_status.39}} {%endif%}>{{beam.get_downvalues.38}}</span></td>
249 <td title='{{module_messages.40}}'><span id="140" {%if beam.pk == active_beam %} {{color_status.40}} {%endif%}>{{beam.get_downvalues.39}}</span></td>
250 250 </tr>
251 251 <tr>
252 252 <td title='{{module_messages.45}}'><span id="45" {%if beam.pk == active_beam %} {{color_status.45}} {%endif%}>{{beam.get_upvalues.44}}</span></td>
253 253 <td title='{{module_messages.46}}'><span id="46" {%if beam.pk == active_beam %} {{color_status.46}} {%endif%}>{{beam.get_upvalues.45}}</span></td>
254 254 <td title='{{module_messages.47}}'><span id="47" {%if beam.pk == active_beam %} {{color_status.47}} {%endif%}>{{beam.get_upvalues.46}}</span></td>
255 255 <td title='{{module_messages.48}}'><span id="48" {%if beam.pk == active_beam %} {{color_status.48}} {%endif%}>{{beam.get_upvalues.47}}</span></td>
256 256 </tr>
257 257 <tr>
258 <td title='{{module_messages.45}}'><span id="45" {%if beam.pk == active_beam %} {{color_status.45}} {%endif%}>{{beam.get_downvalues.44}}</span></td>
259 <td title='{{module_messages.46}}'><span id="46" {%if beam.pk == active_beam %} {{color_status.46}} {%endif%}>{{beam.get_downvalues.45}}</span></td>
260 <td title='{{module_messages.47}}'><span id="47" {%if beam.pk == active_beam %} {{color_status.47}} {%endif%}>{{beam.get_downvalues.46}}</span></td>
261 <td title='{{module_messages.48}}'><span id="48" {%if beam.pk == active_beam %} {{color_status.48}} {%endif%}>{{beam.get_downvalues.47}}</span></td>
258 <td title='{{module_messages.45}}'><span id="145" {%if beam.pk == active_beam %} {{color_status.45}} {%endif%}>{{beam.get_downvalues.44}}</span></td>
259 <td title='{{module_messages.46}}'><span id="146" {%if beam.pk == active_beam %} {{color_status.46}} {%endif%}>{{beam.get_downvalues.45}}</span></td>
260 <td title='{{module_messages.47}}'><span id="147" {%if beam.pk == active_beam %} {{color_status.47}} {%endif%}>{{beam.get_downvalues.46}}</span></td>
261 <td title='{{module_messages.48}}'><span id="148" {%if beam.pk == active_beam %} {{color_status.48}} {%endif%}>{{beam.get_downvalues.47}}</span></td>
262 262 </tr>
263 263 <tr>
264 264 <td title='{{module_messages.53}}'><span id="53" {%if beam.pk == active_beam %} {{color_status.53}} {%endif%}>{{beam.get_upvalues.52}}</span></td>
265 265 <td title='{{module_messages.54}}'><span id="54" {%if beam.pk == active_beam %} {{color_status.54}} {%endif%}>{{beam.get_upvalues.53}}</span></td>
266 266 <td title='{{module_messages.55}}'><span id="55" {%if beam.pk == active_beam %} {{color_status.55}} {%endif%}>{{beam.get_upvalues.54}}</span></td>
267 267 <td title='{{module_messages.56}}'><span id="56" {%if beam.pk == active_beam %} {{color_status.56}} {%endif%}>{{beam.get_upvalues.55}}</span></td>
268 268 </tr>
269 269 <tr>
270 <td title='{{module_messages.53}}'><span id="53" {%if beam.pk == active_beam %} {{color_status.53}} {%endif%}>{{beam.get_downvalues.52}}</span></td>
271 <td title='{{module_messages.54}}'><span id="54" {%if beam.pk == active_beam %} {{color_status.54}} {%endif%}>{{beam.get_downvalues.53}}</span></td>
272 <td title='{{module_messages.55}}'><span id="55" {%if beam.pk == active_beam %} {{color_status.55}} {%endif%}>{{beam.get_downvalues.54}}</span></td>
273 <td title='{{module_messages.56}}'><span id="56" {%if beam.pk == active_beam %} {{color_status.56}} {%endif%}>{{beam.get_downvalues.55}}</span></td>
270 <td title='{{module_messages.53}}'><span id="153" {%if beam.pk == active_beam %} {{color_status.53}} {%endif%}>{{beam.get_downvalues.52}}</span></td>
271 <td title='{{module_messages.54}}'><span id="154" {%if beam.pk == active_beam %} {{color_status.54}} {%endif%}>{{beam.get_downvalues.53}}</span></td>
272 <td title='{{module_messages.55}}'><span id="155" {%if beam.pk == active_beam %} {{color_status.55}} {%endif%}>{{beam.get_downvalues.54}}</span></td>
273 <td title='{{module_messages.56}}'><span id="156" {%if beam.pk == active_beam %} {{color_status.56}} {%endif%}>{{beam.get_downvalues.55}}</span></td>
274 274 </tr>
275 275 <tr>
276 276 <td title='{{module_messages.61}}'><span id="61" {%if beam.pk == active_beam %} {{color_status.61}} {%endif%}>{{beam.get_upvalues.60}}</span></td>
277 277 <td title='{{module_messages.62}}'><span id="62" {%if beam.pk == active_beam %} {{color_status.62}} {%endif%}>{{beam.get_upvalues.61}}</span></td>
278 278 <td title='{{module_messages.63}}'><span id="63" {%if beam.pk == active_beam %} {{color_status.63}} {%endif%}>{{beam.get_upvalues.62}}</span></td>
279 279 <td title='{{module_messages.64}}'><span id="64" {%if beam.pk == active_beam %} {{color_status.64}} {%endif%}>{{beam.get_upvalues.63}}</span></td>
280 280 </tr>
281 281 <tr>
282 <td title='{{module_messages.61}}'><span id="61" {%if beam.pk == active_beam %} {{color_status.61}} {%endif%}>{{beam.get_downvalues.60}}</span></td>
283 <td title='{{module_messages.62}}'><span id="62" {%if beam.pk == active_beam %} {{color_status.62}} {%endif%}>{{beam.get_downvalues.61}}</span></td>
284 <td title='{{module_messages.63}}'><span id="63" {%if beam.pk == active_beam %} {{color_status.63}} {%endif%}>{{beam.get_downvalues.62}}</span></td>
285 <td title='{{module_messages.64}}'><span id="64" {%if beam.pk == active_beam %} {{color_status.64}} {%endif%}>{{beam.get_downvalues.63}}</span></td>
282 <td title='{{module_messages.61}}'><span id="161" {%if beam.pk == active_beam %} {{color_status.61}} {%endif%}>{{beam.get_downvalues.60}}</span></td>
283 <td title='{{module_messages.62}}'><span id="162" {%if beam.pk == active_beam %} {{color_status.62}} {%endif%}>{{beam.get_downvalues.61}}</span></td>
284 <td title='{{module_messages.63}}'><span id="163" {%if beam.pk == active_beam %} {{color_status.63}} {%endif%}>{{beam.get_downvalues.62}}</span></td>
285 <td title='{{module_messages.64}}'><span id="164" {%if beam.pk == active_beam %} {{color_status.64}} {%endif%}>{{beam.get_downvalues.63}}</span></td>
286 286 </tr>
287 287 </table>
288 288 </td>
289 289 </tr>
290 290 </table>
291 291
292 292 <!-- <meta id="configuraciones_down" data-playlist="{{ beam.get_downvalues }}">
293 293 <meta id="configuraciones_up" data-playlist="{{ beam.get_upvalues }}">
294 294 <meta id="sda" data-toggle="" -->
295 295
296 296 {% if beam.id == active_beam %}
297 297 <table class="legend">
298 298 <tr>
299 299 <th>Legend</th>
300 300 </tr>
301 301 <tr>
302 302 <td class="text-warning">Connected</td>
303 303 </tr>
304 304 <tr>
305 305 <td class="text-success">Running</td>
306 306 </tr>
307 307 <tr>
308 308 <td class="text-info">Mismath</td>
309 309 </tr>
310 310 <tr>
311 311 <td class="text-danger">Disconnected</td>
312 312 </tr>
313 313 </table>
314 314 {% else %}
315 315 <div style="vertical-align: top; display:inline-block;">
316 316 <button id="send_beam{{forloop.counter}}" type="button" class="btn btn-default">
317 317 <span class="fas fa-external-link-square-alt" aria-hidden="true"></span>
318 318 Change Beam</button>
319 319 <br><br><br>
320 320 <button id="change_beam_mqtt{{forloop.counter}}" type="button" class="btn btn-default">
321 321 <span class="fas fa-external-link-square-alt" aria-hidden="true"></span>
322 322 Change Beam MQTT</button>
323 323 </div>
324 324 {% endif %}
325 325 </div>
326 326 {% endfor %}
327 327 </div>
328 328 </div>
329 329
330 330
331 331 {% else %}
332 332 <p style="color:#b4bcc2; margin-left: 5%;">
333 333 <i>No Beams...</i>
334 334 </p>
335 335 {% endif %}
336 336 {% endblock extra-content %}
337 337
338 338 {% block extra-js%}
339 339 <script>
340 340 $(document).ready(function () {
341 341
342 342 // var elemento = document.getElementById("4");
343 343
344 344 var socket = io.connect('http://' + document.domain + ':' + location.port);
345 345
346 346 socket.on('connect', function(data) {
347 347 console.log('Connecting... OK');
348 348 })
349 349
350 350 socket.on('abs_ws', function(data) {
351 351 console.log('ingresamos');
352 352 console.log(data.msg);
353 353 var text = data['msg'];
354 354 // $('#chatLog').val(text);
355 355
356 356 if(data.msg=="b\'Hola\'"){console.log('Hola_amigo')};
357 357 })
358 358
359 359 socket.on('beams_ack', function(data) {
360 360 console.log('beams_ack');
361 361 var text = data['msg'];
362 362
363 363 for (let i=1; i<=64;i++){
364 364
365 365 var elemento = document.getElementById(text[i-1]);
366 var elemento2 = document.getElementById(text[i-1]+100);
366 367 if (text[i-1]<=64){
367 368 console.log("1")
368 369 // elemento=document.getElementById(text[i-1]);
369 370 elemento.style.color="green";
370 elemento.style.fontWeight = "bold"}
371 elemento.style.fontWeight = "bold";
372 elemento2.style.color="green";
373 elemento2.style.fontWeight = "bold";}
371 374 else if (text[i-1]>64){
372 375 elemento=document.getElementById(text[i-1]-64);
373 elemento.style.color="blue";
374 elemento.style.fontWeight = "bold"}
375 else {elemento.style.color="red";
376 elemento.style.fontWeight = "bold"}
376 elemento2=document.getElementById(text[i-1]-64+100);
377 elemento.style.color="yellow";
378 elemento.style.fontWeight = "bold";
379 elemento2.style.color="yellow";
380 elemento2.style.fontWeight = "bold"}
381 else {
382 elemento.style.color="red";
383 elemento.style.fontWeight = "bold";
384 elemento2.style.color="red";
385 elemento2.style.fontWeight = "bold"}
377 386 }
378 387
379 388
380 389
381 390 console.log(text[0])
382 391
383 392
384 393 // $('#chatLog').val(text);
385 394
386 395 if(data.msg=="b\'Hola\'"){console.log('Hola_amigo')};
387 396 })
388 397
389 398
390 399 {% for beam in beams %}
391 400
392 401 {% if dev_conf.operation_mode == 1 %}
393 402 $("#send_beam{{forloop.counter}}").prop('disabled', true)
394 403 $("#change_beam_mqtt{{forloop.counter}}").prop('disabled', true)
395 404 {% else %}
396 405 $("#send_beam{{forloop.counter}}").click(function () {
397 406 document.location = "{% url 'url_send_beam' dev_conf.id beam.id %}";
398 407 });
399 408
400 409 a=$("#change_beam_mqtt{{forloop.counter}}")
401 410 a.click(function () {
402 411 info="change_beam_mqtt{{forloop.counter}}"
403 412 socket.emit('change_beam',{data:info})
404 413 });
405 414
406 415 {% endif %}
407 416
408 417 {% endfor %}
409 418
410 419
411 420 });
412 421
413 422 </script>
414 423
415 424
416 425 {% endblock %}
@@ -1,47 +1,72
1 1 version: '3'
2 2 services:
3 3 # Django app
4 4 radarsys:
5 5 container_name: 'radarsys'
6 6 build: .
7 7 restart: always
8 8 image: radarsys
9 9 ports:
10 10 - 8000:8000
11 11 env_file: .env
12 12 links:
13 13 - radarsys-postgres
14 14 volumes:
15 15 - './:/radarsys'
16 16 - '${DOCKER_DATA}/static:/radarsys/static'
17 labels:
18 ofelia.enabled: "true"
19 # ofelia.job-exec.restart-reception.schedule: "0 1/5 * * * *"
20 ofelia.job-exec.test.schedule: "@every 5s"
21 ofelia.job-exec.test.command: "python manage.py hello"
22 # ofelia.job-exec.restart-pedestal.schedule: "0 2/10 * * * *"
23 # ofelia.job-exec.restart-pedestal.command: "python manage.py restart_pedestal"
24 # ofelia.job-exec.restart-experiment.schedule: "@midnight"
25 # ofelia.job-exec.restart-experiment.command: "python manage.py restart_experiment"
17 26 depends_on:
18 27 - radarsys-postgres
19 28
20 29 # PostgreSQL
21 30 radarsys-postgres:
22 31 container_name: 'radarsys-postgres'
23 32 build: ./postgres/
24 33 volumes:
25 34 - ./postgres/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
26 35 - pgdata:/var/lib/postgresql/data
27 36 ports:
28 37 - 5432:5432
29 38 env_file: .env
30 39
31 40 #Web Server
32 41 radarsys-nginx:
33 42 container_name: 'radarsys-nginx'
34 43 restart: always
35 44 build: ./nginx/
36 45 ports:
37 46 - '0.0.0.0:80:80'
38 47 volumes_from:
39 48 - radarsys
40 49 links:
41 50 - radarsys:radarsys
42 51 depends_on:
43 52 - radarsys
44 53
54 #Ofelia Scheduler
55 radarsys-job:
56 container_name: 'radarsys-job'
57 image: mcuadros/ofelia:v0.3.6
58 depends_on:
59 - radarsys
60 # networks:
61 # - backend_sirm
62 command: daemon --docker
63 volumes:
64 - /var/run/docker.sock:/var/run/docker.sock:ro
65 logging:
66 driver: "json-file"
67 options:
68 max-size: "12m"
69
45 70 volumes:
46 71 pgdata:
47 72 driver: local
@@ -1,28 +1,28
1 1 upstream django {
2 2 server radarsys:8000;
3 3 }
4 4
5 5 server {
6 6
7 7 listen 80;
8 8 server_name localhost;
9 9
10 10 #access_log /dev/stdout;
11 11 #error_log /dev/stdout info;
12 12
13 13 location /static {
14 14 alias /radarsys/static;
15 15 }
16 16
17 17 location / {
18 18 proxy_pass http://django;
19 19 proxy_set_header X-Real-IP $remote_addr;
20 proxy_set_header Host $host;
20 proxy_set_header Host $http_host;
21 21 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
22 22 proxy_set_header X-Forwarded-Proto $scheme;
23 23 proxy_http_version 1.1;
24 24 proxy_set_header Upgrade $http_upgrade;
25 25 proxy_set_header Connection "upgrade";
26 26 }
27 27
28 28 } No newline at end of file
@@ -1,171 +1,154
1 1 """
2 2 Django settings for radarsys project.
3 3
4 4 Generated by 'django-admin startproject' using Django 1.8.6.
5 5
6 6 For more information on this file, see
7 7 https://docs.djangoproject.com/en/1.8/topics/settings/
8 8
9 9 For the full list of settings and their values, see
10 10 https://docs.djangoproject.com/en/1.8/ref/settings/
11 11 """
12 12
13 13 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
14 14 import os
15 15
16 16 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17 17
18 18 # Quick-start development settings - unsuitable for production
19 19 # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
20 20
21 21 # SECURITY WARNING: keep the secret key used in production secret!
22 22 SECRET_KEY = 'xshb$k5fc-+j16)cvyffj&9u__0q3$l!hieh#+tbzqg)*f^km0'
23 23
24 24 # SECURITY WARNING: don't run with debug turned on in production!
25 25 DEBUG = True
26 26
27 27 ALLOWED_HOSTS = ['*']
28 28
29 29 CSRF_TRUSTED_ORIGINS=[
30 30 "http://*.localhost:8030",
31 31 "http://localhost:8030",
32 32 "http://127.0.0.1:8030"
33 33 ]
34 34 #Si se requiere que la aplicaciΓ³n salga de este entorno, para otros usuarios es necesario hacer una API request https://fractalideas.com/blog/making-react-and-django-play-well-together-single-page-app-model/
35 35
36 36 # Application definition
37 37
38 38 INSTALLED_APPS = [
39 39 'django.contrib.admin',
40 40 'django.contrib.auth',
41 41 'django.contrib.contenttypes',
42 42 'django.contrib.sessions',
43 43 'django.contrib.messages',
44 44 'django.contrib.staticfiles',
45 45 'apps.accounts',
46 46 'apps.main',
47 47 'apps.misc',
48 48 'apps.rc',
49 49 'apps.dds',
50 50 'apps.jars',
51 51 'apps.usrp',
52 52 'apps.abs',
53 53 'apps.cgs',
54 54 'apps.dds_rest',
55 55 'apps.atrad',
56 56 "django_bootstrap5",
57 57 'polymorphic',
58 58 'radarsys',
59 59 ]
60 60
61 61 MIDDLEWARE = [
62 62 'django.middleware.security.SecurityMiddleware',
63 63 'django.contrib.sessions.middleware.SessionMiddleware',
64 64 'django.middleware.common.CommonMiddleware',
65 65 'django.middleware.csrf.CsrfViewMiddleware',
66 66 'django.contrib.auth.middleware.AuthenticationMiddleware',
67 67 'django.contrib.messages.middleware.MessageMiddleware',
68 68 'django.middleware.clickjacking.XFrameOptionsMiddleware',
69 69
70 70 ]
71 71
72 72 ROOT_URLCONF = 'radarsys.urls'
73 73
74 74 TEMPLATES = [
75 75 {
76 76 'BACKEND': 'django.template.backends.django.DjangoTemplates',
77 77 'DIRS': [os.path.join(BASE_DIR, "templates")],
78 78 'APP_DIRS': True,
79 79 'OPTIONS': {
80 80 'context_processors': [
81 81 'django.template.context_processors.debug',
82 82 'django.template.context_processors.request',
83 83 'django.contrib.auth.context_processors.auth',
84 84 'django.contrib.messages.context_processors.messages',
85 85 'apps.main.processors.radarsys_globals',
86 86 ],
87 87 },
88 88 },
89 89 ]
90 90
91 91 WSGI_APPLICATION = 'radarsys.wsgi.application'
92 92 ASGI_APPLICATION = 'radarsys.asgi.application'
93 93
94 94 # Database
95 95 # https://docs.djangoproject.com/en/1.8/ref/settings/#databases
96 96
97 97 DATABASES = {
98 98 # 'default': {
99 99 # 'ENGINE': 'django.db.backends.sqlite3',
100 100 # 'NAME': 'radarsys.sqlite',
101 101 # }
102 102 'default': {
103 103 'ENGINE': 'django.db.backends.postgresql_psycopg2',
104 104 'NAME': os.environ.get('DB_NAME', 'radarsys'),
105 105 'USER': os.environ.get('DB_USER', 'docker'),
106 106 'PASSWORD': os.environ.get('DB_PASSWORD', 'docker'),
107 107 'HOST': os.environ.get('POSTGRES_PORT_5432_TCP_ADDR', 'localhost'),
108 108 'PORT': os.environ.get('POSTGRES_PORT_5432_TCP_PORT', '5432'),
109 109 }
110 110 }
111 111
112 112 # Internationalization
113 113 # https://docs.djangoproject.com/en/1.8/topics/i18n/
114 114
115 115 LANGUAGE_CODE = 'en-us'
116 116
117 117 USE_TZ = False #True
118 118
119 119 TIME_ZONE = os.environ.get('TZ', 'America/Lima')
120 120
121 121 USE_I18N = True
122 122
123 123 USE_L10N = True
124 124
125 125 # Static files (CSS, JavaScript, Images)
126 126 # https://docs.djangoproject.com/en/1.8/howto/static-files/
127 127
128 128 MEDIA_URL = '/media/'
129 129 MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
130 130
131 131 STATICFILES_DIRS = [
132 132 os.path.join(BASE_DIR, 'radarsys/static/')
133 133 ]
134 134
135 135 STATIC_URL = '/static/'
136 136 STATIC_ROOT = os.path.join(BASE_DIR, 'static')
137 137
138 138 LOGIN_URL = '/accounts/login'
139 139 LOGOUT_URL = 'logout'
140 140 LOGIN_REDIRECT_URL = '/admin'
141 141 LOGOUT_REDIRECT_URL = '/'
142 142
143 143 STATICFILES_FINDERS = (
144 144 'django.contrib.staticfiles.finders.FileSystemFinder',
145 145 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
146 146 )
147 147
148 # # Celery stuff
149
150 # REDIS_HOST = os.environ.get('REDIS_HOST', 'localhost')
151 # #REDIS_HOST = os.environ.get('REDIS_HOST', '127.0.0.1')
152 # REDIS_PORT = os.environ.get('REDIS_PORT', 6379)
153
154 # BROKER_TRANSPORT = 'redis'
155 # #BROKER_URL = 'redis://{}:{}/0'.format(REDIS_HOST, REDIS_PORT)
156 # BROKER_URL = 'redis://{}:{}'.format(REDIS_HOST, REDIS_PORT)
157
158 # CELERY_RESULT_BACKEND = 'redis://{}:{}/0'.format(REDIS_HOST, REDIS_PORT)
159 # CELERY_BROKER_TRANSPORT = BROKER_URL
160 # CELERY_ACCEPT_CONTENT = ['application/json']
161 # CELERY_TASK_SERIALIZER = 'json'
162 # CELERY_RESULT_SERIALIZER = 'json'
163 # CELERY_ENABLE_UTC = False
164 # CELERY_TIMEZONE = 'America/Lima'
165 148
166 149 import django
167 150 from django.utils.encoding import force_str
168 151 django.utils.encoding.force_text = force_str
169 152
170 153 # choose of auto-created primary keys
171 154 DEFAULT_AUTO_FIELD='django.db.models.AutoField'
General Comments 0
You need to be logged in to leave comments. Login now