Skip to content

Commit 5b10026

Browse files
author
jokob-sk
committed
cleanup, css, rebase to alpine 3.21 #968
1 parent 5110a3c commit 5b10026

37 files changed

+116
-311
lines changed

Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.20 AS builder
1+
FROM alpine:3.21 AS builder
22

33
ARG INSTALL_DIR=/app
44

@@ -14,7 +14,7 @@ ENV PATH="/opt/venv/bin:$PATH"
1414
COPY . ${INSTALL_DIR}/
1515

1616

17-
RUN pip install openwrt-luci-rpc asusrouter asyncio aiohttp graphene flask netifaces tplink-omada-client wakeonlan pycryptodome requests paho-mqtt scapy cron-converter pytz json2table dhcp-leases pyunifi speedtest-cli chardet python-nmap dnspython librouteros git+https://github.com/foreign-sub/aiofreepybox.git \
17+
RUN pip install openwrt-luci-rpc asusrouter asyncio aiohttp graphene flask tplink-omada-client wakeonlan pycryptodome requests paho-mqtt scapy cron-converter pytz json2table dhcp-leases pyunifi speedtest-cli chardet python-nmap dnspython librouteros git+https://github.com/foreign-sub/aiofreepybox.git \
1818
&& bash -c "find ${INSTALL_DIR} -type d -exec chmod 750 {} \;" \
1919
&& bash -c "find ${INSTALL_DIR} -type f -exec chmod 640 {} \;" \
2020
&& bash -c "find ${INSTALL_DIR} -type f \( -name '*.sh' -o -name '*.py' -o -name 'speedtest-cli' \) -exec chmod 750 {} \;"
@@ -23,7 +23,7 @@ RUN pip install openwrt-luci-rpc asusrouter asyncio aiohttp graphene flask netif
2323
RUN cat ${INSTALL_DIR}/install/freebox_certificate.pem >> /opt/venv/lib/python3.12/site-packages/aiofreepybox/freebox_certificates.pem
2424

2525
# second stage
26-
FROM alpine:3.20 AS runner
26+
FROM alpine:3.21 AS runner
2727

2828
ARG INSTALL_DIR=/app
2929

Dockerfile.debian

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ RUN phpenmod -v 8.2 sqlite3
4343
RUN apt-get install -y python3-venv
4444
RUN python3 -m venv myenv
4545

46-
RUN /bin/bash -c "source myenv/bin/activate && update-alternatives --install /usr/bin/python python /usr/bin/python3 10 && pip3 install openwrt-luci-rpc asusrouter asyncio aiohttp graphene flask netifaces tplink-omada-client wakeonlan pycryptodome requests paho-mqtt scapy cron-converter pytz json2table dhcp-leases pyunifi speedtest-cli chardet python-nmap dnspython librouteros "
46+
RUN /bin/bash -c "source myenv/bin/activate && update-alternatives --install /usr/bin/python python /usr/bin/python3 10 && pip3 install openwrt-luci-rpc asusrouter asyncio aiohttp graphene flask tplink-omada-client wakeonlan pycryptodome requests paho-mqtt scapy cron-converter pytz json2table dhcp-leases pyunifi speedtest-cli chardet python-nmap dnspython librouteros "
4747

4848
# Create a buildtimestamp.txt to later check if a new version was released
4949
RUN date +%s > ${INSTALL_DIR}/front/buildtimestamp.txt

docker-compose.yml

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ services:
6262
- ${DEV_LOCATION}/front/workflows.php:/app/front/workflows.php
6363
- ${DEV_LOCATION}/front/appEventsCore.php:/app/front/appEventsCore.php
6464
- ${DEV_LOCATION}/front/multiEditCore.php:/app/front/multiEditCore.php
65-
- ${DEV_LOCATION}/front/donations.php:/app/front/donations.php
6665
- ${DEV_LOCATION}/front/plugins:/app/front/plugins
6766
# DELETE END anyone trying to use this file: comment out / delete ABOVE lines, they are only for development purposes
6867
# ---------------------------------------------------------------------------

front/css/app.css

+18-6
Original file line numberDiff line numberDiff line change
@@ -1331,8 +1331,8 @@ input[readonly] {
13311331
top: -6px;
13321332
position: absolute;
13331333
z-index: 1;
1334-
left: 0px;
1335-
font-size: large;
1334+
left: 4px;
1335+
font-size: smaller;
13361336
}
13371337

13381338
.drag
@@ -1397,6 +1397,7 @@ input[readonly] {
13971397
{
13981398
display: none;
13991399
padding-top: 2em;
1400+
cursor: default;
14001401
}
14011402

14021403
/* ----------------------------------------------------------------- */
@@ -1618,6 +1619,20 @@ input[readonly] {
16181619
}
16191620
}
16201621

