Compare commits

..

2 Commits

Author SHA1 Message Date
M_Kececi
744e20591d Merge remote-tracking branch 'origin/master' 2026-02-18 16:40:55 +03:00
M_Kececi
1263531edd Merge remote-tracking branch 'origin/master' 2026-02-18 16:40:37 +03:00
4 changed files with 152 additions and 21 deletions

View File

@@ -89,6 +89,24 @@ ensure_ui_permissions() {
find "$ui_root" -type f -exec chmod 644 {} \; find "$ui_root" -type f -exec chmod 644 {} \;
} }
ensure_ui_readable_by_nginx() {
ui_index="$APP_DIR/ui/dist/spa/index.html"
if [[ ! -f "$ui_index" ]]; then
echo "ERROR: UI index not found at $ui_index"
return 1
fi
# Verify nginx user can read index.html and traverse parent directories.
if id -u www-data >/dev/null 2>&1; then
if ! su -s /bin/sh -c "test -r '$ui_index'" www-data; then
echo "ERROR: www-data cannot read $ui_index"
namei -l "$ui_index" || true
return 1
fi
fi
}
build_api_binary() { build_api_binary() {
if ! command -v go >/dev/null 2>&1; then if ! command -v go >/dev/null 2>&1; then
echo "go command not found; cannot build backend binary." echo "go command not found; cannot build backend binary."
@@ -146,6 +164,7 @@ run_deploy() {
echo "== ENSURE UI PERMISSIONS ==" echo "== ENSURE UI PERMISSIONS =="
ensure_ui_permissions ensure_ui_permissions
ensure_ui_readable_by_nginx
echo "== BUILD API ==" echo "== BUILD API =="
build_api_binary build_api_binary
@@ -156,8 +175,22 @@ run_deploy() {
echo "== ENSURE PDF FONTS ==" echo "== ENSURE PDF FONTS =="
ensure_pdf_fonts ensure_pdf_fonts
echo "== RESTART SERVICE ==" echo "== RESTART SERVICES =="
systemctl restart bssapp systemctl restart bssapp
if systemctl cat nginx >/dev/null 2>&1; then
systemctl restart nginx
if ! systemctl is-active --quiet nginx; then
echo "ERROR: nginx service failed to start"
return 1
fi
else
echo "WARN: nginx service not found; frontend may be unreachable."
fi
if ! systemctl is-active --quiet bssapp; then
echo "ERROR: bssapp service failed to start"
return 1
fi
echo "[DEPLOY FINISHED] $(date '+%F %T')" echo "[DEPLOY FINISHED] $(date '+%F %T')"
} }

View File

@@ -616,16 +616,21 @@ func main() {
), ),
) )
port := strings.TrimSpace(os.Getenv("HTTPPORT")) host := strings.TrimSpace(os.Getenv("API_HOST"))
port := strings.TrimSpace(os.Getenv("API_PORT"))
if host == "" {
host = "0.0.0.0"
}
if port == "" { if port == "" {
port = "8080" port = "8080"
} }
if !strings.HasPrefix(port, ":") {
port = ":" + port
}
log.Println("Server calisiyor: http://localhost" + port) addr := host + ":" + port
log.Fatal(http.ListenAndServe(port, handler))
log.Println("🚀 Server running at:", addr)
log.Fatal(http.ListenAndServe(addr, handler))
} }
func mountSPA(r *mux.Router) { func mountSPA(r *mux.Router) {

View File

@@ -36,7 +36,6 @@ func ensureLegacyUserReadyForSession(db *sql.DB, legacyUser *models.User) (int64
_, err := db.Exec(` _, err := db.Exec(`
INSERT INTO mk_dfusr ( INSERT INTO mk_dfusr (
id, id,
code,
username, username,
email, email,
full_name, full_name,
@@ -46,15 +45,13 @@ func ensureLegacyUserReadyForSession(db *sql.DB, legacyUser *models.User) (int64
password_hash, password_hash,
force_password_change, force_password_change,
created_at, created_at,
updated_at, updated_at
last_updated_date
) )
VALUES ( VALUES (
$1,$2,$3,$4,$5,$6,$7,$8,'',true,NOW(),NOW(),NOW() $1,$2,$3,$4,$5,$6,$7,'',true,NOW(),NOW()
) )
ON CONFLICT (id) ON CONFLICT (id)
DO UPDATE SET DO UPDATE SET
code = EXCLUDED.code,
username = EXCLUDED.username, username = EXCLUDED.username,
email = EXCLUDED.email, email = EXCLUDED.email,
full_name = COALESCE(NULLIF(EXCLUDED.full_name, ''), mk_dfusr.full_name), full_name = COALESCE(NULLIF(EXCLUDED.full_name, ''), mk_dfusr.full_name),
@@ -62,12 +59,10 @@ func ensureLegacyUserReadyForSession(db *sql.DB, legacyUser *models.User) (int64
address = COALESCE(NULLIF(EXCLUDED.address, ''), mk_dfusr.address), address = COALESCE(NULLIF(EXCLUDED.address, ''), mk_dfusr.address),
is_active = EXCLUDED.is_active, is_active = EXCLUDED.is_active,
force_password_change = true, force_password_change = true,
updated_at = NOW(), updated_at = NOW()
last_updated_date = NOW()
`, `,
desiredID, desiredID,
strings.TrimSpace(legacyUser.Username), strings.TrimSpace(legacyUser.Username),
strings.TrimSpace(legacyUser.Username),
strings.TrimSpace(legacyUser.Email), strings.TrimSpace(legacyUser.Email),
strings.TrimSpace(legacyUser.FullName), strings.TrimSpace(legacyUser.FullName),
strings.TrimSpace(legacyUser.Mobile), strings.TrimSpace(legacyUser.Mobile),
@@ -89,8 +84,7 @@ func ensureLegacyUserReadyForSession(db *sql.DB, legacyUser *models.User) (int64
SET SET
is_active = $1, is_active = $1,
force_password_change = true, force_password_change = true,
updated_at = NOW(), updated_at = NOW()
last_updated_date = NOW()
WHERE id = $2 WHERE id = $2
`, legacyUser.IsActive, existing.ID) `, legacyUser.IsActive, existing.ID)
if updErr != nil { if updErr != nil {

View File

@@ -1,5 +1,5 @@
<template> <template>
<q-page v-if="canReadFinance" class="q-pa-md page-col"> <q-page v-if="canReadFinance" class="q-pa-md page-col statement-page">
<!-- 🔹 Cari Kod / İsim (sabit) --> <!-- 🔹 Cari Kod / İsim (sabit) -->
<div class="filter-sticky"> <div class="filter-sticky">
@@ -163,19 +163,21 @@
<!-- Ana Tablo --> <!-- Ana Tablo -->
<q-table <q-table
class="sticky-table" class="sticky-table statement-table"
title="Hareketler" title="Hareketler"
:rows="statementheaderStore.groupedRows" :rows="statementheaderStore.groupedRows"
:columns="columns" :columns="columns"
:visible-columns="visibleColumns" :visible-columns="visibleColumns"
:row-key="row => row.OrderHeaderID + '_' + row.OrderNumber" :row-key="rowKeyFn"
flat flat
bordered bordered
dense dense
hide-bottom
wrap-cells
:rows-per-page-options="[0]" :rows-per-page-options="[0]"
:loading="statementheaderStore.loading" :loading="statementheaderStore.loading"
:table-style="{ tableLayout: 'auto', minWidth: '1600px' }" :table-style="{ tableLayout: 'fixed', width: '100%' }"
> >
<template #body="props"> <template #body="props">
@@ -542,3 +544,100 @@ async function CurrheadDownload() {
} }
</script> </script>
<style scoped>
.statement-page {
height: calc(100vh - 56px);
display: flex;
flex-direction: column;
overflow: hidden;
}
.table-scroll {
flex: 1;
min-height: 0;
overflow: hidden;
display: flex;
flex-direction: column;
}
.sticky-bar {
position: sticky;
top: 0;
z-index: 20;
flex: 0 0 auto;
}
.statement-table {
flex: 1;
min-height: 0;
}
.statement-table :deep(.q-table__container) {
height: 100%;
display: flex;
flex-direction: column;
}
.statement-table :deep(.q-table__top) {
flex: 0 0 auto;
}
.statement-table :deep(.q-table__middle) {
flex: 1 1 auto;
min-height: 0;
overflow: auto !important;
max-height: none !important;
}
.statement-table :deep(thead th) {
position: sticky;
top: 0;
z-index: 10;
background: #fff;
}
.statement-table :deep(th),
.statement-table :deep(td) {
padding: 3px 6px !important;
font-size: 11px !important;
line-height: 1.2 !important;
}
.statement-table :deep(td) {
white-space: nowrap !important;
overflow: hidden !important;
text-overflow: ellipsis !important;
max-width: 120px;
}
.statement-table :deep(td[data-col="aciklama"]),
.statement-table :deep(th[data-col="aciklama"]) {
max-width: 220px;
}
.statement-table :deep(.resizable-cell-content) {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
white-space: normal !important;
}
@media (max-width: 1366px) {
.statement-table :deep(th),
.statement-table :deep(td) {
font-size: 10px !important;
padding: 2px 4px !important;
}
.statement-table :deep(td) {
max-width: 100px;
}
.statement-table :deep(td[data-col="aciklama"]),
.statement-table :deep(th[data-col="aciklama"]) {
max-width: 180px;
}
}
</style>