merge: with remote

This commit is contained in:
ibuler
2024-06-24 15:04:40 +08:00
14 changed files with 70 additions and 18 deletions

View File

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

View File

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

View File

@@ -82,6 +82,7 @@
</template>
<script>
import Dialog from '@/components/Dialog/index.vue'
import { encryptPassword } from '@/utils/crypto'
export default {
name: 'UserConfirmDialog',
@@ -203,7 +204,7 @@ export default {
const data = {
confirm_type: this.confirmTypeRequired,
mfa_type: this.confirmTypeRequired === 'mfa' ? this.subTypeSelected : '',
secret_key: this.secretValue
secret_key: this.confirmTypeRequired === 'password' ? encryptPassword(this.secretValue) : this.secretValue
}
this.$axios.post(`/api/v1/authentication/confirm/`, data).then(() => {

View File

@@ -150,5 +150,4 @@ export default {
</script>
<style scoped>
</style>

View File

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

View File

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

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;
}
&.dameng_ico_docu {
background: url('./icons/dameng.png') no-repeat center left transparent;
}
&.private_ico_docu {
background: url('./icons/private.png') no-repeat center left transparent;
}

View File

@@ -225,6 +225,30 @@ export default {
getUrlQuery: false
},
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',
title: this.$t('DisableSelected'),

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_running = data?.total_count_job_logs_running
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
}
}

View File

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

View File

@@ -66,7 +66,16 @@ export default {
},
methods: {
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() {
return {
config: {
initial: {
},
initial: {},
url: '/api/v1/orgs/orgs/',
fields: [
['', ['name', 'comment']]
],
hasSaveContinue: false,
fieldsMeta: {
},
fieldsMeta: {},
onPerformSuccess(res, method) {
const orderParams = { params: { order: '-date_created' }}
switch (method) {
case 'post':
this.$store.dispatch('users/addAdminOrg', { id: res.id, name: res.name })
this.$message.success(this.$tc('CreateSuccessMsg'))
return this.$router.push({ name: 'OrganizationList' })
return this.$router.push({ name: 'OrganizationList', ...orderParams })
case 'put':
this.$store.dispatch('users/modifyOrg', { id: res.id, name: res.name })
this.$message.success(this.$tc('UpdateSuccessMsg'))
return this.$router.push({ name: 'OrganizationList' })
return this.$router.push({ name: 'OrganizationList', ...orderParams })
}
}
}

View File

@@ -134,6 +134,14 @@ export default {
canCreate: this.$hasPerm('tickets.view_ticket'),
hasBulkDelete: false,
searchConfig: {
default: {
state: {
key: 'state',
label: this.$t('tickets.action'),
value: 'pending',
valueLabel: this.$t('common.Open')
}
},
exclude: ['id', 'title', 'type', 'applicant'],
options: [
{
@@ -181,7 +189,7 @@ export default {
},
{
value: 'relevant_command',
label: this.$t('RelevantSystemUser')
label: this.$t('ApplyRunCommand')
}
]
},