feat: 站点编辑加发布按钮生成manifest上传七牛云
This commit is contained in:
@@ -55,8 +55,9 @@
|
||||
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:8px">
|
||||
<h2 style="margin:0">站点编辑: {{ editSiteId }}</h2>
|
||||
<div style="display:flex;gap:8px">
|
||||
<el-button size="small" type="primary" @click="saveSite" :loading="saving">保存</el-button>
|
||||
<el-button size="small" @click="editSiteId=''">返回列表</el-button>
|
||||
<el-button size="small" type="primary" @click="saveSite" :loading="saving">保存</el-button>
|
||||
<el-button size="small" @click="publishAll" :loading="publishing">发布</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display:flex;gap:12px;flex:1;min-height:0">
|
||||
@@ -106,7 +107,7 @@
|
||||
<script setup>
|
||||
import api from '../api'
|
||||
|
||||
const loading = ref(false), saving = ref(false), pendingCount = ref(0)
|
||||
const loading = ref(false), saving = ref(false), publishing = ref(false), pendingCount = ref(0)
|
||||
const sites = ref([]), editSiteId = ref(''), editorJson = ref('{}'), jsonError = ref(false)
|
||||
const form = reactive({ siteId:'', namesStr:'', urlsStr:'', tagsStr:'', desc:'', siteType:'nexusphp', status:'active' })
|
||||
let syncing = false
|
||||
@@ -153,6 +154,15 @@ const newSite = () => {
|
||||
editorJson.value = JSON.stringify({siteId:'',names:[''],urls:[''],siteType:'nexusphp',status:'active'}, null, 2)
|
||||
}
|
||||
|
||||
const publishAll = async () => {
|
||||
publishing.value = true
|
||||
try {
|
||||
await api.raw.post('/admin/sites/publish')
|
||||
ElMessage.success('已发布到云存储')
|
||||
} catch { ElMessage.error('发布失败') }
|
||||
finally { publishing.value = false }
|
||||
}
|
||||
|
||||
const saveSite = async () => {
|
||||
saving.value = true
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user