apk上传

This commit is contained in:
曹前明 2022-08-08 08:50:12 +08:00
parent d66242d7de
commit f79b37eae7
13 changed files with 200 additions and 18 deletions

View File

@ -26,4 +26,12 @@ export default {
}
}
},
server: {
info: {
name: "服务器状态",
req: async function(name){
return await http.get(`${config.API_URL}/monitor/server/`);
}
}
}
}

View File

@ -341,6 +341,22 @@ export default {
}
},
},
apk:{
read: {
url: `${config.API_URL}/system/apk/`,
name: "apk信息",
req: async function(data){
return await http.get(this.url, data);
}
},
create: {
url: `${config.API_URL}/system/apk/`,
name: "apk创建",
req: async function(data){
return await http.post(this.url, data);
}
}
},
userPost:{
list: {
url: `${config.API_URL}/system/user_post/`,

View File

@ -46,7 +46,7 @@ const DEFAULT_CONFIG = {
LANG: 'zh-cn',
//主题颜色
COLOR: '',
COLOR: '#536DFE',
//是否加密localStorage, 为空不加密可填写AES(模式ECB,移位Pkcs7)加密
LS_ENCRYPTION: '',

View File

@ -755,6 +755,26 @@ const routes = [
},
"component": "ops/fileLogs"
},
{
"name": "server",
"path": "/ops/server",
"meta": {
"title": "服务器",
"icon": "el-icon-document",
"perms": ["ops"]
},
"component": "ops/server"
},
{
"name": "setting",
"path": "/ops/setting",
"meta": {
"title": "配置",
"icon": "el-icon-document",
"perms": ["ops"]
},
"component": "ops/setting"
},
]
},
]

View File

@ -182,7 +182,7 @@
<div class="main-maximize-exit" @click="exitMaximize"><el-icon><el-icon-close /></el-icon></div>
<div class="layout-setting" @click="openSetting"><el-icon><el-icon-brush-filled /></el-icon></div>
<!-- <div class="layout-setting" @click="openSetting"><el-icon><el-icon-brush-filled /></el-icon></div> -->
<el-drawer title="布局实时演示" v-model="settingDialog" :size="400" append-to-body destroy-on-close>
<setting></setting>

View File

@ -73,7 +73,7 @@
min-width="100"
></el-table-column>
<el-table-column label="操作" align="center" width="80">
<el-button type="text" size="small">查看</el-button>
<el-button type="primary" size="small">查看</el-button>
</el-table-column>
</scTable>
</el-main>

View File

@ -44,15 +44,12 @@
<el-table-column label="操作" fixed="right" align="center" width="200">
<template #default="scope">
<el-button
link
type="primary"
size="small"
@click="editMenu(scope.row, scope.$index)"
>编辑</el-button
>
<el-divider direction="vertical"></el-divider>
<el-button
link
type="danger"
size="small"
@click="delMenu(scope.row.id)"

84
src/views/ops/server.vue Normal file
View File

