www-thermferm/js/maintenance_panel.js

Thu, 24 Jul 2014 20:45:15 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Thu, 24 Jul 2014 20:45:15 +0200
changeset 131
528dc0bb81ab
parent 130
25158b08843f
child 132
8bd209d1c020
permissions
-rw-r--r--

Always use uuid to select units and remove numeric record id's.

127
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /*****************************************************************************
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 * Copyright (C) 2014
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 *
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 * Michiel Broek <mbroek at mbse dot eu>
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 *
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 * This file is part of ThermFerm
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 *
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 * This is free software; you can redistribute it and/or modify it
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 * under the terms of the GNU General Public License as published by the
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 * Free Software Foundation; either version 2, or (at your option) any
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 * later version.
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 *
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 * ThermFerm is distributed in the hope that it will be useful, but
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 * General Public License for more details.
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 *
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 * along with ThermFerm; see the file COPYING. If not, write to the Free
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21 *****************************************************************************/
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23 $(document).ready(function () {
130
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
24 /*
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
25 * 1-Wire bus
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
26 */
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
27 var source_bus = {
127
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
28 datatype: "json",
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
29 datafields: [
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
30 { name: 'Address', type: 'string' },
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
31 { name: 'Refcnt', type: 'int' },
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
32 { name: 'Chip', type: 'string' },
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
33 { name: 'Description', type: 'string' }
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
34 ],
129
2817c65fba89 Removed sorting of 1-Wire devices because the busy indicator doesn't dissapear
Michiel Broek <mbroek@mbse.eu>
parents: 127
diff changeset
35 url: 'getbus.php'
127
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
36 };
129
2817c65fba89 Removed sorting of 1-Wire devices because the busy indicator doesn't dissapear
Michiel Broek <mbroek@mbse.eu>
parents: 127
diff changeset
37 var dataAdapter_bus = new $.jqx.dataAdapter(source_bus);
127
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
38 $("#jqxgrid_bus").jqxGrid( {
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
39 width: 770, height: 280,
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
40 source: dataAdapter_bus,
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
41 theme: 'ui-redmond',
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
42 columnsresize: true,
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
43 columns: [
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
44 { text: 'Address', datafield: 'Address', width: 150 },
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
45 { text: 'References', datafield: 'Refcnt', width: 100 },
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
46 { text: 'Chipset', datafield: 'Chip', width: 120 },
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
47 { text: 'Description', datafield: 'Description', minwidth: 120 }
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
48 ]
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
49 });
130
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
50
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
51 /*
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
52 * Profiles
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
53 */
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
54 var source_profiles = {
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
55 datatype: "json",
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
56 datafields: [
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
57 { name: 'UUID', type: 'string' },
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
58 { name: 'Name', type: 'string' },
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
59 { name: 'Steps', type: 'int' }
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
60 ],
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
61 url: 'getprofiles.php'
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
62 };
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
63 var dataAdapter_profiles = new $.jqx.dataAdapter(source_profiles);
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
64 $("#jqxgrid_profiles").jqxGrid( {
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
65 width: 770, height: 280,
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
66 source: dataAdapter_profiles,
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
67 theme: 'ui-redmond',
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
68 columnsresize: true,
131
528dc0bb81ab Always use uuid to select units and remove numeric record id's.
Michiel Broek <mbroek@mbse.eu>
parents: 130
diff changeset
69 editable: true,
130
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
70 columns: [
131
528dc0bb81ab Always use uuid to select units and remove numeric record id's.
Michiel Broek <mbroek@mbse.eu>
parents: 130
diff changeset
71 { text: 'UUID', editable: false, datafield: 'UUID', width: 280 },
130
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
72 { text: 'Name', datafield: 'Name', minwidth: 120 },
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
73 { text: 'Steps', datafield: 'Steps', width: 50 }
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
74 ]
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
75 });
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
76
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
77 /*
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
78 * Units
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
79 */
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
80 var source_units = {
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
81 datatype: "json",
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
82 datafields: [
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
83 { name: 'UUID', type: 'string' },
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
84 { name: 'Name', type: 'string' },
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
85 { name: 'Mode', type: 'string' }
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
86 ],
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
87 url: 'getunits.php'
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
88 };
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
89 var dataAdapter_units = new $.jqx.dataAdapter(source_units);
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
90 $("#jqxgrid_units").jqxGrid( {
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
91 width: 770, height: 280,
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
92 source: dataAdapter_units,
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
93 theme: 'ui-redmond',
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
94 columnsresize: true,
131
528dc0bb81ab Always use uuid to select units and remove numeric record id's.
Michiel Broek <mbroek@mbse.eu>
parents: 130
diff changeset
95 editable: true,
130
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
96 columns: [
131
528dc0bb81ab Always use uuid to select units and remove numeric record id's.
Michiel Broek <mbroek@mbse.eu>
parents: 130
diff changeset
97 { text: 'UUID', editable: false, datafield: 'UUID', width: 280 },
130
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
98 { text: 'Name', datafield: 'Name', minwidth: 120 },
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
99 { text: 'Mode', datafield: 'Mode', width: 70 }
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
100 ]
25158b08843f Added maintenance tabs for units and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 129
diff changeset
101 });
127
f2f45c44942f Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
102 });

mercurial