Compare commits

...

4 Commits

Author SHA1 Message Date
Maxi Quoß 3f0487ef6a v1.2.2 2022-01-15 15:35:43 +01:00
Maxi Quoß d965d17d54 use alpine image to fix #3 2022-01-15 15:29:30 +01:00
Maxi Quoß 4c406227b5 v1.2.1 2022-01-14 18:55:22 +01:00
Maxi Quoß 963a38bc8b fix couple js errors, remove visitors notification 2022-01-14 18:55:16 +01:00
6 changed files with 19 additions and 22 deletions
+9 -9
View File
@@ -1,26 +1,26 @@
FROM python:3.10-slim-bullseye as base
FROM python:3.10-alpine as base
FROM base as builder
ENV PYTHONUNBUFFERED 1
RUN apt-get update && apt-get -y install build-essential libssl-dev libffi-dev python3-dev cargo libpq-dev && \
RUN apk update &&\
apk add python3-dev musl-dev build-base gcc libffi-dev libressl-dev postgresql-dev cargo &&\
rm -rf /var/cache/apk/* &&\
mkdir /install
WORKDIR /install
COPY requirements.txt .
RUN python -m pip install --no-cache-dir --upgrade pip && \
pip install --prefix=/install --no-cache-dir -r requirements.txt && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean
RUN python -m pip install --no-cache-dir --upgrade pip &&\
pip install --prefix=/install --no-cache-dir -r requirements.txt
FROM base
COPY --from=builder /install /usr/local
COPY app /app
WORKDIR /app
RUN apt-get update && \
apt-get -y install iputils-ping nmap curl && \
rm -rf /var/lib/apt/lists/*
RUN apk update &&\
apk add iputils nmap curl bash &&\
rm -rf /var/cache/apk/*
HEALTHCHECK --interval=10s \
CMD curl -fs "http://localhost:$DJANGO_PORT/health/" || exit 1
+1 -1
View File
@@ -142,4 +142,4 @@ STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
VERSION = "v1.1.2"
VERSION = "v1.2.2"
+4 -7
View File
@@ -108,7 +108,7 @@ window.onload = () => {
(hour < 10 ? "0" + hour.toString() : hour) + ":" +
(minute < 10 ? "0" + minute.toString() : minute) +
utcString.substring(16, 19);
// prepare html elements
var datetimeFields = document.querySelectorAll('[id*=-input]');
for (let index = 0; index < datetimeFields.length; index++) {
@@ -200,10 +200,10 @@ function setDeviceDown(device) {
var statusDot = document.getElementById(device.id + "-dot");
var statusPorts = document.getElementById(device.id + "-ports");
var wakeButton = document.querySelector(`[id="btn-wake"][data-id="${device.id}"]`)
var scheduleModalButton = document.getElementById(device.id + "-btn-schedule");
var scheduleModalButton = document.getElementById(device.id + "-btn-schedule");
// check if device was up before
if (statusDot.classList.contains("dot-up") && enableNotifications ) {
if (statusDot.classList.contains("dot-up") && enableNotifications) {
notif.show("Device now down!", device.name + " is now down.", "is-danger", 5000);
}
@@ -287,9 +287,6 @@ socket.onmessage = function (event) {
document.getElementById("visitors").innerHTML = message.visitors + ' visitor';
} else {
document.getElementById("visitors").innerHTML = message.visitors + ' visitors';
if (enableNotifications) {
notif.show("Visitors updated", "There are currently " + message.visitors + " visitors", "is-info", 5000);
}
}
}
@@ -330,7 +327,7 @@ socket.onmessage = function (event) {
if ("reload" in message) {
window.location.reload(true);
}
}
socket.onclose = function (event) {
if (enableNotifications) {
+2 -2
View File
@@ -99,7 +99,7 @@ async function scan() {
const td2 = row.insertCell();
const td3 = row.insertCell();
const td4 = row.insertCell();
const deviceName = "Unknown";
let deviceName = "Unknown";
if (device.name != "") {
deviceName = device.name;
}
@@ -110,7 +110,7 @@ async function scan() {
button.classList.add("button", "is-primary", "is-small");
button.innerText = "Add";
button.addEventListener("click", function (event) {
update_device(JSON.stringify(device));
post_settings("/settings/update/", JSON.stringify(device));
event.target.disabled = true;
event.target.innerText = "Added";
});
+2 -2
View File
@@ -146,7 +146,7 @@
</span>
</button>
{% endif %}
<h3 class="title is-size-4 my-5">Add custom</h3>
<h3 class="title is-size-4 my-5">Add devices</h3>
<form action="/settings/custom_add/" method="post">
{% csrf_token %}
<table class="table is-fullwidth">
@@ -257,7 +257,7 @@
</div>
</div>
</section>
<section class="section py-3">
<section class="section py-3 mb-6">
<h2 class="title is-size-3 my-5">Info</h2>
<div class="box no-flex">
<div class="columns">
+1 -1
View File
@@ -27,7 +27,7 @@ services:
- upsnap_postgres
upsnap_redis:
container_name: upsnap_redis
image: redis:6
image: redis:alpine
ports:
- "6379:6379"
restart: unless-stopped