How to use argo-ui - 10 common examples

To help you get started, we’ve selected a few argo-ui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github argoproj / argo-cd / ui / src / app / applications / components / applications-list / applications-list.tsx View on Github external
createApp={async app => {
                                                        setAppCreatePending(true);
                                                        try {
                                                            await services.applications.create(app);
                                                            ctx.navigation.goto('.', {new: null});
                                                        } catch (e) {
                                                            ctx.notifications.show({
                                                                content: ,
                                                                type: NotificationType.Error
                                                            });
                                                        } finally {
                                                            setAppCreatePending(false);
                                                        }
                                                    }}
                                                    app={appInput}
github argoproj / argo-cd / ui / src / app / applications / components / application-sync-panel / application-sync-panel.tsx View on Github external
try {
                                    await services.applications.sync(
                                        application.metadata.name,
                                        params.revision,
                                        syncFlags.Prune || false,
                                        syncFlags.DryRun || false,
                                        syncStrategy,
                                        resources,
                                        params.syncOptions
                                    );
                                    hide();
                                } catch (e) {
                                    ctx.notifications.show({
                                        content: ,
                                        type: NotificationType.Error
                                    });
                                } finally {
                                    setPending(false);
                                }
                            }}
                            getApi={setForm}>
github argoproj / argo-cd / ui / src / app / settings / components / projects-list / projects-list.tsx View on Github external
onSubmit={async (proj: Project) => {
                                            try {
                                                await services.projects.create(proj);
                                                ctx.navigation.goto(`./${proj.metadata.name}`, {add: null});
                                            } catch (e) {
                                                ctx.notifications.show({
                                                    content: ,
                                                    type: NotificationType.Error
                                                });
                                            }
                                        }}>
                                        {api => (
github argoproj / argo-cd / ui / src / app / applications / components / application-pod-view / pod-view.tsx View on Github external
submit: async (vals, _, close) => {
                                                                                            try {
                                                                                                await services.applications.deleteResource(
                                                                                                    this.props.app.metadata.name,
                                                                                                    pod,
                                                                                                    !!vals.force,
                                                                                                    false
                                                                                                );
                                                                                                close();
                                                                                            } catch (e) {
                                                                                                this.appContext.apis.notifications.show({
                                                                                                    content: ,
                                                                                                    type: NotificationType.Error
                                                                                                });
                                                                                            }
                                                                                        }
                                                                                    }
github argoproj / argo-cd / ui / src / app / settings / components / certs-list / certs-list.tsx View on Github external
private async addTLSCertificate(params: NewTLSCertParams) {
        try {
            await services.certs.create({items: [{serverName: params.serverName, certType: 'https', certData: params.certData, certSubType: '', certInfo: ''}], metadata: null});
            this.showAddTLSCertificate = false;
            this.loader.reload();
        } catch (e) {
            this.appContext.apis.notifications.show({
                content: ,
                type: NotificationType.Error
            });
        }
    }
github argoproj / argo-cd / ui / src / app / settings / components / account-details / account-details.tsx View on Github external
onSubmit={async (params, event, api) => {
                                    const expiresIn = convertExpiresInToSeconds(params.expiresIn);
                                    const confirmed = await ctx.popup.confirm('Generate new token?', 'Are you sure you want to generate new token?');
                                    if (!confirmed) {
                                        return;
                                    }
                                    try {
                                        setNewToken(await services.accounts.createToken(props.match.params.name, params.id, expiresIn));
                                        api.resetAll();
                                        if (tokensLoaderRef.current) {
                                            tokensLoaderRef.current.reload();
                                        }
                                    } catch (e) {
                                        ctx.notifications.show({
                                            content: ,
                                            type: NotificationType.Error
                                        });
                                    }
                                }}
                                validateError={params => ({
github argoproj / argo-cd-ui / src / app / applications / components / application-creation-wizard / application-creation-wizard.tsx View on Github external
}, step: Step.SetParams });
                            } else if (selectedAppDetails.kustomize) {
                                this.updateState({ selectedAppDetails, appParams: {
                                    applicationName: '',
                                    revision: this.state.revision,
                                    repoURL: this.state.selectedRepo,
                                    environment: '',
                                    clusterURL: '',
                                    namespace: '',
                                    path: selectedAppDetails.kustomize.path,
                                    project: this.state.projects[0].metadata.name,
                                    syncPolicy: this.state.syncPolicy,
                                }, step: Step.SetParams });
                            }
                        } catch (e) {
                            this.appContext.apis.notifications.show({type: NotificationType.Error, content: });
                        } finally {
                            this.updateState({ loading: false });
                        }
                    },
                    canPrev: () => true,
github argoproj / argo-cd / ui / src / app / shared / components / editable-panel / editable-panel.tsx View on Github external
onSubmit={async input => {
                                        try {
                                            this.setState({saving: true});
                                            await this.props.save(input as any);
                                            this.setState({edit: false, saving: false});
                                            this.onModeSwitch();
                                        } catch (e) {
                                            ctx.notifications.show({
                                                content: ,
                                                type: NotificationType.Error
                                            });
                                        } finally {
                                            this.setState({saving: false});
                                        }
                                    }}
                                    defaultValues={this.props.values}
github argoproj / argo-cd / ui / src / app / applications / components / application-details / application-details.tsx View on Github external
const confirmed = await this.appContext.apis.popup.confirm('Rollback application', confirmationMessage);
            if (confirmed) {
                if (needDisableRollback) {
                    const update = JSON.parse(JSON.stringify(application)) as appModels.Application;
                    update.spec.syncPolicy = {automated: null};
                    await services.applications.update(update);
                }
                await services.applications.rollback(this.props.match.params.name, revisionHistory.id);
                this.appChanged.next(await services.applications.get(this.props.match.params.name));
                this.setRollbackPanelVisible(-1);
            }
        } catch (e) {
            this.appContext.apis.notifications.show({
                content: ,
                type: NotificationType.Error
            });
        }
    }
github argoproj / argo-cd / ui / src / app / applications / components / utils.tsx View on Github external
submit: async (vals, _, close) => {
                                try {
                                    await services.applications.deleteResource(application.metadata.name, resource, !!vals.force);
                                    appChanged.next(await services.applications.get(application.metadata.name));
                                    close();
                                } catch (e) {
                                    appContext.apis.notifications.show({
                                        content: ,
                                        type: NotificationType.Error
                                    });
                                }
                            }
                        },