Move the creation/appending of the message in the html page

Reviewer: Tiff Go (Post Commit)

Issue: GCP-8814 /     GCP-8819