Web site configuration
Add a Site
- To add sites, you need to modify the file
nui/assets/config.js
- Add a line in the
config.sites
array
Line Format:
{
name: "Name displayed on the tablet",
icon: "img/your_image.png",
href: "unique_name",
url: "website_url"
}
Warning, the href must be unique and cannot be used on another site!
Example
Before:
const config = {
sites : [
{ name: 'Xelyos', icon: 'img/xelyos.png', href: 'xelyosapp', url: "https://xelyos.fr" },
{ name: 'Mail RP', icon: 'img/mailrp.png', href: 'mailrpapp', url: "https://mail-rp.com" },
{ name: 'Top Serveur', icon: 'img/top-serveur.png', href: 'topserveurapp', url: "https://top-serveurs.net" },
{ name: 'COP app', icon: 'img/lspd.png', href: 'copapp', url: "https://intranet-lspd.xelyos.fr" },
{ name: 'SECOURS app', icon: 'img/samu.png', href: 'secoursapp', url: "https://intranet-ems.xelyos.fr" },
]
};
New Site:
{
name: "Intranet Xelyos",
icon: "img/intranet.png",
href: "intranetxelyos",
url: "http://intranet-rp.com"
}
After:
const config = {
sites : [
{ name: 'Xelyos', icon: 'img/xelyos.png', href: 'xelyosapp', url: "https://xelyos.fr" },
{ name: 'Mail RP', icon: 'img/mailrp.png', href: 'mailrpapp', url: "https://mail-rp.com" },
{ name: 'Top Serveur', icon: 'img/top-serveur.png', href: 'topserveurapp', url: "https://top-serveurs.net" },
{ name: 'COP app', icon: 'img/lspd.png', href: 'copapp', url: "https://intranet-lspd.xelyos.fr" },
{ name: 'SECOURS app', icon: 'img/samu.png', href: 'secoursapp', url: "https://intranet-ems.xelyos.fr" },
{ name: "Intranet Xelyos", icon: "img/intranet.png", href: "intranetxelyos", url: "http://intranet-rp.com" },
]
};
- The image linked to your site must be located in the
nui/img
directory
Change the Background Color
- You can also change the background color by adding/modifying the
nui/assets/color.css
file
.application > #unique_number {
background: #37517e;
background: linear-gradient(to right, #37517e, #142747);
}
Limit Access to a Site for a Job
To restrict access to a site for a job, you need to modify the file nui/assets/config.js
.
Restriction Format:
{
job_name: "job_name",
sites: [
{ name: 'COP app', icon: 'img/lspd.png', href: 'copapp', url: "https://intranet-lspd.xelyos.fr" }
]
}
Warning, the line in the sites array must be identical to the one in the config.sites
variable!
Example
Variable with all sites:
const config = {
sites : [
{ name: 'Xelyos', icon: 'img/xelyos.png', href: 'xelyosapp', url: "https://xelyos.fr" },
{ name: 'Mail RP', icon: 'img/mailrp.png', href: 'mailrpapp', url: "https://mail-rp.com" },
{ name: 'Top Serveur', icon: 'img/top-serveur.png', href: 'topserveurapp', url: "https://top-serveurs.net" },
{ name: 'COP app', icon: 'img/lspd.png', href: 'copapp', url: "https://intranet-lspd.xelyos.fr" },
{ name: 'SECOURS app', icon: 'img/samu.png', href: 'secoursapp', url: "https://intranet-ems.xelyos.fr" },
{ name: "Intranet Xelyos", icon: "img/intranet.png", href: "intranetxelyos", url: "http://intranet-rp.com" },
]
};
Variable with the restriction:
const jobSites = [
{
job_name: "police",
sites: [
{ name: 'COP app', icon: 'img/lspd.png', href: 'copapp', url: "https://intranet-lspd.xelyos.fr" },
{ name: "Intranet Xelyos", icon: "img/intranet.png", href: "intranetxelyos", url: "http://intranet-rp.com" },
]
},
{
job_name: "ambulance",
sites: [
{ name: 'SECOURS app', icon: 'img/samu.png', href: 'secoursapp', url: "https://intranet-ems.xelyos.fr" },
{ name: "Intranet Xelyos", icon: "img/intranet.png", href: "intranetxelyos", url: "http://intranet-rp.com" },
]
}
];
With this configuration:
- The site Intranet Xelyos will be accessible for the police and ambulance jobs
- The site COP App will only be accessible for the police job
- The site Secours App will only be accessible for the ambulance job