Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
d265b602
Commit
d265b602
authored
23 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Initial JavaScript for dynamic HTML indexes for FTP server (in progress).
parent
093e7832
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/ftp-html.js
+79
-0
79 additions, 0 deletions
exec/ftp-html.js
with
79 additions
and
0 deletions
exec/ftp-html.js
0 → 100644
+
79
−
0
View file @
d265b602
// JavaScript HTML Index for Synchronet FTP Server
// $id$
var
title
=
system
.
name
+
"
FTP Server:
"
+
curdir
;
write
(
"
<HTML>
\r\n
"
);
write
(
"
<HEAD>
\r\n
"
);
write
(
"
<STYLE>
\r\n
"
);
write
(
"
<!--
\r\n
"
);
// write("* {font-family: Arial,Helvetica,sans-serif}\r\n");
// write("a {color: green}\r\n");
write
(
"
-->
\r\n
"
);
write
(
"
</STYLE>
\r\n
"
);
// Title
write
(
"
<TITLE>
"
);
write
(
title
);
write
(
"
</TITLE>
\r\n
"
);
write
(
"
<META NAME='GENERATOR' content='
"
+
system
.
version
+
"
'>
\r\n
"
);
write
(
"
</HEAD>
\r\n
"
);
write
(
"
<BODY bgcolor=gray text=white link=white vlink=silver alink=yellow>
\r\n
"
);
write
(
"
<FONT FACE=Arial,Helvetica,sans-serif>
\r\n
"
);
write
(
"
<H1><I><FONT COLOR=lime>
"
+
title
+
"
</FONT></I></H1>
\r\n
"
);
if
(
libname
!=
""
)
write
(
"
<H3>Library:
"
+
libdesc
+
"
</H3>
\r\n
"
);
if
(
dirname
!=
""
)
write
(
"
<H3>Directory:
"
+
dirdesc
+
"
</H3>
\r\n
"
);
if
(
file
.
length
)
{
var
total_bytes
=
0
;
write
(
"
<TABLE BORDER='1' WIDTH='100%'>
\r\n
"
);
write
(
""
);
write
(
"
<TH ALIGN=LEFT><font size=-1>File
"
);
write
(
"
<TH ALIGN=RIGHT><font size=-1>Size
"
);
write
(
"
<TH><font size=-1>Description
"
);
write
(
"
<TH><font size=-1>Date/Time
"
);
write
(
"
<TH ALIGN=LEFT><font size=-1>Uploader
"
);
write
(
"
<TH ALIGN=RIGHT><font size=-1>Count
"
);
write
(
"
\r\n
"
);
var
mon
=
[
"
Jan
"
,
"
Feb
"
,
"
Mar
"
,
"
Apr
"
,
"
May
"
,
"
Jun
"
,
"
Jul
"
,
"
Aug
"
,
"
Sep
"
,
"
Oct
"
,
"
Nov
"
,
"
Dec
"
];
for
(
i
in
file
)
{
total_bytes
+=
file
[
i
].
size
;
var
d
=
new
Date
(
file
[
i
].
time
*
1000
);
write
(
"
<TR bgcolor=gray>
\r\n
"
);
write
(
"
<TD><A HREF=
"
+
file
[
i
].
link
+
"
>
"
+
file
[
i
].
name
+
"
</A>
"
);
write
(
"
<TD align=right> <font color=black>
"
+
file
[
i
].
size
);
write
(
"
<TD>
"
+
file
[
i
].
description
);
write
(
"
<TD> <font color=black> <TT>
"
+
format
(
"
%02d-%s-%d %02d:%02d
"
,
d
.
getDate
()
,
mon
[
d
.
getMonth
()]
,
d
.
getFullYear
()
,
d
.
getHours
()
,
d
.
getMinutes
()
)
+
"
</tt>
"
);
var
uploader
=
file
[
i
].
uploader
;
if
(
uploader
==
"
-> ADDFILES <-
"
)
uploader
=
"
Sysop
"
;
write
(
"
<TD>
"
+
uploader
);
write
(
"
<TD align=right> <font color=black>
"
+
file
[
i
].
times_downloaded
);
write
(
"
\r\n
"
);
}
write
(
"
</TABLE>
\r\n
"
);
write
(
format
(
"
%lu bytes in %lu files
"
,
total_bytes
,
file
.
length
));
write
(
"
<BR>
\r\n
"
);
}
if
(
dir
.
length
)
write
(
dir
.
length
+
"
sub-directories:<br>
\r\n
"
);
for
(
i
in
dir
)
{
write
(
"
<A HREF=
"
+
dir
[
i
].
link
+
"
>
"
+
dir
[
i
].
name
+
"
</A>
"
);
write
(
"
"
+
dir
[
i
].
description
+
"
<BR>
\r\n
"
);
}
write
(
"
<BR><font size='-2'>Dynamically generated by
"
);
write
(
"
<A HREF=http://www.synchro.net>
"
+
system
.
version
+
"
</A>
"
);
write
(
"
on
"
+
Date
()
+
"
</font>
\r\n
"
);
write
(
"
</BODY>
\r\n
"
);
write
(
"
</HTML>
\r\n
"
);
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment