13 changed files with 566 additions and 40 deletions
-
119lib/scripts/distro_web_utils.php
-
208lib/scripts/sys_utils.php
-
7lib/scripts/test.php
-
26lib/sysroot/srv/etc/boot.php
-
61lib/sysroot/srv/etc/cron.php
-
2lib/sysroot/srv/etc/system.json
-
21nm_add.php
-
15nm_error.php
-
102nm_operation.php
-
6style/style.css
-
11task_wait.php
-
10wan_cp.php
-
18wan_modem_operation.php
@ -1 +1 @@ |
|||
{"PERIODIC_JOB_COUNTS":0,"SAMBA_IS_ON":true,"ARGUS_CONFIG":{"app_is_running":true,"webui_is_running":true},"MODEM_SETUP":true,"MODEM_CONFIG":{"DEVICES":[{"3gpp":{"enabled-locks":[],"eps":{"initial-bearer":{"dbus-path":"--","settings":{"apn":"--","ip-type":"--","password":"--","user":"--"}},"ue-mode-operation":"csps-1"},"imei":"860147051348496","operator-code":"42501","operator-name":"Partner","pco":"--","registration-state":"--"},"cdma":{"activation-state":"--","cdma1x-registration-state":"--","esn":"--","evdo-registration-state":"--","meid":"--","nid":"--","sid":"--"},"dbus-path":"\/org\/freedesktop\/ModemManager1\/Modem\/0","generic":{"access-technologies":["lte"],"bearers":[],"carrier-configuration":"ROW_Gen_VoLTE","carrier-configuration-revision":"05010822","current-bands":["egsm","dcs","utran-1","utran-5","utran-8","eutran-1","eutran-3","eutran-5","eutran-7","eutran-8","eutran-20","eutran-38","eutran-40","eutran-41"],"current-capabilities":["gsm-umts, lte"],"current-modes":"allowed: 2g, 3g, 4g; preferred: 4g","device":"\/sys\/devices\/pci0000:00\/0000:00:14.0\/usb1\/1-2","device-identifier":"370583bd437ad3b0629ff381ca0c81fc37647d4a","drivers":["option1","qmi_wwan"],"equipment-identifier":"860147051348496","hardware-revision":"10000","manufacturer":"QUALCOMM INCORPORATED","model":"SIMCOM_SIM7600E-H","own-numbers":[],"plugin":"simtech","ports":["cdc-wdm0 (qmi)","ttyUSB1 (qcdm)","ttyUSB2 (gps)","ttyUSB3 (at)","ttyUSB4 (at)","ttyUSB5 (audio)","wwan0 (net)"],"power-state":"on","primary-port":"cdc-wdm0","revision":"LE20B04SIM7600M22_210318","signal-quality":{"recent":"yes","value":"59"},"sim":"\/org\/freedesktop\/ModemManager1\/SIM\/0","state":"enabled","state-failed-reason":"--","supported-bands":["egsm","dcs","utran-1","utran-5","utran-8","eutran-1","eutran-3","eutran-5","eutran-7","eutran-8","eutran-20","eutran-38","eutran-40","eutran-41"],"supported-capabilities":["gsm-umts, lte"],"supported-ip-families":["ipv4","ipv6","ipv4v6"],"supported-modes":["allowed: 2g; preferred: none","allowed: 3g; preferred: none","allowed: 4g; preferred: none","allowed: 2g, 3g; preferred: 3g","allowed: 2g, 3g; preferred: 2g","allowed: 2g, 4g; preferred: 4g","allowed: 2g, 4g; preferred: 2g","allowed: 3g, 4g; preferred: 4g","allowed: 3g, 4g; preferred: 3g","allowed: 2g, 3g, 4g; preferred: 4g","allowed: 2g, 3g, 4g; preferred: 3g","allowed: 2g, 3g, 4g; preferred: 2g"],"unlock-required":"sim-pin2","unlock-retries":["sim-pin (3)","sim-puk (10)","sim-pin2 (3)","sim-puk2 (10)"]}}]},"NET_CONFIG":{"lo":{"flags":{"hotplug":0,"auto":1},"net":[],"fam":"inet","mode":"loopback"},"enp6s0":{"flags":{"hotplug":1,"auto":0},"net":[],"fam":"inet","mode":"dhcp"}}} |
|||
{"PERIODIC_JOB_COUNTS":0,"SAMBA_IS_ON":true,"ARGUS_CONFIG":{"app_is_running":true,"webui_is_running":true},"MODEM_SETUP":true,"MODEM_CONFIG":{"DEVICES":[{"3gpp":{"enabled-locks":[],"eps":{"initial-bearer":{"dbus-path":"--","settings":{"apn":"--","ip-type":"--","password":"--","user":"--"}},"ue-mode-operation":"csps-1"},"imei":"860147051348496","operator-code":"42501","operator-name":"Partner","pco":"--","registration-state":"home"},"cdma":{"activation-state":"--","cdma1x-registration-state":"--","esn":"--","evdo-registration-state":"--","meid":"--","nid":"--","sid":"--"},"dbus-path":"\/org\/freedesktop\/ModemManager1\/Modem\/0","generic":{"access-technologies":["lte"],"bearers":["\/org\/freedesktop\/ModemManager1\/Bearer\/0"],"carrier-configuration":"ROW_Gen_VoLTE","carrier-configuration-revision":"05010822","current-bands":["egsm","dcs","utran-1","utran-5","utran-8","eutran-1","eutran-3","eutran-5","eutran-7","eutran-8","eutran-20","eutran-38","eutran-40","eutran-41"],"current-capabilities":["gsm-umts, lte"],"current-modes":"allowed: 2g, 3g, 4g; preferred: 4g","device":"\/sys\/devices\/pci0000:00\/0000:00:14.0\/usb1\/1-4","device-identifier":"370583bd437ad3b0629ff381ca0c81fc37647d4a","drivers":["option1","qmi_wwan"],"equipment-identifier":"860147051348496","hardware-revision":"10000","manufacturer":"QUALCOMM INCORPORATED","model":"SIMCOM_SIM7600E-H","own-numbers":[],"plugin":"simtech","ports":["cdc-wdm0 (qmi)","ttyUSB0 (qcdm)","ttyUSB1 (gps)","ttyUSB2 (at)","ttyUSB3 (at)","ttyUSB4 (audio)","wwan0 (net)"],"power-state":"on","primary-port":"cdc-wdm0","revision":"LE20B04SIM7600M22_210318","signal-quality":{"recent":"yes","value":"89"},"sim":"\/org\/freedesktop\/ModemManager1\/SIM\/0","state":"connected","state-failed-reason":"--","supported-bands":["egsm","dcs","utran-1","utran-5","utran-8","eutran-1","eutran-3","eutran-5","eutran-7","eutran-8","eutran-20","eutran-38","eutran-40","eutran-41"],"supported-capabilities":["gsm-umts, lte"],"supported-ip-families":["ipv4","ipv6","ipv4v6"],"supported-modes":["allowed: 2g; preferred: none","allowed: 3g; preferred: none","allowed: 4g; preferred: none","allowed: 2g, 3g; preferred: 3g","allowed: 2g, 3g; preferred: 2g","allowed: 2g, 4g; preferred: 4g","allowed: 2g, 4g; preferred: 2g","allowed: 3g, 4g; preferred: 4g","allowed: 3g, 4g; preferred: 3g","allowed: 2g, 3g, 4g; preferred: 4g","allowed: 2g, 3g, 4g; preferred: 3g","allowed: 2g, 3g, 4g; preferred: 2g"],"unlock-required":"sim-pin2","unlock-retries":["sim-pin (3)","sim-puk (10)","sim-pin2 (3)","sim-puk2 (10)"]},"location":{"capabilities":["3gpp-lac-ci","gps-raw","gps-nmea","gps-unmanaged","agps-msa","agps-msb"],"enabled":["3gpp-lac-ci"],"gps":{"assistance":[],"assistance-servers":[],"refresh-rate":"30","supl-server":"--"},"signals":"no"},"REGISTER_AT_BOOT":false,"CONNECT_AT_BOOT":false,"CUSTOM_APN":"","CUSTOM_APN_USER":"","CUSTOM_APN_PASSWORD":""}]},"NET_CONFIG":{"lo":{"flags":{"hotplug":0,"auto":1},"net":[],"fam":"inet","mode":"loopback"},"enp6s0":{"flags":{"hotplug":1,"auto":0},"net":[],"fam":"inet","mode":"dhcp"}}} |
|||
@ -0,0 +1,21 @@ |
|||
<?php |
|||
|
|||
require_once('../../scripts/sys_utils.php'); |
|||
require_once('../../scripts/distro_web_utils.php'); |
|||
|
|||
foreach( $SYS_CONFIG['MODEM_CONFIG']['DEVICES'] as $ID=>$CD ){ |
|||
reload_modem_data( $ID ); |
|||
//$MANU = json_decode( `mmcli -m $ID --output-json`, true );
|
|||
//$LOLO = json_decode( `mmcli -m $ID --location-status --output-json`, true );
|
|||
//$MANU['modem']['location'] = $LOLO['modem']['location'];
|
|||
//$SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$ID]=$MANU['modem'];
|
|||
}; |
|||
|
|||
print_PAGE_HEADER(); |
|||
if( $SYS_CONFIG['NGINX_AUTH_IS_SET'] == false ) { |
|||
print_AUTH_WARNING(); |
|||
}; |
|||
print_NM_ADD_FORM(); |
|||
print_PAGE_BOTTOM(); |
|||
|
|||
?>
|
|||
@ -0,0 +1,15 @@ |
|||
<?php |
|||
|
|||
require_once('../../scripts/sys_utils.php'); |
|||
require_once('../../scripts/distro_web_utils.php'); |
|||
|
|||
print_PAGE_HEADER(); |
|||
if( isset( $_GET['eid'] ) ){ |
|||
switch( intval( $_GET['eid'] ) ){ |
|||
case 7: echo "Error: While Disconnecting Device!"; |
|||
}; |
|||
} else { |
|||
}; |
|||
print_PAGE_BOTTOM(); |
|||
|
|||
?>
|
|||
@ -0,0 +1,102 @@ |
|||
<?php |
|||
require_once('../../scripts/sys_utils.php'); |
|||
require_once('../../scripts/distro_web_utils.php'); |
|||
if( isset( $_GET['OP'] ) ){ |
|||
$OP = intval( $_GET['OP'] ); |
|||
switch( $OP ){ |
|||
case 1:{ |
|||
// Creating New Profile
|
|||
if( !isset( $_POST['cp_name'] ) ){ |
|||
header('location: nm_error.php?eid=1'); |
|||
exit(); |
|||
} else { |
|||
$add_params = array(); |
|||
if( isset($_POST['cp_aa']) && $_POST['cp_aa'] == 'yes' ) $add_params['connection.autoconnect'] = 'yes'; |
|||
if( strlen( $_POST['gsm_num'] ) ) $add_params['gsm.number'] = $_POST['gsm_num']; |
|||
if( strlen( $_POST['gsm_user'] ) ) $add_params['gsm.username'] = $_POST['gsm_user']; |
|||
if( strlen( $_POST['gsm_pass'] ) ) $add_params['gsm.password'] = $_POST['gsm_pass']; |
|||
if( strlen( $_POST['gsm_apn'] ) ) $add_params['gsm.apn'] = $_POST['gsm_apn']; |
|||
if( !create_NetworkManager_Profile( $_POST['cp_type'], $_POST['cp_name'], $add_params ) ){ |
|||
header('location: nm_error.php?eid=2'); |
|||
exit(); |
|||
}; |
|||
}; |
|||
break; |
|||
}; |
|||
case 2:{ |
|||
// modify
|
|||
break; |
|||
}; |
|||
case 3:{ |
|||
// delete
|
|||
if( isset( $_GET['pid'] ) ){ |
|||
if( !delete_NetworkManager_Profile( $_GET['pid'] ) ){ |
|||
header('location: nm_error.php?eid=3'); |
|||
exit(); |
|||
}; |
|||
} else { |
|||
header('location: nm_error.php?eid=4'); |
|||
exit(); |
|||
}; |
|||
break; |
|||
}; |
|||
case 4:{ |
|||
// connect
|
|||
if( isset( $_GET['dev'] ) ){ |
|||
if( !connect_NetworkManager_Device( $_GET['dev'] ) ){ |
|||
header('location: nm_error.php?eid=5'); |
|||
exit(); |
|||
}; |
|||
} else { |
|||
header('location: nm_error.php?eid=6'); |
|||
exit(); |
|||
}; |
|||
break; |
|||
}; |
|||
case 5:{ |
|||
// disconnect
|
|||
if( isset( $_GET['dev'] ) ){ |
|||
if( !disconnect_NetworkManager_Device( $_GET['dev'] ) ){ |
|||
header('location: nm_error.php?eid=7'); |
|||
exit(); |
|||
}; |
|||
} else { |
|||
header('location: nm_error.php?eid=6'); |
|||
exit(); |
|||
}; |
|||
break; |
|||
}; |
|||
case 6:{ |
|||
// set Active
|
|||
if( isset( $_GET['pid'] ) ){ |
|||
if( !activate_NetworkManager_Profile( $_GET['pid'] ) ){ |
|||
header('location: nm_error.php?eid=8'); |
|||
exit(); |
|||
}; |
|||
} else { |
|||
header('location: nm_error.php?eid=9'); |
|||
exit(); |
|||
}; |
|||
break; |
|||
}; |
|||
case 7:{ |
|||
// unset Active
|
|||
if( isset( $_GET['pid'] ) ){ |
|||
if( !deactivate_NetworkManager_Profile( $_GET['pid'] ) ){ |
|||
header('location: nm_error.php?eid=10'); |
|||
exit(); |
|||
}; |
|||
} else { |
|||
header('location: nm_error.php?eid=9'); |
|||
exit(); |
|||
}; |
|||
break; |
|||
}; |
|||
}; |
|||
header('location: /wan_cp.php'); |
|||
} else { |
|||
print_PAGE_HEADER(); |
|||
echo "WRONG USE"; |
|||
print_PAGE_BOTTOM(); |
|||
}; |
|||
?>
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue