Merge pull request #4072 from jumpserver/dev

v3.10.11-lts
This commit is contained in:
Bryan 2024-06-19 16:04:12 +08:00 committed by GitHub
commit 0a3dc30c85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
21 changed files with 97 additions and 33 deletions

View File

@ -10,3 +10,4 @@ jobs:
- uses: jumpserver/action-generic-handler@master - uses: jumpserver/action-generic-handler@master
env: env:
GITHUB_TOKEN: ${{ secrets.PRIVATE_TOKEN }} GITHUB_TOKEN: ${{ secrets.PRIVATE_TOKEN }}
I18N_TOKEN: ${{ secrets.I18N_TOKEN }}

View File

@ -353,7 +353,7 @@ export default {
name: 'BulkVerify', name: 'BulkVerify',
title: this.$t('accounts.BulkVerify'), title: this.$t('accounts.BulkVerify'),
type: 'primary', type: 'primary',
fa: 'fa-handshake-o', fa: 'fa-link',
can: ({ selectedRows }) => { can: ({ selectedRows }) => {
return selectedRows.length > 0 && return selectedRows.length > 0 &&
['clickhouse', 'redis', 'website', 'chatgpt'].indexOf(selectedRows[0].asset.type.value) === -1 && ['clickhouse', 'redis', 'website', 'chatgpt'].indexOf(selectedRows[0].asset.type.value) === -1 &&

View File

@ -83,6 +83,10 @@ export default {
type: String, type: String,
default: '' default: ''
}, },
type: {
type: String,
default: 'account'
},
title: { title: {
type: String, type: String,
default: function() { default: function() {
@ -136,7 +140,8 @@ export default {
name: this.secretInfo.name, name: this.secretInfo.name,
secret: encryptPassword(this.modifiedSecret) secret: encryptPassword(this.modifiedSecret)
} }
this.$axios.patch(`/api/v1/accounts/accounts/${this.account.id}/`, params).then(() => { const url = this.type === 'account' ? `/api/v1/accounts/accounts` : `/api/v1/accounts/account-templates`
this.$axios.patch(`${url}/${this.account.id}/`, params).then(() => {
this.$message.success(this.$tc('common.updateSuccessMsg')) this.$message.success(this.$tc('common.updateSuccessMsg'))
}) })
}, },

View File

@ -7,18 +7,11 @@
</el-radio> </el-radio>
</el-form-item> </el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="2">
{{ this.$t('common.CronTab.from') }}
<el-input-number v-model="cycle01" :max="60" :min="0" size="mini" /> -
<el-input-number v-model="cycle02" :max="60" :min="0" size="mini" /> {{ this.$t('common.CronTab.min') }}
</el-radio>
</el-form-item>
<el-form-item> <el-form-item>
<el-radio v-model="radioValue" :label="3"> <el-radio v-model="radioValue" :label="3">
{{ this.$t('common.CronTab.from') }} {{ this.$t('common.CronTab.from') }}
<el-input-number v-model="average02" :max="60" :min="1" size="mini" /> {{ this.$t('common.CronTab.min') }}{{ this.$t('common.CronTab.executeOnce') }} <el-input-number v-model="average02" :max="60" :min="1" size="mini" />
{{ this.$t('common.CronTab.min') }}{{ this.$t('common.CronTab.executeOnce') }}
</el-radio> </el-radio>
</el-form-item> </el-form-item>
@ -33,7 +26,7 @@
size="small" size="small"
style="width:100%" style="width:100%"
> >
<el-option v-for="item in 60" :key="item" :value="item-1">{{ item-1 }}</el-option> <el-option v-for="item in 60" :key="item" :value="item-1">{{ item - 1 }}</el-option>
</el-select> </el-select>
</el-radio> </el-radio>
</el-form-item> </el-form-item>
@ -158,7 +151,7 @@ export default {
</script> </script>
<style scoped> <style scoped>
.el-form-item--small.el-form-item { .el-form-item--small.el-form-item {
margin-bottom: 10px; margin-bottom: 10px;
} }
</style> </style>

View File

@ -225,9 +225,6 @@ export default {
handler(newValue, oldValue) { handler(newValue, oldValue) {
}, },
deep: true deep: true
},
iOptions(val) {
this.remote = val.length !== 0
} }
}, },
async mounted() { async mounted() {

View File

@ -64,7 +64,7 @@ export default {
} }
return text return text
} }
return '-' return this.items?.distribution || '-'
} }
} }
} }

