mirror of https://github.com/halo-dev/halo-admin
Remove useless files and dependencies.
parent
9d1e7dd1be
commit
a8ade50451
File diff suppressed because it is too large
Load Diff
|
@ -18,12 +18,9 @@
|
|||
"moment": "^2.24.0",
|
||||
"nprogress": "^0.2.0",
|
||||
"verte": "^0.0.12",
|
||||
"viser-vue": "^2.4.6",
|
||||
"vue": "^2.6.10",
|
||||
"vue-clipboard2": "^0.3.0",
|
||||
"vue-codemirror-lite": "^1.0.4",
|
||||
"vue-count-to": "^1.0.13",
|
||||
"vue-cropper": "0.4.9",
|
||||
"vue-ls": "^3.2.1",
|
||||
"vue-router": "^3.1.2",
|
||||
"vue-video-player": "^5.0.2",
|
||||
|
|
14
src/App.vue
14
src/App.vue
|
@ -1,21 +1,13 @@
|
|||
<template>
|
||||
<a-locale-provider :locale="locale">
|
||||
<div id="app">
|
||||
<router-view />
|
||||
</div>
|
||||
</a-locale-provider>
|
||||
<div id="app">
|
||||
<router-view />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
|
||||
import { deviceEnquire, DEVICE_TYPE } from '@/utils/device'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
locale: zhCN
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
const { $store } = this
|
||||
deviceEnquire(deviceType => {
|
||||
|
|
|
@ -11,9 +11,16 @@ themeApi.listAll = () => {
|
|||
})
|
||||
}
|
||||
|
||||
themeApi.listFiles = () => {
|
||||
themeApi.listFilesActivated = () => {
|
||||
return service({
|
||||
url: `${baseUrl}/files`,
|
||||
url: `${baseUrl}/activation/files`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
themeApi.listFiles = themeId => {
|
||||
return service({
|
||||
url: `${baseUrl}/${themeId}/files`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,90 +0,0 @@
|
|||
import { message } from 'ant-design-vue/es'
|
||||
// import defaultSettings from '../defaultSettings';
|
||||
|
||||
let lessNodesAppended
|
||||
|
||||
const colorList = [
|
||||
{
|
||||
key: '薄暮', color: '#F5222D'
|
||||
},
|
||||
{
|
||||
key: '火山', color: '#FA541C'
|
||||
},
|
||||
{
|
||||
key: '日暮', color: '#FAAD14'
|
||||
},
|
||||
{
|
||||
key: '明青', color: '#13C2C2'
|
||||
},
|
||||
{
|
||||
key: '极光绿', color: '#52C41A'
|
||||
},
|
||||
{
|
||||
key: '拂晓蓝(默认)', color: '#1890FF'
|
||||
},
|
||||
{
|
||||
key: '极客蓝', color: '#2F54EB'
|
||||
},
|
||||
{
|
||||
key: '酱紫', color: '#722ED1'
|
||||
}
|
||||
]
|
||||
|
||||
const updateTheme = primaryColor => {
|
||||
// Don't compile less in production!
|
||||
/* if (process.env.NODE_ENV === 'production') {
|
||||
return;
|
||||
} */
|
||||
// Determine if the component is remounted
|
||||
if (!primaryColor) {
|
||||
return
|
||||
}
|
||||
const hideMessage = message.loading('正在编译主题!', 0)
|
||||
function buildIt() {
|
||||
if (!window.less) {
|
||||
return
|
||||
}
|
||||
setTimeout(() => {
|
||||
window.less
|
||||
.modifyVars({
|
||||
'@primary-color': primaryColor
|
||||
})
|
||||
.then(() => {
|
||||
hideMessage()
|
||||
})
|
||||
.catch(() => {
|
||||
message.error('Failed to update theme')
|
||||
hideMessage()
|
||||
})
|
||||
}, 200)
|
||||
}
|
||||
if (!lessNodesAppended) {
|
||||
// insert less.js and color.less
|
||||
const lessStyleNode = document.createElement('link')
|
||||
const lessConfigNode = document.createElement('script')
|
||||
const lessScriptNode = document.createElement('script')
|
||||
lessStyleNode.setAttribute('rel', 'stylesheet/less')
|
||||
lessStyleNode.setAttribute('href', '/color.less')
|
||||
lessConfigNode.innerHTML = `
|
||||
window.less = {
|
||||
async: true,
|
||||
env: 'production',
|
||||
javascriptEnabled: true
|
||||
};
|
||||
`
|
||||
lessScriptNode.src = 'https://cdnjs.loli.net/ajax/libs/less.js/3.8.1/less.min.js'
|
||||
lessScriptNode.async = true
|
||||
lessScriptNode.onload = () => {
|
||||
buildIt()
|
||||
lessScriptNode.onload = null
|
||||
}
|
||||
document.body.appendChild(lessStyleNode)
|
||||
document.body.appendChild(lessConfigNode)
|
||||
document.body.appendChild(lessScriptNode)
|
||||
lessNodesAppended = true
|
||||
} else {
|
||||
buildIt()
|
||||
}
|
||||
}
|
||||
|
||||
export { updateTheme, colorList }
|
|
@ -122,7 +122,6 @@ export default {
|
|||
}
|
||||
</script>
|
||||
<style>
|
||||
/* you can make up upload button and sample style by using stylesheets */
|
||||
.ant-upload-select-picture-card i {
|
||||
font-size: 32px;
|
||||
color: #999;
|
||||
|
|
|
@ -701,28 +701,16 @@ body {
|
|||
}
|
||||
}
|
||||
|
||||
.post-thumb {
|
||||
.post-thumb,.sheet-thumb {
|
||||
.img {
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.post-thumb-remove {
|
||||
margin-top: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.sheet-thumb {
|
||||
.img {
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.sheet-thumb-remove {
|
||||
margin-top: 16px;
|
||||
}
|
||||
.post-thumb-remove,.sheet-thumb-remove {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.ant-calendar-picker {
|
||||
|
@ -733,4 +721,21 @@ body {
|
|||
.v-note-wrapper {
|
||||
min-height: 580px;
|
||||
}
|
||||
}
|
||||
|
||||
.attach-item {
|
||||
width: 50%;
|
||||
margin: 0 auto;
|
||||
position: relative;
|
||||
padding-bottom: 28%;
|
||||
overflow: hidden;
|
||||
float: left;
|
||||
cursor: pointer;
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
}
|
|
@ -4,20 +4,9 @@ import config from '@/config/defaultSettings'
|
|||
|
||||
// base library
|
||||
import '@/core/lazy_lib/components_use'
|
||||
import Viser from 'viser-vue'
|
||||
import VueCropper from 'vue-cropper'
|
||||
import 'ant-design-vue/dist/antd.less'
|
||||
import bootstrap from './bootstrap'
|
||||
|
||||
// ext library
|
||||
import VueClipboard from 'vue-clipboard2'
|
||||
|
||||
VueClipboard.config.autoSetContainer = true
|
||||
|
||||
Vue.use(Viser)
|
||||
|
||||
Vue.use(VueStorage, config.storageOptions)
|
||||
Vue.use(VueClipboard)
|
||||
Vue.use(VueCropper)
|
||||
|
||||
bootstrap()
|
||||
|
|
|
@ -4,18 +4,8 @@ import config from '@/config/defaultSettings'
|
|||
|
||||
// base library
|
||||
import Antd from 'ant-design-vue'
|
||||
import Viser from 'viser-vue'
|
||||
import VueCropper from 'vue-cropper'
|
||||
import 'ant-design-vue/dist/antd.less'
|
||||
|
||||
// ext library
|
||||
import VueClipboard from 'vue-clipboard2'
|
||||
|
||||
VueClipboard.config.autoSetContainer = true
|
||||
|
||||
Vue.use(Antd)
|
||||
Vue.use(Viser)
|
||||
|
||||
Vue.use(VueStorage, config.storageOptions)
|
||||
Vue.use(VueClipboard)
|
||||
Vue.use(VueCropper)
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
<template>
|
||||
<div>
|
||||
404 page
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: '404'
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
|
@ -1,9 +0,0 @@
|
|||
<template>
|
||||
<div> </div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
|
@ -197,20 +197,4 @@ export default {
|
|||
</script>
|
||||
|
||||
<style lang="less" scope>
|
||||
.attach-item {
|
||||
width: 50%;
|
||||
margin: 0 auto;
|
||||
position: relative;
|
||||
padding-bottom: 28%;
|
||||
overflow: hidden;
|
||||
float: left;
|
||||
cursor: pointer;
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -185,20 +185,4 @@ export default {
|
|||
</script>
|
||||
|
||||
<style lang="less" scope>
|
||||
.attach-item {
|
||||
width: 50%;
|
||||
margin: 0 auto;
|
||||
position: relative;
|
||||
padding-bottom: 28%;
|
||||
overflow: hidden;
|
||||
float: left;
|
||||
cursor: pointer;
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -35,7 +35,20 @@
|
|||
:xs="24"
|
||||
:style="{'padding-bottom':'12px'}"
|
||||
>
|
||||
<a-card :title="activatedTheme.name+' 主题'">
|
||||
<a-card>
|
||||
<template slot="title">
|
||||
<a-select
|
||||
style="width: 100%"
|
||||
@change="onSelectTheme"
|
||||
v-model="selectedTheme.id"
|
||||
>
|
||||
<a-select-option
|
||||
v-for="(theme,index) in themes"
|
||||
:key="index"
|
||||
:value="theme.id"
|
||||
>{{ theme.name }} <a-icon v-if="theme.activated" type="check"/></a-select-option>
|
||||
</a-select>
|
||||
</template>
|
||||
<theme-file
|
||||
:files="files"
|
||||
@listenToSelect="handleSelectFile"
|
||||
|
@ -68,22 +81,34 @@ export default {
|
|||
files: [],
|
||||
file: {},
|
||||
content: '',
|
||||
activatedTheme: {}
|
||||
themes: [],
|
||||
selectedTheme: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadFiles()
|
||||
this.loadActivatedTheme()
|
||||
this.loadFiles()
|
||||
this.loadThemes()
|
||||
},
|
||||
methods: {
|
||||
loadActivatedTheme() {
|
||||
themeApi.getActivatedTheme().then(response => {
|
||||
this.selectedTheme = response.data.data
|
||||
})
|
||||
},
|
||||
loadFiles() {
|
||||
themeApi.listFiles().then(response => {
|
||||
themeApi.listFilesActivated().then(response => {
|
||||
this.files = response.data.data
|
||||
})
|
||||
},
|
||||
loadActivatedTheme() {
|
||||
themeApi.getActivatedTheme().then(response => {
|
||||
this.activatedTheme = response.data.data
|
||||
loadThemes() {
|
||||
themeApi.listAll().then(response => {
|
||||
this.themes = response.data.data
|
||||
})
|
||||
},
|
||||
onSelectTheme(themeId) {
|
||||
themeApi.listFiles(themeId).then(response => {
|
||||
this.files = response.data.data
|
||||
})
|
||||
},
|
||||
handleSelectFile(file) {
|
||||
|
@ -95,7 +120,12 @@ export default {
|
|||
this.buttonDisabled = true
|
||||
return
|
||||
}
|
||||
if (file.name === 'settings.yaml' || file.name === 'settings.yml' || file.name === 'theme.yaml' || file.name === 'theme.yml') {
|
||||
if (
|
||||
file.name === 'settings.yaml' ||
|
||||
file.name === 'settings.yml' ||
|
||||
file.name === 'theme.yaml' ||
|
||||
file.name === 'theme.yml'
|
||||
) {
|
||||
this.$confirm({
|
||||
title: '警告:请谨慎修改该配置文件',
|
||||
content: '修改之后可能会产生不可预料的问题!',
|
||||
|
|
|
@ -387,7 +387,7 @@ export default {
|
|||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
<style lang="less">
|
||||
@keyframes scaleDraw {
|
||||
0% {
|
||||
transform: scale(1);
|
||||
|
|
|
@ -240,8 +240,5 @@ export default {
|
|||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.category-tree {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
<style>
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue