Skip to content

Commit

Permalink
UI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tulsiojha committed Jan 14, 2024
1 parent b65da32 commit a8166f7
Show file tree
Hide file tree
Showing 28 changed files with 1,617 additions and 804 deletions.
166 changes: 59 additions & 107 deletions gql-queries-generator/doc/queries.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,16 @@ mutation consoleUpdateApp($projectName: String!, $envName: String!, $app: AppIn!
}
}

mutation consoleInterceptApp($projectName: String!, $envName: String!, $appname: String!, $deviceName: String!, $intercept: Boolean!) {
core_interceptApp(
projectName: $projectName
envName: $envName
appname: $appname
deviceName: $deviceName
intercept: $intercept
)
}

mutation consoleDeleteApp($projectName: String!, $envName: String!, $appName: String!) {
core_deleteApp(projectName: $projectName, envName: $envName, appName: $appName)
}
Expand Down Expand Up @@ -1065,19 +1075,19 @@ query consoleListApps($projectName: String!, $envName: String!, $search: SearchA
displayName
enabled
environmentName
kind
lastUpdatedBy {
userEmail
userId
userName
}
markedForDeletion
metadata {
annotations
generation
name
namespace
}
projectName
recordVersion
spec {
containers {
args
Expand All @@ -1096,23 +1106,6 @@ query consoleListApps($projectName: String!, $envName: String!, $search: SearchA
}
image
imagePullPolicy
livenessProbe {
failureThreshold
httpGet {
httpHeaders
path
port
}
initialDelay
interval
shell {
command
}
tcp {
port
}
type
}
name
readinessProbe {
failureThreshold
Expand All @@ -1128,15 +1121,6 @@ query consoleListApps($projectName: String!, $envName: String!, $search: SearchA
max
min
}
volumes {
items {
fileName
key
}
mountPath
refName
type
}
}
displayName
freeze
Expand Down Expand Up @@ -1184,6 +1168,14 @@ query consoleListApps($projectName: String!, $envName: String!, $search: SearchA
namespace
}
}
syncStatus {
action
error
lastSyncedAt
recordVersion
state
syncScheduledAt
}
updateTime
}
}
Expand Down Expand Up @@ -1243,43 +1235,14 @@ query consoleListRouters($projectName: String!, $envName: String!, $search: Sear
}
markedForDeletion
metadata {
generation
name
namespace
}
projectName
recordVersion
spec {
backendProtocol
basicAuth {
enabled
secretName
username
}
cors {
allowCredentials
enabled
origins
}
domains
https {
clusterIssuer
enabled
forceRedirect
}
ingressClass
maxBodySizeInMB
rateLimit {
connections
enabled
rpm
rps
}
routes {
app
lambda
path
port
rewrite
}
}
status {
checks
Expand All @@ -1296,6 +1259,14 @@ query consoleListRouters($projectName: String!, $envName: String!, $search: Sear
namespace
}
}
syncStatus {
action
error
lastSyncedAt
recordVersion
state
syncScheduledAt
}
updateTime
}
}
Expand Down Expand Up @@ -3359,8 +3330,13 @@ mutation consoleUpdateManagedResource($projectName: String!, $envName: String!,
}
}

query consoleListManagedResources($projectName: String!, $envName: String!) {
core_listManagedResources(projectName: $projectName, envName: $envName) {
query consoleListManagedResources($projectName: String!, $envName: String!, $search: SearchManagedResources, $pq: CursorPaginationIn) {
core_listManagedResources(
projectName: $projectName
envName: $envName
search: $search
pq: $pq
) {
edges {
cursor
node {
Expand All @@ -3380,10 +3356,12 @@ query consoleListManagedResources($projectName: String!, $envName: String!) {
}
markedForDeletion
metadata {
generation
name
namespace
}
projectName
recordVersion
spec {
resourceTemplate {
apiVersion
Expand Down Expand Up @@ -3412,6 +3390,14 @@ query consoleListManagedResources($projectName: String!, $envName: String!) {
namespace
}
}
syncStatus {
action
error
lastSyncedAt
recordVersion
state
syncScheduledAt
}
updateTime
}
}
Expand Down Expand Up @@ -3686,29 +3672,6 @@ query consoleListConsoleVpnDevices($search: CoreSearchVPNDevices, $pq: CursorPag
targetPort
}
}
status {
checks
isReady
lastReadyGeneration
lastReconcileTime
message {
RawMessage
}
resources {
apiVersion
kind
name
namespace
}
}
syncStatus {
action
error
lastSyncedAt
recordVersion
state
syncScheduledAt
}
updateTime
}
}
Expand Down Expand Up @@ -3754,6 +3717,8 @@ query consoleGetConsoleVpnDevice($name: String!) {

query consoleListConsoleVpnDevicesForUser {
core_listVPNDevicesForUser {
accountName
apiVersion
createdBy {
userEmail
userId
Expand All @@ -3762,14 +3727,20 @@ query consoleListConsoleVpnDevicesForUser {
creationTime
displayName
environmentName
id
kind
lastUpdatedBy {
userEmail
userId
userName
}
markedForDeletion
metadata {
annotations
creationTimestamp
deletionTimestamp
generation
labels
name
namespace
}
Expand All @@ -3788,30 +3759,11 @@ query consoleListConsoleVpnDevicesForUser {
targetPort
}
}
status {
checks
isReady
lastReadyGeneration
lastReconcileTime
message {
RawMessage
}
resources {
apiVersion
kind
name
namespace
}
}
syncStatus {
action
error
lastSyncedAt
recordVersion
state
syncScheduledAt
}
updateTime
wireguardConfig {
encoding
value
}
}
}

Expand Down
19 changes: 6 additions & 13 deletions src/apps/console/components/name-id-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ export const NameIdView = forwardRef<HTMLInputElement, INameIdView>(
}, [displayName, name]);

const checkNameAvailable = () => {
console.log('inside ', errors);

if (errors) {
// onCheckError?.(true);
return errors;
Expand Down Expand Up @@ -174,6 +176,7 @@ export const NameIdView = forwardRef<HTMLInputElement, INameIdView>(
'secret',
'project_managed_service',
'console_vpn_device',
'router',
].includes(tempResType)
? {
projectName: project,
Expand Down Expand Up @@ -217,17 +220,6 @@ export const NameIdView = forwardRef<HTMLInputElement, INameIdView>(
[displayName, name, isUpdate]
);

useEffect(() => {
console.log(
'error: ',
(!nameLoading || !isUpdate) &&
((!nameValid && !!name && !nameLoading) || !!errors),
!nameLoading || !isUpdate,
!nameValid && !!name && !nameLoading,
!!errors
);
}, []);

return (
<TextInput
ref={ref}
Expand All @@ -244,10 +236,11 @@ export const NameIdView = forwardRef<HTMLInputElement, INameIdView>(
if (!isUpdate) {
handleChange?.('name')(dummyEvent(id));
}

if (v) {
setNameLoading(true);
handleChange?.(nameErrorLabel)(dummyEvent(true));
if (!isUpdate) {
handleChange?.(nameErrorLabel)(dummyEvent(true));
}
} else {
setNameLoading(false);
handleChange?.(nameErrorLabel)(dummyEvent(false));
Expand Down
6 changes: 5 additions & 1 deletion src/apps/console/components/sync-status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,11 @@ export const listStatus = ({
return {
key,
className,
render: () => <SyncStatus item={item} />,
render: () => (
<div className="min-w-[20px]">
<SyncStatus item={item} />
</div>
),
status: parseStatus({ item, type }),
};
};
Expand Down
Loading

0 comments on commit a8166f7

Please sign in to comment.