Rename brand to Zamena Masla GP and prefix new backups accordingly
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#c8102e" />
|
||||
<title>AvtoAmbor</title>
|
||||
<title>Замена Масла ГП</title>
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover">
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<header class="header">
|
||||
<a class="brand" href="/">
|
||||
<span class="wordmark">
|
||||
{#if lang === 'tg'}АвтоАмбор{:else}AvtoAmbor{/if}
|
||||
{$t('app.name')}
|
||||
</span>
|
||||
<span class="tagline">{$t('app.tagline')}</span>
|
||||
</a>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"app": {
|
||||
"name": "AvtoAmbor",
|
||||
"name": "Zamena Masla GP",
|
||||
"tagline": "Auto parts inventory"
|
||||
},
|
||||
"nav": {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"app": {
|
||||
"name": "AvtoAmbor",
|
||||
"name": "Замена Масла GP",
|
||||
"tagline": "Захираи қисмҳои эҳтиётии мошин"
|
||||
},
|
||||
"nav": {
|
||||
|
||||
@ -4,7 +4,9 @@
|
||||
// mtime has advanced since the previous backup (so an idle shop doesn't
|
||||
// accumulate identical snapshots).
|
||||
// - Backups land in ./backups/ at the repo root, named
|
||||
// avtoambor-YYYY-MM-DD_HH-MM-SS.db (sortable, human-readable).
|
||||
// zamena-masla-gp-YYYY-MM-DD_HH-MM-SS.db (sortable, human-readable).
|
||||
// Legacy avtoambor-*.db backups are still recognized for listing and
|
||||
// restore so existing snapshots remain accessible until they age out.
|
||||
// - After each new backup, prune older snapshots: keep ALL backups from the
|
||||
// last 7 days; for anything older, keep only the most recent backup of
|
||||
// each calendar day.
|
||||
@ -19,9 +21,11 @@ import { resolve, dirname, join } from 'node:path';
|
||||
|
||||
const DATA_DIR = dirname(DB_FILE);
|
||||
export const BACKUP_DIR = resolve(DATA_DIR, '..', 'backups');
|
||||
const PREFIX = 'avtoambor-';
|
||||
const PREFIX = 'zamena-masla-gp-';
|
||||
const EXT = '.db';
|
||||
const FILE_RE = /^avtoambor-(\d{4})-(\d{2})-(\d{2})_(\d{2})-(\d{2})-(\d{2})\.db$/;
|
||||
// Read path accepts the new prefix and the legacy avtoambor- prefix so
|
||||
// pre-rename snapshots stay listable and restorable.
|
||||
const FILE_RE = /^(?:zamena-masla-gp-|avtoambor-)(\d{4})-(\d{2})-(\d{2})_(\d{2})-(\d{2})-(\d{2})\.db$/;
|
||||
const RETAIN_DAYS = 7;
|
||||
const DAY_MS = 24 * 60 * 60 * 1000;
|
||||
const TICK_MS = 5 * 60 * 1000;
|
||||
@ -58,7 +62,7 @@ export function safeName(name) {
|
||||
export function listBackups() {
|
||||
ensureDir();
|
||||
return readdirSync(BACKUP_DIR)
|
||||
.filter((n) => n.startsWith(PREFIX) && n.endsWith(EXT) && FILE_RE.test(n))
|
||||
.filter((n) => n.endsWith(EXT) && FILE_RE.test(n))
|
||||
.map((name) => {
|
||||
const p = join(BACKUP_DIR, name);
|
||||
const st = statSync(p);
|
||||
|
||||
Reference in New Issue
Block a user