mirror of
https://github.com/jumpserver/lina.git
synced 2025-11-08 19:02:40 +00:00
Compare commits
99 Commits
revert-519
...
v4.10.9-lt
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16a92d10bc | ||
|
|
9611eb9c73 | ||
|
|
a2bbb6555b | ||
|
|
ddd25208d8 | ||
|
|
fe8db5831b | ||
|
|
0c29ade399 | ||
|
|
f8b2840d89 | ||
|
|
52a18c3c35 | ||
|
|
ace9cdcd68 | ||
|
|
7098c2266e | ||
|
|
58d3489c33 | ||
|
|
396d20f31e | ||
|
|
c8b866412a | ||
|
|
63b163e382 | ||
|
|
e1acc642ca | ||
|
|
e3f4cc68d2 | ||
|
|
983aff62f2 | ||
|
|
26e1ffdbdd | ||
|
|
7b568ec84f | ||
|
|
73d6bda8c3 | ||
|
|
3934b45367 | ||
|
|
0c5e84d1e3 | ||
|
|
18a3f42717 | ||
|
|
68030d98b2 | ||
|
|
a861f77609 | ||
|
|
e58ec6057c | ||
|
|
7ab20c5885 | ||
|
|
e47ddb5355 | ||
|
|
56aa3caa83 | ||
|
|
19b1dc0dbc | ||
|
|
77ef172a23 | ||
|
|
4596887bf1 | ||
|
|
0a3dc30c85 | ||
|
|
51d24bc8e5 | ||
|
|
1b15a4d043 | ||
|
|
7d3f818242 | ||
|
|
4e26f18d77 | ||
|
|
b22613617a | ||
|
|
e971cbf4a8 | ||
|
|
4672abae35 | ||
|
|
ba36d72602 | ||
|
|
4bfbbba4c5 | ||
|
|
ea038ce43a | ||
|
|
e16b19666c | ||
|
|
c7f5409eb6 | ||
|
|
fdbd7d2222 | ||
|
|
ddbaeeafea | ||
|
|
efb0e9dacb | ||
|
|
f6f8301ad5 | ||
|
|
9a63ae63d4 | ||
|
|
1e007ccda3 | ||
|
|
d1d0b06b53 | ||
|
|
5fb70d2f24 | ||
|
|
b54a95430f | ||
|
|
4d8b4c45af | ||
|
|
a6d642df60 | ||
|
|
2e74f1522f | ||
|
|
fe615e0314 | ||
|
|
09f734e6fc | ||
|
|
3117046342 | ||
|
|
b68aecb5cc | ||
|
|
1c9b155d97 | ||
|
|
75b1be9864 | ||
|
|
615c3c1cf4 | ||
|
|
4d82231af4 | ||
|
|
c6cf6571b6 | ||
|
|
8ea990d070 | ||
|
|
f4a32170d5 | ||
|
|
073508675e | ||
|
|
1d6ca0a93a | ||
|
|
36aea652d6 | ||
|
|
1a42ce90ab | ||
|
|
31a401b55d | ||
|
|
582a84178d | ||
|
|
9b9f7c936c | ||
|
|
2a6100957f | ||
|
|
16606d6a27 | ||
|
|
0a612f50e6 | ||
|
|
fe36fa9390 | ||
|
|
ba109900ec | ||
|
|
ec7768267f | ||
|
|
cc58b374ab | ||
|
|
04ffbb8fd6 | ||
|
|
49880f6739 | ||
|
|
e6f98d58c4 | ||
|
|
fd1f16d43c | ||
|
|
968b2415b1 | ||
|
|
776090d6ba | ||
|
|
3a37952288 | ||
|
|
62b8fc0e3b | ||
|
|
b2028869cb | ||
|
|
5277a725f8 | ||
|
|
f137788c1a | ||
|
|
f7d17c8de7 | ||
|
|
feea70b0be | ||
|
|
04696ef3d6 | ||
|
|
1731f4f788 | ||
|
|
6f25d93909 | ||
|
|
46461ec324 |
@@ -16,7 +16,7 @@
|
||||
<th>{{ $tc('Example') }}</th>
|
||||
</tr>
|
||||
<tr v-for="(item, index) in variables" :key="index">
|
||||
<td :title="$tc('ClickCopy')" class="item-td text-link" @click="onCopy(item.key)">
|
||||
<td :title="$tc('ClickCopy')" class="item-td text-link" @click="onCopy(item.name)">
|
||||
<label class="item-label">{{ item.name }}</label>
|
||||
</td>
|
||||
<td><span>{{ item.label }}</span></td>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<echarts
|
||||
<Echart
|
||||
ref="echarts"
|
||||
:options="options"
|
||||
:autoresize="true"
|
||||
@@ -12,9 +12,10 @@
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import * as echarts from 'echarts'
|
||||
import { mix } from '@/utils/theme/color'
|
||||
import Echart from '@/components/Dashboard/Echart.vue'
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
components: { Echart },
|
||||
props: {
|
||||
datesMetrics: {
|
||||
type: Array,
|
||||
|
||||
@@ -34,18 +34,32 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (!window.totalCharts) {
|
||||
window.totalCharts = 0
|
||||
if (!window._echarts) {
|
||||
window._echarts = {
|
||||
total: new Set(),
|
||||
finished: new Set()
|
||||
}
|
||||
}
|
||||
// 唯一 id,避免重复计数
|
||||
this._chartId = `chart_${Date.now()}_${Math.random().toString(36).slice(2)}`
|
||||
window._echarts.total.add(this._chartId)
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (window._echarts) {
|
||||
window._echarts.total.delete(this._chartId)
|
||||
window._echarts.finished.delete(this._chartId)
|
||||
// 可选:当没有图表时清理全局对象
|
||||
if (window._echarts.total.size === 0) {
|
||||
delete window._echarts
|
||||
delete window.echartsFinished
|
||||
}
|
||||
}
|
||||
window.totalCharts++
|
||||
},
|
||||
methods: {
|
||||
onFinished() {
|
||||
if (!window.finishedCharts) {
|
||||
window.finishedCharts = 0
|
||||
}
|
||||
window.finishedCharts++
|
||||
if (window.finishedCharts === window.totalCharts) {
|
||||
if (!window._echarts) return
|
||||
window._echarts.finished.add(this._chartId)
|
||||
if (window._echarts.finished.size === window._echarts.total.size) {
|
||||
window.echartsFinished = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<echarts
|
||||
<Echart
|
||||
ref="echarts"
|
||||
:options="options"
|
||||
:autoresize="true"
|
||||
@@ -14,9 +14,11 @@
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import * as echarts from 'echarts'
|
||||
import { mix } from '@/utils/theme/color'
|
||||
import Echart from '@/components/Dashboard/Echart.vue'
|
||||
|
||||
export default {
|
||||
name: 'LoginMetric',
|
||||
components: { Echart },
|
||||
props: {
|
||||
range: {
|
||||
type: String,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<echarts
|
||||
<Echart
|
||||
ref="echarts"
|
||||
:options="options"
|
||||
:autoresize="true"
|
||||
@@ -13,8 +13,10 @@
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import * as echarts from 'echarts'
|
||||
import { mix } from '@/utils/theme/color'
|
||||
import Echart from '@/components/Dashboard/Echart.vue'
|
||||
|
||||
export default {
|
||||
components: { Echart },
|
||||
props: {
|
||||
colors: {
|
||||
type: Array,
|
||||
@@ -35,14 +37,15 @@ export default {
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
return {}
|
||||
},
|
||||
computed: {
|
||||
options() {
|
||||
const seriesList = []
|
||||
const labels = this.data.map(item => item.label)
|
||||
const total = _.sumBy(this.data, function(i) { return i.total })
|
||||
const total = _.sumBy(this.data, function(i) {
|
||||
return i.total
|
||||
})
|
||||
for (let i = 0, len = this.data.length; i < len; i++) {
|
||||
const current = this.data[i]
|
||||
let num = (current.total / total) * 100
|
||||
@@ -177,8 +180,8 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.echarts {
|
||||
width: 100%;
|
||||
height: 72px;
|
||||
}
|
||||
.echarts {
|
||||
width: 100%;
|
||||
height: 72px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<echarts
|
||||
<Echart
|
||||
ref="echarts"
|
||||
:autoresize="true"
|
||||
:options="options"
|
||||
@@ -13,12 +13,15 @@ import 'echarts/lib/chart/line'
|
||||
import 'echarts/lib/component/legend'
|
||||
|
||||
import Decimal from 'decimal.js'
|
||||
import Echart from '@/components/Dashboard/Echart.vue'
|
||||
|
||||
export default {
|
||||
components: { Echart },
|
||||
props: {
|
||||
config: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
default: () => {
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
@@ -244,10 +244,12 @@ export default {
|
||||
delete routeFilter.search
|
||||
}
|
||||
const asFilterTags = _.cloneDeep(this.filterTags)
|
||||
this.filterTags = {
|
||||
...asFilterTags,
|
||||
...routeFilter
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.filterTags = {
|
||||
...asFilterTags,
|
||||
...routeFilter
|
||||
}
|
||||
}, 100)
|
||||
},
|
||||
getValueLabel(key, value) {
|
||||
for (const field of this.options) {
|
||||
|
||||
@@ -221,7 +221,7 @@ export default {
|
||||
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
|
||||
.el-button {
|
||||
|
||||
@@ -6,6 +6,7 @@ import ptBrLocale from 'elementui-lts/lib/locale/lang/pt-br'
|
||||
import esLocale from 'elementui-lts/lib/locale/lang/es'
|
||||
import ruLocale from 'elementui-lts/lib/locale/lang/ru-RU'
|
||||
import koLocale from 'elementui-lts/lib/locale/lang/ko'
|
||||
import viLocale from 'elementui-lts/lib/locale/lang/vi'
|
||||
import zh from './zh.json'
|
||||
import zhHant from './zh_hant.json'
|
||||
import en from './en.json'
|
||||
@@ -39,6 +40,9 @@ const messages = {
|
||||
},
|
||||
ko: {
|
||||
...koLocale
|
||||
},
|
||||
vi: {
|
||||
...viLocale
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ export default [
|
||||
component: () => import('@/views/reports/audits/Dashboard.vue'), // Parent router-view
|
||||
name: 'AuditsReport',
|
||||
meta: {
|
||||
permissions: ['rbac.view_audits'],
|
||||
permissions: ['rbac.view_audit'],
|
||||
expanded: true,
|
||||
icon: 'user-o',
|
||||
title: i18n.t('AuditsReport')
|
||||
|
||||
@@ -739,3 +739,7 @@ div.el-loading-parent--relative {
|
||||
.margin-top-20 {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.el-message {
|
||||
z-index: 999999 !important;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// 鼠标可移入tooltip功能
|
||||
import { Table } from 'element-ui'
|
||||
import { getCell, getColumnByCell } from 'element-ui/packages/table/src/util'
|
||||
import { getStyle, hasClass } from 'element-ui/src/utils/dom'
|
||||
import { Table } from 'elementui-lts'
|
||||
import { getCell, getColumnByCell } from 'elementui-lts/packages/table/src/util'
|
||||
import { getStyle, hasClass } from 'elementui-lts/src/utils/dom'
|
||||
import { copy } from '../common/index'
|
||||
|
||||
Object.assign(Table.components.TableBody.methods, {
|
||||
|
||||
@@ -107,6 +107,10 @@ export default {
|
||||
data.secret = data[secretType]
|
||||
delete data[secretType]
|
||||
}
|
||||
|
||||
if (data.ssh_key_change_strategy === 'add') {
|
||||
data.ssh_key_change_strategy = this.initial.ssh_key_change_strategy
|
||||
}
|
||||
return data
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,6 +117,10 @@ export default {
|
||||
data.secret = data[secretType]
|
||||
delete data[secretType]
|
||||
}
|
||||
|
||||
if (data.ssh_key_change_strategy === 'add') {
|
||||
data.ssh_key_change_strategy = this.initial.ssh_key_change_strategy
|
||||
}
|
||||
return data
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import i18n from '@/i18n/i18n'
|
||||
|
||||
const accountExistCache = new Map()
|
||||
|
||||
async function checkAccountExist(username, asset) {
|
||||
@@ -8,9 +9,10 @@ async function checkAccountExist(username, asset) {
|
||||
}
|
||||
const url = `/api/v1/accounts/accounts/?username=${encodeURIComponent(username)}&asset=${asset}`
|
||||
const data = await this.$axios.get(url)
|
||||
const result = data.length > 0
|
||||
accountExistCache.set(cacheKey, result)
|
||||
return result
|
||||
const results = data
|
||||
const isExist = results.length > 0
|
||||
accountExistCache.set(cacheKey, isExist)
|
||||
return isExist
|
||||
}
|
||||
|
||||
async function checkAccountsExist() {
|
||||
|
||||
@@ -18,16 +18,13 @@ export default {
|
||||
return {
|
||||
initial: {},
|
||||
fields: [
|
||||
[this.$t('Basic'), ['name', 'priority']],
|
||||
[this.$t('Basic'), ['name']],
|
||||
[this.$t('Users'), ['users']],
|
||||
[this.$t('ConnectMethod'), ['connect_methods']],
|
||||
[this.$t('Action'), ['action', 'reviewers']],
|
||||
[this.$t('Other'), ['is_active', 'comment']]
|
||||
],
|
||||
fieldsMeta: {
|
||||
priority: {
|
||||
rules: [rules.Required]
|
||||
},
|
||||
assets: assetJSONSelectMeta(this),
|
||||
users: userJSONSelectMeta(this, true),
|
||||
connect_methods: {
|
||||
|
||||
@@ -34,7 +34,7 @@ export default {
|
||||
key: this.$t('Reviewer'),
|
||||
value: this.object.reviewers.map(item => item.name).join(', ')
|
||||
},
|
||||
'priority', 'date_created', 'created_by', 'comment'
|
||||
'date_created', 'created_by', 'comment'
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -17,8 +17,31 @@ export default {
|
||||
columnsShow: {
|
||||
min: ['name', 'actions'],
|
||||
default: [
|
||||
'name', 'priority', 'is_active', 'comment', 'actions'
|
||||
'name', 'is_active', 'comment', 'actions'
|
||||
]
|
||||
},
|
||||
columnsMeta: {
|
||||
'connect_methods': {
|
||||
width: '240px',
|
||||
formatter: (row) => {
|
||||
const methods = Array.isArray(row.connect_methods) ? row.connect_methods : []
|
||||
const colors = ['success', 'warning', 'info', 'danger']
|
||||
|
||||
return (
|
||||
<div style='display: flex; flex-wrap: wrap; gap: 4px;'>
|
||||
{methods.map((item, idx) => (
|
||||
<el-tag
|
||||
key={idx}
|
||||
size='small'
|
||||
type={colors[idx % colors.length]}
|
||||
>
|
||||
{item}
|
||||
</el-tag>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
headerActions: {
|
||||
|
||||
@@ -181,10 +181,10 @@ export default {
|
||||
try {
|
||||
const res = await this.$axios.get(this.tableConfig.url)
|
||||
|
||||
if (res && res.results) {
|
||||
if (res) {
|
||||
this.transObject = {
|
||||
...this.object,
|
||||
gateways: res.results.map(item => {
|
||||
gateways: res.map(item => {
|
||||
return {
|
||||
name: item.name,
|
||||
id: item.id
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<div class="chart-container-title">
|
||||
<div class="chart-container-title-text">{{ $t('TaskExecutionTrends') }}</div>
|
||||
<div class="chart">
|
||||
<echarts
|
||||
<Echart
|
||||
:options="ExecutionMetricsOptions"
|
||||
:autoresize="true"
|
||||
/>
|
||||
@@ -52,6 +52,7 @@ import BaseReport from '../base/BaseReport.vue'
|
||||
import SummaryCountCard from '@/components/Dashboard/SummaryCountCard.vue'
|
||||
import SwitchDate from '@/components/Dashboard/SwitchDate.vue'
|
||||
import * as echarts from 'echarts'
|
||||
import Echart from '@/components/Dashboard/Echart.vue'
|
||||
import AccountSummary from '@/views/reports/pam/ChangeSecret/AccountSummary.vue'
|
||||
import RiskSummary from '@/views/reports/pam/Dashboard/RiskSummary.vue'
|
||||
|
||||
@@ -61,7 +62,8 @@ export default {
|
||||
AccountSummary,
|
||||
SwitchDate,
|
||||
SummaryCountCard,
|
||||
BaseReport
|
||||
BaseReport,
|
||||
Echart
|
||||
},
|
||||
props: {
|
||||
nav: {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<div class="chart-container-title">
|
||||
<div class="chart-container-title-text">{{ $t('AccountCreationSourceDistribution') }}</div>
|
||||
<div class="chart">
|
||||
<echarts
|
||||
<Echart
|
||||
:options="SourceOptions"
|
||||
:autoresize="true"
|
||||
/>
|
||||
@@ -31,7 +31,7 @@
|
||||
<div class="chart-container-title">
|
||||
<div class="chart-container-title-text">{{ $t('AccountConnectivityStatusDistribution') }}</div>
|
||||
<div class="chart">
|
||||
<echarts
|
||||
<Echart
|
||||
:options="ConnectivityOptions"
|
||||
:autoresize="true"
|
||||
/>
|
||||
@@ -42,7 +42,7 @@
|
||||
<div class="chart-container-title">
|
||||
<div class="chart-container-title-text">{{ $t('AccountPasswordChangeTrends') }}</div>
|
||||
<div class="chart">
|
||||
<echarts
|
||||
<Echart
|
||||
:options="ChangeSecretOptions"
|
||||
:autoresize="true"
|
||||
/>
|
||||
@@ -70,6 +70,7 @@
|
||||
import BaseReport from '../base/BaseReport.vue'
|
||||
import SummaryCountCard from '@/components/Dashboard/SummaryCountCard.vue'
|
||||
import * as echarts from 'echarts'
|
||||
import Echart from '@/components/Dashboard/Echart.vue'
|
||||
import { mixColors } from '@/views/reports/const'
|
||||
import RankTable from '@/views/reports/users/components/RankTable.vue'
|
||||
|
||||
@@ -77,7 +78,8 @@ export default {
|
||||
components: {
|
||||
RankTable,
|
||||
SummaryCountCard,
|
||||
BaseReport
|
||||
BaseReport,
|
||||
Echart
|
||||
},
|
||||
props: {
|
||||
nav: {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<div class="chart-container-title">
|
||||
<div class="chart-container-title-text">{{ $t('DistributionOfAssetLoginMethods') }}</div>
|
||||
<div class="chart">
|
||||
<echarts
|
||||
<Echart
|
||||
:options="LoginEntryOptions"
|
||||
:autoresize="true"
|
||||
/>
|
||||
@@ -40,7 +40,7 @@
|
||||
<div class="chart-container-title">
|
||||
<div class="chart-container-title-text">{{ $t('RemoteLoginProtocolUsageDistribution') }}</div>
|
||||
<div class="chart">
|
||||
<echarts
|
||||
<Echart
|
||||
:options="LoginProtocolOptions"
|
||||
:autoresize="true"
|
||||
/>
|
||||
@@ -52,7 +52,7 @@
|
||||
<div class="chart-container-title">
|
||||
<div class="chart-container-title-text">{{ $t('OperatingSystemDistributionOfLoginAssets') }}</div>
|
||||
<div class="chart">
|
||||
<echarts
|
||||
<Echart
|
||||
:options="LoginOSOptions"
|
||||
:autoresize="true"
|
||||
/>
|
||||
@@ -64,7 +64,7 @@
|
||||
<div class="chart-container-title">
|
||||
<div class="chart-container-title-text">{{ $t('AssetLoginTrends') }}</div>
|
||||
<div class="chart">
|
||||
<echarts
|
||||
<Echart
|
||||
ref="loginTrend"
|
||||
:options="loginTrendOptions"
|
||||
:autoresize="true"
|
||||
@@ -83,6 +83,7 @@ import BaseReport from '@/views/reports/base/BaseReport.vue'
|
||||
import SummaryCountCard from '@/components/Dashboard/SummaryCountCard.vue'
|
||||
import UserAssetActivity from '@/views/reports/console/UserAssetActivity.vue'
|
||||
import * as echarts from 'echarts'
|
||||
import Echart from '@/components/Dashboard/Echart.vue'
|
||||
import { mixColors } from '@/views/reports/const'
|
||||
|
||||
export default {
|
||||
@@ -90,7 +91,8 @@ export default {
|
||||
UserAssetActivity,
|
||||
SummaryCountCard,
|
||||
BaseReport,
|
||||
SwitchDate
|
||||
SwitchDate,
|
||||
Echart
|
||||
},
|
||||
props: {
|
||||
nav: {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<div class="chart-container-title">
|
||||
<div class="chart-container-title-text">{{ $t('AssetTypeDistribution') }}</div>
|
||||
<div class="chart">
|
||||
<echarts
|
||||
<Echart
|
||||
:options="AssetTypeOptions"
|
||||
:autoresize="true"
|
||||
/>
|
||||
@@ -31,7 +31,7 @@
|
||||
<div class="chart-container-title">
|
||||
<div class="chart-container-title-text">{{ $t('WeeklyGrowthTrend') }}</div>
|
||||
<div class="chart">
|
||||
<echarts
|
||||
<Echart
|
||||
:options="AddedAssetOptions"
|
||||
:autoresize="true"
|
||||
/>
|
||||
@@ -47,12 +47,14 @@
|
||||
import BaseReport from '../base/BaseReport.vue'
|
||||
import SummaryCountCard from '@/components/Dashboard/SummaryCountCard.vue'
|
||||
import * as echarts from 'echarts'
|
||||
import Echart from '@/components/Dashboard/Echart.vue'
|
||||
import { mixColors } from '@/views/reports/const'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
SummaryCountCard,
|
||||
BaseReport
|
||||
BaseReport,
|
||||
Echart
|
||||
},
|
||||
props: {
|
||||
nav: {
|
||||
|
||||
@@ -52,17 +52,20 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async getMetricData() {
|
||||
const url = `/api/v1/index/?dates_metrics=1&days=${this.days}`
|
||||
const data = await this.$axios.get(url)
|
||||
const activeUsers = data?.dates_metrics_total_count_active_users
|
||||
const activeAssets = data?.dates_metrics_total_count_active_assets
|
||||
this.lineChartConfig.datesMetrics = data.dates_metrics_date
|
||||
if (activeUsers.length > 0) {
|
||||
this.lineChartConfig.primaryData = activeUsers
|
||||
}
|
||||
if (activeAssets.length > 0) {
|
||||
this.lineChartConfig.secondaryData = activeAssets
|
||||
}
|
||||
setTimeout(() => {
|
||||
const url = `/api/v1/index/?dates_metrics=1&days=${this.days}`
|
||||
this.$axios.get(url).then(data => {
|
||||
const activeUsers = data?.dates_metrics_total_count_active_users
|
||||
const activeAssets = data?.dates_metrics_total_count_active_assets
|
||||
this.lineChartConfig.datesMetrics = data.dates_metrics_date
|
||||
if (activeUsers.length > 0) {
|
||||
this.lineChartConfig.primaryData = activeUsers
|
||||
}
|
||||
if (activeAssets.length > 0) {
|
||||
this.lineChartConfig.secondaryData = activeAssets
|
||||
}
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,17 +60,20 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async getMetricData() {
|
||||
const url = `/api/v1/accounts/change-secret-dashboard/?daily_success_and_failure_metrics=1&days=${this.days}`
|
||||
const data = await this.$axios.get(url)
|
||||
const success = data?.dates_metrics_total_count_success
|
||||
const failed = data?.dates_metrics_total_count_failed
|
||||
this.lineChartConfig.datesMetrics = data?.dates_metrics_date
|
||||
if (success.length > 0) {
|
||||
this.lineChartConfig.primaryData = success
|
||||
}
|
||||
if (failed.length > 0) {
|
||||
this.lineChartConfig.secondaryData = failed
|
||||
}
|
||||
setTimeout(() => {
|
||||
const url = `/api/v1/accounts/change-secret-dashboard/?daily_success_and_failure_metrics=1&days=${this.days}`
|
||||
this.$axios.get(url).then(data => {
|
||||
const success = data?.dates_metrics_total_count_success
|
||||
const failed = data?.dates_metrics_total_count_failed
|
||||
this.lineChartConfig.datesMetrics = data?.dates_metrics_date
|
||||
if (success.length > 0) {
|
||||
this.lineChartConfig.primaryData = success
|
||||
}
|
||||
if (failed.length > 0) {
|
||||
this.lineChartConfig.secondaryData = failed
|
||||
}
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<div class="chart-content">
|
||||
<!-- eslint-disable-next-line -->
|
||||
<echarts ref="chartRef" :options="chartOption" :autoresize="true" />
|
||||
<Echart ref="chartRef" :options="chartOption" :autoresize="true"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -14,6 +14,7 @@
|
||||
<script>
|
||||
import Title from '@/components/Dashboard/Title.vue'
|
||||
import * as echarts from 'echarts'
|
||||
import Echart from '@/components/Dashboard/Echart.vue'
|
||||
import 'echarts/lib/chart/pie'
|
||||
import 'echarts/lib/component/tooltip'
|
||||
import 'echarts/lib/component/title'
|
||||
@@ -21,7 +22,7 @@ import 'echarts/lib/component/legend'
|
||||
|
||||
export default {
|
||||
name: 'MissionSummery',
|
||||
components: { Title },
|
||||
components: { Title, Echart },
|
||||
data() {
|
||||
return {
|
||||
config: {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<div class="chart-container-title">
|
||||
<div class="chart-container-title-text">{{ $t('UserModificationTrends') }}</div>
|
||||
<div class="chart">
|
||||
<echarts
|
||||
<Echart
|
||||
:options="UserModificationOptions"
|
||||
:autoresize="true"
|
||||
/>
|
||||
@@ -55,13 +55,15 @@ import BaseReport from '../base/BaseReport.vue'
|
||||
import SummaryCountCard from '@/components/Dashboard/SummaryCountCard.vue'
|
||||
import { mixColors } from '@/views/reports/const'
|
||||
import * as echarts from 'echarts'
|
||||
import Echart from '@/components/Dashboard/Echart.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
SummaryCountCard,
|
||||
RankTable,
|
||||
BaseReport,
|
||||
SwitchDate
|
||||
SwitchDate,
|
||||
Echart
|
||||
},
|
||||
props: {
|
||||
nav: {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
v-if="visible"
|
||||
:show-cancel="false"
|
||||
:show-confirm="false"
|
||||
:title="$tc('Msg Template')"
|
||||
:title="$tc('EmailTemplate')"
|
||||
:visible.sync="visible"
|
||||
width="70%"
|
||||
@confirm="onConfirm()"
|
||||
|
||||
@@ -43,6 +43,7 @@ export default {
|
||||
},
|
||||
localValue(val) {
|
||||
this.$emit('input', val)
|
||||
this.$emit('htmlChange', this.html)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,18 +34,16 @@ export default {
|
||||
const vm = this
|
||||
return {
|
||||
initial: {
|
||||
EMAIL_TEMPLATE_NAME: localStorage.getItem('selectTemplateName') || 'terminal/_msg_session_sharing.html'
|
||||
template_name: localStorage.getItem('selectTemplateName') || 'terminal/_msg_session_sharing.html'
|
||||
},
|
||||
helpText: this.$t('EmailHelpText'),
|
||||
encryptedFields: ['EMAIL_HOST_PASSWORD'],
|
||||
fields: [
|
||||
[this.$t('Basic'), [
|
||||
'EMAIL_TEMPLATE_NAME',
|
||||
'EMAIL_TEMPLATE_CONTENT'
|
||||
'template_name',
|
||||
'template_content'
|
||||
]]
|
||||
],
|
||||
fieldsMeta: {
|
||||
EMAIL_TEMPLATE_NAME: {
|
||||
template_name: {
|
||||
label: this.$t('Name'),
|
||||
helpTextFormatter: () => {
|
||||
const handleClick = () => {
|
||||
@@ -70,7 +68,7 @@ export default {
|
||||
this.variables = item.contexts
|
||||
this.source = item.source
|
||||
updateForm({
|
||||
EMAIL_TEMPLATE_CONTENT: item.content.trimStart()
|
||||
template_content: item.content.trimStart()
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -80,19 +78,28 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
EMAIL_TEMPLATE_CONTENT: {
|
||||
component: MarkDownEditor
|
||||
template_content: {
|
||||
component: MarkDownEditor,
|
||||
on: {
|
||||
htmlChange: ([html]) => {
|
||||
vm.html = html
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
templates: [],
|
||||
successUrl: { name: 'Msg' },
|
||||
showHelpDialog: false,
|
||||
variables: [],
|
||||
html: '',
|
||||
source: 'original',
|
||||
selectTemplateName: '',
|
||||
variablesHelpText: '您可以选择一个模板在模板内容中使用 {{ key }} 读取内置变量,注意:只支持 {{ }} 语法,其他语法不支持。例如 {% if title %}',
|
||||
variablesHelpText: this.$t('TemplateVariablesHelpText'),
|
||||
hasSaveContinue: false,
|
||||
onPerformError() {
|
||||
},
|
||||
performSubmit(validValues) {
|
||||
validValues['render_html'] = vm.html
|
||||
return this.$axios['patch']('/api/v1/notifications/templates/edit/', validValues).then(res => {
|
||||
this.$router.push({ name: 'Msg', query: { t: new Date().getTime() } })
|
||||
})
|
||||
@@ -103,7 +110,6 @@ export default {
|
||||
type: 'default',
|
||||
// hidden: () => this.source === 'original',
|
||||
callback: (value, form, btn) => {
|
||||
console.log(value, form, btn)
|
||||
return this.$axios['post']('/api/v1/notifications/templates/reset/', { template_name: this.selectTemplateName }).then(
|
||||
() => {
|
||||
this.$router.push({ name: 'Msg', query: { t: new Date().getTime() } })
|
||||
@@ -128,7 +134,7 @@ export default {
|
||||
this.$axios.get('/api/v1/notifications/templates/').then(data => {
|
||||
if (data.length > 0) {
|
||||
this.templates = data
|
||||
this.fieldsMeta.EMAIL_TEMPLATE_NAME.el.options = data.map(item => ({
|
||||
this.fieldsMeta.template_name.el.options = data.map(item => ({
|
||||
label: item.subject,
|
||||
value: item.template_name
|
||||
}))
|
||||
|
||||
@@ -26,7 +26,7 @@ export default {
|
||||
hidden: !this.$hasPerm('settings.change_email')
|
||||
},
|
||||
{
|
||||
title: this.$t('Msg Template'),
|
||||
title: this.$t('MsgTemplate'),
|
||||
name: 'MsgTemplate',
|
||||
hidden: !this.$hasPerm('settings.change_email') || !this.$store.getters.hasValidLicense
|
||||
},
|
||||
|
||||
@@ -50,20 +50,25 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async initialSelect() {
|
||||
const commandOptions = await getAllCommandStorage()
|
||||
commandOptions.forEach(item => {
|
||||
this.fieldsMeta.command_storage.options.push({ label: item.name, value: item.name })
|
||||
})
|
||||
const replayOptions = await getAllReplayStorage()
|
||||
replayOptions.forEach(item => {
|
||||
if (item.type.value === 'sftp') return
|
||||
this.fieldsMeta.replay_storage.options.push({ label: item.name, value: item.name })
|
||||
})
|
||||
try {
|
||||
const commandOptions = await getAllCommandStorage()
|
||||
const replayOptions = await getAllReplayStorage()
|
||||
|
||||
if (commandOptions) {
|
||||
commandOptions.forEach(item => {
|
||||
this.fieldsMeta.command_storage.options.push({ label: item.name, value: item.name })
|
||||
})
|
||||
}
|
||||
if (replayOptions) {
|
||||
replayOptions.forEach(item => {
|
||||
if (item.type.value === 'sftp') return
|
||||
this.fieldsMeta.replay_storage.options.push({ label: item.name, value: item.name })
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user