Compare commits

...

24 Commits

Author SHA1 Message Date
“huailei000”
02d1ab25a0 fix: jQuery undefined 2022-10-13 17:41:29 +08:00
“huailei000”
5408057c05 perf: update jquery 2022-10-13 11:20:02 +08:00
feng626
bb640f63a3 Merge pull request #2096 from jumpserver/pr@v2.26@task_log
fix: 修复任务列表无法查看日志信息bug
2022-10-13 10:55:09 +08:00
feng626
7f0df48bb0 fix: 修复任务列表无法查看日志信息bug 2022-10-13 10:52:48 +08:00
“huailei000”
0225ea95fb pref: 作业中心任务详情添加查看输出快捷键 2022-10-12 19:13:28 +08:00
“huailei000”
c599a6aa21 fix: 修复全局组织下更新、删除:用户、端点、端点规则、组织权限 2022-09-26 14:51:57 +08:00
“huailei000”
7f34195ae4 fix: 实例同步列表不显示多选框;设置云同步详情页面的菜单高亮显示;云同步进入详情不主动激活detail页卡 2022-09-26 14:50:47 +08:00
“huailei000”
b23950aefd fix: 修复账号信息内容更新不及时问题 2022-09-26 14:49:34 +08:00
Jiangjie.Bai
49880f6739 Merge pull request #2059 from jumpserver/dev
v2.26.0
2022-09-15 17:49:44 +08:00
Jiangjie.Bai
e6f98d58c4 Merge pull request #2057 from jumpserver/dev
v2.26.0-rc4
2022-09-15 16:18:03 +08:00
Jiangjie.Bai
fd1f16d43c Merge pull request #2050 from jumpserver/dev
v2.26.0-rc2
2022-09-13 17:41:39 +08:00
Jiangjie.Bai
968b2415b1 Merge pull request #2043 from jumpserver/dev
v2.26.0-rc1
2022-09-08 15:46:44 +08:00
Jiangjie.Bai
776090d6ba Merge pull request #2001 from jumpserver/dev
v2.25.0
2022-08-18 16:12:45 +08:00
Jiangjie.Bai
3a37952288 Merge pull request #1996 from jumpserver/dev
v2.25.0-rc4
2022-08-17 16:53:23 +08:00
Jiangjie.Bai
62b8fc0e3b Merge pull request #1994 from jumpserver/dev
v2.25.0-rc3
2022-08-16 19:08:23 +08:00
Jiangjie.Bai
b2028869cb Merge pull request #1986 from jumpserver/dev
v2.25.0-rc2
2022-08-12 18:06:56 +08:00
Jiangjie.Bai
5277a725f8 Merge pull request #1973 from jumpserver/dev
v2.25.0-rc1
2022-08-11 14:11:59 +08:00
Jiangjie.Bai
f137788c1a Merge pull request #1957 from jumpserver/dev
v2.24.0-rc5
2022-07-20 19:06:03 +08:00
Jiangjie.Bai
f7d17c8de7 Merge pull request #1954 from jumpserver/dev
v2.24.0-rc4
2022-07-19 16:18:13 +08:00
Jiangjie.Bai
feea70b0be Merge pull request #1944 from jumpserver/dev
v2.24.0-rc3
2022-07-18 12:05:42 +08:00
Jiangjie.Bai
04696ef3d6 Merge pull request #1940 from jumpserver/dev
v2.24.0-rc2
2022-07-15 18:07:37 +08:00
Jiangjie.Bai
1731f4f788 Merge pull request #1934 from jumpserver/dev
v2.24.0-rc1
2022-07-14 18:27:51 +08:00
Jiangjie.Bai
6f25d93909 Merge pull request #1931 from jumpserver/dev
v2.24.0-rc1
2022-07-14 17:51:58 +08:00
Jiangjie.Bai
46461ec324 Merge pull request #1925 from jumpserver/dev
v2.24.0-rc1
2022-07-14 15:12:15 +08:00
18 changed files with 76 additions and 37 deletions

