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:
@ -173,3 +173,8 @@ When I select Record Movement in the Parts page, can't we prepopulate the moveme
|
|||||||
ANd shouldn't some of the fields be defaulted to our best guess based on what we know about the part?
|
ANd shouldn't some of the fields be defaulted to our best guess based on what we know about the part?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Add login with admin/user where user can not see wholesale or reports
|
||||||
|
Add p&l reporting
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta name="theme-color" content="#c8102e" />
|
<meta name="theme-color" content="#c8102e" />
|
||||||
<title>AvtoAmbor</title>
|
<title>Замена Масла ГП</title>
|
||||||
%sveltekit.head%
|
%sveltekit.head%
|
||||||
</head>
|
</head>
|
||||||
<body data-sveltekit-preload-data="hover">
|
<body data-sveltekit-preload-data="hover">
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
<header class="header">
|
<header class="header">
|
||||||
<a class="brand" href="/">
|
<a class="brand" href="/">
|
||||||
<span class="wordmark">
|
<span class="wordmark">
|
||||||
{#if lang === 'tg'}АвтоАмбор{:else}AvtoAmbor{/if}
|
{$t('app.name')}
|
||||||
</span>
|
</span>
|
||||||
<span class="tagline">{$t('app.tagline')}</span>
|
<span class="tagline">{$t('app.tagline')}</span>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"app": {
|
"app": {
|
||||||
"name": "AvtoAmbor",
|
"name": "Zamena Masla GP",
|
||||||
"tagline": "Auto parts inventory"
|
"tagline": "Auto parts inventory"
|
||||||
},
|
},
|
||||||
"nav": {
|
"nav": {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"app": {
|
"app": {
|
||||||
"name": "AvtoAmbor",
|
"name": "Замена Масла GP",
|
||||||
"tagline": "Захираи қисмҳои эҳтиётии мошин"
|
"tagline": "Захираи қисмҳои эҳтиётии мошин"
|
||||||
},
|
},
|
||||||
"nav": {
|
"nav": {
|
||||||
|
|||||||
@ -4,7 +4,9 @@
|
|||||||
// mtime has advanced since the previous backup (so an idle shop doesn't
|
// mtime has advanced since the previous backup (so an idle shop doesn't
|
||||||
// accumulate identical snapshots).
|
// accumulate identical snapshots).
|
||||||
// - Backups land in ./backups/ at the repo root, named
|
// - 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
|
// - 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
|
// last 7 days; for anything older, keep only the most recent backup of
|
||||||
// each calendar day.
|
// each calendar day.
|
||||||
@ -19,9 +21,11 @@ import { resolve, dirname, join } from 'node:path';
|
|||||||
|
|
||||||
const DATA_DIR = dirname(DB_FILE);
|
const DATA_DIR = dirname(DB_FILE);
|
||||||
export const BACKUP_DIR = resolve(DATA_DIR, '..', 'backups');
|
export const BACKUP_DIR = resolve(DATA_DIR, '..', 'backups');
|
||||||
const PREFIX = 'avtoambor-';
|
const PREFIX = 'zamena-masla-gp-';
|
||||||
const EXT = '.db';
|
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 RETAIN_DAYS = 7;
|
||||||
const DAY_MS = 24 * 60 * 60 * 1000;
|
const DAY_MS = 24 * 60 * 60 * 1000;
|
||||||
const TICK_MS = 5 * 60 * 1000;
|
const TICK_MS = 5 * 60 * 1000;
|
||||||
@ -58,7 +62,7 @@ export function safeName(name) {
|
|||||||
export function listBackups() {
|
export function listBackups() {
|
||||||
ensureDir();
|
ensureDir();
|
||||||
return readdirSync(BACKUP_DIR)
|
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) => {
|
.map((name) => {
|
||||||
const p = join(BACKUP_DIR, name);
|
const p = join(BACKUP_DIR, name);
|
||||||
const st = statSync(p);
|
const st = statSync(p);
|
||||||
|
|||||||
Reference in New Issue
Block a user