Cirkus Serveri Forum
    • CoD4xAdmin
    • Recent
    • Popular
    • Groups
    • Users
    • Register
    • Login

    CoD4X Webadmin Issues

    Scheduled Pinned Locked Moved
    Support
    2
    2
    126
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • zeezZ
      zeez
      last edited by

      Hey,

      i tried setting up your webadmin tool.
      So far everything worked and i can access the site.
      Except when im trying to give my real user admin power from the dummy admin account. I get the following error:
      c354019d-4ae4-4947-b2e5-0f70522550fb-image.png

      I have logged the promise result in this function and appversion is null

      getAdminHome: function(req, res, next) {
      		BluebirdPromise.props({
      			appversion: Appversion.findOne({name:'CoD4x-WebAdmin'}).execAsync(),
      			cod4xversion: Cod4xversion.findOne({name:'CoD4x-Server'}).execAsync(),
      			local_servers: Servers.find({external_ip:false}).execAsync(),
      			external_servers: Servers.find({external_ip: true}).execAsync(),
      			sysinfo: Systemlogs.find({}).sort({createdAt: -1}).limit(30).execAsync(),
      			colors: Color.find({}).execAsync()
      		}).then (function(results){
      			const opsys = osName(os.platform());
      			if (S.startsWith(opsys, "Windows")==true){
      				addlocalServer = false;
      			} else {
      				addlocalServer = true;
      			}
      
      			res.render('admin/home/index.pug', {title: 'Admin Dashboard', results: results, addlocalServer: addlocalServer, csrfToken: req.csrfToken()});
      		}).catch(function(err) {
      			console.log(err);
      			res.redirect('/user/profile');
      		});
      	},
      

      I have checked the mongodb cod4xwebadmin db and there is not even a schema for Appversion, so im a bit confused what went wrong.
      Appreciate any help.
      Best regards zeez.

      EDIT: I have figured it out but im still confused how noone else caught this or how anyone successfully used this app...
      Basically in https://github.com/byNeHo/CoD4x-WebAdmin/blob/ce2b050edca2ce73739774f35bad21c337219097/app/seed/dbseed.js#L786
      in the function exit() you close mongodb connection. However each insertion calls exit. So obviously all the other wont happen.
      I commented out that line and closed the connection after all things are done and now it works just fine.
      I would recommend refactoring that file 🙂

      NeHoN 1 Reply Last reply Reply Quote 0
      • NeHoN
        NeHo Administrators @zeez
        last edited by

        @zeez will look at it in next update, there is another known issue with it

        useUnifiedTopology: true
        
        

        Since I already started some dependencies updates I will look at this to

        I keep hitting the 'Escape' key - but I'm still here. ...

        1 Reply Last reply Reply Quote 1
        • First post
          Last post

        0

        Online

        191

        Users

        268

        Topics

        1.2k

        Posts
        Powered & Designed by NeHo