In a large bowl, combine the grated onion and drained potatoes. Add eggs, salt, black pepper, and flour, mixing well until a thick batter forms.
Heat olive oil in a non-stick pan over medium heat. Spoon the mixture into the pan, shaping into pancakes. Cook for about 2 minutes per side until golden and crisp. Transfer to paper towels.
Preheat the oven to 200°C (400°F). In a bowl, mix diced tomatoes, chopped dill, and half of the mozzarella.
Divide the tomato mixture over the pancakes, sprinkle with remaining mozzarella, and bake for 15 minutes until the cheese is fully melted.
Cool slightly and serve warm, garnished with extra fresh dill if desired.