View File

@@ -32,7 +32,7 @@
"element-ui": "2.13.2", "element-ui": "2.13.2",
"eslint-plugin-html": "^6.0.0", "eslint-plugin-html": "^6.0.0",
"install": "^0.13.0", "install": "^0.13.0",
"jquery": "^3.5.0", "jquery": "^3.6.1",
"js-cookie": "2.2.0", "js-cookie": "2.2.0",
"jsencrypt": "^3.2.1", "jsencrypt": "^3.2.1",
"krry-transfer": "^1.7.3", "krry-transfer": "^1.7.3",

View File

@@ -15,6 +15,16 @@ export default [
permissions: [] permissions: []
} }
}, },
{
path: '/ops/ansible/task/:id/log/',
component: () => import('@/views/ops/CeleryTaskLog'),
name: 'AnsibleTaskLog',
hidden: true,
meta: {
title: i18n.t('route.CeleryTaskLog'),
permissions: []
}
},
{ {
path: '/ops/task/task/:id/log/', path: '/ops/task/task/:id/log/',
component: () => import('@/views/ops/CeleryTaskLog'), component: () => import('@/views/ops/CeleryTaskLog'),

View File

@@ -1,6 +1,8 @@
import empty from '@/layout/empty' import empty from '@/layout/empty'
import i18n from '@/i18n/i18n' import i18n from '@/i18n/i18n'
const activateMenu = '/console/assets/assets'
export default [ export default [
{ {
path: 'cloud', path: 'cloud',
@@ -20,7 +22,7 @@ export default [
hidden: true, hidden: true,
meta: { meta: {
title: i18n.t('xpack.Cloud.CloudSync'), title: i18n.t('xpack.Cloud.CloudSync'),
activeMenu: '/console/assets/assets' activeMenu: activateMenu
} }
}, },
{ {
@@ -71,6 +73,7 @@ export default [
hidden: true, hidden: true,
meta: { meta: {
title: i18n.t('xpack.Cloud.AccountDetail'), title: i18n.t('xpack.Cloud.AccountDetail'),
activeMenu: activateMenu,
permissions: ['xpack.view_account'] permissions: ['xpack.view_account']
} }
} }
@@ -121,7 +124,8 @@ export default [
name: 'SyncInstanceTaskDetail', name: 'SyncInstanceTaskDetail',
hidden: true, hidden: true,
meta: { meta: {
title: i18n.t('xpack.Cloud.SyncInstanceTaskDetail') title: i18n.t('xpack.Cloud.SyncInstanceTaskDetail'),
activeMenu: activateMenu
} }
} }
] ]

View File

@@ -302,3 +302,8 @@ export function groupedDropdownToCascader(group) {
export { BASE_URL } export { BASE_URL }
export function openWindow(url, name = '', iWidth = 900, iHeight = 600) {
var iTop = (window.screen.height - 30 - iHeight) / 2
var iLeft = (window.screen.width - 10 - iWidth) / 2
window.open(url, name, 'height=' + iHeight + ',width=' + iWidth + ',top=' + iTop + ',left=' + iLeft)
}

View File

@@ -1,8 +1,10 @@
import store from '@/store' import store from '@/store'
import { constantRoutes } from '@/router' import { constantRoutes } from '@/router'
import { openWindow } from './common'
export function openTaskPage(taskId) { export function openTaskPage(taskId, taskType) {
window.open(`/#/ops/celery/task/${taskId}/log/`, '', 'width=900,height=600') taskType = taskType || 'celery'
openWindow(`/#/ops/${taskType}/task/${taskId}/log/?type=${taskType}`)
} }
export function checkPermission(permsRequired, permsAll) { export function checkPermission(permsRequired, permsAll) {

View File

@@ -1,4 +1,4 @@
import $ from 'jquery' import $ from 'jquery/dist/jquery.min.js'
window.$ = $ window.$ = $
window.jQuery = $ window.jQuery = $
export default $ export default $

View File

@@ -38,6 +38,7 @@ export default {
}, },
tableConfig: { tableConfig: {
url: `/api/v1/xpack/cloud/sync-instance-tasks/${this.object.id}/instances/`, url: `/api/v1/xpack/cloud/sync-instance-tasks/${this.object.id}/instances/`,
hasSelection: false,
columns: [ columns: [
'instance_id', 'instance_id',
{ {

View File

@@ -58,10 +58,7 @@ export default {
formatter: DetailFormatter, formatter: DetailFormatter,
formatterArgs: { formatterArgs: {
permissions: 'xpack.view_syncinstancedetail', permissions: 'xpack.view_syncinstancedetail',
route: 'SyncInstanceTaskDetail', route: 'SyncInstanceTaskDetail'
routeQuery: {
activeTab: 'detail'
}
} }
}, },
history_count: { history_count: {

View File

@@ -6,6 +6,7 @@
import ListTable from '@/components/ListTable' import ListTable from '@/components/ListTable'
import { ActionsFormatter } from '@/components/TableFormatters' import { ActionsFormatter } from '@/components/TableFormatters'
import { toSafeLocalDateStr } from '@/utils/common' import { toSafeLocalDateStr } from '@/utils/common'
import { openTaskPage } from '@/utils/jms'
export default { export default {
name: 'AdhocExecutionHistory', name: 'AdhocExecutionHistory',
@@ -86,6 +87,14 @@ export default {
callback: function({ row, tableData }) { callback: function({ row, tableData }) {
return this.$router.push({ name: 'HistoryExecutionDetail', params: { id: row.id }}) return this.$router.push({ name: 'HistoryExecutionDetail', params: { id: row.id }})
} }
},
{
name: 'log',
title: this.$t('ops.output'),
type: 'info',
callback: function({ row }) {
openTaskPage(row.id, 'ansible')
}
} }
] ]
} }

View File

@@ -15,7 +15,6 @@ import DetailCard from '@/components/DetailCard'
import { toSafeLocalDateStr } from '@/utils/common' import { toSafeLocalDateStr } from '@/utils/common'
import RunInfoCard from '../../RunInfoCard' import RunInfoCard from '../../RunInfoCard'
import { toLastFailureDisplay, toLastSucessDisplay } from '../business' import { toLastFailureDisplay, toLastSucessDisplay } from '../business'
import { openTaskPage } from '@/utils/jms'
export default { export default {
name: 'HistoryExecutionDetail', name: 'HistoryExecutionDetail',
@@ -72,17 +71,6 @@ export default {
{ {
key: this.$t('ops.isSuccess'), key: this.$t('ops.isSuccess'),
value: this.object.is_success value: this.object.is_success
},
{
key: this.$t('ops.output'),
value: this.object.id,
formatter: function(row, value) {
const onClick = function() {
openTaskPage(value, 'ansible')
}
const title = this.$t('common.View')
return <a onClick={onClick} >{ title }</a>
}
} }
] ]
} }

View File

@@ -108,7 +108,7 @@ export default {
openTaskPage(value, 'ansible') openTaskPage(value, 'ansible')
} }
const title = this.$t('common.View') const title = this.$t('common.View')
return <a onClick={onClick} >{ title }</a> return <a class='text-link' onClick={onClick} >{ title }</a>
} }
} }
] ]

View File

@@ -6,6 +6,7 @@
import ListTable from '@/components/ListTable' import ListTable from '@/components/ListTable'
import { DetailFormatter } from '@/components/TableFormatters' import { DetailFormatter } from '@/components/TableFormatters'
import { toSafeLocalDateStr } from '@/utils/common' import { toSafeLocalDateStr } from '@/utils/common'
import { openTaskPage } from '@/utils/jms'
export default { export default {
name: 'TaskHistory', name: 'TaskHistory',
@@ -95,6 +96,14 @@ export default {
callback: function({ row, tableData }) { callback: function({ row, tableData }) {
return this.$router.push({ name: 'HistoryExecutionDetail', params: { id: row.id }}) return this.$router.push({ name: 'HistoryExecutionDetail', params: { id: row.id }})
} }
},
{
name: 'log',
title: this.$t('ops.output'),
type: 'info',
callback: function({ row }) {
openTaskPage(row.id, 'ansible')
}
} }
] ]
} }

