Skip to content

Commit

Permalink
Display error on commit resolution error
Browse files Browse the repository at this point in the history
  • Loading branch information
motoki317 committed Apr 18, 2024
1 parent b8cc4d6 commit 95ab2a2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
19 changes: 13 additions & 6 deletions dashboard/src/components/templates/app/AppBranchResolution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { style } from '@macaron-css/core'
import { styled } from '@macaron-css/solid'
import { AiOutlineBranches } from 'solid-icons/ai'
import { type Component, For, Show } from 'solid-js'
import { type Application, DeployType } from '/@/api/neoshowcase/protobuf/gateway_pb'
import type { Application } from '/@/api/neoshowcase/protobuf/gateway_pb'
import { Button } from '/@/components/UI/Button'
import Code from '/@/components/UI/Code'
import JumpButton from '/@/components/UI/JumpButton'
import { ToolTip } from '/@/components/UI/ToolTip'
import { List } from '/@/components/templates/List'
import { type CommitsMap, systemInfo } from '/@/libs/api'
import { ApplicationState, deploymentState } from '/@/libs/application'
import { AppStatusIcon } from '/@/components/templates/app/AppStatusIcon'
import type { CommitsMap } from '/@/libs/api'
import { ApplicationState, errorCommit } from '/@/libs/application'
import { diffHuman, shortSha } from '/@/libs/format'
import { colorVars, textVars } from '/@/theme'

Expand Down Expand Up @@ -61,10 +61,17 @@ const AppBranchResolution: Component<{
const commit = () => props.commits?.[props.app.commit]
const commitDisplay = () => {
const c = commit()
const isErrorCommit = props.app.commit === errorCommit
const base = (
<DataRow>
<AiOutlineBranches />
<div>{`${props.app.refName}${shortSha(props.app.commit)}`}</div>
<AiOutlineBranches size={20} />
<DataRow>
{`${props.app.refName} → `}
<Show when={isErrorCommit} fallback={shortSha(props.app.commit)}>
<AppStatusIcon state={ApplicationState.Error} size={20} />
Error
</Show>
</DataRow>
</DataRow>
)
if (!c || !c.commitDate) {
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/libs/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const deploymentState = (app: Application): ApplicationState => {
return ApplicationState.Serving
}

const errorCommit = '0'.repeat(40)
export const errorCommit = '0'.repeat(40)

export const applicationState = (app: Application): ApplicationState => {
if (!app.running) {
Expand Down

0 comments on commit 95ab2a2

Please sign in to comment.