network settings page

This commit is contained in:
2017-07-23 00:57:31 +02:00
parent 3f09cc3601
commit b238390ca8
11 changed files with 248 additions and 94 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
foreach($_pages as $k => $page) {
if (strpos($page->bodyclass, 'cfg') === false) continue;
$sel = (CUR_PAGE == $k) ? ' class="selected"' : '';
$sel = ($_GET['page'] == $k) ? ' class="selected"' : '';
$text = $page->label;
$url = e(url($k));
echo "<a href=\"$url\"$sel>$text</a>";
+4 -4
View File
@@ -4,16 +4,16 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title><?= PAGE_TITLE ?></title>
<title><?= $_GET['PAGE_TITLE'] ?></title>
<link href="/css/app.css" rel="stylesheet">
<script src="/js/app.js"></script>
<script>var _root = <?= JS_WEB_ROOT ?>;</script>
</head>
<body class="<?= BODYCLASS ?>">
<body class="<?= $_GET['BODYCLASS'] ?>">
<div id="outer">
<?php
$cfg = false;
if (strpos($_pages[CUR_PAGE]->bodyclass, 'cfg') !== false) {
if (strpos($_GET['BODYCLASS'], 'cfg') !== false) {
$cfg = true;
require __DIR__ . '/_cfg_menu.php';
}
@@ -22,5 +22,5 @@ if (strpos($_pages[CUR_PAGE]->bodyclass, 'cfg') !== false) {
<div id="content">
<img src="/img/loader.gif" alt="Loading…" id="loader">
<?php if ($cfg): ?>
<h1><?= tr('menu.' . CUR_PAGE) ?></h1>
<h1><?= tr('menu.' . $_GET['page']) ?></h1>
<?php endif; ?>
+76
View File
@@ -0,0 +1,76 @@
<?php
$ipmask='pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}$"';
?>
<form class="Box str mobcol" action="<?= e(url('wifi_set')) ?>" method="GET">
<h2><?= tr('net.ap') ?></h2>
<div class="Row buttons">
<input type="submit" value="<?= tr('apply') ?>">
</div>
<div class="Row mq-phone" style="height: 35px"></div>
<div class="Row" style="max-width: 600px; margin-left: 0">
<?= tr('net.explain_ap') ?>
</div>
<div class="Row">
<label for="ap_dhcp_time"><?= tr('net.ap_dhcp_time') ?><span class="mq-phone">&nbsp;(min)</span></label>
<input type="number" step=1 min=1 max=2880 name="ap_dhcp_time" id="ap_dhcp_time" value="%ap_dhcp_time%" required>
<span class="mq-no-phone">&nbsp;(min)</span>
</div>
<div class="Row">
<label for="ap_dhcp_start"><?= tr('net.ap_dhcp_start') ?></label>
<input type="text" name="ap_dhcp_start" id="ap_dhcp_start" value="%ap_dhcp_start%" <?=$ipmask?> required>
</div>
<div class="Row">
<label for="ap_dhcp_end"><?= tr('net.ap_dhcp_end') ?></label>
<input type="text" name="ap_dhcp_end" id="ap_dhcp_end" value="%ap_dhcp_end%" <?=$ipmask?> required>
</div>
<div class="Row">
<label for="ap_addr_ip"><?= tr('net.ap_addr_ip') ?></label>
<input type="text" name="ap_addr_ip" id="ap_addr_ip" value="%ap_addr_ip%" <?=$ipmask?> required>
</div>
<div class="Row">
<label for="ap_addr_mask"><?= tr('net.ap_addr_mask') ?></label>
<input type="text" name="ap_addr_mask" id="ap_addr_mask" value="%ap_addr_mask%" <?=$ipmask?> required>
</div>
</form>
<form class="Box str mobcol" action="<?= e(url('wifi_set')) ?>" method="GET">
<h2><?= tr('net.sta') ?></h2>
<div class="Row buttons">
<input type="submit" value="<?= tr('apply') ?>">
</div>
<div class="Row mq-phone" style="height: 35px"></div>
<div class="Row" style="max-width: 600px; margin-left: 0">
<?= tr('net.explain_sta') ?>
</div>
<div class="Row checkbox">
<label><?= tr('net.sta_dhcp_enable') ?></label><!--
--><span class="box"></span>
<input type="hidden" name="sta_dhcp_enable" value="%sta_dhcp_enable%">
</div>
<div class="Row">
<label for="sta_addr_ip"><?= tr('net.sta_addr_ip') ?></label>
<input type="text" name="sta_addr_ip" id="sta_addr_ip" value="%sta_addr_ip%" <?=$ipmask?> required>
</div>
<div class="Row">
<label for="sta_addr_mask"><?= tr('net.sta_addr_mask') ?></label>
<input type="text" name="sta_addr_mask" id="sta_addr_mask" value="%sta_addr_mask%" <?=$ipmask?> required>
</div>
<div class="Row">
<label for="sta_addr_gw"><?= tr('net.sta_addr_gw') ?></label>
<input type="text" name="sta_addr_gw" id="sta_addr_gw" value="%sta_addr_gw%" <?=$ipmask?> required>
</div>
</form>
+6 -14
View File
@@ -1,12 +1,8 @@
<form class="Box str mobcol" action="<?= e(url('wifi_set')) ?>" method="GET">
<h2><?= tr('box.ap') ?></h2>
<h2><?= tr('wifi.ap') ?></h2>
<div class="Row buttons mq-phone">
<input type="submit" value="<?= tr('wifi.submit') ?>">
</div>
<div class="Row buttons mq-no-phone">
<input type="submit" value="<?= tr('wifi.submit') ?>">
<div class="Row buttons">
<input type="submit" value="<?= tr('apply') ?>">
</div>
<div class="Row checkbox">
@@ -47,14 +43,10 @@
</form>
<form class="Box str mobcol" action="<?= e(url('wifi_set')) ?>" method="GET">
<h2><?= tr('box.sta') ?></h2>
<h2><?= tr('wifi.sta') ?></h2>
<div class="Row buttons mq-phone">
<input type="submit" value="<?= tr('wifi.submit') ?>">
</div>
<div class="Row buttons mq-no-phone">
<input type="submit" value="<?= tr('wifi.submit') ?>">
<div class="Row buttons">
<input type="submit" value="<?= tr('apply') ?>">
</div>
<div class="Row checkbox">
+1 -1
View File
@@ -7,7 +7,7 @@
}, 2000);
</script>
<h1 onclick="location.href='<?= e(url('cfg_wifi_simple')) ?>'">%term_title%</h1>
<h1>%term_title%</h1>
<div id="termwrap">
<div id="screen"></div>