-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
127 lines (110 loc) · 6.34 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="web/css/mdui.css" type="text/css" />
<script src="web/js/mdui.js"></script>
</head>
<body class="mdui-theme-primary-light-blue">
<script type="text/javascript">
function login(){
var username = document.getElementById('UserName').value;
var pas = document.getElementById('password').value;
window.pywebview.api.login(username+"\n"+pas);
}
function Status(content){
document.getElementById("status").innerHTML = content;
if(content.indexOf("not")==0){
//退出/掉线
document.getElementById('names').innerHTML = "";
}
useageCount(content)
}
function dialog(content){
document.getElementById('noticeContent').innerHTML = content;
var inst = new mdui.Dialog('#notice').open();
}
function useageCount(content){
var useage = content.split(',')[6];
useage = parseInt(useage)/1073741824;
useage.toFixed(3);
percentage = useage+ "%" ;
document.getElementById('useagebar').style.width = percentage;
document.getElementById('useage').innerHTML = "已用 "+useage+" G";
}
function getName(names){
document.getElementById('names').innerHTML = "你好, " + names;
}
</script>
<div class="mdui-toolbar mdui-color-theme">
<span class="mdui-typo-title">Srun3K Boxies</span>
<div class="mdui-toolbar-spacer"></div>
<a href="javascript:;" class="mdui-btn mdui-btn-icon mdui-ripple" onclick="window.pywebview.api.logout();"><i class="mdui-icon material-icons" mdui-tooltip="{content: '注销'}">account_circle</i></a>
<a href="javascript:;" class="mdui-btn mdui-btn-icon mdui-ripple" onclick="window.pywebview.api.minimized();"><i class="mdui-icon material-icons" mdui-tooltip="{content: '最小化'}">indeterminate_check_box</i></a>
<a href="javascript:;" class="mdui-btn mdui-btn-icon mdui-ripple" onclick="window.pywebview.api.destory();"><i class="mdui-icon material-icons" mdui-tooltip="{content: '退出'}">close</i></a>
</div>
<div class="mdui-tab" mdui-tab>
<a href="#main" class="mdui-ripple"><i class="mdui-icon material-icons">home</i><label>主页</label></a>
<a href="#tools" class="mdui-ripple"><i class="mdui-icon material-icons">build</i><label>工具</label></a>
</div>
<!---第一个tab 主页-->
<div id="main" class="mdui-p-a-2">
<div style="height:20px;"></div>
<div style="width: 10%;float: left;min-height: 1px;"></div>
<div class="mdui-card mdui-shadow-10" style="width:39%;float: left;">
<div class="mdui-textfield" style="width:80%;margin:auto">
<h3>用户名</h3>
<input class="mdui-textfield-input" type="text" placeholder="UserName" id="UserName"/>
</div>
<div class="mdui-textfield" style="width:80%;margin:auto">
<h3>密码</h3>
<input class="mdui-textfield-input" type="password" placeholder="Password" id='password'/>
</div>
<div style="height: 10px;"></div>
</div>
<!-----公告栏&状态信息-->
<div style="width: 2%;float: left;min-height: 1px;"></div>
<div class="mdui-card mdui-shadow-10 mdui-ripple" style="margin: auto;width: 39%;float: left;">
<div style="margin: auto;width: 80%;">
<h4 style="width:80%;margin:auto;font-weight: 300;" id="names"></h4>
<p style="font-weight: 400;">登陆状态</p>
<button class="mdui-btn mdui-ripple mdui-color-theme" onclick="window.pywebview.api.status();">刷新状态</button>
<p id="status" style="font-weight: 400;" class="mdui-text-truncate"></p>
<p style="font-weight: 400;">流量使用统计</p>
<div class="mdui-progress">
<div class="mdui-progress-determinate" style="width: 80%;" id="useagebar"></div>
</div>
<p style="font-weight: 400;" id="useage">已用 Null G</p>
</div>
</div>
<div class="mdui-fab-wrapper" mdui-fab="">
<button class="mdui-fab mdui-ripple mdui-color-theme-accent" mdui-tooltip="{content: '登陆', position: 'top'}" onclick="login()">
<i class="mdui-icon material-icons">play_arrow</i>
<i class="mdui-icon mdui-fab-opened material-icons">play_arrow</i>
</button>
</div>
</div>
<!----主页tab结束------>
<div id="tools">
<div style="height:20px;"></div>
<div class="mdui-card mdui-shadow-10" style="margin: auto;width: 80%;">
<code><p style="font-weight: 400;" id="curlResult" class="mdui-typo"></p></code>
<div class="mdui-textfield" style="width:80%;margin:auto">
<h3> 热点</h3>
<p><a href="ms-settings:network-mobilehotspot"><button class="mdui-btn mdui-ripple mdui-color-theme" onclick="window.pywebview.api.hotspot()">启用/关闭热点</button></a></p>
</div>
<div class="mdui-divider"></div>
<div class="mdui-textfield" style="width:80%;margin:auto">
<h3>关于</h3>
<p>作者@pete 请合理使用本应用 开源在 https://github.com/peterpei1186861238/Srun3k-Boxies 下</p>
<p>build : 2.0</p>
</div>
</div>
</div>
<!-----对话框-->
<div class="mdui-dialog" id="notice">
<div class="mdui-dialog-title">Notice</div>
<div class="mdui-dialog-content" id="noticeContent">被你发现了!!!</div>
</div>
</body>
</html>