Skip to content

Commit

Permalink
feat: frequency is now up to 366
Browse files Browse the repository at this point in the history
feat: change filename of backup file
fix: translate: "no category"
fix: trim fixer api key
fix: add webp support to gd on the container
fix: update slovanian translations
  • Loading branch information
ellite authored Jun 4, 2024
1 parent 76186d4 commit fa99a73
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ WORKDIR /var/www/html

# Update packages and install dependencies
RUN apk upgrade --no-cache && \
apk add --no-cache sqlite-dev libpng libpng-dev libjpeg-turbo libjpeg-turbo-dev freetype freetype-dev curl autoconf libgomp icu-dev nginx dcron tzdata imagemagick imagemagick-dev libzip-dev sqlite && \
apk add --no-cache sqlite-dev libpng libpng-dev libjpeg-turbo libjpeg-turbo-dev freetype freetype-dev curl autoconf libgomp icu-dev nginx dcron tzdata imagemagick imagemagick-dev libzip-dev sqlite libwebp-dev && \
docker-php-ext-install pdo pdo_sqlite && \
docker-php-ext-enable pdo pdo_sqlite && \
docker-php-ext-configure gd --with-freetype --with-jpeg && \
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp && \
docker-php-ext-install -j$(nproc) gd intl zip && \
apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
pecl install imagick && \
Expand Down
2 changes: 1 addition & 1 deletion endpoints/currency/fixer_api_key.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true) {
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$newApiKey = isset($_POST["api_key"]) ? $_POST["api_key"] : "";
$newApiKey = isset($_POST["api_key"]) ? trim($_POST["api_key"]) : "";
$provider = isset($_POST["provider"]) ? $_POST["provider"] : 0;

$removeOldKey = "DELETE FROM fixer WHERE user_id = :userId";
Expand Down
7 changes: 2 additions & 5 deletions includes/getdbkeys.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,8 @@
}

$frequencies = array();
$query = "SELECT * FROM frequencies";
$result = $db->query($query);
while ($row = $result->fetchArray(SQLITE3_ASSOC)) {
$frequencyId = $row['id'];
$frequencies[$frequencyId] = $row;
for ($i = 1; $i <= 366; $i++) {
$frequencies[$i] = array('id' => $i, 'name' => $i);
}

?>
2 changes: 1 addition & 1 deletion includes/version.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php
$version = "v2.1.0";
$version = "v2.2.0";
?>
15 changes: 9 additions & 6 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
<div class="filtermenu-submenu-content" id="filter-category">
<?php
foreach ($categories as $category) {
if ($category['name'] == "No category") {
$category['name'] = translate("no_category", $i18n);
}
$selectedClass = '';
if (isset($_GET['category']) && $_GET['category'] == $category['id']) {
$selectedClass = 'selected';
Expand Down Expand Up @@ -252,12 +255,12 @@
<div class="inline">
<select id="frequency" name="frequency" placeholder="<?= translate('frequency', $i18n) ?>">
<?php
foreach ($frequencies as $frequency) {
?>
<option value="<?= $frequency['id'] ?>"><?= $frequency['name'] ?></option>
<?php
}
?>
for ($i = 1; $i <= 366; $i++) {
?>
<option value="<?= $i ?>"><?= $i ?></option>
<?php
}
?>
</select>
<select id="cycle" name="cycle" placeholder="Cycle">
<?php
Expand Down
9 changes: 8 additions & 1 deletion scripts/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,14 @@ function backupDB() {
const link = document.createElement('a');
const filename = data.file;
link.href = '.tmp/' + filename;
link.download = 'backup.zip';
const date = new Date();
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const timestamp = `${year}${month}${day}-${hours}${minutes}`;
link.download = `Wallos-Backup-${timestamp}.zip`;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
Expand Down
5 changes: 4 additions & 1 deletion stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function getPriceConverted($price, $currency, $database, $userId) {
if (isset($_GET['category'])) {
$conditions[] = "category_id = :category";
$params[':category'] = $_GET['category'];
$statsSubtitleParts[] = $categories[$_GET['category']]['name'];
$statsSubtitleParts[] = $categories[$_GET['category']]['name'] == "No category" ? translate("no_category", $i18n) : $categories[$_GET['category']]['name'];
}

if (isset($_GET['payment'])) {
Expand Down Expand Up @@ -264,6 +264,9 @@ function getPriceConverted($price, $currency, $database, $userId) {
<div class="filtermenu-submenu-content" id="filter-category">
<?php
foreach ($categories as $category) {
if ($category['name'] == "No category") {
$category['name'] = translate("no_category", $i18n);
}
$selectedClass = '';
if (isset($_GET['category']) && $_GET['category'] == $category['id']) {
$selectedClass = 'selected';
Expand Down

0 comments on commit fa99a73

Please sign in to comment.