forked from QuantumNous/new-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchannels-dialogs.tsx
More file actions
103 lines (88 loc) 路 3.43 KB
/
Copy pathchannels-dialogs.tsx
File metadata and controls
103 lines (88 loc) 路 3.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
Copyright (C) 2023-2026 QuantumNous
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { useChannels } from './channels-provider'
import { BalanceQueryDialog } from './dialogs/balance-query-dialog'
import { ChannelTestDialog } from './dialogs/channel-test-dialog'
import { CopyChannelDialog } from './dialogs/copy-channel-dialog'
import { EditTagDialog } from './dialogs/edit-tag-dialog'
import { FetchModelsDialog } from './dialogs/fetch-models-dialog'
import { MultiKeyManageDialog } from './dialogs/multi-key-manage-dialog'
import { OllamaModelsDialog } from './dialogs/ollama-models-dialog'
import { TagBatchEditDialog } from './dialogs/tag-batch-edit-dialog'
import { UpstreamUpdateDialog } from './dialogs/upstream-update-dialog'
import { ChannelMutateDrawer } from './drawers/channel-mutate-drawer'
export function ChannelsDialogs() {
const { open, setOpen, currentRow, upstream } = useChannels()
return (
<>
{/* Channel Create/Update Drawer */}
<ChannelMutateDrawer
open={open === 'create-channel' || open === 'update-channel'}
onOpenChange={(v) => !v && setOpen(null)}
currentRow={open === 'update-channel' ? currentRow : null}
/>
{/* Test Channel Dialog */}
<ChannelTestDialog
open={open === 'test-channel'}
onOpenChange={(v) => !v && setOpen(null)}
/>
{/* Balance Query Dialog */}
<BalanceQueryDialog
open={open === 'balance-query'}
onOpenChange={(v) => !v && setOpen(null)}
/>
{/* Fetch Models Dialog */}
<FetchModelsDialog
open={open === 'fetch-models'}
onOpenChange={(v) => !v && setOpen(null)}
/>
{/* Ollama Models Dialog */}
<OllamaModelsDialog
open={open === 'ollama-models'}
onOpenChange={(v) => !v && setOpen(null)}
/>
{/* Copy Channel Dialog */}
<CopyChannelDialog
open={open === 'copy-channel'}
onOpenChange={(v) => !v && setOpen(null)}
/>
{/* Multi-Key Management Dialog */}
<MultiKeyManageDialog
open={open === 'multi-key-manage'}
onOpenChange={(v) => !v && setOpen(null)}
/>
{/* Tag Batch Edit Dialog */}
<TagBatchEditDialog
open={open === 'tag-batch-edit'}
onOpenChange={(v) => !v && setOpen(null)}
/>
{/* Edit Tag Dialog */}
<EditTagDialog
open={open === 'edit-tag'}
onOpenChange={(v) => !v && setOpen(null)}
/>
{/* Upstream Model Update Dialog */}
<UpstreamUpdateDialog
open={upstream.showModal}
addModels={upstream.addModels}
removeModels={upstream.removeModels}
preferredTab={upstream.preferredTab}
confirmLoading={upstream.applyLoading}
onConfirm={upstream.applyUpdates}
onCancel={upstream.closeModal}
/>
</>
)
}