I have a working JupyterHub that’s integrated with Slurm, and I’m trying to replicate what is shown in this link where they can shutdown the interactive Slurm session by selecting " File → Shut Down from the menu in the top left-hand side of a JupyterLab session". I have a screenshot attached just for reference:
There are different ways of integrating JupyterLab with SLURM. Your first link uses Open OnDemand, not JupyterHub.
When you launch JupyterLab via JupyterHub you’ll see the modified menu in your second screenshot. If you go to the Hub Control Panel (/hub/home) you should see a button to stop your server.
You can optionally configure JupyterHub to shutdown the singleuser server when a user logs out:
which means the Log Out menu item would be equivalent to Shut Down unless they had multiple singleuser servers in which case all would be shut down, instead of just one.
Being able to shut down a single server from the menu sounds like a nice enhancement, though it does make the UI slightly more complicated (novice users may not understand the difference between shutdown and logout).