4 Commits

Author SHA1 Message Date
Your Name
68a8865dc6 fix: bust browser cache for app.js to force reload of updated script
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 14:42:36 +03:00
Your Name
aaf20ac9f3 feat: redesign zametki page layout and date format
- Move "Add" button below textarea
- Move "Resolved" button below date (removed float-end)
- Show only HH:MM for note creation time via new formatTime helper

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 14:28:56 +03:00
Your Name
76a9d4c1b3 fix: auto-logout on 401 so stale tokens don't leave frontend in broken state
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 14:27:20 +03:00
Your Name
04ff1b012b chore local env files 2026-05-12 12:24:05 +03:00
4 changed files with 17 additions and 25 deletions

View File

@@ -1,17 +0,0 @@
{
"permissions": {
"allow": [
"Bash(backend\\\\venv\\\\Scripts\\\\python.exe -m uvicorn backend.main:app --reload)",
"Bash(python:*)",
"Bash(backend/venv/Scripts/python.exe:*)",
"Bash(backend/venv/Scripts/pip.exe list:*)",
"Bash(backend/venv/Scripts/pip.exe install:*)",
"Bash(backend/venv/Scripts/uvicorn.exe backend.main:app)",
"Bash(curl -s http://localhost:8000/ping)",
"Bash(curl -s http://127.0.0.1:8000/ping)",
"Bash(taskkill /F /IM python.exe)",
"Bash(netstat -ano)",
"Bash(taskkill:*)"
]
}
}

BIN
.gitignore vendored

Binary file not shown.

View File

@@ -150,9 +150,7 @@ createApp({
this.users = []; this.users = [];
this.status = ''; this.status = '';
this.error = ''; this.error = '';
this.view = 'byAud'; window.location.href = '/login';
// опционально: редирект на страницу логина
// window.location.href = '/login';
}, },
authHeaders() { authHeaders() {
const h = {}; const h = {};
@@ -162,6 +160,10 @@ createApp({
async fetchAuth(url, options = {}) { async fetchAuth(url, options = {}) {
const opt = { ...options, headers: { ...(options.headers||{}), ...this.authHeaders() } }; const opt = { ...options, headers: { ...(options.headers||{}), ...this.authHeaders() } };
const res = await fetch(url, opt); const res = await fetch(url, opt);
if (res.status === 401) {
this.logout();
return;
}
if (!res.ok) { if (!res.ok) {
const text = await res.text(); const text = await res.text();
throw new Error(`HTTP ${res.status}: ${text}`); throw new Error(`HTTP ${res.status}: ${text}`);
@@ -305,6 +307,11 @@ createApp({
const d = new Date(dateStr); const d = new Date(dateStr);
return d.toLocaleString('ru-RU'); return d.toLocaleString('ru-RU');
}, },
formatTime(dateStr) {
if (!dateStr) return '';
const d = new Date(dateStr);
return d.toLocaleTimeString('ru-RU', { hour: '2-digit', minute: '2-digit' });
},
async loadEquipmentTypes() { async loadEquipmentTypes() {
try { try {
this.equipmentTypes = await fetchJSON('/equipment-types/'); this.equipmentTypes = await fetchJSON('/equipment-types/');

View File

@@ -419,11 +419,11 @@
<div v-if="canEdit" class="mb-4"> <div v-if="canEdit" class="mb-4">
<h5>Добавить заметку</h5> <h5>Добавить заметку</h5>
<div class="row g-2 align-items-end"> <div class="row g-2">
<div class="col-md-8"> <div class="col-md-8">
<textarea class="form-control" v-model="newZametkaText" rows="3" placeholder="Текст заметки..."></textarea> <textarea class="form-control" v-model="newZametkaText" rows="3" placeholder="Текст заметки..."></textarea>
</div> </div>
<div class="col-auto"> <div class="col-md-8">
<button class="btn btn-success" @click="createZametka">Добавить</button> <button class="btn btn-success" @click="createZametka">Добавить</button>
</div> </div>
</div> </div>
@@ -436,8 +436,10 @@
<div v-for="z in zametki" :key="z.id" class="card mb-2"> <div v-for="z in zametki" :key="z.id" class="card mb-2">
<div class="card-body"> <div class="card-body">
<p class="card-text" style="white-space: pre-wrap;">{{ z.txtzam }}</p> <p class="card-text" style="white-space: pre-wrap;">{{ z.txtzam }}</p>
<small class="text-muted">{{ formatDate(z.created_date) }}</small> <div>
<button v-if="canEdit" class="btn btn-sm btn-outline-success float-end" @click="resolveZametka(z.id)">Решено</button> <small class="text-muted">{{ formatTime(z.created_date) }}</small>
</div>
<button v-if="canEdit" class="btn btn-sm btn-outline-success mt-1" @click="resolveZametka(z.id)">Решено</button>
</div> </div>
</div> </div>
</div> </div>
@@ -733,6 +735,6 @@
<script src="/app/vue.global.prod.js"></script> <script src="/app/vue.global.prod.js"></script>
<script src="/app/bootstrap.bundle.min.js"></script> <script src="/app/bootstrap.bundle.min.js"></script>
<script src="/app/app.js" defer></script> <script src="/app/app.js?v=2" defer></script>
</body> </body>
</html> </html>