mirror of
https://onedev.site.tesses.net/tytd2025
synced 2026-02-09 01:55:46 +00:00
Add some api docs
This commit is contained in:
12
Tesses.YouTubeDownloader.Server/src/pages/api.tcross
Normal file
12
Tesses.YouTubeDownloader.Server/src/pages/api.tcross
Normal file
@@ -0,0 +1,12 @@
|
||||
func Pages.Api()
|
||||
{
|
||||
var html = <null>
|
||||
<h1>Developers</h1>
|
||||
<ul>
|
||||
<a class="underline" href="./api-v1">
|
||||
API v1
|
||||
</a>
|
||||
</ul>
|
||||
</null>;
|
||||
return Components.Shell("Api",html,4);
|
||||
}
|
||||
27
Tesses.YouTubeDownloader.Server/src/pages/api/api-v1.tcross
Normal file
27
Tesses.YouTubeDownloader.Server/src/pages/api/api-v1.tcross
Normal file
@@ -0,0 +1,27 @@
|
||||
func Pages.ApiV1()
|
||||
{
|
||||
var html = <null>
|
||||
<h1>Api V1</h1>
|
||||
|
||||
<each(var r : apiv1_routes)>
|
||||
<fieldset>
|
||||
|
||||
<legend>{r.method} {r.route}</legend>
|
||||
|
||||
<h6>Query Parameters</h6>
|
||||
<each(var qp : r.queryParams)>
|
||||
<div>{qp.name} ({qp.type}): {qp.description}</div>
|
||||
</each>
|
||||
|
||||
<h6>Description</h6>
|
||||
|
||||
<plink(r.description)>
|
||||
|
||||
|
||||
</fieldset>
|
||||
</each>
|
||||
</null>;
|
||||
return Components.Shell("Api V1",html,4);
|
||||
}
|
||||
|
||||
var apiv1_routes = Json.Decode(embed("apiv1_routes.json").ToString());
|
||||
@@ -20,6 +20,9 @@ func Pages.List(tytd,ctx)
|
||||
<h1>{name}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<raw(Components.PersonalListDescription(tytd,name,false))>
|
||||
|
||||
|
||||
<each(var item : res)>
|
||||
<raw(Components.DownloadedVideo(item))>
|
||||
</each>
|
||||
|
||||
@@ -19,7 +19,7 @@ func Pages.PlaylistInfo(tytd,ctx)
|
||||
<h1>{res.title}</h1>
|
||||
</div>
|
||||
<div class="max">
|
||||
<a href={$"./channel?id={Net.Http.UrlEncode(res.channelId)}"}>{res.channelTitle}</a>
|
||||
<a class="underline" href={$"./channel?id={Net.Http.UrlEncode(res.channelId)}"}>{res.channelTitle}</a>
|
||||
</div>
|
||||
</div>
|
||||
<each(var item : res.items)>
|
||||
|
||||
@@ -60,6 +60,8 @@ func Pages.Settings(tytd,ctx)
|
||||
<footer>
|
||||
<button>Save</button>
|
||||
</footer>
|
||||
|
||||
<a class="button responsive" href="./api/v1/database.db"><i>download</i> Download Database</a>
|
||||
</form>;
|
||||
|
||||
return Components.Shell("Settings",html ,3);
|
||||
|
||||
@@ -19,7 +19,7 @@ func Pages.VideoInfo(tytd,ctx)
|
||||
</div>
|
||||
<div class="min">
|
||||
<h4>{vi.title}</h4>
|
||||
<a href={$"./channel?id={Net.Http.UrlEncode(vi.channelId)}"}>{vi.author}</a>
|
||||
<a class="underline" href={$"./channel?id={Net.Http.UrlEncode(vi.channelId)}"}>{vi.author}</a>
|
||||
<p>{vi.shortDescription}</p>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user