mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-08 10:07:41 +00:00
perf: report to iframe
This commit is contained in:
parent
e361bcbf42
commit
cc4b5183ea
75
src/components/Dialog/ReportDialog.vue
Normal file
75
src/components/Dialog/ReportDialog.vue
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<Dialog
|
||||||
|
v-if="iVisible"
|
||||||
|
:destroy-on-close="true"
|
||||||
|
:show-cancel="false"
|
||||||
|
:show-confirm="false"
|
||||||
|
:title="$tc('Report')"
|
||||||
|
:visible.sync="iVisible"
|
||||||
|
top="35vh"
|
||||||
|
width="80%"
|
||||||
|
@close="loading=true"
|
||||||
|
>
|
||||||
|
<span v-if="loading" v-loading="loading" class="loading" />
|
||||||
|
<iframe title="dialog" :src="url" style="border: none;" @load="onIframeLoad" />
|
||||||
|
</Dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Dialog from '@/components/Dialog/index.vue'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ReportDialog',
|
||||||
|
components: {
|
||||||
|
Dialog
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
url: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
iVisible: {
|
||||||
|
get() {
|
||||||
|
return this.visible
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$emit('update:visible', val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
beforeMount() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onIframeLoad() {
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
iframe {
|
||||||
|
width: 100%;
|
||||||
|
height: 500px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading {
|
||||||
|
margin-top: 20px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
</style>
|
@ -10,7 +10,7 @@ export default [
|
|||||||
},
|
},
|
||||||
name: 'AccountDiscover',
|
name: 'AccountDiscover',
|
||||||
meta: {
|
meta: {
|
||||||
title: i18n.t('AccountDiscoverList'),
|
title: i18n.t('AccountDiscover'),
|
||||||
app: 'accounts',
|
app: 'accounts',
|
||||||
icon: 'discovery'
|
icon: 'discovery'
|
||||||
// activeMenu: '/console/accounts/automations',
|
// activeMenu: '/console/accounts/automations',
|
||||||
@ -43,7 +43,7 @@ export default [
|
|||||||
name: 'AccountDiscoverTaskDetail',
|
name: 'AccountDiscoverTaskDetail',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
meta: {
|
meta: {
|
||||||
title: i18n.t('AccountDiscoverTask'),
|
title: i18n.t('AccountDiscover'),
|
||||||
// activeMenu: '/console/accounts/automations',
|
// activeMenu: '/console/accounts/automations',
|
||||||
permissions: ['accounts.view_gatheraccountsautomation']
|
permissions: ['accounts.view_gatheraccountsautomation']
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<GenericListTable :header-actions="headerActions" :table-config="tableConfig" />
|
<div>
|
||||||
|
<GenericListTable :header-actions="headerActions" :table-config="tableConfig" />
|
||||||
|
<ReportDialog :visible.sync="visible" :url="reportUrl" />
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import GenericListTable from '@/layout/components/GenericListTable/index.vue'
|
import GenericListTable from '@/layout/components/GenericListTable/index.vue'
|
||||||
import { openTaskPage } from '@/utils/jms'
|
import { openTaskPage } from '@/utils/jms'
|
||||||
import { DetailFormatter } from '@/components/Table/TableFormatters'
|
import { DetailFormatter } from '@/components/Table/TableFormatters'
|
||||||
|
import ReportDialog from '@/components/Dialog/ReportDialog.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AccountBackupExecutionList',
|
name: 'AccountBackupExecutionList',
|
||||||
components: {
|
components: {
|
||||||
GenericListTable
|
GenericListTable,
|
||||||
|
ReportDialog
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
object: {
|
object: {
|
||||||
@ -20,7 +25,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
const vm = this
|
||||||
return {
|
return {
|
||||||
|
visible: false,
|
||||||
|
reportUrl: '',
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
url: '/api/v1/accounts/account-backup-plan-executions/',
|
url: '/api/v1/accounts/account-backup-plan-executions/',
|
||||||
columns: [
|
columns: [
|
||||||
@ -87,7 +95,8 @@ export default {
|
|||||||
type: 'success',
|
type: 'success',
|
||||||
can: this.$hasPerm('accounts.view_backupaccountexecution'),
|
can: this.$hasPerm('accounts.view_backupaccountexecution'),
|
||||||
callback: function({ row }) {
|
callback: function({ row }) {
|
||||||
window.open(`/api/v1/accounts/account-backup-plan-executions/${row.id}/report/`)
|
vm.visible = true
|
||||||
|
vm.reportUrl = `/api/v1/accounts/account-backup-plan-executions/${row.id}/report/`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -1,19 +1,27 @@
|
|||||||
<template>
|
<template>
|
||||||
<GenericListTable :header-actions="headerActions" :table-config="tableConfig" />
|
<div>
|
||||||
|
<GenericListTable :header-actions="headerActions" :table-config="tableConfig" />
|
||||||
|
<ReportDialog :visible.sync="visible" :url="reportUrl" />
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import GenericListTable from '@/layout/components/GenericListTable/index.vue'
|
import GenericListTable from '@/layout/components/GenericListTable/index.vue'
|
||||||
import { openTaskPage } from '@/utils/jms'
|
import { openTaskPage } from '@/utils/jms'
|
||||||
import { DetailFormatter } from '@/components/Table/TableFormatters'
|
import { DetailFormatter } from '@/components/Table/TableFormatters'
|
||||||
|
import ReportDialog from '@/components/Dialog/ReportDialog.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AccountChangeSecretExecutionList',
|
name: 'AccountChangeSecretExecutionList',
|
||||||
components: {
|
components: {
|
||||||
|
ReportDialog,
|
||||||
GenericListTable
|
GenericListTable
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
const vm = this
|
||||||
return {
|
return {
|
||||||
|
visible: false,
|
||||||
|
reportUrl: '',
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
url: '/api/v1/accounts/change-secret-executions',
|
url: '/api/v1/accounts/change-secret-executions',
|
||||||
columns: [
|
columns: [
|
||||||
@ -72,12 +80,6 @@ export default {
|
|||||||
status: {
|
status: {
|
||||||
label: this.$t('Result')
|
label: this.$t('Result')
|
||||||
},
|
},
|
||||||
timedelta: {
|
|
||||||
label: this.$t('TimeDelta'),
|
|
||||||
formatter: function(row) {
|
|
||||||
return row.timedelta.toFixed(2) + 's'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
actions: {
|
actions: {
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
hasDelete: false,
|
hasDelete: false,
|
||||||
@ -99,7 +101,8 @@ export default {
|
|||||||
type: 'success',
|
type: 'success',
|
||||||
can: this.$hasPerm('accounts.view_changesecretexecution'),
|
can: this.$hasPerm('accounts.view_changesecretexecution'),
|
||||||
callback: function({ row }) {
|
callback: function({ row }) {
|
||||||
window.open(`/api/v1/accounts/change-secret-executions/${row.id}/report/`)
|
vm.visible = true
|
||||||
|
vm.reportUrl = `/api/v1/accounts/change-secret-executions/${row.id}/report/`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -67,8 +67,8 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
createSuccessNextRoute: { name: 'AccountDiscoverList' },
|
createSuccessNextRoute: { name: 'AccountDiscover' },
|
||||||
updateSuccessNextRoute: { name: 'AccountDiscoverList' },
|
updateSuccessNextRoute: { name: 'AccountDiscover' },
|
||||||
cleanFormValue(values) {
|
cleanFormValue(values) {
|
||||||
values.interval = values.interval || null
|
values.interval = values.interval || null
|
||||||
return values
|
return values
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<GenericListTable :header-actions="headerActions" :table-config="tableConfig" />
|
<GenericListTable :header-actions="headerActions" :table-config="tableConfig" />
|
||||||
|
<ReportDialog :visible.sync="visible" :url="reportUrl" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -11,10 +12,12 @@ import { openTaskPage } from '@/utils/jms'
|
|||||||
import { DetailFormatter } from '@/components/Table/TableFormatters'
|
import { DetailFormatter } from '@/components/Table/TableFormatters'
|
||||||
import { taskStatusFormatterMeta } from '@/components/const'
|
import { taskStatusFormatterMeta } from '@/components/const'
|
||||||
import TaskStatusChoicesFormatter from '@/components/Table/TableFormatters/TaskStatusFormatter.vue'
|
import TaskStatusChoicesFormatter from '@/components/Table/TableFormatters/TaskStatusFormatter.vue'
|
||||||
|
import ReportDialog from '@/components/Dialog/ReportDialog.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AccountDiscoverTaskExecutionList',
|
name: 'AccountDiscoverTaskExecutionList',
|
||||||
components: {
|
components: {
|
||||||
|
ReportDialog,
|
||||||
GenericListTable
|
GenericListTable
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
@ -25,7 +28,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
const vm = this
|
||||||
return {
|
return {
|
||||||
|
visible: false,
|
||||||
|
reportUrl: '',
|
||||||
showTableUpdateDrawer: false,
|
showTableUpdateDrawer: false,
|
||||||
currentTemplate: null,
|
currentTemplate: null,
|
||||||
drawerTitle: '',
|
drawerTitle: '',
|
||||||
@ -72,13 +78,6 @@ export default {
|
|||||||
id: ({ row }) => row.automation,
|
id: ({ row }) => row.automation,
|
||||||
can: this.$hasPerm('accounts.view_gatheraccountsexecution')
|
can: this.$hasPerm('accounts.view_gatheraccountsexecution')
|
||||||
},
|
},
|
||||||
timedelta: {
|
|
||||||
label: this.$t('TimeDelta'),
|
|
||||||
formatter: function(row) {
|
|
||||||
return row.timedelta.toFixed(2) + 's'
|
|
||||||
},
|
|
||||||
width: null
|
|
||||||
},
|
|
||||||
date_start: {
|
date_start: {
|
||||||
width: null
|
width: null
|
||||||
},
|
},
|
||||||
@ -102,7 +101,8 @@ export default {
|
|||||||
type: 'success',
|
type: 'success',
|
||||||
can: this.$hasPerm('accounts.view_gatheraccountsexecution'),
|
can: this.$hasPerm('accounts.view_gatheraccountsexecution'),
|
||||||
callback: function({ row }) {
|
callback: function({ row }) {
|
||||||
window.open(`/api/v1/accounts/gather-account-executions/${row.id}/report/`)
|
vm.visible = true
|
||||||
|
vm.reportUrl = `/api/v1/accounts/gather-account-executions/${row.id}/report/`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -27,7 +27,7 @@ export default {
|
|||||||
component: () => import('@/views/accounts/AccountDiscover/AccountDiscoverList.vue')
|
component: () => import('@/views/accounts/AccountDiscover/AccountDiscoverList.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('AccountDiscoverTask'),
|
title: this.$t('AccountDiscover'),
|
||||||
name: 'AccountDiscoverTaskList',
|
name: 'AccountDiscoverTaskList',
|
||||||
hidden: !this.$hasPerm('accounts.view_gatheraccountsautomation'),
|
hidden: !this.$hasPerm('accounts.view_gatheraccountsautomation'),
|
||||||
component: () => import('@/views/accounts/AccountDiscover/AccountDiscoverTaskList.vue')
|
component: () => import('@/views/accounts/AccountDiscover/AccountDiscoverTaskList.vue')
|
||||||
|
@ -1,24 +1,32 @@
|
|||||||
<template>
|
<template>
|
||||||
<GenericListTable
|
<div>
|
||||||
ref="listTable"
|
<GenericListTable
|
||||||
:detail-drawer="detailDrawer"
|
ref="listTable"
|
||||||
:header-actions="headerActions"
|
:detail-drawer="detailDrawer"
|
||||||
:table-config="tableConfig"
|
:header-actions="headerActions"
|
||||||
/>
|
:table-config="tableConfig"
|
||||||
|
/>
|
||||||
|
<ReportDialog :visible.sync="visible" :url="reportUrl" />
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import GenericListTable from '@/layout/components/GenericListTable/index.vue'
|
import GenericListTable from '@/layout/components/GenericListTable/index.vue'
|
||||||
import { openTaskPage } from '@/utils/jms'
|
import { openTaskPage } from '@/utils/jms'
|
||||||
import { DetailFormatter } from '@/components/Table/TableFormatters'
|
import { DetailFormatter } from '@/components/Table/TableFormatters'
|
||||||
|
import ReportDialog from '@/components/Dialog/ReportDialog'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AccountPushExecutionList',
|
name: 'AccountPushExecutionList',
|
||||||
components: {
|
components: {
|
||||||
GenericListTable
|
GenericListTable,
|
||||||
|
ReportDialog
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
const vm = this
|
||||||
return {
|
return {
|
||||||
|
visible: false,
|
||||||
|
reportUrl: '',
|
||||||
detailDrawer: () => import('@/views/accounts/AccountPush/AccountPushExecutionDetail/index.vue'),
|
detailDrawer: () => import('@/views/accounts/AccountPush/AccountPushExecutionDetail/index.vue'),
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
url: '/api/v1/accounts/push-account-executions',
|
url: '/api/v1/accounts/push-account-executions',
|
||||||
@ -78,12 +86,6 @@ export default {
|
|||||||
status: {
|
status: {
|
||||||
label: this.$t('Result')
|
label: this.$t('Result')
|
||||||
},
|
},
|
||||||
timedelta: {
|
|
||||||
label: this.$t('TimeDelta'),
|
|
||||||
formatter: function(row) {
|
|
||||||
return row.timedelta.toFixed(2) + 's'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
actions: {
|
actions: {
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
hasDelete: false,
|
hasDelete: false,
|
||||||
@ -104,7 +106,8 @@ export default {
|
|||||||
title: this.$t('Report'),
|
title: this.$t('Report'),
|
||||||
can: this.$hasPerm('accounts.view_pushaccountexecution'),
|
can: this.$hasPerm('accounts.view_pushaccountexecution'),
|
||||||
callback: function({ row }) {
|
callback: function({ row }) {
|
||||||
window.open(`/api/v1/accounts/push-account-executions/${row.id}/report/`)
|
vm.visible = true
|
||||||
|
vm.reportUrl = `/api/v1/accounts/push-account-executions/${row.id}/report/`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -11,17 +11,10 @@
|
|||||||
width="80%"
|
width="80%"
|
||||||
@close="loading=true"
|
@close="loading=true"
|
||||||
>
|
>
|
||||||
<!-- <ListTable v-bind="config" />-->
|
|
||||||
<span v-if="loading" v-loading="loading" class="loading" />
|
<span v-if="loading" v-loading="loading" class="loading" />
|
||||||
<iframe :src="url" frameborder="0" @load="onIframeLoad" />
|
<iframe title="dialog" :src="url" style="border: none;" @load="onIframeLoad" />
|
||||||
</Dialog>
|
</Dialog>
|
||||||
<!-- <RemoveAccount-->
|
|
||||||
<!-- v-if="showDeleteAccountDialog"-->
|
|
||||||
<!-- :accounts="gatherAccounts"-->
|
|
||||||
<!-- :visible.sync="showDeleteAccountDialog"-->
|
|
||||||
<!-- />-->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -83,8 +76,6 @@ export default {
|
|||||||
beforeMount() {
|
beforeMount() {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onVisibleChange() {
|
|
||||||
},
|
|
||||||
onIframeLoad() {
|
onIframeLoad() {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}
|
}
|
||||||
|
@ -239,7 +239,7 @@ export function getDefaultConfig(vm) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'DiscoverAccounts',
|
name: 'DiscoverAccounts',
|
||||||
title: 'Discover accounts',
|
title: vm.$t('AccountDiscover'),
|
||||||
callback: ({ row }) => {
|
callback: ({ row }) => {
|
||||||
vm.discoveryDialog.asset = row.id
|
vm.discoveryDialog.asset = row.id
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<BaseList :table-config="tableConfig" v-bind="config" />
|
<BaseList
|
||||||
|
:table-config="tableConfig"
|
||||||
|
:header-actions="headerActions"
|
||||||
|
v-bind="config"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -17,6 +21,13 @@ export default {
|
|||||||
},
|
},
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
columnsExclude: ['date_verified']
|
columnsExclude: ['date_verified']
|
||||||
|
},
|
||||||
|
headerActions: {
|
||||||
|
handleImportClick: ({ selectedRows }) => {
|
||||||
|
this.$message.warning({
|
||||||
|
message: this.$t('ImportMessage')
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<GenericListTable ref="listTable" :header-actions="headerActions" :table-config="tableConfig" />
|
<div>
|
||||||
|
<GenericListTable ref="listTable" :header-actions="headerActions" :table-config="tableConfig" />
|
||||||
|
<ReportDialog :visible.sync="visible" :url="reportUrl" />
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import GenericListTable from '@/layout/components/GenericListTable'
|
import GenericListTable from '@/layout/components/GenericListTable'
|
||||||
import { openTaskPage } from '@/utils/jms'
|
import { openTaskPage } from '@/utils/jms'
|
||||||
import { DetailFormatter } from '@/components/Table/TableFormatters'
|
import { DetailFormatter } from '@/components/Table/TableFormatters'
|
||||||
|
import ReportDialog from '@/components/Dialog/ReportDialog.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'CheckAccountExecutionList',
|
name: 'CheckAccountExecutionList',
|
||||||
components: {
|
components: {
|
||||||
|
ReportDialog,
|
||||||
GenericListTable
|
GenericListTable
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
@ -20,7 +25,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
const vm = this
|
||||||
return {
|
return {
|
||||||
|
visible: false,
|
||||||
|
reportUrl: '',
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
url: '/api/v1/accounts/check-account-executions/',
|
url: '/api/v1/accounts/check-account-executions/',
|
||||||
columns: [
|
columns: [
|
||||||
@ -97,7 +105,8 @@ export default {
|
|||||||
type: 'success',
|
type: 'success',
|
||||||
can: this.$hasPerm('accounts.view_checkaccountexecution'),
|
can: this.$hasPerm('accounts.view_checkaccountexecution'),
|
||||||
callback: function({ row }) {
|
callback: function({ row }) {
|
||||||
window.open(`/api/v1/accounts/check-account-executions/${row.id}/report/`)
|
vm.visible = true
|
||||||
|
vm.reportUrl = `/api/v1/accounts/check-account-executions/${row.id}/report/`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user