31 lines
914 B
JavaScript
31 lines
914 B
JavaScript
|
|
/**
|
|||
|
|
* pc-live | PBS Dashboard – RP PhoneSystem Pro Admin
|
|||
|
|
* Bettet das PBS Web-Dashboard per iframe ein.
|
|||
|
|
* URL kommt vom Server-Convar `setr pbs_web_url "http://..."` (server.cfg).
|
|||
|
|
*/
|
|||
|
|
const PBSDashboardApp = (() => {
|
|||
|
|
const WIN_ID = 'app-pbs-dashboard';
|
|||
|
|
|
|||
|
|
async function open() {
|
|||
|
|
// URL vom FiveM-Server lesen (Convar pbs_web_url)
|
|||
|
|
const res = await fetchNui('getPbsUrl');
|
|||
|
|
const url = (res && res.url) ? res.url : 'http://localhost:4088';
|
|||
|
|
|
|||
|
|
WindowManager.create({
|
|||
|
|
id: WIN_ID,
|
|||
|
|
title: 'PBS – PhoneSystem Dashboard',
|
|||
|
|
icon: '📞',
|
|||
|
|
width: 1200,
|
|||
|
|
height: 720,
|
|||
|
|
content: `<iframe
|
|||
|
|
src="${url}"
|
|||
|
|
style="flex:1;width:100%;height:100%;border:none;display:block;background:#0f172a"
|
|||
|
|
allowfullscreen
|
|||
|
|
sandbox="allow-scripts allow-same-origin allow-forms allow-popups"
|
|||
|
|
></iframe>`,
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return { open };
|
|||
|
|
})();
|