minor UI improvements
This commit is contained in:
parent
a32334eaa3
commit
104a284f88
3 changed files with 17 additions and 15 deletions
|
|
@ -50,7 +50,7 @@ class MigrationContext:
|
|||
self.is_running = False
|
||||
|
||||
def _find_backup_path(self, server_id: str, base_dir_str: str) -> Path:
|
||||
"""Searches workspace for a DISCORD_BACKUP-{server_id} directory. Creates it if missing."""
|
||||
"""Searches workspace for a DISCORD_BACKUP-{server_id} directory. Returns the path (does not create)."""
|
||||
base_dir = Path(base_dir_str) if base_dir_str else Path(".")
|
||||
|
||||
# 1. Search inside the specific workspace directory first
|
||||
|
|
@ -66,11 +66,9 @@ class MigrationContext:
|
|||
logger.info(f"Found backup directory globally: {d}")
|
||||
return d
|
||||
|
||||
# If not found anywhere, create it inside the workspace
|
||||
base_dir.mkdir(exist_ok=True)
|
||||
# If not found anywhere, return the expected location inside the workspace
|
||||
new_path = base_dir / f"DISCORD_BACKUP-{server_id}"
|
||||
logger.info(f"No existing backup directory found for {server_id}. Creating new one: {new_path}")
|
||||
new_path.mkdir(exist_ok=True)
|
||||
logger.info(f"Using lazy backup path: {new_path}")
|
||||
return new_path
|
||||
|
||||
async def validate_all(self) -> Dict[str, Any]:
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ class ConfigSelectionScreen(Screen):
|
|||
lv = self.query_one("#config_list", ListView)
|
||||
lv.clear()
|
||||
for c in configs:
|
||||
lv.append(ListItem(Label(f"ReaperFiles-{c}"), name=c))
|
||||
lv.append(ListItem(Label(c), name=c))
|
||||
|
||||
def on_list_view_selected(self, event: ListView.Selected) -> None:
|
||||
cfg_name = event.item.name
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ Shows the appropriate pane(s) based on the mode:
|
|||
from pathlib import Path
|
||||
|
||||
from textual.app import ComposeResult
|
||||
from textual.containers import Container, Horizontal, VerticalScroll
|
||||
from textual.containers import Container, Vertical, Horizontal, VerticalScroll
|
||||
from textual.widgets import Header, Footer, Button, ContentSwitcher, Rule
|
||||
from textual.screen import Screen
|
||||
|
||||
|
|
@ -35,12 +35,15 @@ class ModeScreen(Screen):
|
|||
padding: 1 2;
|
||||
margin: 2 0;
|
||||
}
|
||||
#switcher {
|
||||
#switcher, #pane_backup, #pane_migrate {
|
||||
height: 1fr;
|
||||
}
|
||||
#mode_footer {
|
||||
height: auto;
|
||||
dock: bottom;
|
||||
}
|
||||
#bottom_actions {
|
||||
height: auto;
|
||||
dock: bottom;
|
||||
margin: 1 1 0 1;
|
||||
}
|
||||
#bottom_actions Button, #btn_switch {
|
||||
|
|
@ -126,6 +129,7 @@ class ModeScreen(Screen):
|
|||
yield BackupPane(self.cfg_name, self.config_path, id="pane_backup")
|
||||
yield ShuttlePane(self.cfg_name, self.config_path, id="pane_migrate")
|
||||
|
||||
with Vertical(id="mode_footer"):
|
||||
yield Rule()
|
||||
with Horizontal(id="bottom_actions"):
|
||||
if mode == "backup_transfer":
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue