all files / app/utils/componentProperties/ columnExtendedProperties.ts

100% Statements 3/3
100% Branches 0/0
100% Functions 0/0
100% Lines 3/3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196                                    1×                                                                                                                                                                                                                           1×                                                               1×                                                                      
/* Copyright CloudLinux Zug GmbH 2010-2017 All Rights Reserved
 *
 * Licensed under CLOUD LINUX LICENSE AGREEMENT
 * http://cloudlinux.com/docs/LICENSE.TXT
 */
 
import { ColumnProperties } from '../column';
import { TypeOfUnits } from '../types';
 
export interface ExtendedColumnProperties extends ColumnProperties{
    icon?: string;
    tooltip?: string;
    additionalCssClass?: string;
    units?: TypeOfUnits;
    objField?: string;
}
 
// TODO rename 'byteinsec' to 'byte_per_sec'
export const commonColumnsArray: Array<ExtendedColumnProperties> = [
    // SPEED columns
    {
        name: 'usage_cpu_lve', descr: 'A', convertToFormat: 'number', group: 'SPEED',
        units: 'percents', tooltip: 'Sort by Average SPEED'
    },
    {
        name: 'limits_cpu_lve', descr: 'L', convertToFormat: 'number', group: 'SPEED',
        units: 'percents', tooltip: 'Sort by SPEED Limit'
    },
    {
        name: 'usage_cpu_mysql', descr: 'A', convertToFormat: 'number', group: 'SPEED',
        units: 'percents', tooltip: 'Sort by Average MySQL SPEED', icon: 'db_icon.png'
    },
    {
        name: 'limits_cpu_mysql', descr: 'L', convertToFormat: 'number', group: 'SPEED',
        units: 'percents', tooltip: 'Sort by MySQL SPEED Limit', icon: 'db_icon.png'
    },
    {
        name: 'faults_cpu_lve', descr: 'F', convertToFormat: 'number', group: 'SPEED',
        tooltip: 'Sort by SPEED Faults'
    },
    // PMEM columns
    {
        name: 'usage_pmem_lve', descr: 'A', convertToFormat: 'byte-amount', group: 'PMEM',
        units: 'bytes', tooltip: 'Sort by Average PMEM'
    },
    {
        name: 'limits_pmem_lve', descr: 'L', convertToFormat: 'byte-amount', group: 'PMEM',
        units: 'bytes', tooltip: 'Sort by PMEM Limit'
    },
    {
        name: 'faults_pmem_lve', descr: 'F', convertToFormat: 'number', group: 'PMEM',
        tooltip: 'Sort by PMEM Faults'
    },
    // VMEM columns
    {
        name: 'usage_vmem_lve', descr: 'A', convertToFormat: 'byte-amount', group: 'VMEM',
        units: 'bytes', tooltip: 'Sort by Average VMEM'
    },
    {
        name: 'limits_vmem_lve', descr: 'L', convertToFormat: 'byte-amount', group: 'VMEM',
        units: 'bytes', tooltip: 'Sort by VMEM Limit'
    },
    {
        name: 'faults_vmem_lve', descr: 'F', convertToFormat: 'number', group: 'VMEM',
        tooltip: 'Sort by VMEM Faults'
    },
    // IO columns
    {
        name: 'usage_io_lve', descr: 'A', convertToFormat: 'byte-amount', group: 'IO',
        units: 'byteinsec', tooltip: 'Sort by Average IO'
    },
    {
        name: 'limits_io_lve', descr: 'L', convertToFormat: 'byte-amount', group: 'IO',
        units: 'byteinsec', tooltip: 'Sort by IO Limit'
    },
    {
        name: 'usage_io_mysql', descr: 'A', convertToFormat: 'byte-amount', group: 'IO',
        units: 'byteinsec', tooltip: 'Sort by Average MySQL IO', icon: 'db_icon.png'
    },
    {
        name: 'limits_io_mysql', descr: 'L', convertToFormat: 'byte-amount', group: 'IO',
        units: 'byteinsec', tooltip: 'Sort by MySQL IO Limit', icon: 'db_icon.png'
    },
    {
        name: 'faults_io_lve', descr: 'F', convertToFormat: 'number', group: 'IO',
        tooltip: 'Sort by IO Faults'
    },
    // EP column
    {
        name: 'usage_ep_lve', descr: 'A', convertToFormat: 'number', group: 'EP',
        tooltip: 'Sort by Average EP'
    },
    {
        name: 'limits_ep_lve', descr: 'L', convertToFormat: 'number', group: 'EP',
        tooltip: 'Sort by EP Limit'
    },
    {
        name: 'faults_ep_lve', descr: 'F', convertToFormat: 'number', group: 'EP',
        tooltip: 'Sort by EP Faults'
    },
    // NPROC column
    {
        name: 'usage_nproc_lve', descr: 'A', convertToFormat: 'number', group: 'NPROC',
        tooltip: 'Sort by Average NPROC'
    },
    {
        name: 'limits_nproc_lve', descr: 'L', convertToFormat: 'number', group: 'NPROC',
        tooltip: 'Sort by NPROC Limit'
    },
    {
        name: 'faults_nproc_lve', descr: 'F', convertToFormat: 'number', group: 'NPROC',
        tooltip: 'Sort by NPROC Faults'
    },
    // IOPS
    {
        name: 'usage_iops_lve', descr: 'A', convertToFormat: 'number', group: 'IOPS',
        tooltip: 'Sort by Average IOPS'
    },
    {
        name: 'limits_iops_lve', descr: 'L', convertToFormat: 'number', group: 'IOPS',
        tooltip: 'Sort by IOPS Limit'
    },
    {
        name: 'faults_iops_lve', descr: 'F', convertToFormat: 'number', group: 'IOPS',
        tooltip: 'Sort by IOPS Faults'
    }
];
 
export const shortenColumnsArray: Array<ExtendedColumnProperties> = [
    {
        name: 'cpu_all', descr: 'LVE', convertToFormat: 'number', group: 'SPEED',
        units: 'percents'
    },
    {
        name: 'cpu_mysql', descr: 'MySQL', convertToFormat: 'number', group: 'SPEED',
        units: 'percents'
    },
    {
        name: 'mem', descr: 'MEM', convertToFormat: 'byte-amount',
        units: 'bytes'
    },
    {
        name: 'io_all', descr: 'LVE', convertToFormat: 'byte-amount', group: 'IO',
        units: 'byteinsec'
    },
    {
        name: 'io_mysql', descr: 'MySQL', convertToFormat: 'byte-amount', group: 'IO',
        units: 'byteinsec'
    },
    {
        name: 'iops', descr: 'IOPS', convertToFormat: 'number'
    },
    {
        name: 'pno', descr: 'PNO', convertToFormat: 'number'
    },
    {
        name: 'ep', descr: 'EP', convertToFormat: 'number',
    }
];
 
export const packageColumnInfo: Array<ExtendedColumnProperties> = [
    {
        name: 'limits_cpu_all', descr: 'SPEED', convertToFormat: 'number',
        units: 'percents'
    },
    {
        name: 'limits_vmem', descr: 'VMEM', convertToFormat: 'byte-amount',
        hidden: true, showEditOrValue: true, units: 'bytes'
    },
    {
        name: 'limits_pmem', descr: 'PMEM', convertToFormat: 'byte-amount',
        units: 'bytes'
    },
    {
        name: 'limits_io_all', descr: 'IO', convertToFormat: 'byte-amount',
        units: 'kbinsec', objField: 'all'
    },
    {
        name: 'limits_iops', descr: 'IOPS', convertToFormat: 'number'
    },
    {
        name: 'limits_ep', descr: 'EP', convertToFormat: 'number'
    },
    {
        name: 'limits_nproc', descr: 'NPROC', convertToFormat: 'number'
    },
    {
        name: 'limits_inodes_hard', descr: 'INODES', convertToFormat: 'number',
        objField: 'hard'
    },
    {
        name: 'limits_inodes_soft', descr: 'INODES', convertToFormat: 'number',
        objField: 'soft', hidden: true
    }
];