@ -0,0 +1,84 @@
<template>
<el-container>
<el-main>
<el-row :gutter="4">
<el-col :md="8" :sm="24">
<el-card header="CPU" v-loading="loading">
<el-descriptions :column="1" border>
<el-descriptions-item label="物理核心数">{{
cpuData.count
}}</el-descriptions-item>
<el-descriptions-item label="逻辑核心数">{{
cpuData.lcount
}}</el-descriptions-item>
<el-descriptions-item label="当前使用率"
>{{ cpuData.percent }}%</el-descriptions-item
>
</el-descriptions>
</el-card>
</el-col>
<el-col :md="8" :sm="24">
<el-card header="内存" v-loading="loading">
<el-descriptions :column="1" border>
<el-descriptions-item label="总内存"
>{{ memoryData.total }}GB</el-descriptions-item
>
<el-descriptions-item label="已用内存"
>{{ memoryData.used }}GB</el-descriptions-item
>
<el-descriptions-item label="当前使用率"
>{{ memoryData.percent }}%</el-descriptions-item
>
</el-descriptions>
</el-card>
</el-col>
<el-col :md="8" :sm="24">
<el-card header="硬盘" v-loading="loading">
<el-descriptions :column="1" border>
<el-descriptions-item label="总大小"
>{{ diskData.total }}GB</el-descriptions-item
>
<el-descriptions-item label="已用大小"
>{{ diskData.used }}GB</el-descriptions-item
>
<el-descriptions-item label="当前使用率"
>{{ diskData.percent }}GB</el-descriptions-item
>
</el-descriptions>
</el-card>
</el-col>
</el-row>
</el-main>
</el-container>
</template>
<script>
export default {
data() {
return {
loading: false,
cpuData: {},
diskData: {},
memoryData: {},
};
},
mounted() {
this.serverInfo();
},
methods: {
serverInfo() {
this.loading = true;
this.$API.ops.server.info
.req()
.then((res) => {
this.loading = false;
this.cpuData = res.cpu;
this.diskData = res.disk;
this.memoryData = res.memory;
})
.catch((e) => {
this.loading = false;
});
},
},
};
</script>

57
src/views/ops/setting.vue Normal file
View File

@ -0,0 +1,57 @@
<template>
<el-container>
<el-main>
<el-row :gutter="4">
<el-col :md="8" :sm="24">
<el-card header="安卓APP" shadow="hover">
<el-form >
<el-form-item label="版本号">
<el-input v-model="apk_form.version" placeholder="版本号"></el-input>
</el-form-item>
<el-form-item label="文件">
<sc-upload-file
v-model="apk_form.file"
:multiple="false"
:limit="1"
>
<el-button type="primary" icon="el-icon-upload">上传</el-button>
</sc-upload-file>
</el-form-item>
<el-form-item style="float:right">
<el-button type="primary" :loading="apkSaveLoading" @click="apkSave">保存</el-button>
</el-form-item>
</el-form>
</el-card>
</el-col>
</el-row>
</el-main>
</el-container>
</template>
<script>
export default {
data() {
return {
apkSaveLoading: false,
apk_form: {},
};
},
mounted(){
this.apkRead()
},
methods:{
apkSave(){
this.apkSaveLoading = true
this.$API.system.apk.create.req(this.apk_form).then(res=>{
this.apkSaveLoading = false
this.$message.success("保存成功")
}).catch(e=>{this.apkSaveLoading=true})
},
apkRead(){
this.$API.system.apk.read.req().then(res=>{
this.apk_form = res
})
}
}
};
</script>

View File

@ -77,7 +77,7 @@
min-width="100"
></el-table-column>
<el-table-column label="操作" align="center" width="80">
<el-button link size="small">查看</el-button>
<el-button type="primary" size="small">查看</el-button>
</el-table-column>
</scTable>
</el-main>

View File

@ -66,7 +66,6 @@
v-auth="'dept.update'"
>编辑</el-button
>
<el-divider direction="vertical"></el-divider>
<el-popconfirm
title="确定删除吗?"
@confirm="delDept(scope.row, scope.$index)"

View File

@ -203,16 +203,16 @@
this.showDicloading = false;
this.dicList = res;
//, &
let firstNode = this.dicList[0];
if(firstNode){
this.$nextTick(() => {
this.$refs.dic.setCurrentKey(firstNode.id)
});
this.listApiParams = {
id: firstNode.id
};
this.listApi = this.$API.system.dict.list;
}
// let firstNode = this.dicList[0];
// if(firstNode){
// this.$nextTick(() => {
// this.$refs.dic.setCurrentKey(firstNode.id)
// });
// this.listApiParams = {
// id: firstNode.id
// };
// this.listApi = this.$API.system.dict.list;
// }
let postList = res;
let posts = [];
postList.forEach(item => {
@ -294,6 +294,7 @@
},
//
dicClickType(data){
this.listApi = this.$API.system.dict.list;
this.$refs.table.queryData({
type: data.id
})