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