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

This commit is contained in:
ibuler
2024-05-13 15:28:57 +08:00
13 changed files with 99 additions and 61 deletions

View File

@@ -33,6 +33,7 @@
</template>
<script>
import { debounce } from 'lodash'
export default {
name: 'LabelSearch',
@@ -65,6 +66,10 @@ export default {
this.$emit('showLabelSearch', newValue)
}
},
created() {
this.showLabelSearch = window.innerWidth < 992
this.listenViewPort()
},
mounted() {
this.$eventBus.$on('labelSearch', label => {
if (!label) {
@@ -143,6 +148,12 @@ export default {
this.$refs.labelCascader.toggleDropDownVisible(true)
this.setSearchFocus()
}, 200)
},
listenViewPort() {
window.addEventListener('resize', debounce((e) => {
const viewPort = e?.target?.innerWidth
this.showLabelSearch = viewPort < 992
}, 100), false)
}
}
}
@@ -151,22 +162,26 @@ export default {
<style lang='scss' scoped>
.label-search {
margin-right: 10px;
border-radius: 5px;
border: 1px solid var(--color-disabled-background);
border-radius: 3px;
overflow: hidden;
::v-deep .el-button.label-button {
height: 30px;
height: 28px;
border: none;
}
.label-cascader {
width: 300px;
line-height: 30px;
height: 28px;
line-height: 28px;
::v-deep .el-input {
.el-input__inner {
height: 30px;
height: 28px !important;
line-height: 28px;
font-size: 13px;
border: none;
}
.el-input__suffix {

View File

@@ -159,6 +159,7 @@ $headerHeight: 30px;
.right-side {
float: right;
height: 30px;
}
.search {
@@ -166,7 +167,9 @@ $headerHeight: 30px;
flex-direction: row;
.right-side-item.action-search {
height: $headerHeight;
border: 1px solid var(--color-disabled-background);
border-radius: 5px;
overflow: hidden;
}
}
@@ -194,14 +197,42 @@ $headerHeight: 30px;
}
.mobile .search.right {
clear: both;
float: none;
padding-top: 10px;
.label-search {
margin-right: 0;
::v-deep .el-button.label-button {
border: 1px solid var(--color-disabled-background);
}
::v-deep .label-cascader {
display: block;
width: 100%;
}
}
}
.mobile .search.right .action-search {
display: inline-block;
width: 100%;
margin-top: 5px;
}
.mobile .right-side {
padding-top: 5px;
padding-top: 10px;
}
@media (max-width: 481px) {
.mobile .right-side {
float: left;
margin-left: -15px;
}
.mobile .left-side {
width: 100%;
}
}
</style>

View File

@@ -351,28 +351,23 @@ export default {
display: flex;
align-items: center;
min-width: 198px;
//height: 30px;
border: 1px solid var(--color-disabled-background);
border-radius: 4px;
background-color: #fff;
box-sizing: border-box;
.el-cascader {
line-height: 30px;
height: 28px;
line-height: 28px;
::v-deep .el-input__inner {
width: 0;
height: 30px;
padding-right: 20px;
border: none;
::v-deep .el-input.el-input--suffix {
.el-input__inner {
width: 0;
height: 28px;
padding-right: 20px;
border: none;
}
}
::v-deep .el-input__suffix {
color: var(--color-icon-primary) !important;
.el-input__suffix-inner {
line-height: 30px;
}
}
}
@@ -394,11 +389,9 @@ export default {
}
.search-input {
height: 30px;
height: 28px;
::v-deep .el-input__suffix {
height: 30px;
line-height: 30px;
cursor: pointer;
i {
@@ -409,8 +402,7 @@ export default {
}
::v-deep .el-input__inner {
line-height: 30px;
height: 30px;
height: 28px;
max-width: 200px;
border: none;
padding-left: 5px;

View File

@@ -382,7 +382,7 @@ export default [
name: 'AccountBackupList',
meta: {
menuTitle: i18n.t('BackupAccounts'),
title: i18n.t('AccountBackupPlanList'),
title: i18n.t('AccountBackupList'),
activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_accountbackupautomation']
}
@@ -390,9 +390,9 @@ export default [
{
path: 'create',
component: () => import('@/views/accounts/AccountBackup/AccountBackupCreateUpdate.vue'),
name: 'AccountBackupPlanCreate',
name: 'AccountBackupCreate',
meta: {
title: i18n.t('AccountBackupPlanCreate'),
title: i18n.t('AccountBackupCreate'),
activeMenu: '/console/accounts/automations',
action: 'create'
},
@@ -401,9 +401,9 @@ export default [
{
path: ':id/update',
component: () => import('@/views/accounts/AccountBackup/AccountBackupCreateUpdate.vue'),
name: 'AccountBackupPlanUpdate',
name: 'AccountBackupUpdate',
meta: {
title: i18n.t('AccountBackupPlanUpdate'),
title: i18n.t('AccountBackupUpdate'),
activeMenu: '/console/accounts/automations',
action: 'update'
},
@@ -412,10 +412,10 @@ export default [
{
path: ':id',
component: () => import('@/views/accounts/AccountBackup/AccountBackupDetail/index.vue'),
name: 'AccountBackupPlanDetail',
name: 'AccountBackupDetail',
activeMenu: '/console/accounts/automations',
meta: {
title: i18n.t('AccountBackupPlanDetail'),
title: i18n.t('AccountBackupDetail'),
activeMenu: '/console/accounts/automations'
},
hidden: true
@@ -423,14 +423,14 @@ export default [
{
path: 'executions',
component: () => import('@/views/accounts/AccountBackup/AccountBackupDetail/AccountBackupExecution/AccountBackupExecutionList.vue'),
name: 'AccountBackupPlanExecutionList',
name: 'AccountBackupExecutionList',
meta: { title: i18n.t('ExecutionDetail') },
hidden: true
},
{
path: 'executions/:id',
component: () => import('@/views/accounts/AccountBackup/AccountBackupDetail/AccountBackupExecution/AccountBackupExecutionDetail/index.vue'),
name: 'AccountBackupPlanExecutionDetail',
name: 'AccountBackupExecutionDetail',
meta: { title: i18n.t('ExecutionDetail') },
hidden: true
}

View File

@@ -8,7 +8,7 @@ import getChangeSecretFields from '@/views/accounts/AccountBackup/fields'
import { encryptPassword } from '@/utils/crypto'
export default {
name: 'AccountBackupPlanUpdate',
name: 'AccountBackupUpdate',
components: {
GenericCreateUpdatePage
},

View File

@@ -10,7 +10,7 @@
import AutoDetailCard from '@/components/Cards/DetailCard/auto'
export default {
name: 'AccountBackupPlanExecutionInfo',
name: 'AccountBackupExecutionInfo',
components: {
AutoDetailCard
},

View File

@@ -8,18 +8,18 @@
<script>
import { GenericDetailPage } from '@/layout/components'
import AccountBackupPlanExecutionInfo from './AccountBackupExecutionInfo.vue'
import AccountBackupExecutionInfo from './AccountBackupExecutionInfo.vue'
export default {
components: {
GenericDetailPage,
AccountBackupPlanExecutionInfo
AccountBackupExecutionInfo
},
data() {
return {
execution: { id: '' },
config: {
activeMenu: 'AccountBackupPlanExecutionInfo',
activeMenu: 'AccountBackupExecutionInfo',
actions: {
detailApiUrl: `/api/v1/accounts/account-backup-plan-executions/${this.$route.params.id}/`,
hasUpdate: false,
@@ -28,7 +28,7 @@ export default {
submenu: [
{
title: this.$t('Basic'),
name: 'AccountBackupPlanExecutionInfo'
name: 'AccountBackupExecutionInfo'
}
],
getTitle: this.getExecutionTitle

View File

@@ -8,7 +8,7 @@ import { openTaskPage } from '@/utils/jms'
import { DetailFormatter } from '@/components/Table/TableFormatters'
export default {
name: 'AccountBackupPlanExecutionList',
name: 'AccountBackupExecutionList',
components: {
GenericListTable
},
@@ -40,7 +40,7 @@ export default {
formatterArgs: {
getTitle: ({ row }) => row.snapshot.name,
getRoute: ({ row }) => ({
name: 'AccountBackupPlanDetail',
name: 'AccountBackupDetail',
params: { id: row.plan }
})
},
@@ -71,7 +71,7 @@ export default {
title: this.$t('Detail'),
type: 'info',
callback: function({ row }) {
return this.$router.push({ name: 'AccountBackupPlanExecutionDetail', params: { id: row.id }})
return this.$router.push({ name: 'AccountBackupExecutionDetail', params: { id: row.id }})
}
}
]

View File

@@ -15,7 +15,7 @@ import AutoDetailCard from '@/components/Cards/DetailCard/auto'
import { openTaskPage } from '@/utils/jms'
export default {
name: 'AccountBackupPlanInfo',
name: 'AccountBackupInfo',
components: {
AutoDetailCard,
QuickActions

View File

@@ -8,24 +8,24 @@
<script>
import { GenericDetailPage } from '@/layout/components'
import AccountBackupPlanInfo from './AccountBackupInfo.vue'
import AccountBackupPlanExecutionList from './AccountBackupExecution/AccountBackupExecutionList.vue'
import AccountBackupInfo from './AccountBackupInfo.vue'
import AccountBackupExecutionList from './AccountBackupExecution/AccountBackupExecutionList.vue'
export default {
components: {
GenericDetailPage,
AccountBackupPlanInfo,
AccountBackupPlanExecutionList
AccountBackupInfo,
AccountBackupExecutionList
},
data() {
return {
plan: { name: '', comment: '' },
config: {
activeMenu: 'AccountBackupPlanInfo',
activeMenu: 'AccountBackupInfo',
submenu: [
{
title: this.$t('Basic'),
name: 'AccountBackupPlanInfo'
name: 'AccountBackupInfo'
}
],
actions: {

View File

@@ -8,7 +8,7 @@ import { ArrayFormatter, DetailFormatter } from '@/components/Table/TableFormatt
import { openTaskPage } from '@/utils/jms'
export default {
name: 'AccountBackupPlanList',
name: 'AccountBackupList',
components: {
GenericListTable
},
@@ -36,7 +36,7 @@ export default {
name: {
formatter: DetailFormatter,
formatterArgs: {
route: 'AccountBackupPlanDetail'
route: 'AccountBackupDetail'
}
},
types: {
@@ -55,7 +55,7 @@ export default {
return {
name: 'AccountBackupList',
query: {
tab: 'AccountBackupPlanExecutionList',
tab: 'AccountBackupExecutionList',
plan_id: row.id
}
}
@@ -65,10 +65,10 @@ export default {
actions: {
formatterArgs: {
onClone: ({ row }) => {
vm.$router.push({ name: 'AccountBackupPlanCreate', query: { clone_from: row.id }})
vm.$router.push({ name: 'AccountBackupCreate', query: { clone_from: row.id }})
},
onUpdate: ({ row }) => {
vm.$router.push({ name: 'AccountBackupPlanUpdate', params: { id: row.id }})
vm.$router.push({ name: 'AccountBackupUpdate', params: { id: row.id }})
},
extraActions: [
{
@@ -96,7 +96,7 @@ export default {
hasImport: false,
createRoute: () => {
return {
name: 'AccountBackupPlanCreate'
name: 'AccountBackupCreate'
}
}
}

View File

@@ -13,17 +13,17 @@ export default {
data() {
return {
config: {
activeMenu: 'AccountBackupPlanList',
activeMenu: 'AccountBackupList',
submenu: [
{
title: this.$t('AccountBackup'),
name: 'AccountBackupPlanList',
name: 'AccountBackupList',
hidden: !this.$hasPerm('accounts.view_accountbackupautomation'),
component: () => import('@/views/accounts/AccountBackup/AccountBackupList.vue')
},
{
title: this.$t('ExecutionList'),
name: 'AccountBackupPlanExecutionList',
name: 'AccountBackupExecutionList',
hidden: !this.$hasPerm('accounts.view_accountbackupexecution'),
component: () => import('@/views/accounts/AccountBackup/AccountBackupDetail/AccountBackupExecution/AccountBackupExecutionList.vue')
}

View File

@@ -9127,7 +9127,7 @@ npm-normalize-package-bin@^1.0.0, npm-normalize-package-bin@^1.0.1:
resolved "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz"
integrity sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==
npm-package-arg@^8.0.0, npm-package-arg@^8.0.1, npm-package-arg@^8.1.0, npm-package-arg@^8.1.2, npm-package-arg@^8.1.4, npm-package-arg@^8.1.5:
npm-package-arg@^8.0.0, npm-package-arg@^8.0.1, npm-package-arg@^8.1.0, npm-package-arg@^8.1.1, npm-package-arg@^8.1.2, npm-package-arg@^8.1.5:
version "8.1.5"
resolved "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.5.tgz"
integrity sha512-LhgZrg0n0VgvzVdSm1oiZworPbTxYHUJCgtsJW8mGvlDpxTM1vSJc3m5QZeUkhAHIzbz3VCHd/R4osi1L1Tg/Q==
@@ -9633,7 +9633,7 @@ p-try@^2.0.0:
resolved "https://registry.npmmirror.com/p-try/-/p-try-2.2.0.tgz"
integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==
pacote@^11.1.11, pacote@^11.2.6, pacote@^11.3.1, pacote@^11.3.4, pacote@^11.3.5:
pacote@^11.1.11, pacote@^11.2.6, pacote@^11.3.0, pacote@^11.3.1, pacote@^11.3.5:
version "11.3.5"
resolved "https://registry.npmjs.org/pacote/-/pacote-11.3.5.tgz"
integrity sha512-fT375Yczn4zi+6Hkk2TBe1x1sP8FgFsEIZ2/iWaXY2r/NkhDJfxbcn5paz1+RTFCyNf+dPnaoBDJoAxXSU8Bkg==