This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-rocketbot-ui.git


The following commit(s) were added to refs/heads/master by this push:
     new 5ce7776  fix: limit edit dashboard (#304)
5ce7776 is described below

commit 5ce777695cf4b8ca23fa119d18c717ee988f4918
Author: Qiuxia Fan <[email protected]>
AuthorDate: Wed Jun 3 17:52:22 2020 +0800

    fix: limit edit dashboard (#304)
---
 src/views/components/dashboard/dashboard-item.vue | 7 ++++---
 src/views/containers/dashboard.vue                | 7 ++++++-
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/views/components/dashboard/dashboard-item.vue 
b/src/views/components/dashboard/dashboard-item.vue
index 9ac8a09..78061b0 100644
--- a/src/views/components/dashboard/dashboard-item.vue
+++ b/src/views/components/dashboard/dashboard-item.vue
@@ -21,7 +21,7 @@ limitations under the License. -->
       <span>{{ title }}</span>
       <span v-show="unit"> ( {{ unit }} ) </span>
       <span v-show="status === 'UNKNOWN'" class="item-status">( {{ 
$t('unknownMetrics') }} )</span>
-      <span v-show="!rocketGlobal.edit" @click="editComponentConfig">
+      <span v-show="!rocketGlobal.edit && !pageTypes.includes(type)" 
@click="editComponentConfig">
         <svg class="icon cp r">
           <use xlink:href="#lock"></use>
         </svg>
@@ -85,6 +85,7 @@ limitations under the License. -->
     @Prop() private index!: number;
     @Prop() private type!: string;
 
+    private pageTypes = ['TOPOLOGY_ENDPOINT', 'TOPOLOGY_INSTANCE'];
     private dialogConfigVisible = false;
     private status = 'UNKNOWN';
     private title = 'Title';
@@ -101,8 +102,8 @@ limitations under the License. -->
       this.height = this.item.height;
       this.unit = this.item.unit;
       this.itemConfig = this.item;
-      const pageTypes = ['TOPOLOGY_ENDPOINT', 'TOPOLOGY_INSTANCE'];
-      if (pageTypes.includes(this.type)) {
+
+      if (this.pageTypes.includes(this.type)) {
         return;
       }
       this.chartRender();
diff --git a/src/views/containers/dashboard.vue 
b/src/views/containers/dashboard.vue
index 5277f9f..b616fac 100644
--- a/src/views/containers/dashboard.vue
+++ b/src/views/containers/dashboard.vue
@@ -24,7 +24,8 @@ limitations under the License. -->
     <ToolNav :rocketGlobal="rocketGlobal" :rocketComps="rocketComps" />
     <div class="dashboard-container clear">
       <DashboardItem
-        v-for="(i, index) in 
rocketComps.tree[this.rocketComps.group].children[this.rocketComps.current].children"
+        v-for="(i, index) in 
rocketComps.tree[rocketComps.group].children[rocketComps.current] &&
+          
rocketComps.tree[rocketComps.group].children[rocketComps.current].children"
         :key="index + i.title + i.width"
         :index="index"
         :rocketGlobal="rocketGlobal"
@@ -66,6 +67,7 @@ limitations under the License. -->
     @Mutation('SET_CURRENT_COMPS') private SET_CURRENT_COMPS: any;
     @Mutation('ADD_COMP') private ADD_COMP: any;
     @Mutation('SET_ALL_TEMPLATES') private SET_ALL_TEMPLATES: any;
+    @Mutation('SET_EDIT') private SET_EDIT: any;
 
     private isRouterAlive: boolean = true;
     public reload(): void {
@@ -118,6 +120,9 @@ limitations under the License. -->
       );
       this.handleOption();
     }
+    private beforeDestroy() {
+      this.SET_EDIT(false);
+    }
   }
 </script>
 <style lang="scss">

Reply via email to