15407: Fixes node's properties & info handling.
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Fri, 16 Aug 2019 18:18:20 +0000 (15:18 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Mon, 19 Aug 2019 19:43:56 +0000 (16:43 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>

src/models/node.ts
src/views-components/compute-nodes-dialog/attributes-dialog.tsx

index 8723811565700dc2980e9040903ef81042e3f6e7..d0232b83d63414b92531db45b00bbe7bca8aecb6 100644 (file)
@@ -18,17 +18,17 @@ export interface NodeResource extends Resource {
 }
 
 export interface NodeInfo {
-    lastAction: string;
-    pingSecret: string;
-    ec2InstanceId: string;
-    slurmState?: string;
+    last_action: string;
+    ping_secret: string;
+    ec2_instance_id: string;
+    slurm_state?: string;
 }
 
 export interface NodeProperties {
-    cloudNode: CloudNode;
-    totalRamMb: number;
-    totalCpuCores: number;
-    totalScratchMb: number;
+    cloud_node: CloudNode;
+    total_ram_mb: number;
+    total_cpu_cores: number;
+    total_scratch_mb: number;
 }
 
 interface CloudNode {
index 41ca63950f977cab61e9499dcb17fe6e648b7b3f..5d9946b4848e01e0bc7d6dd3b8740fca3828b3aa 100644 (file)
@@ -29,7 +29,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     },
     grid: {
         padding: '8px 0 0 0'
-    } 
+    }
 });
 
 interface AttributesComputeNodeDialogDataProps {
@@ -81,35 +81,35 @@ const renderPrimaryInfo = (computeNode: NodeResource, classes: any) => {
 };
 
 const renderInfo = (info: NodeInfo, classes: any) => {
-    const { lastAction, pingSecret, ec2InstanceId, slurmState } = info;
+    const { last_action, ping_secret, ec2_instance_id, slurm_state } = info;
     return (
         <Grid container direction="row" spacing={16} className={classnames([classes.root, classes.grid])}>
             <Grid item xs={5}>Info - Last action</Grid>
-            <Grid item xs={7}>{lastAction || '(none)'}</Grid>
+            <Grid item xs={7}>{last_action || '(none)'}</Grid>
             <Grid item xs={5}>Info - Ping secret</Grid>
-            <Grid item xs={7}>{pingSecret || '(none)'}</Grid>
+            <Grid item xs={7}>{ping_secret || '(none)'}</Grid>
             <Grid item xs={5}>Info - ec2 instance id</Grid>
-            <Grid item xs={7}>{ec2InstanceId || '(none)'}</Grid>
+            <Grid item xs={7}>{ec2_instance_id || '(none)'}</Grid>
             <Grid item xs={5}>Info - Slurm state</Grid>
-            <Grid item xs={7}>{slurmState || '(none)'}</Grid>
+            <Grid item xs={7}>{slurm_state || '(none)'}</Grid>
         </Grid>
     );
 };
 
 const renderProperties = (properties: NodeProperties, classes: any) => {
-    const { totalRamMb, totalCpuCores, totalScratchMb, cloudNode } = properties;
+    const { total_ram_mb, total_cpu_cores, total_scratch_mb, cloud_node } = properties;
     return (
         <Grid container direction="row" spacing={16} className={classnames([classes.root, classes.grid])}>
             <Grid item xs={5}>Properties - Total ram mb</Grid>
-            <Grid item xs={7}>{totalRamMb || '(none)'}</Grid>
+            <Grid item xs={7}>{total_ram_mb || '(none)'}</Grid>
             <Grid item xs={5}>Properties - Total scratch mb</Grid>
-            <Grid item xs={7}>{totalScratchMb || '(none)'}</Grid>
+            <Grid item xs={7}>{total_scratch_mb || '(none)'}</Grid>
             <Grid item xs={5}>Properties - Total cpu cores</Grid>
-            <Grid item xs={7}>{totalCpuCores || '(none)'}</Grid>
+            <Grid item xs={7}>{total_cpu_cores || '(none)'}</Grid>
             <Grid item xs={5}>Properties - Cloud node size </Grid>
-            <Grid item xs={7}>{cloudNode ? cloudNode.size : '(none)'}</Grid>
+            <Grid item xs={7}>{cloud_node ? cloud_node.size : '(none)'}</Grid>
             <Grid item xs={5}>Properties - Cloud node price</Grid>
-            <Grid item xs={7}>{cloudNode ? cloudNode.price : '(none)'}</Grid>
+            <Grid item xs={7}>{cloud_node ? cloud_node.price : '(none)'}</Grid>
         </Grid>
     );
 };
\ No newline at end of file