mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-13 03:15:48 +02:00
feat: generate password for user
This commit is contained in:
parent
92fb679b55
commit
5490e48d9f
19 changed files with 702 additions and 259 deletions
88
frontend/src/components/StdDataEntry/index.tsx
Normal file
88
frontend/src/components/StdDataEntry/index.tsx
Normal file
|
@ -0,0 +1,88 @@
|
|||
import StdDataEntry from './StdDataEntry.js'
|
||||
import {h} from 'vue'
|
||||
import {Input, Textarea, InputPassword} from 'ant-design-vue'
|
||||
import StdSelector from './compontents/StdSelector.vue'
|
||||
import StdSelect from './compontents/StdSelect.vue'
|
||||
import StdPassword from './compontents/StdPassword.vue'
|
||||
|
||||
interface IEdit {
|
||||
type: Function
|
||||
placeholder: any
|
||||
mask: any
|
||||
key: any
|
||||
value: any
|
||||
recordValueIndex: any
|
||||
selectionType: any
|
||||
api: Object,
|
||||
columns: any,
|
||||
data_key: any,
|
||||
disable_search: boolean,
|
||||
get_params: Object,
|
||||
description: string
|
||||
generate: boolean
|
||||
}
|
||||
|
||||
function readonly(edit: IEdit, dataSource: any, dataIndex: any) {
|
||||
return h('p', dataSource[dataIndex])
|
||||
}
|
||||
|
||||
function input(edit: IEdit, dataSource: any, dataIndex: any) {
|
||||
return h(Input, {
|
||||
placeholder: edit.placeholder?.() ?? '',
|
||||
value: dataSource?.[dataIndex],
|
||||
'onUpdate:value': value => {
|
||||
dataSource[dataIndex] = value
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function textarea(edit: IEdit, dataSource: any, dataIndex: any) {
|
||||
return h(Textarea, {
|
||||
placeholder: edit.placeholder?.() ?? '',
|
||||
value: dataSource?.[dataIndex],
|
||||
'onUpdate:value': value => {
|
||||
dataSource[dataIndex] = value
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function password(edit: IEdit, dataSource: any, dataIndex: any) {
|
||||
return <StdPassword
|
||||
v-model:value={dataSource[dataIndex]}
|
||||
generate={edit.generate}
|
||||
placeholder={edit.placeholder}
|
||||
/>
|
||||
}
|
||||
|
||||
function select(edit: IEdit, dataSource: any, dataIndex: any) {
|
||||
return <StdSelect
|
||||
v-model:value={dataSource[dataIndex]}
|
||||
mask={edit.mask}
|
||||
/>
|
||||
}
|
||||
|
||||
function selector(edit: IEdit, dataSource: any, dataIndex: any) {
|
||||
return <StdSelector
|
||||
v-model:selectedKey={dataSource[dataIndex]}
|
||||
value={edit.value}
|
||||
recordValueIndex={edit.recordValueIndex}
|
||||
selectionType={edit.selectionType}
|
||||
api={edit.api}
|
||||
columns={edit.columns}
|
||||
data_key={edit.data_key}
|
||||
disable_search={edit.disable_search}
|
||||
get_params={edit.get_params}
|
||||
description={edit.description}
|
||||
/>
|
||||
}
|
||||
|
||||
export {
|
||||
readonly,
|
||||
input,
|
||||
textarea,
|
||||
select,
|
||||
selector,
|
||||
password
|
||||
}
|
||||
|
||||
export default StdDataEntry
|
Loading…
Add table
Add a link
Reference in a new issue