If you read the instructions above the data entry fields, the instructions state to enter your name as it appears on your passport. So you'd put first name then middle name.
That said, it won't matter. I had the same predicament a couple of weeks ago and did enter my middle name followed by my first name. So the ticket didn't exactly match my passport - but it didn't matter to the airline nor did it matter to the security folks in Hanoi and Danang.