mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Install custom symbols. Fixes #2492
This commit is contained in:
3 files changed
+20
-40
No files matched your search
@@ -74,6 +74,7 @@ class Controller:
|
||||
|
||||
log.info("Controller is starting")
|
||||
await self._install_base_configs()
|
||||
await self._install_custom_symbols()
|
||||
installed_disks = await self._install_builtin_disks()
|
||||
if installed_disks:
|
||||
await update_disk_checksums(installed_disks)
|
||||
@@ -371,6 +372,19 @@ class Controller:
|
||||
except OSError as e:
|
||||
log.error(f"Could not install disk files to {dst_path}: {e}")
|
||||
|
||||
async def _install_custom_symbols(self):
|
||||
"""
|
||||
At startup we copy custom symbols to the user location to allow
|
||||
them to use with appliances
|
||||
"""
|
||||
|
||||
dst_path = self.symbols.symbols_path()
|
||||
log.info(f"Installing custom symbols in '{dst_path}'")
|
||||
try:
|
||||
return await Controller.install_resource_files(dst_path, "custom_symbols", upgrade_resources=False)
|
||||
except OSError as e:
|
||||
log.error(f"Could not install custom symbols to {dst_path}: {e}")
|
||||
|
||||
def images_path(self):
|
||||
"""
|
||||
Get the image storage directory
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
Symbols
|
||||
*******
|
||||
|
||||
This directory contains symbols that you can use in GNS3.
|
||||
|
||||
Rules
|
||||
=====
|
||||
|
||||
* All symbols must be a SVG file
|
||||
* A file named symbol.txt should exist and contains the symbol licence
|
||||
* Try to keep the file size small
|
||||
* The recommended maximum width and height is 70px, please see how to resize a SVG below
|
||||
|
||||
|
||||
Resize a SVG
|
||||
============
|
||||
|
||||
It is possible to resize a SVG file using a software like Inkscape or any
|
||||
other editor that works for SVG images.
|
||||
|
||||
Alternatively, you could use ImageMagick (with rsvg support) on Mac OS and Linux
|
||||
|
||||
Example to install ImageMagick on Mac using Homebrew:
|
||||
|
||||
```
|
||||
brew install imagemagick --with-librsvg
|
||||
```
|
||||
|
||||
Example to install ImageMagick on Debian or Ubuntu:
|
||||
|
||||
```
|
||||
sudo apt-get install imagemagick
|
||||
```
|
||||
|
||||
Example to resize to a width and height of 70px:
|
||||
|
||||
```
|
||||
convert -background none symbols/firefox.svg -resize x70 firefox.svg
|
||||
```
|
||||
Reference in new issue
Block a user