Merge remote-tracking branch 'origin/v3' into v3

This commit is contained in:
feng
2022-11-25 10:10:05 +08:00
17 changed files with 88 additions and 51 deletions

View File

@@ -713,7 +713,8 @@
"JobType": "作业类型", "JobType": "作业类型",
"Comment": "备注", "Comment": "备注",
"History": "执行历史", "History": "执行历史",
"UseParameterDefine": "定义参数" "UseParameterDefine": "定义参数",
"TaskDispatch": "任务下发成功"
}, },
"perms": { "perms": {
"": "", "": "",

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#646A73" d="M1 3.5a1 1 0 0 1 1-1h20a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1v-13Zm2 1v11h18v-11H3Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill-opacity=".2" fill="#000" d="M1 3.5a1 1 0 0 1 1-1h20a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1v-13Zm2 1v11h18v-11H3Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill="#646A73" d="M5.5 9a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill-opacity=".2" fill="#000" d="M5.5 9a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill="#646A73" d="M5.5 13a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill-opacity=".2" fill="#000" d="M5.5 13a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill="#646A73" d="M11 19.5v-3h2v3h-2Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill-opacity=".2" fill="#000" d="M11 19.5v-3h2v3h-2Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill="#646A73" d="M12 12.5a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v1Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill-opacity=".2" fill="#000" d="M12 12.5a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v1Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill="#646A73" d="M19 8.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 .5.5v1Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill-opacity=".2" fill="#000" d="M19 8.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 .5.5v1Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill="#646A73" d="M18 21a.5.5 0 0 1-.5.5h-11A.5.5 0 0 1 6 21v-1a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 .5.5v1Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill-opacity=".2" fill="#000" d="M18 21a.5.5 0 0 1-.5.5h-11A.5.5 0 0 1 6 21v-1a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 .5.5v1Z" clip-rule="evenodd" fill-rule="evenodd"/></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -25,7 +25,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.app-main { .app-main {
background-color: #f3f3f4; background-color: #f3f3f4;
min-height: calc(100vh - 50px); min-height: calc(100vh - 0px);
width: 100%; width: 100%;
position: relative; position: relative;
overflow: hidden; overflow: hidden;

View File

@@ -87,6 +87,7 @@ export default {
width: 24px; width: 24px;
margin-right: 5px; margin-right: 5px;
vertical-align: middle; vertical-align: middle;
background: white;
} }
.mobile .header-avatar { .mobile .header-avatar {
display: none; display: none;

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dropdown :show-timeout="50" @command="handleCommand"> <el-dropdown :show-timeout="50" @command="handleCommand">
<span class="el-dropdown-link" style="vertical-align: sub;"> <span class="el-dropdown-link" style="vertical-align: middle;">
<svg-icon icon-class="question-mark" style="font-size: 16px;" /> <svg-icon icon-class="question-mark" style="font-size: 16px;" />
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
@@ -8,6 +8,7 @@
<el-dropdown-item command="support">{{ $t('common.nav.Support') }}</el-dropdown-item> <el-dropdown-item command="support">{{ $t('common.nav.Support') }}</el-dropdown-item>
<el-dropdown-item command="toolsDownload">{{ $t('common.nav.Download') }}</el-dropdown-item> <el-dropdown-item command="toolsDownload">{{ $t('common.nav.Download') }}</el-dropdown-item>
<el-dropdown-item v-if="!hasLicence" command="enterprise">{{ $t('common.nav.EnterpriseEdition') }}</el-dropdown-item> <el-dropdown-item v-if="!hasLicence" command="enterprise">{{ $t('common.nav.EnterpriseEdition') }}</el-dropdown-item>
<el-dropdown-item command="github">GITHUB</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</template> </template>
@@ -47,6 +48,9 @@ export default {
case 'toolsDownload': case 'toolsDownload':
window.open('/core/download/', '_blank') window.open('/core/download/', '_blank')
break break
case 'github':
window.open('https://github.com/jumpserver/jumpserver', '_blank')
break
default: default:
window.open(this.URLSite.HELP_DOCUMENT_URL, '_blank') window.open(this.URLSite.HELP_DOCUMENT_URL, '_blank')
break break

View File

@@ -1,7 +1,7 @@
<template> <template>
<el-select <el-select
:value="currentOrgId" :value="currentOrgId"
class="org-select organization" class="org-select organization autoWidth-select"
filterable filterable
:placeholder="$tc('common.Select')" :placeholder="$tc('common.Select')"
@change="changeOrg" @change="changeOrg"
@@ -9,6 +9,9 @@
<template slot="prefix"> <template slot="prefix">
<svg-icon icon-class="organization" /> <svg-icon icon-class="organization" />
<span class="line" /> <span class="line" />
<span class="placeholder">
{{ (orgGroups.map(i => (i.options.find(item => item.id === currentOrg.id) || {}).name)).filter(Boolean) }}
</span>
</template> </template>
<el-option-group <el-option-group
@@ -148,7 +151,7 @@ export default {
.line { .line {
width: 1px; width: 1px;
margin-left: 8px; margin-left: 6px;
border: .5px solid #FFF; border: .5px solid #FFF;
} }
@@ -183,4 +186,26 @@ export default {
font-size: 12px; font-size: 12px;
line-height: 30px; line-height: 30px;
} }
.autoWidth-select {
min-width: 140px;
&>>> input{
position: absolute;
}
&>>> .el-input__inner{
margin-left: 6px;
}
&>>> .el-input__prefix{
position: relative;
left: 0px;
box-sizing: border-box;
border: 1px solid #ffffff00;
padding: 0 30px 0 0;
height: 30px;
line-height: 30px;
.placeholder {
visibility: hidden;
}
}
}
</style> </style>

View File

@@ -180,6 +180,7 @@ export default {
font-size: 16px; font-size: 16px;
text-align: center; text-align: center;
color: #1F2329; color: #1F2329;
margin-right: 10px;
} }
.icons-title { .icons-title {
display: inline-block; display: inline-block;

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-link :href="webTerminalUrl" target="_blank"> <el-link :href="webTerminalUrl" target="_blank" style="padding-top: 1px;">
<svg-icon icon-class="terminal" /> <svg-icon icon-class="terminal" style="font-size: 17px;" />
</el-link> </el-link>
</template> </template>

View File

@@ -30,7 +30,12 @@
</ul> </ul>
<hamburger :is-active="sidebar.opened" class="hamburger-container is-show-menu" @toggleClick="toggleSideBar" /> <hamburger :is-active="sidebar.opened" class="hamburger-container is-show-menu" @toggleClick="toggleSideBar" />
<ul class="navbar-left"> <ul class="navbar-left">
<li v-if="showOrganize()" class="left-item" style="margin-left: 24px"> <li class="left-item">
<div class="nav-logo">
<Logo v-if="showLogo" :collapse="false" />
</div>
</li>
<li v-if="showOrganize()" class="left-item" style="margin-left: 21px">
<Organization class="organization" /> <Organization class="organization" />
</li> </li>
</ul> </ul>
@@ -47,6 +52,7 @@ import WebTerminal from './WebTerminal'
import Tickets from './Tickets' import Tickets from './Tickets'
import Organization from './Organization' import Organization from './Organization'
import SystemSetting from './SystemSetting' import SystemSetting from './SystemSetting'
import Logo from '../NavLeft/Logo'
export default { export default {
components: { components: {
@@ -57,7 +63,8 @@ export default {
Tickets, Tickets,
WebTerminal, WebTerminal,
SiteMessages, SiteMessages,
SystemSetting SystemSetting,
Logo
}, },
data() { data() {
return {} return {}
@@ -70,6 +77,9 @@ export default {
return this.publicSettings['TICKETS_ENABLED'] && return this.publicSettings['TICKETS_ENABLED'] &&
this.$hasLicense() && this.$hasLicense() &&
this.$hasPerm('tickets.view_ticket') this.$hasPerm('tickets.view_ticket')
},
showLogo() {
return this.$store.state.settings.sidebarLogo
} }
}, },
methods: { methods: {
@@ -111,6 +121,9 @@ export default {
& >>> .org-select { & >>> .org-select {
padding: 0; padding: 0;
} }
.nav-logo {
width: 200px;
}
} }
} }
@@ -129,10 +142,13 @@ export default {
display: inline-block; display: inline-block;
padding-right: 10px; padding-right: 10px;
padding-left: 10px; padding-left: 10px;
vertical-align: middle; vertical-align: top;
&>>> .svg-icon { &>>> .svg-icon {
color: #FFF!important; color: #FFF!important;
} }
&>>> .el-badge {
vertical-align: top;
}
} }
.header-icon { .header-icon {

View File

@@ -74,9 +74,9 @@ export default {
& .sidebar-logo-text { & .sidebar-logo-text {
width: 150px; width: 150px;
height: 45px; height: 50px;
padding: 2px 0; padding: 3px 0;
vertical-align: middle; vertical-align: top;
margin-right: 12px; margin-right: 12px;
} }
@@ -93,8 +93,8 @@ export default {
} }
&.collapse { &.collapse {
height: 55px; height: 50px;
line-height: 55px; line-height: 46px;
.sidebar-logo { .sidebar-logo {
margin-right: 0; margin-right: 0;
} }

View File

@@ -1,9 +1,6 @@
<template> <template>
<div :class="{'has-logo': showLogo, 'show-orgs': showOrgs}"> <div :class="{'has-logo': showLogo, 'show-orgs': showOrgs}">
<div class="nav-header"> <div class="nav-header">
<div class="nav-logo">
<Logo v-if="showLogo" :collapse="isCollapse" />
</div>
<div class="active-mobile"> <div class="active-mobile">
<ViewSwitcher mode="vertical" class="mobile-view-switch" /> <ViewSwitcher mode="vertical" class="mobile-view-switch" />
<Organization v-if="$hasLicense()" class="organization" /> <Organization v-if="$hasLicense()" class="organization" />
@@ -60,7 +57,6 @@
<script> <script>
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import Logo from './Logo'
import SidebarItem from './SidebarItem' import SidebarItem from './SidebarItem'
import Hamburger from '@/components/Hamburger' import Hamburger from '@/components/Hamburger'
import ViewSwitcher from '../NavHeader/ViewSwitcher' import ViewSwitcher from '../NavHeader/ViewSwitcher'
@@ -70,7 +66,6 @@ import variables from '@/styles/variables.scss'
export default { export default {
components: { components: {
SidebarItem, SidebarItem,
Logo,
Hamburger, Hamburger,
ViewSwitcher, ViewSwitcher,
Organization Organization
@@ -140,7 +135,7 @@ export default {
.nav-title { .nav-title {
position: relative; position: relative;
box-sizing: border-box; box-sizing: border-box;
padding: 17px 0 17px 20px; padding: 14px 0 13px 20px;
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
color: #1F2329; color: #1F2329;

View File

@@ -1,19 +1,18 @@
<template> <template>
<div :class="classObj" class="app-wrapper"> <div :class="classObj" class="app-wrapper">
<div v-if="device==='mobile' && sidebar.opened" class="drawer-bg" @click="handleClickOutside" /> <div v-if="device==='mobile' && sidebar.opened" class="drawer-bg" @click="handleClickOutside" />
<NavLeft class="sidebar-container disabled-when-print" />
<div :class="{hasTagsView: needTagsView}" class="main-container">
<div :class="{'fixed-header': fixedHeader}" class="disabled-when-print"> <div :class="{'fixed-header': fixedHeader}" class="disabled-when-print">
<NavHeader /> <NavHeader />
</div> </div>
<div :class="{hasTagsView: needTagsView}" class="main-container">
<NavLeft class="sidebar-container disabled-when-print" />
<app-main /> <app-main />
<Footer class="disabled-when-print" />
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { NavHeader, NavLeft, AppMain, Footer } from './components' import { NavHeader, NavLeft, AppMain } from './components'
import ResizeMixin from './mixin/ResizeHandler' import ResizeMixin from './mixin/ResizeHandler'
export default { export default {
@@ -21,8 +20,7 @@ export default {
components: { components: {
NavLeft, NavLeft,
NavHeader, NavHeader,
AppMain, AppMain
Footer
}, },
mixins: [ResizeMixin], mixins: [ResizeMixin],
computed: { computed: {
@@ -86,14 +84,10 @@ export default {
top: 0; top: 0;
right: 0; right: 0;
z-index: 9; z-index: 9;
width: calc(100% - #{$sideBarWidth}); width: 100%;
transition: width 0.28s; transition: width 0.28s;
} }
.hideSidebar .fixed-header {
width: calc(100% - 50px)
}
.mobile .fixed-header { .mobile .fixed-header {
width: 100%; width: 100%;
} }

View File

@@ -27,7 +27,7 @@ export default {
name: 'MyHome', name: 'MyHome',
component: () => import('@/views/myhome'), component: () => import('@/views/myhome'),
meta: { meta: {
icon: 'dashboard', icon: 'overview',
title: i18n.t('route.Overview'), title: i18n.t('route.Overview'),
permissions: [] permissions: []
} }

View File

@@ -9,7 +9,7 @@
.el-submenu, .el-menu-item.submenu-title-noDropdown { .el-submenu, .el-menu-item.submenu-title-noDropdown {
background-color: $menuBg; background-color: $menuBg;
border-top: dashed 1px #f3f3f4; border-top: solid 1px #f3f3f4;
.el-submenu__title { .el-submenu__title {
color: $menuText; color: $menuText;
@@ -25,7 +25,6 @@
.el-menu-item, .el-submenu-sidebar .el-menu-item { .el-menu-item, .el-submenu-sidebar .el-menu-item {
background-color: $subMenuBg; background-color: $subMenuBg;
color: $menuText; color: $menuText;
list-style: circle inside; list-style: circle inside;
&.submenu-title-noDropdown { &.submenu-title-noDropdown {
@@ -37,9 +36,11 @@
font-weight: 600; font-weight: 600;
list-style-type: disc; list-style-type: disc;
} }
&:hover { &:hover {
background-color: $subMenuHover; background-color: $subMenuHover;
color: $subMenuActiveText; color: $subMenuActiveText;
list-style-type: disc;
} }
i { i {
color: $menuText; color: $menuText;

View File

@@ -1,10 +1,11 @@
@import "./variables"; @import "./variables";
#app { #app {
.main-container { .main-container {
position: relative;
min-height: 100%; min-height: 100%;
margin-top: 50px;
transition: margin-left .28s; transition: margin-left .28s;
margin-left: $sideBarWidth; margin-left: $sideBarWidth;
position: relative;
} }
.sidebar-container { .sidebar-container {
@@ -14,7 +15,7 @@
height: 100%; height: 100%;
position: fixed; position: fixed;
font-size: 0; font-size: 0;
top: 0; top: 50px;
bottom: 0; bottom: 0;
left: 0; left: 0;
z-index: 1001; z-index: 1001;
@@ -40,7 +41,7 @@
&.has-logo { &.has-logo {
.el-scrollbar { .el-scrollbar {
height: calc(100% - 157px); height: calc(100% - 150px);
} }
} }

View File

@@ -38,9 +38,9 @@ export default {
width: '96px', width: '96px',
formatter: (row) => { formatter: (row) => {
if (row.is_finished) { if (row.is_finished) {
return <i Class='fa fa-check text-primary' /> return <i Class='fa fa-check text-primary'/>
} }
return <i Class='fa fa-times text-danger' /> return <i Class='fa fa-times text-danger'/>
}, },
formatterArgs: { formatterArgs: {
width: '14px' width: '14px'
@@ -51,12 +51,12 @@ export default {
width: '96px', width: '96px',
formatter: (row) => { formatter: (row) => {
if (!row.is_finished) { if (!row.is_finished) {
return <i Class='fa fa fa-spinner fa-spin' /> return <i Class='fa fa fa-spinner fa-spin'/>
} }
if (row.is_success) { if (row.is_success) {
return <i Class='fa fa-check text-primary' /> return <i Class='fa fa-check text-primary'/>
} }
return <i Class='fa fa-times text-danger' /> return <i Class='fa fa-times text-danger'/>
}, },
formatterArgs: { formatterArgs: {
width: '14px' width: '14px'

View File

@@ -8,7 +8,6 @@
<script> <script>
import GenericListPage from '@/layout/components/GenericListPage' import GenericListPage from '@/layout/components/GenericListPage'
import { ActionsFormatter, DateFormatter } from '@/components/TableFormatters' import { ActionsFormatter, DateFormatter } from '@/components/TableFormatters'
import { openTaskPage } from '@/utils/jms'
import JobRunDialog from '@/views/ops/Job/JobRunDialog' import JobRunDialog from '@/views/ops/Job/JobRunDialog'
export default { export default {
@@ -41,7 +40,7 @@ export default {
if (row.is_periodic) { if (row.is_periodic) {
return <span>{row.type}&nbsp; return <span>{row.type}&nbsp;
<el-tooltip content={this.$t('ops.ThisPeriodic')}> <el-tooltip content={this.$t('ops.ThisPeriodic')}>
<i Class='fa fa-circle-o text-primary' /> <i Class='fa fa-circle-o text-primary'/>
</el-tooltip> </el-tooltip>
</span> </span>
} }
@@ -119,10 +118,8 @@ export default {
this.$axios.post('/api/v1/ops/job-executions/', { this.$axios.post('/api/v1/ops/job-executions/', {
job: row.id, job: row.id,
parameters: parameters parameters: parameters
}).then(data => { }).then(() => {
this.$axios.get(`/api/v1/ops/job-executions/${data.id}/`).then(d => { this.$message.success(this.$tc('ops.TaskDispatch'))
openTaskPage(d.task_id)
})
}) })
} }
} }