Skip to content

Commit

Permalink
Ensure that App IDs are not truncated in modal app list
Browse files Browse the repository at this point in the history
  • Loading branch information
mwaskom committed May 9, 2024
1 parent 66c8bc3 commit 4dab910
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions modal/cli/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import typer
from click import UsageError
from grpclib import GRPCError, Status
from rich.table import Column
from rich.text import Text

from modal._output import OutputManager, get_app_logs_loop
Expand Down Expand Up @@ -35,7 +36,14 @@ async def list(env: Optional[str] = ENV_OPTION, json: Optional[bool] = False):
"""List Modal apps that are currently deployed/running or recently stopped."""
env = ensure_env(env)

column_names = ["App ID", "Description", "State", "Tasks", "Created at", "Stopped at"]
columns = [
Column("App ID", min_width=25), # Ensure that App ID is not truncated in slim terminals
"Description",
"State",
"Tasks",
"Created at",
"Stopped at",
]
rows: List[List[Union[Text, str]]] = []
apps: List[api_pb2.AppStats] = await _list_apps(env)
now = time.time()
Expand Down Expand Up @@ -68,7 +76,7 @@ async def list(env: Optional[str] = ENV_OPTION, json: Optional[bool] = False):
)

env_part = f" in environment '{env}'" if env else ""
display_table(column_names, rows, json, title=f"Apps{env_part}")
display_table(columns, rows, json, title=f"Apps{env_part}")


@app_cli.command("logs")
Expand Down

0 comments on commit 4dab910

Please sign in to comment.