mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-12-26 07:24:10 +08:00
feat(connections): reset the ordering of columns
This commit is contained in:
parent
281bf45789
commit
9d3706f390
@ -1,3 +1,4 @@
|
||||
import { useI18n } from '@solid-primitives/i18n'
|
||||
import type {
|
||||
DragEventHandler,
|
||||
Draggable,
|
||||
@ -24,6 +25,7 @@ export default (props: {
|
||||
onOrderChange: (value: ColumnOrder) => void
|
||||
onVisibleChange: (value: ColumnVisibility) => void
|
||||
}) => {
|
||||
const [t] = useI18n()
|
||||
const [activeKey, setActiveKey] = createSignal<AccessorKey | null>(null)
|
||||
const onDragStart = ({ draggable }: { draggable: Draggable }) =>
|
||||
setActiveKey(draggable.id as AccessorKey)
|
||||
@ -100,7 +102,15 @@ export default (props: {
|
||||
<div class="sortable">{activeKey()}</div>
|
||||
</DragOverlay>
|
||||
</DragDropProvider>
|
||||
|
||||
<button
|
||||
class="btn btn-neutral btn-sm ml-auto mt-4 block"
|
||||
onClick={() => props.onOrderChange(Object.values(AccessorKey))}
|
||||
>
|
||||
{t('reset')}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<label class="modal-backdrop" for="connection-modal" />
|
||||
</div>
|
||||
</>
|
||||
|
@ -36,6 +36,7 @@ const dict = {
|
||||
source: 'Source',
|
||||
destination: 'Destination',
|
||||
close: 'Close',
|
||||
reset: 'Reset',
|
||||
},
|
||||
'zh-Hans': {
|
||||
add: '添加',
|
||||
@ -70,6 +71,7 @@ const dict = {
|
||||
source: '源地址',
|
||||
destination: '目标地址',
|
||||
close: '关闭',
|
||||
reset: '重置',
|
||||
},
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user