Commit a2f46efa authored by Takumaru Sekine's avatar Takumaru Sekine Committed by Yas Naoi
Browse files

Issue #3258844 by sekinet, yas, Ryo Yamashita: Add a detailed view to SPA (K8s ConfigMaps)

parent bb043a18
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import K8S_REPLICA_SET_TEMPLATE from 'constant/entity_info_template/k8s/replica_
import K8S_NETWORK_POLICY_TEMPLATE from 'constant/entity_info_template/k8s/network_policy';
import K8S_RESOURCE_QUOTA_TEMPLATE from 'constant/entity_info_template/k8s/resource_quota';
import K8S_PRIORITY_CLASS_TEMPLATE from 'constant/entity_info_template/k8s/priority_class';
import K8S_CONFIG_MAP_TEMPLATE from 'constant/entity_info_template/k8s/config_map';

const ENTITY_INFO_LIST = [
  AWS_CLOUD_INSTANCE_TEMPLATE,
@@ -46,6 +47,7 @@ const ENTITY_INFO_LIST = [
  K8S_NETWORK_POLICY_TEMPLATE,
  K8S_RESOURCE_QUOTA_TEMPLATE,
  K8S_PRIORITY_CLASS_TEMPLATE,
  K8S_CONFIG_MAP_TEMPLATE,
];

export const UPPERCASE_WORD_SET = new Set([
+44 −0
Original line number Diff line number Diff line
import EntityInfoTemplate from 'model/EntityInfoTemplate';

// Template for displaying detailed information about entities in K8s.
const K8S_CONFIG_MAP_TEMPLATE: EntityInfoTemplate = {
  cloudServiceProvider: 'k8s',
  entityName: 'config_map',
  entityRecords: [
    {
      panelName: 'ConfigMap',
      tableRecordList: ['labels', 'annotations'],
      keyValueRecords: [
        { labelName: 'Name', name: 'name', type: 'default' },
        { labelName: 'Namespace', name: 'namespace', type: 'default' },
        { labelName: 'Created', name: 'created', type: 'datetime' },
        { labelName: 'Labels', name: 'labels', type: 'default' },
        { labelName: 'Annotations', name: 'annotations', type: 'default' },
      ]
    },
    {
      panelName: 'Data',
      tableRecordList: ['data'],
      keyValueRecords: [
        { labelName: 'Data', name: 'data', type: 'default' },
      ]
    },
    {
      panelName: 'Detail',
      tableRecordList: [],
      keyValueRecords: [
        { labelName: 'Detail', name: 'detail', type: 'default' },
        { labelName: 'Creation YAML', name: 'creation_yaml', type: 'default' },
      ]
    },
    {
      panelName: 'Other',
      tableRecordList: [],
      keyValueRecords: [
        { labelName: 'Cloud Service Provider ID', name: 'cloud_context', type: 'default' },
      ]
    },
  ]
};

export default K8S_CONFIG_MAP_TEMPLATE;
+1 −1
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ const EntityInfoPage = ({ entityInfoTemplate }: {
            for (const record of entityData.attributes[keyValueRecord.name]) {
              const temp: Record<string, string> = {};
              for (const key of Object.keys((record))) {
                temp[key] = record[key] ? `${record[key].replace(/\n/g,'')}` : '';
                temp[key] = record[key] ? `${record[key].replace(/(\r\n)|\n/,'')}` : '';
              }
              keyVal.push(temp);
            }