:- use_module(library(http/thread_httpd)). :- use_module(library(http/http_dispatch)). :- use_module(library(http/http_error)). :- use_module(library(http/html_write)). % we need this module from the HTTP client library for http_read_data :- use_module(library(http/http_client)). :- http_handler('/gitl', gitl_web_form, []). %:-include('../SSI/ssi.pl'). %:-include('../SSI/ssi.pl'). %:-include('gitl1_pl.pl'). %:- include('files/listprolog.pl'). % show changes to all repos on page, allow selecting checkboxes of repos to commit or all % have anchor, link to top % list of repos at top have notif icon, pass icon % refresh time :-dynamic num1/1. gitl_server(Port) :- http_server(http_dispatch, [port(Port)]). /* browse http://127.0.0.1:8000/ This demonstrates handling POST requests */ gitl_web_form(_Request) :- %retractall(html_api_maker_or_terminal(_)), %assertz(html_api_maker_or_terminal(html %terminal %)), retractall(num1(_)),assertz(num1(1)), repository_root_path(RRP),atom_string(RRP1,RRP), working_directory(A3,A3), working_directory(_,RRP1), format('Content-type: text/html~n~n', []), data(Header,Footer), format(Header,[]), writeln("
All
========~n', []), %%portray_clause %portray_clause(result), %%writeln1(Data), %format('
'). data(Header,Footer) :- Header='|
', Footer=' |
', []),
%portray_clause(Data),
%a(Data) :- %%term_to_atom(Term,Data),
%append(Data1,[submit=_],Data),
findall(_,(member(HHa=O,Data),atom_concat(HH,'xxA',HHa),atom_concat(HH,'xxB',HH1a),(O=on->(member(HH1a=Label,Data),
atomic_list_concat(B,"+",HH),%atomic_list_concat(B,"\\ ",HH1),
atomic_list_concat(B," ",HH1),atom_string(HH1,HH2),atom_string(Label,Label1),
(commit(HH2,Label1)->(foldr(string_concat,[HH1," (with label: \"",Label1,"\") was committed.
"],A),writeln(A));writeln([HH,not,committed]))))),_),
%Data=[%%debug='off',%%Debug1,
%query=Query1,functions=Functions1,submit=_],
%term_to_atom(Debug2,'off'),
%term_to_atom(Query2,Query1),
%term_to_atom(Functions2,Functions1),
%international_interpret([lang,"en"],Debug2,Query2,Functions2,Result),
%%format('
========~n', []), %%portray_clause %portray_clause(Result), %%writeln1(Data), format('
') %*/ .