!
What on earth have you been doing all this time!
Literal
Until-now what-on-earth-[いったい] what [object-を] was-doing [explanatory-んだ]!
いったい is an emphatic interrogative intensifier — 'what on earth / what the hell,' never used as a standalone word. It typically scopes over the following interrogative (here 何). ~ていた is past progressive, 'was (continuously) doing.' The explanatory んだ sentence-ender gives the question a confrontational, demanding-an-explanation tone rather than a neutral request for information — pairs naturally with the scolding register.