MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / getStatusColor

Function getStatusColor

src/utils/utils.ts:744–784  ·  view source on GitHub ↗
(options: {
  isPausing: boolean;
  isTask: boolean;
  taskStatus?: string | null;
  isStartingStatus: boolean;
  isStopStatus: boolean;
  curAgentState: AgentState;
})

Source from the content-addressed store, hash-verified

742 * }) // Returns "var(--oh-status-success)"
743 */
744export const getStatusColor = (options: {
745 isPausing: boolean;
746 isTask: boolean;
747 taskStatus?: string | null;
748 isStartingStatus: boolean;
749 isStopStatus: boolean;
750 curAgentState: AgentState;
751}): string => {
752 const {
753 isPausing,
754 isTask,
755 taskStatus,
756 isStartingStatus,
757 isStopStatus,
758 curAgentState,
759 } = options;
760
761 // Show pausing status
762 if (isPausing) {
763 return "#FFD600";
764 }
765
766 // Show task status if we're polling a task
767 if (isTask && taskStatus) {
768 if (taskStatus === "ERROR") {
769 return OH_STATUS_ERROR_COLOR;
770 }
771 return "#FFD600";
772 }
773
774 if (isStartingStatus) {
775 return "#FFD600";
776 }
777 if (isStopStatus) {
778 return "#ffffff";
779 }
780 if (curAgentState === AgentState.ERROR) {
781 return OH_STATUS_ERROR_COLOR;
782 }
783 return OH_STATUS_SUCCESS_COLOR;
784};
785
786interface GetStatusTextArgs {
787 isPausing: boolean;

Callers 3

ChatInterfaceFunction · 0.90
ServerStatusFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected