Well, I can see that you have the intention to rely on tea tree oil to treat your eye infection, because the tea tree oil contains a lot of nutritions and vitamins, which could do your health good. However, it is not medication and could only help relieve your symptoms. Anyway, antibiotic medicines could be very useful so you can consult the doctor what is suitable for your problem. Also, try to make proper use of your eyes and be careful.
Yes, you could use the tea tree oil to treat your eye infection because of the moisture role. In addition, you'd better use the eye drops with anti-inflammation which will let you get rid of the invisible bacterium in the eyes. You should have the good rest for the eyes, not sitting in front of the computers for a long time.