4 Commits
Author SHA1 Message Date
austnv 4e6e0d4d48 fix deploy
Build and Deploy Frontend via SSH / deploy (push) Successful in 47s
2026-06-21 22:39:42 +03:00
austnv a22662f11b v0.9.2
Build and Deploy Frontend via SSH / deploy (push) Failing after 4s
2026-06-21 21:56:47 +03:00
austnv 75531a9ec3 update workflow: add auto release 2026-06-21 21:56:19 +03:00
austnv e6ab2667c9 fix: micropatch NodesStatus 2026-06-21 21:50:00 +03:00
3 changed files with 64 additions and 13 deletions
+43
View File
@@ -24,6 +24,49 @@ jobs:
- name: Build project
run: npm run build
- name: Create Gitea Release via API
run: |
# Получаем описание из тега (если есть)
TAG_MESSAGE=$(git tag -l --format='%(contents)' "${{ gitea.ref_name }}" 2>/dev/null || echo "Автоматический релиз через CI/CD")
# Экранируем кавычки и переносы для JSON
TAG_MESSAGE_ESCAPED=$(echo "$TAG_MESSAGE" | sed 's/"/\\"/g' | awk '{printf "%s\\n", $0}')
# Формируем JSON
JSON_PAYLOAD=$(cat <<EOF
{
"tag_name": "${{ gitea.ref_name }}",
"name": "Release ${{ gitea.ref_name }}",
"body": "## Релиз ${{ gitea.ref_name }}\n\n📝 ${TAG_MESSAGE_ESCAPED}\n\n---\n\n**🏷️ Тег:** \`${{ gitea.ref_name }}\`\n**👤 Автор:** ${{ gitea.actor }}\n\n✅ Автоматически собрано и развёрнуто",
"draft": false,
"prerelease": false
}
EOF
)
# Отправляем запрос
RESPONSE=$(curl -s -w "\n%{http_code}" \
-X POST \
-H "Authorization: token ${{ secrets.ACCESS_TOKEN }}" \
-H "Content-Type: application/json" \
-d "$JSON_PAYLOAD" \
"https://git.uvpn.shop/api/v1/repos/${{ gitea.repository }}/releases")
# Проверяем ответ
HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
BODY=$(echo "$RESPONSE" | sed '$d')
if [ "$HTTP_CODE" -eq 201 ]; then
echo "✅ Релиз успешно создан!"
echo "$BODY" | jq '.'
elif [ "$HTTP_CODE" -eq 409 ]; then
echo "⚠️ Релиз с таким тегом уже существует, пропускаем"
else
echo "❌ Ошибка создания релиза (HTTP $HTTP_CODE)"
echo "$BODY"
exit 1
fi
- name: Install SSH key
uses: webfactory/ssh-agent@v0.9.0
with:
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "0.9.1",
"version": "0.9.3",
"private": true,
"type": "module",
"scripts": {
+20 -12
View File
@@ -44,7 +44,6 @@
</div>
<div class="flex items-center gap-4">
<!-- Пинг -->
<span
v-if="host.ping !== undefined && host.ping !== null"
class="font-mono font-semibold flex items-center gap-1 min-w-[60px] justify-end"
@@ -59,7 +58,6 @@
</span>
<span v-else class="text-gray-300 min-w-[60px] text-right"></span>
<!-- Кнопка пинга -->
<button
@click="pingSingleHost(host)"
:disabled="host.pinging"
@@ -90,21 +88,31 @@ let interval = null
const countriesList = getAllCountries()
const findCountryByName = (countryName) => {
if (!countryName) return null
const found = countriesList.find(c => c.label.toLowerCase() === countryName.toLowerCase())
if (found) return found
// Поиск страны по первому слову в названии
const findCountryByFirstWord = (name) => {
if (!name) return null
// Берём первое слово из названия
const firstWord = name.split(' ')[0]
if (!firstWord) return null
// Ищем точное совпадение
const exact = countriesList.find(c =>
c.label.toLowerCase() === firstWord.toLowerCase()
)
if (exact) return exact
// Ищем частичное совпадение
const partial = countriesList.find(c =>
countryName.toLowerCase().includes(c.label.toLowerCase()) ||
c.label.toLowerCase().includes(countryName.toLowerCase())
firstWord.toLowerCase().includes(c.label.toLowerCase()) ||
c.label.toLowerCase().includes(firstWord.toLowerCase())
)
return partial || null
}
// Сортировка по пингу (меньше -> выше)
// Сортировка по пингу
const sortedHosts = computed(() => {
return [...hosts.value].sort((a, b) => {
// Если пинг null -> в конец
if (a.ping === null && b.ping === null) return 0
if (a.ping === null) return 1
if (b.ping === null) return -1
@@ -161,7 +169,7 @@ const fetchHosts = async () => {
const data = await res.json()
hosts.value = data.map((h) => {
const country = findCountryByName(h.name)
const country = findCountryByFirstWord(h.name)
return {
...h,
countryCode: country?.code?.toLowerCase() || null,
@@ -190,4 +198,4 @@ onMounted(() => {
interval = setInterval(refreshData, 30000)
})
onUnmounted(() => clearInterval(interval))
</script>s
</script>