diff options
| author | zyh <[email protected]> | 2023-10-27 10:29:04 +0800 |
|---|---|---|
| committer | zyh <[email protected]> | 2023-10-27 10:29:04 +0800 |
| commit | 9fced424deccc8bb8364dbd29f803e960c52653e (patch) | |
| tree | 9685b64a7aa72652af68f330d76d1e605b3a1dde | |
| parent | 9d18918bfc72cc9352daacc3623f9fad5770de3e (diff) | |
NEZ-3280 fix:Role Permission,Permission中未勾选View权限,但仍可进行View操作rel-23.10.05
3 files changed, 14 insertions, 9 deletions
diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/notebookTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/notebookTab.vue index 3281c2a34..232aa04ad 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/notebookTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/notebookTab.vue @@ -12,13 +12,15 @@ > <template v-slot:title><span :title="obj.name">{{obj.name}}</span></template> <template v-slot:top-tool-right> - <button class="nz-btn nz-btn-size-normal nz-btn-style-normal" v-if="!notebookEdit" @click="edit"> - <i class="nz-icon nz-icon-edit"></i> - <span>{{$t('overall.edit')}}</span> - </button> - <button class="nz-btn nz-btn-size-normal nz-btn-style-normal" v-else @click="done"> - <span>{{$t('notebook.done')}}</span> - </button> + <div v-has="'notebook_edit'"> + <button class="nz-btn nz-btn-size-normal nz-btn-style-normal" v-if="!notebookEdit" @click="edit"> + <i class="nz-icon nz-icon-edit"></i> + <span>{{$t('overall.edit')}}</span> + </button> + <button class="nz-btn nz-btn-size-normal nz-btn-style-normal" v-else @click="done"> + <span>{{$t('notebook.done')}}</span> + </button> + </div> <pick-time ref="pickTime" v-model="searchTime" :refresh-data-func="dateChange" :show-locked="true" :use-chart-unit="false" :sign="'notebook' + obj.id"></pick-time> <el-dropdown v-has="['notebook_view']" trigger="click" size="medium" class="nz-el-dropdown"> <button class="top-tool-btn" :title="$t('overall.download')"> diff --git a/nezha-fronted/src/components/common/table/settings/notebookTable.vue b/nezha-fronted/src/components/common/table/settings/notebookTable.vue index 0d6e1d6f5..21e6fa6ef 100644 --- a/nezha-fronted/src/components/common/table/settings/notebookTable.vue +++ b/nezha-fronted/src/components/common/table/settings/notebookTable.vue @@ -55,7 +55,7 @@ fixed="right"> <div slot="header" class="table-operation-title">{{$t('overall.option')}}</div> <div slot-scope="scope" class="table-operation-items"> - <button class="table-operation-item" @click="showBottomBox('notebookTab', scope.row)" :title="$t('overall.view')"><i class="nz-icon nz-icon-view1"></i></button> + <button class="table-operation-item" v-has="'notebook_view'" @click="showBottomBox('notebookTab', scope.row)" :title="$t('overall.view')"><i class="nz-icon nz-icon-view1"></i></button> <el-dropdown size="medium" v-has="['notebook_add','notebook_edit','notebook_delete']" trigger="click" @command="tableOperation"> <div class="table-operation-item table-operation-item--more" :title="$t('overall.moreOperations')"> <i class="nz-icon nz-icon-more3"></i> @@ -121,6 +121,9 @@ export default { }, methods: { showBottomBox (targetTab, row) { + if (!this.hasButton('notebook_view')) { + return + } this.$store.commit('setNotebookEdit', false) this.$emit('showBottomBox', targetTab, JSON.parse(JSON.stringify(row))) } diff --git a/nezha-fronted/src/components/page/config/system/license.vue b/nezha-fronted/src/components/page/config/system/license.vue index 61d4041f1..005b6a6df 100644 --- a/nezha-fronted/src/components/page/config/system/license.vue +++ b/nezha-fronted/src/components/page/config/system/license.vue @@ -80,7 +80,7 @@ <span>{{scope.row.hostname}}</span> </template> <!-- ip --> - <template v-if="item.prop === 'ip'"> + <template v-else-if="item.prop === 'ip'"> <span>{{getLicense(scope.row)}}</span> </template> <!-- state --> |
