]> git.nbdom.net Git - nb.git/commitdiff
lib/php/db.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 30 Aug 2024 15:34:30 +0000 (17:34 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 30 Aug 2024 15:34:30 +0000 (17:34 +0200)
lib/php/db.php

index 7eba7704f93d1f3cd97c3dbe1e025a12b0756b58..f9a99ebab8287ea291034542d1ebcd56c2f0c1ed 100644 (file)
@@ -1159,12 +1159,13 @@ class Db extends nb {
        public function status() {
                $status = $new = [];
 
+               $server = isset( $_SERVER['SERVER_ADDR'] ) ?  $_SERVER['SERVER_ADDR'] : 'localhost';
                $new = []
                +[
                        'id' => (empty($this->id) ? '' : $this->id),
                        'name' => $this->name,
                        'type' => $this->type,
-                       'host' => $this->host,
+                       'host' => ($this->type == 'sqlite' ? $server.':' : '').$this->host,
                        'tables' => count($this->tables()),
                ]
                +($this->conf_type('use_path') ? [] : [