-
Notifications
You must be signed in to change notification settings - Fork 1
/
plugin.html
445 lines (420 loc) · 19.2 KB
/
plugin.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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
<!DOCTYPE html>
<html lang="zxx">
<head>
<!--====== Required meta tags ======-->
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!--====== Title ======-->
<title> 插件 - Serverless Registry - Serverless package management platform </title>
<!--====== Bootstrap css ======-->
<link rel="stylesheet" href="static/css/bootstrap.min.css">
<!--=== Owl-Carousel ===-->
<link rel="stylesheet" href="static/css/owl.carousel.min.css">
<!--====== Magnific ======-->
<link rel="stylesheet" href="static/css/magnific-popup.css">
<!--===nice-select===-->
<link rel="stylesheet" href="static/css/nice-select.css">
<!--====== Animate CSS ======-->
<link rel="stylesheet" href="static/css/animate.min.css">
<!--====== Font Awesome ======-->
<link rel="stylesheet" href="static/css/font-awesome.min.css">
<!--====== Main Css ======-->
<link rel="stylesheet" href="static/css/style.css">
<!--====== Responsive Css ======-->
<link rel="stylesheet" href="static/css/responsive.css">
<style>
.text-flow-ellipsis-multiple {
/* 多余内容省略号处理-多行 */
word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
}
.text-flow-ellipsis-single {
/* 多余内容省略号处理-单行 */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.preButton {
width: 120px;
height: 34px;
border: 1px solid rgba(4, 10, 41, 0.12);
border-radius: 3px;
color: #fff;
line-height: 2.53;
text-align: center;
font-weight: 500;
background: #547af8;
}
.download {
margin-left: 20px;
width: 120px;
height: 34px;
border: 1px solid rgba(4, 10, 41, 0.12);
border-radius: 3px;
color: #051c35;
line-height: 2.53;
text-align: center;
font-weight: 500;
background: #fff;
}
</style>
</head>
<body>
<!--====== Header Part Start ======-->
<header class="header-one sticky-header">
<div class="header-navigation" style="padding-top: 10px;padding-bottom: 7px">
<div class="container-fluid d-flex align-items-center justify-content-between container-1470">
<div class="header-left">
<h1 href="index.html" style="color: black">Serverless Registry</h1>
</div>
<div class="header-right d-flex align-items-center justify-content-end">
<div class="site-nav-menu">
<ul class="primary-menu">
<li>
<a class="nav-link" href="index.html">首页</a>
</li>
<li>
<a class="nav-link" href="application.html">应用</a>
</li>
<li>
<a class="nav-link" href="component.html">组件</a>
</li>
<li class="current">
<a class="nav-link" href="plugin.html">插件</a>
</li>
<li>
<a class="nav-link" href="https://github.com/Serverless-Devs/Serverless-Devs/blob/master/spec/zh/0.0.2/serverless_registry_model/readme.md" target="_blank">规范</a>
</li>
<li>
<a class="nav-link" href="faq.html">常见问题</a>
</li>
</ul>
<a href="#0" class="nav-close"><i class="fal fa-times"></i></a>
</div>
<div class="header-extra d-flex align-items-center">
<div class="search-widget">
<a href="#0" class="search-icon"><i class="fal fa-search"></i></a>
<div class="search-form">
<form action="search.html" method="GET">
<input type="search" placeholder="请输入要搜索的 Serverless Package 关键词" name="keyword">
</form>
<a href="#0" class="search-close"><i class="fal fa-times"></i></a>
</div>
</div>
<div class="offcanvas-widget d-none">
<div class="offcanvas-icon">
<span></span><span></span><span></span>
</div>
</div>
<div class="nav-toggler">
<span></span><span></span><span></span>
</div>
</div>
</div>
</div>
</div>
</header>
<!--====== Header Part End ======-->
<!--====== Banner Start ======-->
<section class="breadcrumb-area">
<div class="container">
<div class="content">
<h2 class="breadd wow fadeInUp">
插件
</h2>
<ul class="breadcrumb-list wow fadeInUp">
<li><a href="index.html">首页 /</a></li>
<li>插件</li>
</ul>
</div>
</div>
</section>
<!--====== Banner End ======-->
<!--====== Unique Themes Start ======-->
<section class="unique themes producttwo">
<div class="container">
<div class="row">
<div class="col-lg-12 wow fadeInUp">
<div class="product-show">
<div class="left-box">
<p class="text" id="showinfo"></p>
</div>
<div class="right-box">
<div class="language-select">
<select class="select-bar" onchange="getPackages()" id="sortselect">
<option value="download">按下载排序</option>
<option value="time">按时间排序</option>
</select>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xl-8 col-lg-7">
<div class="row" id="itemlist"></div>
</div>
<div class="col-xl-4 col-lg-5">
<div class="widget widget-search wow fadeInUp">
<h5 class="widtitle">插件搜索</h5>
<div class="search-form">
<div class="form-group">
<input type="text" placeholder="Search" required="" id="searchdata">
<button onclick="getPackages()"><i class="fas fa-search"></i></button>
</div>
</div>
</div>
<div class="widget m-0 widget-categories wow fadeInUp">
<h5 class="widtitle">分类</h5>
<ul id="categorylist">
</ul>
</div>
<div class="widget m-0 widget-categories wow fadeInUp">
<h5 class="widtitle">云厂商</h5>
<ul id="providerlist">
</ul>
</div>
</div>
</div>
</div>
</section>
<!--====== Unique Themes End ======-->
<!--====== Footer Area START ======-->
<footer class="footer-area two">
<div class="container">
<div class="row justify-content-between">
<div class="col-lg-4 col-md-6 wow fadeInUp" data-wow-delay="0.2s">
<div class="footer-box one">
<div class="logo">
<h1 style="color: white">Serverless Registry</h1>
</div>
<p class="text">Serverless Registry 是 Serverless Devs 社区的衍生品,遵循 Serverless Devs Model 规范,为打造
Serverless 生态基础,繁荣 Serverless 开源生态而努力。正在为成为好用的 Serverless 领域的 NPM,Pypi ... 而努力。 </p>
<div class="social">
<a href="https://github.com/serverless-devs/serverless-devs"><i class="fab fa-github"></i></a>
<a href="https://gitee.com/serverless-devs/Serverless-Devs"><i class="fab fa-git"></i></a>
<a href="https://www.serverless-devs.com"><i class="fab fa-page4"></i></a>
</div>
</div>
</div>
<div class="col-lg-2 col-md-6 wow fadeInUp" data-wow-delay="0.3s">
<div class="footer-box two">
<h4 class="lasthead">相关资源</h4>
<div class="footer-list">
<ul>
<li><a href="about.html"> 关于我们 </a></li>
<li><a href="https://github.com/serverless-devs/serverless-devs"> Serverless Devs 仓库 </a>
</li>
<li><a href="https://github.com/Serverless-Devs/Serverless-Devs/blob/master/spec/readme.md">
SDM 规范文档 </a></li>
<li><a href="https://github.com/Serverless-Devs/Serverless-Devs/discussions"> Serverless
Devs 社区 </a></li>
<li>
<a href="https://github.com/Serverless-Devs/Serverless-Devs/blob/master/CONTRIBUTORS.md">
贡献者列表 </a></li>
</ul>
</div>
</div>
</div>
<div class="col-lg-2 col-md-6 wow fadeInUp" data-wow-delay="0.4s">
<div class="footer-box three">
<h4 class="lasthead">钉钉交流群</h4>
<div class="footer-list">
<img src="https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1648814797378_20220401120637498673.png">
</div>
</div>
</div>
<div class="col-lg-2 col-md-6 wow fadeInUp" data-wow-delay="0.5s">
<div class="footer-box none">
<h4 class="lasthead">微信公众号</h4>
<div class="footer-list">
<img src="https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1648814758343_20220401120558862369.png">
</div>
</div>
</div>
</div>
</div>
</footer>
<div class="copyright two">
<div class="container">
<div class="row">
<div class="col-12 wow fadeInUp text-center">
<p class="text">Copyright © 2022. Serverless Devs; By <a href="http://www.bluo.cn" target="_blank">Anycodes</a>; <a href="https://beian.miit.gov.cn/" target="_blank">浙ICP备19029259号</a>
</p>
</div>
</div>
</div>
</div>
<!--====== Footer Area END ======-->
<!--====== Back to top start ======-->
<div class="back-to-top">
<a href="#0"> <i class="fas fa-arrow-up"></i> </a>
</div>
<!--====== Back to top start ======-->
<!--====== Jquery ======-->
<script src="static/js/jquery-3.6.0.min.js"></script>
<!--====== Bootstrap ======-->
<script src="static/js/bootstrap.bundle.min.js"></script>
<!--=== Owl-Carousel ===-->
<script src="static/js/owl.carousel.min.js"></script>
<!--====== Nice Select ======-->
<script src="static/js/jquery.nice-select.min.js"></script>
<!--====== Magnific ======-->
<script src="static/js/jquery.magnific-popup.min.js"></script>
<!--====== Nice Select ======-->
<script src="static/js/jquery.nice-select.min.js"></script>
<!--====== Wow ======-->
<script src="static/js/wow.min.js"></script>
<!--====== Main JS ======-->
<script src="static/js/main.js"></script>
<script>
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
return (false);
}
function insertParam(key, value, sourceData = document.location.search.substr(1)) {
key = escape(key);
// value = escape(value);
var kvp = sourceData.split('&');
if (kvp == '') {
return '?' + key + '=' + value;
} else {
var i = kvp.length;
var x;
while (i--) {
x = kvp[i].split('=');
if (x[0] == key) {
x[1] = value;
kvp[i] = x.join('=');
break;
}
}
if (i < 0) {
kvp[kvp.length] = [key, value].join('=');
}
return kvp.join('&')
}
}
function getBaseList(name, detail) {
const xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("GET", detail['url'], false);
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
let tempData = JSON.parse(xmlhttp.responseText)
const newData = {}
if (name == "provider") {
const tempKeys = Object.keys(tempData)
for (let i = 0; i < tempKeys.length; i++) {
newData[tempData[tempKeys[i]]] = tempData[tempKeys[i]]
}
tempData = newData
}
setBaseList(tempData, detail['id'], name)
}
}
xmlhttp.setRequestHeader("Content-type", "application/json");
xmlhttp.send();
}
function setBaseList(listData, idName, name) {
var attrString = ''
const keys = ["-1"].concat(Object.keys(listData))
for (let i = 0; i < keys.length; i++) {
attrString = attrString + `<li>
<a href="${insertParam(name, keys[i]).startsWith('?') ? insertParam(name, keys[i]) : '?' + insertParam(name, keys[i])}" class="link ${keys[i] == decodeURI(getQueryVariable(name) || '-1') ? 'active' : ''}">
<span>${listData[keys[i]] || "全部"}</span>
</a>
</li>`
}
document.getElementById(idName).innerHTML = attrString
}
function getBaseInfor() {
const attrList = {
"category": {
"url": "https://registry.devsapp.cn/common/category",
"id": 'categorylist'
},
"provider": {
"url": "https://registry.devsapp.cn/common/provider",
"id": 'providerlist'
}
}
for (let i = 0; i < Object.keys(attrList).length; i++) {
getBaseList(Object.keys(attrList)[i], attrList[Object.keys(attrList)[i]])
}
}
function getPackages() {
const selectData = document.getElementById("sortselect");
const index = selectData.selectedIndex
console.log(document.getElementById('sortselect').selectedIndex)
const xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("POST", 'https://registry.devsapp.cn/package/search', false);
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {
let itemString = ''
const result = JSON.parse(xmlhttp.responseText).Response
const keys = Object.keys(result)
const times = [0.3, 0.2, 0.1]
for (let i = 0; i < keys.length; i++) {
itemString = itemString + `<div class="col-xl-6 wow fadeInUp" data-wow-delay="${times[Math.floor((Math.random() * times.length))]}s">
<div class="themes-box">
<div class="main-content">
<h5><a href="details.html?name=${result[keys[i]].package}" class="text-flow-ellipsis-single">${result[keys[i]].package.length > 27 ? result[keys[i]].package.slice(0, 27) + '...' : result[keys[i]].package}</a> <i class="fas fa-fire" style="float: right; color: orange;"> ${result[keys[i]].download} </i></h5>
<div class="last-part">
<div class="right" style="width: 100%">
<p class="text" style="margin-bottom: 10px; width: 100%">
<i class="fas fa-calendar"></i> ${result[keys[i]].version.published_at.split('T')[0]} |
<i class="fas fa-desktop"></i> V${result[keys[i]].version.tag_name}
</p>
<p class="text-flow-ellipsis-multiple" style="height: 70px">
${result[keys[i]].description}
</p>
</div>
</div>
<div class="past-part" style="margin-top: 10px">
<center>
<div class="buton">
<a href="details.html?name=${result[keys[i]].package}" class="preButton"> <i class="fas fa-book"></i> 查看详情 </a>
<a href="${result[keys[i]].version.zipball_url}" target="_blank" class="download"> <i class="fas fa-download"></i> 下载插件 </a>
</div>
</center>
</div>
</div>
</div>
</div>
</div>`
}
document.getElementById('itemlist').innerHTML = itemString
document.getElementById('showinfo').innerHTML = `<i class="fas fa-list"></i> 找到 ${Object.keys(result).length} 条结果`
}
}
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
let data = `type=Plugin&sort=${selectData.options[index].value}`
if ((getQueryVariable('category') || '-1') !== "-1") {
data = insertParam('category', getQueryVariable('category'), data)
}
if (document.getElementById('searchdata').value) {
data = insertParam('keyword', document.getElementById('searchdata').value, data)
}
if ((getQueryVariable('provider') || '-1') !== "-1") {
data = insertParam('provider', getQueryVariable('provider'), data)
}
xmlhttp.send(data);
}
getPackages()
getBaseInfor()
</script>
</body>
</html>