en el moras
This commit is contained in:
@@ -35,6 +35,7 @@ sub startup {
|
|||||||
$r->any('/json/candy/:command')->to('data#candy');
|
$r->any('/json/candy/:command')->to('data#candy');
|
||||||
|
|
||||||
$r->any('/admin/:section'=> {section =>'home'})->to('home#admin');
|
$r->any('/admin/:section'=> {section =>'home'})->to('home#admin');
|
||||||
|
$r->any('/admin/json/:dreq/:id/')->to('data#admin');
|
||||||
|
|
||||||
$r->any('/login')->to('users#login');
|
$r->any('/login')->to('users#login');
|
||||||
$r->any('/logout')->to('users#logout');
|
$r->any('/logout')->to('users#logout');
|
||||||
|
|||||||
@@ -15,6 +15,14 @@ sub simple{
|
|||||||
$c->render(json=>$json);
|
$c->render(json=>$json);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub admin{
|
||||||
|
my $c=shift;
|
||||||
|
my $n=$c->param("dreq")//"";
|
||||||
|
my $json = {status => "304"};
|
||||||
|
$json= ($c->dbv->rmsgid($c->param('id')))[0] if ($n =~m/^mensajes$/);
|
||||||
|
$c->render(json=>$json);
|
||||||
|
}
|
||||||
|
#==== candy =====================================================
|
||||||
sub candy{
|
sub candy{
|
||||||
my $c=shift;
|
my $c=shift;
|
||||||
my $r="-1";
|
my $r="-1";
|
||||||
@@ -57,6 +65,7 @@ sub candy{
|
|||||||
}
|
}
|
||||||
sub disconnectT{ $t->close();}
|
sub disconnectT{ $t->close();}
|
||||||
|
|
||||||
|
#=========================================================
|
||||||
1
|
1
|
||||||
__END__
|
__END__
|
||||||
|
|
||||||
|
|||||||
@@ -101,12 +101,35 @@ sub admin{
|
|||||||
if ($c->param("hup")=~/Cambiar/){
|
if ($c->param("hup")=~/Cambiar/){
|
||||||
$c->dbv->umod($c->param('link'),$c->param('update'));
|
$c->dbv->umod($c->param('link'),$c->param('update'));
|
||||||
};
|
};
|
||||||
my $v=(load_module("home/admin"))[0];
|
if ($c->param("section")=~/home/){
|
||||||
my ($x,$w)= load_module("home/admin/home");
|
my $v=(load_module("home/admin"))[0];
|
||||||
$c->stash( merge_hash($x,$v) );
|
my ($x,$w)= load_module("home/admin/home");
|
||||||
$c->stash(apend => ["home/admin/home"]);
|
$c->stash( merge_hash($x,$v) );
|
||||||
$c->stash( map{ $_->{nombre} => $_->{contenido}} @{$c->dbv->mod});
|
$c->stash(apend => ["home/admin/home"]);
|
||||||
|
$c->stash( map{ $_->{nombre} => $_->{contenido}} @{$c->dbv->mod});
|
||||||
|
}
|
||||||
|
elsif ( $c->param("section")=~/radio/ ){
|
||||||
|
$c->stash(
|
||||||
|
merge_hash( (load_module("home/admin"))[0],
|
||||||
|
merge_hash( (load_module("home/admin/candySwitch"))[0],
|
||||||
|
(load_module("home/admin/radio"))[0],
|
||||||
|
)));
|
||||||
|
$c->stash(apend => ["home/admin/radio","home/admin/candySwitch"]);
|
||||||
|
$c->stash(%{($c->dbv->radio)->[0]});
|
||||||
|
$c->stash($Dojo::Conf::radio);
|
||||||
|
}
|
||||||
|
elsif ( $c->param("section")=~/event/ ){
|
||||||
|
}
|
||||||
|
elsif ( $c->param("section")=~/mensajes/ ){
|
||||||
|
$c->stash(merge_hash(
|
||||||
|
(load_module("home/admin"))[0],
|
||||||
|
(load_module("home/admin/mensajes"))[0]
|
||||||
|
));
|
||||||
|
$c->stash(apend => ["home/admin/mensajes"]);
|
||||||
|
my $h = $c->dbv->rmsg;
|
||||||
|
$c->stash( h=>$h );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,11 +17,6 @@ sub mod{
|
|||||||
return \@{_read($q)};
|
return \@{_read($q)};
|
||||||
}
|
}
|
||||||
|
|
||||||
sub umod{
|
|
||||||
my $c=shift;
|
|
||||||
my $q="update casa set contenido = ? where nombre = 'mod' ;";
|
|
||||||
return _write($q,@_);
|
|
||||||
}
|
|
||||||
sub pang{
|
sub pang{
|
||||||
my ($c,$q)=@_;
|
my ($c,$q)=@_;
|
||||||
return {map { basename($_,".md") => load_md("public/$_")}@{$q->{md}}};
|
return {map { basename($_,".md") => load_md("public/$_")}@{$q->{md}}};
|
||||||
@@ -58,6 +53,39 @@ sub radio{
|
|||||||
return _read($q);
|
return _read($q);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub umod{
|
||||||
|
my $c=shift;
|
||||||
|
my $q="update casa set contenido = ? where nombre = ? ;";
|
||||||
|
return _write($q,@_);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub urmod{
|
||||||
|
my $c=shift;
|
||||||
|
my $q="update casa set contenido = ? where nombre = ? ;";
|
||||||
|
return _write($q,@_);
|
||||||
|
}
|
||||||
|
sub rmsg{
|
||||||
|
my @empty;
|
||||||
|
my $q= path("public/home/admin/mensajes/qEntries.q")->slurp;
|
||||||
|
my $dbh = DBI->connect("DBI:mysql:".Dojo::Conf::MSGDB.":".Dojo::Conf::MSGDB_H,Dojo::Conf::MSGDB_UR,Dojo::Conf::MSGDB_URP);
|
||||||
|
return \@empty unless($dbh);
|
||||||
|
my $h=$dbh->selectall_arrayref($q,{ Slice => {} },@bind);
|
||||||
|
#((col1=>d1,col2=>d1),(col1=>d2,col2=>d2))
|
||||||
|
$dbh->disconnect();
|
||||||
|
return $h;
|
||||||
|
}
|
||||||
|
sub rmsgid{
|
||||||
|
my ($c,@bind)=@_;
|
||||||
|
my @empty;
|
||||||
|
my $q= path("public/home/admin/mensajes/json/qGetInfo.q")->slurp;
|
||||||
|
my $dbh = DBI->connect("DBI:mysql:".Dojo::Conf::MSGDB.":".Dojo::Conf::MSGDB_H,Dojo::Conf::MSGDB_UR,Dojo::Conf::MSGDB_URP);
|
||||||
|
return \@empty unless($dbh);
|
||||||
|
my $h=$dbh->selectall_arrayref($q,{ Slice => {} },@bind);
|
||||||
|
#((col1=>d1,col2=>d1),(col1=>d2,col2=>d2))
|
||||||
|
$dbh->disconnect();
|
||||||
|
return $h;
|
||||||
|
}
|
||||||
|
|
||||||
sub _read{
|
sub _read{
|
||||||
my ($q,@bind)=@_;
|
my ($q,@bind)=@_;
|
||||||
my (@empty,$arr);
|
my (@empty,$arr);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
d3.select("#clink").on("click",function(){
|
d3.select("#clink").on("click",function(){
|
||||||
var newWindow = window.open(' #nav candy','_blank');
|
var newWindow = window.open('candy','_blank');
|
||||||
});
|
});
|
||||||
|
|
||||||
var ciface =" #exec candy_loader/candyInterface.pl&v=";
|
var ciface =" #exec candy_loader/candyInterface.pl&v=";
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
d3.select("select#sentry").on("change",function(){
|
d3.select("select#sentry").on("change",function(){
|
||||||
var msg_id=d3.select("select#sentry").node().value;
|
var msg_id=d3.select("select#sentry").node().value;
|
||||||
d3.json(" #data admin/mensajes/json/qGetInfo.q&imid="+msg_id ,function(d){
|
d3.json("/admin/json/mensajes/"+msg_id ,function(d){
|
||||||
if(d[0] !=undefined) {if(d[0] != 0){
|
if(d[0] !=undefined) {if(d[0] != 0){
|
||||||
d3.select("p#fecha").text(d[0].imdate);
|
d3.select("p#fecha").text(d[0].imdate);
|
||||||
d3.select("p#correo").text(d[0].imail);
|
d3.select("p#correo").text(d[0].imail);
|
||||||
|
|||||||
@@ -1,11 +1,3 @@
|
|||||||
|
|
||||||
/* c#host localhost*/
|
|
||||||
/* c#database #dbmsg */
|
|
||||||
/* c#user #dbmsg_user */
|
|
||||||
/* c#password #dbmsg_pass */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
select
|
select
|
||||||
e.id as imid,
|
e.id as imid,
|
||||||
concat(day(e.fecha)," de ",m.nombre," ", year(e.fecha)) as imdate,
|
concat(day(e.fecha)," de ",m.nombre," ", year(e.fecha)) as imdate,
|
||||||
@@ -15,5 +7,5 @@ select
|
|||||||
|
|
||||||
from entrada as e
|
from entrada as e
|
||||||
inner join vuelo.mes as m on m.id=month(e.fecha)
|
inner join vuelo.mes as m on m.id=month(e.fecha)
|
||||||
where e.id= " #imid ";
|
where e.id= ? ; #imid
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
|
|
||||||
/* c#host localhost*/
|
|
||||||
/* c#database #dbmsg */
|
|
||||||
/* c#user #dbmsg_user */
|
|
||||||
/* c#password #dbmsg_pass */
|
|
||||||
|
|
||||||
select
|
select
|
||||||
"mlist" as tag,
|
|
||||||
id as mid,
|
id as mid,
|
||||||
concat(nombre," ",date(fecha)) as "entry"
|
concat(nombre," ",date(fecha)) as "entry"
|
||||||
from entrada
|
from entrada
|
||||||
order by fecha;
|
order by fecha desc
|
||||||
|
limit 100;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
dataUpdate();
|
dataUpdate();
|
||||||
|
// let radio_server = xxx.info;
|
||||||
function dataUpdate(){
|
function dataUpdate(){
|
||||||
d3.json(" #radio_server /status-json.xsl",function(d){
|
d3.json(radio_server+"/status-json.xsl",function(d){
|
||||||
if (d.icestats.source != undefined){
|
if (d.icestats.source != undefined){
|
||||||
d3.select("#now").text(d.icestats.source.title);
|
d3.select("#now").text(d.icestats.source.title);
|
||||||
d3.select("#onAir").style("background-color","green");
|
d3.select("#onAir").style("background-color","green");
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
|
# update casa set contenido= q#link where nombre = q#update ;
|
||||||
/* c#host localhost*/
|
update casa set contenido= ? where nombre = ? ;
|
||||||
/* c#database #dbdata */
|
|
||||||
/* c#user #dbdata_w */
|
|
||||||
/* c#password #dbdata_wp */
|
|
||||||
/* c#write write*/
|
|
||||||
|
|
||||||
|
|
||||||
update casa set contenido= q#link where nombre = q#update ;
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
<section class="flex messages">
|
<section class="flex messages">
|
||||||
<article class="select">
|
<article class="select">
|
||||||
<select id="sentry" class="entry" size=10>
|
<select id="sentry" class="entry" size=10>
|
||||||
|
% foreach (@{stash('h')}){
|
||||||
<!-- ##mlist -->
|
<option value="<%= $_->{'mid'} %>" class=entry"> <%= $_->{'entry'} %></option>
|
||||||
|
% }
|
||||||
<!-- r##hide -->
|
|
||||||
<!-- c#mlist <option value=" #mid " class="entry"> #entry </option> -->
|
|
||||||
<!-- rr#hide -->
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</article>
|
</article>
|
||||||
<article class="view">
|
<article class="view">
|
||||||
@@ -13,12 +13,15 @@
|
|||||||
</article>
|
</article>
|
||||||
|
|
||||||
<article class="rmod">
|
<article class="rmod">
|
||||||
<form action=" #nav adminr" method="POST">
|
<form action="/admin/radio" method="POST">
|
||||||
<label>Aviso para el radio</label>
|
<label>Aviso para el radio</label>
|
||||||
<textarea name="link" id="tmod" class="rmod"> #rContent </textarea> <!-- a#dropvar -->
|
<textarea name="link" id="tmod" class="rmod"><%= $rmod %></textarea> <!-- a#dropvar -->
|
||||||
<input type="hidden" name="update" value="rmod"> <!-- a#dropvar -->
|
<input type="hidden" name="update" value="rmod"> <!-- a#dropvar -->
|
||||||
<input type="submit" name="hup" value="Cambiar"> <!-- a#dropvar -->
|
<input type="submit" name="hup" value="Cambiar"> <!-- a#dropvar -->
|
||||||
</form>
|
</form>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const radio_server="<%= $radio_server %>";
|
||||||
|
</script>
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
<section class="flex chat"><article>
|
<section class="flex chat"><article>
|
||||||
</section></article> </section>
|
</section></article> </section>
|
||||||
<script>
|
<script>
|
||||||
var radio_server="<%= $radio_server %>";
|
const radio_server="<%= $radio_server %>";
|
||||||
var listen_url="<%= $listen_url %>";
|
const listen_url="<%= $listen_url %>";
|
||||||
var channel="<%= $channel %>";
|
const channel="<%= $channel %>";
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user