Subversion Repositories computer_asset_manager_v1

Rev

Rev 54 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
49 rodolico 1
/* moving sysinfo summary from a report to a callable */
2
insert into _system( group_name,key_name,theValue,added_date ) values ( 'device view', 'SysInfo', 'callable.php:sysinfoView', now() );
3
update report set screen_report = null where name = 'Sysinfo Reports';
4
/* this is a cleanup, and should be in the main function. It creates a view which shows only devices which are systems */
5
create or replace view view_device_systems as select * from device where device_type_id in (select device_type_id from device_type where show_as_system = 'Y');
6
/* add maintenance report */
7
insert into _system( group_name,key_name,theValue,added_date ) values ( 'device view', 'Maintenance', 'callable.php:maintenanceView', now() );
8
 
50 rodolico 9
delete from report where name = 'New Report';
10
insert into report ( name, query, parameters ) values ('Backup History','select
11
   backups_run.start_time Started,
12
   backups_run.end_time Ended,
13
   backups_run.version Version,
14
   format(backups_run.files_count,0) Files,
15
   format(backups_run.files_size/1024/1024,0) \'Size (M)\',
16
   format(backups_run.transferred_count,0) Transfer,
17
   format(backups_run.skipped,0) Skipped,
18
   format(backups_run.files_deleted,0) Deleted,
19
   format(backups_run.data_sent/1024/1024,2) \'MB Out\',
20
   format(backups_run.data_received/1024/1024,2) \'MB In\',
21
   backups_run.disk_used Disk
22
from
23
   backups_run join backups using (backups_id)
24
where
25
   backups.device_id = <device_id>
26
order by
27
   backups_run.report_date desc
28
limit <count>','device_id++Device ID++++
29
count++Number of Reports++++');
30
 
31
insert into _system( group_name,key_name,theValue,added_date ) values ( 'device view', 'Backup', 'callable.php:backupView', now() );
54 rodolico 32
 
55 rodolico 33
create or replace view view_current_client_site as select concat( client.name, ' - ', ifnull(site.name,'None' )) name, client.client_id,site.site_id from client left outer join site using (client_id) where client.removed_date is null and site.removed_date is null;
34
create or replace view view_current_client_systems as 
35
   select 
36
      device.device_id,
37
      concat(device.name, ' (', view_current_client_site.name, ')') 'Device' 
38
   from 
39
      device join view_current_client_site using (site_id) 
40
      join device_type using (device_type_id) 
41
   where 
42
      device_type.show_as_system = 'Y' 
43
      and device.removed_date is null;
44
 
45
create or replace view view_current_client as select name, client_id from client where removed_date is null;
46