|
@@ -2291,18 +2291,18 @@ function PrinterCard({
|
|
|
<div className="absolute top-full left-0 mt-1 z-50 bg-bambu-dark-secondary border border-bambu-dark-tertiary rounded-lg shadow-xl py-1 min-w-[120px]">
|
|
<div className="absolute top-full left-0 mt-1 z-50 bg-bambu-dark-secondary border border-bambu-dark-tertiary rounded-lg shadow-xl py-1 min-w-[120px]">
|
|
|
<button
|
|
<button
|
|
|
className={`w-full px-3 py-1.5 text-left text-xs flex items-center gap-2 ${
|
|
className={`w-full px-3 py-1.5 text-left text-xs flex items-center gap-2 ${
|
|
|
- hasPermission('printers:control')
|
|
|
|
|
|
|
+ hasPermission('printers:ams_rfid')
|
|
|
? 'text-white hover:bg-bambu-dark-tertiary'
|
|
? 'text-white hover:bg-bambu-dark-tertiary'
|
|
|
: 'text-bambu-gray/50 cursor-not-allowed'
|
|
: 'text-bambu-gray/50 cursor-not-allowed'
|
|
|
}`}
|
|
}`}
|
|
|
onClick={(e) => {
|
|
onClick={(e) => {
|
|
|
e.stopPropagation();
|
|
e.stopPropagation();
|
|
|
- if (!hasPermission('printers:control')) return;
|
|
|
|
|
|
|
+ if (!hasPermission('printers:ams_rfid')) return;
|
|
|
refreshAmsSlotMutation.mutate({ amsId: ams.id, slotId: slotIdx });
|
|
refreshAmsSlotMutation.mutate({ amsId: ams.id, slotId: slotIdx });
|
|
|
setAmsSlotMenu(null);
|
|
setAmsSlotMenu(null);
|
|
|
}}
|
|
}}
|
|
|
- disabled={isRefreshing || !hasPermission('printers:control')}
|
|
|
|
|
- title={!hasPermission('printers:control') ? 'You do not have permission to control printers' : undefined}
|
|
|
|
|
|
|
+ disabled={isRefreshing || !hasPermission('printers:ams_rfid')}
|
|
|
|
|
+ title={!hasPermission('printers:ams_rfid') ? 'You do not have permission to re-read AMS RFID' : undefined}
|
|
|
>
|
|
>
|
|
|
<RefreshCw className={`w-3 h-3 ${isRefreshing ? 'animate-spin' : ''}`} />
|
|
<RefreshCw className={`w-3 h-3 ${isRefreshing ? 'animate-spin' : ''}`} />
|
|
|
Re-read RFID
|
|
Re-read RFID
|
|
@@ -2480,18 +2480,18 @@ function PrinterCard({
|
|
|
<div className="absolute top-full left-0 mt-1 z-50 bg-bambu-dark-secondary border border-bambu-dark-tertiary rounded-lg shadow-xl py-1 min-w-[120px]">
|
|
<div className="absolute top-full left-0 mt-1 z-50 bg-bambu-dark-secondary border border-bambu-dark-tertiary rounded-lg shadow-xl py-1 min-w-[120px]">
|
|
|
<button
|
|
<button
|
|
|
className={`w-full px-3 py-1.5 text-left text-xs flex items-center gap-2 ${
|
|
className={`w-full px-3 py-1.5 text-left text-xs flex items-center gap-2 ${
|
|
|
- hasPermission('printers:control')
|
|
|
|
|
|
|
+ hasPermission('printers:ams_rfid')
|
|
|
? 'text-white hover:bg-bambu-dark-tertiary'
|
|
? 'text-white hover:bg-bambu-dark-tertiary'
|
|
|
: 'text-bambu-gray/50 cursor-not-allowed'
|
|
: 'text-bambu-gray/50 cursor-not-allowed'
|
|
|
}`}
|
|
}`}
|
|
|
onClick={(e) => {
|
|
onClick={(e) => {
|
|
|
e.stopPropagation();
|
|
e.stopPropagation();
|
|
|
- if (!hasPermission('printers:control')) return;
|
|
|
|
|
|
|
+ if (!hasPermission('printers:ams_rfid')) return;
|
|
|
refreshAmsSlotMutation.mutate({ amsId: ams.id, slotId: htSlotId });
|
|
refreshAmsSlotMutation.mutate({ amsId: ams.id, slotId: htSlotId });
|
|
|
setAmsSlotMenu(null);
|
|
setAmsSlotMenu(null);
|
|
|
}}
|
|
}}
|
|
|
- disabled={isHtRefreshing || !hasPermission('printers:control')}
|
|
|
|
|
- title={!hasPermission('printers:control') ? 'You do not have permission to control printers' : undefined}
|
|
|
|
|
|
|
+ disabled={isHtRefreshing || !hasPermission('printers:ams_rfid')}
|
|
|
|
|
+ title={!hasPermission('printers:ams_rfid') ? 'You do not have permission to re-read AMS RFID' : undefined}
|
|
|
>
|
|
>
|
|
|
<RefreshCw className={`w-3 h-3 ${isHtRefreshing ? 'animate-spin' : ''}`} />
|
|
<RefreshCw className={`w-3 h-3 ${isHtRefreshing ? 'animate-spin' : ''}`} />
|
|
|
Re-read RFID
|
|
Re-read RFID
|