View File

@ -27,7 +27,7 @@
</a> </a>
<a <a
v-if="formatterArgs.showEditBtn" v-if="formatterArgs.showEditBtn"
class="edit-btn" :class="[{ 'disabled-link': this.$store.getters.currentOrgIsRoot },'edit-btn']"
style="padding-left: 5px" style="padding-left: 5px"
@click="showDialog = true" @click="showDialog = true"
> >
@ -269,4 +269,11 @@ export default {
.tag-tip { .tag-tip {
margin-top: 10px; margin-top: 10px;
} }
.disabled-link {
pointer-events: none;
color: grey;
cursor: default;
text-decoration: none;
}
</style> </style>

View File

@ -126,6 +126,7 @@ export default {
filterTags: { filterTags: {
handler() { handler() {
this.$emit('tag-search', this.filterMaps) this.$emit('tag-search', this.filterMaps)
this.$eventBus.$emit('TagSearch', this.filterMaps)
}, },
deep: true deep: true
}, },

View File

@ -721,6 +721,7 @@
"BatchActivate": "Batch activate", "BatchActivate": "Batch activate",
"SyncSelected": "Sync selected", "SyncSelected": "Sync selected",
"bulkDeploy": "Bulk deploy", "bulkDeploy": "Bulk deploy",
"BulkVerify": "Bulk verify",
"bulkDeleteErrorMsg": "Bulk delete failed: ", "bulkDeleteErrorMsg": "Bulk delete failed: ",
"bulkDeleteSuccessMsg": "Bulk delete success", "bulkDeleteSuccessMsg": "Bulk delete success",
"bulkRemoveErrorMsg": "Bulk remove failed: ", "bulkRemoveErrorMsg": "Bulk remove failed: ",

View File

@ -717,6 +717,7 @@
"SyncSuccessMsg": "同期に成功しました", "SyncSuccessMsg": "同期に成功しました",
"SyncSelected": "選択した同期", "SyncSelected": "選択した同期",
"bulkDeploy": "一括デプロイ", "bulkDeploy": "一括デプロイ",
"BulkVerify": "一括テスト",
"bulkSyncErrorMsg": "一括同期に失敗しました:", "bulkSyncErrorMsg": "一括同期に失敗しました:",
"bulkDeleteErrorMsg": "一括削除に失敗しました:", "bulkDeleteErrorMsg": "一括削除に失敗しました:",
"bulkDeleteSuccessMsg": "一括削除に成功しました", "bulkDeleteSuccessMsg": "一括削除に成功しました",

View File

@ -771,6 +771,7 @@
"BatchActivate": "批量激活", "BatchActivate": "批量激活",
"SyncSelected": "同步所选", "SyncSelected": "同步所选",
"bulkDeploy": "批量部署", "bulkDeploy": "批量部署",
"BulkVerify": "批量测试",
"bulkDeleteErrorMsg": "批量删除失败: ", "bulkDeleteErrorMsg": "批量删除失败: ",
"bulkDeleteSuccessMsg": "批量删除成功", "bulkDeleteSuccessMsg": "批量删除成功",
"bulkRemoveErrorMsg": "批量移除失败: ", "bulkRemoveErrorMsg": "批量移除失败: ",

View File

@ -771,6 +771,7 @@
"BatchActivate": "批次啟用", "BatchActivate": "批次啟用",
"SyncSelected": "同步所選", "SyncSelected": "同步所選",
"bulkDeploy": "批次部署", "bulkDeploy": "批次部署",
"BulkVerify": "批次測試",
"bulkDeleteErrorMsg": "批次刪除失敗: ", "bulkDeleteErrorMsg": "批次刪除失敗: ",
"bulkDeleteSuccessMsg": "批次刪除成功", "bulkDeleteSuccessMsg": "批次刪除成功",
"bulkRemoveErrorMsg": "批次移除失敗: ", "bulkRemoveErrorMsg": "批次移除失敗: ",

BIN
src/styles/icons/dameng.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -92,6 +92,10 @@
background: url('./icons/db2.png') no-repeat center left transparent; background: url('./icons/db2.png') no-repeat center left transparent;
} }
&.dameng_ico_docu {
background: url('./icons/dameng.png') no-repeat center left transparent;
}
&.private_ico_docu { &.private_ico_docu {
background: url('./icons/private.png') no-repeat center left transparent; background: url('./icons/private.png') no-repeat center left transparent;
} }

