patch..
This commit is contained in:
@@ -17,6 +17,7 @@ type ModuleListViewProps = {
|
||||
controllingModuleNames: string[]
|
||||
listError: string | null
|
||||
installError: string | null
|
||||
allowRepositoryDeletion?: boolean
|
||||
onAddModuleTab: (module: ModuleRow) => void
|
||||
onOpenSource: (module: ModuleRow) => void
|
||||
onInstallModule: (module: ModuleRow) => void
|
||||
@@ -29,6 +30,7 @@ type ModuleListViewProps = {
|
||||
onInstallAll: () => void
|
||||
onStartAll: () => void
|
||||
onStopAll: () => void
|
||||
onOpenWorldEditor: () => void
|
||||
}
|
||||
|
||||
export default function ModuleListView({
|
||||
@@ -39,6 +41,7 @@ export default function ModuleListView({
|
||||
controllingModuleNames,
|
||||
listError,
|
||||
installError,
|
||||
allowRepositoryDeletion = true,
|
||||
onAddModuleTab,
|
||||
onOpenSource,
|
||||
onInstallModule,
|
||||
@@ -50,7 +53,8 @@ export default function ModuleListView({
|
||||
onRestartModule,
|
||||
onInstallAll,
|
||||
onStartAll,
|
||||
onStopAll
|
||||
onStopAll,
|
||||
onOpenWorldEditor
|
||||
}: ModuleListViewProps): React.JSX.Element {
|
||||
const [moduleFilter, setModuleFilter] = useState<ModuleFilter>('all')
|
||||
const [deleteConfirmModule, setDeleteConfirmModule] = useState<ModuleRow | null>(null)
|
||||
@@ -60,6 +64,7 @@ export default function ModuleListView({
|
||||
const runningCount = modules.filter((row) => row.state === 'running').length
|
||||
const stoppedCount = modules.filter((row) => row.state === 'stopped').length
|
||||
const installingAll = installingModuleName === '__all__'
|
||||
const bulkControlling = installingModuleName === '__start_all__' || installingModuleName === '__stop_all__'
|
||||
|
||||
useEffect(() => {
|
||||
const handleEscape = (event: KeyboardEvent): void => {
|
||||
@@ -102,6 +107,7 @@ export default function ModuleListView({
|
||||
onInstallAll={onInstallAll}
|
||||
onStartAll={onStartAll}
|
||||
onStopAll={onStopAll}
|
||||
onOpenWorldEditor={onOpenWorldEditor}
|
||||
/>
|
||||
<ModuleListHeader dark={dark} />
|
||||
{(listError || installError) && (
|
||||
@@ -122,6 +128,7 @@ export default function ModuleListView({
|
||||
module={row}
|
||||
installing={installingModuleName === row.name || (installingAll && row.state === 'uninstalled')}
|
||||
controlling={controllingModuleNames.includes(row.name)}
|
||||
bulkControlling={bulkControlling}
|
||||
onAddModuleTab={onAddModuleTab}
|
||||
onOpenSource={onOpenSource}
|
||||
onOpenParameters={(module) => {
|
||||
@@ -148,6 +155,7 @@ export default function ModuleListView({
|
||||
<ModuleDeleteConfirm
|
||||
dark={dark}
|
||||
module={deleteConfirmModule}
|
||||
allowRepositoryDeletion={allowRepositoryDeletion}
|
||||
onCancel={() => setDeleteConfirmModule(null)}
|
||||
onConfirm={(module, options) => {
|
||||
onDeleteModule(module, options)
|
||||
|
||||
Reference in New Issue
Block a user