mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-25 14:25:23 +00:00
perf: 优化更新auth (#1018)
* perf: 优化更新auth * perf: 优化提交 Co-authored-by: ibuler <ibuler@qq.com>
This commit is contained in:
@@ -11,19 +11,20 @@
|
|||||||
:show-confirm="false"
|
:show-confirm="false"
|
||||||
width="70%"
|
width="70%"
|
||||||
v-on="$listeners"
|
v-on="$listeners"
|
||||||
@confirm="onConfirm()"
|
|
||||||
>
|
>
|
||||||
<slot />
|
<GenericCreateUpdateForm v-bind="iConfig" @submitSuccess="submitSuccess" />
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Dialog from '@/components/Dialog'
|
import Dialog from '@/components/Dialog'
|
||||||
|
import { GenericCreateUpdateForm } from '@/layout/components'
|
||||||
export default {
|
export default {
|
||||||
name: 'Base',
|
name: 'Base',
|
||||||
components: {
|
components: {
|
||||||
Dialog
|
Dialog,
|
||||||
|
GenericCreateUpdateForm
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
title: {
|
title: {
|
||||||
@@ -33,6 +34,14 @@ export default {
|
|||||||
value: {
|
value: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true
|
required: true
|
||||||
|
},
|
||||||
|
config: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({})
|
||||||
|
},
|
||||||
|
enableField: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -40,8 +49,15 @@ export default {
|
|||||||
visible: false
|
visible: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
iConfig() {
|
||||||
|
return this.config
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onConfirm() {
|
submitSuccess(res) {
|
||||||
|
this.$emit('input', !!res[this.enableField])
|
||||||
|
this.visible = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,17 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<BaseAuth v-model="value" :title="$t('setting.CASSetting')">
|
<BaseAuth
|
||||||
<GenericCreateUpdateForm v-bind="settings" />
|
:value="value"
|
||||||
</BaseAuth>
|
:config="settings"
|
||||||
|
:title="$t('setting.CASSetting')"
|
||||||
|
enable-field="AUTH_CAS"
|
||||||
|
v-on="$listeners"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import BaseAuth from './Base'
|
import BaseAuth from './Base'
|
||||||
import { GenericCreateUpdateForm } from '@/layout/components'
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Cas',
|
name: 'Cas',
|
||||||
components: {
|
components: {
|
||||||
BaseAuth,
|
BaseAuth
|
||||||
GenericCreateUpdateForm
|
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: {
|
||||||
@@ -21,7 +23,6 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
visible: false,
|
|
||||||
settings: {
|
settings: {
|
||||||
url: '/api/v1/settings/setting/?category=cas',
|
url: '/api/v1/settings/setting/?category=cas',
|
||||||
fields: [
|
fields: [
|
||||||
|
@@ -1,18 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<BaseAuth v-model="value" :title="$t('setting.DingTalk')">
|
<BaseAuth
|
||||||
<GenericCreateUpdateForm v-bind="$data" />
|
:value="value"
|
||||||
</BaseAuth>
|
:config="settings"
|
||||||
|
:title="$t('setting.DingTalk')"
|
||||||
|
enable-field="AUTH_DINGTALK"
|
||||||
|
v-on="$listeners"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import BaseAuth from './Base'
|
import BaseAuth from './Base'
|
||||||
import GenericCreateUpdateForm from '@/layout/components/GenericCreateUpdateForm'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DingTalk',
|
name: 'DingTalk',
|
||||||
components: {
|
components: {
|
||||||
BaseAuth,
|
BaseAuth
|
||||||
GenericCreateUpdateForm
|
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: {
|
||||||
@@ -23,6 +25,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
const vm = this
|
const vm = this
|
||||||
return {
|
return {
|
||||||
|
settings: {
|
||||||
url: '/api/v1/settings/setting/?category=dingtalk',
|
url: '/api/v1/settings/setting/?category=dingtalk',
|
||||||
moreButtons: [
|
moreButtons: [
|
||||||
{
|
{
|
||||||
@@ -62,6 +65,7 @@ export default {
|
|||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
}
|
}
|
||||||
|
@@ -1,18 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<BaseAuth v-model="value" :title="$t('setting.FeiShu')">
|
<BaseAuth
|
||||||
<GenericCreateUpdateForm v-bind="$data" />
|
:value="value"
|
||||||
</BaseAuth>
|
:config="settings"
|
||||||
|
:title="$t('setting.FeiShu')"
|
||||||
|
enable-field="AUTH_FIESHU"
|
||||||
|
v-on="$listeners"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import BaseAuth from './Base'
|
import BaseAuth from './Base'
|
||||||
import GenericCreateUpdateForm from '@/layout/components/GenericCreateUpdateForm'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Wecom',
|
name: 'Wecom',
|
||||||
components: {
|
components: {
|
||||||
BaseAuth,
|
BaseAuth
|
||||||
GenericCreateUpdateForm
|
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: {
|
||||||
@@ -23,6 +25,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
const vm = this
|
const vm = this
|
||||||
return {
|
return {
|
||||||
|
settings: {
|
||||||
url: '/api/v1/settings/setting/?category=feishu',
|
url: '/api/v1/settings/setting/?category=feishu',
|
||||||
hasDetailInMsg: false,
|
hasDetailInMsg: false,
|
||||||
moreButtons: [
|
moreButtons: [
|
||||||
@@ -61,6 +64,7 @@ export default {
|
|||||||
return 'put'
|
return 'put'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
}
|
}
|
||||||
|
@@ -1,18 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<BaseAuth v-model="value" title="OIDC">
|
<BaseAuth
|
||||||
<GenericCreateUpdateForm v-bind="settings" />
|
:value="value"
|
||||||
</BaseAuth>
|
:config="settings"
|
||||||
|
title="OIDC"
|
||||||
|
enable-field="AUTH_OPENID"
|
||||||
|
v-on="$listeners"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import BaseAuth from './Base'
|
import BaseAuth from './Base'
|
||||||
import { GenericCreateUpdateForm } from '@/layout/components'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'OIDC',
|
name: 'OIDC',
|
||||||
components: {
|
components: {
|
||||||
BaseAuth,
|
BaseAuth
|
||||||
GenericCreateUpdateForm
|
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: {
|
||||||
@@ -22,7 +24,6 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
visible: false,
|
|
||||||
settings: {
|
settings: {
|
||||||
url: '/api/v1/settings/setting/?category=oidc',
|
url: '/api/v1/settings/setting/?category=oidc',
|
||||||
fields: [
|
fields: [
|
||||||
|
@@ -1,17 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<BaseAuth v-model="value" :title="$t('setting.Radius')">
|
<BaseAuth
|
||||||
<GenericCreateUpdateForm v-bind="settings" />
|
:value="value"
|
||||||
</BaseAuth>
|
:config="settings"
|
||||||
|
:title="$t('setting.Radius')"
|
||||||
|
enable-field="AUTH_RADIUS"
|
||||||
|
v-on="$listeners"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import BaseAuth from './Base'
|
import BaseAuth from './Base'
|
||||||
import { GenericCreateUpdateForm } from '@/layout/components'
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Cas',
|
name: 'Cas',
|
||||||
components: {
|
components: {
|
||||||
BaseAuth,
|
BaseAuth
|
||||||
GenericCreateUpdateForm
|
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: {
|
||||||
@@ -21,7 +23,6 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
visible: false,
|
|
||||||
settings: {
|
settings: {
|
||||||
url: '/api/v1/settings/setting/?category=radius',
|
url: '/api/v1/settings/setting/?category=radius',
|
||||||
fields: [
|
fields: [
|
||||||
|
@@ -1,17 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<BaseAuth v-model="value" :title="$t('setting.SSO')">
|
<BaseAuth
|
||||||
<GenericCreateUpdateForm v-bind="settings" />
|
:value="value"
|
||||||
</BaseAuth>
|
:config="settings"
|
||||||
|
:title="$t('setting.SSO')"
|
||||||
|
enable-field="AUTH_SSO"
|
||||||
|
v-on="$listeners"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import BaseAuth from './Base'
|
import BaseAuth from './Base'
|
||||||
import { GenericCreateUpdateForm } from '@/layout/components'
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SSO',
|
name: 'SSO',
|
||||||
components: {
|
components: {
|
||||||
BaseAuth,
|
BaseAuth
|
||||||
GenericCreateUpdateForm
|
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: {
|
||||||
@@ -21,7 +23,6 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
visible: false,
|
|
||||||
settings: {
|
settings: {
|
||||||
url: '/api/v1/settings/setting/?category=sso',
|
url: '/api/v1/settings/setting/?category=sso',
|
||||||
fields: [
|
fields: [
|
||||||
|
@@ -1,18 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<BaseAuth v-model="value" :title="$t('setting.WeCom')">
|
<BaseAuth
|
||||||
<GenericCreateUpdateForm v-bind="$data" />
|
:value="value"
|
||||||
</BaseAuth>
|
:config="settings"
|
||||||
|
:title="$t('setting.WeCom')"
|
||||||
|
enable-field="AUTH_WECOM"
|
||||||
|
v-on="$listeners"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import BaseAuth from './Base'
|
import BaseAuth from './Base'
|
||||||
import GenericCreateUpdateForm from '@/layout/components/GenericCreateUpdateForm'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Wecom',
|
name: 'WeCom',
|
||||||
components: {
|
components: {
|
||||||
BaseAuth,
|
BaseAuth
|
||||||
GenericCreateUpdateForm
|
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: {
|
||||||
@@ -23,6 +25,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
const vm = this
|
const vm = this
|
||||||
return {
|
return {
|
||||||
|
settings: {
|
||||||
url: '/api/v1/settings/setting/?category=wecom',
|
url: '/api/v1/settings/setting/?category=wecom',
|
||||||
hasDetailInMsg: false,
|
hasDetailInMsg: false,
|
||||||
moreButtons: [
|
moreButtons: [
|
||||||
@@ -44,8 +47,7 @@ export default {
|
|||||||
[
|
[
|
||||||
this.$t('common.BasicInfo'),
|
this.$t('common.BasicInfo'),
|
||||||
[
|
[
|
||||||
'AUTH_WECOM', 'WECOM_CORPID', 'WECOM_AGENTID',
|
'AUTH_WECOM', 'WECOM_CORPID', 'WECOM_AGENTID', 'WECOM_SECRET'
|
||||||
'WECOM_SECRET'
|
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@@ -59,7 +61,8 @@ export default {
|
|||||||
return data
|
return data
|
||||||
},
|
},
|
||||||
submitMethod() {
|
submitMethod() {
|
||||||
return 'put'
|
return 'patch'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user