Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DS_Store
node_modules
/dist
.nvmrc


# local env files
Expand Down
25,624 changes: 2,048 additions & 23,576 deletions client/package-lock.json

Large diffs are not rendered by default.

15 changes: 5 additions & 10 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "client",
"version": "0.8.1",
"version": "0.8.2",
"private": true,
"scripts": {
"build": "vite build",
Expand All @@ -20,7 +20,7 @@
"deep-object-diff": "1.1.9",
"jquery": "3.7.1",
"lodash": "4.17.21",
"loglevel": "1.9.1",
"loglevel": "1.9.2",
"vue": "2.7.14",
"vue-multiselect": "2.1.9",
"vue-native-websocket": "2.0.15",
Expand All @@ -31,8 +31,8 @@
"vuex-persistedstate": "3.2.1"
},
"devDependencies": {
"@babel/core": "7.24.9",
"@babel/eslint-parser": "7.24.8",
"@babel/core": "7.26.0",
"@babel/eslint-parser": "7.25.9",
"@babel/preset-env": "7.24.8",
"@vitejs/plugin-vue2": "2.3.1",
"eslint": "8.57.0",
Expand All @@ -44,12 +44,7 @@
"node-sass": "7.0.3",
"sass": "1.77.8",
"sass-loader": "13.3.3",
"vite": "4.5.3"
},
"overrides": {
"bootstrap-vue": {
"vue": "$vue"
}
"vite": "4.5.5"
},
"browserslist": [
"> 1%",
Expand Down
20 changes: 19 additions & 1 deletion client/src/vue_components/config/ConfigSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,28 @@
v-for="(setting, key) in RAW_SETTINGS"
:id="`${key}-input-group`"
:key="key"
:label="key"
:label-for="`${key}-input`"
:label-cols="true"
>
<template #label>
<p>
<template v-if="setting.display_name !== ''">
{{ setting.display_name }}
</template>
<template v-else>
{{ key }}
</template>
<template v-if="setting.help_text !== ''">
<b-icon-question-circle-fill :id="`${key}-help-icon`" />
<b-tooltip
:target="`${key}-help-icon`"
triggers="hover"
>
{{ setting.help_text }}
</b-tooltip>
</template>
</p>
</template>
<b-form-input
v-if="setting.type !== 'bool'"
:id="`${key}-input`"
Expand Down
49 changes: 32 additions & 17 deletions server/digi_server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@


class SettingsObject: # pylint: disable=too-many-instance-attributes
def __init__(self, key, val_type, default, can_edit=True, callback_fn=None, nullable=False):
def __init__(self, key, val_type, default, can_edit=True, callback_fn=None, nullable=False,
display_name: str = "", help_text: str = ""):
if val_type not in [str, bool, int]:
raise RuntimeError(f'Invalid type {val_type} for {key}. Allowed options are: '
f'[str, int, bool]')
Expand All @@ -27,6 +28,8 @@ def __init__(self, key, val_type, default, can_edit=True, callback_fn=None, null
self._callback_fn = callback_fn
self._nullable = nullable
self._loaded = False
self.display_name = display_name
self.help_text = help_text

def set_to_default(self):
self.value = self.default
Expand Down Expand Up @@ -61,7 +64,9 @@ def as_json(self):
'type': self.val_type.__name__,
'value': self.value,
'default': self.default,
'can_edit': self.can_edit
'can_edit': self.can_edit,
'display_name': self.display_name,
'help_text': self.help_text,
}


Expand Down Expand Up @@ -90,32 +95,42 @@ def __init__(self, application: DigiScriptServer, settings_path=None):

db_default = f'sqlite:///{os.path.join(os.path.dirname(__file__), "../conf/digiscript.sqlite")}'
self.define('has_admin_user', bool, False, False, nullable=False,
callback_fn=self._application.validate_has_admin)
self.define('db_path', str, db_default, False, nullable=False)
callback_fn=self._application.validate_has_admin, display_name="Has Admin User")
self.define('db_path', str, db_default, False, nullable=False, display_name="Database Path")
self.define('current_show', int, None, False, nullable=True,
callback_fn=self._application.show_changed)
self.define('debug_mode', bool, False, True)
callback_fn=self._application.show_changed, display_name="Current Show ID")
self.define('debug_mode', bool, False, True, display_name="Enable Debug Mode")
self.define('log_path', str, os.path.join(self._base_path, 'digiscript.log'), True,
self._application.regen_logging)
self.define('max_log_mb', int, 100, True, self._application.regen_logging)
self.define('log_backups', int, 5, True, self._application.regen_logging)
self.define('db_log_enabled', bool, False, True, self._application.regen_logging)
self._application.regen_logging, display_name="Application Log Path")
self.define('max_log_mb', int, 100, True, self._application.regen_logging, display_name="Max Log Size (MB)")
self.define('log_backups', int, 5, True, self._application.regen_logging, display_name="Log Backups")
self.define('db_log_enabled', bool, False, True, self._application.regen_logging,
display_name="Enable Database Log")
self.define('db_log_path', str, os.path.join(self._base_path, 'digiscript_db.log'), True,
self._application.regen_logging)
self.define('db_max_log_mb', int, 100, True, self._application.regen_logging)
self.define('db_log_backups', int, 5, True, self._application.regen_logging)
self.define('enable_lazy_loading', bool, True, True)
self.define('enable_live_batching', bool, True, True)
self._application.regen_logging, display_name="Database Log Path")
self.define('db_max_log_mb', int, 100, True, self._application.regen_logging,
display_name="Max Database Log Size (MB)")
self.define('db_log_backups', int, 5, True, self._application.regen_logging,
display_name="Database Log Backups")
self.define('enable_lazy_loading', bool, True, True,
display_name="Enable Lazy Loading",
help_text="Whether the client side should load all script pages initially when connected "
"to a live show")
self.define('enable_live_batching', bool, True, True,
display_name="Enable Live Batching",
help_text="Whether the live show page should only display a subsection of the script pages "
"at a time")

self._load(spawn_callbacks=False)

self._file_watcher = IOLoopFileWatcher(self.settings_path, self.auto_reload_changes, 100)
self._file_watcher.add_error_callback(self.file_deleted)
self._file_watcher.watch()

def define(self, key, val_type, default, can_edit, callback_fn=None, nullable=False):
def define(self, key, val_type, default, can_edit, callback_fn=None, nullable=False,
display_name: str = "", help_text: str = ""):
self.settings[key] = SettingsObject(key, val_type, default, can_edit, callback_fn,
nullable)
nullable, display_name, help_text)

def file_deleted(self):
get_logger().info('Settings file deleted; recreating from in memory settings')
Expand Down
2 changes: 1 addition & 1 deletion server/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ marshmallow-sqlalchemy==0.30.0
tornado-prometheus==0.1.2
bcrypt==4.2.1
anytree==2.12.1
alembic==1.14.0
alembic==1.14.1
2 changes: 1 addition & 1 deletion server/test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pytest<8.2
pytest<8.4