Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a22662f11b | ||
|
|
75531a9ec3 | ||
|
|
e6ab2667c9 |
@@ -24,6 +24,36 @@ jobs:
|
||||
- name: Build project
|
||||
run: npm run build
|
||||
|
||||
- name: Create Gitea Release
|
||||
uses: actions/gitea-release-action@v1
|
||||
with:
|
||||
release_name: ${{ gitea.ref_name }}
|
||||
release_notes: |
|
||||
## Релиз ${{ gitea.ref_name }}
|
||||
|
||||
${{ (github.event.head_commit.message != '' && format('📝 {0}', github.event.head_commit.message)) || '' }}
|
||||
|
||||
### 📦 Что изменилось
|
||||
${{ github.event.head_commit.message || 'Автоматический релиз через CI/CD' }}
|
||||
|
||||
---
|
||||
|
||||
### 🔧 Технические детали
|
||||
- **Тег:** `${{ gitea.ref_name }}`
|
||||
- **Ветка:** `${{ gitea.ref }}`
|
||||
- **Автор:** ${{ gitea.actor }}
|
||||
|
||||
### 🚀 Деплой
|
||||
- ✅ Сервер обновлён автоматически
|
||||
|
||||
---
|
||||
|
||||
> Релиз создан автоматически через Gitea Actions
|
||||
draft: false
|
||||
prerelease: false
|
||||
env:
|
||||
GITEA_API_KEY: ${{ secrets.ACCESS_TOKEN }}
|
||||
|
||||
- name: Install SSH key
|
||||
uses: webfactory/ssh-agent@v0.9.0
|
||||
with:
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "frontend",
|
||||
"version": "0.9.1",
|
||||
"version": "0.9.2",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user