1622+
/* ----------------------------------------------------------------- */
1623+
/* EVENTS page */
1624+
/* ----------------------------------------------------------------- */
1625+
1626+
.eventsPeriodSelectWrap{
1627+
display: inline;
1628+
float: right;
1629+
}
1630+
1631+
.eventsPage #tableEventsTitle
1632+
{
1633+
float: left ;
1634+
}
1635+
16211636
/* ----------------------------------------------------------------- */
16221637
/* PLUGINS page */
16231638
/* ----------------------------------------------------------------- */
@@ -1800,10 +1815,7 @@ input[readonly] {
18001815
----------------------------------------------------------------------------- */
18011816
#multiEditPlc
18021817
{
1803-
position: fixed;
1804-
bottom: 50px;
1805-
right: 0px;
1806-
z-index: 10;
1818+
padding-right: 10px;
18071819
}
18081820

18091821

front/devices.php

+7-12
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,6 @@
2828
<!-- Page ------------------------------------------------------------------ -->
2929
<div class="content-wrapper">
3030

31-
<!-- Content header--------------------------------------------------------- -->
32-
<section class="content-header">
33-
<h1 id="pageTitle">
34-
<i class="fa fa-laptop"></i>
35-
<?= lang('Device_Title');?>
36-
</h1>
37-
</section>
38-
3931
<!-- Main content ---------------------------------------------------------- -->
4032
<section class="content">
4133

@@ -78,6 +70,9 @@
7870
<h3 id="tableDevicesTitle" class="box-title text-gray "></h3>
7971
</div>
8072
<div class="dummyDevice col-md-3 ">
73+
<span id="multiEditPlc">
74+
<!-- multi edit button placeholder -->
75+
</span>
8176
<span>
8277
<a href="deviceDetails.php?mac=new"><i title="<?= lang('Gen_create_new_device');?>" class="fa fa-square-plus"></i> <?= lang('Gen_create_new_device');?></a>
8378
</span>
@@ -106,7 +101,7 @@
106101
<!-- ----------------------------------------------------------------------- -->
107102
</section>
108103
<!-- /.content -->
109-
<div id="multiEditPlc" class="col-md-2"></div>
104+
110105
</div>
111106
<!-- /.content-wrapper -->
112107

@@ -749,9 +744,9 @@ function initializeDatatable (status) {
749744

750745
// add multi-edit button
751746
$('#multiEditPlc').append(
752-
`<button type="submit" id="multiEdit" class="btn btn-primary" style="display:none" onclick="multiEditDevices();">
753-
<i class="fa fa-pencil pointer" ></i> ${getString("Device_MultiEdit")}
754-
</button>`)
747+
`<span type="submit" id="multiEdit" class="pointer " style="display:none" onclick="multiEditDevices();">
748+
<a href="#"><i class="fa fa-pencil " ></i> ${getString("Device_MultiEdit")} </a>
749+
</span>`)
755750

756751
// Event listener for row selection in DataTable
757752
$('#tableDevices').on('click', 'tr', function (e) {

front/donations.php

-70
This file was deleted.

front/events.php

+19-36
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,11 @@
1-
<!--
2-
#---------------------------------------------------------------------------------#
3-
# NetAlertX #
4-
# Open Source Network Guard / WIFI & LAN intrusion detector #
5-
# #
6-
# events.php - Front module. Events page #
7-
#---------------------------------------------------------------------------------#
8-
# Puche 2021 [email protected] GNU GPLv3 #
9-
# jokob-sk 2022 [email protected] GNU GPLv3 #
10-
# leiweibau 2022 https://github.com/leiweibau GNU GPLv3 #
11-
# cvc90 2023 https://github.com/cvc90 GNU GPLv3 #
12-
#---------------------------------------------------------------------------------#
13-
-->
14-
151
<?php
162
require 'php/templates/header.php';
173
?>
184

195
<!-- ----------------------------------------------------------------------- -->
206

217
<!-- Page ------------------------------------------------------------------ -->
22-
<div class="content-wrapper">
23-
24-
<!-- Content header--------------------------------------------------------- -->
25-
<section class="content-header">
26-
<h1 id="pageTitle">
27-
<i class="fa fa-bolt"></i>
28-
<?= lang('Events_Title');?>
29-
</h1>
30-
31-
<!-- period selector -->
32-
<span class="breadcrumb" style="top: 0px;">
33-
<select class="form-control" id="period" onchange="javascript: periodChanged();">
34-
<option value="1 day"><?= lang('Events_Periodselect_today');?></option>
35-
<option value="7 days"><?= lang('Events_Periodselect_LastWeek');?></option>
36-
<option value="1 month" selected><?= lang('Events_Periodselect_LastMonth');?></option>
37-
<option value="1 year"><?= lang('Events_Periodselect_LastYear');?></option>
38-
<option value="100 years"><?= lang('Events_Periodselect_All');?></option>
39-
</select>
40-
</span>
41-
</section>
8+
<div class="content-wrapper eventsPage">
429

4310
<!-- Main content ---------------------------------------------------------- -->
4411
<section class="content">
@@ -123,15 +90,31 @@
12390
<!-- datatable ------------------------------------------------------------- -->
12491
<div class="row">
12592
<div class="col-xs-12">
93+
12694
<div id="tableEventsBox" class="box">
12795

12896
<!-- box-header -->
129-
<div class="box-header">
130-
<h3 id="tableEventsTitle" class="box-title text-gray">Events</h3>
97+
<div class="box-header col-xs-12">
98+
<h3 id="tableEventsTitle" class="box-title text-gray col-xs-10">Events</h3>
99+
<div class="eventsPeriodSelectWrap col-xs-2">
100+
<select class="form-control" id="period" onchange="javascript: periodChanged();">
101+
<option value="1 day"><?= lang('Events_Periodselect_today');?></option>
102+
<option value="7 days"><?= lang('Events_Periodselect_LastWeek');?></option>
103+
<option value="1 month" selected><?= lang('Events_Periodselect_LastMonth');?></option>
104+
<option value="1 year"><?= lang('Events_Periodselect_LastYear');?></option>
105+
<option value="100 years"><?= lang('Events_Periodselect_All');?></option>
106+
</select>
107+
</div>
108+
131109
</div>
132110

111+
112+
133113
<!-- table -->
134114
<div class="box-body table-responsive">
115+
116+
117+
135118
<table id="tableEvents" class="table table-bordered table-hover table-striped ">
136119
<thead>
137120
<tr>

front/help_faq.php

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
<?php
22
require 'php/templates/header.php';
3+
require 'php/templates/notification.php';
34
?>
45
<!-- Page ------------------------------------------------------------------ -->
56
<div class="content-wrapper">
6-
7-
<!-- Content header--------------------------------------------------------- -->
8-
<section class="content-header">
9-
<?php require 'php/templates/notification.php'; ?>
10-
<h1 id="pageTitle">
11-
<i class="fa fa-question"></i>
12-
<?= lang('HelpFAQ_Title');?>
13-
</h1>
14-
</section>
15-
167
<!-- Main content ---------------------------------------------------------- -->
178
<section class="content">
189
<h4>

front/maintenance.php

+7-37
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,16 @@
1-
<?php
2-
#---------------------------------------------------------------------------------#
3-
# NetAlertX #
4-
# Open Source Network Guard / WIFI & LAN intrusion detector #
5-
# #
6-
# maintenance.php - Front module. Server side. Maintenance #
7-
#---------------------------------------------------------------------------------#
8-
# Puche 2021 [email protected] GNU GPLv3 #
9-
# jokob-sk 2022 [email protected] GNU GPLv3 #
10-
# leiweibau 2022 https://github.com/leiweibau GNU GPLv3 #
11-
# cvc90 2023 https://github.com/cvc90 GNU GPLv3 #
12-
#---------------------------------------------------------------------------------#
13-
14-
15-
16-
//------------------------------------------------------------------------------
17-
?>
18-
19-
20-
211
<?php
222
require 'php/templates/header.php';
3+
require 'php/templates/notification.php';
234
?>
245

25-
<!-- ----------------------------------------------------------------------- -->
26-
27-
286
<!-- Page ------------------------------------------------------------------ -->
297
<div class="content-wrapper" id="maintenancePage">
308

31-
<!-- Content header--------------------------------------------------------- -->
32-
<section class="content-header">
33-
<?php require 'php/templates/notification.php'; ?>
34-
<h1 id="pageTitle">
35-
<i class="fa fa-wrench"></i>
36-
<?= lang('Maintenance_Title');?>
37-
</h1>
38-
</section>
9+
<!-- Main content ---------------------------------------------------------- -->
10+
<section class="content">
3911

40-
<!-- Main content ---------------------------------------------------------- -->
41-
<section class="content">
4212

43-
44-
<?php
13+
<?php
4514

4615
// Size and last mod of DB ------------------------------------------------------
4716

@@ -91,10 +60,11 @@
9160
<div class="db_info_table_row">
9261
<div class="db_info_table_cell" style="min-width: 140px"><?= lang('Maintenance_version');?>
9362
<a href="https://github.com/jokob-sk/NetAlertX/blob/main/docs/VERSIONS.md" target="_blank"> <span><i class="fa fa-circle-question"></i></a><span>
94-
9563
</div>
9664
<div class="db_info_table_cell">
97-
<div class="version" id="version" data-build-time="<?php echo file_get_contents( "buildtimestamp.txt");?>"><?php echo '<span id="new-version-text" class="myhidden">' .lang('Maintenance_new_version').'</span>'.'<span id="current-version-text" class="myhidden">' .lang('Maintenance_current_version').'</span>';?></div>
65+
<div class="version" id="version" data-build-time="<?php echo file_get_contents( "buildtimestamp.txt");?>">
66+
<?php echo '<span id="new-version-text" class="myhidden"><i class="fa-solid fa-rocket fa-beat"></i> ' .lang('Maintenance_new_version').'</span>'.'<span id="current-version-text" class="myhidden">' .lang('Maintenance_current_version').'</span>';?>
67+
</div>
9868
</div>
9969
</div>
10070
<div class="db_info_table_row">

0 commit comments

Comments
 (0)