mirror of
https://github.com/lucaspalomodevelop/opnsense-core.git
synced 2026-03-13 08:09:42 +00:00
dashboard: tooltip sweep
This commit is contained in:
parent
21184535c7
commit
f2c5e53f3f
@ -53,6 +53,8 @@ export default class Carp extends BaseTableWidget {
|
||||
return;
|
||||
}
|
||||
|
||||
$('.carp-status-icon').tooltip('hide');
|
||||
|
||||
let ifs = {};
|
||||
|
||||
data.rows.forEach(({ interface: iface, vhid, status, status_txt, subnet, mode, vhid_txt }) => {
|
||||
@ -70,7 +72,7 @@ export default class Carp extends BaseTableWidget {
|
||||
let $intf = `<div><a href="/ui/interfaces/vip">${primary.interface} @ VHID ${primary.vhid}</a></div>`;
|
||||
let vips = [
|
||||
`<div>
|
||||
<span class="bootgrid-tooltip badge badge-pill"
|
||||
<span class="badge badge-pill carp-status-icon"
|
||||
data-toggle="tooltip"
|
||||
title="${primary.vhid_txt}"
|
||||
style="background-color: ${primary.status == 'MASTER' ? 'green' : 'primary'}">
|
||||
@ -83,7 +85,7 @@ export default class Carp extends BaseTableWidget {
|
||||
aliases.forEach(({ status, status_txt, subnet }) => {
|
||||
vips.push(`
|
||||
<div>
|
||||
<span class="bootgrid-tooltip badge badge-pill"
|
||||
<span class="badge badge-pill carp-status-icon"
|
||||
data-toggle="tooltip"
|
||||
title="${primary.vhid_txt}"
|
||||
style="background-color: ${status == 'MASTER' ? 'green' : 'primary'}">
|
||||
@ -97,6 +99,6 @@ export default class Carp extends BaseTableWidget {
|
||||
this.updateTable('carp-table', [[$intf, vips]], `carp_${primary.interface}_${primary.vhid}`);
|
||||
});
|
||||
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
$('.carp-status-icon').tooltip({container: 'body'});
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,6 +47,7 @@ export default class Gateways extends BaseTableWidget {
|
||||
}
|
||||
|
||||
async onWidgetTick() {
|
||||
$('.gateways-status-icon').tooltip('hide');
|
||||
const data = await this.ajaxCall('/api/routes/gateway/status');
|
||||
if (data.items === undefined) {
|
||||
return;
|
||||
@ -72,7 +73,7 @@ export default class Gateways extends BaseTableWidget {
|
||||
}
|
||||
|
||||
let gw = `<div>
|
||||
<i class="fa fa-circle text-muted ${color}" style="font-size: 11px; cursor: pointer;"
|
||||
<i class="fa fa-circle text-muted ${color} gateways-status-icon" style="font-size: 11px; cursor: pointer;"
|
||||
data-toggle="tooltip" title="${status_translated}">
|
||||
</i>
|
||||
|
||||
@ -91,6 +92,6 @@ export default class Gateways extends BaseTableWidget {
|
||||
this.updateTable('gateway-table', [[gw, stats]], `gw_${name}`);
|
||||
});
|
||||
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
$('.gateways-status-icon').tooltip({container: 'body'});
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,6 +55,8 @@ export default class Interfaces extends BaseTableWidget {
|
||||
return;
|
||||
}
|
||||
|
||||
$('.if-status-icon').tooltip('hide');
|
||||
|
||||
let rows = [];
|
||||
data.rows.map((intf_data) => {
|
||||
if (!intf_data.hasOwnProperty('config') || intf_data.enabled == false) {
|
||||
@ -69,7 +71,7 @@ export default class Interfaces extends BaseTableWidget {
|
||||
|
||||
row.push($(`
|
||||
<div class="interface-info if-name">
|
||||
<i class="fa fa-plug text-${intf_data.status === 'up' ? 'success' : 'danger'}" title="" data-toggle="tooltip" data-original-title="${intf_data.status}"></i>
|
||||
<i class="fa fa-plug text-${intf_data.status === 'up' ? 'success' : 'danger'} if-status-icon" title="" data-toggle="tooltip" data-original-title="${intf_data.status}"></i>
|
||||
<b class="interface-descr" onclick="location.href='/interfaces.php?if=${intf_data.identifier}'">
|
||||
${intf_data.description}
|
||||
</b>
|
||||
@ -106,7 +108,7 @@ export default class Interfaces extends BaseTableWidget {
|
||||
|
||||
super.updateTable('if-table', rows);
|
||||
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
$('.if-status-icon').tooltip({container: 'body'});
|
||||
}
|
||||
|
||||
onWidgetResize(elem, width, height) {
|
||||
|
||||
@ -80,6 +80,8 @@ export default class IpsecLeases extends BaseTableWidget {
|
||||
return; // No changes detected, do not update the UI
|
||||
}
|
||||
|
||||
$('.ipsecleases-status-icon').tooltip('hide');
|
||||
|
||||
let users = {}; // Initialize an object to store user data indexed by user names
|
||||
|
||||
// Organize leases by user
|
||||
@ -121,7 +123,7 @@ export default class IpsecLeases extends BaseTableWidget {
|
||||
|
||||
let row = `
|
||||
<div>
|
||||
<i class="fa fa-user ${userStatusClass}" style="cursor: pointer;"
|
||||
<i class="fa fa-user ${userStatusClass} ipsecleases-status-icon" style="cursor: pointer;"
|
||||
data-toggle="tooltip" title="${userStatusTitle}">
|
||||
</i>
|
||||
|
||||
@ -138,6 +140,6 @@ export default class IpsecLeases extends BaseTableWidget {
|
||||
super.updateTable('ipsecLeaseTable', rows.map(row => [row]));
|
||||
|
||||
// Activate tooltips for new dynamic elements
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
$('.ipsecleases-status-icon').tooltip({container: 'body'});
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,6 +79,8 @@ export default class IpsecTunnels extends BaseTableWidget {
|
||||
return; // No changes detected, do not update the UI
|
||||
}
|
||||
|
||||
$('.ipsectunnels-status-icon').tooltip('hide');
|
||||
|
||||
let tunnels = newTunnels.map(tunnel => ({
|
||||
localAddrs: tunnel['local-addrs'],
|
||||
remoteAddrs: tunnel['remote-addrs'],
|
||||
@ -104,7 +106,7 @@ export default class IpsecTunnels extends BaseTableWidget {
|
||||
tunnels.forEach(tunnel => {
|
||||
let row = `
|
||||
<div>
|
||||
<i class="fa ${tunnel.statusIcon}" style="cursor: pointer;"
|
||||
<i class="fa ${tunnel.statusIcon} ipsectunnels-status-icon" style="cursor: pointer;"
|
||||
data-toggle="tooltip" title="${tunnel.connected ? this.translations.online : this.translations.offline}">
|
||||
</i>
|
||||
|
||||
@ -121,6 +123,6 @@ export default class IpsecTunnels extends BaseTableWidget {
|
||||
super.updateTable('ipsecTunnelTable', rows.map(row => [row]));
|
||||
|
||||
// Activate tooltips for new dynamic elements
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
$('.ipsectunnels-status-icon').tooltip({container: 'body'});
|
||||
}
|
||||
}
|
||||
|
||||
@ -86,6 +86,9 @@ export default class Monit extends BaseTableWidget {
|
||||
return;
|
||||
}
|
||||
|
||||
$('.monit-status-icon').tooltip('hide');
|
||||
$('.monit-type-icon').tooltip('hide');
|
||||
|
||||
let rows = [];
|
||||
$.each(data['status']['service'], (index, service) => {
|
||||
let color = this.statusColors[service['status']] || "text-success";
|
||||
@ -93,11 +96,11 @@ export default class Monit extends BaseTableWidget {
|
||||
|
||||
let $header = $(`
|
||||
<div>
|
||||
<i class="fa fa-circle text-muted ${color}" style="font-size: 11px; cursor: pointer;"
|
||||
<i class="fa fa-circle text-muted ${color} monit-status-icon" style="font-size: 11px; cursor: pointer;"
|
||||
data-toggle="tooltip" title="${this.statusMap[service['status']]}">
|
||||
</i>
|
||||
|
||||
<i class="fa ${icon}" style="font-size: 11px;"
|
||||
<i class="fa ${icon} monit-type-icon" style="font-size: 11px;"
|
||||
data-toggle="tooltip" title="${this.serviceMap[service['@attributes']['type']]}">
|
||||
</i>
|
||||
|
||||
@ -110,5 +113,8 @@ export default class Monit extends BaseTableWidget {
|
||||
});
|
||||
|
||||
this.updateTable('monit-table', rows);
|
||||
|
||||
$('.monit-status-icon').tooltip({container: 'body'});
|
||||
$('.monit-type-icon').tooltip({container: 'body'});
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ export default class Services extends BaseTableWidget {
|
||||
serviceControl(actions) {
|
||||
return actions.map(({ action, id, title, icon }) => `
|
||||
<button data-service_action="${action}" data-service="${id}"
|
||||
class="btn btn-xs btn-default srv_status_act2" title="${title}">
|
||||
class="btn btn-xs btn-default srv_status_act2" title="${title}" data-toggle="tooltip">
|
||||
<i class="fa fa-fw fa-${icon}"></i>
|
||||
</button>
|
||||
`).join('');
|
||||
@ -68,6 +68,9 @@ export default class Services extends BaseTableWidget {
|
||||
return;
|
||||
}
|
||||
|
||||
$('.service-status').tooltip('hide');
|
||||
$('.srv_status_act2').tooltip('hide');
|
||||
|
||||
for (const service of data.rows) {
|
||||
let name = service.name;
|
||||
let description = service.description;
|
||||
@ -85,7 +88,7 @@ export default class Services extends BaseTableWidget {
|
||||
let $buttonContainer = $(`<div>
|
||||
<span class="label label-opnsense label-opnsense-xs
|
||||
label-${service.running ? 'success' : 'danger'}
|
||||
bootgrid-tooltip
|
||||
service-status"
|
||||
data-toggle="tooltip" title="${service.running ? this.translations.running : this.translations.stopped}">
|
||||
<i class="fa fa-${service.running ? 'play' : 'stop'} fa-fw"></i>
|
||||
</span>
|
||||
@ -97,7 +100,8 @@ export default class Services extends BaseTableWidget {
|
||||
super.updateTable('services-table', [[description, $buttonContainer.prop('outerHTML')]], service.id);
|
||||
}
|
||||
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
$('.service-status').tooltip({container: 'body'});
|
||||
$('.srv_status_act2').tooltip({container: 'body'});
|
||||
|
||||
$('.srv_status_act2').on('click', async (event) => {
|
||||
this.locked = true;
|
||||
|
||||
@ -174,8 +174,8 @@ export default class ThermalSensors extends BaseWidget {
|
||||
|
||||
this.chart = new Chart(context, config);
|
||||
|
||||
$(`#${this.id}-title`).append(` <i class="fa fa-question-circle" data-toggle="tooltip" title="${this.translations.help}"></i>`);
|
||||
$('[data-toggle="tooltip"]').tooltip({container: 'body', triger: 'hover'});
|
||||
$(`#${this.id}-title`).append(` <i class="fa fa-question-circle thermalsensors-info-icon" data-toggle="tooltip" title="${this.translations.help}"></i>`);
|
||||
$('.thermalsensors-info-icon').tooltip({container: 'body'});
|
||||
}
|
||||
|
||||
async onWidgetTick() {
|
||||
|
||||
@ -75,6 +75,7 @@ export default class Wireguard extends BaseTableWidget {
|
||||
}
|
||||
|
||||
processTunnels(newTunnels) {
|
||||
$('.wireguard-interface').tooltip('hide');
|
||||
let tunnels = newTunnels.filter(row => row.type == 'peer').map(row => ({
|
||||
ifname: row.ifname ? row.if + ' (' + row.ifname + ') ' : row.if,
|
||||
name: row.name,
|
||||
@ -92,9 +93,9 @@ export default class Wireguard extends BaseTableWidget {
|
||||
tunnels.forEach(tunnel => {
|
||||
let row = `
|
||||
<div>
|
||||
<div data-toggle="tooltip" title="${tunnel.pubkey}">
|
||||
<div data-toggle="tooltip" class="wireguard-interface" title="${tunnel.pubkey}">
|
||||
<b>${tunnel.ifname}</b>
|
||||
<i class="fa fa-arrows-h" aria-hidden="true"></i>
|
||||
<i class="fa fa-arrows-h " aria-hidden="true"></i>
|
||||
<b>${tunnel.name}</b>
|
||||
</div>
|
||||
<div>
|
||||
@ -112,6 +113,6 @@ export default class Wireguard extends BaseTableWidget {
|
||||
super.updateTable('wgTunnelTable', rows.map(row => [row]));
|
||||
|
||||
// Activate tooltips for new dynamic elements
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
$('.wireguard-interface').tooltip();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user