/* ===== Radius.js (Vue 3 + TT-Core) ===== */ /* ---------- Root View: ---------- */ const Radius = { name: 'Radius', template: `
Radius

`, data() { return { view: 'users', window: window, _initFlags: {} }; }, computed: { viewOptions() { const options = [ { id: 'users', name: 'Benutzer', icon: 'fa-duotone fa-users' }, { id: 'free', name: 'Freie Benutzer', icon: 'fa-duotone fa-user-plus' }, { id: 'unused', name: 'Ungenutzte Benutzer', icon: 'fa-duotone fa-user-clock' }, { id: 'avmscanner', name: 'AVM Scanner', icon: 'fa-duotone fa-router' } ]; if (window.TT_CONFIG.CAN_BILLING === '1') { options.push( { id: 'ont', name: 'ONT Parser', icon: 'fa-duotone fa-diagram-project' }, { id: 'ontReverse', name: 'ONT Reverse', icon: 'fa-duotone fa-arrows-rotate' } ); } return options; } }, mounted() { this.switchView(this.view); }, methods: { switchView(v) { this.view = v; if (!this._initFlags || this._initFlags[v]) return; let refName = ''; if (v === 'free') refName = 'freeView'; else if (v === 'unused') refName = 'unusedView'; else if (v === 'avmscanner') refName = 'avmScannerView'; if (refName) { this.$nextTick(() => { const childComponent = this.$refs[refName]; if (childComponent && typeof childComponent.initIfNeeded === 'function') { childComponent.initIfNeeded(); this._initFlags[v] = true; } }); } } } }; // Register component with Vue 3 app if (window.VueApp) { window.VueApp.component('radius', Radius); }