President Obama and China’s leader Xi Jinping were very busy, and productive, in the last couple of days. Good. But what about America’s other Asian allies?

Obama’s plan to revive America’s Asian alliances seems to have fallen by the wayside. Our friends there, increasingly in fear of being left behind while China rises, have no choice but to kiss Beijing’s hand.

America used to be Asia’s predominant power, something Obama promised to maintain a few years ago in his much-heralded “pivot to Asia.” But the pivot never happened, and Xi is set to capture that top spot. He sure covets it.

Exhibit one: This week’s summit of the Asian-Pacific Economic Cooperation countries in Beijing.

The host choreographed every detail, from that traditional purplish attire worn by participants (which, for some reason, looked good only on Xi) to the agreements signed at the end, much to the delight of Obama’s supporters at home.

Xi surprised even the most hopeful of greens on Wednesday by signing a non-binding deal with Obama to limit the two countries’ carbon emissions.

The pact would actually start cutting US carbon emissions now (harm to our economy not yet fully calculated), while China stops the growth of its emissions by 2030.

But who’s counting? The deal moves us a tad closer to a global treaty that, on paper, would cut everybody’s emissions — a goal Obama has long advocated.

Never mind that he can only lower US emissions now by presidential fiat, as an emboldened Congress will fight those cuts tooth and nail.

And never mind that by the time any of this kicks in, Obama (and by then Xi as well) will long be gone from everyone’s rear view mirror.

But it’s a symbolic victory for Obama’s agenda.

Obama and Xi did sign a genuine win-win for both nations, assuming it actually materializes: a $1 trillion information-technology deal that would drop tariffs between the US and China.

As Obama said in Wednesday’s press conference with Xi, this week’s conversations “gave us the opportunity to debunk the notion that our pivot to Asia is about containing China.”

Wait, what? The fact is, the rest of Asia is desperately looking for someone to contain Xi. But time and again Obama has failed to fully side with Japan, the Philippines, South Korea, Vietnam, Taiwan and other US allies as China ratcheted up its territorial disputes with them.

So now these US allies turn to Asia’s new hegemon instead. Japanese Prime Minister Shinzo Abe, for one, last week politely agreed to disagree with Xi over ownership of the Senkaku islands in order to smooth ties with China on other fields.

The biggest dropped ball is the Trans Pacific Partnership. This is Obama’s ambitious initiative to create a free-trade zone with the United States and 11 of our allies on both sides of the ocean. It was to become the backbone of America’s “pivot” to Asia.

But talks bogged down from the start, with Japanese agriculture lobbyists, and America’s Big Labor and green lobbyists, blocking completion.

Ironically, the coming Republican majority in the Senate may give Obama the power to finally complete that deal by granting him “fast track” negotiating power, something Democratic Majority Leader Harry Reid has blocked for fear of offending those union and enviro lobbyists.

As a savvy Tokyo official told me this week, the trade deal isn’t dead yet, but no one expects any movement on it before the new Congress settles in.

China is happy for any delay. Beijing worries that the free-trade zone (which it has no interest in joining) would interfere with its plans to secure its place as the only economic power that counts in Asia.

As long as the trade deal is stalled, Xi can go on dominating.

But as the citizens of Hong Kong learned recently, if you live in Xi’s shadow, you play by Xi’s rules. The region’s heads of state are watching and wondering. Are they next? Does America care?

Making the Trans Pacific Partnership a reality would ease some of those fears. Unlike the deals that Obama inked with Xi, it would level the playing field and allow our allies to give China a fair run for its money.

Once he’s done basking in the applause over his deals with Xi, the president better return to his original plan, and do the hard work necessary to complete the free-trade zone. Otherwise, his Asian legacy will be “the pivot that went pfft.”