dashboard tweaks

pull/14/head
Tom Early 6 years ago
parent 8c56bf8440
commit 018144ce54

@ -24,19 +24,26 @@ bool CQnetDB::Open(const char *name)
if (sqlite3_open(name, &db)) if (sqlite3_open(name, &db))
return true; return true;
std::string sql = "DROP TABLE IF EXISTS LHEARD; " std::string sql = "DROP TABLE IF EXISTS LHEARD;";
"CREATE TABLE LHEARD("
"mycall TEXT PRIMARY KEY, "
"sfx TEXT, "
"urcall TEXT, "
"module TEXT, "
"gateway TEXT, "
"lasttime INT NOT NULL"
") WITHOUT ROWID;";
char *eMsg; char *eMsg;
if (SQLITE_OK != sqlite3_exec(db, sql.c_str(), NULL, 0, &eMsg)) { if (SQLITE_OK != sqlite3_exec(db, sql.c_str(), NULL, 0, &eMsg)) {
fprintf(stderr, "CQnetDB::Open error: %s\n", eMsg); fprintf(stderr, "CQnetDB::Open drop table error: %s\n", eMsg);
sqlite3_free(eMsg);
return true;
}
sql = "CREATE TABLE LHEARD("
"mycall TEXT PRIMARY KEY, "
"sfx TEXT, "
"urcall TEXT, "
"module TEXT, "
"gateway TEXT, "
"lasttime INT NOT NULL"
") WITHOUT ROWID;";
if (SQLITE_OK != sqlite3_exec(db, sql.c_str(), NULL, 0, &eMsg)) {
fprintf(stderr, "CQnetDB::Open create table error: %s\n", eMsg);
sqlite3_free(eMsg); sqlite3_free(eMsg);
return true; return true;
} }

@ -1128,7 +1128,6 @@ void CQnetGateway::ProcessG2(const ssize_t g2buflen, const SDSVT &g2buf, const i
std::string gateway((const char *)g2buf.hdr.rpt2, 8); std::string gateway((const char *)g2buf.hdr.rpt2, 8);
rtrim(mycall); rtrim(mycall);
rtrim(sfx); rtrim(sfx);
rtrim(urcall);
qnDB.Update(mycall.c_str(), sfx.c_str(), urcall.c_str(), module.c_str(), gateway.c_str()); qnDB.Update(mycall.c_str(), sfx.c_str(), urcall.c_str(), module.c_str(), gateway.c_str());
} }

@ -140,7 +140,7 @@ if ('true' == GetCFGValue('dash_show_ps') && `ps -aux | grep -e qn -e MMDVMHost
foreach ($lines as $line) { foreach ($lines as $line) {
echo str_replace(' ', '&nbsp;', $line), "<br>\n"; echo str_replace(' ', '&nbsp;', $line), "<br>\n";
} }
echo '</code><br>', "\n"; echo '</code>', "\n";
} }
if ('true' == GetCFGValue('dash_show_lh')) { if ('true' == GetCFGValue('dash_show_lh')) {

Loading…
Cancel
Save

Powered by TurnKey Linux.