Single word for a person who puts forth effort only in front of management
The term for the phenomenon, when you perform better under observation, is Hawthorne effect:
(also referred to as the observer effect) is a type of reactivity in which individuals modify or improve an aspect of their behavior in response to their awareness of being observed. wikipedia
I don't believe there is a succinct single word to define a person who is a slacker but pretends to work hard when the boss is watching. Sycophant and related adjectives come to mind but they are not specific enough.
If you look up synonyms for phony, you will find
dissembler, dissimulator, hypocrite, phoney, pretender, whited sepulcher. beguiler, cheater, deceiver, trickster, Tartuffe
thefreedictionary.com