235 lines
7.5 KiB
HTML
235 lines
7.5 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="keywords" content=""/>
|
|
<meta name="description" content=""/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
|
|
<meta name="format-detection" content="telephone=no"/>
|
|
<meta name="apple-mobile-web-app-capable" content="yes"/>
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
<meta name="author" content="CSS5, css5.com.cn"/>
|
|
<style>
|
|
html, body {
|
|
font-family: "Microsoft YaHei", Arial;
|
|
overflow-x: hidden;
|
|
overflow-y: auto;
|
|
height: 100%;
|
|
width: 100%;
|
|
padding: 0px;
|
|
margin: 0px;
|
|
background: #f7f8fa;
|
|
color: #555;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.context {
|
|
display: flex;
|
|
height: 100%;
|
|
width: 100%;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.main {
|
|
flex: 1;
|
|
overflow: auto;
|
|
flex-direction: column;
|
|
display: flex;
|
|
width: 100%;
|
|
}
|
|
|
|
.net {
|
|
margin: 10px;
|
|
background: #fff;
|
|
border-radius: 4px;
|
|
padding: 10px;
|
|
}
|
|
|
|
.net-list {
|
|
padding: 10px;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.net-list label {
|
|
width: 110px;
|
|
text-align: left;
|
|
}
|
|
|
|
.net-list input {
|
|
border: 0;
|
|
flex: 1;
|
|
display: block;
|
|
box-sizing: border-box;
|
|
width: 100%;
|
|
min-width: 0;
|
|
margin: 0;
|
|
padding: 0;
|
|
color: #323233;
|
|
line-height: inherit;
|
|
text-align: left;
|
|
background-color: transparent;
|
|
resize: none;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.net-list input:focus {
|
|
outline: -webkit-focus-ring-color auto 0px;
|
|
}
|
|
|
|
.operation {
|
|
display: flex;
|
|
flex-direction: column;
|
|
margin: 10px;
|
|
padding: 10px;
|
|
}
|
|
|
|
.operation button {
|
|
margin: 10px;
|
|
border-radius: 5000px;
|
|
height: 40px;
|
|
border: 0;
|
|
color: #fff;
|
|
}
|
|
|
|
.operation button:focus {
|
|
outline: -webkit-focus-ring-color auto 0px;
|
|
}
|
|
|
|
.radio-group {
|
|
display: flex;
|
|
padding: 10px;
|
|
}
|
|
.radio-group>span {
|
|
display: inline-block;
|
|
width: 110px;
|
|
min-width: 110px;
|
|
}
|
|
.radio-group .radio-group-box {
|
|
display: flex;
|
|
flex-wrap: wrap; /* 允许换行 */
|
|
gap: 10px 20px; /* 垂直和水平间距 */
|
|
width: 100%;
|
|
}
|
|
.radio-group .radio-group-box .radio-item {
|
|
width: calc(50% - 10px);
|
|
}
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
<div class="context">
|
|
<div class="main">
|
|
<div class="net">
|
|
<div class="net-list">
|
|
<label>服务器地址</label>
|
|
<input id="address" name="address" placeholder="ip地址或者域名地址">
|
|
</div>
|
|
<div class="net-list">
|
|
<label>服务器端口号</label>
|
|
<input value="-1" id="port" name="port" placeholder="服务器端口号">
|
|
</div>
|
|
<div class="net-list">
|
|
<label>访问子路径</label>
|
|
<input id="path" name="path" placeholder="访问子路径">
|
|
</div>
|
|
<div class="radio-group">
|
|
<span>屏幕旋转</span>
|
|
<div class="radio-group-box">
|
|
<label class="radio-item">
|
|
<input type="radio" name="screen_rotation" value="1" checked>
|
|
竖屏
|
|
</label>
|
|
<label class="radio-item">
|
|
<input type="radio" name="screen_rotation" value="2">
|
|
横屏
|
|
</label>
|
|
<label class="radio-item">
|
|
<input type="radio" name="screen_rotation" value="3">
|
|
横竖
|
|
</label>
|
|
<label class="radio-item">
|
|
<input type="radio" name="screen_rotation" value="4">
|
|
禁止
|
|
</label>
|
|
</div>
|
|
</div>
|
|
<div class="radio-group">
|
|
<span>隐藏状态栏</span>
|
|
<div class="radio-group-box">
|
|
<label class="radio-item">
|
|
<input type="radio" name="hide_bar" value="1" checked>
|
|
隐藏
|
|
</label>
|
|
<label class="radio-item">
|
|
<input type="radio" name="hide_bar" value="2">
|
|
显示
|
|
</label>
|
|
</div>
|
|
</div>
|
|
<div class="radio-group">
|
|
<span>默认屏幕方向</span>
|
|
<div class="radio-group-box">
|
|
<label class="radio-item">
|
|
<input type="radio" name="start_direction" value="1" checked>
|
|
正竖屏
|
|
</label>
|
|
<label class="radio-item">
|
|
<input type="radio" name="start_direction" value="2">
|
|
倒竖屏
|
|
</label>
|
|
<label class="radio-item">
|
|
<input type="radio" name="start_direction" value="3">
|
|
正横屏
|
|
</label>
|
|
<label class="radio-item">
|
|
<input type="radio" name="start_direction" value="4">
|
|
倒横屏
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="operation">
|
|
<button style="background: #1989fa;" onclick="saveSetting()">保存</button>
|
|
<button style="background: #fff; color: #333">取消</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
<script>
|
|
|
|
function init() {
|
|
var dstr = window.NetworkSettingEngine.getStringSetting();
|
|
if (dstr.length > 0) {
|
|
var d = JSON.parse(dstr);
|
|
document.getElementById('address').value = d.address;
|
|
document.getElementById('port').value = d.port;
|
|
document.getElementById('path').value = d.path;
|
|
document.querySelector('input[name="screen_rotation"][value="'+d.screen_rotation+'"]').checked = true;
|
|
document.querySelector('input[name="hide_bar"][value="'+d.hide_bar+'"]').checked = true;
|
|
document.querySelector('input[name="start_direction"][value="'+d.start_direction+'"]').checked = true;
|
|
console.log("d_data_end_=========================");
|
|
}
|
|
}
|
|
|
|
init();
|
|
|
|
function saveSetting(){
|
|
var data=JSON.stringify({
|
|
"address":document.getElementById('address').value,
|
|
"port":document.getElementById('port').value,
|
|
"path":document.getElementById('path').value,
|
|
"screen_rotation":document.querySelector('input[name="screen_rotation"]:checked').value,
|
|
"hide_bar":document.querySelector('input[name="hide_bar"]:checked').value,
|
|
"start_direction":document.querySelector('input[name="start_direction"]:checked').value,
|
|
});
|
|
window.NetworkSettingEngine.saveSetting(data);
|
|
window.View.reload();
|
|
}
|
|
|
|
</script>
|
|
|
|
</html>
|