You can create your own panel with this code. It will show TOC of current page.
{{velocity}}
#panelheader('Table of Contents')
{{context document="$services.model.serialize($doc.documentReference)" transformationContext="document"}}
{{toc/}}
{{/context}}
#panelfooter()
{{/velocity}}