Indonesian police have arrested 321 foreign nationals in a raid on an alleged online gambling operation in the country’s capital.