How can we tell if the system is in maintenance mode using code in the code studio / theme pack

We would like to show / do some stuff on screen when the system goes into maintenance mode. At the moment when the user clicks a submit or back button whilst the system is in maintenance mode nothing happens (the form wont submit, it doesnt redirect to maintenance page, or show a message). We would like to either show a banner to advise them to try again in 5 mins, or redirect to the maintenance page which will give them the same message.

Is there a way to retrieve the maintenance status of the app?

TIA

Hi @kevin.rowe ,

There’s isn’t a variable or anything to know you’re in maintenance mode, however, you are able to modify the maintenance page itself.

When you create a themepack, within the frontend folder there is a maintenance.vue file which generates the maintenance page. You are able to code all of your logic within here for showing a banner, changing the message, etc.

Hope this helps! :slight_smile:

Hi

Thanks Ali

yes, we are in the process of creating a custom maintenance page in the themepack, but we want to be able to control when it appears. At the moment it will only appear when the user clicks refresh in the browser, however we would like to display it when the user tries to click submit or a weblink too. The issue is, we have no way to tell if the platform is in maintenance mode when the button is clicked

Hi @kevin.rowe ,

I understand, and see why that would be useful.
I would suggest raising an Idea for having a variable that can be accessed to display whether or not the application is in maintenance mode.

Hope this helps :slight_smile: