You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ordie('Could not connect: ' . mysqli_error($link));
62
58
63
59
// ******************************************
64
60
@@ -76,13 +72,6 @@ function js_escape($str)
76
72
{
77
73
$dataid = intval($_REQUEST['dataid']);
78
74
79
-
//$SQL_graphid = sprintf("SELECT graph_templates_item.local_graph_id, title_cache FROM graph_templates_item,graph_templates_graph,data_template_rrd where graph_templates_graph.local_graph_id = graph_templates_item.local_graph_id and task_item_id=data_template_rrd.id and local_data_id=%d LIMIT 1;",$dataid);
80
-
81
-
//mysql_selectdb($config['db_name'],$link) or die('Could not select database: '.mysql_error());
82
-
83
-
//$result = mysql_query($SQL_graphid) or die('Query failed: ' . mysql_error());
@@ -268,8 +257,6 @@ function applyDSFilterChange(objForm) {
268
257
<body>
269
258
<?php
270
259
271
-
//$SQL_picklist = "select data_local.host_id, data_template_data.local_data_id, data_template_data.name_cache, data_template_data.active, data_template_data.data_source_path from data_local,data_template_data,data_input,data_template where data_local.id=data_template_data.local_data_id and data_input.id=data_template_data.data_input_id and data_local.data_template_id=data_template.id ";
272
-
273
260
$host_id = $weathermap_config['show_interfaces'];
274
261
275
262
$overlib = true;
@@ -282,38 +269,32 @@ function applyDSFilterChange(objForm) {
282
269
if (isset ($_REQUEST['host_id']) and !empty ($_REQUEST['host_id']))
283
270
{
284
271
$host_id = intval ($_REQUEST['host_id']);
285
-
//if($host_id>=0) $SQL_picklist .= " and data_local.host_id=$host_id ";
286
272
}
287
273
288
274
/* If the editor gave us the links source node name, try to find the device_id
289
275
* so we can present the user with the interfaces of this particular device. */
290
276
if (isset ($_REQUEST['node1']) and !empty ($_REQUEST['node1']))
@@ -334,43 +315,35 @@ function applyDSFilterChange(objForm) {
334
315
*/
335
316
$result = Null;
336
317
if ($host_id != 0) {
337
-
$query = "SELECT devices.device_id,hostname,ports.port_id,ports.ifAlias,ports.ifIndex,ports.ifDescr,ports.deleted FROM devices LEFT JOIN ports ON devices.device_id=ports.device_id WHERE ports.disabled=0";
338
-
339
-
/* ...of specific host/device? */
340
-
if($host_id > 0) {
341
-
$query .= " AND devices.device_id='$host_id'";
342
-
}
343
-
344
-
/* ...in specific order? */
345
-
$query .= " ORDER BY hostname,ports." . $weathermap_config['sort_if_by'];
346
-
$result = mysqli_query($link,$query);
318
+
$devices = \App\Models\Device::when($host_id > 0, function ($query) use ($host_id) {
319
+
$query->where('device_id', $host_id);
320
+
})
321
+
->with(['ports' => function ($query) use ($weathermap_config) {
$configerror = "The map config directory is not writable by the web server user. You will not be able to edit any files until this is corrected. [WMEDIT01]";
0 commit comments