Adding new Admin pages

Hi All,

Seem to be going around in circles and missing something simple (I’m guessing my answer might be hiding in one of the .conf files?) but how do you add new admin pages to Coronium backend admin panel? eg add a page for users to set some dynamic app content like the splash screen image?

I’m happy to working through the lua and tpl files but my issue is actually getting the new page to display

Have made a new folder in /usr/local/coronium/http/ (lets call it ‘test’ so located /usr/local/coronium/http/test) and added basic .lua and .tpl files (just based it on the users folder files). Add a link from admin page to open ‘test’ but just get the folder directory, not the displayed html .tpl file?

Videos from Chris mentioned a future update to add html pages but seems development never got that far. I can see how the .lua calls to 'local answer = coronium.template.render( ‘/usr/local/coronium/http/folder/view_whatever.tpl’, vars, true ) but still missing how to get it to display not as a directory structure

Cheers

You need to also add the route to Ngiinx/Open-Resty. Look at  /usr/local/coronium/conf/coronium.conf and add your route there. If you are enforcing SSL you will need to configure it in /usr/local/coronium/conf/coronium.conf.ssl also.

Hi Steven,

Thanks for the reply. Have since stumbled on the .coronium.conf files since posting and can see how they relate to the routing. Its odd as sometimes get a 404 error or 500 error? is they anything you could suggest? rebooting VPS doesn’t seem to help.  It must be something I’ve messed up in the coronium.conf. Would I just need to add one ‘location’ record under ‘#admin’ as below or also in another section:? maybe need to purge the server to retake the amended .conf?

location /test {
    limit_except GET POST {
      deny all;
    }

    include /usr/local/coronium/conf/auth.conf;

    default_type text/html;
    content_by_lua_file /usr/local/coronium/http/test/view_test.lua;
  }

Many thanks in advance

make sure you restart NGINX,“sudo service nginx restart” after you edit the routes. If that doesn’t help look at the log files to see why you are getting the 404 or 500 errors. 

Thanks Steven,

You’ve given me plenty to throw at this problem

Many thanks for your assistance!

Hope this noob question helps a few others out

Cheers

You need to also add the route to Ngiinx/Open-Resty. Look at  /usr/local/coronium/conf/coronium.conf and add your route there. If you are enforcing SSL you will need to configure it in /usr/local/coronium/conf/coronium.conf.ssl also.

Hi Steven,

Thanks for the reply. Have since stumbled on the .coronium.conf files since posting and can see how they relate to the routing. Its odd as sometimes get a 404 error or 500 error? is they anything you could suggest? rebooting VPS doesn’t seem to help.  It must be something I’ve messed up in the coronium.conf. Would I just need to add one ‘location’ record under ‘#admin’ as below or also in another section:? maybe need to purge the server to retake the amended .conf?

location /test {
    limit_except GET POST {
      deny all;
    }

    include /usr/local/coronium/conf/auth.conf;

    default_type text/html;
    content_by_lua_file /usr/local/coronium/http/test/view_test.lua;
  }

Many thanks in advance

make sure you restart NGINX,“sudo service nginx restart” after you edit the routes. If that doesn’t help look at the log files to see why you are getting the 404 or 500 errors. 

Thanks Steven,

You’ve given me plenty to throw at this problem

Many thanks for your assistance!

Hope this noob question helps a few others out

Cheers