Merge branch 'v3' of github.com:jumpserver/lina into v3

This commit is contained in:
ibuler 2022-10-27 20:00:04 +08:00
commit 32ec05e04c
8 changed files with 247 additions and 440 deletions

View File

@ -18,8 +18,8 @@
"created_by": "Created by",
"asset": "Asset",
"system_user": "System user",
"username_group":"Username group",
"hostname_group":"Hostname group",
"username_group": "Username group",
"hostname_group": "Hostname group",
"asset_ip_group": "Asset ip group",
"system_users_name_group": "Systemuser name",
"system_users_protocol_group": "Systemuser protocol",
@ -40,8 +40,8 @@
"applicationsType": {
"chrome": "Chrome",
"mysql_workbench": "MySQL Workbench",
"vmware_client":"Vmware Client",
"custom":"Custom",
"vmware_client": "Vmware Client",
"custom": "Custom",
"mysql": "MySQL",
"oracle": "Oracle",
"postgresql": "PostgreSQL",
@ -86,7 +86,7 @@
"custom_password": "Password",
"Custom": "Custom",
"cluster": "Cluster",
"kubernetes":"Kubernetes",
"kubernetes": "Kubernetes",
"clusterHelpTextMessage": "Tips: https://172.16.8.8:8443",
"DBInfo": "Database Info",
"RDBProtocol": "RDS Protocol",
@ -114,7 +114,7 @@
"Action": "Action",
"ActiveSelected": "Active selected",
"AdminUser": "Admin user",
"ReplaceNodeAssetsAdminUser":"Replace node assets admin user with this",
"ReplaceNodeAssetsAdminUser": "Replace node assets admin user with this",
"AdminUserDetail": "Admin user detail",
"DynamicUsername": "Dynamic username",
"AdminUserListHelpMessage": "Admin users are asset (charged server) on the root, or have NOPASSWD: ALL sudo permissions users, JumpServer users of the system using the user to `push system user`, `get assets hardware information`, etc.\n",
@ -130,7 +130,7 @@
"AssetListHelpMessage": "The left side is the asset tree, right click to create, delete, and change the tree node, authorization asset is also organized as a node, and the right side is the asset under that node\n",
"AssetNumber": "Asset number",
"AssetUserList": "Asset user list",
"TestGatewayTestConnection":"Test gateway test connection",
"TestGatewayTestConnection": "Test gateway test connection",
"TestGatewayHelpMessage": "If use nat, set the ssh real port",
"SshPort": "SSH Port",
"Assets": "Assets",
@ -304,18 +304,18 @@
"ConnectWebSocketError": "Connect Websocket failed",
"Nothing": "Nothing",
"Action": "Action",
"CustomCol":"Custom table col",
"CustomCol": "Custom table col",
"RequestTickets": "Request tickets",
"Actions": "Actions",
"NeedSpecifiedFile": "Required to upload the specified format file",
"TestPortErrorMsg":"Port Error, please check",
"TestPortErrorMsg": "Port Error, please check",
"Activate": "Activate",
"actionsTips":"Clipboard's copy and paste control only support RDP/VNC protocol.",
"actionsTips": "Clipboard's copy and paste control only support RDP/VNC protocol.",
"Active": "Active",
"TableColSettingInfo": "Please select the list details you want to display",
"Add": "Add",
"PleaseAgreeToTheTerms": "Please agree to the terms",
"PushSelected":"Push selected",
"PushSelected": "Push selected",
"PushSelectedSystemUsersToAsset": "Push selected system users to asset",
"TestSelected": "Test selected",
"TestSelectedSystemUsersConnective": "Test selected system users connective",
@ -388,7 +388,7 @@
"Show": "Show",
"Submit": "Submit",
"Test": "Test",
"SaveAndAddAnother":"Save and add another",
"SaveAndAddAnother": "Save and add another",
"TestSuccessMsg": "Test Success",
"To": "To",
"Update": "Update",
@ -627,7 +627,11 @@
"versionDetail": "Version detail",
"versionRunExecution": "Version run execution",
"Unkown": "Unkown",
"Unknown": "Unknown"
"Unknown": "Unknown",
"PENDING": "Pending",
"RUNNING": "Running",
"SUCCESS": "Success",
"FAILURE": "Failure"
},
"perms": {
"": "",
@ -657,7 +661,7 @@
"addUserGroupToThisPermission": "Add user group to this permission",
"addUserToThisPermission": "Add user to this permission",
"all": "All",
"PermName":"Perm name",
"PermName": "Perm name",
"assetAndNode": "Assets and node",
"assetCount": "Asset count",
"connect": "Connect",
@ -676,15 +680,15 @@
"remoteApp": "RemoteApp",
"remoteAppCount": "RemoteApp count",
"appsCount": "App count",
"appsList":"App list",
"appsList": "App list",
"DatabaseAppCount": "DatabaseApp count",
"KubernetesAppCount": "KubernetesApp count",
"systemUserCount": "System user count",
"upDownload": "Upload download",
"uploadFile": "Upload file",
"clipboardCopyPaste":"Copy Paste",
"clipboardCopy":"Clipboard copy",
"clipboardPaste":"Clipboard paste",
"clipboardCopyPaste": "Copy Paste",
"clipboardCopy": "Clipboard copy",
"clipboardPaste": "Clipboard paste",
"userCount": "User count",
"userGroupCount": "User group count",
"usersAndUserGroups": "Users and user groups"
@ -929,7 +933,7 @@
"TerminateTaskSendSuccessMsg": "Terminate task has been send, Please check later",
"helpText": {
"esUrl": "Tip: If you have multiple hosts, use comma (, ) to split (eg: http://www.jumpserver.a.com, http://www.jumpserver.b.com)",
"esIndex":"Es provides the default index: jumpserver. If you choose to build an index by date, this blank is the index prefix",
"esIndex": "Es provides the default index: jumpserver. If you choose to build an index by date, this blank is the index prefix",
"esDocType": "Es provides the default document type: command"
}
},
@ -1106,7 +1110,7 @@
"userGuideUrl": "User Guide URL",
"username": "Username",
"usernamePlaceholder": "Please input username",
"refreshLdapCache":"Refreshing Ldap cache ",
"refreshLdapCache": "Refreshing Ldap cache ",
"LicenseExpired": "License expired",
"LicenseWillBe": "License will expire at ",
"LicenseReachedAssetAmountLimit": "The number of assets has exceeded the license limit",
@ -1128,16 +1132,16 @@
"ApprovalProcess": "Approval process",
"LevelApproval": "Level approval",
"Assignee": "Assignee",
"RequestPerm":"Request Perm",
"AssignedInfo":"Assigned Info",
"RequestPerm": "Request Perm",
"AssignedInfo": "Assigned Info",
"OpenTicket": "Open Ticket",
"HandleTicket": "Handle Ticket",
"FinishedTicket": "Finished Ticket",
"CheckViewAcceptor": "Click to view the acceptor",
"Assignees": "Assignees",
"Close": "Close",
"OpenStatus":"Open",
"CloseStatus":"Close",
"OpenStatus": "Open",
"CloseStatus": "Close",
"Comment": "Comment",
"MyTickets": "My tickets",
"action": "Action",
@ -1151,7 +1155,7 @@
"user": "User",
"Status": "Status",
"Open": "Open",
"OrgName":"Org name",
"OrgName": "Org name",
"IP": "IP",
"Hostname": "Hostname",
"Asset": "Asset",
@ -1199,7 +1203,7 @@
"AuthSettings": "Auth settings",
"UserName": "Name",
"Account": "Account",
"Existing":"Existing",
"Existing": "Existing",
"AccountInformation": "Account information",
"PersonalSetting": "Personal setting",
"Authentication": "Account",
@ -1228,7 +1232,6 @@
"OrgUser": "Org User",
"OrgAdmin": "Org Admin",
"OrgAuditor": "Org Auditor",
"HelpText": {
"MFAOfUserFirstLoginPersonalInformationImprovementPage": "Enable multi-factor authentication to make the account more secure <br/> After is enabled, you will enter the multi-factor authentication binding process on your next login <br/> You can also bind directly in (personal information -> fast modifier -> modifier multiple factor Settings)",
"MFAOfUserFirstLoginUserGuidePage": "To protect the security of you and the company <br/> please properly keep your account, password, key and other important and sensitive information <br/> (e.g., set a complex password and enable multi-factor authentication)",
@ -1291,7 +1294,7 @@
"databasePermissionRules": "Database Permission rules",
"k8sPermissionRules": "Kubernetes Permission rules",
"grantedAssets": "Granted assets",
"grantedK8Ss":"Granted K8Ss",
"grantedK8Ss": "Granted K8Ss",
"grantedDatabases": "Granted databases",
"grantedRemoteApps": "Granted remote apps",
"grantedApplications": "Granted applications",
@ -1425,7 +1428,7 @@
"HuaweiCloud": "Huawei Cloud",
"BaiduCloud": "Baidu Cloud",
"JDCloud": "JD Cloud",
"Azure":"Azure(China)",
"Azure": "Azure(China)",
"Azure_Int": "Azure(International)",
"HostnameStrategy": "Used to produce the asset hostname. For example, 1. Instance name (instanceDemo)2. Instance name and Partial IP (instanceDemo-250.1)",
"IsAlwaysUpdate": "Asset info is kept up-to-date",
@ -1447,20 +1450,20 @@
"CloudSource": "Cloud source",
"SaveSetting": "Save setting",
"Name": "Name",
"Account":"Account",
"Account": "Account",
"Node": "Node",
"WindowsAdminUser":"Windows Admin user",
"LinuxAdminUser":"Linux Admin user",
"PeriodicPerform":"Periodic perform",
"Periodic":"Periodic",
"WindowsAdminUser": "Windows Admin user",
"LinuxAdminUser": "Linux Admin user",
"PeriodicPerform": "Periodic perform",
"Periodic": "Periodic",
"RegularlyPerform": "Regularly perform",
"CyclePerform": "Cycle perform",
"DateLastSync":"Date last sync",
"DateCreated":"Date created",
"DateLastSync": "Date last sync",
"DateCreated": "Date created",
"Region": "Region",
"RunTaskManually":"Run task manually",
"RunTaskManually": "Run task manually",
"Comment": "Comment",
"True":"True",
"True": "True",
"False": "False",
"NewCount": "New count",
"UnSyncCount": "Unsync count",
@ -1494,11 +1497,11 @@
"Endpoint": "Endpoint",
"EndpointRule": "Endpoint rule",
"ServiceRatio": "Service ratio",
"LoadStatus":"Status",
"NormalLoad":"Normal",
"HighLoad":"High",
"LoadStatus": "Status",
"NormalLoad": "Normal",
"HighLoad": "High",
"Offline": "Offline",
"CriticalLoad":"Critical",
"CriticalLoad": "Critical",
"LicenseFile": "License file",
"NoLicense": "No License",
"Node": "Node",
@ -1510,8 +1513,8 @@
"OrganizationList": "Organizations",
"OrganizationUpdate": "Update org",
"OrganizationMembership": "Organization membership",
"DeleteOrgTitle":"Please ensure that the following information in the organization has been deleted",
"DeleteOrgMsg":"User list、User group、Asset list、Domain list、Admin user、System user、Labels、Asset permission",
"DeleteOrgTitle": "Please ensure that the following information in the organization has been deleted",
"DeleteOrgMsg": "User list、User group、Asset list、Domain list、Admin user、System user、Labels、Asset permission",
"OrgRole": "Org role",
"CreateOrgMsg": "Please go to Organization Details to add users",
"AddOrgMembers": "Add organization members",

View File

@ -20,10 +20,10 @@
"date_created": "创建时间",
"created_by": "创建者",
"asset": "资产信息",
"users":"用户",
"users": "用户",
"system_user": "系统用户",
"username_group":"用户名",
"hostname_group":"资产名",
"username_group": "用户名",
"hostname_group": "资产名",
"asset_ip_group": "资产IP",
"system_users_name_group": "系统用户名称",
"system_users_protocol_group": "系统用户协议",
@ -45,8 +45,8 @@
"applicationsType": {
"chrome": "Chrome",
"mysql_workbench": "MySQL Workbench",
"vmware_client":"Vmware Client",
"custom":"Custom",
"vmware_client": "Vmware Client",
"custom": "Custom",
"mysql": "MySQL",
"oracle": "Oracle",
"postgresql": "PostgreSQL",
@ -91,7 +91,7 @@
"custom_password": "登录密码",
"Custom": "自定义",
"cluster": "集群",
"kubernetes":"Kubernetes",
"kubernetes": "Kubernetes",
"clusterHelpTextMessage": "例如https://172.16.8.8:8443",
"DBInfo": "数据库信息",
"RDBProtocol": "关系型数据库",
@ -130,9 +130,9 @@
"HardwareInfo": "硬件信息",
"AssetDetail": "资产详情",
"AssetList": "资产列表",
"ReplaceNodeAssetsAdminUser":"替换节点资产的管理员",
"ReplaceNodeAssetsAdminUser": "替换节点资产的管理员",
"AssetListHelpMessage": "左侧是资产树,右击可以新建、删除、更改树节点,授权资产也是以节点方式组织的,右侧是属于该节点下的资产\n",
"TestGatewayTestConnection":"测试连接网关",
"TestGatewayTestConnection": "测试连接网关",
"TestGatewayHelpMessage": "如果使用了nat端口映射请设置为ssh真实监听的端口",
"SshPort": "SSH 端口",
"AssetNumber": "资产编号",
@ -318,12 +318,12 @@
"Action": "动作",
"RequestTickets": "申请工单",
"Actions": "操作",
"CustomCol":"自定义列表字段",
"CustomCol": "自定义列表字段",
"Activate": "激活",
"NeedSpecifiedFile": "需上传指定格式文件",
"TestPortErrorMsg":"端口错误,请重新输入",
"TestPortErrorMsg": "端口错误,请重新输入",
"Active": "激活中",
"actionsTips":"剪切板权限控制目前仅支持 RDP/VNC 协议的连接",
"actionsTips": "剪切板权限控制目前仅支持 RDP/VNC 协议的连接",
"TableColSettingInfo": "请选择您想显示的列表详细信息。",
"Add": "添加",
"UpdateAssetDetail": "配置更多信息",
@ -331,7 +331,7 @@
"Auth": "认证",
"bind": "绑定",
"unbind": "解绑",
"PushSelected":"推送所选",
"PushSelected": "推送所选",
"PushSelectedSystemUsersToAsset": "推送所选系统用户到资产",
"TestSelected": "测试所选",
"TestSelectedSystemUsersConnective": "测试所选系统用户可连接性",
@ -644,7 +644,11 @@
"versionDetail": "版本详情",
"versionRunExecution": "执行历史",
"Unkown": "未知",
"Unknown": "未知"
"Unknown": "未知",
"PENDING": "等待中",
"RUNNING": "运行中",
"SUCCESS": "成功",
"FAILURE": "失败"
},
"perms": {
"": "",
@ -659,7 +663,7 @@
"SystemUser": "系统用户",
"User": "用户",
"UserGroups": "用户组",
"PermName":"授权名称",
"PermName": "授权名称",
"Permissions": "授权列表",
"DatabaseAppPermission": "数据库授权",
"RemoteAppPermission": "远程应用授权",
@ -692,15 +696,15 @@
"remoteApp": "远程应用",
"remoteAppCount": "远程应用数量",
"appsCount": "应用数量",
"appsList":"应用列表",
"appsList": "应用列表",
"DatabaseAppCount": "数据库应用数量",
"KubernetesAppCount": "Kubernetes应用数量",
"systemUserCount": "系统用户",
"upDownload": "上传下载",
"uploadFile": "上传文件",
"clipboardCopyPaste":"剪贴板复制粘贴",
"clipboardCopy":"剪切板复制",
"clipboardPaste":"剪切板粘贴",
"clipboardCopyPaste": "剪贴板复制粘贴",
"clipboardCopy": "剪切板复制",
"clipboardPaste": "剪切板粘贴",
"userCount": "用户数量",
"userGroupCount": "用户组数量",
"usersAndUserGroups": "用户或用户组"
@ -732,7 +736,7 @@
"AssetAccount": "资产账号",
"AssetHistoryAccount": "资产历史账号",
"ApplicationAccount": "应用账号",
"Ticket":"工单",
"Ticket": "工单",
"MyTickets": "我的申请",
"AssignedTicketList": "待我审批",
"SessionDetail": "会话详情",
@ -1156,7 +1160,7 @@
"userGuideUrl": "用户向导URL",
"username": "用户名",
"usernamePlaceholder": "请输入用户名",
"refreshLdapCache":"刷新Ldap缓存请稍后",
"refreshLdapCache": "刷新Ldap缓存请稍后",
"LicenseExpired": "许可证已经过期",
"LicenseWillBe": "许可证即将在 ",
"LicenseReachedAssetAmountLimit": "资产数量已经超过许可证数量限制",
@ -1192,11 +1196,11 @@
"Assignee": "处理人",
"Assignees": "待处理人",
"Close": "关闭",
"OpenStatus":"审批中",
"CloseStatus":"已完成",
"OpenStatus": "审批中",
"CloseStatus": "已完成",
"Comment": "备注",
"MyTickets": "我发起的",
"RequestPerm":"授权申请",
"RequestPerm": "授权申请",
"Reject": "拒绝",
"date": "日期",
"reply": "回复",
@ -1207,8 +1211,8 @@
"user": "用户",
"Status": "状态",
"Open": "待处理",
"OrgName":"授权组织名称",
"AssignedInfo":"审批信息",
"OrgName": "授权组织名称",
"AssignedInfo": "审批信息",
"OpenTicket": "创建工单",
"HandleTicket": "处理工单",
"FinishedTicket": "完成工单",
@ -1301,7 +1305,7 @@
"LoginConfirm": "登录复核",
"LoginPasswordSetting": "登录密码设置",
"MFA": "MFA",
"Existing":"已存在",
"Existing": "已存在",
"MfaLevel": "多因子认证",
"Name": "姓名",
"NewPassword": "新密码",
@ -1491,7 +1495,7 @@
"HuaweiCloud": "华为云",
"BaiduCloud": "百度云",
"JDCloud": "京东云",
"Azure":"Azure(中国)",
"Azure": "Azure(中国)",
"Azure_Int": "Azure(国际)",
"HostnameStrategy": "用于生成资产主机名。例如1. 实例名称 (instanceDemo)2. 实例名称和部分IP(后两位) (instanceDemo-250.1)",
"IsAlwaysUpdate": "资产信息保持最新",
@ -1513,20 +1517,20 @@
"CloudSource": "同步源",
"SaveSetting": "同步设置",
"Name": "名称",
"Account":"账户",
"Account": "账户",
"Node": "节点",
"WindowsAdminUser":"Windows 特权用户",
"LinuxAdminUser":"Linux 特权用户",
"Periodic":"执行周期",
"PeriodicPerform":"定时执行",
"WindowsAdminUser": "Windows 特权用户",
"LinuxAdminUser": "Linux 特权用户",
"Periodic": "执行周期",
"PeriodicPerform": "定时执行",
"RegularlyPerform": "定期执行",
"CyclePerform": "周期执行",
"DateLastSync":"最后同步日期",
"DateCreated":"创建日期",
"DateLastSync": "最后同步日期",
"DateCreated": "创建日期",
"Region": "地域",
"Comment": "备注",
"RunTaskManually":"手动执行",
"True":"是",
"RunTaskManually": "手动执行",
"True": "是",
"False": "否",
"NewCount": "新增",
"UnSyncCount": "未同步",
@ -1538,8 +1542,8 @@
"DeleteReleasedAssets": "删除已释放资产"
},
"Template": {
"Template": "模版管理"
},
"Template": "模版管理"
},
"Corporation": "公司",
"Edition": "版本",
"Execute": "执行",
@ -1562,10 +1566,10 @@
"Endpoint": "服务端点",
"EndpointRule": "端点规则",
"ServiceRatio": "组件负载统计",
"LoadStatus":"组件状态",
"NormalLoad":"正常",
"HighLoad":"较高",
"CriticalLoad":"严重",
"LoadStatus": "组件状态",
"NormalLoad": "正常",
"HighLoad": "较高",
"CriticalLoad": "严重",
"Offline": "离线",
"LicenseDetail": "许可证详情",
"LicenseFile": "许可证文件",

View File

@ -12,14 +12,14 @@ export default [
path: '',
name: 'TaskList',
component: () => import('@/views/ops/TaskList'),
meta: { title: i18n.t('route.TaskList') }
meta: { title: i18n.t('route.TaskList'), permissions: [] }
},
{
path: ':id',
component: () => import('@/views/ops/TaskDetail'),
name: 'TaskDetail',
hidden: true,
meta: { title: i18n.t('route.TaskDetail') }
meta: { title: i18n.t('route.TaskDetail'), permissions: [] }
}
]
},

View File

@ -1,103 +0,0 @@
<template>
<ListTable :table-config="tableConfig" :header-actions="headerActions" />
</template>
<script>
import ListTable from '@/components/ListTable'
import { toSafeLocalDateStr } from '@/utils/common'
import { DetailFormatter } from '@/components/TableFormatters'
export default {
name: 'TaskAdhoc',
components: {
ListTable
},
props: {
object: {
type: Object,
default: () => ({})
}
},
data() {
return {
tableConfig: {
url: `/api/v1/ops/adhoc/?task=${this.object.id}`,
columns: [
'short_id', 'hosts', 'pattern', 'run_as', 'become_display', 'date_created', 'actions'
],
columnsMeta: {
short_id: {
label: this.$t('ops.version'),
formatter: DetailFormatter,
formatterArgs: {
route: 'AdhocDetail'
}
},
hosts: {
label: this.$t('ops.hosts'),
width: '80px',
formatter: (row, column, cellValue) => {
if (cellValue instanceof Array) {
return cellValue.length
}
return cellValue
},
showOverflowTooltip: true
},
pattern: {
label: this.$t('ops.pattern'),
width: '80px'
},
run_as: {
label: this.$t('ops.runAs'),
formatter: function(row) {
if (row.run_as_admin) {
return 'Admin'
}
if (row.run_as) {
return row.run_as
}
}
},
become_display: {
label: this.$t('ops.become')
},
date_created: {
label: this.$t('ops.datetime'),
formatter: function(row) {
return toSafeLocalDateStr(row.date_created)
}
},
actions: {
prop: 'id',
width: '80px',
formatterArgs: {
hasEdit: false,
hasDelete: false,
hasUpdate: false,
hasClone: false,
extraActions: [
{
name: 'detail',
title: this.$t('ops.detail'),
type: 'primary',
callback: function({ row, tableData }) {
return this.$router.push({ name: 'AdhocDetail', params: { id: row.id }})
}
}
]
}
}
}
},
headerActions: {
hasLeftActions: false,
hasRightActions: false
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -3,25 +3,16 @@
<el-col :md="14" :sm="24">
<DetailCard :title="cardTitle" :items="detailCardItems" />
</el-col>
<el-col :md="10" :sm="24">
<RunInfoCard type="danger" style="margin-top: 15px" v-bind="RunFailedConfig" />
<RunInfoCard type="info" v-bind="RunSuccessConfig" style="margin-top: 15px" />
</el-col>
</el-row>
</template>
<script type="text/jsx">
import DetailCard from '@/components/DetailCard'
import RunInfoCard from '../RunInfoCard/index'
import { toLastFailureDisplay, toLastSucessDisplay } from './business'
import { toSafeLocalDateStr } from '@/utils/common'
import { openTaskPage } from '@/utils/jms'
export default {
name: 'TaskDetail',
components: {
DetailCard,
RunInfoCard
DetailCard
},
props: {
object: {
@ -30,100 +21,22 @@ export default {
}
},
data() {
return {
RunSuccessConfig: {
icon: 'fa-info',
title: this.$t('ops.lastRunSuccessHosts'),
contents: toLastSucessDisplay(this.object.latest_execution)
},
RunFailedConfig: {
icon: 'fa-info',
title: this.$t('ops.lastRunFailedHosts'),
contents: toLastFailureDisplay(this.object.latest_execution)
},
taskData: {}
}
return {}
},
computed: {
cardTitle() {
return this.object.display_name
return this.object.name
},
detailCardItems() {
return [
{
key: this.$t('common.Name'),
value: this.object.display_name
},
{
key: this.$t('common.dateCreated'),
value: toSafeLocalDateStr(this.object.date_created)
},
{
key: this.$t('ops.totalVersions'),
value: JSON.stringify(this.object.summary.total)
},
{
key: this.$t('ops.latestVersion'),
value: this.object.latest_execution,
formatter: function(row, data) {
const route = { to: { name: 'AdhocDetail', params: { id: data.adhoc }}}
if (!this.$hasPerm('ops.ops.view_adhoc')) {
return <span>{ data.adhoc_short_id }</span>
}
return <router-link {...{ attrs: route }}>{ data.adhoc_short_id }</router-link>
}
},
{
key: this.$t('ops.lastRun'),
value: toSafeLocalDateStr(this.object.latest_execution.date_finished)
},
{
key: this.$t('ops.timeDelta'),
value: this.object.latest_execution.timedelta.toFixed(2) + 's'
},
{
key: this.$t('ops.isFinished'),
value: this.object.latest_execution.is_finished
},
{
key: this.$t('ops.isSuccess'),
value: this.object.latest_execution.is_success
},
{
key: this.$t('ops.contents'),
value: this.toContentsDisplay(this.object.contents),
formatter(row, value) {
return (<div>{
value.map((content) => {
return <div>{ content }</div>
})}
</div>)
}
},
{
key: this.$t('ops.lastExecutionOutput'),
value: this.object.latest_execution.id,
formatter: function(row, value) {
const onClick = function() {
openTaskPage(value, 'ansible')
}
const title = this.$t('common.View')
return <a onClick={onClick} >{ title }</a>
}
value: this.object.name
}
]
}
},
methods: {
toContentsDisplay(contents) {
const lines = []
for (let i = 0; i < contents.length; i++) {
const content = contents[i]
lines.push(`${i}. ${content.name} ::: ${content.action.module}`)
}
return lines
}
}
methods: {}
}
</script>

View File

@ -4,8 +4,6 @@
<script type="text/jsx">
import ListTable from '@/components/ListTable'
import { DetailFormatter } from '@/components/TableFormatters'
import { toSafeLocalDateStr } from '@/utils/common'
export default {
name: 'TaskHistory',
@ -21,63 +19,25 @@ export default {
data() {
return {
tableConfig: {
url: `/api/v1/ops/adhoc-executions/?task=${this.object.id}`,
url: `/api/v1/ops/tasks/${this.object.id}/executions/`,
columns: [
'date_start', 'stat', 'ratio', 'is_finished', 'is_success', 'timedelta', 'adhoc_short_id', 'actions'
'id', 'state', 'is_finished', 'date_published', 'date_start', 'date_finished', 'actions'
],
columnsMeta: {
date_start: {
formatter: (row) => toSafeLocalDateStr(row.date_start),
width: '160px'
},
stat: {
label: this.$t('ops.stat'),
align: 'center',
width: '100px',
formatter: function(row) {
return (
<div>
<span class='text-primary'>{row.stat.success}</span>/
<span class='text-danger'>{row.stat.failed}</span>/
<span>{row.stat.total}</span>
</div>
)
}
},
ratio: {
label: this.$t('ops.ratio'),
align: 'center',
width: '80px',
formatter: function(row) {
const ratio = (row.stat.success / row.stat.total) * 100
if (ratio === 100) {
return <span class='text-navy'>{ratio + '%'}</span>
state: {
label: this.$t('ops.state'),
width: '120px',
formatter: (row) => {
switch (row.state) {
case 'PENDING':
return <span><i Class='fa fa-spinner fa-spin' />{this.$t(`ops.${row.state}`)}</span>
case 'RUNNING':
return <span><i Class='fa fa-spinner fa-spin' />{this.$t(`ops.${row.state}`)}</span>
case 'SUCCESS':
return <span Class='text-success'><i Class='fa fa-check' />{this.$t(`ops.${row.state}`)}</span>
case 'FAILURE':
return <span Class='text-danger'><i Class='fa fa-times' />{this.$t(`ops.${row.state}`)}</span>
}
return <span class='text-danger'>{ratio + '%'}</span>
}
},
is_finished: {
align: 'center',
width: '100px',
label: this.$t('ops.isFinished')
},
is_success: {
align: 'center',
width: '100px',
label: this.$t('ops.isSuccess')
},
timedelta: {
label: this.$t('ops.time'),
width: '100px',
formatter: function(row) {
return row.timedelta.toFixed(2) + 's'
}
},
adhoc_short_id: {
label: this.$t('ops.version'),
formatter: DetailFormatter,
formatterArgs: {
route: 'HistoryExecutionDetail'
}
},
actions: {

View File

@ -10,7 +10,6 @@
import { GenericDetailPage, TabPage } from '@/layout/components'
import TaskDetail from './TaskDetail'
import TaskHistory from './TaskHistory'
import TaskAdhoc from './TaskAdhoc'
import CeleryTaskLog from '../CeleryTaskLog'
export default {
components: {
@ -18,7 +17,6 @@ export default {
CeleryTaskLog,
TaskHistory,
TaskDetail,
TaskAdhoc,
TabPage
},
data() {
@ -34,11 +32,6 @@ export default {
title: this.$t('ops.taskDetail'),
name: 'TaskDetail'
},
{
title: this.$t('ops.taskVersions'),
name: 'TaskAdhoc',
hidden: () => !this.$hasPerm('ops.view_adhoc')
},
{
title: this.$t('ops.execution'),
name: 'TaskHistory',

View File

@ -3,14 +3,9 @@
</template>
<script type="text/jsx">
import { timeOffset, toSafeLocalDateStr } from '@/utils/common'
// import { timeOffset, toSafeLocalDateStr } from '@/utils/common'
import { GenericListPage } from '@/layout/components'
import { openTaskPage } from '@/utils/jms'
const performDelete = function({ row }) {
const id = row.id
const url = `${this.url}${id}/`
return this.$axios.delete(url)
}
// import { openTaskPage } from '@/utils/jms'
export default {
components: {
@ -21,109 +16,150 @@ export default {
tableConfig: {
url: '/api/v1/ops/tasks/',
columns: [
'name', 'runtimes', 'host_amount', 'is_success',
'date_start', 'time', 'actions'
'name', 'queue', 'comment', 'count', 'state', 'last_published_time'
],
columnsMeta: {
name: {
showOverflowTooltip: true,
formatterArgs: {
getTitle({ row }) {
return row['display_name']
}
can: true
}
// formatter: (row) => {
// return row.meta.verbose_name != null ? row.meta.verbose_name : row.name
// }
},
comment: {
label: 'comment',
formatter: (row) => {
return row.meta.comment
}
},
runtimes: {
label: this.$t('ops.runTimes'),
queue: {
label: 'queue',
formatter: (row) => {
return row.meta.queue
}
},
last_published_time: {
width: '210px',
formatter: (row) => {
return row.last_published_time != null ? row.last_published_time : '-'
}
},
count: {
label: 'success/total',
width: '120px',
formatter: function(row) {
return (<div>
<span Class='text-primary'>{row.summary.success}</span>/
<span Class='text-danger'>{row.summary.failed}</span>/
<span>{row.summary.total}</span>
</div>)
formatter: (row) => {
return <div>
<span Class='text-primary'>{row.success_count}</span>/
<span>{row.publish_count}</span>
</div>
}
},
host_amount: {
label: this.$t('ops.hosts'),
width: '65px',
formatter: function(row) {
return _.get(row, 'latest_execution.hosts_amount', 0)
}
},
is_success: {
label: this.$t('ops.success'),
state: {
width: '60px',
align: 'center',
width: '80px',
formatter: row => {
if (_.get(row, 'latest_execution.is_success', false)) {
return <i Class='fa fa-check text-primary'/>
formatter: (row) => {
switch (row.state) {
case 'green':
return <i Class='fa fa-circle-o text-primary' />
case 'yellow':
return <i Class='fa fa-circle-o text-warning' />
case 'red':
return <i Class='fa fa-circle-o text-danger' />
}
return <i Class='fa fa-times text-danger'/>
}
},
date_start: {
label: this.$t('ops.date'),
width: '150px',
formatter: function(row) {
if (_.get(row, 'latest_execution.date_start', false)) {
return toSafeLocalDateStr(row.latest_execution.date_start)
}
return ''
}
},
time: {
label: this.$t('ops.time'),
width: '100px',
formatter: function(row) {
if (_.get(row, 'latest_execution.date_start', false)) {
return timeOffset(row.latest_execution.date_start, row.latest_execution.date_finished)
}
return ''
}
},
// runtimes: {
// label: this.$t('ops.runTimes'),
// width: '120px',
// formatter: function(row) {
// return (<div>
// <span Class='text-primary'>{row.summary.success}</span>/
// <span Class='text-danger'>{row.summary.failed}</span>/
// <span>{row.summary.total}</span>
// </div>)
// }
// },
// host_amount: {
// label: this.$t('ops.hosts'),
// width: '65px',
// formatter: function(row) {
// return _.get(row, 'latest_execution.hosts_amount', 0)
// }
// },
// is_success: {
// label: this.$t('ops.success'),
// align: 'center',
// width: '80px',
// formatter: row => {
// if (_.get(row, 'latest_execution.is_success', false)) {
// return <i Class='fa fa-check text-primary'/>
// }
// return <i Class='fa fa-times text-danger'/>
// }
// },
// date_start: {
// label: this.$t('ops.date'),
// width: '150px',
// formatter: function(row) {
// if (_.get(row, 'latest_execution.date_start', false)) {
// return toSafeLocalDateStr(row.latest_execution.date_start)
// }
// return ''
// }
// },
// time: {
// label: this.$t('ops.time'),
// width: '100px',
// formatter: function(row) {
// if (_.get(row, 'latest_execution.date_start', false)) {
// return timeOffset(row.latest_execution.date_start, row.latest_execution.date_finished)
// }
// return ''
// }
// },
actions: {
prop: 'id',
formatterArgs: {
hasUpdate: false,
hasClone: false,
canDelete: this.$hasPerm('ops.delete_task'),
onDelete: function({ row, col, cellValue, reload }) {
const msg = this.$t('common.deleteWarningMsg') + ` "${row.display_name || row.name}" ` + '?'
const title = this.$t('common.Info')
this.$alert(msg, title, {
type: 'warning',
confirmButtonClass: 'el-button--danger',
showCancelButton: true,
beforeClose: async(action, instance, done) => {
if (action !== 'confirm') return done()
instance.confirmButtonLoading = true
try {
await performDelete.bind(this)({ row: row, col: col })
done()
reload()
this.$message.success(this.$t('common.deleteSuccessMsg'))
} finally {
instance.confirmButtonLoading = false
}
}
})
},
extraActions: [
{
name: 'run',
can: this.$hasPerm('ops.add_adhoc'),
title: this.$t('ops.run'),
type: 'primary',
callback: function({ row, tableData }) {
this.$axios.get(
`/api/v1/ops/tasks/${row.id}/run/`
).then(res => {
openTaskPage(res['task'])
})
}
}
]
// hasUpdate: false,
// hasClone: false,
// canDelete: this.$hasPerm('ops.delete_task'),
// onDelete: function({ row, col, cellValue, reload }) {
// const msg = this.$t('common.deleteWarningMsg') + ` "${row.display_name || row.name}" ` + '?'
// const title = this.$t('common.Info')
// this.$alert(msg, title, {
// type: 'warning',
// confirmButtonClass: 'el-button--danger',
// showCancelButton: true,
// beforeClose: async(action, instance, done) => {
// if (action !== 'confirm') return done()
// instance.confirmButtonLoading = true
// try {
// await performDelete.bind(this)({ row: row, col: col })
// done()
// reload()
// this.$message.success(this.$t('common.deleteSuccessMsg'))
// } finally {
// instance.confirmButtonLoading = false
// }
// }
// })
// },
// extraActions: [
// {
// name: 'run',
// can: this.$hasPerm('ops.add_adhoc'),
// title: this.$t('ops.run'),
// type: 'primary',
// callback: function({ row, tableData }) {
// this.$axios.get(
// `/api/v1/ops/tasks/${row.id}/run/`
// ).then(res => {
// openTaskPage(res['task'])
// })
// }
// }
// ]
}
}
}
@ -133,7 +169,8 @@ export default {
hasCreate: false
}
}
}
},
methods: {}
}
</script>