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 {} \;
}
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() {
if ! command -v go >/dev/null 2>&1; then
echo "go command not found; cannot build backend binary."
@@ -146,6 +164,7 @@ run_deploy() {
echo "== ENSURE UI PERMISSIONS =="
ensure_ui_permissions
ensure_ui_readable_by_nginx
echo "== BUILD API =="
build_api_binary
@@ -156,8 +175,22 @@ run_deploy() {
echo "== ENSURE PDF FONTS =="
ensure_pdf_fonts
echo "== RESTART SERVICE =="
echo "== RESTART SERVICES =="
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')"
}

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 == "" {
port = "8080"
}
if !strings.HasPrefix(port, ":") {
port = ":" + port
}
log.Println("Server calisiyor: http://localhost" + port)
log.Fatal(http.ListenAndServe(port, handler))
addr := host + ":" + port
log.Println("🚀 Server running at:", addr)
log.Fatal(http.ListenAndServe(addr, handler))
}
func mountSPA(r *mux.Router) {

View File

@@ -36,7 +36,6 @@ func ensureLegacyUserReadyForSession(db *sql.DB, legacyUser *models.User) (int64
_, err := db.Exec(`
INSERT INTO mk_dfusr (
id,
code,
username,
email,
full_name,
@@ -46,15 +45,13 @@ func ensureLegacyUserReadyForSession(db *sql.DB, legacyUser *models.User) (int64
password_hash,
force_password_change,
created_at,
updated_at,
last_updated_date
updated_at
)
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)
DO UPDATE SET
code = EXCLUDED.code,
username = EXCLUDED.username,
email = EXCLUDED.email,
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),
is_active = EXCLUDED.is_active,
force_password_change = true,
updated_at = NOW(),
last_updated_date = NOW()
updated_at = NOW()
`,
desiredID,
strings.TrimSpace(legacyUser.Username),
strings.TrimSpace(legacyUser.Username),
strings.TrimSpace(legacyUser.Email),
strings.TrimSpace(legacyUser.FullName),
strings.TrimSpace(legacyUser.Mobile),
@@ -89,8 +84,7 @@ func ensureLegacyUserReadyForSession(db *sql.DB, legacyUser *models.User) (int64
SET
is_active = $1,
force_password_change = true,
updated_at = NOW(),
last_updated_date = NOW()
updated_at = NOW()
WHERE id = $2
`, legacyUser.IsActive, existing.ID)
if updErr != nil {

View File

@@ -1,5 +1,5 @@
<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) -->
<div class="filter-sticky">
@@ -163,19 +163,21 @@
<!-- Ana Tablo -->
<q-table
class="sticky-table"
class="sticky-table statement-table"
title="Hareketler"
:rows="statementheaderStore.groupedRows"
:columns="columns"
:visible-columns="visibleColumns"
:row-key="row => row.OrderHeaderID + '_' + row.OrderNumber"
:row-key="rowKeyFn"
flat
bordered
dense
hide-bottom
wrap-cells
:rows-per-page-options="[0]"
:loading="statementheaderStore.loading"
:table-style="{ tableLayout: 'auto', minWidth: '1600px' }"
:table-style="{ tableLayout: 'fixed', width: '100%' }"
>
<template #body="props">
@@ -542,3 +544,100 @@ async function CurrheadDownload() {
}
</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>