Add View in CARD button to tooltip and action modal
Copies the Ivanti Host ID to clipboard and opens card.charter.com/ipn-search in a new tab. ESSO prevents URL-based pre-fill so the user pastes the ID.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { X, Loader, AlertCircle, CheckCircle, ArrowRightLeft, XCircle } from 'lucide-react'; // ⚠️ CONVENTION: Removed unused `Shield` import to satisfy no-unused-vars lint rule
|
||||
import { X, Loader, AlertCircle, CheckCircle, ArrowRightLeft, XCircle, ExternalLink } from 'lucide-react';
|
||||
|
||||
const API_BASE = process.env.REACT_APP_API_BASE || 'http://localhost:3001/api';
|
||||
|
||||
@@ -148,8 +148,36 @@ export default function CardActionModal({ isOpen, onClose, item, initialAction,
|
||||
<div>
|
||||
<h3 style={{ margin: 0, color: '#F8FAFC', fontSize: '0.95rem' }}>CARD Asset Action</h3>
|
||||
{ownerData && (
|
||||
<div style={{ fontSize: '0.7rem', color: '#7C3AED', fontFamily: 'monospace', marginTop: '0.2rem' }}>
|
||||
{ownerData.asset_id}
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: '0.5rem', marginTop: '0.2rem' }}>
|
||||
<span style={{ fontSize: '0.7rem', color: '#7C3AED', fontFamily: 'monospace' }}>
|
||||
{ownerData.asset_id}
|
||||
</span>
|
||||
{item?.host_id && (
|
||||
<button
|
||||
onClick={() => {
|
||||
navigator.clipboard.writeText(String(item.host_id));
|
||||
window.open('https://card.charter.com/ipn-search', '_blank');
|
||||
}}
|
||||
title={`Copy Host ID ${item.host_id} and open CARD`}
|
||||
style={{
|
||||
display: 'inline-flex', alignItems: 'center', gap: '0.25rem',
|
||||
padding: '0.15rem 0.45rem',
|
||||
background: 'rgba(14, 165, 233, 0.12)',
|
||||
border: '1px solid rgba(14, 165, 233, 0.4)',
|
||||
borderRadius: '0.25rem',
|
||||
color: '#7DD3FC',
|
||||
fontSize: '0.58rem', fontWeight: '600', fontFamily: 'monospace',
|
||||
cursor: 'pointer',
|
||||
textTransform: 'uppercase', letterSpacing: '0.04em',
|
||||
transition: 'all 0.12s',
|
||||
}}
|
||||
onMouseEnter={(e) => { e.currentTarget.style.background = 'rgba(14, 165, 233, 0.25)'; }}
|
||||
onMouseLeave={(e) => { e.currentTarget.style.background = 'rgba(14, 165, 233, 0.12)'; }}
|
||||
>
|
||||
<ExternalLink style={{ width: 9, height: 9 }} />
|
||||
CARD
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user