chore: bump version to v1.2.1

This commit is contained in:
dyzulk
2026-01-19 10:04:47 +07:00
parent a0e8c097f7
commit 9cee55c05a
12 changed files with 33 additions and 17 deletions

3
.gitignore vendored
View File

@@ -32,4 +32,5 @@ deploy.ps1
!/public/uploads/.gitignore
# Plugins
/plugins/*
/plugins/*
!/plugins/.gitkeep

View File

@@ -3,7 +3,7 @@ namespace App\Config;
class SiteConfig {
const APP_NAME = 'MIVO';
const APP_VERSION = 'v1.2.0';
const APP_VERSION = 'v1.2.1';
const APP_FULL_NAME = 'MIVO - Mikrotik Voucher';
const CREDIT_NAME = 'MivoDev';
const CREDIT_URL = 'https://github.com/mivodev';

View File

@@ -97,10 +97,16 @@ class Router {
$path = parse_url($uri, PHP_URL_PATH);
// Handle subdirectory
$scriptName = dirname($_SERVER['SCRIPT_NAME']);
if (strpos($path, $scriptName) === 0) {
$path = substr($path, strlen($scriptName));
// Handle subdirectory (SKIP for PHP Built-in Server to avoid SCRIPT_NAME issues)
if (php_sapi_name() !== 'cli-server') {
$scriptName = dirname($_SERVER['SCRIPT_NAME']);
// Normalize backslashes (Windows)
$scriptName = str_replace('\\', '/', $scriptName);
// Ensure we don't strip root slash
if ($scriptName !== '/' && strpos($path, $scriptName) === 0) {
$path = substr($path, strlen($scriptName));
}
}
$path = $this->normalizePath($path);

View File

@@ -40,6 +40,6 @@ class LanguageHelper
}
}
return $languages;
return \App\Core\Hooks::applyFilters('get_available_languages', $languages);
}
}

View File

@@ -13,7 +13,7 @@
<i data-lucide="book-open" class="w-4 h-4"></i>
<span>Docs</span>
</a>
<a href="https://github.com/mivodev/mivo/issues" target="_blank" class="hover:text-foreground transition-colors flex items-center gap-2">
<a href="https://github.com/mivodev/mivo/discussions" target="_blank" class="hover:text-foreground transition-colors flex items-center gap-2">
<i data-lucide="message-circle" class="w-4 h-4"></i>
<span>Community</span>
</a>

View File

@@ -4,7 +4,7 @@
<i data-lucide="book-open" class="w-4 h-4"></i>
<span>Docs</span>
</a>
<a href="https://github.com/mivodev/mivo/issues" target="_blank" class="hover:text-foreground transition-colors flex items-center gap-2">
<a href="https://github.com/mivodev/mivo/discussions" target="_blank" class="hover:text-foreground transition-colors flex items-center gap-2">
<i data-lucide="message-circle" class="w-4 h-4"></i>
<span>Community</span>
</a>

View File

@@ -53,8 +53,9 @@ $uri = $_SERVER['REQUEST_URI'] ?? '/';
<?php
$languages = \App\Helpers\LanguageHelper::getAvailableLanguages();
foreach ($languages as $lang):
$pathArg = isset($lang['path']) ? "', '" . $lang['path'] : "";
?>
<button onclick="Mivo.modules.I18n.loadLanguage('<?= $lang['code'] ?>')" class="w-full text-left flex items-center gap-3 px-4 py-2.5 text-sm hover:bg-accents-1 transition-colors text-accents-6 hover:text-foreground group/lang">
<button onclick="Mivo.modules.I18n.loadLanguage('<?= $lang['code'] ?><?= $pathArg ?>')" class="w-full text-left flex items-center gap-3 px-4 py-2.5 text-sm hover:bg-accents-1 transition-colors text-accents-6 hover:text-foreground group/lang">
<span class="fi fi-<?= $lang['flag'] ?> rounded-sm shadow-sm transition-transform group-hover/lang:scale-110"></span>
<span><?= $lang['name'] ?></span>
</button>
@@ -123,8 +124,10 @@ $uri = $_SERVER['REQUEST_URI'] ?? '/';
<span class="text-xs font-bold text-accents-4 uppercase tracking-wider">Select Language</span>
</div>
<div class="flex items-center gap-2 overflow-x-auto pb-2 -mx-4 px-4 scrollbar-hide snap-x">
<?php foreach ($languages as $lang): ?>
<button onclick="changeLanguage('<?= $lang['code'] ?>')" class="flex-shrink-0 flex items-center gap-2 px-4 py-2 rounded-full border border-accents-2 bg-background hover:border-foreground transition-all text-sm font-medium snap-start shadow-sm">
<?php foreach ($languages as $lang):
$pathArg = isset($lang['path']) ? "', '" . $lang['path'] : "";
?>
<button onclick="changeLanguage('<?= $lang['code'] ?><?= $pathArg ?>')" class="flex-shrink-0 flex items-center gap-2 px-4 py-2 rounded-full border border-accents-2 bg-background hover:border-foreground transition-all text-sm font-medium snap-start shadow-sm">
<span class="fi fi-<?= $lang['flag'] ?> rounded-full shadow-sm"></span>
<span class="whitespace-nowrap"><?= $lang['name'] ?></span>
</button>

View File

@@ -397,7 +397,7 @@ $getInitials = function($name) {
</a>
<!-- Community -->
<a href="https://github.com/mivodev/mivo/issues" target="_blank" class="flex items-center gap-3 px-3 py-2 rounded-md text-sm font-medium transition-colors text-accents-6 hover:text-foreground hover:bg-white/5">
<a href="https://github.com/mivodev/mivo/discussions" target="_blank" class="flex items-center gap-3 px-3 py-2 rounded-md text-sm font-medium transition-colors text-accents-6 hover:text-foreground hover:bg-white/5">
<i data-lucide="message-circle" class="w-4 h-4"></i>
<span data-i18n="sidebar.community">Community</span>
<i data-lucide="external-link" class="w-3 h-3 ml-auto opacity-50"></i>

View File

@@ -1,6 +1,6 @@
{
"name": "mivo",
"version": "1.2.0",
"version": "1.2.1",
"description": "This is a complete rewrite of Mivo using a modern MVC architecture.\r It runs on a lightweight custom core designed for performance on low-end devices (STB/Android).",
"main": "index.js",
"scripts": {

View File

@@ -19,10 +19,12 @@ class I18n {
this.isLoaded = true;
}
async loadLanguage(lang) {
async loadLanguage(lang, customUrl = null) {
try {
const cacheBuster = Date.now();
const response = await fetch(`/lang/${lang}.json?v=${cacheBuster}`);
// Use custom URL if provided, otherwise default to public/lang structure
const url = customUrl || `/lang/${lang}.json`;
const response = await fetch(`${url}?v=${cacheBuster}`);
if (!response.ok) throw new Error(`Failed to load language: ${lang}`);
this.translations = await response.json();

View File

@@ -1,7 +1,7 @@
{
"_meta": {
"name": "English",
"flag": "gb"
"flag": "us"
},
"common": {
"dashboard": "Dashboard",

View File

@@ -39,6 +39,10 @@ $router->group(['middleware' => 'router.valid'], function($router) {
// Temporary Test Route
$router->get('/test-alert', [HomeController::class, 'testAlert']);
// Plugin Language Route - DEPRECATED
// Plugins now handle their own routing via Hooks::addAction('router_init')
// -----------------------------------------------------------------------------
// Protected Admin Routes (Requires Auth)