完成第一版
parent
62e53063b9
commit
24bb7e3aae
|
@ -7,8 +7,8 @@
|
|||
<title>{{title}}</title>
|
||||
<meta name="keywords" content="{{keywords}}">
|
||||
<meta name="description" content="{{description}}">
|
||||
<link rel="stylesheet" href="//a.jscdn.ink/@bytedo/wcui/dist/css/reset-basic.css">
|
||||
<script async src="//esm.tool/es-module-shims.wasm.js"></script>
|
||||
<link rel="stylesheet" href="//jscdn.ink/@bytedo/wcui/1.0.12/css/reset-basic.css">
|
||||
<script async src="//jscdn.ink/es-module-shims/1.6.3/es-module-shims.wasm.js"></script>
|
||||
<script type="importmap">{{importmap}}</script>
|
||||
</head>
|
||||
<body>
|
||||
|
|
10
src/main.js
10
src/main.js
|
@ -1,10 +1,10 @@
|
|||
import { createApp } from 'vue'
|
||||
|
||||
import '//a.jscdn.ink/es.shim/dist/index.js'
|
||||
import '//a.jscdn.ink/@bytedo/wcui/dist/form/input.js'
|
||||
import '//a.jscdn.ink/@bytedo/wcui/dist/form/button.js'
|
||||
import '//a.jscdn.ink/@bytedo/wcui/dist/form/link.js'
|
||||
import '//a.jscdn.ink/@bytedo/wcui/dist/layer/index.js'
|
||||
import '//jscdn.ink/es.shim/2.1.0/index.js'
|
||||
import '//jscdn.ink/@bytedo/wcui/1.0.12/form/input.js'
|
||||
import '//jscdn.ink/@bytedo/wcui/1.0.12/form/button.js'
|
||||
import '//jscdn.ink/@bytedo/wcui/1.0.12/form/link.js'
|
||||
import '//jscdn.ink/@bytedo/wcui/1.0.12/layer/index.js'
|
||||
|
||||
import App from './app.vue'
|
||||
|
||||
|
|
|
@ -17,19 +17,19 @@
|
|||
<wc-tr v-for="it of list" :key="it.id">
|
||||
<wc-td align="center">{{ it.id }}</wc-td>
|
||||
<wc-td align="center">{{ it.author }}</wc-td>
|
||||
<wc-td>{{ it.description }}</wc-td>
|
||||
<wc-td align="center">{{ it.sync_date }}</wc-td>
|
||||
<wc-td align="center">{{ it.latest || '-' }}</wc-td>
|
||||
<wc-td align="center">{{ it.latest ? it.sync_date : '-' }}</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-link
|
||||
:disabled="it.stat !== 2"
|
||||
:disabled="loading || it.stat !== 2"
|
||||
@click="handlePackgae('sync', it.id)"
|
||||
type="info"
|
||||
>更新</wc-link
|
||||
>
|
||||
<wc-link
|
||||
v-if="$store.user.admin"
|
||||
v-if="$store.user.admin && it.stat !== 2"
|
||||
@click="handlePackgae('accept', it.id)"
|
||||
type="info"
|
||||
>通过</wc-link
|
||||
|
@ -94,9 +94,9 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import '//a.jscdn.ink/@bytedo/wcui/dist/table/index.js'
|
||||
import '//a.jscdn.ink/@bytedo/wcui/dist/form/switch.js'
|
||||
import '//a.jscdn.ink/@bytedo/wcui/dist/pager/index.js'
|
||||
import '//jscdn.ink/@bytedo/wcui/1.0.12/table/index.js'
|
||||
import '//jscdn.ink/@bytedo/wcui/1.0.12/form/switch.js'
|
||||
import '//jscdn.ink/@bytedo/wcui/1.0.12/pager/index.js'
|
||||
import fetch from '@/lib/fetch.js'
|
||||
|
||||
export default {
|
||||
|
@ -107,7 +107,7 @@ export default {
|
|||
thead: JSON.stringify([
|
||||
'开源库',
|
||||
'作者',
|
||||
'介绍',
|
||||
'最后同步版本',
|
||||
'最后同步日期',
|
||||
'收录状态',
|
||||
'备注',
|
||||
|
@ -206,13 +206,13 @@ export default {
|
|||
: 'unknow'
|
||||
|
||||
this.lib.author = author
|
||||
this.lib.description = r.description
|
||||
this.lib.description = r.description || r.homepage
|
||||
this.lib.latest = r['dist-tags'].latest
|
||||
|
||||
this.disabled = false
|
||||
return {
|
||||
author,
|
||||
description: r.description,
|
||||
description: this.lib.description,
|
||||
latest: r['dist-tags'].latest
|
||||
}
|
||||
})
|
||||
|
@ -270,7 +270,7 @@ export default {
|
|||
})
|
||||
})
|
||||
} else if (act === 'accept') {
|
||||
req = layer.prompt('请输入文件目录').then(dist => {
|
||||
req = layer.prompt('请输入文件目录', 'dist').then(dist => {
|
||||
return fetch(`/package/${act}/${encodeURIComponent(id)}`, {
|
||||
method: 'PUT',
|
||||
body: { dist }
|
||||
|
@ -281,7 +281,7 @@ export default {
|
|||
method: 'PUT'
|
||||
})
|
||||
}
|
||||
|
||||
this.loading = true
|
||||
req
|
||||
.then(r => {
|
||||
layer.toast('操作成功', 'success')
|
||||
|
@ -290,6 +290,7 @@ export default {
|
|||
.catch(r => {
|
||||
r && layer.toast(r.msg, 'error')
|
||||
})
|
||||
.finally(_ => (this.loading = false))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
10
vue.live.js
10
vue.live.js
|
@ -25,13 +25,11 @@ export default {
|
|||
// 有用到其他的库, 可以手动添加,
|
||||
// 也可以在页面中直接引入完整的路径, 而不必须在这里声明
|
||||
imports: {
|
||||
vue: '//a.jscdn.ink/vue/dist/vue.esm-browser.prod.js',
|
||||
'vue-router': '//a.jscdn.ink/vue-router/dist/vue-router.esm-browser.js',
|
||||
vue: '//jscdn.ink/vue/3.2.47/vue.esm-browser.prod.js',
|
||||
'vue-router': '//jscdn.ink/vue-router/4.1.6/vue-router.esm-browser.js',
|
||||
// 这个库被vue-router依赖, 可以注释掉vue-router代码中的 @vue/devtools-api 的引入
|
||||
// 以达到减少不必须的体积的效果
|
||||
'@vue/devtools-api':
|
||||
'//a.jscdn.ink/@vue/devtools-api@6.4.4/lib/esm/index.js',
|
||||
fetch: '//a.jscdn.ink/@bytedo/fetch/dist/next.js',
|
||||
'node-fetch': '//a.jscdn.ink/@bytedo/fetch/dist/next.js'
|
||||
'@vue/devtools-api': '//jscdn.ink/@vue/devtools-api/6.5.0/esm/index.js',
|
||||
fetch: '//jscdn.ink/@bytedo/fetch/2.1.1/next.js'
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue