Skip to content

Commit

Permalink
disable file imports when running on external server (#3239) (#3241)
Browse files Browse the repository at this point in the history
* disable file imports when running on external server
  • Loading branch information
kecnry authored Oct 22, 2024
1 parent 9218bcd commit 696d152
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Cubeviz
Imviz
^^^^^

- Remove "From File.." option when running on an external server. [#3239]

Mosviz
^^^^^^

Expand Down
6 changes: 4 additions & 2 deletions jdaviz/configs/imviz/plugins/catalogs/catalogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ class Catalogs(PluginTemplateMixin, ViewerSelectMixin, HasFileImportSelect):

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

cat_options = ['SDSS']
if not self.app.state.settings.get('server_is_remote', False):
cat_options.append('From File...')
self.catalog = FileImportSelectPluginComponent(self,
items='catalog_items',
selected='catalog_selected',
manual_options=['SDSS', 'From File...'])
manual_options=cat_options)

# set the custom file parser for importing catalogs
self.catalog._file_parser = self._file_parser
Expand Down
3 changes: 2 additions & 1 deletion jdaviz/configs/imviz/plugins/footprints/footprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ def __init__(self, *args, **kwargs):
preset_options = list(preset_regions._instruments.keys())
else:
preset_options = ['None']
preset_options.append('From File...')
if not self.app.state.settings.get('server_is_remote', False):
preset_options.append('From File...')
self.preset = FileImportSelectPluginComponent(self,
items='preset_items',
selected='preset_selected',
Expand Down

0 comments on commit 696d152

Please sign in to comment.