View File

@ -6,6 +6,7 @@
:account="account" :account="account"
:show-password-record="false" :show-password-record="false"
:url="secretUrl" :url="secretUrl"
type="template"
:visible.sync="showViewSecretDialog" :visible.sync="showViewSecretDialog"
/> />
</div> </div>

View File

@ -222,6 +222,30 @@ export default {
getUrlQuery: false getUrlQuery: false
}, },
extraMoreActions: [ extraMoreActions: [
{
name: 'BulkVerify',
title: this.$t('common.BulkVerify'),
type: 'primary',
icon: 'fa fa-link',
can: ({ selectedRows }) =>
this.$hasPerm('assets.test_assetconnectivity') &&
!this.$store.getters.currentOrgIsRoot &&
selectedRows.length > 0 &&
selectedRows[0].auto_config?.ansible_enabled &&
selectedRows[0].auto_config?.ping_enabled,
callback: function({ selectedRows }) {
const ids = selectedRows.map(v => {
return v.id
})
this.$axios.post(
'/api/v1/assets/assets/tasks/',
{ action: 'test', assets: ids }).then(res => {
openTaskPage(res['task'])
}).catch(err => {
this.$message.error(this.$tc('common.bulkVerifyErrorMsg' + ' ' + err))
})
}.bind(this)
},
{ {
name: 'DeactiveSelected', name: 'DeactiveSelected',
title: this.$t('common.BatchDisable'), title: this.$t('common.BatchDisable'),

View File

@ -100,7 +100,7 @@ export default {
this.data.total_count_job_logs = data?.total_count_job_logs this.data.total_count_job_logs = data?.total_count_job_logs
this.data.total_count_job_logs_running = data?.total_count_job_logs_running this.data.total_count_job_logs_running = data?.total_count_job_logs_running
this.data.total_count_job_logs_failed = data?.total_count_job_logs_failed this.data.total_count_job_logs_failed = data?.total_count_job_logs_failed
if (totalCountSession.length > 1) { if (totalCountSession.length > 0) {
this.chartConfig.secondaryData = totalCountSession this.chartConfig.secondaryData = totalCountSession
} }
} }

View File

@ -16,8 +16,7 @@ export default {
Title, Title,
LineChart LineChart
}, },
props: { props: {},
},
data() { data() {
return { return {
loading: false, loading: false,
@ -48,10 +47,10 @@ export default {
const activeUsers = data?.dates_metrics_total_count_active_users const activeUsers = data?.dates_metrics_total_count_active_users
const activeAssets = data?.dates_metrics_total_count_active_assets const activeAssets = data?.dates_metrics_total_count_active_assets
this.lineChartConfig.datesMetrics = data.dates_metrics_date this.lineChartConfig.datesMetrics = data.dates_metrics_date
if (activeUsers.length > 1) { if (activeUsers.length > 0) {
this.lineChartConfig.primaryData = activeUsers this.lineChartConfig.primaryData = activeUsers
} }
if (activeAssets.length > 1) { if (activeAssets.length > 0) {
this.lineChartConfig.secondaryData = activeAssets this.lineChartConfig.secondaryData = activeAssets
} }
} }
@ -64,6 +63,7 @@ export default {
margin-top: 16px; margin-top: 16px;
padding: 20px; padding: 20px;
background: #fff; background: #fff;
.head { .head {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

View File

@ -66,7 +66,16 @@ export default {
}, },
methods: { methods: {
async getResourcesCount() { async getResourcesCount() {
return this.$axios.get('/api/v1/index/?total_count=1') return this.$axios.get(
'/api/v1/index/',
{
params: {
total_count_online_sessions: 1,
total_count_online_users: 1,
total_count_today_failed_sessions: 1
}
}
)
} }
} }
} }

View File

@ -12,25 +12,24 @@ export default {
data() { data() {
return { return {
config: { config: {
initial: { initial: {},
},
url: '/api/v1/orgs/orgs/', url: '/api/v1/orgs/orgs/',
fields: [ fields: [
['', ['name', 'comment']] ['', ['name', 'comment']]
], ],
hasSaveContinue: false, hasSaveContinue: false,
fieldsMeta: { fieldsMeta: {},
},
onPerformSuccess(res, method) { onPerformSuccess(res, method) {
const order_params = { params: { order: '-date_created' }}
switch (method) { switch (method) {
case 'post': case 'post':
this.$store.dispatch('users/addAdminOrg', { id: res.id, name: res.name }) this.$store.dispatch('users/addAdminOrg', { id: res.id, name: res.name })
this.$message.success(this.$tc('common.createSuccessMsg')) this.$message.success(this.$tc('common.createSuccessMsg'))
return this.$router.push({ name: 'OrganizationList' }) return this.$router.push({ name: 'OrganizationList', ...order_params })
case 'put': case 'put':
this.$store.dispatch('users/modifyOrg', { id: res.id, name: res.name }) this.$store.dispatch('users/modifyOrg', { id: res.id, name: res.name })
this.$message.success(this.$tc('common.updateSuccessMsg')) this.$message.success(this.$tc('common.updateSuccessMsg'))
return this.$router.push({ name: 'OrganizationList' }) return this.$router.push({ name: 'OrganizationList', ...order_params })
} }
} }
} }

View File

@ -137,6 +137,14 @@ export default {
canCreate: this.$hasPerm('tickets.view_ticket'), canCreate: this.$hasPerm('tickets.view_ticket'),
hasBulkDelete: false, hasBulkDelete: false,
searchConfig: { searchConfig: {
default: {
state: {
key: 'state',
label: this.$t('tickets.action'),
value: 'pending',
valueLabel: this.$t('common.Open')
}
},
exclude: ['id', 'title', 'type', 'applicant'], exclude: ['id', 'title', 'type', 'applicant'],
options: [ options: [
{ {
@ -180,7 +188,7 @@ export default {
}, },
{ {
value: 'relevant_command', value: 'relevant_command',
label: this.$t('tickets.RelevantSystemUser') label: this.$t('tickets.ApplyRunCommand')
} }
] ]
}, },
@ -193,6 +201,9 @@ export default {
return Object.assign({}, this.defaultTicketActions, this.extraTicketAction) return Object.assign({}, this.defaultTicketActions, this.extraTicketAction)
} }
}, },
created() {
this.$eventBus.$on('TagSearch', this.handleTagSearchEvent)
},
mounted() { mounted() {
setTimeout(() => { setTimeout(() => {
this.loading = false this.loading = false
@ -201,6 +212,14 @@ export default {
methods: { methods: {
reloadTable() { reloadTable() {
this.$refs.ListPage.$refs.ListTable.$refs.ListTable.reloadTable() this.$refs.ListPage.$refs.ListTable.$refs.ListTable.reloadTable()
},
handleTagSearchEvent(tags) {
if (tags.hasOwnProperty('state')) {
const delimiter = this.url.indexOf('?') === -1 ? '?' : '&'
this.ticketTableConfig.url = `${this.url}${delimiter}state=${tags.state}`
} else {
this.ticketTableConfig.url = this.url
}
} }
} }
} }