mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-26 07:44:41 +02:00
implement add page
This commit is contained in:
@@ -17,6 +17,7 @@ from ..config import (
|
|||||||
PUBLIC_SNAPSHOTS,
|
PUBLIC_SNAPSHOTS,
|
||||||
)
|
)
|
||||||
from ..util import base_url
|
from ..util import base_url
|
||||||
|
from .. main import add
|
||||||
|
|
||||||
|
|
||||||
class MainIndex(View):
|
class MainIndex(View):
|
||||||
@@ -51,12 +52,13 @@ class AddLinks(View):
|
|||||||
|
|
||||||
return render(template_name=self.template, request=request, context=context)
|
return render(template_name=self.template, request=request, context=context)
|
||||||
|
|
||||||
|
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
import_path = request.POST['url']
|
print(f'[+] Adding URL: {import_path}')
|
||||||
|
add(
|
||||||
# TODO: add the links to the index here using archivebox.main.add
|
import_str=request.POST['url'],
|
||||||
print(f'Adding URL: {import_path}')
|
update_all=False,
|
||||||
|
out_dir=OUTPUT_DIR,
|
||||||
|
)
|
||||||
|
|
||||||
return render(template_name=self.template, request=request, context={})
|
return render(template_name=self.template, request=request, context={})
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user