Barney,
from your pictures:
This is my educated guess:
from left to right, the first cable, 9 wires with the white unused, is the standard 9-pin motor cable.
Its 9 pins are:
3 phase wires: large yellow green blue with 3.9mm bullet crimps
5-pin female JST connector are the hall wires
the white unused wire is reserved for the speed sensor.
The two red and blue 2-pin female JST connectors are the brake sensors.
The damaged JST connector should be replaced with a new one.
If the wires are shorted, the motor will be cut off.
the two pairs of black wires are for the front light. There is a switch on the 810 LED panel that turns the front light on/off. You must have 40V bulb to connect to these wires. Don't use them otherwise. The other two JST connectors (2-pin red and blue + 3 pin white, yellow, black) are for the 810 LED panel.
The white plug with red green black wires cable is the throttle.
I guess the white and yellow wires from the same cable can be on/off switch for the throttle.
There is a female 3-pin JST that is half hidden beneath the blue phase wire seems to be the pedal sensor.
Please post some pictures of your controller, I'll match up the wiring for you.