This is an automated email from the ASF dual-hosted git repository. zhangyonglun pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/shardingsphere-elasticjob-ui.git
commit 8d74d84cd29e7b1c7b47097726898e9fc02bce55 Author: menghaoranss <[email protected]> AuthorDate: Fri Jul 17 18:38:39 2020 +0800 Guest user just read only --- .../src/views/data-source/module/dataSource.vue | 4 ++++ shardingsphere-elasticjob-ui-frontend/src/views/login/index.vue | 5 +++-- .../src/views/registry-center/module/registryCenter.vue | 8 ++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/shardingsphere-elasticjob-ui-frontend/src/views/data-source/module/dataSource.vue b/shardingsphere-elasticjob-ui-frontend/src/views/data-source/module/dataSource.vue index c9a9f6e..3da97a7 100644 --- a/shardingsphere-elasticjob-ui-frontend/src/views/data-source/module/dataSource.vue +++ b/shardingsphere-elasticjob-ui-frontend/src/views/data-source/module/dataSource.vue @@ -23,6 +23,7 @@ type="primary" icon="el-icon-plus" @click="add" + :disabled="isGuest" >{{ $t("dataSource.btnTxt") }}</el-button> </div> <div class="table-wrap"> @@ -46,6 +47,7 @@ type="primary" icon="el-icon-link" size="small" + :disabled="isGuest" @click="handleConnect(scope.row)" /> </el-tooltip> @@ -59,6 +61,7 @@ size="small" type="danger" icon="el-icon-delete" + :disabled="isGuest" @click="handlerDel(scope.row)" /> </el-tooltip> @@ -137,6 +140,7 @@ export default { data() { return { regustDialogVisible: false, + isGuest: window.localStorage.getItem('isGuest') == 'true', column: [ { label: this.$t('dataSource').addDialog.name, diff --git a/shardingsphere-elasticjob-ui-frontend/src/views/login/index.vue b/shardingsphere-elasticjob-ui-frontend/src/views/login/index.vue index 644176c..03373ba 100644 --- a/shardingsphere-elasticjob-ui-frontend/src/views/login/index.vue +++ b/shardingsphere-elasticjob-ui-frontend/src/views/login/index.vue @@ -72,8 +72,8 @@ export default { data() { return { loginForm: { - username: 'admin', - password: 'admin' + username: '', + password: '' }, loading: false, pwdType: 'password', @@ -104,6 +104,7 @@ export default { const store = window.localStorage store.setItem('Access-Token', data.accessToken) store.setItem('username', data.username) + store.setItem('isGuest', data.isGuest) location.href = '#/registry-center' }) } diff --git a/shardingsphere-elasticjob-ui-frontend/src/views/registry-center/module/registryCenter.vue b/shardingsphere-elasticjob-ui-frontend/src/views/registry-center/module/registryCenter.vue index 13669f8..d762f6e 100644 --- a/shardingsphere-elasticjob-ui-frontend/src/views/registry-center/module/registryCenter.vue +++ b/shardingsphere-elasticjob-ui-frontend/src/views/registry-center/module/registryCenter.vue @@ -23,6 +23,7 @@ type="primary" icon="el-icon-plus" @click="add" + :disabled="isGuest" >{{ $t("registryCenter.btnTxt") }}</el-button> </div> <div class="table-wrap"> @@ -47,6 +48,7 @@ icon="el-icon-link" size="small" @click="handleConnect(scope.row)" + :disabled="isGuest" /> </el-tooltip> <el-tooltip @@ -60,6 +62,7 @@ type="danger" icon="el-icon-delete" @click="handlerDel(scope.row)" + :disabled="isGuest" /> </el-tooltip> </template> @@ -77,14 +80,14 @@ </div> <el-dialog :title="$t('registryCenter.registDialog.title')" - :visible.sync="regustDialogVisible" + :visible.sync="addDialogVisible" width="1010px" > <el-form ref="form" :model="form" :rules="rules" label-width="170px"> <el-form-item :label="$t('registryCenter.registDialog.name')" prop="name"> <el-input :placeholder="$t('registryCenter.rules.name')" v-model="form.name" autocomplete="off" /> </el-form-item> - <el-form-item :label="$t('registryCenter.registDialog.address')" prop="serverLists"> + <el-form-item :label="$t('registryCenter.registDialog.address')" prop="zkAddressList"> <el-input :placeholder="$t('registryCenter.rules.address')" v-model="form.zkAddressList" @@ -125,6 +128,7 @@ export default { data() { return { addDialogVisible: false, + isGuest: window.localStorage.getItem('isGuest') == 'true', column: [ { label: this.$t('registryCenter').registDialog.name,
