1.0.1: check both tea-cli and tea for every tea command, with a test for each case
This commit is contained in:
1 parent
e303c51b23
commit
25cea75eb5
6 files changed
+93
-19
No files matched your search
@@ -741,7 +741,7 @@ window.__ModuleLoader__.load({
|
||||
setGt((g) => ({ ...g, token: '', password: '' })); setMsg({ text: t('settings.added') }); await refresh(true);
|
||||
});
|
||||
const doLogout = (a) => act('logout:' + a.id, async () => {
|
||||
const cli = a.kind === 'github' ? 'gh' : 'tea-cli';
|
||||
const cli = a.kind === 'github' ? 'gh' : ((status && status.cli && status.cli.tea.binary) || 'tea-cli');
|
||||
if (!window.confirm(fill(t('settings.logoutConfirm'), { id: a.id, cli }))) return;
|
||||
await post('auth/logout', { account: a.id }); setMsg({ text: t('settings.removed') }); await refresh(true);
|
||||
})();
|
||||
@@ -775,7 +775,7 @@ window.__ModuleLoader__.load({
|
||||
h(P.Button, { variant: 'outline', size: 'sm', disabled: !!busy, onClick: () => doLogout(a) }, t('settings.logout'))))),
|
||||
cli ? h('div', { style: S.caption },
|
||||
t('settings.cli') + ': gh ' + (cli.gh.available ? cli.gh.version.replace(/^gh version\s*/, '') : t('settings.missing')) +
|
||||
' · ' + (cli.tea.binary || 'tea-cli') + ' ' + (cli.tea.available ? cli.tea.version.replace(/^Version:\s*/, '') : t('settings.missing'))) : null),
|
||||
' · ' + (cli.tea.binary || 'tea-cli / tea') + ' ' + (cli.tea.available ? cli.tea.version.replace(/^Version:\s*/, '') : t('settings.missing'))) : null),
|
||||
msg ? h('div', { style: msg.bad ? S.errorBox : S.hint, role: msg.bad ? 'alert' : 'status' }, msg.text) : null,
|
||||
// github
|
||||
h('div', { style: S.section },
|
||||
@@ -802,7 +802,7 @@ window.__ModuleLoader__.load({
|
||||
// gitea
|
||||
h('div', { style: S.section },
|
||||
h('span', { style: S.label }, t('settings.add') + ' — ' + t('settings.gitea')),
|
||||
!teaOk ? h('div', { style: S.error }, 'tea-cli ' + t('settings.missing')) : h(React.Fragment, null,
|
||||
!teaOk ? h('div', { style: S.error }, 'tea-cli / tea ' + t('settings.missing')) : h(React.Fragment, null,
|
||||
h('div', { style: S.split },
|
||||
h(Field, { label: t('settings.url') }, h(P.Input, { value: gt.url, placeholder: 'https://gitea.example.com', spellCheck: false, onChange: setG('url') })),
|
||||
h(Field, { label: t('settings.name') }, h(P.Input, { value: gt.name, placeholder: 'optional', spellCheck: false, onChange: setG('name') }))),
|
||||
|
||||
Reference in new issue
Block a user