Skip to content

Commit

Permalink
cleanup, css, rebase to alpine 3.21 #968
Browse files Browse the repository at this point in the history
  • Loading branch information
jokob-sk committed Jan 20, 2025
1 parent 5110a3c commit 5b10026
Show file tree
Hide file tree
Showing 37 changed files with 116 additions and 311 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.20 AS builder
FROM alpine:3.21 AS builder

ARG INSTALL_DIR=/app

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


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 \
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 \
&& bash -c "find ${INSTALL_DIR} -type d -exec chmod 750 {} \;" \
&& bash -c "find ${INSTALL_DIR} -type f -exec chmod 640 {} \;" \
&& bash -c "find ${INSTALL_DIR} -type f \( -name '*.sh' -o -name '*.py' -o -name 'speedtest-cli' \) -exec chmod 750 {} \;"
Expand All @@ -23,7 +23,7 @@ RUN pip install openwrt-luci-rpc asusrouter asyncio aiohttp graphene flask netif
RUN cat ${INSTALL_DIR}/install/freebox_certificate.pem >> /opt/venv/lib/python3.12/site-packages/aiofreepybox/freebox_certificates.pem

# second stage
FROM alpine:3.20 AS runner
FROM alpine:3.21 AS runner

ARG INSTALL_DIR=/app

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ RUN phpenmod -v 8.2 sqlite3
RUN apt-get install -y python3-venv
RUN python3 -m venv myenv

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 "
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 "

# Create a buildtimestamp.txt to later check if a new version was released
RUN date +%s > ${INSTALL_DIR}/front/buildtimestamp.txt
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ services:
- ${DEV_LOCATION}/front/workflows.php:/app/front/workflows.php
- ${DEV_LOCATION}/front/appEventsCore.php:/app/front/appEventsCore.php
- ${DEV_LOCATION}/front/multiEditCore.php:/app/front/multiEditCore.php
- ${DEV_LOCATION}/front/donations.php:/app/front/donations.php
- ${DEV_LOCATION}/front/plugins:/app/front/plugins
# DELETE END anyone trying to use this file: comment out / delete ABOVE lines, they are only for development purposes
# ---------------------------------------------------------------------------
Expand Down
24 changes: 18 additions & 6 deletions front/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -1331,8 +1331,8 @@ input[readonly] {
top: -6px;
position: absolute;
z-index: 1;
left: 0px;
font-size: large;
left: 4px;
font-size: smaller;
}

.drag
Expand Down Expand Up @@ -1397,6 +1397,7 @@ input[readonly] {
{
display: none;
padding-top: 2em;
cursor: default;
}

/* ----------------------------------------------------------------- */
Expand Down Expand Up @@ -1618,6 +1619,20 @@ input[readonly] {
}
}

/* ----------------------------------------------------------------- */
/* EVENTS page */
/* ----------------------------------------------------------------- */

.eventsPeriodSelectWrap{
display: inline;
float: right;
}

.eventsPage #tableEventsTitle
{
float: left ;
}

