权限调整

This commit is contained in:
kerwincui
2022-06-03 14:29:50 +08:00
parent f281ccc1da
commit c9623a5ec6
5 changed files with 81 additions and 37 deletions

View File

@@ -147,15 +147,33 @@
<h2><i class="el-icon-s-data"> 服务器状态</i></h2> <h2><i class="el-icon-s-data"> 服务器状态</i></h2>
<el-row :gutter="40"> <el-row :gutter="40">
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="6"> <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="6">
<el-card style="margin:-10px;height:218px;margin-bottom:30px;" shadow="hover"> <el-card style="margin:-10px;height:218px;margin-bottom:150px;background-color:#fafafa;" shadow="hover">
<el-descriptions :column="1"> <table class="description">
<el-descriptions-item label="服务器名称"><strong>{{server.sys.computerName}}</strong></el-descriptions-item> <tr>
<el-descriptions-item label="服务器IP"><strong>{{server.sys.computerIp}}</strong></el-descriptions-item> <td><strong>服务器名称 </strong></td>
<el-descriptions-item label="操作系统"><strong>{{server.sys.osName}}</strong></el-descriptions-item> <td>{{server.sys.computerName}}</td>
<el-descriptions-item label="系统架构"><strong>{{server.sys.osArch}}</strong></el-descriptions-item> </tr>
<el-descriptions-item label="CPU核心"><strong>{{server.cpu.cpuNum}}</strong></el-descriptions-item> <tr>
<el-descriptions-item label="总内存"><strong>{{server.mem.total}}G</strong></el-descriptions-item> <td><strong>服务器IP </strong></td>
</el-descriptions> <td>{{server.sys.computerIp}}</td>
</tr>
<tr>
<td><strong>操作系统 </strong></td>
<td>{{server.sys.osName}}</td>
</tr>
<tr>
<td><strong>系统架构 </strong></td>
<td>{{server.sys.osArch}}</td>
</tr>
<tr>
<td><strong>CPU核心 </strong></td>
<td>{{server.cpu.cpuNum}}</td>
</tr>
<tr>
<td><strong>总内存 </strong></td>
<td>{{server.mem.total}}</td>
</tr>
</table>
</el-card> </el-card>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4"> <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4">
@@ -174,15 +192,33 @@
</el-card> </el-card>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="6"> <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="6">
<el-card style="margin:-10px;height:218px;margin-bottom:30px;" shadow="hover"> <el-card style="margin:-10px;height:218px;margin-bottom:30px;background-color:#fafafa;" shadow="hover">
<el-descriptions :column="1"> <table class="description">
<el-descriptions-item label="Java名称"><strong>{{server.jvm.name}}</strong></el-descriptions-item> <tr>
<el-descriptions-item label="启动时间"><strong>{{ server.jvm.startTime }}</strong></el-descriptions-item> <td><strong>Java名称 </strong></td>
<el-descriptions-item label="Java版本"><strong>{{ server.jvm.version }}</strong></el-descriptions-item> <td>{{server.jvm.name}}</td>
<el-descriptions-item label="运行时长"><strong>{{ server.jvm.runTime }}</strong></el-descriptions-item> </tr>
<el-descriptions-item label="占用内存"><strong>{{server.jvm.used}}M</strong></el-descriptions-item> <tr>
<el-descriptions-item label="JVM总内存"><strong>{{server.jvm.total}}M</strong></el-descriptions-item> <td><strong>启动时间 </strong></td>
</el-descriptions> <td>{{server.jvm.startTime}}</td>
</tr>
<tr>
<td><strong>Java版本 </strong></td>
<td>{{server.jvm.version}}</td>
</tr>
<tr>
<td><strong>运行时长 </strong></td>
<td>{{server.jvm.runTime}}</td>
</tr>
<tr>
<td><strong>占用内存 </strong></td>
<td>{{server.jvm.used}}</td>
</tr>
<tr>
<td><strong>JVM总内存 </strong></td>
<td>{{server.jvm.total}}</td>
</tr>
</table>
</el-card> </el-card>
</el-col> </el-col>
</el-row> </el-row>
@@ -397,7 +433,7 @@ export default {
featureType: 'land', featureType: 'land',
elementType: 'all', elementType: 'all',
stylers: { stylers: {
color: '#f0f0f0' // ##fffeee 黄色 color: '#fffff8'
} }
}, },
{ {
@@ -750,6 +786,14 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.description {
font-size: 14px;
tr {
line-height: 26px;
}
}
.panel-group { .panel-group {
.card-panel-col { .card-panel-col {
margin-bottom: 10px; margin-bottom: 10px;
@@ -761,8 +805,8 @@ export default {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
color: #666; color: #666;
border:1px solid #eee; border: 1px solid #eee;
border-radius:5px; border-radius: 5px;
box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.08); box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.08);
&:hover { &:hover {

View File

@@ -43,7 +43,7 @@
<el-table-column label="会话创建时间" align="center" prop="created_at" /> <el-table-column label="会话创建时间" align="center" prop="created_at" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="small" type="danger" v-if="scope.row.connected" style="padding: 5px" v-hasPermi="['iot:product:remove']" @click="handleDelete(scope.row)"> <el-button size="small" type="danger" v-if="scope.row.connected" style="padding: 5px" v-hasPermi="['iot:emqx:remove']" @click="handleDelete(scope.row)">
<svg-icon icon-class="disconnect" /> 断开连接 <svg-icon icon-class="disconnect" /> 断开连接
</el-button> </el-button>
</template> </template>
@@ -102,10 +102,10 @@
<span slot="label">订阅列表</span> <span slot="label">订阅列表</span>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-refresh" size="mini" @click="handleRefresh" v-hasPermi="['monitor:subscribe:refresh']">刷新</el-button> <el-button type="primary" plain icon="el-icon-refresh" size="mini" @click="handleRefresh" v-hasPermi="['iot:emqx:query']">刷新</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="success" plain icon="el-icon-plus" size="mini" :disabled="single" @click="handleAdd" v-hasPermi="['monitor:subscribe:add']">添加订阅</el-button> <el-button type="success" plain icon="el-icon-plus" size="mini" :disabled="single" @click="handleAdd" v-hasPermi="['iot:emqx:add']">添加订阅</el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-table v-loading="loadSubscribeing" :data="subscribeList"> <el-table v-loading="loadSubscribeing" :data="subscribeList">
@@ -113,7 +113,7 @@
<el-table-column label="QoS" align="center" prop="qos" /> <el-table-column label="QoS" align="center" prop="qos" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="small" type="danger" style="padding: 5px" v-hasPermi="['monitor:subscribe:delete']" @click="handleUnsubscribe(scope.row)"> <el-button size="small" type="danger" style="padding: 5px" v-hasPermi="['iot:emqx:remove']" @click="handleUnsubscribe(scope.row)">
<svg-icon icon-class="disconnect" /> 取消订阅 <svg-icon icon-class="disconnect" /> 取消订阅
</el-button> </el-button>
</template> </template>

View File

@@ -14,11 +14,11 @@
<el-table-column label="描述" align="left" prop="description" /> <el-table-column label="描述" align="left" prop="description" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="small" type="success" style="padding:5px;" @click="loadMqttPlugin(scope.row.name)" v-if="!scope.row.active" v-hasPermi="['iot:product:remove']"> <el-button size="small" type="success" style="padding:5px;" @click="loadMqttPlugin(scope.row.name)" v-if="!scope.row.active" v-hasPermi="['iot:emqx:edit']">
<svg-icon icon-class="start" /> 启动 <svg-icon icon-class="start" /> 启动
</el-button> </el-button>
<el-button size="small" type="danger" style="padding:5px;" @click="unloadMqttPlugin(scope.row.name)" v-else v-hasPermi="['iot:product:remove']"> <el-button size="small" type="danger" style="padding:5px;" @click="unloadMqttPlugin(scope.row.name)" v-hasPermi="['iot:emqx:edit']" v-if="scope.row.active && scope.row.name!='emqx_auth_http' && scope.row.name!='emqx_web_hook' && scope.row.name!='emqx_rule_engine' && scope.row.name!='emqx_management' ">
<svg-icon icon-class="stop" /> 停止 <svg-icon icon-class="stop" /> 停止
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>

View File

@@ -3,10 +3,10 @@
<el-card style="padding-bottom: 100px"> <el-card style="padding-bottom: 100px">
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="success" plain icon="el-icon-refresh" size="mini" @click="getList" v-hasPermi="['monitor:resource:refresh']">刷新</el-button> <el-button type="success" plain icon="el-icon-refresh" size="mini" @click="getList" v-hasPermi="['iot:emqx:query']">刷新</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="addResource" v-hasPermi="['monitor:resource:add']">新增</el-button> <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="addResource" v-hasPermi="['iot:emqx:add']">新增</el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-table v-loading="loading" :data="resourceList"> <el-table v-loading="loading" :data="resourceList">
@@ -19,9 +19,9 @@
<el-table-column label="备注" align="center" prop="description" /> <el-table-column label="备注" align="center" prop="description" />
<el-table-column label="操作" align="center" width="200"> <el-table-column label="操作" align="center" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="small" type="text" icon="el-icon-connection" style="padding: 5px" v-hasPermi="['monitor:resource:checkStatus']" @click="checkStatus(scope.row)">状态 <el-button size="small" type="text" icon="el-icon-connection" style="padding: 5px" v-hasPermi="['iot:emqx:edit']" @click="checkStatus(scope.row)">状态
</el-button> </el-button>
<el-button size="small" type="text" icon="el-icon-delete" style="padding: 5px" v-hasPermi="['iot:product:remove']" @click="handleDelete(scope.row)">删除 <el-button size="small" type="text" icon="el-icon-delete" style="padding: 5px" v-hasPermi="['iot:emqx:remove']" @click="handleDelete(scope.row)">删除
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@@ -98,7 +98,7 @@
{{ statusForm.status[0].node }} {{ statusForm.status[0].node }}
<el-tag type="success" v-if="statusForm.status[0].is_alive == true" style="margin-left: 10px">可用</el-tag> <el-tag type="success" v-if="statusForm.status[0].is_alive == true" style="margin-left: 10px">可用</el-tag>
<el-tag type="danger" v-if="statusForm.status[0].is_alive == false" style="margin-left: 10px">不可用</el-tag> <el-tag type="danger" v-if="statusForm.status[0].is_alive == false" style="margin-left: 10px">不可用</el-tag>
<el-button size="small" type="primary" icon="el-icon-connection" style="padding: 5px; margin-left: 10px" v-hasPermi="['monitor:resource:connect']" @click="checkNode(statusForm.id)">重新连接 <el-button size="small" type="primary" icon="el-icon-connection" style="padding: 5px; margin-left: 10px" v-hasPermi="['iot:emqx:edit']" @click="checkNode(statusForm.id)">重新连接
</el-button> </el-button>
</el-form> </el-form>
</el-dialog> </el-dialog>

View File

@@ -3,10 +3,10 @@
<el-card style="padding-bottom: 100px"> <el-card style="padding-bottom: 100px">
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="success" plain icon="el-icon-refresh" size="mini" @click="getList" v-hasPermi="['monitor:rules:refresh']">刷新</el-button> <el-button type="success" plain icon="el-icon-refresh" size="mini" @click="getList" v-hasPermi="['iot:emqx:query']">刷新</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="getAddRules" v-hasPermi="['monitor:rules:add']">新增</el-button> <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="getAddRules" v-hasPermi="['iot:emqx:add']">新增</el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-table v-loading="loading" :data="rulesList"> <el-table v-loading="loading" :data="rulesList">
@@ -37,7 +37,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="small" type="danger" icon="el-icon-delete" style="padding: 5px" v-hasPermi="['iot:product:remove']" @click="handleDelete(scope.row)">删除 <el-button size="small" type="danger" icon="el-icon-delete" style="padding: 5px" v-hasPermi="['iot:emqx:remove']" @click="handleDelete(scope.row)">删除
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>