mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
fix(editor): Add button to refresh branches (#6387)
* fix(editor): Add button to refresh branches * trigger CI
This commit is contained in:
parent
e72521d5ec
commit
ce578162f4
|
@ -1403,6 +1403,9 @@
|
||||||
"settings.versionControl.loading.pull": "Pulling from remote",
|
"settings.versionControl.loading.pull": "Pulling from remote",
|
||||||
"settings.versionControl.loading.push": "Pushing to remote",
|
"settings.versionControl.loading.push": "Pushing to remote",
|
||||||
"settings.versionControl.saved.title": "Settings successfully saved",
|
"settings.versionControl.saved.title": "Settings successfully saved",
|
||||||
|
"settings.versionControl.refreshBranches.tooltip": "Reload branches list",
|
||||||
|
"settings.versionControl.refreshBranches.success": "Branches successfully refreshed",
|
||||||
|
"settings.versionControl.refreshBranches.error": "Error refreshing branches",
|
||||||
"showMessage.cancel": "@:_reusableBaseText.cancel",
|
"showMessage.cancel": "@:_reusableBaseText.cancel",
|
||||||
"showMessage.ok": "OK",
|
"showMessage.ok": "OK",
|
||||||
"showMessage.showDetails": "Show Details",
|
"showMessage.showDetails": "Show Details",
|
||||||
|
|
|
@ -162,6 +162,18 @@ async function refreshSshKey() {
|
||||||
toast.showError(error, locale.baseText('settings.versionControl.refreshSshKey.error.title'));
|
toast.showError(error, locale.baseText('settings.versionControl.refreshSshKey.error.title'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const refreshBranches = async () => {
|
||||||
|
try {
|
||||||
|
await versionControlStore.getBranches();
|
||||||
|
toast.showMessage({
|
||||||
|
title: locale.baseText('settings.versionControl.refreshBranches.success'),
|
||||||
|
type: 'success',
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
toast.showError(error, locale.baseText('settings.versionControl.refreshBranches.error'));
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -288,20 +300,37 @@ async function refreshSshKey() {
|
||||||
locale.baseText('settings.versionControl.instanceSettings')
|
locale.baseText('settings.versionControl.instanceSettings')
|
||||||
}}</n8n-heading>
|
}}</n8n-heading>
|
||||||
<label>{{ locale.baseText('settings.versionControl.branches') }}</label>
|
<label>{{ locale.baseText('settings.versionControl.branches') }}</label>
|
||||||
<n8n-select
|
<div :class="$style.branchSelection">
|
||||||
:value="versionControlStore.preferences.branchName"
|
<n8n-select
|
||||||
class="mb-s"
|
:value="versionControlStore.preferences.branchName"
|
||||||
size="medium"
|
class="mb-s"
|
||||||
filterable
|
size="medium"
|
||||||
@input="onSelect"
|
filterable
|
||||||
>
|
@input="onSelect"
|
||||||
<n8n-option
|
>
|
||||||
v-for="b in versionControlStore.preferences.branches"
|
<n8n-option
|
||||||
:key="b"
|
v-for="b in versionControlStore.preferences.branches"
|
||||||
:value="b"
|
:key="b"
|
||||||
:label="b"
|
:value="b"
|
||||||
/>
|
:label="b"
|
||||||
</n8n-select>
|
/>
|
||||||
|
</n8n-select>
|
||||||
|
<n8n-tooltip placement="top">
|
||||||
|
<template #content>
|
||||||
|
<span>
|
||||||
|
{{ locale.baseText('settings.versionControl.refreshBranches.tooltip') }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<n8n-button
|
||||||
|
size="small"
|
||||||
|
type="tertiary"
|
||||||
|
icon="sync"
|
||||||
|
square
|
||||||
|
:class="$style.refreshBranches"
|
||||||
|
@click="refreshBranches"
|
||||||
|
/>
|
||||||
|
</n8n-tooltip>
|
||||||
|
</div>
|
||||||
<n8n-checkbox
|
<n8n-checkbox
|
||||||
v-model="versionControlStore.preferences.branchReadOnly"
|
v-model="versionControlStore.preferences.branchReadOnly"
|
||||||
:class="$style.readOnly"
|
:class="$style.readOnly"
|
||||||
|
@ -418,4 +447,14 @@ hr {
|
||||||
margin: 0 0 var(--spacing-xl);
|
margin: 0 0 var(--spacing-xl);
|
||||||
border: 1px solid var(--color-foreground-light);
|
border: 1px solid var(--color-foreground-light);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.branchSelection {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
button.refreshBranches {
|
||||||
|
height: 36px;
|
||||||
|
width: 36px;
|
||||||
|
margin-left: var(--spacing-xs);
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in a new issue