Setting d digit after decimal for device indicators
This commit is contained in:
@@ -255,8 +255,9 @@ class AssetadmintController extends Controller
|
||||
];
|
||||
}
|
||||
return null;
|
||||
})->filter()->values(); // remove nulls and reset keys
|
||||
})->pluck('full_name')->filter()->values(); // remove nulls and reset keys
|
||||
|
||||
// $assetData['assign_to_users'] = !empty($assignToUsers) ? implode(', ', $assignToUsers) : '';
|
||||
$assetData['assign_to_users'] = $assignToUsers;
|
||||
|
||||
return $assetData;
|
||||
@@ -442,11 +443,11 @@ class AssetadmintController extends Controller
|
||||
$assetId = $request->asset_id;
|
||||
$activeStatus = $request->active;
|
||||
|
||||
if ($activeStatus) {
|
||||
// If assigning asset, first unassign from any other users
|
||||
UserAssetLink::where('asset_id', $assetId)
|
||||
->update(['active' => 0]);
|
||||
}
|
||||
// if ($activeStatus) {
|
||||
// // If assigning asset, first unassign from any other users
|
||||
// UserAssetLink::where('asset_id', $assetId)
|
||||
// ->update(['active' => 0]);
|
||||
// }
|
||||
|
||||
// Now either update existing record or create a new one for this user and asset
|
||||
$userAssetLink = UserAssetLink::firstOrNew([
|
||||
|
||||
@@ -1107,7 +1107,7 @@ class TelemetryController extends Controller
|
||||
$transformedTelemetry[] = [
|
||||
'display_name' => $displayNameMap[$key] ?? $key,
|
||||
'value' => $item['value'],
|
||||
'averageVal' => (string)$averageVal,
|
||||
'averageVal' => number_format((float)$averageVal, 2, '.', ''),
|
||||
'color' => $color
|
||||
];
|
||||
}
|
||||
|
||||
@@ -32,13 +32,11 @@ Route::middleware(['customerApiBasicAuth'])->group(function () {
|
||||
Route::post('/telemetry-data-asset', [TelemetryController::class, 'telemetryDataAsset']);
|
||||
Route::post('/telemetry-data-device', [TelemetryController::class, 'telemetryDataDevice']);
|
||||
|
||||
Route::get('/user-assets', [UserAssetLinkController::class, 'index']);
|
||||
Route::post('/store/report', [CustomerApiDownloadsController::class, 'storePdfData'])->name('store-report');
|
||||
Route::post('/fetch/report', [CustomerApiDownloadsController::class, 'fetchReport'])->name('fetch-report');
|
||||
Route::post('/destroy/report', [CustomerApiDownloadsController::class, 'destroyReport'])->name('destroy-report');
|
||||
|
||||
Route::get('/alert-message/{deviceId}', [TimeseriesAlertMessageController::class, 'alertMessage']);
|
||||
Route::get('/user-assets', [UserAssetLinkController::class, 'index']);
|
||||
Route::post('/store/report', [CustomerApiDownloadsController::class, 'storePdfData'])->name('store-report');
|
||||
Route::post('/fetch/report', [CustomerApiDownloadsController::class, 'fetchReport'])->name('fetch-report');
|
||||
Route::post('/destroy/report', [CustomerApiDownloadsController::class, 'destroyReport'])->name('destroy-report');
|
||||
|
||||
Reference in New Issue
Block a user