-
Notifications
You must be signed in to change notification settings - Fork 0
/
setting.html
70 lines (64 loc) · 2.46 KB
/
setting.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>GIH - Setting</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/sweet-alert.min.css">
<link rel="stylesheet" href="css/loaders.min.css">
<link rel="stylesheet" href="css/popup.css">
<style>
.link-item {
margin-bottom: 0px;
}
</style>
</head>
<body>
<button onclick="location.href='index.html'">返回</button>
<div class="col-xs-8 single-model">
<div class="link-item">
<strong>仓库URL</small></strong>
<div class="input-append">
<input class="res col-xs-10" id="rep_uri" value="" spelcheck="false" />
</div>
</div>
<div class="link-item" style="float: left;width: 100%;">
<strong>本地仓库位置</strong>
<div class="input-append">
<input class="res col-xs-10" id="local_folder" value="" spellcheck="false"/>
</div>
</div>
<div class="link-item" style="float: left;width: 100%;">
<strong>上传目录</strong>
<div class="input-append">
<input class="res col-xs-10" id="path" value="" spellcheck="false"/>
</div>
</div>
<div class="link-item" style="float: left;width: 100%;">
<button id="submitB" type="button" class="btn btn-default btn-copy">保存</button>
</div>
</div>
<script src="./js/utils.js"></script>
<script src="./js/command.js"></script>
<script>
// 页面渲染 TODO
var settings = JSON.parse(localStorage.getItem("setting"))
if (settings != null) {
document.querySelector("#rep_uri").value = settings.rep_uri
document.querySelector("#local_folder").value = settings.local_folder
document.querySelector("#path").value = settings.path
}
document.querySelector("#submitB").onclick = function () {
var config = {}
config.rep_uri = document.querySelector("#rep_uri").value
config.local_folder = document.querySelector("#local_folder").value
config.path = document.querySelector("#path").value
config.origin_name = 'origin'
config.label = 'master'
localStorage.setItem("setting", JSON.stringify(config));
alert('设置成功')
location.href = './index.html'
}
</script>
</body>
</html>