This repository has been archived by the owner on Aug 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathstatus.html
210 lines (204 loc) · 12.2 KB
/
status.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="上海大学开源镜像站,致力于为上大校内提供高质量的开源软件镜像、Linux镜像源服务,帮助校内用户更方便地获取开源软件。本镜像站由上海大学开源社区负责维护">
<meta name="keywords" content="镜像站,镜像源,Linux,开源,软件源">
<meta name="author" content="SHUOSC">
<title>上海大学开源镜像站</title>
<link href="/src/element-ui.css" rel="stylesheet">
<link href="/src/mirrors.css" rel="stylesheet">
<link rel="shortcut icon" href="/src/img/favicon.ico">
</head>
<body>
<div id="menu">
<div class="container">
<el-menu :default-active="activeIndex" mode="horizontal" >
<div class="title">上海大学开源镜像站</div>
<div class="navBar">
<el-menu-item index="7"><a href="https://osc.shu.edu.cn">Home</a></el-menu-item>
<el-menu-item index="2"><a href="/news/">News</a></el-menu-item>
<el-menu-item index="3"><a href="/status.html">Status</a></el-menu-item>
<el-menu-item index="4"><a href="/help/">Help</a></el-menu-item>
<el-menu-item index="5"><a href="/news/atom.xml">RSS</a></el-menu-item>
<el-menu-item index="6"><a href="/">Mirrors</a></el-menu-item>
</div>
<div class="clear"></div>
</el-menu>
</div>
</div>
<div class="container">
<div id="mirrors-list">
<div class="bar">
<div class="title">同步状态</div>
<div class="list">
<div class="content">
<template>
<el-table :data="searchData" stripe style="width: 100%" v-if="isAll">
<el-table-column prop="name" label="镜像名" sortable min-width="20%">
<template scope="scope">
<a v-bind:href="[scope.row.url]">{{scope.row.name}}</a>
</template>
</el-table-column>
<el-table-column prop="sources" label="上游地址" min-width="35%"></el-table-column>
<el-table-column prop="taskStatus" label="同步状态" min-width="10%">
<template scope="scope">
<el-tag v-if="scope.row.taskStatus == '1'" type="warning">正在同步</el-tag>
<el-tag v-else-if="scope.row.taskStatus == '0'" type="primary">尚未同步</el-tag>
<el-tag v-else-if="scope.row.taskStatus == '2'&&scope.row.exitcode == '0'" type="success">同步完成</el-tag>
<el-tag v-else-if="scope.row.taskStatus == '2'&&scope.row.exitcode == '1'" type="success">同步完成</el-tag>
<el-tag v-else-if="scope.row.taskStatus == '2'&&scope.row.exitcode == '4'" type="success">同步完成</el-tag>
<el-tag v-else-if="scope.row.taskStatus == '2'&&scope.row.exitcode == '8'" type="success">同步完成</el-tag>
<el-tag v-else type="danger">同步出错</el-tag>
</template>
</el-table-column>
<el-table-column prop="updateTime" label="最近同步完成时间" sortable min-width="15%">
<template scope="scope">
<div v-if="scope.row.updateTime == ''">Unknow</div>
<div v-else>{{scope.row.updateTime}}</div>
</template>
</el-table-column>
<el-table-column prop="nextTime" label="下次同步时间" sortable min-width="15%">
<template scope="scope">
<div v-if="scope.row.nextTime == ''">Unknow</div>
<div v-else>{{scope.row.nextTime}}</div>
</template>
</el-table-column>
</el-table>
<el-table :data="searchData" stripe style="width: 1024px;" v-else>
<el-table-column prop="name" label="镜像名" sortable min-width="20%">
<template scope="scope">
<a v-bind:href="[scope.row.url]">{{scope.row.name}}</a>
</template>
</el-table-column>
<el-table-column prop="sources" label="上游地址" min-width="35%"></el-table-column>
<el-table-column prop="taskStatus" label="同步状态" min-width="10%">
<template scope="scope">
<el-tag v-if="scope.row.taskStatus == '1'" type="warning">正在同步</el-tag>
<el-tag v-else-if="scope.row.taskStatus == '0'" type="primary">尚未同步</el-tag>
<el-tag v-else-if="scope.row.taskStatus == '2'&&scope.row.exitcode == '0'" type="success">同步完成</el-tag>
<el-tag v-else-if="scope.row.taskStatus == '2'&&scope.row.exitcode == '1'" type="success">同步完成</el-tag>
<el-tag v-else-if="scope.row.taskStatus == '2'&&scope.row.exitcode == '4'" type="success">同步完成</el-tag>
<el-tag v-else-if="scope.row.taskStatus == '2'&&scope.row.exitcode == '8'" type="success">同步完成</el-tag>
<el-tag v-else type="danger">同步出错</el-tag>
</template>
</el-table-column>
<el-table-column prop="updateTime" label="最近同步完成时间" sortable min-width="15%">
<template scope="scope">
<div v-if="scope.row.updateTime == ''">Unknow</div>
<div v-else>{{scope.row.updateTime}}</div>
</template>
</el-table-column>
<el-table-column prop="nextTime" label="下次同步时间" sortable min-width="15%">
<template scope="scope">
<div v-if="scope.row.nextTime == ''">Unknow</div>
<div v-else>{{scope.row.nextTime}}</div>
</template>
</el-table-column>
</el-table>
</template>
</div>
</div>
</div>
</div>
<div id="servers-status">
<div class="bar">
<div class="title">服务器状态</div>
<div class="graphs">
<div class="g-cpu">
<iframe src="https://osc.shu.edu.cn/grafana/d-solo/X5VHs0Nmk/hpc-servers?orgId=1&panelId=2&theme=light" width="100%" height="300" frameborder="0"></iframe>
</div>
<div class="g-net">
<iframe src="https://osc.shu.edu.cn/grafana/d-solo/X5VHs0Nmk/hpc-servers?orgId=1&panelId=4&theme=light" width="100%" height="300" frameborder="0"></iframe>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<div id="copyright">
<div class="container">
<div class="content">
<p>上海大学开源镜像站是由<a href="http://www.its.shu.edu.cn" target="_blank">上海大学信息化办公室</a>和<a href="http://www.hpcc.shu.edu.cn" target="_blank">上海大学高效能计算中心</a>提供基础设施支持,由<a href="https://nita.shu.edu.cn" target="_blank">上海大学NITA实验室</a>提供服务器支持,由<a href="https://osc.shu.edu.cn" target="_blank">上海大学开源社区</a>负责管理维护。本站所有源均可通过HTTP、FTP和RSYNC方式访问,RSYNC的访问模块名为源的HTTP子目录名。</p>
<p>上海大学开源社区(SHU Open Source Community)是由上海大学的开源技术爱好者于 2010 年自主发起成立的非营利性学生组织。上海大学开源社区的宗旨是:面向全校师生传播开源理念、分享技术知识;为上海大学的开源技术爱好者提供公共服务,建立开放友好的技术交流平台;弘扬自由软件精神,培养自由软件社区文化氛围,为开源事业做出贡献。 </p>
</div>
<div class="logo">上海大学开源社区</div>
<div class="clear"></div>
</div>
</div>
<script src="/src/vue.min.js"></script>
<script src="/src/element-ui.js"></script>
<script src="/src/axios.js"></script>
<script src="/src/mirrors.js"></script>
<script>
var menu = new Vue({
el: '#menu',
data: {
activeIndex: '1'
}
})
var mirrors = new Vue({
el: '#mirrors-list',
data: {
search: '',
items: [],
isAll: 'true'
},
created: function() {
this.loadMirrors();
},
methods: {
loadMirrors: function () {
axios.get('/data/mirrors.json')
.then(function (response) {
mirrors.items = response.data.mirrors;
});
axios.get('/data/task_status.json')
.then(function (response) {
for(item of mirrors.items){
var name = item.name;
var data = response.data[name];
var date = new Date();
if(date.getHours()>=2){
item.updateTime = showTime(0)+" 02:00:00";
item.nextTime = showTime(+1)+" 02:00:00";
}else{
item.updateTime = showTime(-1)+" 02:00:00";
item.nextTime = showTime(0)+" 02:00:00";
}
item.taskStatus = "2";
item.exitcode = "0";
if(typeof(data['upstream']) != "undefined"){
item.sources = data['upstream'];
}
}
});
var clientWidth = document.documentElement.clientWidth;
if(clientWidth<=768){
this.isAll = false;
}
}
},
computed: {
searchData: function() {
var search = this.search;
var vm = this;
if (search) {
return this.items.filter(function(item) {
return Object.keys(item).some(function(key) {
return String(item[key]).toLowerCase().indexOf(search) > -1
})
})
}
vm.items = vm.items.sort(function(x, y) {
return x.name.localeCompare(y.name);
});
return vm.items;
}
}
})
</script>
</body>
</html>