Compare commits
4 Commits
feature/fr
...
68a8865dc6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68a8865dc6 | ||
|
|
aaf20ac9f3 | ||
|
|
76a9d4c1b3 | ||
|
|
04ff1b012b |
@@ -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
BIN
.gitignore
vendored
Binary file not shown.
@@ -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/');
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user