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

fix: limit edit dashboard (#304)

上级 d917a428
......@@ -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();
......
......@@ -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">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册