首页更新

master
yutent 2023-02-10 18:26:10 +08:00
parent 1183064004
commit 1f819bc83b
4 changed files with 89 additions and 12 deletions

View File

@ -12,7 +12,7 @@
<script type="importmap">{{importmap}}</script> <script type="importmap">{{importmap}}</script>
</head> </head>
<body> <body>
<div class="app noselect"></div> <div class="app"></div>
<script src="main.js"></script> <script src="main.js"></script>
</body> </body>
</html> </html>

View File

@ -1,5 +1,8 @@
<template> <template>
<div class="common-header" :class="{ 'search-show': $store.searchShow }"> <div
class="common-header noselect"
:class="{ 'search-show': $store.searchShow }"
>
<header class="navibar"> <header class="navibar">
<div class="wrapper"> <div class="wrapper">
<a class="logo"><img src="/assets/logo.svg" /></a> <a class="logo"><img src="/assets/logo.svg" /></a>

View File

@ -1,8 +1,29 @@
<template>
<main class="home">
<dl class="card" v-for="it in libs">
<dt class="title">{{ it.name }} - v{{ it.version }}</dt>
<dd class="list">
<section class="link">
//jscdn.ink/{{ it.name }}/{{ it.version }}/{{ it.file }}
</section>
</dd>
</dl>
</main>
</template>
<script> <script>
export default { export default {
data() { data() {
return { return {
content: '欢迎访问~~ 这是首页' libs: [
{ name: 'vue', version: '2.3.2', file: 'vue.esm-browser.js' },
{
name: 'vue-router',
version: '4.1.2',
file: 'vue-router.esm-browser.js'
},
{ name: '@bytedo/fetch', version: '2.1.2', file: 'index.js' }
]
} }
}, },
@ -12,8 +33,38 @@ export default {
} }
</script> </script>
<template> <style lang="scss" scoped>
<main> .home {
<h1>{{ content }}</h1> display: flex;
</main> flex-direction: column;
</template> align-items: center;
padding-top: 16px;
.card {
width: 1024px;
margin-top: 24px;
box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
.title {
padding: 16px;
font-size: 26px;
background: var(--color-plain-1);
}
.list {
padding: 16px;
font-size: 16px;
}
.link {
transition: background 0.1s ease;
&:hover {
text-decoration: underline;
}
&:active {
background: var(--color-plain-a);
}
}
}
}
</style>

View File

@ -22,7 +22,10 @@
<wc-td align="center">{{ $store.stats[it.stat] }}</wc-td> <wc-td align="center">{{ $store.stats[it.stat] }}</wc-td>
<wc-td>{{ it.remark }}</wc-td> <wc-td>{{ it.remark }}</wc-td>
<wc-td align="center"> <wc-td align="center">
<wc-link @click="handlePackgae('sync', it.id)" type="info" <wc-link
:disabled="it.stat !== 2"
@click="handlePackgae('sync', it)"
type="info"
>更新</wc-link >更新</wc-link
> >
<wc-link <wc-link
@ -258,14 +261,34 @@ export default {
if (act !== 'sync' && !this.$store.user.admin) { if (act !== 'sync' && !this.$store.user.admin) {
return layer.alert('别闹, 老实等管理员通过~~') return layer.alert('别闹, 老实等管理员通过~~')
} }
fetch(`/package/${act}/${encodeURIComponent(id)}`) let req
if (act === 'reject' || act === 'delete') {
req = layer.prompt('请输入理由').then(remark => {
return fetch(`/package/${act}/${encodeURIComponent(id)}`, {
method: 'PUT',
body: { remark }
})
})
} else if (act === 'accept') {
req = layer.prompt('请输入文件目录').then(dist => {
return fetch(`/package/${act}/${encodeURIComponent(id)}`, {
method: 'PUT',
body: { dist }
})
})
} else {
req = fetch(`/package/${act}/${encodeURIComponent(id)}`, {
method: 'PUT'
})
}
req
.then(r => { .then(r => {
layer.toast('操作成功', 'success') layer.toast('操作成功', 'success')
this.fetchList() this.fetchList()
}) })
.catch(r => { .catch(r => {
console.log(r) r && layer.toast(r.msg, 'error')
layer.toast(r.msg, 'error')
}) })
} }
} }