[webui] move common code into mixin