HI, have a look at this app and give me your opinion: https://6bzwt7sqvoixvnce.anvil.app/CVMBSNLA7EEWA33RXPRQJ4UC
please open this link instead: geology-elkef.anvil.app and tell me what do you think
thank you
Thanks for sharing @chikhaoui.mongi.
It would be helpful if you added a description/screenshots—and a fixed link. This might encourage others to see what you have built.
It’s very informative - fascinating topic!
It looks nice. Not all pages start at the top when navigating to them.
It’s really nice.
Here is one little improvement that could be done: I noticed that it takes a long time to load. My guess is that the delay is caused by the large size images that are all loaded at once when the app is first loaded.
If the images have been added as assets, then that may be the problem.
Adding images as assets is ok for a few images, but it is not scalable, and it can make the app unusable when the number of images increases.
A more scalable approach is to add the images to a database table or to Google Drive. This way the app starts very quickly and immediately shows up without images. Then it starts downloading only the images used by the current form.
Nice work!
Perhaps you want to implement hash routing so you can share specific pages of your app.
https://anvil-extras.readthedocs.io/en/latest/guides/modules/routing.html
Also right now some of your navigation elements on the left panel open up an extra tab (Geological site). And after closing the tab, we see new navigation elements. But we can’t get back to the original navigation elements unless we click on “Home”. So maybe you want to work with sub menus.
Here’s an example
Hi APDW
I want to work with submenus but I don’t know how it works.
can you send me the code of your example
Thanks a lot
Chikhaoui Mongi
chikhaoui.mongi@gmail.com
He already did. Try his clone link (“Open in Anvil”) above.
Hi Stefano
can you please send me the code to do this
Here is a snippet (I removed a few lines that shouldn’t help, I hope I didn’t break it) from an HTTP endpoint in a very old app that uploads an image to database:
@anvil.server.http_endpoint('/add_bitmap/:wizard_name/:bitmap_name')
def add_bitmap(wizard_name, bitmap_name):
extension = bitmap_name.split('.')[-1]
if extension in ['gif', 'bpm', 'jpg', 'png']:
mime = 'image/' + extension
else:
mime = 'application/octet-stream'
bb = anvil.server.request.body.get_bytes()
bb = base64.b64decode(bb)
app_tables.bitmaps.add_row(wizard_name=wizard_name,
image_name=bitmap_name,
bitmap=anvil.BlobMedia(mime, bb, name=bitmap_name))
return 'OK'
And here is how I use it:
# on the server side:
@anvil.server.callable
def get_wizard_definition(wizard_name):
return {image['image_name']: image['bitmap']
for image in app_tables.bitmaps.search(wizard_name=wizard_name)}
# on the client
self.images = anvil.server.call('get_wizard_definition', self.wizard_name)
image = Image(source=self.images[bitmap], display_mode='original_size')
flow_panel.add_component(image, width=anvil.image.get_dimensions(image.source)[1])