302 lines
16 KiB
XML
302 lines
16 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
|
|
<!-- UniFi Site List View -->
|
|
<record id="view_unifi_site_list" model="ir.ui.view">
|
|
<field name="name">unifi.site.list</field>
|
|
<field name="model">unifi.site</field>
|
|
<field name="arch" type="xml">
|
|
<list string="UniFi Sites" js_class="unifi_site_list">
|
|
<field name="name"/>
|
|
<field name="site_id"/>
|
|
<field name="api_type"/>
|
|
<field name="active"/>
|
|
<field name="last_sync" optional="show"/>
|
|
<field name="create_date" optional="show"/>
|
|
<button name="action_import_site" string="Importer" type="object" icon="fa-download" class="oe_highlight"/>
|
|
</list>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- UniFi Site Form View -->
|
|
<record id="view_unifi_site_form" model="ir.ui.view">
|
|
<field name="name">unifi.site.form</field>
|
|
<field name="model">unifi.site</field>
|
|
<field name="arch" type="xml">
|
|
<form string="UniFi Site">
|
|
<header>
|
|
<button name="action_sync_now" string="Synchronize Now" type="object" class="btn-primary"/>
|
|
<button name="action_test_connection" string="Test Connection" type="object" class="btn-secondary"/>
|
|
</header>
|
|
<sheet>
|
|
<div class="oe_button_box" name="button_box">
|
|
<!-- Boutons statistiques communs à tous les types d'API -->
|
|
<button name="action_view_api_logs"
|
|
type="object"
|
|
class="oe_stat_button"
|
|
icon="fa-history">
|
|
<div class="o_stat_info">
|
|
<span class="o_stat_text">API Logs</span>
|
|
</div>
|
|
</button>
|
|
<button name="action_view_sync_jobs"
|
|
type="object"
|
|
class="oe_stat_button"
|
|
icon="fa-refresh">
|
|
<div class="o_stat_info">
|
|
<span class="o_stat_text">Sync Jobs</span>
|
|
</div>
|
|
</button>
|
|
|
|
<!-- Boutons spécifiques au Controller -->
|
|
<button name="action_view_networks"
|
|
type="object"
|
|
class="oe_stat_button"
|
|
icon="fa-sitemap"
|
|
invisible="context.get('api_type') != 'controller'">
|
|
<field name="network_count" widget="statinfo" string="Networks"/>
|
|
</button>
|
|
<button name="action_view_devices"
|
|
type="object"
|
|
class="oe_stat_button"
|
|
icon="fa-server"
|
|
invisible="context.get('api_type') != 'controller'">
|
|
<field name="device_count" widget="statinfo" string="Devices"/>
|
|
</button>
|
|
<button name="action_view_users"
|
|
type="object"
|
|
class="oe_stat_button"
|
|
icon="fa-users"
|
|
invisible="context.get('api_type') != 'controller'">
|
|
<field name="user_count" widget="statinfo" string="Users"/>
|
|
</button>
|
|
|
|
<!-- Boutons spécifiques au Site Manager -->
|
|
<button name="action_view_firewall_rules"
|
|
type="object"
|
|
class="oe_stat_button"
|
|
icon="fa-shield"
|
|
invisible="context.get('api_type') != 'site_manager'">
|
|
<field name="firewall_rule_count" widget="statinfo" string="Firewall Rules"/>
|
|
</button>
|
|
</div>
|
|
|
|
<div class="oe_title">
|
|
<h1>
|
|
<field name="name" placeholder="Site Name"/>
|
|
</h1>
|
|
</div>
|
|
<group>
|
|
<group>
|
|
<field name="site_id"/>
|
|
<field name="api_type" widget="radio"/>
|
|
<field name="active"/>
|
|
</group>
|
|
<group>
|
|
<field name="timestamp" readonly="1"/>
|
|
<field name="last_sync" readonly="1"/>
|
|
<field name="import_status" readonly="1"/>
|
|
</group>
|
|
</group>
|
|
|
|
<!-- Informations de connexion pour Controller API -->
|
|
<group string="Informations de connexion" invisible="context.get('api_type') != 'controller'">
|
|
<group>
|
|
<field name="host" required="context.get('api_type') == 'controller'"/>
|
|
<field name="port" required="context.get('api_type') == 'controller'"/>
|
|
</group>
|
|
<group>
|
|
<field name="username" required="context.get('api_type') == 'controller'"/>
|
|
<field name="password" password="True" required="context.get('api_type') == 'controller'"/>
|
|
<field name="verify_ssl"/>
|
|
</group>
|
|
</group>
|
|
|
|
<!-- Informations de connexion pour Site Manager API -->
|
|
<group string="Informations de connexion" invisible="context.get('api_type') != 'site_manager'">
|
|
<group>
|
|
<field name="api_key" required="context.get('api_type') == 'site_manager'"/>
|
|
</group>
|
|
<group>
|
|
<field name="mfa_enabled" invisible="context.get('api_type') != 'site_manager'"/>
|
|
<field name="mfa_token" password="True"
|
|
invisible="context.get('api_type') != 'site_manager' or not context.get('mfa_enabled')"
|
|
required="context.get('api_type') == 'site_manager' and context.get('mfa_enabled')"/>
|
|
</group>
|
|
</group>
|
|
<notebook>
|
|
<page string="Site Information" name="site_info">
|
|
<group>
|
|
<field name="description" placeholder="Description of this site"/>
|
|
<field name="address" placeholder="Physical address of this site"/>
|
|
</group>
|
|
</page>
|
|
|
|
<!-- Onglets spécifiques au Controller -->
|
|
<page string="Networks" name="networks" invisible="context.get('api_type') != 'controller'">
|
|
<div class="oe_button_box">
|
|
<button name="action_sync_networks" string="Synchronize Networks" type="object" class="btn btn-secondary"/>
|
|
</div>
|
|
<field name="network_ids" readonly="1">
|
|
<list>
|
|
<field name="name"/>
|
|
</list>
|
|
</field>
|
|
</page>
|
|
|
|
<page string="Devices" name="devices" invisible="context.get('api_type') != 'controller'">
|
|
<div class="oe_button_box">
|
|
<button name="action_sync_devices" string="Synchronize Devices" type="object" class="btn btn-secondary"/>
|
|
</div>
|
|
<field name="device_ids" readonly="1">
|
|
<list>
|
|
<field name="name"/>
|
|
</list>
|
|
</field>
|
|
</page>
|
|
|
|
<page string="Users" name="users" invisible="context.get('api_type') != 'controller'">
|
|
<div class="oe_button_box">
|
|
<button name="action_sync_users" string="Synchronize Users" type="object" class="btn btn-secondary"/>
|
|
</div>
|
|
<field name="user_ids" readonly="1">
|
|
<list>
|
|
<field name="name"/>
|
|
</list>
|
|
</field>
|
|
</page>
|
|
|
|
<!-- Onglets spécifiques au Site Manager -->
|
|
<page string="VLANs" name="vlans" invisible="context.get('api_type') != 'site_manager'">
|
|
<div class="oe_button_box">
|
|
<button name="action_sync_vlans" string="Synchronize VLANs" type="object" class="btn btn-secondary"/>
|
|
</div>
|
|
<field name="vlan_ids" readonly="1">
|
|
<list>
|
|
<field name="name"/>
|
|
</list>
|
|
</field>
|
|
</page>
|
|
|
|
<page string="Firewall Rules" name="firewall_rules" invisible="context.get('api_type') != 'site_manager'">
|
|
<div class="oe_button_box">
|
|
<button name="action_sync_firewall_rules" string="Synchronize Firewall Rules" type="object" class="btn btn-secondary"/>
|
|
</div>
|
|
<field name="firewall_rule_ids" readonly="1">
|
|
<list>
|
|
<field name="name"/>
|
|
</list>
|
|
</field>
|
|
</page>
|
|
|
|
<page string="Port Forwarding" name="port_forwarding" invisible="context.get('api_type') != 'site_manager'">
|
|
<div class="oe_button_box">
|
|
<button name="action_sync_port_forwards" string="Synchronize Port Forwards" type="object" class="btn btn-secondary"/>
|
|
</div>
|
|
<field name="port_forward_ids" readonly="1">
|
|
<list>
|
|
<field name="name"/>
|
|
</list>
|
|
</field>
|
|
</page>
|
|
|
|
<page string="Routing" name="routing" invisible="context.get('api_type') != 'site_manager'">
|
|
<div class="oe_button_box">
|
|
<button name="action_sync_routing" string="Synchronize Routing" type="object" class="btn btn-primary"/>
|
|
</div>
|
|
<field name="routing_config_ids" readonly="1"/>
|
|
</page>
|
|
<page string="Connection Information" name="connection_info">
|
|
<group invisible="context.get('api_type') != 'controller'">
|
|
<group string="Controller API Settings">
|
|
<button string="Configure Controller API" name="action_configure_controller" type="object" class="btn-primary"/>
|
|
<field name="verify_ssl"/>
|
|
</group>
|
|
</group>
|
|
<group invisible="context.get('api_type') != 'site_manager'">
|
|
<group string="Site Manager API Settings">
|
|
<button string="Configure Site Manager API" name="action_configure_site_manager" type="object" class="btn-primary"/>
|
|
<field name="verify_ssl"/>
|
|
</group>
|
|
</group>
|
|
</page>
|
|
<page string="Synchronization" name="sync_settings">
|
|
<group>
|
|
<field name="auto_sync"/>
|
|
<field name="sync_interval" invisible="not context.get('auto_sync')"/>
|
|
<field name="last_update" readonly="1"/>
|
|
</group>
|
|
<group string="Recent Sync Jobs" invisible="not context.get('sync_job_ids')">
|
|
<field name="sync_job_ids" nolabel="1" readonly="1">
|
|
<list>
|
|
<field name="name"/>
|
|
<field name="state"/>
|
|
<field name="start_time"/>
|
|
<field name="end_time"/>
|
|
<field name="duration" widget="float_time"/>
|
|
</list>
|
|
</field>
|
|
</group>
|
|
</page>
|
|
<page string="API Logs" name="api_logs">
|
|
<field name="api_log_ids" readonly="1">
|
|
<list>
|
|
<field name="create_date"/>
|
|
<field name="api_type"/>
|
|
<field name="method"/>
|
|
<field name="endpoint"/>
|
|
<field name="status_code"/>
|
|
<field name="success"/>
|
|
<field name="duration" widget="float_time"/>
|
|
</list>
|
|
</field>
|
|
</page>
|
|
<page string="Raw Data" name="raw_data" groups="base.group_system">
|
|
<field name="raw_data" widget="ace" options="{'mode': 'json'}"/>
|
|
</page>
|
|
</notebook>
|
|
</sheet>
|
|
<div class="oe_chatter">
|
|
<field name="message_follower_ids" widget="mail_followers"/>
|
|
<field name="activity_ids" widget="mail_activity"/>
|
|
<field name="message_ids" widget="mail_thread"/>
|
|
</div>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Import UniFi Site Form View -->
|
|
<record id="view_unifi_site_import_form" model="ir.ui.view">
|
|
<field name="name">unifi.site.import.form</field>
|
|
<field name="model">unifi.site</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Import UniFi Site">
|
|
<group>
|
|
<field name="name" required="1" placeholder="Site Name"/>
|
|
<field name="site_id" required="1" default="default"/>
|
|
<field name="api_type" widget="radio" required="1"/>
|
|
</group>
|
|
|
|
<group invisible="context.get('api_type') != 'controller'">
|
|
<group string="Controller API Settings">
|
|
<button string="Configure Controller API" name="action_configure_controller" type="object" class="btn-primary"/>
|
|
</group>
|
|
</group>
|
|
|
|
<group invisible="context.get('api_type') != 'site_manager'">
|
|
<group string="Site Manager API Settings">
|
|
<button string="Configure Site Manager API" name="action_configure_site_manager" type="object" class="btn-primary"/>
|
|
</group>
|
|
</group>
|
|
|
|
<footer>
|
|
<button string="Import" name="action_test_connection" type="object" class="btn-primary"/>
|
|
<button string="Cancel" class="btn-secondary" special="cancel"/>
|
|
</footer>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Actions moved to unifi_actions.xml -->
|
|
|
|
</odoo>
|