Exemplo n.º 1
0
  getSubView() {
    const task = MesosStateStore.getTaskFromTaskID(this.props.params.taskID);
    const { directory, selectedLogFile } = this.state;
    if (this.hasLoadingError()) {
      return this.getErrorScreen();
    }

    if (!directory || !task) {
      return this.getLoadingScreen();
    }
    const service = DCOSStore.serviceTree.getServiceFromTaskID(task.getId());

    return (
      <div className="flex flex-direction-top-to-bottom flex-item-grow-1 flex-item-shrink-1">
        {this.props.children &&
          React.cloneElement(this.props.children, {
            directory,
            selectedLogFile,
            task,
            onOpenLogClick: this.handleOpenLogClick,
            service
          })}
      </div>
    );
  }
Exemplo n.º 2
0
      const serviceCrumbs = ids.map((id, index) => {
        let breadcrumbHealth = null;
        let serviceImage = null;

        aggregateIDs += encodeURIComponent(`/${id}`);
        let routePath = "/services/overview/" + aggregateIDs;
        if (index === ids.length - 1) {
          const service = DCOSStore.serviceTree.findItemById(serviceID);
          // Make sure to change to detail route if service is not a group
          if (!(service instanceof ServiceTree)) {
            routePath = "/services/detail/" + aggregateIDs;
          }
          breadcrumbHealth = this.getHealthStatus(service);
          serviceImage = this.getServiceImage(service, aggregateIDs);
        }

        return (
          <Breadcrumb key={index} title={ids.slice(0, index + 1).join("/")}>
            {serviceImage}
            <BreadcrumbTextContent
              ref={ref => (this.primaryBreadcrumbTextRef = ref)}
            >
              <Link to={routePath}>
                {id}
              </Link>
            </BreadcrumbTextContent>
            {breadcrumbHealth}
          </Breadcrumb>
        );
      });
Exemplo n.º 3
0
  render() {
    const marathonTask = DCOSStore.serviceTree.getTaskFromTaskID(
      this.props.taskID
    );
    const taskConfiguration = this.getMarathonTaskDetails(marathonTask);
    const healthCheckResults = this.getMarathonTaskHealthCheckResults(
      marathonTask
    );

    return (
      <ConfigurationMapSection>
        {taskConfiguration}
        {healthCheckResults}
      </ConfigurationMapSection>
    );
  }
Exemplo n.º 4
0
  getBasicInfo() {
    const { selectedLogFile } = this.state;
    const task = MesosStateStore.getTaskFromTaskID(this.props.params.taskID);

    if (task == null) {
      return null;
    }

    const service = DCOSStore.serviceTree.getServiceFromTaskID(task.getId());
    const taskIcon = <img src={task.getImages()["icon-large"]} />;
    const filePath = (selectedLogFile && selectedLogFile.get("path")) || null;
    const params = Object.assign({ filePath }, this.props.params);

    let tabsArray = this.tabs_getRoutedTabs({ params }) || [];

    if (!this.hasVolumes(service)) {
      tabsArray = tabsArray.filter(function(tab) {
        if (
          tab.key === "/nodes/:nodeID/tasks/:taskID/volumes(/:volumeID)" ||
          tab.key === "/services/detail/:id/tasks/:taskID/volumes"
        ) {
          return false;
        }

        return true;
      });
    }

    const navigationTabs = <ul className="menu-tabbed">{tabsArray}</ul>;

    const taskState = task.get("state");
    const serviceStatus = TaskStates[taskState].displayName;
    const serviceStatusClassSet = StatusMapping[serviceStatus] || "";

    return (
      <DetailViewHeader
        icon={taskIcon}
        iconClassName="icon-app-container  icon-image-container"
        subTitle={<Trans render="span" id={serviceStatus} />}
        subTitleClassName={serviceStatusClassSet}
        navigationTabs={navigationTabs}
        title={task.getName()}
      />
    );
  }
Exemplo n.º 5
0
  render() {
    const { taskId } = this.props;

    if (taskId == null) {
      return null;
    }

    const service = DCOSStore.serviceTree.getServiceFromTaskID(taskId);

    return (
      <ConfigurationMapRow>
        <ConfigurationMapLabel>
          <Trans render="span">IP Addresses</Trans>
        </ConfigurationMapLabel>
        <ConfigurationMapValue>
          {this.getIPAddressesForTask(service, taskId).join(", ")}
        </ConfigurationMapValue>
      </ConfigurationMapRow>
    );
  }
Exemplo n.º 6
0
  render() {
    const { taskID, volumeID } = this.props.params;
    const task = MesosStateStore.getTaskFromTaskID(taskID);
    const service = DCOSStore.serviceTree.getServiceFromTaskID(task.getId());
    const volumeId = decodeURIComponent(volumeID);

    if (this.state.isLoading) {
      return <Loader />;
    }

    if (!service) {
      return (
        <ServiceItemNotFound
          message={
            <Trans render="span">
              The service with the ID of "{taskID}" could not be found.
            </Trans>
          }
        />
      );
    }

    const volume = service.getVolumes().findItem(volume => {
      return volume.getId() === volumeId;
    });

    if (!volume) {
      return (
        <ServiceItemNotFound
          message={
            <Trans render="span">Volume '{volumeId}' was not found.</Trans>
          }
        />
      );
    }

    return <VolumeDetail service={service} volume={volume} />;
  }
Exemplo n.º 7
0
  render() {
    const { id, volumeID } = this.props.params;
    const serviceId = decodeURIComponent(id);
    const service = DCOSStore.serviceTree.findItemById(serviceId);
    const volumeId = decodeURIComponent(volumeID);

    if (this.state.isLoading) {
      return <Loader />;
    }

    if (!service) {
      return (
        <ServiceItemNotFound
          message={
            <Trans render="span">
              The service with the ID of "{id}" could not be found.
            </Trans>
          }
        />
      );
    }

    const volume = service.getVolumesData().findItem(volume => {
      return volume.getId() === volumeId;
    });

    if (!volume) {
      return (
        <ServiceItemNotFound
          message={
            <Trans render="span">Volume '{volumeId}' was not found.</Trans>
          }
        />
      );
    }

    return <PodVolumeDetail service={service} volume={volume} />;
  }