Skip to content

Commit

Permalink
Merge pull request #1461 from rern/UPDATE
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
rern authored Oct 22, 2023
2 parents 7a3f9b0 + 989babd commit e8dcd5a
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 14 deletions.
16 changes: 15 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,23 @@ alias=r1

. /srv/http/bash/settings/addons.sh

# 20231022
if [[ -e /boot/kernel.img && ! -e /lib/python3.10/site-packages/websocket ]]; then
echo '
[alarm]
SigLevel = PackageRequired
Include = /etc/pacman.d/mirrorlist
[community]
SigLevel = PackageRequired
Include = /etc/pacman.d/mirrorlist' >> /etc/pacman.conf
pacman -Sy --noconfirm python-websocket-client
systemctl start websocket
fi

# 20231020
file=$dirsystem/localbrowser.conf
if ! grep -q runxinitrcd $file; then
if [[ -e $file ]] && ! grep -q runxinitrcd $file; then
sed -i -e '/hdmi/ d
' -e '$ a\
runxinitrcd=
Expand Down
3 changes: 3 additions & 0 deletions srv/http/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,9 @@ i.map.disabled, .map.disabled i {
left: 0;
right: 0;
margin: auto;
width: 40px;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 24px;
}
Expand Down
8 changes: 4 additions & 4 deletions srv/http/assets/js/networks.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,17 +282,17 @@ function infoWiFi( v ) {
, checkbox : [ 'WEP', 'Hidden SSID' ]
, values : values
, checkblank : [ 0 ]
, checkchanged : true
, checkchanged : ! V.wifistatic
, ok : () => connectWiFi( infoVal() )
} );
}
function infoWiFiGet() {
bash( [ 'profileget', V.li.data( 'ssid' ), 'CMD SSID' ], v => {
var static = v.IP === 'static'
V.wifistatic = v.IP === 'static'
v.SECURITY = v.SECURITY === 'wep';
v.HIDDEN = 'HIDDEN' in v;
[ 'INTERFACE', 'CONNECTION', 'IP' ].forEach( k => delete v[ k ] );
static ? infoWiFiStatic( v ) : infoWiFi( v );
V.wifistatic ? infoWiFiStatic( v ) : infoWiFi( v );
}, 'json' );
}
function infoWiFiStatic( v ) {
Expand All @@ -314,7 +314,7 @@ function infoWiFiStatic( v ) {
, checkbox : [ 'WEP', 'Hidden SSID' ]
, values : values
, checkblank : [ 0 ]
, checkchanged : true
, checkchanged : V.wifistatic
, checkip : [ 2, 3 ]
, beforeshow : () => $('#infoContent input' ).eq( 1 ).attr( 'type', 'password' )
, ok : () => connectWiFi( infoVal() )
Expand Down
11 changes: 6 additions & 5 deletions srv/http/bash/settings/networks-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ listWlan() {
readarray -t profiles <<< $( ls -1p /etc/netctl | grep -v /$ )
if [[ $profiles ]]; then
for profile in "${profiles[@]}"; do
ssid=$( stringEscape $profile )
! grep -q 'Interface="*'$wldev "/etc/netctl/$profile" && continue
if netctl is-active "$profile" &> /dev/null; then
for i in {1..10}; do
Expand All @@ -48,14 +49,14 @@ listWlan() {
dbm=$( awk '/'$wldev'/ {print $4}' /proc/net/wireless | tr -d . )
[[ ! $dbm ]] && dbm=0
listwl=',{
"dbm" : '$dbm'
, "gateway" : "'$gatewaywl'"
, "ip" : "'$IPWL'"
, "ssid" : "'$( stringEscape $profile )'"
"dbm" : '$dbm'
, "gateway" : "'$gatewaywl'"
, "ip" : "'$IPWL'"
, "ssid" : "'$ssid'"
}'
else
notconnected+=',{
"ssid" : "'$( stringEscape $profile )'"
"ssid" : "'$ssid'"
}'
fi
done
Expand Down
2 changes: 1 addition & 1 deletion srv/http/bash/settings/system-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ data+='
, "hostname" : "'$( hostname )'"
, "i2seeprom" : '$( grep -q -m1 force_eeprom_read=0 /boot/config.txt && echo true )'
, "i2smodulesw" : '$i2smodulesw'
, "ipsub" : "'$( ipSub )'"
, "ipsub" : "'$( ipSub )'"
, "lcdchar" : '$( exists $dirsystem/lcdchar )'
, "lcdcharaddr" : '$lcdcharaddr'
, "lcdcharconf" : '$( conf2json lcdcharconf.py )'
Expand Down
5 changes: 2 additions & 3 deletions srv/http/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
// hovercursor.css and shortcut.js - appended last
$title = 'STATUS';
} else { // settings
// foreach( [ 'addons', 'addonsprogress', 'guide', 'networks' ] as $k ) ${ $k } = $page === $k;
$$page = true; // $$ - variable variables
$$page = true; // $$ - variable value as variable name
$cssp = [];
$css[] = 'settings';
$jsp = [ 'jquery', $networks ? 'qrcode' : 'select2' ];
$js = [ 'common', 'settings', $page ];
Expand All @@ -74,7 +74,6 @@
$css[] = 'select2';
}
if ( $addons ) $css[] = 'addons';

$icon = $page;
$pagetitle = strtoupper( $page );
if ( $addonsprogress ) {
Expand Down

0 comments on commit e8dcd5a

Please sign in to comment.