未验证 提交 5ce77769 编写于 作者: Q Qiuxia Fan 提交者: GitHub

fix: limit edit dashboard (#304)

上级 d917a428
...@@ -21,7 +21,7 @@ limitations under the License. --> ...@@ -21,7 +21,7 @@ limitations under the License. -->
<span>{{ title }}</span> <span>{{ title }}</span>
<span v-show="unit"> ( {{ unit }} ) </span> <span v-show="unit"> ( {{ unit }} ) </span>
<span v-show="status === 'UNKNOWN'" class="item-status">( {{ $t('unknownMetrics') }} )</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"> <svg class="icon cp r">
<use xlink:href="#lock"></use> <use xlink:href="#lock"></use>
</svg> </svg>
...@@ -85,6 +85,7 @@ limitations under the License. --> ...@@ -85,6 +85,7 @@ limitations under the License. -->
@Prop() private index!: number; @Prop() private index!: number;
@Prop() private type!: string; @Prop() private type!: string;
private pageTypes = ['TOPOLOGY_ENDPOINT', 'TOPOLOGY_INSTANCE'];
private dialogConfigVisible = false; private dialogConfigVisible = false;
private status = 'UNKNOWN'; private status = 'UNKNOWN';
private title = 'Title'; private title = 'Title';
...@@ -101,8 +102,8 @@ limitations under the License. --> ...@@ -101,8 +102,8 @@ limitations under the License. -->
this.height = this.item.height; this.height = this.item.height;
this.unit = this.item.unit; this.unit = this.item.unit;
this.itemConfig = this.item; this.itemConfig = this.item;
const pageTypes = ['TOPOLOGY_ENDPOINT', 'TOPOLOGY_INSTANCE'];
if (pageTypes.includes(this.type)) { if (this.pageTypes.includes(this.type)) {
return; return;
} }
this.chartRender(); this.chartRender();
......
...@@ -24,7 +24,8 @@ limitations under the License. --> ...@@ -24,7 +24,8 @@ limitations under the License. -->
<ToolNav :rocketGlobal="rocketGlobal" :rocketComps="rocketComps" /> <ToolNav :rocketGlobal="rocketGlobal" :rocketComps="rocketComps" />
<div class="dashboard-container clear"> <div class="dashboard-container clear">
<DashboardItem <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" :key="index + i.title + i.width"
:index="index" :index="index"
:rocketGlobal="rocketGlobal" :rocketGlobal="rocketGlobal"
...@@ -66,6 +67,7 @@ limitations under the License. --> ...@@ -66,6 +67,7 @@ limitations under the License. -->
@Mutation('SET_CURRENT_COMPS') private SET_CURRENT_COMPS: any; @Mutation('SET_CURRENT_COMPS') private SET_CURRENT_COMPS: any;
@Mutation('ADD_COMP') private ADD_COMP: any; @Mutation('ADD_COMP') private ADD_COMP: any;
@Mutation('SET_ALL_TEMPLATES') private SET_ALL_TEMPLATES: any; @Mutation('SET_ALL_TEMPLATES') private SET_ALL_TEMPLATES: any;
@Mutation('SET_EDIT') private SET_EDIT: any;
private isRouterAlive: boolean = true; private isRouterAlive: boolean = true;
public reload(): void { public reload(): void {
...@@ -118,6 +120,9 @@ limitations under the License. --> ...@@ -118,6 +120,9 @@ limitations under the License. -->
); );
this.handleOption(); this.handleOption();
} }
private beforeDestroy() {
this.SET_EDIT(false);
}
} }
</script> </script>
<style lang="scss"> <style lang="scss">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册