Skip to content

Scripts definitions update workflow

Jakub Šindelář edited this page May 23, 2020 · 1 revision

How does it work

Set up your environment

When you deploy Lazy Admin to your environment, you need to create master definition file and scripts definition file for each module you want to deploy to your computers. Those files need to be hosted on some web server or file server accessible to application. Then distribute path to master definition file to computers' registry HKLM\SOFTWARE\LazyAdmin\MasterDefinitionUrl, preferably via ADMX templates.

You can read more about setting up your environment on wiki.

Update flow explained

When user successfully logs in, Lazy Admin starts automatic update, which consist of:

  1. Reads update URL value from registry HKLM\SOFTWARE\LazyAdmin\MasterDefinitionUrl
  2. Downloads JSON file containing master definition version and scripts definitions URLs
  3. Compares current master definition and downloaded master definition:
    • If newer master definition file is found, all previous definitions are replaced with definitions from provided URLs
    • If master definition is already latest version, each scripts defitions URL is checked for updates and updated if newer version is found
  4. If updated scripts definitions file has dependency on any module, attempt is made to download or update required module

Developers

Code location

Functions are located in src\boot\definitions-updater.js and are accessible from Vue files via $defUpdater prototype.
Those function are automatically called in src\layouts\FullLayout.vue and can be manually called via update button in src\pages\AboutPage.vue

Reasoning

Because update may be called from two separate locations, most of the work is done in $defUpdater module, which emmits events containing results back to Vue page. Those functions expect Vue's this context to be passed to them, which allows functions to easily work with Vuex store and other Vue components like $q.notify.

Clone this wiki locally