Skip to content

Commit 143113b

Browse files
author
Marcus Funch
committed
Merge branch 'release/5.11.0' into 'master'
Release 5.11.0 See merge request os2borgerpc/os2borgerpc-admin-site!393
2 parents 6d16c44 + ceee824 commit 143113b

File tree

10 files changed

+34
-27
lines changed

10 files changed

+34
-27
lines changed

.gitlab-ci.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ variables:
4343
stage: lint
4444
needs: []
4545
image: python:3.8
46-
tags:
47-
- docker
4846

4947
Lint Python:
5048
<<: *lint-default
@@ -76,8 +74,6 @@ Build app image:
7674
image:
7775
name: gcr.io/kaniko-project/executor:debug-v0.16.0
7876
entrypoint: [""]
79-
tags:
80-
- docker
8177
script:
8278
# Login to GitLab registry
8379
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
@@ -98,8 +94,6 @@ Build app image:
9894
variables:
9995
GIT_STRATEGY: none # We do not need the source code
10096
dependencies: []
101-
tags:
102-
- docker
10397
before_script:
10498
# install skopeo
10599
- apk add skopeo

NEWS.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Version 5.11.0, February 23, 2023
2+
---------------------------------
3+
4+
- Make computers/json API work again.
5+
16
Version 5.10.3, February 2, 2023
27
--------------------------------
38

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.10.3
1+
5.11.0
Binary file not shown.

admin_site/system/views.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2989,8 +2989,14 @@ class JSONSiteSummary(JSONResponseMixin, SiteView):
29892989
"location",
29902990
]
29912991

2992+
def render_to_response(self, context, **response_kwargs):
2993+
# It is necessary to overwrite the standard render_to_response method
2994+
# when we want to return something that should not be rendered
2995+
# via a Django template
2996+
return self.render_to_json_response(context, **response_kwargs)
2997+
29922998
def get_context_data(self, **kwargs):
2993-
pcs = []
2999+
pcs = {}
29943000
for p in self.object.pcs.all():
29953001
pc = {}
29963002
for pn in JSONSiteSummary.interesting_properties:
@@ -3010,7 +3016,7 @@ def get_context_data(self, **kwargs):
30103016
else:
30113017
pv = str(pv)
30123018
pc[pn] = pv
3013-
pcs.append(pc)
3019+
pcs[pc["id"]] = pc
30143020
return pcs
30153021

30163022

admin_site/templates/base.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
</ie11-browser-warning>
4545

4646
<script src="/static/js/bootstrap-table.min.js"></script>
47+
<script src="/static/js/bootstrap-table-da-DK.min.js"></script>
4748
<script src="/static/js/bootstrap.bundle.min.js"></script>
4849
{% block javascripts %}{% endblock %}
4950
</body>

admin_site/templates/documentation/wake_plans/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ <h2>Vigtige bemærkninger</h2>
9595
den først begynde at følge den nye/opdaterede tidsplan, når den har været tændt.
9696
</p>
9797
<p>
98-
Hvis en computer modtager en tidsplan, der siger at den skal være slukket på nuværende tidspunkt,
99-
vil der gå 20 minutter fra den modtager tidsplanen til den faktisk slukker. Ligeledes,
100-
hvis den manuelt tændes på et tidspunkt, hvor den skal være slukket ifølge tidsplanen, vil
101-
der gå 20 minutter før den slukker. Dette er valgt, så man har tid til at ændre tidsplanen,
102-
inden computeren slukker.
98+
Hvis en computer manuelt tændes efter dens sluk-tidspunkt, eller på en dag hvor den er
99+
sat til at være konstant slukket, vil den først slukke automatisk på
100+
sluk-tidspunktet for næste dag. Hvis der ikke findes et sluk-tidspunkt for næste dag,
101+
vil den automatisk slukke 24 timer efter den blev tændt. Hvis computeren manuelt
102+
slukkes igen, vil den vågne efter tidsplanen.
103103
</p>
104104
<h3>Indstilling af BIOS/UEFI</h3>
105105
<ol>

