:- ensure_loaded(common).
cvs_id('$Id: server_views.pl,v 1.2 2004/06/09 20:59:23 sandro Exp $').
/*

  Views of this server/database itself

  KIND OF OLD AND BROKEN RIGHT NOW.

  (should be tab/5, box, etc.)
  
*/


/*
html_view('Tree View', page, Focus, Q, HTree) :-
	outbound(Q, Focus, Triples),
	debug(view, 'PS: ~q, Focus: ~q, Triples: ~q', [Q, Focus, Triples]),
	HTree = div(class="semWalkerMainBody",
		    h3(\short(Q, Focus)),
		    Triples).
*/

/*
html_view('SemWalker Server', para, Focus, Q, HTree) :-
	rdf_equal(sw:'Agent', Agent),
	rdfq(Q, Focus, rdf:type, Agent),
	statistics(heapused, HeapUsed),	% @@@ CHEAT!
	Memory is float(round( HeapUsed / 104857.6 ) / 10),
	flag(basic_page_request, ReqCount, ReqCount), % @@@ CHEAT!
	self_uri(basic, Q, [focus=Focus], Link, ""),
	HTree = span(class='semWalkerStatus',
		     a(href= \any(Q, Focus, sw:adminUri), \any(Q, Focus, sw:adminName)),
		     ' Public Server ',
		     '(',
		     a(href= \any(Q, Focus, sw:policiesUri),
		       'Policies'),
		     ')  ',
		     \any(Q, Focus, sw:version),
		     br([]),
		     \any(Q, Focus, sw:triples),
		     ' triples, ',
		     float(Memory,1),
		     'MB heap, ',
		     { rdfq(Q, Focus, sw:rss, Rss) },
		     float(Rss, 0),
		     'MB resident, ',
		     { rdfq(Q, Focus, sw:loadavg, Load) },
		     float(Load, 2),
		     ' loadavg, ',
		     int(ReqCount),
		     ' pages served. ',
		     a(href=Link, 'more...')).



*/