You can attach the vertical piece of flooring with common builders panel adhesive. Then you will want to put a cap of some sort at the top. I use 1/2" X 1/2" aluminum angle, secured with small screws in front. More decorative trim is available, but isn't as rugged.
Looks like there was a past leak, or a lot of water boil-overs. I'd take it out, take it all apart and have the inside sandblasted, then repainted with high temp
paint. Actually a whole new cook top isn't all that expensive.