It was all she could do to watch him leave.

Literal

She [topic-は] [he [subject-が] [is-leaving-去っていく] [nominalizer-の]] [object-を] watch [only by-だけで] one's-utmost was.

精一杯 ('one's utmost') with だった ('was') means 'was at one's limit.' The construction ~だけで精一杯 ('just by doing X, one is at the limit') conveys emotional or practical maxing-out. ~ていく adds the directional sense of fading-away to 去る ('leave'). The whole act of watching is nominalized with の.