Skip to content

Commit

Permalink
feat(grafana): url
Browse files Browse the repository at this point in the history
  • Loading branch information
h7ml committed Jun 8, 2022
1 parent e36f501 commit 530b9fd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 26 deletions.
20 changes: 16 additions & 4 deletions src/views/CloudPressure/grafana.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,37 @@
<template>
<div class="grafana-container">
<div class="grafana">
<iframe frameborder="0" src="http://101.32.99.133:3000/login"></iframe>
<iframe frameborder="0" :src="iframeSrc"></iframe>
</div>
</div>
</template>

<script>
import { mapMutations } from 'vuex'
export default {
name: 'Grafana',
components: {},
props: {},
data() {
return {}
return {
iframeSrc:
process.env.NODE_ENV !== 'development'
? location.protocol + '//' + location.hostname + ':3000'
: 'http://101.32.99.133:3000/login',
}
},
computed: {},
watch: {},
created() {},
mounted() {},
mounted() {
this.setTreeFlag(false)
},
destroyed() {},
methods: {},
methods: {
...mapMutations({
setTreeFlag: 'settings/setTreeFlag',
}),
},
}
</script>

Expand Down
37 changes: 15 additions & 22 deletions src/views/CloudPressure/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
:closable="true"
fullscreen
:title="draw.row.name"
@on-cancel="close"
@on-cancel="beforeClose"
>
<div>
<Tabs size="small" :value="defaultTable">
Expand Down Expand Up @@ -279,13 +279,13 @@
>
{{ $translateTitle('pressure.报告配置') }}
</el-button>
<el-button
size="mini"
type="info"
@click.native="generateReport(row)"
>
{{ $translateTitle('pressure.生成报告') }}
</el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="info"-->
<!-- @click.native="generateReport(row)"-->
<!-- >-->
<!-- {{ $translateTitle('pressure.生成报告') }}-->
<!-- </el-button>-->
</template>
</el-table-column>
<el-table-column
Expand Down Expand Up @@ -503,6 +503,9 @@
...mapMutations({
setTreeFlag: 'settings/setTreeFlag',
}),
beforeClose() {
this.fetchData()
},
async generateReport(row) {
console.log(row)
},
Expand Down Expand Up @@ -831,22 +834,12 @@
const timeExp = /\[(\d{2,}):(\d{2})(?:\.(\d{2,3}))?]/g
results.forEach((i) => {
i.startTime = i?.profile?.startTime
? timeExp.exec(i.profile.startTime)
? this.$moment
.unix(i.profile.startTime)
.format('YYYY-MM-DD HH:mm:ss')
: this.$moment
.unix(i.profile.startTime)
.format('YYYY-MM-DD HH:mm:ss')
? this.$moment
.unix(i.profile.startTime)
.format('YYYY-MM-DD HH:mm:ss')
: this.$translateTitle('pressure.暂未配置')
i.endTime = i?.profile?.endTime
? timeExp.exec(i.profile.endTime)
? this.$moment
.unix(i.profile.endTime)
.format('YYYY-MM-DD HH:mm:ss')
: this.$moment
.unix(i.profile.endTime)
.format('YYYY-MM-DD HH:mm:ss')
? this.$moment.unix(i.profile.endTime).format('YYYY-MM-DD HH:mm:ss')
: this.$translateTitle('pressure.暂未配置')
})
this.list = results
Expand Down

0 comments on commit 530b9fd

Please sign in to comment.