Manual images

main
Bob Mottram 2022-10-11 19:21:30 +01:00
parent c3926ebe0e
commit 22c3530218
3 changed files with 60 additions and 0 deletions

View File

@ -8313,6 +8313,56 @@ class PubServer(BaseHTTPRequestHandler):
return
self._404()
def _show_manual_image(self, path: str,
base_dir: str, getreq_start_time) -> None:
"""Shows an image within the manual
"""
image_filename = path.split('/', 1)[1]
if '/' in image_filename:
self._404()
return
media_filename = \
base_dir + '/manual/' + image_filename
if self._etag_exists(media_filename):
# The file has not changed
self._304()
return
if self.server.iconsCache.get(media_filename):
media_binary = self.server.iconsCache[media_filename]
mime_type_str = media_file_mime_type(media_filename)
self._set_headers_etag(media_filename,
mime_type_str,
media_binary, None,
self.server.domain_full,
False, None)
self._write(media_binary)
fitness_performance(getreq_start_time, self.server.fitness,
'_GET', '_show_manual_image',
self.server.debug)
return
if os.path.isfile(media_filename):
media_binary = None
try:
with open(media_filename, 'rb') as av_file:
media_binary = av_file.read()
except OSError:
print('EX: unable to read manual image ' +
media_filename)
if media_binary:
mime_type = media_file_mime_type(media_filename)
self._set_headers_etag(media_filename,
mime_type,
media_binary, None,
self.server.domain_full,
False, None)
self._write(media_binary)
self.server.iconsCache[media_filename] = media_binary
fitness_performance(getreq_start_time, self.server.fitness,
'_GET', '_show_manual_image',
self.server.debug)
return
self._404()
def _show_help_screen_image(self, path: str,
base_dir: str, getreq_start_time) -> None:
"""Shows a help screen image
@ -16905,6 +16955,14 @@ class PubServer(BaseHTTPRequestHandler):
getreq_start_time)
return
# show images within https://instancedomain/manual
if self.path.startswith('/manual-'):
if self.path.endswith('.png'):
self._show_manual_image(self.path,
self.server.base_dir,
getreq_start_time)
return
# help screen images
# Note that this comes before the busy flag to avoid conflicts
if self.path.startswith('/helpimages/'):

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -289,6 +289,8 @@ Once you are following someone then selecting their profile picture and then the
## Maps
# The Timeline
## Layout
![Layout](manual-layout.png)
On a desktop system the main timeline screen has a multi-column layout. The main content containing posts is in the centre. To the left is a column containing useful web links. To the right is the newswire containing links from RSS feeds.
At the top right of the centre column there are a few icons, for show/hide, calendar, search and creating a new post.