mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-13 19:35:24 +00:00
Compare commits
8 Commits
v3.10.18-l
...
v3.10.19
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61c56d2cc8 | ||
|
|
81b3c79ac1 | ||
|
|
710fa9c109 | ||
|
|
b3a3ca13a7 | ||
|
|
e04abd8b79 | ||
|
|
e3a207f7b6 | ||
|
|
40379ac761 | ||
|
|
33862c716e |
@@ -72,7 +72,6 @@
|
||||
"vue-i18n": "^8.15.5",
|
||||
"vue-json-editor": "^1.4.3",
|
||||
"vue-markdown": "^2.2.4",
|
||||
"vue-moment": "^4.1.0",
|
||||
"vue-password-strength-meter": "^1.7.2",
|
||||
"vue-router": "3.0.6",
|
||||
"vue-select": "^3.9.5",
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
class="text edit-input"
|
||||
@blur="onEditBlur"
|
||||
/>
|
||||
<span v-if="realValue" class="action">
|
||||
<span class="action">
|
||||
<template v-for="(item, index) in iActions">
|
||||
<el-tooltip
|
||||
v-if="item.has"
|
||||
|
||||
@@ -81,7 +81,7 @@ export default {
|
||||
},
|
||||
{
|
||||
label: this.$t('common.Version'),
|
||||
value: 'version-dev'
|
||||
value: 'v3.10.19'
|
||||
},
|
||||
{
|
||||
label: this.$t('common.PermissionCompany'),
|
||||
|
||||
@@ -24,6 +24,8 @@ import { message } from '@/utils/message'
|
||||
import xss from '@/utils/xss'
|
||||
import request from '@/utils/request'
|
||||
import ElTableTooltipPatch from '@/utils/elTableTooltipPatch.js'
|
||||
import moment from 'moment'
|
||||
moment.locale('zh-cn')
|
||||
|
||||
/**
|
||||
* If you don't want to use mock-server
|
||||
@@ -50,11 +52,7 @@ Vue.config.productionTip = false
|
||||
Vue.use(VueCookie)
|
||||
window.$cookie = VueCookie
|
||||
|
||||
const moment = require('moment')
|
||||
require('moment/locale/zh-cn')
|
||||
Vue.use(require('vue-moment'), {
|
||||
moment
|
||||
})
|
||||
Vue.prototype.$moment = moment
|
||||
|
||||
Vue.use(VueLogger, loggerOptions)
|
||||
|
||||
|
||||
@@ -90,10 +90,20 @@ function ifBadRequest({ response, error }) {
|
||||
}
|
||||
}
|
||||
|
||||
export function logout() {
|
||||
window.location.href = `${process.env.VUE_APP_LOGOUT_PATH}?next=${location.pathname}`
|
||||
}
|
||||
|
||||
export function flashErrorMsg({ response, error }) {
|
||||
if (!response.config.disableFlashErrorMsg) {
|
||||
const responseErrorMsg = getErrorResponseMsg(error)
|
||||
const msg = responseErrorMsg || error.message
|
||||
|
||||
if (response.status === 403 && msg === 'CSRF Failed: CSRF token missing.') {
|
||||
setTimeout(() => {
|
||||
logout()
|
||||
}, 1000)
|
||||
}
|
||||
message({
|
||||
message: msg,
|
||||
type: 'error',
|
||||
|
||||
@@ -122,9 +122,53 @@ export default {
|
||||
return {
|
||||
name: 'AccountChangeSecretCreate'
|
||||
}
|
||||
}
|
||||
},
|
||||
extraMoreActions: [
|
||||
{
|
||||
name: 'BatchDisable',
|
||||
title: this.$t('common.BatchDisable'),
|
||||
icon: 'fa fa-ban',
|
||||
can: ({ selectedRows }) => selectedRows.length > 0 && this.$hasPerm('accounts.change_changesecretautomation'),
|
||||
callback: ({ selectedRows, reloadTable }) => this.bulkDisableCallback(selectedRows, reloadTable)
|
||||
},
|
||||
{
|
||||
name: 'BatchActivate',
|
||||
title: this.$t('common.BatchActivate'),
|
||||
icon: 'fa fa-check-circle-o',
|
||||
can: ({ selectedRows }) => selectedRows.length > 0 && this.$hasPerm('accounts.change_changesecretautomation'),
|
||||
callback: ({ selectedRows, reloadTable }) => this.bulkActivateCallback(selectedRows, reloadTable)
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
bulkDisableCallback(selectedRows, reloadTable) {
|
||||
const url = '/api/v1/accounts/change-secret-automations/'
|
||||
const data = selectedRows.map(row => {
|
||||
return { id: row.id, is_active: false }
|
||||
})
|
||||
if (data.length === 0) return
|
||||
this.$axios.patch(url, data).then(() => {
|
||||
reloadTable()
|
||||
this.$message.success(this.$t('common.disableSuccessMsg'))
|
||||
}).catch(error => {
|
||||
this.$message.error(this.$t('common.updateError') + ' ' + error)
|
||||
})
|
||||
},
|
||||
bulkActivateCallback(selectedRows, reloadTable) {
|
||||
const url = '/api/v1/accounts/change-secret-automations/'
|
||||
const data = selectedRows.map(row => {
|
||||
return { id: row.id, is_active: true }
|
||||
})
|
||||
if (data.length === 0) return
|
||||
this.$axios.patch(url, data).then(() => {
|
||||
reloadTable()
|
||||
this.$message.success(this.$t('common.activateSuccessMsg'))
|
||||
}).catch(error => {
|
||||
this.$message.error(this.$t('common.updateError') + ' ' + error)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -127,9 +127,58 @@ export default {
|
||||
headerActions: {
|
||||
hasRefresh: true,
|
||||
hasExport: false,
|
||||
hasImport: false
|
||||
hasImport: false,
|
||||
createRoute: () => {
|
||||
return {
|
||||
name: 'AccountPushCreate'
|
||||
}
|
||||
},
|
||||
extraMoreActions: [
|
||||
{
|
||||
name: 'BatchDisable',
|
||||
title: this.$t('common.BatchDisable'),
|
||||
icon: 'fa fa-ban',
|
||||
can: ({ selectedRows }) => selectedRows.length > 0 && this.$hasPerm('accounts.change_pushaccountautomation'),
|
||||
callback: ({ selectedRows, reloadTable }) => this.bulkDisableCallback(selectedRows, reloadTable)
|
||||
},
|
||||
{
|
||||
name: 'BatchActivate',
|
||||
title: this.$t('common.BatchActivate'),
|
||||
icon: 'fa fa-check-circle-o',
|
||||
can: ({ selectedRows }) => selectedRows.length > 0 && this.$hasPerm('accounts.change_pushaccountautomation'),
|
||||
callback: ({ selectedRows, reloadTable }) => this.bulkActivateCallback(selectedRows, reloadTable)
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
bulkDisableCallback(selectedRows, reloadTable) {
|
||||
const url = '/api/v1/accounts/push-account-automations/'
|
||||
const data = selectedRows.map(row => {
|
||||
return { id: row.id, is_active: false }
|
||||
})
|
||||
if (data.length === 0) return
|
||||
this.$axios.patch(url, data).then(() => {
|
||||
reloadTable()
|
||||
this.$message.success(this.$t('common.disableSuccessMsg'))
|
||||
}).catch(error => {
|
||||
this.$message.error(this.$t('common.updateError') + ' ' + error)
|
||||
})
|
||||
},
|
||||
bulkActivateCallback(selectedRows, reloadTable) {
|
||||
const url = '/api/v1/accounts/push-account-automations/'
|
||||
const data = selectedRows.map(row => {
|
||||
return { id: row.id, is_active: true }
|
||||
})
|
||||
if (data.length === 0) return
|
||||
this.$axios.patch(url, data).then(() => {
|
||||
reloadTable()
|
||||
this.$message.success(this.$t('common.activateSuccessMsg'))
|
||||
}).catch(error => {
|
||||
this.$message.error(this.$t('common.updateError') + ' ' + error)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -20,7 +20,8 @@ export const platformFieldsMeta = (vm) => {
|
||||
'change_secret_enabled', 'change_secret_method', 'change_secret_params',
|
||||
'push_account_enabled', 'push_account_method', 'push_account_params',
|
||||
'verify_account_enabled', 'verify_account_method', 'verify_account_params',
|
||||
'gather_accounts_enabled', 'gather_accounts_method', 'gather_accounts_params'
|
||||
'gather_accounts_enabled', 'gather_accounts_method', 'gather_accounts_params',
|
||||
'remove_account_enabled', 'remove_account_method', 'remove_account_params'
|
||||
],
|
||||
fieldsMeta: {
|
||||
ansible_config: {
|
||||
@@ -28,12 +29,15 @@ export const platformFieldsMeta = (vm) => {
|
||||
hidden: (formValue) => !formValue['ansible_enabled']
|
||||
},
|
||||
gather_facts_enabled: {},
|
||||
remove_account_enabled: {},
|
||||
ping_method: {},
|
||||
ping_params: {
|
||||
label: ''
|
||||
},
|
||||
gather_facts_method: {},
|
||||
push_account_method: {},
|
||||
remove_account_method: {},
|
||||
remove_account_params: {},
|
||||
push_account_params: {
|
||||
label: ''
|
||||
},
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
<script>
|
||||
import { GenericCreateUpdatePage } from '@/layout/components'
|
||||
import AssetSelect from '@/components/Apps/AssetSelect'
|
||||
import { getDayFuture } from '@/utils/common'
|
||||
import AccountFormatter from './components/AccountFormatter'
|
||||
import { AllAccount } from '../const'
|
||||
import ProtocolsSelect from '@/components/Form/FormFields/AllOrSpec.vue'
|
||||
@@ -34,7 +33,6 @@ export default {
|
||||
initial: {
|
||||
is_active: true,
|
||||
date_start: new Date().toISOString(),
|
||||
date_expired: getDayFuture(25550, new Date()).toISOString(),
|
||||
nodes: nodesInitial,
|
||||
assets: assetsInitial,
|
||||
accounts: [AllAccount]
|
||||
|
||||
Reference in New Issue
Block a user