View File

@@ -37,7 +37,8 @@ import DetailCard from '@/components/DetailCard'
import QuickActions from '@/components/QuickActions' import QuickActions from '@/components/QuickActions'
import UserConfirmDialog from '@/components/UserConfirmDialog' import UserConfirmDialog from '@/components/UserConfirmDialog'
import { toSafeLocalDateStr } from '@/utils/common' import { toSafeLocalDateStr } from '@/utils/common'
import store from '@/store' import { getProfile } from '@/api/users'
import { mapState } from 'vuex'
export default { export default {
name: 'ProfileInfo', name: 'ProfileInfo',
@@ -47,14 +48,9 @@ export default {
QuickActions, QuickActions,
UserConfirmDialog UserConfirmDialog
}, },
props: {
object: {
type: Object,
default: () => store.state.users.profile
}
},
data() { data() {
return { return {
object: this.userProfile || {},
url: `/api/v1/users/profile/`, url: `/api/v1/users/profile/`,
showPasswordDialog: false, showPasswordDialog: false,
currentEdit: '', currentEdit: '',
@@ -160,7 +156,7 @@ export default {
attrs: { attrs: {
disabled: true, disabled: true,
name: 'site_msg', name: 'site_msg',
model: this.object.receive_backends.indexOf('site_msg') !== -1 model: this.object?.receive_backends.indexOf('site_msg') !== -1
}, },
callbacks: { callbacks: {
change: this.updateUserReceiveBackends change: this.updateUserReceiveBackends
@@ -171,7 +167,7 @@ export default {
type: 'switcher', type: 'switcher',
attrs: { attrs: {
name: 'email', name: 'email',
model: this.object.receive_backends.indexOf('email') !== -1 model: this.object?.receive_backends.indexOf('email') !== -1
}, },
callbacks: { callbacks: {
change: this.updateUserReceiveBackends change: this.updateUserReceiveBackends
@@ -182,7 +178,7 @@ export default {
type: 'switcher', type: 'switcher',
attrs: { attrs: {
name: 'wecom', name: 'wecom',
model: this.object.receive_backends.indexOf('wecom') !== -1 model: this.object?.receive_backends.indexOf('wecom') !== -1
}, },
has: this.$store.getters.publicSettings.AUTH_WECOM, has: this.$store.getters.publicSettings.AUTH_WECOM,
callbacks: { callbacks: {
@@ -194,7 +190,7 @@ export default {
type: 'switcher', type: 'switcher',
attrs: { attrs: {
name: 'dingtalk', name: 'dingtalk',
model: this.object.receive_backends.indexOf('dingtalk') !== -1 model: this.object?.receive_backends.indexOf('dingtalk') !== -1
}, },
has: this.$store.getters.publicSettings.AUTH_DINGTALK, has: this.$store.getters.publicSettings.AUTH_DINGTALK,
callbacks: { callbacks: {
@@ -206,7 +202,7 @@ export default {
type: 'switcher', type: 'switcher',
attrs: { attrs: {
name: 'feishu', name: 'feishu',
model: this.object.receive_backends.indexOf('feishu') !== -1 model: this.object?.receive_backends.indexOf('feishu') !== -1
}, },
has: this.$store.getters.publicSettings.AUTH_FEISHU, has: this.$store.getters.publicSettings.AUTH_FEISHU,
callbacks: { callbacks: {
@@ -217,6 +213,9 @@ export default {
} }
}, },
computed: { computed: {
...mapState({
userProfile: state => state.users.profile
}),
detailCardItems() { detailCardItems() {
return [ return [
{ {
@@ -299,6 +298,12 @@ export default {
return url return url
} }
}, },
created() {
getProfile().then(res => {
this.object = res
this.$store.commit('users/SET_PROFILE', res)
})
},
methods: { methods: {
updateUserReceiveBackends(val) { updateUserReceiveBackends(val) {
this.$axios.patch( this.$axios.patch(

View File

@@ -60,6 +60,7 @@ export default {
actions: { actions: {
prop: 'id', prop: 'id',
formatterArgs: { formatterArgs: {
canUpdate: this.$hasPerm('orgs.change_organization'),
canDelete: function({ row }) { canDelete: function({ row }) {
return !row.is_default && vm.$hasPerm('orgs.delete_organization') return !row.is_default && vm.$hasPerm('orgs.delete_organization')
}, },

View File

@@ -39,9 +39,10 @@ export default {
}, },
actions: { actions: {
formatterArgs: { formatterArgs: {
canUpdate: this.$hasPerm('terminal.change_endpoint'),
updateRoute: 'EndpointUpdate', updateRoute: 'EndpointUpdate',
cloneRoute: 'EndpointCreate', cloneRoute: 'EndpointCreate',
canDelete: ({ row }) => row.id !== '00000000-0000-0000-0000-000000000001' canDelete: ({ row }) => row.id !== '00000000-0000-0000-0000-000000000001' && this.$hasPerm('terminal.delete_endpoint')
} }
} }
} }

View File

@@ -38,6 +38,7 @@ export default {
}, },
actions: { actions: {
formatterArgs: { formatterArgs: {
canUpdate: this.$hasPerm('terminal.change_endpointrule'),
updateRoute: 'EndpointRuleUpdate', updateRoute: 'EndpointRuleUpdate',
cloneRoute: 'EndpointRuleCreate' cloneRoute: 'EndpointRuleCreate'
} }

View File

@@ -115,6 +115,7 @@ export default {
actions: { actions: {
formatterArgs: { formatterArgs: {
hasDelete: hasDelete, hasDelete: hasDelete,
canUpdate: this.$hasPerm('users.change_user'),
extraActions: [ extraActions: [
{ {
title: this.$t('users.Remove'), title: this.$t('users.Remove'),

View File

@@ -6290,11 +6290,16 @@ jest@^23.6.0:
import-local "^1.0.0" import-local "^1.0.0"
jest-cli "^23.6.0" jest-cli "^23.6.0"
jquery@>=1.4.4, jquery@^3.5.0: jquery@>=1.4.4:
version "3.5.0" version "3.5.0"
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.5.0.tgz#9980b97d9e4194611c36530e7dc46a58d7340fc9" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.5.0.tgz#9980b97d9e4194611c36530e7dc46a58d7340fc9"
integrity sha512-Xb7SVYMvygPxbFMpTFQiHh1J7HClEaThguL15N/Gg37Lri/qKyhRGZYzHRyLH8Stq3Aow0LsHO2O2ci86fCrNQ== integrity sha512-Xb7SVYMvygPxbFMpTFQiHh1J7HClEaThguL15N/Gg37Lri/qKyhRGZYzHRyLH8Stq3Aow0LsHO2O2ci86fCrNQ==
jquery@^3.6.1:
version "3.6.1"
resolved "https://registry.npmmirror.com/jquery/-/jquery-3.6.1.tgz#fab0408f8b45fc19f956205773b62b292c147a16"
integrity sha512-opJeO4nCucVnsjiXOE+/PcCgYw9Gwpvs/a6B1LL/lQhwWwpbVEVYDZ1FokFr8PRc7ghYlrFPuyHuiiDNTQxmcw==
js-base64@^2.1.9: js-base64@^2.1.9:
version "2.5.2" version "2.5.2"
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.5.2.tgz#313b6274dda718f714d00b3330bbae6e38e90209" resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.5.2.tgz#313b6274dda718f714d00b3330bbae6e38e90209"