/* ----------------------------------------------------------------- */
/* PLUGINS page */
/* ----------------------------------------------------------------- */
Expand Down Expand Up @@ -1800,10 +1815,7 @@ input[readonly] {
----------------------------------------------------------------------------- */
#multiEditPlc
{
position: fixed;
bottom: 50px;
right: 0px;
z-index: 10;
padding-right: 10px;
}


Expand Down
19 changes: 7 additions & 12 deletions front/devices.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@
<!-- Page ------------------------------------------------------------------ -->
<div class="content-wrapper">

<!-- Content header--------------------------------------------------------- -->
<section class="content-header">
<h1 id="pageTitle">
<i class="fa fa-laptop"></i>
<?= lang('Device_Title');?>
</h1>
</section>

<!-- Main content ---------------------------------------------------------- -->
<section class="content">

Expand Down Expand Up @@ -78,6 +70,9 @@
<h3 id="tableDevicesTitle" class="box-title text-gray "></h3>
</div>
<div class="dummyDevice col-md-3 ">
<span id="multiEditPlc">
<!-- multi edit button placeholder -->
</span>
<span>
<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>
</span>
Expand Down Expand Up @@ -106,7 +101,7 @@
<!-- ----------------------------------------------------------------------- -->
</section>
<!-- /.content -->
<div id="multiEditPlc" class="col-md-2"></div>

</div>
<!-- /.content-wrapper -->

Expand Down Expand Up @@ -749,9 +744,9 @@ function initializeDatatable (status) {

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

// Event listener for row selection in DataTable
$('#tableDevices').on('click', 'tr', function (e) {
Expand Down
70 changes: 0 additions & 70 deletions front/donations.php

This file was deleted.

55 changes: 19 additions & 36 deletions front/events.php
Original file line number Diff line number Diff line change
@@ -1,44 +1,11 @@
<!--
#---------------------------------------------------------------------------------#
# NetAlertX #
# Open Source Network Guard / WIFI & LAN intrusion detector #
# #
# events.php - Front module. Events page #
#---------------------------------------------------------------------------------#
# Puche 2021 [email protected] GNU GPLv3 #
# jokob-sk 2022 [email protected] GNU GPLv3 #
# leiweibau 2022 https://github.com/leiweibau GNU GPLv3 #
# cvc90 2023 https://github.com/cvc90 GNU GPLv3 #
#---------------------------------------------------------------------------------#
-->

<?php
require 'php/templates/header.php';
?>

<!-- ----------------------------------------------------------------------- -->

<!-- Page ------------------------------------------------------------------ -->
<div class="content-wrapper">

<!-- Content header--------------------------------------------------------- -->
<section class="content-header">
<h1 id="pageTitle">
<i class="fa fa-bolt"></i>
<?= lang('Events_Title');?>
</h1>

<!-- period selector -->
<span class="breadcrumb" style="top: 0px;">
<select class="form-control" id="period" onchange="javascript: periodChanged();">
<option value="1 day"><?= lang('Events_Periodselect_today');?></option>
<option value="7 days"><?= lang('Events_Periodselect_LastWeek');?></option>
<option value="1 month" selected><?= lang('Events_Periodselect_LastMonth');?></option>
<option value="1 year"><?= lang('Events_Periodselect_LastYear');?></option>
<option value="100 years"><?= lang('Events_Periodselect_All');?></option>
</select>
</span>
</section>
<div class="content-wrapper eventsPage">

<!-- Main content ---------------------------------------------------------- -->
<section class="content">
Expand Down Expand Up @@ -123,15 +90,31 @@
<!-- datatable ------------------------------------------------------------- -->
<div class="row">
<div class="col-xs-12">

<div id="tableEventsBox" class="box">

<!-- box-header -->
<div class="box-header">
<h3 id="tableEventsTitle" class="box-title text-gray">Events</h3>
<div class="box-header col-xs-12">
<h3 id="tableEventsTitle" class="box-title text-gray col-xs-10">Events</h3>
<div class="eventsPeriodSelectWrap col-xs-2">
<select class="form-control" id="period" onchange="javascript: periodChanged();">
<option value="1 day"><?= lang('Events_Periodselect_today');?></option>
<option value="7 days"><?= lang('Events_Periodselect_LastWeek');?></option>
<option value="1 month" selected><?= lang('Events_Periodselect_LastMonth');?></option>
<option value="1 year"><?= lang('Events_Periodselect_LastYear');?></option>
<option value="100 years"><?= lang('Events_Periodselect_All');?></option>
</select>
</div>

</div>



<!-- table -->
<div class="box-body table-responsive">



<table id="tableEvents" class="table table-bordered table-hover table-striped ">
<thead>
<tr>
Expand Down
11 changes: 1 addition & 10 deletions front/help_faq.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
<?php
require 'php/templates/header.php';
require 'php/templates/notification.php';
?>
<!-- Page ------------------------------------------------------------------ -->
<div class="content-wrapper">

<!-- Content header--------------------------------------------------------- -->
<section class="content-header">
<?php require 'php/templates/notification.php'; ?>
<h1 id="pageTitle">
<i class="fa fa-question"></i>
<?= lang('HelpFAQ_Title');?>
</h1>
</section>

<!-- Main content ---------------------------------------------------------- -->
<section class="content">
<h4>
Expand Down
44 changes: 7 additions & 37 deletions front/maintenance.php
Original file line number Diff line number Diff line change
@@ -1,47 +1,16 @@
<?php
#---------------------------------------------------------------------------------#
# NetAlertX #
# Open Source Network Guard / WIFI & LAN intrusion detector #
# #
# maintenance.php - Front module. Server side. Maintenance #
#---------------------------------------------------------------------------------#
# Puche 2021 [email protected] GNU GPLv3 #
# jokob-sk 2022 [email protected] GNU GPLv3 #
# leiweibau 2022 https://github.com/leiweibau GNU GPLv3 #
# cvc90 2023 https://github.com/cvc90 GNU GPLv3 #
#---------------------------------------------------------------------------------#



//------------------------------------------------------------------------------
?>



<?php
require 'php/templates/header.php';
require 'php/templates/notification.php';
?>

<!-- ----------------------------------------------------------------------- -->


<!-- Page ------------------------------------------------------------------ -->
<div class="content-wrapper" id="maintenancePage">

<!-- Content header--------------------------------------------------------- -->
<section class="content-header">
<?php require 'php/templates/notification.php'; ?>
<h1 id="pageTitle">
<i class="fa fa-wrench"></i>
<?= lang('Maintenance_Title');?>
</h1>
</section>
<!-- Main content ---------------------------------------------------------- -->
<section class="content">

<!-- Main content ---------------------------------------------------------- -->
<section class="content">


<?php
<?php

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

Expand Down Expand Up @@ -91,10 +60,11 @@
<div class="db_info_table_row">
<div class="db_info_table_cell" style="min-width: 140px"><?= lang('Maintenance_version');?>
<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>

</div>
<div class="db_info_table_cell">
<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>
<div class="version" id="version" data-build-time="<?php echo file_get_contents( "buildtimestamp.txt");?>">
<?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>';?>
</div>
</div>
</div>
<div class="db_info_table_row">
Expand Down
Loading

0 comments on commit 5b10026

Please sign in to comment.