Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a22662f11b | ||
|
|
75531a9ec3 | ||
|
|
e6ab2667c9 |
@@ -24,6 +24,36 @@ jobs:
|
|||||||
- name: Build project
|
- name: Build project
|
||||||
run: npm run build
|
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
|
- name: Install SSH key
|
||||||
uses: webfactory/ssh-agent@v0.9.0
|
uses: webfactory/ssh-agent@v0.9.0
|
||||||
with:
|
with:
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "frontend",
|
"name": "frontend",
|
||||||
"version": "0.9.1",
|
"version": "0.9.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -44,7 +44,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex items-center gap-4">
|
<div class="flex items-center gap-4">
|
||||||
<!-- Пинг -->
|
|
||||||
<span
|
<span
|
||||||
v-if="host.ping !== undefined && host.ping !== null"
|
v-if="host.ping !== undefined && host.ping !== null"
|
||||||
class="font-mono font-semibold flex items-center gap-1 min-w-[60px] justify-end"
|
class="font-mono font-semibold flex items-center gap-1 min-w-[60px] justify-end"
|
||||||
@@ -59,7 +58,6 @@
|
|||||||
</span>
|
</span>
|
||||||
<span v-else class="text-gray-300 min-w-[60px] text-right">—</span>
|
<span v-else class="text-gray-300 min-w-[60px] text-right">—</span>
|
||||||
|
|
||||||
<!-- Кнопка пинга -->
|
|
||||||
<button
|
<button
|
||||||
@click="pingSingleHost(host)"
|
@click="pingSingleHost(host)"
|
||||||
:disabled="host.pinging"
|
:disabled="host.pinging"
|
||||||
@@ -90,21 +88,31 @@ let interval = null
|
|||||||
|
|
||||||
const countriesList = getAllCountries()
|
const countriesList = getAllCountries()
|
||||||
|
|
||||||
const findCountryByName = (countryName) => {
|
// Поиск страны по первому слову в названии
|
||||||
if (!countryName) return null
|
const findCountryByFirstWord = (name) => {
|
||||||
const found = countriesList.find(c => c.label.toLowerCase() === countryName.toLowerCase())
|
if (!name) return null
|
||||||
if (found) return found
|
|
||||||
|
// Берём первое слово из названия
|
||||||
|
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 =>
|
const partial = countriesList.find(c =>
|
||||||
countryName.toLowerCase().includes(c.label.toLowerCase()) ||
|
firstWord.toLowerCase().includes(c.label.toLowerCase()) ||
|
||||||
c.label.toLowerCase().includes(countryName.toLowerCase())
|
c.label.toLowerCase().includes(firstWord.toLowerCase())
|
||||||
)
|
)
|
||||||
return partial || null
|
return partial || null
|
||||||
}
|
}
|
||||||
|
|
||||||
// Сортировка по пингу (меньше -> выше)
|
// Сортировка по пингу
|
||||||
const sortedHosts = computed(() => {
|
const sortedHosts = computed(() => {
|
||||||
return [...hosts.value].sort((a, b) => {
|
return [...hosts.value].sort((a, b) => {
|
||||||
// Если пинг null -> в конец
|
|
||||||
if (a.ping === null && b.ping === null) return 0
|
if (a.ping === null && b.ping === null) return 0
|
||||||
if (a.ping === null) return 1
|
if (a.ping === null) return 1
|
||||||
if (b.ping === null) return -1
|
if (b.ping === null) return -1
|
||||||
@@ -161,7 +169,7 @@ const fetchHosts = async () => {
|
|||||||
const data = await res.json()
|
const data = await res.json()
|
||||||
|
|
||||||
hosts.value = data.map((h) => {
|
hosts.value = data.map((h) => {
|
||||||
const country = findCountryByName(h.name)
|
const country = findCountryByFirstWord(h.name)
|
||||||
return {
|
return {
|
||||||
...h,
|
...h,
|
||||||
countryCode: country?.code?.toLowerCase() || null,
|
countryCode: country?.code?.toLowerCase() || null,
|
||||||
@@ -190,4 +198,4 @@ onMounted(() => {
|
|||||||
interval = setInterval(refreshData, 30000)
|
interval = setInterval(refreshData, 30000)
|
||||||
})
|
})
|
||||||
onUnmounted(() => clearInterval(interval))
|
onUnmounted(() => clearInterval(interval))
|
||||||
</script>s
|
</script>
|
||||||
Reference in New Issue
Block a user