admin_site/templates/system/site_status.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{% block specific_content %}
88
<div class="container-fluid main sublevelmain" style="overflow-x: auto;">
99
<h2 class="divideheader">
10-
Computere
10+
Computere
1111
<span class="ms-3 badge bg-secondary">Aktiverede: {{ activated_pcs }} / {{ total_pcs }}</span>
1212
{# Originally this was online / activated, but it turns out a computer that isn't activated can still be online #}
1313
<span class="ms-3 badge bg-secondary">Online: {{ online_pcs }} / {{ total_pcs }}</span>
@@ -25,8 +25,8 @@ <h2 class="divideheader">
2525
</tr>
2626
</thead>
2727
<tbody>
28-
{% for pc in ls_pcs %}
29-
<tr class="click-list--item">
28+
{% for pc in ls_pcs %}
29+
<tr class="click-list--item">
3030
<td>
3131
<span style="display: none;">{{pc.name}}</span> <!-- Used to ensure sorting by pcname rather than uid -->
3232
<strong><a href="{% url 'computer' site_uid=site.uid pc_uid=pc.uid %}">{{ pc.name }}</a></strong>
@@ -40,22 +40,22 @@ <h2 class="divideheader">
4040
<td>{{ pc.location }}</td>
4141
<td>
4242
{% if pc.online %}
43-
<span class="badge bg-success">Online</span>
43+
<span class="badge bg-success">Online</span>
4444
{% elif pc.is_activated %}
45-
<span class="badge bg-danger">Offline</span>
45+
<span class="badge bg-danger">Offline</span>
4646
{% endif %}
4747
</td>
4848
<td>{% if pc.last_seen %}{{ pc.last_seen|timesince }} siden ({{ pc.last_seen }}) {% else %}Aldrig{% endif %}</td>
4949
<td>
50-
{% if pc.security_events.latest_event %}
51-
{{ pc.security_events.latest_event.reported_time }}
52-
{% else %}
53-
Aldrig
54-
{% endif %}
50+
{% if pc.security_events.latest_event %}
51+
{{ pc.security_events.latest_event.reported_time }}
52+
{% else %}
53+
Aldrig
54+
{% endif %}
5555
</td>
56-
</tr>
56+
</tr>
5757
{% endfor %}
5858
</tbody>
59-
</table>
59+
</table>
6060
</div>
6161
{% endblock %}

docker/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ COPY --from=frontend \
7373
/code/nodejs/node_modules/jquery/dist/jquery.min.js \
7474
/code/nodejs/node_modules/qrcodejs/qrcode.min.js \
7575
/code/nodejs/node_modules/bootstrap-table/dist/bootstrap-table.min.js \
76+
/code/nodejs/node_modules/bootstrap-table/dist/locale/bootstrap-table-da-DK.min.js \
7677
/frontend/js/
7778

7879
# Unfortunately, `collectstatic` requires all settings to be set. We include a

nodejs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"build-sass": "node_modules/.bin/sass src/custom.scss:dist/css/bootstrap.css --style=compressed --source-map",
1010
"watch-sass": "node_modules/.bin/sass src/custom.scss:/code/admin_site/static/css/bootstrap.css --style=compressed --source-map --watch",
1111
"copy-bootstrap-css": "cp dist/css/bootstrap.* node_modules/bootstrap-table/dist/bootstrap-table.min.css /code/admin_site/static/css",
12-
"copy-bootstrap-js": "cp node_modules/bootstrap/dist/js/bootstrap.bundle.min.js* node_modules/bootstrap-table/dist/bootstrap-table.min.js /code/admin_site/static/js",
12+
"copy-bootstrap-js": "cp node_modules/bootstrap/dist/js/bootstrap.bundle.min.js* node_modules/bootstrap-table/dist/bootstrap-table.min.js node_modules/bootstrap-table/dist/locale/bootstrap-table-da-DK.min.js /code/admin_site/static/js",
1313
"test": "echo \"Error: no test specified\" && exit 1"
1414
},
1515
"author": "Magenta ApS",

0 commit comments

Comments
 (0)