I agree the whole thing is a mess; the Palestinians undoubtedly have some legitimate grievances dating back to the foundation of Israel but I don't see that ever being undone. Israel clearly now needs to protect its own citizens and is entitled to feel very aggrieved about the most recent Hamas attacks. But Israel has the same problem that we had in Belfast & Londonderry back in the 70's & 80's - I doubt that everyone in Gaza is a member of Hamas and you cannot win against a terrorist community hiding in the civilian population by attacking large numbers of the population, killing people and destroying homes. Every Palestinian child witnessing what Israel does today is a potential terrorist in 5, 10, 15 years time as they seek revenge for today's pain on top of the pain of 1948/9 etc.
Iran, of course, are fomenting the trouble because of their clear and explicit hatred of Israel and a racist attitude to Jews. It is noticeable that the other Arab nations, such as Egypt and Jordan, are not falling over themselves to support the Palestinians - they know that accepting Israel's existence is, in the long term, necessary for middle eastern peace and being able to cohabit with the west.
I think that, somehow, Israel must be made to row back on the revenge aspects of the current operations and focus on more targeted efforts against specific individuals - the bullet is better than the bomb in that regard - and try (again, I know) to make some sort of accord with the more amenable and peaceable Palestinians, who themselves probably have no love for Hamas. Iran needs to butt out (difficult, I know) and the moderate Arab states must play their part even if it means appearing to side with Israel and risking their own internal tensions.
There are no easy answers and too many people with their own arses to cover and axes to grind, regardless of what they may do to the wider peace of the middle east and beyond.