mirror of
https://github.com/jumpserver/lina.git
synced 2025-11-08 02:18:44 +00:00
Compare commits
78 Commits
pr@dev@fix
...
v4.3.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56aa3caa83 | ||
|
|
9b6f54c1ed | ||
|
|
611341307b | ||
|
|
f8479c53ff | ||
|
|
e25bf46659 | ||
|
|
6d07307e56 | ||
|
|
6fb7fe8fa1 | ||
|
|
19cd497095 | ||
|
|
19b1dc0dbc | ||
|
|
77ef172a23 | ||
|
|
4596887bf1 | ||
|
|
0a3dc30c85 | ||
|
|
51d24bc8e5 | ||
|
|
1b15a4d043 | ||
|
|
7d3f818242 | ||
|
|
4e26f18d77 | ||
|
|
b22613617a | ||
|
|
e971cbf4a8 | ||
|
|
4672abae35 | ||
|
|
ba36d72602 | ||
|
|
4bfbbba4c5 | ||
|
|
ea038ce43a | ||
|
|
e16b19666c | ||
|
|
c7f5409eb6 | ||
|
|
fdbd7d2222 | ||
|
|
ddbaeeafea | ||
|
|
efb0e9dacb | ||
|
|
f6f8301ad5 | ||
|
|
9a63ae63d4 | ||
|
|
1e007ccda3 | ||
|
|
d1d0b06b53 | ||
|
|
5fb70d2f24 | ||
|
|
b54a95430f | ||
|
|
4d8b4c45af | ||
|
|
a6d642df60 | ||
|
|
2e74f1522f | ||
|
|
fe615e0314 | ||
|
|
09f734e6fc | ||
|
|
3117046342 | ||
|
|
b68aecb5cc | ||
|
|
1c9b155d97 | ||
|
|
75b1be9864 | ||
|
|
615c3c1cf4 | ||
|
|
4d82231af4 | ||
|
|
c6cf6571b6 | ||
|
|
8ea990d070 | ||
|
|
f4a32170d5 | ||
|
|
073508675e | ||
|
|
1d6ca0a93a | ||
|
|
36aea652d6 | ||
|
|
1a42ce90ab | ||
|
|
31a401b55d | ||
|
|
582a84178d | ||
|
|
9b9f7c936c | ||
|
|
2a6100957f | ||
|
|
16606d6a27 | ||
|
|
0a612f50e6 | ||
|
|
fe36fa9390 | ||
|
|
ba109900ec | ||
|
|
ec7768267f | ||
|
|
cc58b374ab | ||
|
|
04ffbb8fd6 | ||
|
|
49880f6739 | ||
|
|
e6f98d58c4 | ||
|
|
fd1f16d43c | ||
|
|
968b2415b1 | ||
|
|
776090d6ba | ||
|
|
3a37952288 | ||
|
|
62b8fc0e3b | ||
|
|
b2028869cb | ||
|
|
5277a725f8 | ||
|
|
f137788c1a | ||
|
|
f7d17c8de7 | ||
|
|
feea70b0be | ||
|
|
04696ef3d6 | ||
|
|
1731f4f788 | ||
|
|
6f25d93909 | ||
|
|
46461ec324 |
@@ -7,7 +7,6 @@ import BasicTree from '@/components/Form/FormFields/BasicTree.vue'
|
||||
import JsonEditor from '@/components/Form/FormFields/JsonEditor.vue'
|
||||
import { assignIfNot, toSentenceCase } from '@/utils/common'
|
||||
import TagInput from '@/components/Form/FormFields/TagInput.vue'
|
||||
import TransferSelect from '@/components/Form/FormFields/TransferSelect.vue'
|
||||
import i18n from '@/i18n/i18n'
|
||||
|
||||
export class FormFieldGenerator {
|
||||
@@ -135,9 +134,6 @@ export class FormFieldGenerator {
|
||||
case 'comment':
|
||||
field.el.type = 'textarea'
|
||||
break
|
||||
case 'users':
|
||||
field.component = TransferSelect
|
||||
field.el.label = field.label
|
||||
}
|
||||
return field
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-input v-model="iValue" v-bind="$attrs" v-on="$listeners">
|
||||
<el-input v-bind="$attrs" v-on="$listeners">
|
||||
<template slot="append">{{ iUnit }}</template>
|
||||
</el-input>
|
||||
</template>
|
||||
@@ -30,9 +30,6 @@ export default {
|
||||
computed: {
|
||||
iUnit() {
|
||||
return this.displayMapper[this.unit] || this.unit
|
||||
},
|
||||
iValue() {
|
||||
return this.$attrs.value ? this.$attrs.value : this.defaultValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
:table-url="tableUrl"
|
||||
v-bind="headerActions"
|
||||
/>
|
||||
<el-row :gutter="10" type="flex" class="the-row">
|
||||
<IBox v-if="totalData.length === 0" style="width: 100%">
|
||||
<el-row :gutter="10" class="the-row">
|
||||
<IBox v-if="totalData.length === 0">
|
||||
<el-empty :description="$t('NoData')" :image-size="200" class="no-data" style="padding: 20px" />
|
||||
</IBox>
|
||||
<el-col v-for="(d, index) in totalData" :key="index" style="max-width: 550px; width: 400px">
|
||||
<el-col v-for="(d, index) in totalData" :key="index" :lg="8" :md="12" :sm="24" style="min-width: 335px;">
|
||||
<el-card
|
||||
:body-style="{ 'text-align': 'center', 'padding': '15px' }"
|
||||
:class="{'is-disabled': isDisabled(d)}"
|
||||
@@ -56,7 +56,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<Pagination
|
||||
v-show="pagination"
|
||||
v-show="pagination && total > paginationSize"
|
||||
ref="pagination"
|
||||
class="pagination"
|
||||
v-bind="$data"
|
||||
@@ -234,8 +234,6 @@ export default {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.the-row {
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
margin-top: 15px;
|
||||
max-width: 1600px;
|
||||
text-align: center;
|
||||
@@ -249,13 +247,12 @@ export default {
|
||||
|
||||
::v-deep .el-card__body {
|
||||
height: 100%;
|
||||
padding: unset !important;
|
||||
|
||||
.el-row {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
margin-top: 0;
|
||||
height: 190px;
|
||||
height: 100%;
|
||||
|
||||
.image {
|
||||
display: flex;
|
||||
@@ -278,7 +275,6 @@ export default {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
padding: 10px;
|
||||
|
||||
.one-line {
|
||||
display: flex;
|
||||
@@ -300,14 +296,15 @@ export default {
|
||||
|
||||
.comment {
|
||||
display: -webkit-box;
|
||||
height: 120px;
|
||||
font-size: 12px;
|
||||
padding: 10px 0;
|
||||
line-height: 13px;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-line-clamp: 4;
|
||||
-webkit-box-flex: 1;
|
||||
-webkit-box-orient: vertical;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.tag-zone {
|
||||
@@ -315,7 +312,6 @@ export default {
|
||||
height: 30%;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
margin-top: 70px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,10 +234,12 @@ export default {
|
||||
delete routeFilter.search
|
||||
}
|
||||
const asFilterTags = _.cloneDeep(this.filterTags)
|
||||
this.filterTags = {
|
||||
...asFilterTags,
|
||||
...routeFilter
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.filterTags = {
|
||||
...asFilterTags,
|
||||
...routeFilter
|
||||
}
|
||||
}, 100)
|
||||
},
|
||||
getValueLabel(key, value) {
|
||||
for (const field of this.options) {
|
||||
|
||||
@@ -128,6 +128,8 @@ export function getErrorResponseMsg(error) {
|
||||
}).filter(i => i).join('; ')
|
||||
} else if (typeof data === 'string') {
|
||||
return data
|
||||
} else {
|
||||
msg = error.toString()
|
||||
}
|
||||
return msg
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import InputWithUnit from '@/components/Form/FormFields/InputWithUnit.vue'
|
||||
import store from '@/store'
|
||||
|
||||
const validatorInterval = (rule, value, callback) => {
|
||||
if (parseInt(value) < 1) {
|
||||
if (isNaN(parseInt(value, 10)) || parseInt(value) < 1) {
|
||||
return callback(new Error(i18n.t('EnsureThisValueIsGreaterThanOrEqualTo1')))
|
||||
}
|
||||
callback()
|
||||
|
||||
@@ -73,13 +73,7 @@ export default {
|
||||
btn.loading = true
|
||||
}
|
||||
})
|
||||
|
||||
if (form.value.interval && typeof form.value.interval === 'number') {
|
||||
form.value.interval = parseInt(form.value.interval, 10)
|
||||
} else {
|
||||
form.value.interval = 24
|
||||
}
|
||||
|
||||
form.value.interval = parseInt(form.value.interval, 10)
|
||||
this.$refs.form.$refs.form.dataForm.submitForm('form', false)
|
||||
},
|
||||
handleSubmitSuccess(res) {
|
||||
|
||||
@@ -39,7 +39,8 @@ export default {
|
||||
submitBtnSize: 'mini',
|
||||
submitBtnText: this.$t('Add'),
|
||||
hasReset: false,
|
||||
onSubmit: () => {},
|
||||
onSubmit: () => {
|
||||
},
|
||||
submitMethod: () => 'post',
|
||||
getUrl: () => '',
|
||||
cleanFormValue(data) {
|
||||
@@ -86,7 +87,11 @@ export default {
|
||||
this.formConfig.fieldsMeta.protocols.el.hidden = true
|
||||
}
|
||||
this.resourceType = val
|
||||
this.formConfig.fieldsMeta.value.el.ajax.url = url
|
||||
if (url) {
|
||||
this.formConfig.fieldsMeta.value.el.ajax.url = url
|
||||
} else {
|
||||
this.formConfig.fieldsMeta.attr.el.remote = false
|
||||
}
|
||||
this.formConfig.fieldsMeta.value.el.options = options
|
||||
}
|
||||
}
|
||||
@@ -151,21 +156,31 @@ export default {
|
||||
tableConfig: {
|
||||
columns: [
|
||||
{ prop: 'attr', label: this.$t('ResourceType'), formatter: tableFormatter('resource_type') },
|
||||
{ prop: 'value', label: this.$t('Resource'), formatter: tableFormatter('resource', () => { return this.globalResource }) },
|
||||
{
|
||||
prop: 'value', label: this.$t('Resource'), formatter: tableFormatter('resource', () => {
|
||||
return this.globalResource
|
||||
})
|
||||
},
|
||||
{ prop: 'protocols', label: this.$t('Other'), formatter: tableFormatter('protocols') },
|
||||
{ prop: 'action', label: this.$t('Action'), align: 'center', width: '100px', formatter: (row, col, cellValue, index) => {
|
||||
return (
|
||||
<div className='input-button'>
|
||||
<el-button
|
||||
icon='el-icon-minus'
|
||||
size='mini'
|
||||
style={{ 'flexShrink': 0 }}
|
||||
type='danger'
|
||||
onClick={ this.handleDelete(index) }
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
} }
|
||||
{
|
||||
prop: 'action',
|
||||
label: this.$t('Action'),
|
||||
align: 'center',
|
||||
width: '100px',
|
||||
formatter: (row, col, cellValue, index) => {
|
||||
return (
|
||||
<div className='input-button'>
|
||||
<el-button
|
||||
icon='el-icon-minus'
|
||||
size='mini'
|
||||
style={{ 'flexShrink': 0 }}
|
||||
type='danger'
|
||||
onClick={this.handleDelete(index)}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
],
|
||||
totalData: this.value || [],
|
||||
hasPagination: false
|
||||
@@ -177,7 +192,9 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.nameOptions.map((o) => { this.globalResource[o.value] = o.label })
|
||||
this.nameOptions.map((o) => {
|
||||
this.globalResource[o.value] = o.label
|
||||
})
|
||||
},
|
||||
onSubmit() {
|
||||
this.$emit('input', this.tableConfig.totalData)
|
||||
@@ -218,9 +235,11 @@ export default {
|
||||
::v-deep .el-form-item:nth-child(-n+3) {
|
||||
width: 43.5%;
|
||||
}
|
||||
|
||||
::v-deep .el-form-item:last-child {
|
||||
width: 6%;
|
||||
}
|
||||
|
||||
.action-input {
|
||||
margin-top: -10px;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@ export default {
|
||||
'AUTH_PASSKEY', 'FIDO_SERVER_ID', 'FIDO_SERVER_NAME'
|
||||
],
|
||||
fieldsMeta: {
|
||||
'FIDO_SERVER_ID': {
|
||||
placeholder: 'js.example.org'
|
||||
}
|
||||
},
|
||||
submitMethod() {
|
||||
return 'patch'
|
||||
@@ -30,8 +33,7 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<el-form-item style="float: right">
|
||||
<template v-if="hasActionPerm">
|
||||
<el-button
|
||||
:disabled="object.status.value === 'closed'"
|
||||
:disabled="isDisabled || object.status.value === 'closed'"
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="handleApprove"
|
||||
@@ -33,7 +33,7 @@
|
||||
<i class="fa fa-check" /> {{ $t('Accept') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
:disabled="object.status.value === 'closed'"
|
||||
:disabled="isDisabled || object.status.value === 'closed'"
|
||||
size="small"
|
||||
type="warning"
|
||||
@click="handleReject"
|
||||
@@ -43,7 +43,7 @@
|
||||
</template>
|
||||
<el-button
|
||||
v-if="isSelfTicket"
|
||||
:disabled="object.status.value === 'closed'"
|
||||
:disabled="isDisabled || object.status.value === 'closed'"
|
||||
size="small"
|
||||
type="danger"
|
||||
@click="handleClose"
|
||||
@@ -92,6 +92,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isDisabled: false,
|
||||
comments: '',
|
||||
type_api: '',
|
||||
imageUrl: require('@/assets/img/avatar.png'),
|
||||
@@ -154,17 +155,35 @@ export default {
|
||||
this.createComment(function() {
|
||||
})
|
||||
const url = `/api/v1/tickets/${this.type_api}/${this.object.id}/approve/`
|
||||
this.$axios.put(url).then(res => this.reloadPage()).catch(err => this.$message.error(err))
|
||||
this.$axios.put(url).then(res => {
|
||||
this.reloadPage()
|
||||
}).catch(err => {
|
||||
this.$message.error(err)
|
||||
}).finally(() => {
|
||||
this.isDisabled = false
|
||||
})
|
||||
},
|
||||
defaultReject() {
|
||||
this.createComment(function() {
|
||||
})
|
||||
const url = `/api/v1/tickets/${this.type_api}/${this.object.id}/reject/`
|
||||
this.$axios.put(url).then(res => this.reloadPage()).catch(err => this.$message.error(err))
|
||||
this.$axios.put(url).then(res => {
|
||||
this.reloadPage()
|
||||
}).catch(err => {
|
||||
this.$message.error(err)
|
||||
}).finally(() => {
|
||||
this.isDisabled = false
|
||||
})
|
||||
},
|
||||
defaultClose() {
|
||||
const url = `/api/v1/tickets/${this.type_api}/${this.object.id}/close/`
|
||||
this.$axios.put(url).then(res => this.reloadPage()).catch(err => this.$message.error(err))
|
||||
this.$axios.put(url).then(res => {
|
||||
this.reloadPage()
|
||||
}).catch(err => {
|
||||
this.$message.error(err)
|
||||
}).finally(() => {
|
||||
this.isDisabled = false
|
||||
})
|
||||
},
|
||||
createComment(successCallback) {
|
||||
const commentText = this.form.comments
|
||||
@@ -185,17 +204,42 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
handleAction(actionType) {
|
||||
if (this.isDisabled) {
|
||||
return
|
||||
}
|
||||
|
||||
this.isDisabled = true
|
||||
let handler
|
||||
switch (actionType) {
|
||||
case 'approve':
|
||||
handler = this.approve || this.defaultApprove
|
||||
break
|
||||
case 'reject':
|
||||
handler = this.reject || this.defaultReject
|
||||
break
|
||||
case 'close':
|
||||
handler = this.close || this.defaultClose
|
||||
break
|
||||
default:
|
||||
handler = null
|
||||
break
|
||||
}
|
||||
|
||||
if (handler) {
|
||||
handler()
|
||||
} else {
|
||||
this.$message.error('No handler for action')
|
||||
}
|
||||
},
|
||||
handleApprove() {
|
||||
const handler = this.approve || this.defaultApprove
|
||||
handler()
|
||||
this.handleAction('approve')
|
||||
},
|
||||
handleReject() {
|
||||
const handler = this.reject || this.defaultReject
|
||||
handler()
|
||||
this.handleAction('reject')
|
||||
},
|
||||
handleClose() {
|
||||
const handler = this.close || this.defaultClose
|
||||
handler()
|
||||
this.handleAction('close')
|
||||
},
|
||||
handleComment() {
|
||||
this.createComment(
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
<script>
|
||||
import { GenericCreateUpdatePage } from '@/layout/components'
|
||||
import TransSelect from '@/components/Form/FormFields/TransferSelect.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -23,7 +22,6 @@ export default {
|
||||
],
|
||||
fieldsMeta: {
|
||||
users: {
|
||||
component: TransSelect,
|
||||
el: {
|
||||
url: '/api/v1/users/users/?fields_size=mini&order=name',
|
||||
ajax: {
|
||||
|
||||
Reference in New Issue
Block a user