Skip to content

Modular logistics and supply chain operating system (LSOS)

console is no longer a submodule 🚀

Ronald A. Richardson8c1f96ef0e7f
diff --git a/console b/console
deleted file mode 160000
index 8e43f513..00000000
--- a/console
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 8e43f5139d7ef5e10cef99b011f3af1f219cadb7
diff --git a/console/.dockerignore b/console/.dockerignore
new file mode 100644
index 00000000..8933b7c9
--- /dev/null
+++ b/console/.dockerignore
@@ -0,0 +1,25 @@
+# Ignore files not needed for docker to build microservice image
+node_modules/*
+postgres/*
+typings/*
+*/.git*
+*.git*
+*.git
+*.md
+!gulpfile.js
+ci/
+.circleci/
+Vagrantfile
+concourse/
+infra/*
+vagrant/*
+docker/*
+deploy/*
+media/*
+data/*
+appspec.yml
+compose.yml
+docker-compose-prod.yml
+docker-compose.yml
+$virtualenv.tar.gz
+$node_modules.tar.gz
diff --git a/console/.editorconfig b/console/.editorconfig
new file mode 100644
index 00000000..c35a0024
--- /dev/null
+++ b/console/.editorconfig
@@ -0,0 +1,19 @@
+# EditorConfig helps developers define and maintain consistent
+# coding styles between different editors and IDEs
+# editorconfig.org
+
+root = true
+
+[*]
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+indent_style = space
+indent_size = 2
+
+[*.hbs]
+insert_final_newline = false
+
+[*.{diff,md}]
+trim_trailing_whitespace = false
diff --git a/console/.ember-cli b/console/.ember-cli
new file mode 100644
index 00000000..4ccb4bf4
--- /dev/null
+++ b/console/.ember-cli
@@ -0,0 +1,15 @@
+{
+ /**
+ Ember CLI sends analytics information by default. The data is completely
+ anonymous, but there are times when you might want to disable this behavior.
+
+ Setting `disableAnalytics` to true will prevent any data from being sent.
+ */
+ "disableAnalytics": false,
+
+ /**
+ Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
+ rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
+ */
+ "isTypeScriptProject": false
+}
diff --git a/console/.eslintignore b/console/.eslintignore
new file mode 100644
index 00000000..d474a40b
--- /dev/null
+++ b/console/.eslintignore
@@ -0,0 +1,25 @@
+# unconventional js
+/blueprints/*/files/
+/vendor/
+
+# compiled output
+/dist/
+/tmp/
+
+# dependencies
+/bower_components/
+/node_modules/
+
+# misc
+/coverage/
+!.*
+.*/
+.eslintcache
+
+# ember-try
+/.node_modules.ember-try/
+/bower.json.ember-try
+/npm-shrinkwrap.json.ember-try
+/package.json.ember-try
+/package-lock.json.ember-try
+/yarn.lock.ember-try
diff --git a/console/.eslintrc.js b/console/.eslintrc.js
new file mode 100644
index 00000000..1cb05e98
--- /dev/null
+++ b/console/.eslintrc.js
@@ -0,0 +1,82 @@
+'use strict';
+
+module.exports = {
+ root: true,
+ parser: 'babel-eslint',
+ parserOptions: {
+ ecmaVersion: 2018,
+ sourceType: 'module',
+ ecmaFeatures: {
+ legacyDecorators: true,
+ },
+ },
+ plugins: ['ember'],
+ extends: ['eslint:recommended', 'plugin:ember/recommended', 'plugin:prettier/recommended'],
+ ignorePatterns: ['prebuild.js'],
+ env: {
+ browser: true,
+ },
+ globals: {
+ socketClusterClient: 'readonly',
+ L: 'readonly',
+ module: 'readonly',
+ require: 'readonly',
+ },
+ rules: {
+ 'ember/no-array-prototype-extensions': 'off',
+ 'ember/no-computed-properties-in-native-classes': 'off',
+ 'ember/no-controller-access-in-routes': 'off',
+ 'ember/no-empty-glimmer-component-classes': 'off',
+ 'ember/no-get': 'off',
+ 'ember/classic-decorator-no-classic-methods': 'off',
+ 'node/no-unpublished-require': [
+ 'error',
+ {
+ allowModules: [
+ 'ember-cli',
+ 'tailwindcss',
+ '@tailwindcss/forms',
+ 'postcss-import',
+ 'postcss-preset-env',
+ 'postcss-each',
+ 'postcss-mixins',
+ 'postcss-conditionals-renewed',
+ 'autoprefixer',
+ 'broccoli-funnel',
+ 'ember-auto-import',
+ ],
+ },
+ ],
+ 'no-prototype-builtins': 'off',
+ },
+ overrides: [
+ // node files
+ {
+ files: [
+ './.eslintrc.js',
+ './.prettierrc.js',
+ './.template-lintrc.js',
+ './ember-cli-build.js',
+ './index.js',
+ './testem.js',
+ './blueprints/*/index.js',
+ './config/**/*.js',
+ './tests/dummy/config/**/*.js',
+ ],
+ parserOptions: {
+ sourceType: 'script',
+ },
+ env: {
+ browser: false,
+ node: true,
+ },
+ plugins: ['node'],
+ extends: ['plugin:node/recommended'],
+ },
+ {
+ // test files
+ files: ['tests/**/*-test.{js,ts}'],
+ extends: ['plugin:qunit/recommended'],
+ },
+ ],
+};
diff --git a/console/.github/workflows/ci.yml b/console/.github/workflows/ci.yml
new file mode 100644
index 00000000..cf5964ba
--- /dev/null
+++ b/console/.github/workflows/ci.yml
@@ -0,0 +1,60 @@
+name: Ember CI
+
+on:
+ push:
+ branches: [ main ]
+ tags:
+ - 'v*'
+ pull_request:
+ branches: [ main ]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ node-version: [16.x] # Build on Node.js 16
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Setup Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v2
+ with:
+ node-version: ${{ matrix.node-version }}
+
+ - name: Setup pnpm
+ uses: pnpm/[email protected]
+ with:
+ version: latest
+
+ - name: Get pnpm Store Directory
+ id: pnpm-cache
+ shell: bash
+ run: |
+ echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
+
+ - uses: actions/cache@v3
+ name: Setup pnpm Cache
+ with:
+ path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
+ key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
+ restore-keys: |
+ ${{ runner.os }}-pnpm-store-
+
+ - name: Create .npmrc
+ run: |
+ if [[ -n "${{ secrets._GITHUB_AUTH_TOKEN }}" ]]; then
+ echo "@fleetbase:registry=https://npm.pkg.github.com/" > .npmrc
+ echo "//npm.pkg.github.com/:_authToken=${{ secrets._GITHUB_AUTH_TOKEN }}" >> .npmrc
+ fi
+
+ - name: Install Dependencies
+ run: pnpm install
+
+ - name: Lint
+ run: pnpm run lint
+
+ - name: Build
+ run: npx ember build --environment production
diff --git a/console/.gitignore b/console/.gitignore
new file mode 100644
index 00000000..77ae0999
--- /dev/null
+++ b/console/.gitignore
@@ -0,0 +1,35 @@
+# See https://help.github.com/ignore-files/ for more about ignoring files.
+
+# compiled output
+/dist/
+/tmp/
+
+# dependencies
+/bower_components/
+/node_modules/
+
+# misc
+/.env*
+/environments/.env*
+/.pnp*
+/.sass-cache
+/.eslintcache
+/connect.lock
+/coverage/
+/libpeerconnection.log
+/npm-debug.log*
+/testem.log
+/yarn-error.log
+/.npmrc
+/pnpm-lock.yaml
+
+# ember-try
+/.node_modules.ember-try/
+/bower.json.ember-try
+/npm-shrinkwrap.json.ember-try
+/package.json.ember-try
+/package-lock.json.ember-try
+/yarn.lock.ember-try
+
+# broccoli-debug
+/DEBUG/
diff --git a/console/.prettierignore b/console/.prettierignore
new file mode 100644
index 00000000..4178fd57
--- /dev/null
+++ b/console/.prettierignore
@@ -0,0 +1,25 @@
+# unconventional js
+/blueprints/*/files/
+/vendor/
+
+# compiled output
+/dist/
+/tmp/
+
+# dependencies
+/bower_components/
+/node_modules/
+
+# misc
+/coverage/
+!.*
+.eslintcache
+.lint-todo/
+
+# ember-try
+/.node_modules.ember-try/
+/bower.json.ember-try
+/npm-shrinkwrap.json.ember-try
+/package.json.ember-try
+/package-lock.json.ember-try
+/yarn.lock.ember-try
diff --git a/console/.prettierrc.js b/console/.prettierrc.js
new file mode 100644
index 00000000..cd88cc9f
--- /dev/null
+++ b/console/.prettierrc.js
@@ -0,0 +1,17 @@
+'use strict';
+
+module.exports = {
+ trailingComma: 'es5',
+ tabWidth: 4,
+ semi: true,
+ singleQuote: true,
+ printWidth: 190,
+ overrides: [
+ {
+ files: '*.hbs',
+ options: {
+ singleQuote: false,
+ },
+ },
+ ],
+};
diff --git a/console/.template-lintrc.js b/console/.template-lintrc.js
new file mode 100644
index 00000000..77c8fc74
--- /dev/null
+++ b/console/.template-lintrc.js
@@ -0,0 +1,14 @@
+'use strict';
+
+module.exports = {
+ extends: 'recommended',
+ rules: {
+ 'no-bare-strings': 'off',
+ 'no-invalid-interactive': 'off',
+ 'no-yield-only': 'off',
+ 'no-down-event-binding': 'off',
+ 'table-groups': 'off',
+ 'link-href-attributes': 'off',
+ 'require-input-label': 'off',
+ },
+};
diff --git a/console/.watchmanconfig b/console/.watchmanconfig
new file mode 100644
index 00000000..e7834e3e
--- /dev/null
+++ b/console/.watchmanconfig
@@ -0,0 +1,3 @@
+{
+ "ignore_dirs": ["tmp", "dist"]
+}
diff --git a/console/Dockerfile b/console/Dockerfile
new file mode 100644
index 00000000..7dd675a1
--- /dev/null
+++ b/console/Dockerfile
@@ -0,0 +1,51 @@
+# ---- Build Stage ----
+FROM node:16.20-alpine AS builder
+
+# Set the working directory in the container to /app
+WORKDIR /app
+
+# Create the pnpm directory and set the PNPM_HOME environment variable
+RUN mkdir -p ~/.pnpm
+ENV PNPM_HOME /root/.pnpm
+
+# Add the pnpm global bin to the PATH
+ENV PATH /root/.pnpm/bin:$PATH
+
+# Copy pnpm-lock.yaml (or package.json) into the directory /app in the container
+COPY console/package.json console/pnpm-lock.yaml ./
+
+# Copy over .npmrc if applicable
+COPY console/.npmr[c] ./
+
+# Install global dependencies
+RUN npm install -g ember-cli pnpm
+
+# Install git
+RUN apk update && apk add git openssh-client
+
+# Trust GitHub's RSA host key
+RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
+
+# Install app dependencies
+RUN pnpm install
+
+# Copy the console directory contents into the container at /app
+COPY console .
+
+# Build the application
+RUN pnpm build
+
+# ---- Serve Stage ----
+FROM nginx:alpine
+
+# Copy the built app to our served directory
+COPY --from=builder /app/dist /usr/share/nginx/html
+
+# Expose the port nginx is bound to
+EXPOSE 4200
+
+# Use custom nginx.conf
+COPY console/nginx.conf /etc/nginx/conf.d/default.conf
+
+# Start Nginx server
+CMD ["nginx", "-g", "daemon off;"]
\ No newline at end of file
diff --git a/console/README.md b/console/README.md
new file mode 100644
index 00000000..a3284d62
--- /dev/null
+++ b/console/README.md
@@ -0,0 +1,22 @@
+<div id="hero">
+ <p align="center" dir="auto">
+ <a href="https://fleetbase.io" rel="nofollow">
+ <img src="https://user-images.githubusercontent.com/58805033/191936702-fed04b0f-7966-4041-96d0-95e27bf98248.png" alt="Fleetbase logo" width="600" height="140" style="max-width: 100%;">
+ </a>
+ </p>
+ <h2 align="center" dir="auto">
+ Fleetbase Console
+ </h2>
+</div>
+
+<p align="center" dir="auto">
+ <img src="https://user-images.githubusercontent.com/816371/246987420-deef79fa-e30c-4ce9-8a04-0dee990ffd9d.png" alt="Fleetbase Console" width="600" style="max-width: 100%;" />
+</p>
+
+# ⭐️ Overview
+
+<p>The Fleetbase Console, a vital component of the Fleetbase Platform, serves as the graphical user interface that facilitates interaction with all Fleetbase extensions. It's architecturally designed to be lightweight, primarily employing Ember Engines for its operational foundation. Ember Engines, a scalable development paradigm for ambitious web applications, allow the Console to dynamically load and manage extensions, ensuring a streamlined and efficient user experience.</p>
+
+<p>The responsibilities of the Console are kept minimalistic to maintain its performance and agility. The Console's key responsibilities encompass administration management, configuration of organization and user settings, and establishing a robust connection to the Fleetbase extensions repository. In its administrative capacity, it provides an intuitive interface for configuring the Fleetbas instance.</p>
+
+<p>Lastly, the Console plays a pivotal role in connecting to the Fleetbase extensions repository. This provides the flexibility to add, update, or remove extensions as per the organizational needs and preferences, all while ensuring the seamless operation and integrity of the Fleetbase Platform.</p>
diff --git a/console/app/adapters/application.js b/console/app/adapters/application.js
new file mode 100644
index 00000000..ac44c25f
--- /dev/null
+++ b/console/app/adapters/application.js
@@ -0,0 +1 @@
+export { default } from '@fleetbase/ember-core/adapters/application';
diff --git a/console/app/adapters/brand.js b/console/app/adapters/brand.js
new file mode 100644
index 00000000..2ab9bd26
--- /dev/null
+++ b/console/app/adapters/brand.js
@@ -0,0 +1,15 @@
+import ApplicationAdapter from './application';
+
+export default class BrandAdapter extends ApplicationAdapter {
+ urlForFindRecord() {
+ return `${this.host}/${this.namespace}/settings/branding`;
+ }
+
+ urlForUpdateRecord() {
+ return `${this.host}/${this.namespace}/settings/branding`;
+ }
+
+ urlForCreateRecord() {
+ return `${this.host}/${this.namespace}/settings/branding`;
+ }
+}
diff --git a/console/app/app.js b/console/app/app.js
new file mode 100644
index 00000000..ab948fd0
--- /dev/null
+++ b/console/app/app.js
@@ -0,0 +1,23 @@
+import Application from '@ember/application';
+import Resolver from 'ember-resolver';
+import loadInitializers from 'ember-load-initializers';
+import config from '@fleetbase/console/config/environment';
+import loadExtensions from '@fleetbase/ember-core/utils/load-extensions';
+import mapEngines from '@fleetbase/ember-core/utils/map-engines';
+
+export default class App extends Application {
+ modulePrefix = config.modulePrefix;
+ podModulePrefix = config.podModulePrefix;
+ Resolver = Resolver;
+ extensions = [];
+ engines = {};
+
+ async ready() {
+ const extensions = await loadExtensions();
+
+ this.extensions = extensions;
+ this.engines = mapEngines(extensions);
+ }
+}
+
+loadInitializers(App, config.modulePrefix);
diff --git a/console/app/components/.gitkeep b/console/app/components/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/console/app/components/configure/filesystem.hbs b/console/app/components/configure/filesystem.hbs
new file mode 100644
index 00000000..82d89f20
--- /dev/null
+++ b/console/app/components/configure/filesystem.hbs
@@ -0,0 +1,21 @@
+<ContentPanel @title="Filesystem" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
+ <InputGroup @name="Driver" @helpText="Select the default filesystem driver for Fleetbase to use.">
+ <Select @options={{this.disks}} @value={{this.driver}} @onSelect={{this.setDriver}} @placeholder="Select filesystem driver" class="w-full" disabled={{this.isLoading}} />
+ </InputGroup>
+ {{#if (eq this.driver "s3")}}
+ <InputGroup @name="S3 Bucket" @value={{this.s3Bucket}} disabled={{this.isLoading}} />
+ <InputGroup @name="S3 URL" @value={{this.s3Url}} disabled={{this.isLoading}} />
+ <InputGroup @name="S3 Endpoint" @value={{this.s3Endpoint}} disabled={{this.isLoading}} />
+ {{/if}}
+ {{#if this.testResponse}}
+ <div class="animate-pulse flex flex-row items-center rounded-lg border {{if (eq this.testResponse.status 'error') 'border-red-900 bg-red-800 text-red-100' 'border-green-900 bg-green-800 text-green-100'}} shadow-sm my-2 px-4 py-2">
+ <FaIcon @icon={{if (eq this.testResponse.status 'error') 'triangle-exclamation' 'circle-check'}} class="mr-1.5 {{if (eq this.testResponse.status 'error') 'text-red-200' 'text-green-200'}}" />
+ <span class="text-xs">{{this.this.testResponse.message}}</span>
+ </div>
+ {{/if}}
+ <Button @wrapperClass="mt-3" @icon="plug" @text="Test Config" @onClick={{this.test}} @isLoading={{this.isLoading}} />
+</ContentPanel>
+
+<div class="mt-3 flex items-center justify-end">
+ <Button @type="primary" @size="lg" @icon="save" @text="Save Changes" @onClick={{this.save}} @disabled={{this.isLoading}} @isLoading={{this.isLoading}} />
+</div>
\ No newline at end of file
diff --git a/console/app/components/configure/filesystem.js b/console/app/components/configure/filesystem.js
new file mode 100644
index 00000000..0228a5d4
--- /dev/null
+++ b/console/app/components/configure/filesystem.js
@@ -0,0 +1,85 @@
+import Component from '@glimmer/component';
+import { inject as service } from '@ember/service';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+
+export default class ConfigureFilesystemComponent extends Component {
+ @service fetch;
+ @service notifications;
+ @tracked isLoading = false;
+ @tracked testResponse;
+ @tracked disks = [];
+ @tracked driver = 'local';
+ @tracked s3Bucket = null;
+ @tracked s3Url = null;
+ @tracked s3Endpoint = null;
+
+ /**
+ * Creates an instance of ConfigureFilesystemComponent.
+ * @memberof ConfigureFilesystemComponent
+ */
+ constructor() {
+ super(...arguments);
+ this.loadConfigValues();
+ }
+
+ @action setConfigValues(config) {
+ for (const key in config) {
+ if (this[key] !== undefined) {
+ this[key] = config[key];
+ }
+ }
+ }
+
+ @action setDriver(driver) {
+ this.driver = driver;
+ }
+
+ @action loadConfigValues() {
+ this.isLoading = true;
+
+ this.fetch
+ .get('settings/filesystem-config')
+ .then((response) => {
+ this.setConfigValues(response);
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+
+ @action save() {
+ this.isLoading = true;
+
+ this.fetch
+ .post('settings/filesystem-config', {
+ driver: this.driver,
+ s3: {
+ bucket: this.s3Bucket,
+ url: this.s3Url,
+ endpoint: this.s3Endpoint,
+ },
+ })
+ .then(() => {
+ this.notifications.success('Filesystem configuration saved.');
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+
+ @action test() {
+ this.isLoading = true;
+
+ this.fetch
+ .post('settings/test-filesystem-config', {
+ disk: this.driver,
+ })
+ .then((response) => {
+ this.testResponse = response;
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+}
diff --git a/console/app/components/configure/mail.hbs b/console/app/components/configure/mail.hbs
new file mode 100644
index 00000000..ce964521
--- /dev/null
+++ b/console/app/components/configure/mail.hbs
@@ -0,0 +1,27 @@
+<ContentPanel @title="Mail" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
+ <InputGroup @name="Mailer" @helpText="Select the default mailer for Fleetbase to use.">
+ <Select @options={{this.mailers}} @value={{this.mailer}} @onSelect={{this.setMailer}} @placeholder="Select mailer" class="w-full" />
+ </InputGroup>
+ {{#if (eq this.mailer "smtp")}}
+ <InputGroup @name="SMTP Host" @value={{this.smtpHost}} disabled={{this.isLoading}} />
+ <InputGroup @name="SMTP Port" @type="number" @value={{this.smtpPort}} disabled={{this.isLoading}} />
+ <InputGroup @name="SMTP Encryption" @value={{this.smtpEncryption}} disabled={{this.isLoading}} />
+ <InputGroup @name="SMTP Username" @value={{this.smtpUsername}} disabled={{this.isLoading}} />
+ <InputGroup @name="SMTP Password" @type="password" @value={{this.smtpPassword}} disabled={{this.isLoading}} />
+ <InputGroup @name="SMTP Timeout" @value={{this.smtpTimeout}} disabled={{this.isLoading}} />
+ <InputGroup @name="SMTP Auth Mode" @value={{this.smtpAuth_mode}} disabled={{this.isLoading}} />
+ {{/if}}
+ <InputGroup @name="From Address" @helpText="Input the email address for Fleetbase to send emails from." @value={{this.fromAddress}} @placeholder="From Address" disabled={{this.isLoading}} />
+ <InputGroup @name="From Name" @helpText="Input the name for Fleetbase to send emails from." @value={{this.fromName}} @placeholder="From Name" disabled={{this.isLoading}} />
+ {{#if this.testResponse}}
+ <div class="animate-pulse flex flex-row items-center rounded-lg border {{if (eq this.testResponse.status 'error') 'border-red-900 bg-red-800 text-red-100' 'border-green-900 bg-green-800 text-green-100'}} shadow-sm my-2 px-4 py-2">
+ <FaIcon @icon={{if (eq this.testResponse.status 'error') 'triangle-exclamation' 'circle-check'}} class="mr-1.5 {{if (eq this.testResponse.status 'error') 'text-red-200' 'text-green-200'}}" />
+ <span class="text-xs">{{this.this.testResponse.message}}</span>
+ </div>
+ {{/if}}
+ <Button @wrapperClass="mt-3" @icon="plug" @text="Test Config" @onClick={{this.test}} @isLoading={{this.isLoading}} />
+</ContentPanel>
+
+<div class="mt-3 flex items-center justify-end">
+ <Button @type="primary" @size="lg" @icon="save" @text="Save Changes" @onClick={{this.save}} @disabled={{this.isLoading}} @isLoading={{this.isLoading}} />
+</div>
\ No newline at end of file
diff --git a/console/app/components/configure/mail.js b/console/app/components/configure/mail.js
new file mode 100644
index 00000000..375d6e5d
--- /dev/null
+++ b/console/app/components/configure/mail.js
@@ -0,0 +1,108 @@
+import Component from '@glimmer/component';
+import { inject as service } from '@ember/service';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+
+export default class ConfigureMailComponent extends Component {
+ @service fetch;
+ @service notifications;
+ @tracked isLoading = false;
+ @tracked testResponse;
+ @tracked mailers = [];
+ @tracked mailer = 'smtp';
+ @tracked fromAddress = null;
+ @tracked fromName = null;
+ @tracked smtpHost = 'smtp.mailgun.org';
+ @tracked smtpPort = 587;
+ @tracked smtpEncryption = 'tls';
+ @tracked smtpUsername = null;
+ @tracked smtpPassword = null;
+ @tracked smtpTimeout = null;
+ @tracked smtpAuth_mode = null;
+
+ /**
+ * Creates an instance of ConfigureFilesystemComponent.
+ * @memberof ConfigureFilesystemComponent
+ */
+ constructor() {
+ super(...arguments);
+ this.loadConfigValues();
+ }
+
+ @action setConfigValues(config) {
+ for (const key in config) {
+ if (this[key] !== undefined) {
+ this[key] = config[key];
+ }
+ }
+ }
+
+ @action setMailer(mailer) {
+ this.mailer = mailer;
+ }
+
+ @action serializeSmtpConfig() {
+ return {
+ host: this.smtpHost,
+ port: this.smtpPort,
+ encryption: this.smtpEncryption,
+ username: this.smtpUsername,
+ password: this.smtpPassword,
+ timeout: this.smtpTimeout,
+ auth_mode: this.smtpAuth_mode,
+ };
+ }
+
+ @action loadConfigValues() {
+ this.isLoading = true;
+
+ this.fetch
+ .get('settings/mail-config')
+ .then((response) => {
+ this.setConfigValues(response);
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+
+ @action test() {
+ this.isLoading = true;
+
+ this.fetch
+ .post('settings/test-mail-config', {
+ mailer: this.mailer,
+ from: {
+ address: this.fromAddress,
+ name: this.fromName,
+ },
+ smtp: this.serializeSmtpConfig(),
+ })
+ .then((response) => {
+ this.testResponse = response;
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+
+ @action save() {
+ this.isLoading = true;
+
+ this.fetch
+ .post('settings/mail-config', {
+ mailer: this.mailer,
+ from: {
+ address: this.fromAddress,
+ name: this.fromName,
+ },
+ smtp: this.serializeSmtpConfig(),
+ })
+ .then(() => {
+ this.notifications.success('Mail configuration saved.');
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+}
diff --git a/console/app/components/configure/notification-channels.hbs b/console/app/components/configure/notification-channels.hbs
new file mode 100644
index 00000000..7a0ee9f4
--- /dev/null
+++ b/console/app/components/configure/notification-channels.hbs
@@ -0,0 +1,52 @@
+<ContentPanel @title="APN Configutation" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
+ <InputGroup @name="APN Key ID" @value={{this.apn.key_id}} disabled={{this.isLoading}} />
+ <InputGroup @name="APN Team ID" @value={{this.apn.team_id}} disabled={{this.isLoading}} />
+ <InputGroup @name="APN App Bundle ID" @value={{this.apn.app_bundle_id}} disabled={{this.isLoading}} />
+ {{!-- <InputGroup @name="APN Private Key" disabled={{this.isLoading}}>
+ <Textarea class="form-input w-full" @value={{this.apn.private_key_content}} placeholder="APN Private Key" rows="10" disabled={{this.isLoading}} />
+ </InputGroup> --}}
+ <InputGroup @wrapperClass="flex flex-row items-center">
+ <UploadButton @name="apn-key" @accept="text/plain,application/x-pem-file,application/x-pkcs12,application/x-x509-ca-cert,.p12,.pem,.p8" @onFileAdded={{this.uploadApnKey}} @buttonText="Upload P8 Key File" @uploadIcon="upload" class="w-auto m-0i mt-0i" />
+ {{#if this.apn.private_key_file}}
+ <div class="ml-2.5 text-sm dark:text-white text-black flex flex-row items-center border border-blue-500 rounded-lg px-2 py-0.5 -mt-1">
+ <FaIcon @icon="file-text" @size="sm" class="mr-2 dark:text-white text-black" />
+ <span>{{this.apn.private_key_file.original_filename}}</span>
+ <a href="javascript:;" class="text-red-500 ml-2" {{on "click" this.removeApnFile}}><FaIcon @icon="times" class="text-red-500" /></a>
+ </div>
+ {{/if}}
+ </InputGroup>
+ <InputGroup>
+ <Checkbox @label="APN Production" @value={{this.apn.production}} @onToggle={{fn (mut this.apn.production)}} @disabled={{this.isLoading}} />
+ </InputGroup>
+ {{#if this.testResponse}}
+ <div class="animate-pulse flex flex-row items-center rounded-lg border {{if (eq this.testResponse.status 'error') 'border-red-900 bg-red-800 text-red-100' 'border-green-900 bg-green-800 text-green-100'}} shadow-sm my-2 px-4 py-2">
+ <FaIcon @icon={{if (eq this.testResponse.status 'error') 'triangle-exclamation' 'circle-check'}} class="mr-1.5 {{if (eq this.testResponse.status 'error') 'text-red-200' 'text-green-200'}}" />
+ <span class="text-xs">{{this.this.testResponse.message}}</span>
+ </div>
+ {{/if}}
+ <div class="mt-3 rounded-lg bg-gray-900 shadow-inner p-3">
+ <div class="flex flex-col space-y-2">
+ <div class="flex flex-row items-center">
+ <div class="text-sm w-40">Title:</div>
+ <Input @value={{this.testTitle}} placeholder="Push Notification Title" class="form-input flex-1" />
+ </div>
+ <div class="flex flex-row items-center">
+ <div class="text-sm w-40">Message:</div>
+ <Input @value={{this.testMessage}} placeholder="Push Notification Message" class="form-input flex-1" />
+ </div>
+ <div class="flex flex-row items-center">
+ <div class="text-sm w-40">APN Device Token:</div>
+ <Input @value={{this.apnToken}} placeholder="APN Device Token" class="form-input flex-1" />
+ </div>
+ <div class="flex flex-row items-center">
+ <div class="text-sm w-40">FCM Device Token:</div>
+ <Input @value={{this.fcmToken}} placeholder="FCM Device Token" class="form-input flex-1" />
+ </div>
+ </div>
+ <Button @wrapperClass="mt-3" @icon="plug" @text="Test Config" @onClick={{this.test}} @isLoading={{this.isLoading}} />
+ </div>
+</ContentPanel>
+
+<div class="mt-3 flex items-center justify-end">
+ <Button @type="primary" @size="lg" @icon="save" @text="Save Changes" @onClick={{this.save}} @disabled={{this.isLoading}} @isLoading={{this.isLoading}} />
+</div>
\ No newline at end of file
diff --git a/console/app/components/configure/notification-channels.js b/console/app/components/configure/notification-channels.js
new file mode 100644
index 00000000..ad279d07
--- /dev/null
+++ b/console/app/components/configure/notification-channels.js
@@ -0,0 +1,127 @@
+import Component from '@glimmer/component';
+import { inject as service } from '@ember/service';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+
+export default class ConfigureNotificationChannelsComponent extends Component {
+ @service fetch;
+ @service notifications;
+ @service currentUser;
+ @tracked isLoading = false;
+ @tracked testResponse;
+ @tracked testTitle = 'Hello World from Fleetbase 🚀';
+ @tracked testMessage = 'This is a test push notification!';
+ @tracked apnToken;
+ @tracked fcmToken;
+ @tracked apn = {
+ key_id: '',
+ team_id: '',
+ app_bundle_id: '',
+ private_key_path: '',
+ private_key_file_id: '',
+ private_key_file: null,
+ production: true,
+ };
+ @tracked fcm = {
+ firebase_credentials_json: '',
+ firebase_database_url: '',
+ firebase_project_name: '',
+ };
+
+ constructor() {
+ super(...arguments);
+ this.loadConfigValues();
+ }
+
+ @action removeApnFile() {
+ const apnConfig = this.apn;
+ apnConfig.private_key_file = null;
+ apnConfig.private_key_file_id = '';
+ apnConfig.private_key_path = '';
+
+ this.apn = apnConfig;
+ }
+
+ @action uploadApnKey(file) {
+ try {
+ this.fetch.uploadFile.perform(
+ file,
+ {
+ disk: 'local',
+ path: `apn`,
+ subject_uuid: this.currentUser.companyId,
+ subject_type: `company`,
+ type: `apn_key`,
+ },
+ (uploadedFile) => {
+ const apnConfig = this.apn;
+ apnConfig.private_key_file = uploadedFile;
+ apnConfig.private_key_file_id = uploadedFile.id;
+ apnConfig.private_key_path = uploadedFile.path;
+
+ this.apn = apnConfig;
+ }
+ );
+ } catch (error) {
+ this.notifications.serverError(error);
+ }
+ }
+
+ @action setConfigValues(config) {
+ for (const key in config) {
+ if (this[key] !== undefined) {
+ this[key] = config[key];
+ }
+ }
+ }
+
+ @action loadConfigValues() {
+ this.isLoading = true;
+
+ this.fetch
+ .get('settings/notification-channels-config')
+ .then((response) => {
+ this.setConfigValues(response);
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+
+ @action save() {
+ this.isLoading = true;
+
+ const apnConfig = this.apn;
+ delete apnConfig.private_key_file;
+
+ this.fetch
+ .post('settings/notification-channels-config', {
+ apn: apnConfig,
+ })
+ .then(() => {
+ this.notifications.success("Notification channel's configuration saved.");
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+
+ @action test() {
+ this.isLoading = true;
+
+ this.fetch
+ .post('settings/test-notification-channels-config', {
+ apn: this.apn,
+ title: this.testTitle,
+ message: this.testMessage,
+ apnToken: this.apnToken,
+ fcmToken: this.fcmToken,
+ })
+ .then((response) => {
+ this.testResponse = response;
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+}
diff --git a/console/app/components/configure/queue.hbs b/console/app/components/configure/queue.hbs
new file mode 100644
index 00000000..4c2d7797
--- /dev/null
+++ b/console/app/components/configure/queue.hbs
@@ -0,0 +1,25 @@
+<ContentPanel @title="Queue" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
+ <InputGroup @name="Driver" @helpText="Select the default queue driver for Fleetbase to use.">
+ <Select @options={{this.connections}} @value={{this.driver}} @onSelect={{this.setDriver}} @placeholder="Select queue driver" disabled={{this.isLoading}} class="w-full" />
+ </InputGroup>
+ {{#if (eq this.driver "beanstalkd")}}
+ <InputGroup @name="Beanstalk Host" @value={{this.beanstalkdHost}} disabled={{this.isLoading}} />
+ <InputGroup @name="Beanstalk Queue" @value={{this.beanstalkdQueue}} />
+ {{/if}}
+ {{#if (eq this.driver "sqs")}}
+ <InputGroup @name="SQS Prefix" @value={{this.sqsPrefix}} disabled={{this.isLoading}} />
+ <InputGroup @name="SQS Queue" @value={{this.sqsQueue}} disabled={{this.isLoading}} />
+ <InputGroup @name="SQS Suffix" @value={{this.sqsSuffix}} disabled={{this.isLoading}} />
+ {{/if}}
+ {{#if this.testResponse}}
+ <div class="animate-pulse flex flex-row items-center rounded-lg border {{if (eq this.testResponse.status 'error') 'border-red-900 bg-red-800 text-red-100' 'border-green-900 bg-green-800 text-green-100'}} shadow-sm my-2 px-4 py-2">
+ <FaIcon @icon={{if (eq this.testResponse.status 'error') 'triangle-exclamation' 'circle-check'}} class="mr-1.5 {{if (eq this.testResponse.status 'error') 'text-red-200' 'text-green-200'}}" />
+ <span class="text-xs">{{this.this.testResponse.message}}</span>
+ </div>
+ {{/if}}
+ <Button @wrapperClass="mt-3" @icon="plug" @text="Test Config" @onClick={{this.test}} @isLoading={{this.isLoading}} />
+</ContentPanel>
+
+<div class="mt-3 flex items-center justify-end">
+ <Button @type="primary" @size="lg" @icon="save" @text="Save Changes" @onClick={{this.save}} @disabled={{this.isLoading}} @isLoading={{this.isLoading}} />
+</div>
\ No newline at end of file
diff --git a/console/app/components/configure/queue.js b/console/app/components/configure/queue.js
new file mode 100644
index 00000000..6f8cfe1f
--- /dev/null
+++ b/console/app/components/configure/queue.js
@@ -0,0 +1,91 @@
+import Component from '@glimmer/component';
+import { inject as service } from '@ember/service';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+
+export default class ConfigureQueueComponent extends Component {
+ @service fetch;
+ @service notifications;
+ @tracked isLoading = false;
+ @tracked testResponse;
+ @tracked connections = [];
+ @tracked driver = 'sync';
+ @tracked sqsPrefix = null;
+ @tracked sqsQueue = null;
+ @tracked sqsSuffix = null;
+ @tracked beanstalkdHost = 'localhost';
+ @tracked beanstalkdQueue = 'default';
+
+ /**
+ * Creates an instance of ConfigureQueueComponent.
+ * @memberof ConfigureQueueComponent
+ */
+ constructor() {
+ super(...arguments);
+ this.loadConfigValues();
+ }
+
+ @action setConfigValues(config) {
+ for (const key in config) {
+ if (this[key] !== undefined) {
+ this[key] = config[key];
+ }
+ }
+ }
+
+ @action setDriver(driver) {
+ this.driver = driver;
+ }
+
+ @action loadConfigValues() {
+ this.isLoading = true;
+
+ this.fetch
+ .get('settings/queue-config')
+ .then((response) => {
+ this.setConfigValues(response);
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+
+ @action save() {
+ this.isLoading = true;
+
+ this.fetch
+ .post('settings/queue-config', {
+ driver: this.driver,
+ sqs: {
+ prefix: this.sqsPrefix,
+ queue: this.sqsQueue,
+ suffix: this.sqsSuffix,
+ },
+ beanstalkd: {
+ host: this.beanstalkdHost,
+ queue: this.beanstalkdQueue,
+ },
+ })
+ .then(() => {
+ this.notifications.success('Queue configuration saved.');
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+
+ @action test() {
+ this.isLoading = true;
+
+ this.fetch
+ .post('settings/test-queue-config', {
+ queue: this.driver,
+ })
+ .then((response) => {
+ this.testResponse = response;
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+}
diff --git a/console/app/components/configure/services.hbs b/console/app/components/configure/services.hbs
new file mode 100644
index 00000000..8f893bd3
--- /dev/null
+++ b/console/app/components/configure/services.hbs
@@ -0,0 +1,45 @@
+<ContentPanel @title="AWS" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
+ <InputGroup @name="AWS Access Key" @value={{this.awsKey}} disabled={{this.isLoading}} />
+ <InputGroup @name="AWS Access Secret" @value={{this.awsSecret}} disabled={{this.isLoading}} />
+ <InputGroup @name="AWS Region" @value={{this.awsRegion}} disabled={{this.isLoading}} />
+</ContentPanel>
+
+<ContentPanel @title="Google Maps" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
+ <InputGroup @name="Google Maps API Key" @value={{this.googleMapsApiKey}} disabled={{this.isLoading}} />
+ <InputGroup @name="Google Maps Locale" @value={{this.googleMapsLocale}} disabled={{this.isLoading}} />
+</ContentPanel>
+
+<ContentPanel @title="Twilio" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
+ <InputGroup @name="Twilio SID" @value={{this.twilioSid}} disabled={{this.isLoading}} />
+ <InputGroup @name="Twilio Token" @value={{this.twilioToken}} disabled={{this.isLoading}} />
+ <InputGroup @name="Twilio From" @value={{this.twilioFrom}} disabled={{this.isLoading}} />
+ {{#if this.twilioTestResponse}}
+ <div class="animate-pulse flex flex-row items-center rounded-lg border {{if (eq this.twilioTestResponse.status 'error') 'border-red-900 bg-red-800 text-red-100' 'border-green-900 bg-green-800 text-green-100'}} shadow-sm my-2 px-4 py-2">
+ <FaIcon @icon={{if (eq this.twilioTestResponse.status 'error') 'triangle-exclamation' 'circle-check'}} class="mr-1.5 {{if (eq this.twilioTestResponse.status 'error') 'text-red-200' 'text-green-200'}}" />
+ <span class="text-xs">{{this.this.twilioTestResponse.message}}</span>
+ </div>
+ {{/if}}
+ <div class="flex flex-row items-center mt-3">
+ <Input @value={{this.twilioTestPhone}} @type="tel" placeholder="Send Test SMS Here" class="form-input form-input-sm" />
+ <Button @wrapperClass="ml-2" @icon="plug" @text="Test Twilio Config" @onClick={{this.testTwilio}} @isLoading={{this.isLoading}} @disabled={{not this.twilioTestPhone}} />
+ </div>
+</ContentPanel>
+
+<ContentPanel @title="Sentry" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
+ <InputGroup @name="Sentry DSN" @value={{this.sentryDsn}} disabled={{this.isLoading}} />
+ {{#if this.sentryTestResponse}}
+ <div class="animate-pulse flex flex-row items-center rounded-lg border {{if (eq this.sentryTestResponse.status 'error') 'border-red-900 bg-red-800 text-red-100' 'border-green-900 bg-green-800 text-green-100'}} shadow-sm my-2 px-4 py-2">
+ <FaIcon @icon={{if (eq this.sentryTestResponse.status 'error') 'triangle-exclamation' 'circle-check'}} class="mr-1.5 {{if (eq this.sentryTestResponse.status 'error') 'text-red-200' 'text-green-200'}}" />
+ <span class="text-xs">{{this.this.sentryTestResponse.message}}</span>
+ </div>
+ {{/if}}
+ <Button @wrapperClass="mt-3" @icon="plug" @text="Test Sentry Config" @onClick={{this.testSentry}} @isLoading={{this.isLoading}} />
+</ContentPanel>
+
+<ContentPanel @title="IP Info" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
+ <InputGroup @name="IP Info API Key" @value={{this.ipinfoApiKey}} disabled={{this.isLoading}} />
+</ContentPanel>
+
+<div class="mt-3 flex items-center justify-end">
+ <Button @type="primary" @size="lg" @icon="save" @text="Save Changes" @onClick={{this.save}} @disabled={{this.isLoading}} @isLoading={{this.isLoading}} />
+</div>
\ No newline at end of file
diff --git a/console/app/components/configure/services.js b/console/app/components/configure/services.js
new file mode 100644
index 00000000..b342fac8
--- /dev/null
+++ b/console/app/components/configure/services.js
@@ -0,0 +1,130 @@
+import Component from '@glimmer/component';
+import { inject as service } from '@ember/service';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+
+export default class ConfigureServicesComponent extends Component {
+ @service fetch;
+ @service notifications;
+ @tracked isLoading = false;
+
+ /** aws service */
+ @tracked awsKey = null;
+ @tracked awsSecret = null;
+ @tracked awsRegion = null;
+
+ /** ipinfo service */
+ @tracked ipinfoApiKey = null;
+
+ /** google maps service */
+ @tracked googleMapsApiKey = null;
+ @tracked googleMapsLocale = 'us';
+
+ /** twilio service */
+ @tracked twilioSid = null;
+ @tracked twilioToken = null;
+ @tracked twilioFrom = null;
+ @tracked twilioTestPhone = null;
+ @tracked twilioTestResponse;
+
+ /** sentry service */
+ @tracked sentryDsn = null;
+ @tracked sentryTestResponse;
+
+ /**
+ * Creates an instance of ConfigureServicesComponent.
+ * @memberof ConfigureServicesComponent
+ */
+ constructor() {
+ super(...arguments);
+ this.loadConfigValues();
+ }
+
+ @action setConfigValues(config) {
+ for (const key in config) {
+ if (this[key] !== undefined) {
+ this[key] = config[key];
+ }
+ }
+ }
+
+ @action loadConfigValues() {
+ this.isLoading = true;
+
+ this.fetch
+ .get('settings/services-config')
+ .then((response) => {
+ this.setConfigValues(response);
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+
+ @action save() {
+ this.isLoading = true;
+
+ this.fetch
+ .post('settings/services-config', {
+ aws: {
+ key: this.awsKey,
+ secret: this.awsSecret,
+ region: this.awsRegion,
+ },
+ ipinfo: {
+ api_key: this.ipinfoApiKey,
+ },
+ googleMaps: {
+ api_key: this.googleMapsApiKey,
+ locale: this.googleMapsLocale,
+ },
+ twilio: {
+ sid: this.twilioSid,
+ token: this.twilioToken,
+ from: this.twilioFrom,
+ },
+ sentry: {
+ dsn: this.sentryDsn,
+ },
+ })
+ .then(() => {
+ this.notifications.success('Services configuration saved.');
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+
+ @action testTwilio() {
+ this.isLoading = true;
+
+ this.fetch
+ .post('settings/test-twilio-config', {
+ sid: this.twilioSid,
+ token: this.twilioToken,
+ from: this.twilioFrom,
+ phone: this.twilioTestPhone,
+ })
+ .then((response) => {
+ this.twilioTestResponse = response;
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+
+ @action testSentry() {
+ this.isLoading = true;
+
+ this.fetch
+ .post('settings/test-sentry-config', {
+ dsn: this.sentryDsn,
+ })
+ .then((response) => {
+ this.sentryTestResponse = response;
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+}
diff --git a/console/app/components/configure/socket.hbs b/console/app/components/configure/socket.hbs
new file mode 100644
index 00000000..210c4578
--- /dev/null
+++ b/console/app/components/configure/socket.hbs
@@ -0,0 +1,46 @@
+<ContentPanel @title="SocketCluster Connection" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
+ <p class="mb-4">The SocketCluster configuration cannot be changed at this time.</p>
+ <div id="output" class="font-mono rounded-lg max-h-full px-6 py-4 overflow-y-scroll bg-black shadow-inner dark:shadow-none">
+ <div class="flex items-center justify-between mb-4">
+ <div class="block w-1/2 font-mono text-sm font-semibold text-green-300">
+ Output
+ </div>
+ {{#if this.events.length}}
+ <div class="flex items-center justify-end w-1/2 text-sm text-green-300">
+ <Spinner @iconClass="green-loader" />
+
+ <span class="ml-2 text-sm font-mono">
+ Awaiting events...
+ </span>
+ </div>
+ {{/if}}
+ </div>
+
+ <div>
+ {{#each this.events as |event|}}
+ <div class="mb-3 text-sm font-mono rounded-lg shadow-sm flex flex-row">
+ <div class="text-{{event.color}}-300 uppercase text-sm font-mono pr-2 flex-shrink-0">
+ [{{event.time}}]:
+ </div>
+ <div class="text-{{event.color}}-300 text-sm font-mono">
+ {{html-safe event.content}}
+ </div>
+ </div>
+ {{else}}
+ <div class="flex items-center mt-6 text-green-300">
+ <Spinner @iconClass="green-loader" />
+ <span class="ml-2 text-sm font-mono">
+ Awaiting events...
+ </span>
+ </div>
+ {{/each}}
+ </div>
+ </div>
+ {{#if this.testResponse}}
+ <div class="animate-pulse flex flex-row items-center rounded-lg border {{if (eq this.testResponse.status 'error') 'border-red-900 bg-red-800 text-red-100' 'border-green-900 bg-green-800 text-green-100'}} shadow-sm my-2 px-4 py-2">
+ <FaIcon @icon={{if (eq this.testResponse.status 'error') 'triangle-exclamation' 'circle-check'}} class="mr-1.5 {{if (eq this.testResponse.status 'error') 'text-red-200' 'text-green-200'}}" />
+ <span class="text-xs">{{this.this.testResponse.message}}</span>
+ </div>
+ {{/if}}
+ <Button @wrapperClass="mt-3" @icon="plug" @text="Test Socket Connection" @onClick={{this.testSocketConnection}} @isLoading={{this.isLoading}} />
+</ContentPanel>
\ No newline at end of file
diff --git a/console/app/components/configure/socket.js b/console/app/components/configure/socket.js
new file mode 100644
index 00000000..53a5dfa2
--- /dev/null
+++ b/console/app/components/configure/socket.js
@@ -0,0 +1,165 @@
+import Component from '@glimmer/component';
+import { inject as service } from '@ember/service';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+import { format } from 'date-fns';
+
+export default class ConfigureSocketComponent extends Component {
+ /**
+ * Inject the `router` service
+ *
+ * @var {Service}
+ * @memberof ConfigureSocketComponent
+ */
+ @service router;
+
+ /**
+ * Inject the `fetch` service
+ *
+ * @var {Service}
+ * @memberof ConfigureSocketComponent
+ */
+ @service fetch;
+
+ /**
+ * Inject the `notifications` service
+ *
+ * @var {Service}
+ * @memberof ConfigureSocketComponent
+ */
+ @service notifications;
+
+ /**
+ * Inject the `socket` service
+ *
+ * @var {Service}
+ * @memberof ConfigureSocketComponent
+ */
+ @service socket;
+
+ /**
+ * State of the test request.
+ *
+ * @memberof ConfigureSocketComponent
+ */
+ @tracked isLoading = null;
+
+ /**
+ * The response form testing the socket.
+ *
+ * @memberof ConfigureSocketComponent
+ */
+ @tracked testResponse = null;
+
+ /**
+ * Incoming events logged from test socket channel.
+ *
+ * @memberof ConfigureSocketComponent
+ */
+ @tracked events = [];
+
+ /**
+ * Date format to use for socket console events.
+ *
+ * @memberof ConfigureSocketComponent
+ */
+ consoleDateFormat = 'MMM-dd HH:mm';
+
+ /**
+ * Creates an instance of ConfigureSocketComponent.
+ * @memberof ConfigureSocketComponent
+ */
+ constructor() {
+ super(...arguments);
+ this.listenToTestSocket();
+ }
+
+ /**
+ * Send a request to test the socket connection.
+ *
+ * @memberof ConfigureSocketComponent
+ */
+ @action testSocketConnection() {
+ this.isLoading = true;
+
+ this.fetch
+ .post('settings/test-socket', {
+ channel: 'test',
+ })
+ .then((response) => {
+ this.testResponse = response;
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+
+ /**
+ * Opens socket and logs all incoming events.
+ *
+ * @memberof ConfigureSocketComponent
+ */
+ @action async listenToTestSocket() {
+ // Create SocketClusterClient
+ const socket = this.socket.instance();
+
+ // Listen for socket connection errors
+ (async () => {
+ // eslint-disable-next-line no-unused-vars
+ for await (let event of socket.listener('error')) {
+ // Push an event or notification for socket connection here
+ this.events.pushObject({
+ time: format(new Date(), this.consoleDateFormat),
+ content: 'Socket connection error!',
+ color: 'red',
+ });
+ }
+ })();
+
+ // Listen for socket connection
+ (async () => {
+ // eslint-disable-next-line no-unused-vars
+ for await (let event of socket.listener('connect')) {
+ // Push an event or notification for socket connection here
+ this.events.pushObject({
+ time: format(new Date(), this.consoleDateFormat),
+ content: 'Socket is connected',
+ color: 'green',
+ });
+ }
+ })();
+
+ // Listed on company channel
+ const channel = socket.subscribe('test');
+
+ // Listen for channel subscription
+ (async () => {
+ // eslint-disable-next-line no-unused-vars
+ for await (let event of channel.listener('subscribe')) {
+ // Push an event or notification for channel subscription here
+ this.events.pushObject({
+ time: format(new Date(), this.consoleDateFormat),
+ content: `Socket subscribed to test channel`,
+ color: 'blue',
+ });
+ }
+ })();
+
+ // Listen for channel subscription
+ (async () => {
+ for await (let data of channel) {
+ this.events.pushObject({
+ time: format(new Date(), this.consoleDateFormat),
+ content: JSON.stringify(data, undefined, 2),
+ color: 'green',
+ });
+ }
+ })();
+
+ // disconnect when transitioning
+ this.router.on('routeWillChange', () => {
+ channel.close();
+ this.events = [];
+ });
+ }
+}
diff --git a/console/app/components/dashboard.hbs b/console/app/components/dashboard.hbs
new file mode 100644
index 00000000..24efba6e
--- /dev/null
+++ b/console/app/components/dashboard.hbs
@@ -0,0 +1,7 @@
+<div class="fleetbase-dashboard-grid">
+ <div class="grid grid-cols-1 md:grid-cols-12 gap-4">
+ {{#each this.dashboards as |dashboard index|}}
+ <Dashboard::Create @index={{index}} @dashboard={{dashboard}} />
+ {{/each}}
+ </div>
+</div>
\ No newline at end of file
diff --git a/console/app/components/dashboard.js b/console/app/components/dashboard.js
new file mode 100644
index 00000000..68e988e1
--- /dev/null
+++ b/console/app/components/dashboard.js
@@ -0,0 +1,48 @@
+import Component from '@glimmer/component';
+import loadExtensions from '@fleetbase/ember-core/utils/load-extensions';
+import { inject as service } from '@ember/service';
+import { action } from '@ember/object';
+import { isArray } from '@ember/array';
+import { tracked } from '@glimmer/tracking';
+import { task } from 'ember-concurrency-decorators';
+
+export default class DashboardComponent extends Component {
+ @service fetch;
+ @tracked extensions;
+ @tracked dashboards = [];
+ @tracked isLoading;
+
+ constructor() {
+ super(...arguments);
+ this.loadExtensions();
+ }
+
+ @action async loadExtensions() {
+ this.extensions = await loadExtensions();
+ this.loadDashboardBuilds.perform();
+ }
+
+ @task *loadDashboard(extension) {
+ this.isLoading = extension.extension;
+ let dashboardBuild;
+
+ try {
+ dashboardBuild = yield this.fetch.get(extension.fleetbase.dashboard, {}, { namespace: '' });
+ } catch {
+ return;
+ }
+
+ if (isArray(dashboardBuild)) {
+ this.dashboards = [...this.dashboards, ...dashboardBuild.map((build) => ({ ...build, extension }))];
+ }
+ }
+
+ @task({ enqueue: true, maxConcurrency: 1 }) *loadDashboardBuilds() {
+ const extensionsWithDashboards = this.extensions.filter((extension) => typeof extension.fleetbase?.dashboard === 'string');
+
+ for (let i = 0; i < extensionsWithDashboards.length; i++) {
+ const extension = extensionsWithDashboards[i];
+ yield this.loadDashboard.perform(extension);
+ }
+ }
+}
diff --git a/console/app/components/dashboard/count.hbs b/console/app/components/dashboard/count.hbs
new file mode 100644
index 00000000..fc501018
--- /dev/null
+++ b/console/app/components/dashboard/count.hbs
@@ -0,0 +1,6 @@
+<div class="dashboard-component-count lg:col-span-2">
+ <h3 class="text-sm dark:text-gray-100 text-black mb-4">{{@options.title}}</h3>
+ <h1 class="text-3xl font-bold dark:text-gray-100 text-black mb-4">
+ {{this.displayValue}}
+ </h1>
+</div>
\ No newline at end of file
diff --git a/console/app/components/dashboard/count.js b/console/app/components/dashboard/count.js
new file mode 100644
index 00000000..c1af1cb9
--- /dev/null
+++ b/console/app/components/dashboard/count.js
@@ -0,0 +1,43 @@
+import Component from '@glimmer/component';
+import { computed } from '@ember/object';
+import formatCurrency from '@fleetbase/ember-ui/utils/format-currency';
+import formatMeters from '@fleetbase/ember-ui/utils/format-meters';
+import formatBytes from '@fleetbase/ember-ui/utils/format-bytes';
+import formatDuration from '@fleetbase/ember-ui/utils/format-duration';
+import formatDate from '@fleetbase/ember-ui/utils/format-date';
+
+export default class DashboardCountComponent extends Component {
+ @computed('args.options.{currency,dateFormat,format,value}') get displayValue() {
+ let format = this.args.options?.format;
+ let currency = this.args.options?.currency;
+ let dateFormat = this.args.options?.dateFormat;
+ let value = this.args.options?.value;
+
+ switch (format) {
+ case 'money':
+ value = formatCurrency([value, currency]);
+ break;
+
+ case 'meters':
+ value = formatMeters([value]);
+ break;
+
+ case 'bytes':
+ value = formatBytes([value]);
+ break;
+
+ case 'duration':
+ value = formatDuration([value]);
+ break;
+
+ case 'date':
+ value = formatDate([value, dateFormat]);
+ break;
+
+ default:
+ break;
+ }
+
+ return value;
+ }
+}
diff --git a/console/app/components/dashboard/create.hbs b/console/app/components/dashboard/create.hbs
new file mode 100644
index 00000000..64a7df6d
--- /dev/null
+++ b/console/app/components/dashboard/create.hbs
@@ -0,0 +1,18 @@
+<div class="col-span-{{or @dashboard.size 12}}">
+ <div class="dashboard-title flex flex-col lg:flex-row lg:items-center">
+ <div class="flex flex-row items-center mb-2 lg:mb-0">
+ {{#if this.isLoading}}
+ <Spinner class="mr-2i" />
+ {{/if}}
+ <h2 class="text-sm font-bold dark:text-gray-100 text-black">{{@dashboard.title}}</h2>
+ </div>
+ <div>
+ <Dashboard::QueryParams @params={{@dashboard.queryParams}} @onChange={{this.onQueryParamsChanged}} />
+ </div>
+ </div>
+ <div class="grid grid-cols-2 lg:grid-cols-12 gap-4">
+ {{#each this.dashboard.widgets as |widget|}}
+ {{component (concat "dashboard/" widget.component) options=widget.options}}
+ {{/each}}
+ </div>
+</div>
\ No newline at end of file
diff --git a/console/app/components/dashboard/create.js b/console/app/components/dashboard/create.js
new file mode 100644
index 00000000..c4484676
--- /dev/null
+++ b/console/app/components/dashboard/create.js
@@ -0,0 +1,41 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { inject as service } from '@ember/service';
+import { action } from '@ember/object';
+import { isArray } from '@ember/array';
+import { task } from 'ember-concurrency-decorators';
+
+export default class DashboardCreateComponent extends Component {
+ @service fetch;
+ @tracked isLoading = false;
+ @tracked dashboard;
+
+ constructor() {
+ super(...arguments);
+ this.dashboard = this.args.dashboard;
+ }
+
+ @action onQueryParamsChanged(changedParams) {
+ this.reloadDashboard.perform(changedParams);
+ }
+
+ @task *reloadDashboard(params) {
+ const { extension } = this.args.dashboard;
+ const index = this.args.index;
+ let dashboards = [];
+
+ this.isLoading = true;
+
+ try {
+ dashboards = yield this.fetch.get(extension.fleetbase.dashboard, params, { namespace: '' });
+ } catch {
+ return;
+ }
+
+ this.isLoading = false;
+
+ if (isArray(dashboards)) {
+ this.dashboard = dashboards.objectAt(index);
+ }
+ }
+}
diff --git a/console/app/components/dashboard/query-params.hbs b/console/app/components/dashboard/query-params.hbs
new file mode 100644
index 00000000..77cf6ed7
--- /dev/null
+++ b/console/app/components/dashboard/query-params.hbs
@@ -0,0 +1,8 @@
+<div class="flex flex-row items-center space-x-3" ...attributes>
+ {{#each-in @params as |param options|}}
+ <div class="flex flex-col lg:flex-row lg:items-center">
+ <label class="hidden lg:flex mr-2 text-sm">{{humanize param}}:</label>
+ {{component options.component onChange=(fn this.onChange param) placeholder=(humanize param) class="form-input-sm"}}
+ </div>
+ {{/each-in}}
+</div>
\ No newline at end of file
diff --git a/console/app/components/dashboard/query-params.js b/console/app/components/dashboard/query-params.js
new file mode 100644
index 00000000..8f1692bb
--- /dev/null
+++ b/console/app/components/dashboard/query-params.js
@@ -0,0 +1,21 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+
+export default class DashboardQueryParamsComponent extends Component {
+ @tracked changedParams = {};
+
+ @action onChange(param, value) {
+ const component = this.args.params[param].component;
+
+ if (component === 'date-picker') {
+ value = value.formattedDate;
+ }
+
+ this.changedParams = { ...this.changedParams, [param]: value };
+
+ if (typeof this.args.onChange === 'function') {
+ this.args.onChange(this.changedParams);
+ }
+ }
+}
diff --git a/console/app/components/fleetbase-blog.hbs b/console/app/components/fleetbase-blog.hbs
new file mode 100644
index 00000000..de565412
--- /dev/null
+++ b/console/app/components/fleetbase-blog.hbs
@@ -0,0 +1,27 @@
+<div class="fleetbase-blog" ...attributes>
+ <div class="border dark:border-gray-700 border-gray-200 dark:bg-gray-800 bg-gray-50 rounded-lg shadow-sm flex flex-col">
+ <div class="flex flex-row items-center justify-between rounded-t-lg px-4 py-2 border-b border-gray-200 dark:border-gray-700">
+ <span class="text-base font-bold text-black dark:text-gray-100">Fleetbase Blog</span>
+ <a href="https://www.fleetbase.io/blog" target="_blog" class="flex flex-row items-center text-sm">
+ <FaIcon @icon="arrow-up-right-from-square" @size="xs" class="mr-2" />
+ <span>Visit Blog</span>
+ </a>
+ </div>
+ <div class="px-4 py-2.5">
+ {{#if this.isLoading}}
+ <Spinner />
+ {{else}}
+ <ul class="space-y-2">
+ {{#each this.posts as |post|}}
+ <li class="text-sm flex flex-col lg:flex-row">
+ <a href={{post.link}} target="_blog" class="text-black truncate max-w-lg dark:text-gray-200">
+ <span class="truncate">{{post.title}}</span>
+ </a>
+ <span class="ml-1 text-gray-900 dark:text-gray-400">- {{post.pubDate}}</span>
+ </li>
+ {{/each}}
+ </ul>
+ {{/if}}
+ </div>
+ </div>
+</div>
\ No newline at end of file
diff --git a/console/app/components/fleetbase-blog.js b/console/app/components/fleetbase-blog.js
new file mode 100644
index 00000000..a25d722d
--- /dev/null
+++ b/console/app/components/fleetbase-blog.js
@@ -0,0 +1,28 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { inject as service } from '@ember/service';
+import { action } from '@ember/object';
+
+export default class FleetbaseBlogComponent extends Component {
+ @service fetch;
+ @tracked posts = [];
+ @tracked isLoading = false;
+
+ constructor() {
+ super(...arguments);
+ this.loadBlogPosts();
+ }
+
+ @action loadBlogPosts() {
+ this.isLoading = true;
+
+ return this.fetch
+ .get('lookup/fleetbase-blog')
+ .then((response) => {
+ this.posts = response;
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+}
diff --git a/console/app/components/github-card.hbs b/console/app/components/github-card.hbs
new file mode 100644
index 00000000..26d15c73
--- /dev/null
+++ b/console/app/components/github-card.hbs
@@ -0,0 +1,49 @@
+<div class="fleetbase-github-card relative flex-1 w-full" ...attributes>
+ <div class="border dark:border-gray-700 border-gray-200 dark:bg-gray-800 bg-gray-50 rounded-lg shadow-sm flex flex-col">
+ {{#if this.isLoading}}
+ <div class="p-4">
+ <Spinner />
+ </div>
+ {{else}}
+ <div class="flex flex-row p-4 border-b dark:border-gray-700 border-gray-200">
+ <div class="w-12 flex-shrink-0"><img src={{this.data.owner.avatar_url}} alt="fleetbase/fleetbase" class="rounded-full w-8 h-8" width="32" height="32" /></div>
+ <div class="flex-1 -mt-2">
+ <div class="flex flex-1 flex-row items-center justify-between mb-2">
+ <a href={{this.data.html_url}} target="_github" class="dark:text-gray-100 text-black text-lg font-semibold">{{this.data.full_name}}</a>
+ <a href={{this.data.html_url}} target="_github" class="btn btn-xs btn-default">
+ <FaIcon @icon="star" class="text-yellow-400" />
+ <span class="hidden lg:flex ml-2.5">Star on Github</span>
+ </a>
+ </div>
+ <p class="dark:text-gray-100 text-black text-sm">{{this.data.description}}</p>
+ <div class="flex-grow-0 flex mt-2">
+ <a href={{this.releaseUrl}} class="rounded-lg px-2 py-1 flex flex-row items-center text-xs text-white font-bold font-mono">
+ <FaIcon @icon="arrow-up-right-from-square" @size="xs" class="mr-2" />
+ <span>Latest Release: {{this.latestRelease.name}}</span>
+ </a>
+ </div>
+ </div>
+ </div>
+ <div class="rounded-b-lg px-4 py-2">
+ <div class="grid grid-cols-12 gap-2">
+ <div class="col-span-3 dark:text-gray-100 text-black text-xs flex flex-row">
+ <span class="font-bold mr-1">{{this.data.stargazers_count}}</span>
+ <span>Stars</span>
+ </div>
+ <div class="col-span-3 dark:text-gray-100 text-black text-xs flex flex-row">
+ <span class="font-bold mr-1">{{this.data.subscribers_count}}</span>
+ <span>Watchers</span>
+ </div>
+ <div class="col-span-3 dark:text-gray-100 text-black text-xs flex flex-row">
+ <span class="font-bold mr-1">{{this.data.forks_count}}</span>
+ <span>Forks</span>
+ </div>
+ <div class="col-span-3 dark:text-gray-100 text-black text-xs flex flex-row">
+ <span class="font-bold mr-1">{{this.data.open_issues_count}}</span>
+ <span><span class="hidden lg:inline-flex">Open</span> Issues</span>
+ </div>
+ </div>
+ </div>
+ {{/if}}
+ </div>
+</div>
\ No newline at end of file
diff --git a/console/app/components/github-card.js b/console/app/components/github-card.js
new file mode 100644
index 00000000..622041fc
--- /dev/null
+++ b/console/app/components/github-card.js
@@ -0,0 +1,58 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { action, computed } from '@ember/object';
+import { isArray } from '@ember/array';
+import { isBlank } from '@ember/utils';
+import fetch from 'fetch';
+
+export default class GithubCardComponent extends Component {
+ @tracked data;
+ @tracked tags;
+ @tracked isLoading = false;
+
+ @computed('tags.length') get latestRelease() {
+ if (isArray(this.tags) && this.tags.length) {
+ return this.tags[0];
+ }
+
+ return { name: 'v0.0.1' };
+ }
+
+ @computed('data.releases_url', 'latestRelease.name') get releaseUrl() {
+ let url = 'https://github.com/fleetbase/fleetbase/releases';
+
+ if (!isBlank(this.latestRelease?.name)) {
+ url += '/tag/' + this.latestRelease.name;
+ }
+
+ return url;
+ }
+
+ constructor() {
+ super(...arguments);
+ this.loadRepositoryData();
+ this.loadRepositoryTags();
+ }
+
+ @action loadRepositoryData() {
+ this.isLoading = true;
+
+ return fetch('https://api.github.com/repos/fleetbase/fleetbase')
+ .then((response) => {
+ return response.json().then((data) => {
+ this.data = data;
+ });
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+
+ @action loadRepositoryTags() {
+ return fetch('https://api.github.com/repos/fleetbase/fleetbase/tags').then((response) => {
+ return response.json().then((data) => {
+ this.tags = data;
+ });
+ });
+ }
+}
diff --git a/console/app/controllers/.gitkeep b/console/app/controllers/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/console/app/controllers/application.js b/console/app/controllers/application.js
new file mode 100644
index 00000000..30470793
--- /dev/null
+++ b/console/app/controllers/application.js
@@ -0,0 +1,3 @@
+import Controller from '@ember/controller';
+
+export default class ApplicationController extends Controller {}
diff --git a/console/app/controllers/auth/forgot-password.js b/console/app/controllers/auth/forgot-password.js
new file mode 100644
index 00000000..08a41315
--- /dev/null
+++ b/console/app/controllers/auth/forgot-password.js
@@ -0,0 +1,68 @@
+import Controller from '@ember/controller';
+import { inject as service } from '@ember/service';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+
+export default class AuthForgotPasswordController extends Controller {
+ /**
+ * Inject the `fetch` service
+ *
+ * @memberof AuthForgotPasswordController
+ */
+ @service fetch;
+
+ /**
+ * Inject the `notifications` service
+ *
+ * @memberof AuthForgotPasswordController
+ */
+ @service notifications;
+
+ /**
+ * The email variable
+ *
+ * @memberof AuthForgotPasswordController
+ */
+ @tracked email;
+
+ /**
+ * The loading state
+ *
+ * @memberof AuthForgotPasswordController
+ */
+ @tracked isLoading;
+
+ /**
+ * Indicator if request has been sent.
+ *
+ * @memberof AuthForgotPasswordController
+ */
+ @tracked isSent = false;
+
+ /**
+ * Sends a secure magic reset link to the user provided email.
+ *
+ * @memberof AuthForgotPasswordController
+ */
+ @action sendSecureLink(event) {
+ // firefox patch
+ event.preventDefault();
+
+ const { email } = this;
+
+ this.isLoading = true;
+
+ this.fetch
+ .post('auth/get-magic-reset-link', { email })
+ .then(() => {
+ this.notifications.success('Check your email to continue!');
+ this.isSent = true;
+ })
+ .catch((error) => {
+ this.notifications.serverError(error);
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+}
diff --git a/console/app/controllers/auth/login.js b/console/app/controllers/auth/login.js
new file mode 100644
index 00000000..cc43fd58
--- /dev/null
+++ b/console/app/controllers/auth/login.js
@@ -0,0 +1,207 @@
+import Controller, { inject as controller } from '@ember/controller';
+import { inject as service } from '@ember/service';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+import pathToRoute from '@fleetbase/ember-core/utils/path-to-route';
+
+export default class AuthLoginController extends Controller {
+ /**
+ * Inject the `forgotPassword` controller
+ *
+ * @var {Controller}
+ */
+ @controller('auth.forgot-password') forgotPasswordController;
+
+ /**
+ * Inject the `notifications` service
+ *
+ * @var {Service}
+ */
+ @service notifications;
+
+ /**
+ * Inject the `urlSearchParams` service
+ *
+ * @var {Service}
+ */
+ @service urlSearchParams;
+
+ /**
+ * Inject the `session` service
+ *
+ * @var {Service}
+ */
+ @service session;
+
+ /**
+ * Whether or not to remember the users session
+ *
+ * @var {Boolean}
+ */
+ @tracked rememberMe = false;
+
+ /**
+ * The identity to authenticate with
+ *
+ * @var {String}
+ */
+ @tracked identity = null;
+
+ /**
+ * The password to authenticate with
+ *
+ * @var {String}
+ */
+ @tracked password = null;
+
+ /**
+ * Login is validating user input
+ *
+ * @var {Boolean}
+ */
+ @tracked isValidating = false;
+
+ /**
+ * Login is processing
+ *
+ * @var {Boolean}
+ */
+ @tracked isLoading = false;
+
+ /**
+ * If the connection or requesst it taking too long
+ *
+ * @var {Boolean}
+ */
+ @tracked isSlowConnection = false;
+
+ /**
+ * Interval to determine when to timeout the request
+ *
+ * @var {Integer}
+ */
+ @tracked timeout = null;
+
+ /**
+ * Number of failed login attempts
+ *
+ * @var {Integer}
+ */
+ @tracked failedAttempts = 0;
+
+ /**
+ * Authenticate the user
+ *
+ * @void
+ */
+ @action async login(event) {
+ // firefox patch
+ event.preventDefault();
+
+ // get user credentials
+ const { email, password, rememberMe } = this;
+
+ // start loader
+ this.set('isLoading', true);
+
+ // set where to redirect on login
+ this.setRedirect();
+
+ try {
+ await this.session.authenticate('authenticator:fleetbase', { email, password }, rememberMe);
+ } catch (error) {
+ this.failedAttempts++;
+
+ return this.failure(error);
+ }
+
+ if (this.session.isAuthenticated) {
+ this.success();
+ }
+ }
+
+ /**
+ * Transition user to onboarding screen
+ */
+ @action transitionToOnboard() {
+ return this.transitionToRoute('onboard');
+ }
+
+ /**
+ * Transition to forgot password screen, if email is set - set it.
+ */
+ @action forgotPassword() {
+ return this.transitionToRoute('auth.forgot-password').then(() => {
+ if (this.email) {
+ this.forgotPasswordController.email = this.email;
+ }
+ });
+ }
+
+ /**
+ * Sets correct route to send user to after login.
+ *
+ * @void
+ */
+ setRedirect() {
+ const shift = this.urlSearchParams.get('shift');
+
+ if (shift) {
+ this.session.setRedirect(pathToRoute(shift));
+ }
+ }
+
+ /**
+ * Handles the authentication success
+ *
+ * @void
+ */
+ success() {
+ this.reset('success');
+ }
+
+ /**
+ * Handles the authentication failure
+ *
+ * @param {String} error An error message
+ * @void
+ */
+ failure(error) {
+ this.notifications.serverError(error);
+ this.reset('error');
+ }
+
+ /**
+ * Handles the request slow connection
+ *
+ * @void
+ */
+ slowConnection() {
+ this.notifications.error('Experiencing connectivity issues.');
+ }
+
+ /**
+ * Reset the login form
+ *
+ * @param {String} type
+ * @void
+ */
+ reset(type) {
+ // reset login form state
+ this.isLoading = false;
+ this.isSlowConnection = false;
+ // reset login form state depending on type of reset
+ switch (type) {
+ case 'success':
+ this.identity = null;
+ this.password = null;
+ this.isValidating = false;
+ break;
+ case 'error':
+ case 'fail':
+ this.password = null;
+ break;
+ }
+ // clearTimeout(this.timeout);
+ }
+}
diff --git a/console/app/controllers/auth/reset-password.js b/console/app/controllers/auth/reset-password.js
new file mode 100644
index 00000000..672bbbd6
--- /dev/null
+++ b/console/app/controllers/auth/reset-password.js
@@ -0,0 +1,77 @@
+import Controller from '@ember/controller';
+import { inject as service } from '@ember/service';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+
+export default class AuthResetPasswordController extends Controller {
+ /**
+ * Inject the `fetch` service
+ *
+ * @memberof AuthResetPasswordController
+ */
+ @service fetch;
+
+ /**
+ * Inject the `notifications` service
+ *
+ * @memberof AuthResetPasswordController
+ */
+ @service notifications;
+
+ /**
+ * The code param.
+ *
+ * @memberof AuthResetPasswordController
+ */
+ @tracked code;
+
+ /**
+ * Users new password.
+ *
+ * @memberof AuthResetPasswordController
+ */
+ @tracked password;
+
+ /**
+ * Users new password confirmation.
+ *
+ * @memberof AuthResetPasswordController
+ */
+ @tracked password_confirmation;
+
+ /**
+ * Loading stae of password reset.
+ *
+ * @memberof AuthResetPasswordController
+ */
+ @tracked isLoading;
+
+ /**
+ * The reset password action.
+ *
+ * @memberof AuthResetPasswordController
+ */
+ @action resetPassword(event) {
+ // firefox patch
+ event.preventDefault();
+
+ const { code, password, password_confirmation } = this;
+ const { id } = this.model;
+
+ this.isLoading = true;
+
+ this.fetch
+ .post('auth/reset-password', { link: id, code, password, password_confirmation })
+ .then(() => {
+ this.notifications.success('Your password has been reset! Login to continue.');
+
+ return this.transitionToRoute('auth.login');
+ })
+ .catch((error) => {
+ this.notifications.serverError(error);
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+}
diff --git a/console/app/controllers/console.js b/console/app/controllers/console.js
new file mode 100644
index 00000000..27c76497
--- /dev/null
+++ b/console/app/controllers/console.js
@@ -0,0 +1,257 @@
+import Controller from '@ember/controller';
+import { tracked } from '@glimmer/tracking';
+import { inject as service } from '@ember/service';
+import { getOwner } from '@ember/application';
+import { later } from '@ember/runloop';
+import { action, computed } from '@ember/object';
+import { alias } from '@ember/object/computed';
+import { isArray } from '@ember/array';
+import first from '@fleetbase/ember-core/utils/first';
+
+export default class ConsoleController extends Controller {
+ /**
+ * Inject the `currentUser` service.
+ *
+ * @var {Service}
+ */
+ @service currentUser;
+
+ /**
+ * Inject the `modalsManager` service.
+ *
+ * @var {Service}
+ */
+ @service modalsManager;
+
+ /**
+ * Inject the `session` service.
+ *
+ * @var {Service}
+ */
+ @service session;
+
+ /**
+ * Inject the `fetch` service.
+ *
+ * @var {Service}
+ */
+ @service fetch;
+
+ /**
+ * Inject the `notifications` service.
+ *
+ * @var {Service}
+ */
+ @service notifications;
+
+ /**
+ * Inject the `router` service.
+ *
+ * @var {Service}
+ */
+ @service router;
+
+ /**
+ * Inject the `universe` service.
+ *
+ * @var {Service}
+ */
+ @service universe;
+
+ /**
+ * Authenticated user organizations.
+ *
+ * @var {Array}
+ */
+ @tracked organizations = [];
+
+ /**
+ * Whether or not to hide the sidebar.
+ *
+ * @var {Boolean}
+ */
+ @tracked hideSidebar = true;
+
+ /**
+ * Sidebar Context Controls
+ *
+ * @var {SidebarContext}
+ */
+ @tracked sidebarContext;
+
+ /**
+ * Installed extensions.
+ *
+ * @var {Array}
+ */
+ @computed() get extensions() {
+ return getOwner(this).application.extensions;
+ }
+
+ /**
+ * Get the currently authenticated user
+ *
+ * @var {Model}
+ */
+ @alias('currentUser.user') user;
+
+ /**
+ * Creates an instance of ConsoleController.
+ * @memberof ConsoleController
+ */
+ constructor() {
+ super(...arguments);
+
+ this.router.on('routeDidChange', (transition) => {
+ if (this.sidebarContext) {
+ if (transition.to.name === 'console.home' || transition.to.name === 'console.extensions') {
+ this.sidebarContext.hideNow();
+ } else {
+ this.sidebarContext.show();
+ }
+ }
+ });
+ }
+
+ /**
+ * Sets the sidebar context
+ *
+ * @param {SidebarContext} sidebarContext
+ * @memberof ConsoleController
+ */
+ @action setSidebarContext(sidebarContext) {
+ this.sidebarContext = sidebarContext;
+ this.universe.sidebarContext = sidebarContext;
+
+ if (this.router.currentRouteName === 'console.home' || this.router.currentRouteName === 'console.extensions') {
+ this.sidebarContext.hideNow();
+ }
+ }
+
+ /**
+ * Action handler.
+ *
+ * @void
+ */
+ @action onAction(action, ...params) {
+ if (typeof this[action] === 'function') {
+ this[action](...params);
+ }
+ }
+
+ /**
+ * Action to invalidate and log user out
+ *
+ * @void
+ */
+ @action invalidateSession(noop, event) {
+ event.preventDefault();
+ this.session.invalidateWithLoader();
+ }
+
+ /**
+ * Action to invalidate and log user out
+ *
+ * @void
+ */
+ @action createOrJoinOrg() {
+ const currency = this.currentUser.currency;
+ const country = this.currentUser.country;
+
+ this.modalsManager.show('modals/create-or-join-org', {
+ title: 'Create or join a organization',
+ acceptButtonText: 'Confirm',
+ acceptButtonIcon: 'check',
+ acceptButtonIconPrefix: 'fas',
+ action: 'join',
+ next: null,
+ name: null,
+ decription: null,
+ phone: null,
+ currency,
+ country,
+ timezone: null,
+ changeAction: (action) => {
+ this.modalsManager.setOption('action', action);
+ },
+ confirm: (modal) => {
+ modal.startLoading();
+
+ const { action, next, name, description, phone, currency, country, timezone } = modal.getOptions();
+
+ if (action === 'join') {
+ return this.fetch.post('auth/join-organization', { next }).then(() => {
+ this.fetch.flushRequestCache('auth/organizations');
+ this.notifications.success('You have joined a new organization!');
+ setTimeout(() => {
+ window.location.reload();
+ }, 900);
+ });
+ }
+
+ return this.fetch
+ .post('auth/create-organization', {
+ name,
+ description,
+ phone,
+ currency,
+ country,
+ timezone,
+ })
+ .then(() => {
+ this.fetch.flushRequestCache('auth/organizations');
+ this.notifications.success('You have created a new organization!');
+ later(
+ this,
+ () => {
+ window.location.reload();
+ },
+ 900
+ );
+ });
+ },
+ });
+ }
+
+ /**
+ * Confirm prompt for user to switch organization
+ *
+ * @void
+ */
+ @action switchOrganization(organization) {
+ if (isArray(organization)) {
+ organization = first(organization);
+ }
+
+ this.modalsManager.confirm({
+ title: `Are you sure you want to switch organization to ${organization.name}?`,
+ body: `By confirming your account will remain logged in, but your primary organization will be switched.`,
+ acceptButtonText: `Yes, I want to switch organization`,
+ acceptButtonScheme: 'primary',
+ confirm: (modal) => {
+ modal.startLoading();
+
+ return this.fetch
+ .post('auth/switch-organization', { next: organization.uuid })
+ .then(() => {
+ this.fetch.flushRequestCache('auth/organizations');
+ this.notifications.success('You have switched organizations');
+ setTimeout(() => {
+ window.location.reload();
+ }, 900);
+ })
+ .catch((error) => {
+ this.notifications.serverError(error);
+ });
+ },
+ });
+ }
+
+ @action viewChangelog() {
+ this.modalsManager.show('modals/changelog', {
+ title: 'Changelog',
+ acceptButtonText: 'OK',
+ hideDeclineButton: true,
+ });
+ }
+}
diff --git a/console/app/controllers/console/account.js b/console/app/controllers/console/account.js
new file mode 100644
index 00000000..241adaa9
--- /dev/null
+++ b/console/app/controllers/console/account.js
@@ -0,0 +1,6 @@
+import Controller from '@ember/controller';
+import { inject as service } from '@ember/service';
+
+export default class ConsoleAccountController extends Controller {
+ @service universe;
+}
diff --git a/console/app/controllers/console/account/index.js b/console/app/controllers/console/account/index.js
new file mode 100644
index 00000000..93a54ea0
--- /dev/null
+++ b/console/app/controllers/console/account/index.js
@@ -0,0 +1,92 @@
+import Controller from '@ember/controller';
+import { tracked } from '@glimmer/tracking';
+import { inject as service } from '@ember/service';
+import { action } from '@ember/object';
+import { alias } from '@ember/object/computed';
+
+export default class ConsoleAccountIndexController extends Controller {
+ /**
+ * Inject the `currentUser` service.
+ *
+ * @memberof ConsoleAccountIndexController
+ */
+ @service currentUser;
+
+ /**
+ * Inject the `fetch` service.
+ *
+ * @memberof ConsoleAccountIndexController
+ */
+ @service fetch;
+ /**
+ * Inject the `notifications` service.
+ *
+ * @memberof ConsoleAccountIndexController
+ */
+ @service notifications;
+
+ /**
+ * The loading state of request.
+ *
+ * @memberof ConsoleAccountIndexController
+ */
+ @tracked isLoading = false;
+
+ /**
+ * Alias to the currentUser service user record.
+ *
+ * @memberof ConsoleAccountIndexController
+ */
+ @alias('currentUser.user') user;
+
+ /**
+ * Handle upload of new photo
+ *
+ * @param {UploadFile} file
+ * @memberof ConsoleAccountIndexController
+ */
+ @action uploadNewPhoto(file) {
+ return this.fetch.uploadFile.perform(
+ file,
+ {
+ path: `uploads/${this.user.company_uuid}/users/${this.user.slug}`,
+ key_uuid: this.user.id,
+ key_type: `user`,
+ type: `user_avatar`,
+ },
+ (uploadedFile) => {
+ this.user.setProperties({
+ avatar_uuid: uploadedFile.id,
+ avatar_url: uploadedFile.url,
+ });
+
+ return this.user.save();
+ }
+ );
+ }
+
+ /**
+ * Save the Profile settings.
+ *
+ * @return {Promise}
+ * @memberof ConsoleAccountIndexController
+ */
+ @action saveProfile() {
+ const user = this.user;
+
+ this.isLoading = true;
+
+ return user
+ .save()
+ .then((user) => {
+ this.notifications.success('Profile changes saved.');
+ this.currentUser.set('user', user);
+ })
+ .catch((error) => {
+ this.notifications.serverError(error);
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+}
diff --git a/console/app/controllers/console/admin.js b/console/app/controllers/console/admin.js
new file mode 100644
index 00000000..7ef27853
--- /dev/null
+++ b/console/app/controllers/console/admin.js
@@ -0,0 +1,6 @@
+import Controller from '@ember/controller';
+import { inject as service } from '@ember/service';
+
+export default class ConsoleAdminController extends Controller {
+ @service universe;
+}
diff --git a/console/app/controllers/console/admin/branding.js b/console/app/controllers/console/admin/branding.js
new file mode 100644
index 00000000..00fb1f94
--- /dev/null
+++ b/console/app/controllers/console/admin/branding.js
@@ -0,0 +1,127 @@
+import Controller from '@ember/controller';
+import { tracked } from '@glimmer/tracking';
+import { inject as service } from '@ember/service';
+import { action } from '@ember/object';
+
+export default class ConsoleAdminBrandingController extends Controller {
+ /**
+ * Inject the `fetch` service.
+ *
+ * @memberof ConsoleAdminBrandingController
+ */
+ @service fetch;
+
+ /**
+ * Inject the `notifications` service.
+ *
+ * @memberof ConsoleAdminBrandingController
+ */
+ @service notifications;
+
+ /**
+ * Inject the `theme` service.
+ *
+ * @memberof ConsoleAdminBrandingController
+ */
+ @service theme;
+
+ /**
+ * Status of loading process.
+ *
+ * @memberof ConsoleAdminBrandingController
+ */
+ @tracked isLoading = false;
+
+ /**
+ * Theme options.
+ *
+ * @memberof ConsoleAdminBrandingController
+ */
+ @tracked themeOptions = ['light', 'dark'];
+
+ /**
+ * Set the default theme
+ *
+ * @param {String} theme
+ * @memberof ConsoleAdminBrandingController
+ */
+ @action setTheme(theme) {
+ this.model.default_theme = theme;
+ this.theme.setTheme(theme);
+ }
+
+ /**
+ * Unset a branding settings
+ *
+ * @param {String} key
+ * @memberof ConsoleAdminBrandingController
+ */
+ @action unset(key, newValue = null) {
+ this.model[key] = newValue;
+ }
+
+ /**
+ * Save branding settings.
+ *
+ * @return {Promise}
+ * @memberof ConsoleAdminBrandingController
+ */
+ @action save() {
+ this.isLoading = true;
+
+ return this.model
+ .save()
+ .then(() => {
+ this.notifications.success('Branding settings saved.');
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+
+ /**
+ * Handle upload of new console icon
+ *
+ * @param {UploadFile} file
+ * @memberof ConsoleAccountIndexController
+ */
+ @action uploadIcon(file) {
+ this.isLoading = true;
+
+ return this.fetch.uploadFile.perform(
+ file,
+ {
+ path: `uploads/system`,
+ type: `system`,
+ },
+ (uploadedFile) => {
+ this.model.icon_uuid = uploadedFile.id;
+ this.model.icon_url = uploadedFile.url;
+ this.isLoading = false;
+ }
+ );
+ }
+
+ /**
+ * Handle upload of new console logo
+ *
+ * @param {UploadFile} file
+ * @memberof ConsoleAccountIndexController
+ */
+ @action uploadLogo(file) {
+ this.isLoading = true;
+
+ return this.fetch.uploadFile.perform(
+ file,
+ {
+ path: `uploads/system`,
+ type: `system`,
+ },
+ (uploadedFile) => {
+ this.model.logo_uuid = uploadedFile.id;
+ this.model.logo_url = uploadedFile.url;
+ this.isLoading = false;
+ }
+ );
+ }
+}
diff --git a/console/app/controllers/console/admin/config/cache.js b/console/app/controllers/console/admin/config/cache.js
new file mode 100644
index 00000000..bb52bb91
--- /dev/null
+++ b/console/app/controllers/console/admin/config/cache.js
@@ -0,0 +1,3 @@
+import Controller from '@ember/controller';
+
+export default class ConsoleAdminConfigCacheController extends Controller {}
diff --git a/console/app/controllers/console/admin/config/database.js b/console/app/controllers/console/admin/config/database.js
new file mode 100644
index 00000000..1dba85d2
--- /dev/null
+++ b/console/app/controllers/console/admin/config/database.js
@@ -0,0 +1,3 @@
+import Controller from '@ember/controller';
+
+export default class ConsoleAdminConfigDatabaseController extends Controller {}
diff --git a/console/app/controllers/console/admin/config/filesystem.js b/console/app/controllers/console/admin/config/filesystem.js
new file mode 100644
index 00000000..1fb079b1
--- /dev/null
+++ b/console/app/controllers/console/admin/config/filesystem.js
@@ -0,0 +1,3 @@
+import Controller from '@ember/controller';
+
+export default class ConsoleAdminConfigFilesystemController extends Controller {}
diff --git a/console/app/controllers/console/admin/config/mail.js b/console/app/controllers/console/admin/config/mail.js
new file mode 100644
index 00000000..98a6ca91
--- /dev/null
+++ b/console/app/controllers/console/admin/config/mail.js
@@ -0,0 +1,3 @@
+import Controller from '@ember/controller';
+
+export default class ConsoleAdminConfigMailController extends Controller {}
diff --git a/console/app/controllers/console/admin/config/notification-channels.js b/console/app/controllers/console/admin/config/notification-channels.js
new file mode 100644
index 00000000..296c91a2
--- /dev/null
+++ b/console/app/controllers/console/admin/config/notification-channels.js
@@ -0,0 +1,3 @@
+import Controller from '@ember/controller';
+
+export default class ConsoleAdminConfigNotificationChannelsController extends Controller {}
diff --git a/console/app/controllers/console/admin/config/queue.js b/console/app/controllers/console/admin/config/queue.js
new file mode 100644
index 00000000..d70738bb
--- /dev/null
+++ b/console/app/controllers/console/admin/config/queue.js
@@ -0,0 +1,3 @@
+import Controller from '@ember/controller';
+
+export default class ConsoleAdminConfigQueueController extends Controller {}
diff --git a/console/app/controllers/console/admin/config/services.js b/console/app/controllers/console/admin/config/services.js
new file mode 100644
index 00000000..e505f6f8
--- /dev/null
+++ b/console/app/controllers/console/admin/config/services.js
@@ -0,0 +1,3 @@
+import Controller from '@ember/controller';
+
+export default class ConsoleAdminConfigServicesController extends Controller {}
diff --git a/console/app/controllers/console/home.js b/console/app/controllers/console/home.js
new file mode 100644
index 00000000..d877e8fd
--- /dev/null
+++ b/console/app/controllers/console/home.js
@@ -0,0 +1,3 @@
+import Controller from '@ember/controller';
+
+export default class ConsoleHomeController extends Controller {}
diff --git a/console/app/controllers/console/settings.js b/console/app/controllers/console/settings.js
new file mode 100644
index 00000000..a7684b58
--- /dev/null
+++ b/console/app/controllers/console/settings.js
@@ -0,0 +1,6 @@
+import Controller from '@ember/controller';
+import { inject as service } from '@ember/service';
+
+export default class ConsoleSettingsController extends Controller {
+ @service universe;
+}
diff --git a/console/app/controllers/console/settings/index.js b/console/app/controllers/console/settings/index.js
new file mode 100644
index 00000000..f98a5b67
--- /dev/null
+++ b/console/app/controllers/console/settings/index.js
@@ -0,0 +1,94 @@
+import Controller from '@ember/controller';
+import { tracked } from '@glimmer/tracking';
+import { inject as service } from '@ember/service';
+import { action } from '@ember/object';
+
+export default class ConsoleSettingsIndexController extends Controller {
+ /**
+ * Inject the `currentUser` service
+ *
+ * @memberof ConsoleSettingsIndexController
+ */
+ @service currentUser;
+
+ /**
+ * Inject the `notifications` service
+ *
+ * @memberof ConsoleSettingsIndexController
+ */
+ @service notifications;
+
+ /**
+ * Inject the `fetch` service
+ *
+ * @memberof ConsoleSettingsIndexController
+ */
+ @service fetch;
+
+ /**
+ * The request loading state.
+ *
+ * @memberof ConsoleSettingsIndexController
+ */
+ @tracked isLoading = false;
+
+ /**
+ * the upload queue.
+ *
+ * @memberof ConsoleSettingsIndexController
+ */
+ @tracked uploadQueue = [];
+
+ /**
+ * Uploaded files.
+ *
+ * @memberof ConsoleSettingsIndexController
+ */
+ @tracked uploadedFiles = [];
+
+ /**
+ * Save the organization settings.
+ *
+ * @memberof ConsoleSettingsIndexController
+ */
+ @action saveSettings(event) {
+ event.preventDefault();
+ this.isLoading = true;
+
+ this.model
+ .save()
+ .then(() => {
+ this.notifications.success('Organization changes successfully saved.');
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+
+ /**
+ * Upload file to company.
+ *
+ * @param {String} type
+ * @param {File} file
+ * @return {Promise}
+ * @memberof ConsoleSettingsIndexController
+ */
+ @action uploadFile(type, file) {
+ return this.fetch.uploadFile.perform(
+ file,
+ {
+ path: `uploads/companies/${this.currentUser.companyId}/${type}`,
+ key_uuid: this.currentUser.companyId,
+ key_type: `company`,
+ type,
+ },
+ (uploadedFile) => {
+ this.model.setProperties({
+ [`${type}_uuid`]: uploadedFile.id,
+ [`${type}_url`]: uploadedFile.url,
+ [type]: uploadedFile,
+ });
+ }
+ );
+ }
+}
diff --git a/console/app/controllers/install.js b/console/app/controllers/install.js
new file mode 100644
index 00000000..02ae88cb
--- /dev/null
+++ b/console/app/controllers/install.js
@@ -0,0 +1,101 @@
+import Controller from '@ember/controller';
+import { tracked } from '@glimmer/tracking';
+import { inject as service } from '@ember/service';
+import { action } from '@ember/object';
+import { task } from 'ember-concurrency-decorators';
+
+export default class InstallController extends Controller {
+ @service fetch;
+ @service notifications;
+ @tracked error;
+ @tracked steps = [
+ { task: 'createdb', name: 'Create Database', status: 'pending' },
+ { task: 'migrate', name: 'Run Migrations', status: 'pending' },
+ { task: 'seed', name: 'Seed Database', status: 'pending' },
+ ];
+
+ @action updateTask(task, properties = {}) {
+ const steps = [...this.steps];
+ const index = steps.findIndex((step) => step.task === task);
+
+ if (index > -1) {
+ steps[index] = { ...steps[index], ...properties };
+ }
+
+ this.steps = [...steps];
+ }
+
+ @action startInstall() {
+ this.install.perform();
+ }
+
+ @action reset(options = {}) {
+ const install = options.install === true;
+
+ this.steps.forEach((step) => {
+ this.updateTask(step.task, { status: 'pending' });
+ });
+
+ if (install) {
+ this.install.perform();
+ }
+ }
+
+ @action onInstallCompleted() {
+ const isCompleted = this.steps.every(({ status }) => status === 'completed');
+
+ if (isCompleted) {
+ this.notifications.success('Install completed successfully!');
+ return this.transitionToRoute('onboard');
+ }
+ }
+
+ @task({ enqueue: true, maxConcurrency: 1 }) *install() {
+ try {
+ yield this.createdb.perform();
+ yield this.migrate.perform();
+ yield this.seed.perform();
+ } catch (error) {
+ this.error = error;
+ return this.reset();
+ }
+
+ this.onInstallCompleted();
+ }
+
+ @task *createdb() {
+ this.updateTask('createdb', { status: 'in_progress' });
+
+ try {
+ yield this.fetch.post('installer/createdb');
+ this.updateTask('createdb', { status: 'completed' });
+ } catch (error) {
+ this.updateTask('createdb', { status: 'failed' });
+ throw error;
+ }
+ }
+
+ @task *migrate() {
+ this.updateTask('migrate', { status: 'in_progress' });
+
+ try {
+ yield this.fetch.post('installer/migrate');
+ this.updateTask('migrate', { status: 'completed' });
+ } catch (error) {
+ this.updateTask('migrate', { status: 'failed' });
+ throw error;
+ }
+ }
+
+ @task *seed() {
+ this.updateTask('seed', { status: 'in_progress' });
+
+ try {
+ yield this.fetch.post('installer/seed');
+ this.updateTask('seed', { status: 'completed' });
+ } catch (error) {
+ this.updateTask('seed', { status: 'failed' });
+ throw error;
+ }
+ }
+}
diff --git a/console/app/controllers/invite/for-user.js b/console/app/controllers/invite/for-user.js
new file mode 100644
index 00000000..0dd2291e
--- /dev/null
+++ b/console/app/controllers/invite/for-user.js
@@ -0,0 +1,57 @@
+import Controller from '@ember/controller';
+import { tracked } from '@glimmer/tracking';
+import { inject as service } from '@ember/service';
+import { action } from '@ember/object';
+
+export default class InviteForUserController extends Controller {
+ @service fetch;
+ @service session;
+ @service notifications;
+ @service modalsManager;
+ @tracked code;
+ @tracked isLoading;
+
+ @action acceptInvite() {
+ const { code } = this;
+
+ this.isLoading = true;
+
+ this.fetch
+ .post('users/accept-company-invite', { code })
+ .then((response) => {
+ this.session.manuallyAuthenticate(response.token);
+ this.notifications.success('Invitation accepted, welcome to Fleetbase!');
+
+ this.isLoading = false;
+
+ return this.transitionToRoute('console').then(() => {
+ if (response.needs_password && response.needs_password === true) {
+ this.setPassword();
+ }
+ });
+ })
+ .catch((error) => {
+ this.notifications.serverError(error);
+ this.isLoading = false;
+ });
+ }
+
+ @action setPassword() {
+ this.modalsManager.show('modals/set-password', {
+ title: 'Set a new password',
+ closeButton: false,
+ backdropClose: false,
+ hideDeclineButton: true,
+ declineButtonDisabled: true,
+ password: null,
+ password_confirmation: null,
+ confirm: (modal) => {
+ modal.startLoading();
+
+ const input = modal.getOptions(['password', 'password_confirmation']);
+
+ return this.fetch.post('users/set-password', input);
+ },
+ });
+ }
+}
diff --git a/console/app/controllers/onboard/index.js b/console/app/controllers/onboard/index.js
new file mode 100644
index 00000000..7828a867
--- /dev/null
+++ b/console/app/controllers/onboard/index.js
@@ -0,0 +1,140 @@
+import Controller from '@ember/controller';
+import { inject as service } from '@ember/service';
+import { tracked } from '@glimmer/tracking';
+import { action, getProperties } from '@ember/object';
+import OnboardValidations from '../../validations/onboard';
+import lookupValidator from 'ember-changeset-validations';
+import Changeset from 'ember-changeset';
+
+export default class OnboardIndexController extends Controller {
+ /**
+ * Inject the `fetch` service
+ *
+ * @memberof OnboardIndexController
+ */
+ @service fetch;
+
+ /**
+ * Inject the `session` service
+ *
+ * @memberof OnboardIndexController
+ */
+ @service session;
+
+ /**
+ * Inject the `notifications` service
+ *
+ * @memberof OnboardIndexController
+ */
+ @service notifications;
+
+ /**
+ * The name input field.
+ *
+ * @memberof OnboardIndexController
+ */
+ @tracked name;
+
+ /**
+ * The email input field.
+ *
+ * @memberof OnboardIndexController
+ */
+ @tracked email;
+
+ /**
+ * The phone input field.
+ *
+ * @memberof OnboardIndexController
+ */
+ @tracked phone;
+
+ /**
+ * The organization_name input field.
+ *
+ * @memberof OnboardIndexController
+ */
+ @tracked organization_name;
+
+ /**
+ * The password input field.
+ *
+ * @memberof OnboardIndexController
+ */
+ @tracked password;
+
+ /**
+ * The name password confirmation field.
+ *
+ * @memberof OnboardIndexController
+ */
+ @tracked password_confirmation;
+
+ /**
+ * The property for error message.
+ *
+ * @memberof OnboardIndexController
+ */
+ @tracked error;
+
+ /**
+ * The loading state of the onboard request.
+ *
+ * @memberof OnboardIndexController
+ */
+ @tracked isLoading = false;
+
+ /**
+ * The ready state for the form.
+ *
+ * @memberof OnboardIndexController
+ */
+ @tracked readyToSubmit = false;
+
+ /**
+ * Start the onboard process.
+ *
+ * @return {Promise}
+ * @memberof OnboardIndexController
+ */
+ @action async startOnboard(event) {
+ event.preventDefault();
+
+ // eslint-disable-next-line ember/no-get
+ const input = getProperties(this, 'name', 'email', 'phone', 'organization_name', 'password', 'password_confirmation');
+ const changeset = new Changeset(input, lookupValidator(OnboardValidations), OnboardValidations);
+
+ await changeset.validate();
+
+ if (changeset.get('isInvalid')) {
+ const errorMessage = changeset.errors.firstObject.validation.firstObject;
+
+ this.notifications.error(errorMessage);
+ return;
+ }
+
+ this.isLoading = true;
+
+ return this.fetch
+ .post('onboard/create-account', input)
+ .then((response) => {
+ if (response.status === 'success') {
+ this.session.isOnboarding().manuallyAuthenticate(response.token);
+
+ if (response.skipVerification === true) {
+ return this.transitionToRoute('console').then(() => {
+ this.notifications.success('Welcome to Fleetbase!');
+ });
+ }
+
+ return this.transitionToRoute('onboard.verify-email', { queryParams: { hello: response.session } });
+ }
+ })
+ .catch((error) => {
+ this.notifications.serverError(error);
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+}
diff --git a/console/app/controllers/onboard/verify-email.js b/console/app/controllers/onboard/verify-email.js
new file mode 100644
index 00000000..86ba8f53
--- /dev/null
+++ b/console/app/controllers/onboard/verify-email.js
@@ -0,0 +1,194 @@
+import Controller from '@ember/controller';
+import { inject as service } from '@ember/service';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+import { later } from '@ember/runloop';
+import { not } from '@ember/object/computed';
+
+export default class OnboardVerifyEmailController extends Controller {
+ /**
+ * Inject the `fetch` service
+ *
+ * @memberof OnboardIndexController
+ */
+ @service fetch;
+
+ /**
+ * Inject the `notifications` service
+ *
+ * @memberof OnboardIndexController
+ */
+ @service notifications;
+
+ /**
+ * Inject the `modalsManager` service
+ *
+ * @memberof OnboardIndexController
+ */
+ @service modalsManager;
+
+ /**
+ * Inject the `currentUser` service
+ *
+ * @memberof OnboardIndexController
+ */
+ @service currentUser;
+
+ /**
+ * The session paramerer.
+ *
+ * @memberof OnboardVerifyEmailController
+ */
+ @tracked hello;
+
+ /**
+ * The loading state of the verification request.
+ *
+ * @memberof OnboardVerifyEmailController
+ */
+ @tracked isLoading = false;
+
+ /**
+ * Validation state tracker.
+ *
+ * @memberof OnboardVerifyEmailController
+ */
+ @tracked isReadyToSubmit = false;
+
+ /**
+ * The request timeout to trigger alternative verification options.
+ *
+ * @memberof OnboardVerifyEmailController
+ */
+ @tracked waitTimeout = 800 * 60 * 2;
+
+ /**
+ * Determines if Fleetbase is still awaiting verification after a certain time.
+ *
+ * @memberof OnboardVerifyEmailController
+ */
+ @tracked stillWaiting = false;
+
+ /**
+ * the input code.
+ *
+ * @memberof OnboardVerifyEmailController
+ */
+ @tracked code;
+
+ /**
+ * The query param for the session token.
+ *
+ * @memberof OnboardVerifyEmailController
+ */
+ @tracked queryParams = ['hello'];
+
+ /**
+ * The boolean opposite of `isReadyToSubmit`
+ *
+ * @memberof OnboardVerifyEmailController
+ */
+ @not('isReadyToSubmit') isNotReadyToSubmit;
+
+ /**
+ * Creates an instance of OnboardVerifyEmailController.
+ * @memberof OnboardVerifyEmailController
+ */
+ constructor() {
+ super(...arguments);
+
+ later(
+ this,
+ () => {
+ this.stillWaiting = true;
+ },
+ this.waitTimeout
+ );
+ }
+
+ /**
+ * Validates the input
+ *
+ * @param {InputEvent} { target: { value } }
+ * @memberof OnboardVerifyEmailController
+ */
+ @action validateInput({ target: { value } }) {
+ if (value.length > 5) {
+ this.isReadyToSubmit = true;
+ } else {
+ this.isReadyToSubmit = false;
+ }
+ }
+
+ /**
+ * Submits to verify code.
+ *
+ * @return {Promise}
+ * @memberof OnboardVerifyEmailController
+ */
+ @action verifyCode() {
+ const session = this.hello;
+ const code = this.code;
+
+ this.isLoading = true;
+
+ return this.fetch
+ .post('onboard/verify-email', { session, code })
+ .then((response) => {
+ if (response.status === 'success') {
+ this.notifications.success('Email successfully verified!');
+ this.notifications.info('Welcome to Fleetbase!');
+
+ return this.transitionToRoute('console');
+ }
+ })
+ .catch((error) => {
+ this.notifications.serverError(error);
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ }
+
+ /**
+ * Action to resend verification code by SMS.
+ *
+ * @memberof OnboardVerifyEmailController
+ */
+ @action resendBySms() {
+ this.modalsManager.show('modals/verify-by-sms', {
+ title: 'Verify Account by Phone',
+ acceptButtonText: 'Send',
+ phone: this.currentUser.phone,
+ confirm: (modal) => {
+ modal.startLoading();
+ const phone = modal.getOption('phone');
+
+ return this.fetch.post('onboard/send-verification-sms', { phone }).then(() => {
+ this.notifications.success('Verification code SMS sent!');
+ });
+ },
+ });
+ }
+
+ /**
+ * Action to resend verification code by email.
+ *
+ * @memberof OnboardVerifyEmailController
+ */
+ @action resendEmail() {
+ this.modalsManager.show('modals/resend-verification-email', {
+ title: 'Resend Verification Code',
+ acceptButtonText: 'Send',
+ email: this.currentUser.email,
+ confirm: (modal) => {
+ modal.startLoading();
+ const email = modal.getOption('email');
+
+ return this.fetch.post('onboard/send-verification-email', { email }).then(() => {
+ this.notifications.success('Verification code email sent!');
+ });
+ },
+ });
+ }
+}
diff --git a/console/app/formats.js b/console/app/formats.js
new file mode 100644
index 00000000..6bfe37ea
--- /dev/null
+++ b/console/app/formats.js
@@ -0,0 +1,27 @@
+export default {
+ time: {
+ hhmmss: {
+ hour: 'numeric',
+ minute: 'numeric',
+ second: 'numeric',
+ },
+ },
+ date: {
+ hhmmss: {
+ hour: 'numeric',
+ minute: 'numeric',
+ second: 'numeric',
+ },
+ },
+ number: {
+ compact: { notation: 'compact' },
+ EUR: {
+ style: 'currency',
+ currency: 'EUR',
+ },
+ USD: {
+ style: 'currency',
+ currency: 'USD',
+ },
+ },
+};
diff --git a/console/app/helpers/.gitkeep b/console/app/helpers/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/console/app/helpers/json-pretty-print.js b/console/app/helpers/json-pretty-print.js
new file mode 100644
index 00000000..9d0fbd83
--- /dev/null
+++ b/console/app/helpers/json-pretty-print.js
@@ -0,0 +1,5 @@
+import { helper } from '@ember/component/helper';
+
+export default helper(function jsonPrettyPrint([json]) {
+ return JSON.stringify(json, null, ' ');
+});
diff --git a/console/app/index.html b/console/app/index.html
new file mode 100644
index 00000000..e099b2b8
--- /dev/null
+++ b/console/app/index.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
+ <meta name="msapplication-TileColor" content="#da532c" />
+ <meta name="theme-color" content="#ffffff" />
+ <title>Fleetbase Console</title>
+
+ {{content-for "head"}}
+
+ <link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png" />
+ <link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png" />
+ <link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png" />
+ <link rel="manifest" href="/favicon/site.webmanifest" />
+ <link rel="mask-icon" href="/favicon/safari-pinned-tab.svg" color="#5bbad5" />
+ <link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
+ <link integrity="" rel="stylesheet" href="{{rootURL}}assets/@fleetbase/console.css">
+
+ {{content-for "head-footer"}}
+ </head>
+ <body>
+ {{content-for "body"}}
+
+ <script src="{{rootURL}}assets/vendor.js"></script>
+ <script src="{{rootURL}}assets/@fleetbase/console.js"></script>
+
+ {{content-for "body-footer"}}
+ </body>
+</html>
diff --git a/console/app/initializers/initialize-random-uuid-polyfill.js b/console/app/initializers/initialize-random-uuid-polyfill.js
new file mode 100644
index 00000000..d76be33a
--- /dev/null
+++ b/console/app/initializers/initialize-random-uuid-polyfill.js
@@ -0,0 +1,121 @@
+class ERR_INVALID_ARG_TYPE extends TypeError {
+ constructor(name, type, value) {
+ super(`${name} variable is not of type ${type} (value: '${value}')`);
+ }
+
+ code = 'ERR_INVALID_ARG_TYPE';
+}
+
+function validateBoolean(value, name) {
+ if (typeof value !== 'boolean') throw new ERR_INVALID_ARG_TYPE(name, 'boolean', value);
+}
+
+function validateObject(value, name) {
+ if (value === null || Array.isArray(value) || typeof value !== 'object') {
+ throw new ERR_INVALID_ARG_TYPE(name, 'Object', value);
+ }
+}
+
+const randomFillSync = window.crypto.getRandomValues.bind(window.crypto);
+
+// Implements an RFC 4122 version 4 random UUID.
+// To improve performance, random data is generated in batches
+// large enough to cover kBatchSize UUID's at a time. The uuidData
+// and uuid buffers are reused. Each call to randomUUID() consumes
+// 16 bytes from the buffer.
+
+const kHexDigits = [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 97, 98, 99, 100, 101, 102];
+const kBatchSize = 128;
+let uuidData;
+let uuidNotBuffered;
+let uuid;
+let uuidBatch = 0;
+
+function getBufferedUUID() {
+ if (uuidData === undefined) {
+ uuidData = new Uint8Array(16 * kBatchSize);
+ }
+
+ if (uuidBatch === 0) randomFillSync(uuidData);
+ uuidBatch = (uuidBatch + 1) % kBatchSize;
+ return uuidData.slice(uuidBatch * 16, uuidBatch * 16 + 16);
+}
+
+function randomUUID(options) {
+ if (options !== undefined) validateObject(options, 'options');
+ const { disableEntropyCache = false } = { ...options };
+
+ validateBoolean(disableEntropyCache, 'options.disableEntropyCache');
+
+ if (uuid === undefined) {
+ uuid = new Uint8Array(36);
+ uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-'.charCodeAt(0);
+ uuid[14] = 52; // '4', identifies the UUID version
+ }
+
+ let uuidBuf;
+ if (!disableEntropyCache) {
+ uuidBuf = getBufferedUUID();
+ } else {
+ uuidBuf = uuidNotBuffered;
+ if (uuidBuf === undefined) uuidBuf = uuidNotBuffered = new Uint8Array(16);
+ randomFillSync(uuidBuf);
+ }
+
+ // Variant byte: 10xxxxxx (variant 1)
+ uuidBuf[8] = (uuidBuf[8] & 0x3f) | 0x80;
+
+ // This function is structured the way it is for performance.
+ // The uuid buffer stores the serialization of the random
+ // bytes from uuidData.
+ // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+ let n = 0;
+ uuid[0] = kHexDigits[uuidBuf[n] >> 4];
+ uuid[1] = kHexDigits[uuidBuf[n++] & 0xf];
+ uuid[2] = kHexDigits[uuidBuf[n] >> 4];
+ uuid[3] = kHexDigits[uuidBuf[n++] & 0xf];
+ uuid[4] = kHexDigits[uuidBuf[n] >> 4];
+ uuid[5] = kHexDigits[uuidBuf[n++] & 0xf];
+ uuid[6] = kHexDigits[uuidBuf[n] >> 4];
+ uuid[7] = kHexDigits[uuidBuf[n++] & 0xf];
+ // -
+ uuid[9] = kHexDigits[uuidBuf[n] >> 4];
+ uuid[10] = kHexDigits[uuidBuf[n++] & 0xf];
+ uuid[11] = kHexDigits[uuidBuf[n] >> 4];
+ uuid[12] = kHexDigits[uuidBuf[n++] & 0xf];
+ // -
+ // 4, uuid[14] is set already...
+ uuid[15] = kHexDigits[uuidBuf[n++] & 0xf];
+ uuid[16] = kHexDigits[uuidBuf[n] >> 4];
+ uuid[17] = kHexDigits[uuidBuf[n++] & 0xf];
+ // -
+ uuid[19] = kHexDigits[uuidBuf[n] >> 4];
+ uuid[20] = kHexDigits[uuidBuf[n++] & 0xf];
+ uuid[21] = kHexDigits[uuidBuf[n] >> 4];
+ uuid[22] = kHexDigits[uuidBuf[n++] & 0xf];
+ // -
+ uuid[24] = kHexDigits[uuidBuf[n] >> 4];
+ uuid[25] = kHexDigits[uuidBuf[n++] & 0xf];
+ uuid[26] = kHexDigits[uuidBuf[n] >> 4];
+ uuid[27] = kHexDigits[uuidBuf[n++] & 0xf];
+ uuid[28] = kHexDigits[uuidBuf[n] >> 4];
+ uuid[29] = kHexDigits[uuidBuf[n++] & 0xf];
+ uuid[30] = kHexDigits[uuidBuf[n] >> 4];
+ uuid[31] = kHexDigits[uuidBuf[n++] & 0xf];
+ uuid[32] = kHexDigits[uuidBuf[n] >> 4];
+ uuid[33] = kHexDigits[uuidBuf[n++] & 0xf];
+ uuid[34] = kHexDigits[uuidBuf[n] >> 4];
+ uuid[35] = kHexDigits[uuidBuf[n] & 0xf];
+
+ return String.fromCharCode.apply(null, uuid);
+}
+
+export function initialize() {
+ if (typeof window.crypto.randomUUID === 'undefined') {
+ window.crypto.randomUUID = randomUUID;
+ }
+}
+
+export default {
+ initialize,
+};
diff --git a/console/app/initializers/load-socketcluster-client.js b/console/app/initializers/load-socketcluster-client.js
new file mode 100644
index 00000000..63981f0c
--- /dev/null
+++ b/console/app/initializers/load-socketcluster-client.js
@@ -0,0 +1,9 @@
+export function initialize() {
+ const socketClusterClientScript = document.createElement('script');
+ socketClusterClientScript.src = '/assets/socketcluster-client.min.js';
+ document.body.appendChild(socketClusterClientScript);
+}
+
+export default {
+ initialize,
+};
diff --git a/console/app/instance-initializers/load-extensions.js b/console/app/instance-initializers/load-extensions.js
new file mode 100644
index 00000000..087b778b
--- /dev/null
+++ b/console/app/instance-initializers/load-extensions.js
@@ -0,0 +1,19 @@
+import loadExtensions from '@fleetbase/ember-core/utils/load-extensions';
+
+export function initialize(owner) {
+ const universe = owner.lookup('service:universe');
+
+ loadExtensions().then((extensions) => {
+ extensions.forEach((extension) => {
+ universe.loadEngine(extension.name).then((engineInstance) => {
+ if (engineInstance.base && engineInstance.base.setupExtension) {
+ engineInstance.base.setupExtension(owner, engineInstance, universe);
+ }
+ });
+ });
+ });
+}
+
+export default {
+ initialize,
+};
diff --git a/console/app/models/.gitkeep b/console/app/models/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/console/app/models/brand.js b/console/app/models/brand.js
new file mode 100644
index 00000000..93c47e3a
--- /dev/null
+++ b/console/app/models/brand.js
@@ -0,0 +1,13 @@
+import Model, { attr } from '@ember-data/model';
+
+export default class BrandModel extends Model {
+ /** @ids */
+ @attr('string') uuid;
+ @attr('string') logo_uuid;
+ @attr('string') icon_uuid;
+
+ /** @attributes */
+ @attr('string') default_theme;
+ @attr('string') logo_url;
+ @attr('string') icon_url;
+}
diff --git a/console/app/models/category.js b/console/app/models/category.js
new file mode 100644
index 00000000..5c12866c
--- /dev/null
+++ b/console/app/models/category.js
@@ -0,0 +1,66 @@
+import Model, { attr, belongsTo, hasMany } from '@ember-data/model';
+import { tracked } from '@glimmer/tracking';
+import { computed, get } from '@ember/object';
+import { format, formatDistanceToNow } from 'date-fns';
+import config from 'ember-get-config';
+
+export default class CategoryModel extends Model {
+ /** @ids */
+ @attr('string') uuid;
+ @attr('string') company_uuid;
+ @attr('string') parent_uuid;
+ @attr('string') owner_uuid;
+ @attr('string') icon_file_uuid;
+
+ /** @relationships */
+ @belongsTo('file') icon_file;
+ @belongsTo('category', { inverse: 'subcategories', async: false }) parent;
+ @hasMany('category', { inverse: 'parent' }) subcategories;
+ @tracked parent_category;
+
+ /** @attributes */
+ @attr('string') owner_type;
+ @attr('string') name;
+ @attr('string') description;
+ @attr('string') icon;
+ @attr('string') icon_color;
+ @attr('string', { defaultValue: get(config, 'defaultValues.categoryImage') }) icon_url;
+ @attr('string') for;
+ @attr('string') slug;
+ @attr('string') order;
+ @attr('raw') translations;
+
+ /** @dates */
+ @attr('date') deleted_at;
+ @attr('date') created_at;
+ @attr('date') updated_at;
+
+ /** @computed */
+ @computed('public_id') get customerId() {
+ return this.public_id.replace('contact_', 'customer_');
+ }
+
+ @computed('updated_at') get updatedAgo() {
+ return formatDistanceToNow(this.updated_at);
+ }
+
+ @computed('updated_at') get updatedAt() {
+ return format(this.updated_at, 'PPP p');
+ }
+
+ @computed('updated_at') get updatedAtShort() {
+ return format(this.updated_at, 'PP');
+ }
+
+ @computed('created_at') get createdAgo() {
+ return formatDistanceToNow(this.created_at);
+ }
+
+ @computed('created_at') get createdAt() {
+ return format(this.created_at, 'PPP p');
+ }
+
+ @computed('created_at') get createdAtShort() {
+ return format(this.created_at, 'PP');
+ }
+}
diff --git a/console/app/models/company.js b/console/app/models/company.js
new file mode 100644
index 00000000..db4094cb
--- /dev/null
+++ b/console/app/models/company.js
@@ -0,0 +1,72 @@
+import Model, { attr, belongsTo } from '@ember-data/model';
+import { computed } from '@ember/object';
+import { format, formatDistanceToNow } from 'date-fns';
+import autoSerialize from '../utils/auto-serialize';
+
+export default class Company extends Model {
+ /** @ids */
+ @attr('string') uuid;
+ @attr('string') public_id;
+ @attr('string') owner_uuid;
+ @attr('string') logo_uuid;
+ @attr('string') backdrop_uuid;
+ @attr('string') address_uuid;
+
+ /** @relationships */
+ @belongsTo('file') logo;
+ @belongsTo('file') backdrop;
+
+ /** @attributes */
+ @attr('string') name;
+ @attr('string') website_url;
+ @attr('string') logo_url;
+ @attr('string') backdrop_url;
+ @attr('string') description;
+ @attr('raw') options;
+ @attr('string') type;
+ @attr('string') currency;
+ @attr('string') country;
+ @attr('string') timezone;
+ @attr('string') phone;
+ @attr('string') status;
+ @attr('string') slug;
+
+ /** @dates */
+ @attr('date') deleted_at;
+ @attr('date') created_at;
+ @attr('date') updated_at;
+
+ /** @computed */
+ @computed('phone_country_code', 'country') get phoneCountryCode() {
+ return this.phone_country_code || this.country;
+ }
+
+ @computed('updated_at') get updatedAgo() {
+ return formatDistanceToNow(this.updated_at);
+ }
+
+ @computed('updated_at') get updatedAt() {
+ return format(this.updated_at, 'PPP p');
+ }
+
+ @computed('updated_at') get updatedAtShort() {
+ return format(this.updated_at, 'PP');
+ }
+
+ @computed('created_at') get createdAgo() {
+ return formatDistanceToNow(this.created_at);
+ }
+
+ @computed('created_at') get createdAt() {
+ return format(this.created_at, 'PPP p');
+ }
+
+ @computed('created_at') get createdAtShort() {
+ return format(this.created_at, 'PP');
+ }
+
+ /** @methods */
+ toJSON() {
+ return autoSerialize(this);
+ }
+}
diff --git a/console/app/models/extension.js b/console/app/models/extension.js
new file mode 100644
index 00000000..b676aac2
--- /dev/null
+++ b/console/app/models/extension.js
@@ -0,0 +1,132 @@
+import Model, { attr } from '@ember-data/model';
+import { computed } from '@ember/object';
+import { notEmpty } from '@ember/object/computed';
+import { getOwner } from '@ember/application';
+import { format, formatDistanceToNow } from 'date-fns';
+
+export default class ExtensionModel extends Model {
+ /** @ids */
+ @attr('string') uuid;
+ @attr('string') author_uuid;
+ @attr('string') category_uuid;
+ @attr('string') type_uuid;
+ @attr('string') icon_uuid;
+ @attr('string') extension_id;
+
+ /** @relationships */
+
+ /** @attributes */
+ @attr('string') name;
+ @attr('string') display_name;
+ @attr('string') description;
+ @attr('string') icon_url;
+ @attr('string') namespace;
+ @attr('string') key;
+ @attr('string') internal_route;
+ @attr('string') fa_icon;
+ @attr('string') version;
+ @attr('string') website_url;
+ @attr('string') privacy_policy_url;
+ @attr('string') tos_url;
+ @attr('string') contact_email;
+ @attr('string') domains;
+ @attr('string') type_name;
+ @attr('string') category_name;
+ @attr('string') author_name;
+ @attr('number') install_count;
+ @attr('string') secret;
+ @attr('string') client_token;
+ @attr('string') status;
+ @attr('string') slug;
+
+ /** @boolean */
+ @attr('boolean') core_service;
+ @attr('boolean') is_installed;
+ @attr('boolean') installed;
+
+ /** @json */
+ @attr('raw') tags;
+ @attr('raw') meta;
+ @attr('raw') config;
+
+ /** @dates */
+ @attr('date') deleted_at;
+ @attr('date') created_at;
+ @attr('date') updated_at;
+
+ /** @methods */
+ toJSON() {
+ const json = {};
+
+ this.eachAttribute((key) => {
+ json[key] = this[key];
+ });
+
+ return json;
+ }
+
+ install() {
+ const owner = getOwner(this);
+ const fetch = owner.lookup(`service:fetch`);
+
+ return new Promise((resolve, reject) => {
+ fetch
+ .post('installer/install', {
+ extension: this.id,
+ })
+ .then((response) => {
+ this.is_installed = true;
+ resolve(response);
+ })
+ .catch((error) => {
+ reject(error);
+ });
+ });
+ }
+
+ uninstall() {
+ const owner = getOwner(this);
+ const fetch = owner.lookup(`service:fetch`);
+
+ return new Promise((resolve, reject) => {
+ fetch
+ .post('installer/uninstall', {
+ extension: this.id,
+ })
+ .then((response) => {
+ this.is_installed = false;
+ resolve(response);
+ })
+ .catch((error) => {
+ reject(error);
+ });
+ });
+ }
+
+ /** @computed */
+ @notEmpty('icon_uuid') hasIcon;
+
+ @computed('updated_at') get updatedAgo() {
+ return formatDistanceToNow(this.updated_at);
+ }
+
+ @computed('updated_at') get updatedAt() {
+ return format(this.updated_at, 'PPP p');
+ }
+
+ @computed('updated_at') get updatedAtShort() {
+ return format(this.updated_at, 'PP');
+ }
+
+ @computed('created_at') get createdAgo() {
+ return formatDistanceToNow(this.created_at);
+ }
+
+ @computed('created_at') get createdAt() {
+ return format(this.created_at, 'PPP p');
+ }
+
+ @computed('created_at') get createdAtShort() {
+ return format(this.created_at, 'PP');
+ }
+}
diff --git a/console/app/models/file.js b/console/app/models/file.js
new file mode 100644
index 00000000..5b6e99be
--- /dev/null
+++ b/console/app/models/file.js
@@ -0,0 +1,76 @@
+import Model, { attr } from '@ember-data/model';
+import { computed } from '@ember/object';
+import { not } from '@ember/object/computed';
+import { getOwner } from '@ember/application';
+import { format, formatDistanceToNow } from 'date-fns';
+import ENV from '@fleetbase/console/config/environment';
+import isVideoFile from '@fleetbase/ember-core/utils/is-video-file';
+import isImageFile from '@fleetbase/ember-core/utils/is-image-file';
+
+export default class FileModel extends Model {
+ /** @ids */
+ @attr('string') uuid;
+ @attr('string') uploader_uuid;
+ @attr('string') company_uuid;
+ @attr('string') subject_uuid;
+
+ /** @attributes */
+ @attr('string') caption;
+ @attr('string') url;
+ @attr('string') path;
+ @attr('string') bucket;
+ @attr('string') folder;
+ @attr('string') etag;
+ @attr('string') original_filename;
+ @attr('string') type;
+ @attr('string') content_type;
+ @attr('string') subject_type;
+ @attr('number') file_size;
+ @attr('string') slug;
+ @attr('string') permalink;
+
+ /** @dates */
+ @attr('date') deleted_at;
+ @attr('date') created_at;
+ @attr('date') updated_at;
+
+ /** @computed */
+ @computed('updated_at') get updatedAgo() {
+ return formatDistanceToNow(this.updated_at);
+ }
+
+ @computed('updated_at') get updatedAt() {
+ return format(this.updated_at, 'PPP');
+ }
+
+ @computed('created_at') get createdAgo() {
+ return formatDistanceToNow(this.created_at);
+ }
+
+ @computed('created_at') get createdAt() {
+ return format(this.created_at, 'PPP p');
+ }
+
+ @computed('content_type') get isVideo() {
+ return isVideoFile(this.content_type);
+ }
+
+ @computed('content_type') get isImage() {
+ return isImageFile(this.content_type);
+ }
+
+ @not('isVideo') isNotVideo;
+ @not('isImage') isNotImage;
+
+ /** @methods */
+ downloadFromApi() {
+ window.open(ENV.api.host + '/' + ENV.api.namespace + '/files/download?file=' + this.id, '_self');
+ }
+
+ download() {
+ const owner = getOwner(this);
+ const fetch = owner.lookup(`service:store`);
+
+ return fetch.download('files/download', { file: this.id });
+ }
+}
diff --git a/console/app/models/group.js b/console/app/models/group.js
new file mode 100644
index 00000000..8565c552
--- /dev/null
+++ b/console/app/models/group.js
@@ -0,0 +1,39 @@
+import Model, { attr, hasMany } from '@ember-data/model';
+import { computed } from '@ember/object';
+import { format, formatDistanceToNow } from 'date-fns';
+
+export default class GroupModel extends Model {
+ /** @attributes */
+ @attr('string') name;
+ @attr('string') description;
+
+ /** @dates */
+ @attr('date') created_at;
+ @attr('date') updated_at;
+
+ /** @relationships */
+ @hasMany('policy') policies;
+ @hasMany('permission') permissions;
+ @hasMany('user', { async: false }) users;
+
+ /** @computed */
+ @computed('[email protected]') get membersList() {
+ return this.users.map((user) => user.name);
+ }
+
+ @computed('updated_at') get updatedAgo() {
+ return formatDistanceToNow(this.updated_at);
+ }
+
+ @computed('updated_at') get updatedAt() {
+ return format(this.updated_at, 'PPP p');
+ }
+
+ @computed('created_at') get createdAgo() {
+ return formatDistanceToNow(this.created_at);
+ }
+
+ @computed('created_at') get createdAt() {
+ return format(this.created_at, 'PPP p');
+ }
+}
diff --git a/console/app/models/permission.js b/console/app/models/permission.js
new file mode 100644
index 00000000..7a832148
--- /dev/null
+++ b/console/app/models/permission.js
@@ -0,0 +1,117 @@
+import Model, { attr } from '@ember-data/model';
+import { computed } from '@ember/object';
+import { pluralize } from 'ember-inflector';
+import { format, formatDistanceToNow } from 'date-fns';
+import humanize from '@fleetbase/ember-core/utils/humanize';
+
+export const parserPermissionName = function (permissionName, index = 0) {
+ const parts = permissionName.split(' ');
+
+ if (parts.length >= index + 1) {
+ return parts[index];
+ }
+
+ return null;
+};
+
+export const getPermissionExtension = function (permissionName) {
+ return parserPermissionName(permissionName);
+};
+
+export const getPermissionAction = function (permissionName) {
+ return parserPermissionName(permissionName, 1);
+};
+
+export const getPermissionResource = function (permissionName) {
+ return parserPermissionName(permissionName, 2);
+};
+
+const lowercase = function (string) {
+ let words = string.split(' ');
+ words[0] = words[0].toLowerCase();
+ return words.join(' ');
+};
+
+const titleize = function (string) {
+ return lowercase(humanize(string));
+};
+
+/**
+ * Permission model for handling and authorizing actions.
+ * permission schema: {extension} {action} {resource}
+ * action and resource can be wildcards
+ *
+ * @export
+ * @class PermissionModel
+ * @extends {Model}
+ */
+export default class PermissionModel extends Model {
+ /** @attributes */
+ @attr('string') name;
+ @attr('string') guard_name;
+
+ /** @dates */
+ @attr('date') created_at;
+ @attr('date') updated_at;
+
+ /** @methods */
+ toJSON() {
+ return {
+ name: this.name,
+ guard_name: this.guard_name,
+ created_at: this.created_at,
+ updated_at: this.updated_at,
+ };
+ }
+
+ /** @computed */
+ @computed('name') get serviceName() {
+ return getPermissionExtension(this.name);
+ }
+
+ @computed('name') get extensionName() {
+ return getPermissionExtension(this.name);
+ }
+
+ @computed('name') get actionName() {
+ let action = getPermissionAction(this.name);
+
+ if (action === '*') {
+ return 'do anything';
+ }
+
+ return titleize(action);
+ }
+
+ @computed('name') get resourceName() {
+ return getPermissionResource(this.name);
+ }
+
+ @computed('actionName', 'name', 'resourceName', 'extensionName') get description() {
+ let actionName = this.actionName;
+ let actionPreposition = 'to';
+ let resourceName = pluralize(humanize(this.resourceName));
+ let resourcePreposition = getPermissionAction(this.name) === '*' && resourceName ? 'with' : '';
+ let extensionName = humanize(this.extensionName);
+ let extensionPreposition = 'on';
+ let descriptionParts = ['Permission', actionPreposition, actionName, resourcePreposition, resourceName, extensionPreposition, extensionName];
+
+ return descriptionParts.join(' ');
+ }
+
+ @computed('updated_at') get updatedAgo() {
+ return formatDistanceToNow(this.updated_at);
+ }
+
+ @computed('updated_at') get updatedAt() {
+ return format(this.updated_at, 'PPP');
+ }
+
+ @computed('created_at') get createdAgo() {
+ return formatDistanceToNow(this.created_at);
+ }
+
+ @computed('created_at') get createdAt() {
+ return format(this.created_at, 'PPP p');
+ }
+}
diff --git a/console/app/models/policy.js b/console/app/models/policy.js
new file mode 100644
index 00000000..c4ec5d4f
--- /dev/null
+++ b/console/app/models/policy.js
@@ -0,0 +1,49 @@
+import Model, { attr, hasMany } from '@ember-data/model';
+import { computed } from '@ember/object';
+import { format, formatDistanceToNow } from 'date-fns';
+
+export default class PolicyModel extends Model {
+ /** @ids */
+ @attr('string') company_uuid;
+
+ /** @relationships */
+ @hasMany('permission') permissions;
+
+ /** @attributes */
+ @attr('string') name;
+ @attr('string') type;
+ @attr('string') guard_name;
+ @attr('string') description;
+ @attr('boolean') is_mutable;
+ @attr('boolean') is_deletable;
+
+ /** @dates */
+ @attr('date') created_at;
+ @attr('date') updated_at;
+
+ /** @methods */
+ toJSON() {
+ return this.serialize();
+ }
+
+ /** @computed */
+ @computed('permissions') get permissionsArray() {
+ return this.permissions.toArray();
+ }
+
+ @computed('updated_at') get updatedAgo() {
+ return formatDistanceToNow(this.updated_at);
+ }
+
+ @computed('updated_at') get updatedAt() {
+ return format(this.updated_at, 'PPP p');
+ }
+
+ @computed('created_at') get createdAgo() {
+ return formatDistanceToNow(this.created_at);
+ }
+
+ @computed('created_at') get createdAt() {
+ return format(this.created_at, 'PPP p');
+ }
+}
diff --git a/console/app/models/role.js b/console/app/models/role.js
new file mode 100644
index 00000000..d442de33
--- /dev/null
+++ b/console/app/models/role.js
@@ -0,0 +1,55 @@
+import Model, { attr, hasMany } from '@ember-data/model';
+import { computed } from '@ember/object';
+import { format, formatDistanceToNow } from 'date-fns';
+
+export default class RoleModel extends Model {
+ /** @ids */
+ @attr('string') company_uuid;
+
+ /** @relationships */
+ @hasMany('policy') policies;
+ @hasMany('permission') permissions;
+
+ /** @attributes */
+ @attr('string') name;
+ @attr('string') guard_name;
+ @attr('string') description;
+
+ /** @dates */
+ @attr('date') created_at;
+ @attr('date') updated_at;
+
+ /** @methods */
+ toJSON() {
+ return this.serialize();
+ }
+
+ /** @computed */
+ @computed('permissions') get permissionsArray() {
+ return this.permissions.toArray();
+ }
+
+ @computed('updated_at') get updatedAgo() {
+ return formatDistanceToNow(this.updated_at);
+ }
+
+ @computed('updated_at') get updatedAt() {
+ return format(this.updated_at, 'PPP p');
+ }
+
+ @computed('updated_at') get updatedAtShort() {
+ return format(this.updated_at, 'PP');
+ }
+
+ @computed('created_at') get createdAgo() {
+ return formatDistanceToNow(this.created_at);
+ }
+
+ @computed('created_at') get createdAt() {
+ return format(this.created_at, 'PPP p');
+ }
+
+ @computed('created_at') get createdAtShort() {
+ return format(this.created_at, 'PP');
+ }
+}
diff --git a/console/app/models/setting.js b/console/app/models/setting.js
new file mode 100644
index 00000000..67fb0d0b
--- /dev/null
+++ b/console/app/models/setting.js
@@ -0,0 +1,3 @@
+import Model from '@ember-data/model';
+
+export default class SettingModel extends Model {}
diff --git a/console/app/models/transaction.js b/console/app/models/transaction.js
new file mode 100644
index 00000000..b086bf1a
--- /dev/null
+++ b/console/app/models/transaction.js
@@ -0,0 +1,3 @@
+import Model from '@ember-data/model';
+
+export default class TransactionModel extends Model {}
diff --git a/console/app/models/user-device.js b/console/app/models/user-device.js
new file mode 100644
index 00000000..7ff834fb
--- /dev/null
+++ b/console/app/models/user-device.js
@@ -0,0 +1,3 @@
+import Model from '@ember-data/model';
+
+export default class UserDeviceModel extends Model {}
diff --git a/console/app/models/user.js b/console/app/models/user.js
new file mode 100644
index 00000000..595e759c
--- /dev/null
+++ b/console/app/models/user.js
@@ -0,0 +1,126 @@
+import Model, { attr } from '@ember-data/model';
+import { computed, get } from '@ember/object';
+import { not } from '@ember/object/computed';
+import { getOwner } from '@ember/application';
+import { format, formatDistanceToNow, isValid } from 'date-fns';
+import config from 'ember-get-config';
+
+export default class UserModel extends Model {
+ /** @ids */
+ @attr('string') public_id;
+ @attr('string') company_uuid;
+ @attr('string') avatar_uuid;
+
+ /** @attributes */
+ @attr('string') name;
+ @attr('string', { defaultValue: get(config, 'defaultValues.userImage') }) avatar_url;
+ @attr('string') email;
+ @attr('string') password;
+ @attr('string') phone;
+ @attr('string') company_name;
+ @attr('string') date_of_birth;
+ @attr('string') timezone;
+ @attr('string') country;
+ @attr('string') ip_address;
+ @attr('string') slug;
+ @attr('string') type;
+ @attr('string') session_status;
+ @attr('string') status;
+ @attr('boolean') is_admin;
+ @attr('raw') types;
+ @attr('raw') meta;
+
+ /** @dates */
+ @attr('date') phone_verified_at;
+ @attr('date') email_verified_at;
+ @attr('date') last_login;
+ @attr('date') deleted_at;
+ @attr('date') created_at;
+ @attr('date') updated_at;
+
+ /** @methods */
+ deactivate() {
+ const owner = getOwner(this);
+ const fetch = owner.lookup(`service:fetch`);
+
+ return fetch.patch(`users/deactivate/${this.id}`).then((response) => {
+ this.session_status = 'inactive';
+
+ return response;
+ });
+ }
+
+ activate() {
+ const owner = getOwner(this);
+ const fetch = owner.lookup(`service:fetch`);
+
+ return fetch.patch(`users/activate/${this.id}`).then((response) => {
+ this.session_status = 'active';
+
+ return response;
+ });
+ }
+
+ removeFromCurrentCompany() {
+ const owner = getOwner(this);
+ const fetch = owner.lookup(`service:fetch`);
+
+ return fetch.delete(`users/remove-from-company/${this.id}`);
+ }
+
+ resendInvite() {
+ const owner = getOwner(this);
+ const fetch = owner.lookup(`service:fetch`);
+
+ return fetch.post(`users/resend-invite`, { user: this.id });
+ }
+
+ /** @computed */
+ @not('isEmailVerified') emailIsNotVerified;
+ @not('isPhoneVerified') phoneIsNotVerified;
+
+ @computed('types') get typesList() {
+ const types = Array.from(this.types);
+ return types.join(', ');
+ }
+
+ @computed('email_verified_at') get isEmailVerified() {
+ return this.email_verified_at && isValid(new Date(this.email_verified_at));
+ }
+
+ @computed('phone_verified_at') get isPhoneVerified() {
+ return this.phone_verified_at && isValid(new Date(this.phone_verified_at));
+ }
+
+ @computed('last_login') get lastLogin() {
+ if (!this.last_login || !isValid(new Date(this.last_login))) {
+ return 'Never';
+ }
+
+ return format(new Date(this.last_login), 'PP');
+ }
+
+ @computed('updated_at') get updatedAgo() {
+ return formatDistanceToNow(this.updated_at);
+ }
+
+ @computed('updated_at') get updatedAt() {
+ return format(this.updated_at, 'PPP p');
+ }
+
+ @computed('updated_at') get updatedAtShort() {
+ return format(this.updated_at, 'PP');
+ }
+
+ @computed('created_at') get createdAgo() {
+ return formatDistanceToNow(this.created_at);
+ }
+
+ @computed('created_at') get createdAt() {
+ return format(this.created_at, 'PPP p');
+ }
+
+ @computed('created_at') get createdAtShort() {
+ return format(this.created_at, 'PP');
+ }
+}
diff --git a/console/app/resolver.js b/console/app/resolver.js
new file mode 100644
index 00000000..fefaf116
--- /dev/null
+++ b/console/app/resolver.js
@@ -0,0 +1,11 @@
+import Resolver from 'ember-resolver';
+
+export default class extends Resolver {
+ resolveRoute(parsedName) {
+ if (parsedName.fullNameWithoutType === 'main') {
+ return import('./router.generated');
+ }
+
+ return super.resolveRoute(parsedName);
+ }
+}
diff --git a/console/app/router.js b/console/app/router.js
new file mode 100644
index 00000000..b193b3e5
--- /dev/null
+++ b/console/app/router.js
@@ -0,0 +1,68 @@
+import EmberRouter from '@ember/routing/router';
+import config from '@fleetbase/console/config/environment';
+
+export default class Router extends EmberRouter {
+ location = config.locationType;
+ rootURL = config.rootURL;
+}
+
+Router.map(function () {
+ this.route('auth', function () {
+ this.route('login', { path: '/' });
+ this.route('forgot-password');
+ this.route('reset-password');
+ });
+ this.route('onboard', function () {
+ this.route('verify-email');
+ });
+ this.route('invite', { path: 'join' }, function () {
+ this.route('for-driver', { path: '/fleet/:public_id' });
+ this.route('for-user', { path: '/org/:public_id' });
+ });
+ this.route('console', { path: '/' }, function () {
+ this.route('home', { path: '/' });
+ this.route('extensions');
+ this.route('account', function () {
+ this.route('virtual', { path: '/:slug/:view' });
+ });
+ this.route('settings', function () {
+ this.route('virtual', { path: '/:slug/:view' });
+ });
+ this.route('virtual', { path: '/:slug/:view' });
+ this.route('admin', function () {
+ this.route('config', function () {
+ this.route('database');
+ this.route('cache');
+ this.route('filesystem');
+ this.route('mail');
+ this.route('notification-channels');
+ this.route('queue');
+ this.route('services');
+ this.route('socket');
+ });
+ this.route('branding');
+ this.route('virtual', { path: '/:slug/:view' });
+ });
+
+ this.mount('@fleetbase/dev-engine', {
+ as: 'developers',
+ path: 'developers'
+ });
+
+ this.mount('@fleetbase/fleetops-engine', {
+ as: 'fleet-ops',
+ path: 'fleet-ops'
+ });
+
+ this.mount('@fleetbase/iam-engine', {
+ as: 'iam',
+ path: 'iam'
+ });
+
+ this.mount('@fleetbase/storefront-engine', {
+ as: 'storefront',
+ path: 'storefront'
+ });
+ });
+ this.route('install');
+});
diff --git a/console/app/routes/.gitkeep b/console/app/routes/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/console/app/routes/application.js b/console/app/routes/application.js
new file mode 100644
index 00000000..5fa907dc
--- /dev/null
+++ b/console/app/routes/application.js
@@ -0,0 +1,82 @@
+import Route from '@ember/routing/route';
+import { tracked } from '@glimmer/tracking';
+import { inject as service } from '@ember/service';
+import isElectron from '@fleetbase/ember-core/utils/is-electron';
+import pathToRoute from '@fleetbase/ember-core/utils/path-to-route';
+
+export default class ApplicationRoute extends Route {
+ @service session;
+ @service theme;
+ @service fetch;
+ @service urlSearchParams;
+ @service modalsManager;
+ @service intl;
+ @tracked defaultTheme;
+
+ /**
+ * Check the installation status of Fleetbase and transition user accordingly.
+ *
+ * @return {void|Transition}
+ * @memberof ApplicationRoute
+ */
+ // eslint-disable-next-line ember/classic-decorator-hooks
+ async init() {
+ super.init(...arguments);
+ const { shouldInstall, shouldOnboard, defaultTheme } = await this.checkInstallationStatus();
+
+ this.defaultTheme = defaultTheme;
+
+ if (shouldInstall) {
+ return this.transitionTo('install');
+ }
+
+ if (shouldOnboard) {
+ return this.transitionTo('onboard');
+ }
+ }
+
+ /**
+ * Sets up session and handles redirects
+ *
+ * @param {Transition} transition
+ * @return {Transition}
+ * @memberof ApplicationRoute
+ */
+ async beforeModel() {
+ await this.session.setup();
+
+ const { isAuthenticated } = this.session;
+ const shift = this.urlSearchParams.get('shift');
+
+ if (isAuthenticated && shift) {
+ return this.transitionTo(pathToRoute(shift));
+ }
+ }
+
+ /**
+ * On application route activation
+ *
+ * @memberof ApplicationRoute
+ * @void
+ */
+ activate() {
+ const bodyClassNames = [];
+
+ if (isElectron()) {
+ bodyClassNames.pushObject(['is-electron']);
+ }
+
+ this.theme.initialize({ bodyClassNames, theme: this.defaultTheme });
+ this.intl.setLocale(['en-us']);
+ }
+
+ /**
+ * Checks to determine if Fleetbase should be installed or user needs to onboard.
+ *
+ * @return {Promise}
+ * @memberof ApplicationRoute
+ */
+ checkInstallationStatus() {
+ return this.fetch.get('installer/initialize');
+ }
+}
diff --git a/console/app/routes/auth/forgot-password.js b/console/app/routes/auth/forgot-password.js
new file mode 100644
index 00000000..082bfc09
--- /dev/null
+++ b/console/app/routes/auth/forgot-password.js
@@ -0,0 +1,10 @@
+import Route from '@ember/routing/route';
+import { inject as service } from '@ember/service';
+
+export default class AuthForgotPasswordRoute extends Route {
+ @service store;
+
+ model() {
+ return this.store.findRecord('brand', 1);
+ }
+}
diff --git a/console/app/routes/auth/login.js b/console/app/routes/auth/login.js
new file mode 100644
index 00000000..83c3f695
--- /dev/null
+++ b/console/app/routes/auth/login.js
@@ -0,0 +1,16 @@
+import Route from '@ember/routing/route';
+import { inject as service } from '@ember/service';
+
+export default class AuthLoginRoute extends Route {
+ @service session;
+
+ /**
+ * If user is authentication redirect to console.
+ *
+ * @memberof AuthLoginRoute
+ * @void
+ */
+ beforeModel() {
+ this.session.prohibitAuthentication('console');
+ }
+}
diff --git a/console/app/routes/auth/reset-password.js b/console/app/routes/auth/reset-password.js
new file mode 100644
index 00000000..8f4cc220
--- /dev/null
+++ b/console/app/routes/auth/reset-password.js
@@ -0,0 +1,10 @@
+import Route from '@ember/routing/route';
+import { inject as service } from '@ember/service';
+
+export default class AuthResetPasswordRoute extends Route {
+ @service store;
+
+ model() {
+ return this.store.findRecord('brand', 1);
+ }
+}
diff --git a/console/app/routes/console.js b/console/app/routes/console.js
new file mode 100644
index 00000000..beafea09
--- /dev/null
+++ b/console/app/routes/console.js
@@ -0,0 +1,101 @@
+import Route from '@ember/routing/route';
+import { inject as service } from '@ember/service';
+import { action } from '@ember/object';
+import '@fleetbase/leaflet-routing-machine';
+
+export default class ConsoleRoute extends Route {
+ /**
+ * Inject the `store` service
+ *
+ * @var {Service}
+ */
+ @service store;
+
+ /**
+ * Inject the `fetch` service
+ *
+ * @var {Service}
+ */
+ @service fetch;
+
+ /**
+ * Inject the `session` service
+ *
+ * @var {Service}
+ */
+ @service session;
+
+ /**
+ * Inject the `currentUser` service
+ *
+ * @var {Service}
+ */
+ @service currentUser;
+
+ /**
+ * Require authentication to access all `console` routes.
+ *
+ * @param {Transition} transition
+ * @return {Promise}
+ * @memberof ConsoleRoute
+ */
+ @action async beforeModel(transition) {
+ this.session.requireAuthentication(transition, 'auth.login');
+
+ return this.session.promiseCurrentUser(transition);
+ }
+
+ /**
+ * Get the branding settings.
+ *
+ * @return {BrandModel}
+ * @memberof ConsoleRoute
+ */
+ model() {
+ return this.store.findRecord('brand', 1);
+ }
+
+ /**
+ * We will use this hook to preload engines
+ *
+ * @void
+ */
+ @action afterModel() {
+ this.fetchSessionInfo();
+ }
+
+ /**
+ * We will use this hook to setup controller and more
+ *
+ * @void
+ */
+ @action setupController(controller, model) {
+ super.setupController(controller, model);
+
+ this.fetch.get('auth/organizations').then((organizations) => {
+ this.currentUser.setOption('organizations', organizations);
+ controller.organizations = organizations;
+ });
+ }
+
+ /**
+ * Use this hook to fetch user related queries
+ *
+ * @void
+ */
+ @action fetchSessionInfo() {
+ this.fetch.shouldResetCache();
+ this.fetch
+ .cachedGet(
+ 'lookup/whois',
+ {},
+ {
+ expirationInterval: 60,
+ expirationIntervalUnit: 'minutes',
+ }
+ )
+ .then((whois) => {
+ this.currentUser.setOption('whois', whois);
+ });
+ }
+}
diff --git a/console/app/routes/console/account.js b/console/app/routes/console/account.js
new file mode 100644
index 00000000..a4c4befa
--- /dev/null
+++ b/console/app/routes/console/account.js
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class ConsoleAccountRoute extends Route {}
diff --git a/console/app/routes/console/account/index.js b/console/app/routes/console/account/index.js
new file mode 100644
index 00000000..2c58785d
--- /dev/null
+++ b/console/app/routes/console/account/index.js
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class ConsoleAccountIndexRoute extends Route {}
diff --git a/console/app/routes/console/account/virtual.js b/console/app/routes/console/account/virtual.js
new file mode 100644
index 00000000..d2a81a31
--- /dev/null
+++ b/console/app/routes/console/account/virtual.js
@@ -0,0 +1,10 @@
+import Route from '@ember/routing/route';
+import { inject as service } from '@ember/service';
+
+export default class ConsoleAccountVirtualRoute extends Route {
+ @service universe;
+
+ model({ slug, view }) {
+ return this.universe.lookupMenuItemFromRegistry('account', slug, view);
+ }
+}
diff --git a/console/app/routes/console/admin.js b/console/app/routes/console/admin.js
new file mode 100644
index 00000000..a661f688
--- /dev/null
+++ b/console/app/routes/console/admin.js
@@ -0,0 +1,16 @@
+import Route from '@ember/routing/route';
+import { inject as service } from '@ember/service';
+
+export default class ConsoleAdminRoute extends Route {
+ @service currentUser;
+ @service notifications;
+
+ beforeModel() {
+ // USER MUST BE ADMIN
+ if (!this.currentUser.user.is_admin) {
+ return this.transitionTo('console').then(() => {
+ this.notifications.error('You do not have authorization to access admin!');
+ });
+ }
+ }
+}
diff --git a/console/app/routes/console/admin/branding.js b/console/app/routes/console/admin/branding.js
new file mode 100644
index 00000000..b0d9f962
--- /dev/null
+++ b/console/app/routes/console/admin/branding.js
@@ -0,0 +1,10 @@
+import Route from '@ember/routing/route';
+import { inject as service } from '@ember/service';
+
+export default class ConsoleAdminBrandingRoute extends Route {
+ @service store;
+
+ model() {
+ return this.store.findRecord('brand', 1);
+ }
+}
diff --git a/console/app/routes/console/admin/config.js b/console/app/routes/console/admin/config.js
new file mode 100644
index 00000000..32de8018
--- /dev/null
+++ b/console/app/routes/console/admin/config.js
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class ConsoleAdminConfigRoute extends Route {}
diff --git a/console/app/routes/console/admin/config/cache.js b/console/app/routes/console/admin/config/cache.js
new file mode 100644
index 00000000..64119622
--- /dev/null
+++ b/console/app/routes/console/admin/config/cache.js
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class ConsoleAdminConfigCacheRoute extends Route {}
diff --git a/console/app/routes/console/admin/config/database.js b/console/app/routes/console/admin/config/database.js
new file mode 100644
index 00000000..de5e4955
--- /dev/null
+++ b/console/app/routes/console/admin/config/database.js
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class ConsoleAdminConfigDatabaseRoute extends Route {}
diff --git a/console/app/routes/console/admin/config/filesystem.js b/console/app/routes/console/admin/config/filesystem.js
new file mode 100644
index 00000000..1c76e175
--- /dev/null
+++ b/console/app/routes/console/admin/config/filesystem.js
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class ConsoleAdminConfigFilesystemRoute extends Route {}
diff --git a/console/app/routes/console/admin/config/mail.js b/console/app/routes/console/admin/config/mail.js
new file mode 100644
index 00000000..cacf955a
--- /dev/null
+++ b/console/app/routes/console/admin/config/mail.js
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class ConsoleAdminConfigMailRoute extends Route {}
diff --git a/console/app/routes/console/admin/config/notification-channels.js b/console/app/routes/console/admin/config/notification-channels.js
new file mode 100644
index 00000000..c6b92113
--- /dev/null
+++ b/console/app/routes/console/admin/config/notification-channels.js
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class ConsoleAdminConfigNotificationChannelsRoute extends Route {}
diff --git a/console/app/routes/console/admin/config/queue.js b/console/app/routes/console/admin/config/queue.js
new file mode 100644
index 00000000..46f44ce6
--- /dev/null
+++ b/console/app/routes/console/admin/config/queue.js
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class ConsoleAdminConfigQueueRoute extends Route {}
diff --git a/console/app/routes/console/admin/config/services.js b/console/app/routes/console/admin/config/services.js
new file mode 100644
index 00000000..5d058ab4
--- /dev/null
+++ b/console/app/routes/console/admin/config/services.js
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class ConsoleAdminConfigServicesRoute extends Route {}
diff --git a/console/app/routes/console/admin/config/socket.js b/console/app/routes/console/admin/config/socket.js
new file mode 100644
index 00000000..e8a8f3c9
--- /dev/null
+++ b/console/app/routes/console/admin/config/socket.js
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class ConsoleAdminConfigSocketRoute extends Route {}
diff --git a/console/app/routes/console/admin/index.js b/console/app/routes/console/admin/index.js
new file mode 100644
index 00000000..2ebeb00e
--- /dev/null
+++ b/console/app/routes/console/admin/index.js
@@ -0,0 +1,10 @@
+import Route from '@ember/routing/route';
+import { inject as service } from '@ember/service';
+
+export default class ConsoleAdminIndexRoute extends Route {
+ @service fetch;
+
+ model() {
+ return this.fetch.get('settings/overview');
+ }
+}
diff --git a/console/app/routes/console/admin/virtual.js b/console/app/routes/console/admin/virtual.js
new file mode 100644
index 00000000..3fc59a69
--- /dev/null
+++ b/console/app/routes/console/admin/virtual.js
@@ -0,0 +1,10 @@
+import Route from '@ember/routing/route';
+import { inject as service } from '@ember/service';
+
+export default class ConsoleAdminVirtualRoute extends Route {
+ @service universe;
+
+ model({ slug, view }) {
+ return this.universe.lookupMenuItemFromRegistry('admin', slug, view);
+ }
+}
diff --git a/console/app/routes/console/extensions.js b/console/app/routes/console/extensions.js
new file mode 100644
index 00000000..e50e79b7
--- /dev/null
+++ b/console/app/routes/console/extensions.js
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class ConsoleExtensionsRoute extends Route {}
diff --git a/console/app/routes/console/home.js b/console/app/routes/console/home.js
new file mode 100644
index 00000000..c49d2505
--- /dev/null
+++ b/console/app/routes/console/home.js
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class ConsoleHomeRoute extends Route {}
diff --git a/console/app/routes/console/settings.js b/console/app/routes/console/settings.js
new file mode 100644
index 00000000..ab7ac8a6
--- /dev/null
+++ b/console/app/routes/console/settings.js
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class ConsoleSettingsRoute extends Route {}
diff --git a/console/app/routes/console/settings/index.js b/console/app/routes/console/settings/index.js
new file mode 100644
index 00000000..c85e1a98
--- /dev/null
+++ b/console/app/routes/console/settings/index.js
@@ -0,0 +1,11 @@
+import Route from '@ember/routing/route';
+import { inject as service } from '@ember/service';
+
+export default class ConsoleSettingsIndexRoute extends Route {
+ @service currentUser;
+ @service store;
+
+ model() {
+ return this.store.findRecord('company', this.currentUser.companyId);
+ }
+}
diff --git a/console/app/routes/console/settings/virtual.js b/console/app/routes/console/settings/virtual.js
new file mode 100644
index 00000000..9e11b00c
--- /dev/null
+++ b/console/app/routes/console/settings/virtual.js
@@ -0,0 +1,10 @@
+import Route from '@ember/routing/route';
+import { inject as service } from '@ember/service';
+
+export default class ConsoleSettingsVirtualRoute extends Route {
+ @service universe;
+
+ model({ slug, view }) {
+ return this.universe.lookupMenuItemFromRegistry('settings', slug, view);
+ }
+}
diff --git a/console/app/routes/console/virtual.js b/console/app/routes/console/virtual.js
new file mode 100644
index 00000000..ad532964
--- /dev/null
+++ b/console/app/routes/console/virtual.js
@@ -0,0 +1,10 @@
+import Route from '@ember/routing/route';
+import { inject as service } from '@ember/service';
+
+export default class ConsoleVirtualRoute extends Route {
+ @service universe;
+
+ model({ slug, view }) {
+ return this.universe.lookupMenuItemFromRegistry('console', slug, view);
+ }
+}
diff --git a/console/app/routes/install.js b/console/app/routes/install.js
new file mode 100644
index 00000000..3c0b1a84
--- /dev/null
+++ b/console/app/routes/install.js
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class InstallRoute extends Route {}
diff --git a/console/app/routes/invite.js b/console/app/routes/invite.js
new file mode 100644
index 00000000..c668b4f8
--- /dev/null
+++ b/console/app/routes/invite.js
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class InviteRoute extends Route {}
diff --git a/console/app/routes/invite/for-driver.js b/console/app/routes/invite/for-driver.js
new file mode 100644
index 00000000..4fe0c277
--- /dev/null
+++ b/console/app/routes/invite/for-driver.js
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class InviteForDriverRoute extends Route {}
diff --git a/console/app/routes/invite/for-user.js b/console/app/routes/invite/for-user.js
new file mode 100644
index 00000000..8d338ac1
--- /dev/null
+++ b/console/app/routes/invite/for-user.js
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class InviteForUserRoute extends Route {}
diff --git a/console/app/routes/onboard.js b/console/app/routes/onboard.js
new file mode 100644
index 00000000..027ee1ca
--- /dev/null
+++ b/console/app/routes/onboard.js
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class OnboardRoute extends Route {}
diff --git a/console/app/routes/onboard/index.js b/console/app/routes/onboard/index.js
new file mode 100644
index 00000000..2cf6b08b
--- /dev/null
+++ b/console/app/routes/onboard/index.js
@@ -0,0 +1,10 @@
+import Route from '@ember/routing/route';
+import { inject as service } from '@ember/service';
+
+export default class OnboardIndexRoute extends Route {
+ @service store;
+
+ model() {
+ return this.store.findRecord('brand', 1);
+ }
+}
diff --git a/console/app/routes/onboard/verify-email.js b/console/app/routes/onboard/verify-email.js
new file mode 100644
index 00000000..66ea6b7d
--- /dev/null
+++ b/console/app/routes/onboard/verify-email.js
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class OnboardVerifyEmailRoute extends Route {}
diff --git a/console/app/serializers/brand.js b/console/app/serializers/brand.js
new file mode 100644
index 00000000..4dcff68e
--- /dev/null
+++ b/console/app/serializers/brand.js
@@ -0,0 +1,4 @@
+import ApplicationSerializer from '@fleetbase/ember-core/serializers/application';
+import { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';
+
+export default class BrandSerializer extends ApplicationSerializer.extend(EmbeddedRecordsMixin) {}
diff --git a/console/app/serializers/category.js b/console/app/serializers/category.js
new file mode 100644
index 00000000..61399f9b
--- /dev/null
+++ b/console/app/serializers/category.js
@@ -0,0 +1,37 @@
+import ApplicationSerializer from '@fleetbase/ember-core/serializers/application';
+import { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';
+
+export default class CategorySerializer extends ApplicationSerializer.extend(EmbeddedRecordsMixin) {
+ /**
+ * Embedded relationship attributes
+ *
+ * @var {Object}
+ */
+ get attrs() {
+ return {
+ parent: { embedded: 'always' },
+ subcategories: { embedded: 'always' },
+ icon_file: { embedded: 'always' },
+ };
+ }
+
+ serializeBelongsTo(snapshot, json, relationship) {
+ let key = relationship.key;
+
+ if (key === 'parent') {
+ return;
+ }
+
+ return super.serializeBelongsTo(...arguments);
+ }
+
+ serializeHasMany(snapshot, json, relationship) {
+ let key = relationship.key;
+
+ if (key === 'subcategories') {
+ return;
+ }
+
+ return super.serializeHasMany(...arguments);
+ }
+}
diff --git a/console/app/serializers/group.js b/console/app/serializers/group.js
new file mode 100644
index 00000000..21204dc4
--- /dev/null
+++ b/console/app/serializers/group.js
@@ -0,0 +1,17 @@
+import ApplicationSerializer from '@fleetbase/ember-core/serializers/application';
+import { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';
+
+export default class GroupSerializer extends ApplicationSerializer.extend(EmbeddedRecordsMixin) {
+ /**
+ * Embedded relationship attributes
+ *
+ * @var {Object}
+ */
+ get attrs() {
+ return {
+ users: { serialize: 'ids', deserialize: 'records' },
+ permissions: { serialize: 'ids', deserialize: 'records' },
+ policies: { serialize: 'ids', deserialize: 'records' },
+ };
+ }
+}
diff --git a/console/app/serializers/permission.js b/console/app/serializers/permission.js
new file mode 100644
index 00000000..b42e8ec8
--- /dev/null
+++ b/console/app/serializers/permission.js
@@ -0,0 +1,5 @@
+import ApplicationSerializer from '@fleetbase/ember-core/serializers/application';
+
+export default class PermissionSerializer extends ApplicationSerializer {
+ primaryKey = 'id';
+}
diff --git a/console/app/serializers/policy.js b/console/app/serializers/policy.js
new file mode 100644
index 00000000..740b31da
--- /dev/null
+++ b/console/app/serializers/policy.js
@@ -0,0 +1,17 @@
+import ApplicationSerializer from '@fleetbase/ember-core/serializers/application';
+import { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';
+
+export default class PolicySerializer extends ApplicationSerializer.extend(EmbeddedRecordsMixin) {
+ primaryKey = 'id';
+
+ /**
+ * Embedded relationship attributes
+ *
+ * @var {Object}
+ */
+ get attrs() {
+ return {
+ permissions: { serialize: 'ids', deserialize: 'records' },
+ };
+ }
+}
diff --git a/console/app/serializers/role.js b/console/app/serializers/role.js
new file mode 100644
index 00000000..ff0e0420
--- /dev/null
+++ b/console/app/serializers/role.js
@@ -0,0 +1,18 @@
+import ApplicationSerializer from '@fleetbase/ember-core/serializers/application';
+import { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';
+
+export default class RoleSerializer extends ApplicationSerializer.extend(EmbeddedRecordsMixin) {
+ primaryKey = 'id';
+
+ /**
+ * Embedded relationship attributes
+ *
+ * @var {Object}
+ */
+ get attrs() {
+ return {
+ policies: { serialize: 'ids', deserialize: 'records' },
+ permissions: { serialize: 'ids', deserialize: 'records' },
+ };
+ }
+}
diff --git a/console/app/serializers/user.js b/console/app/serializers/user.js
new file mode 100644
index 00000000..890bed5b
--- /dev/null
+++ b/console/app/serializers/user.js
@@ -0,0 +1,19 @@
+import ApplicationSerializer from '@fleetbase/ember-core/serializers/application';
+
+export default class UserSerializer extends ApplicationSerializer {
+ /**
+ * Customize serializer so that the password is never sent to the server via Ember Data
+ *
+ * @param {Snapshot} snapshot
+ * @param {Object} options
+ * @return {Object} json
+ */
+ serialize() {
+ const json = super.serialize(...arguments);
+
+ // delete the password always
+ delete json.password;
+
+ return json;
+ }
+}
diff --git a/console/app/styles/app.css b/console/app/styles/app.css
new file mode 100644
index 00000000..80957554
--- /dev/null
+++ b/console/app/styles/app.css
@@ -0,0 +1,4 @@
+@import 'tailwindcss/base';
+@import 'tailwindcss/components';
+@import 'tailwindcss/utilities';
+@import 'inter-ui/inter.css';
\ No newline at end of file
diff --git a/console/app/templates/application.hbs b/console/app/templates/application.hbs
new file mode 100644
index 00000000..c796ec43
--- /dev/null
+++ b/console/app/templates/application.hbs
@@ -0,0 +1,4 @@
+{{page-title (t "app.name")}}
+<ModalsContainer />
+<NotificationContainer @position="top" @zindex="99999" />
+{{outlet}}
\ No newline at end of file
diff --git a/console/app/templates/auth.hbs b/console/app/templates/auth.hbs
new file mode 100644
index 00000000..95b14c2c
--- /dev/null
+++ b/console/app/templates/auth.hbs
@@ -0,0 +1,5 @@
+<div class="flex items-center justify-center min-h-screen px-4 py-12 bg-gray-50 dark:bg-gray-900 sm:px-6 lg:px-8">
+ <div class="w-full max-w-md">
+ {{outlet}}
+ </div>
+</div>
\ No newline at end of file
diff --git a/console/app/templates/auth/forgot-password.hbs b/console/app/templates/auth/forgot-password.hbs
new file mode 100644
index 00000000..08000eab
--- /dev/null
+++ b/console/app/templates/auth/forgot-password.hbs
@@ -0,0 +1,44 @@
+<div class="bg-white dark:bg-gray-800 py-8 px-4 shadow rounded-lg">
+ <div class="mb-4">
+ <Image src={{@model.logo_url}} @fallbackSrc="/images/fleetbase-logo-svg.svg" alt={{t "app.name"}} width="160" height="56" class="w-40 h-14 mx-auto" />
+ <h2 class="text-center text-lg font-extrabold text-gray-900 dark:text-white truncate">
+ {{if this.isSent "Almost done!" "Forgot your password?"}}
+ </h2>
+ </div>
+
+ {{#if this.isSent}}
+ <div class="flex px-3 py-2 mb-4 rounded-md shadow-sm bg-green-200">
+ <div>
+ <FaIcon @icon="check-circle" @size="lg" class="text-green-900 mr-4" />
+ </div>
+ <p class="flex-1 text-sm text-green-900 dark:text-green-900">
+ <strong>Check your email!</strong><br> We've sent you a magic link to your email which will allow you to reset your password. The link expires in 15 minutes.
+ </p>
+ </div>
+ {{else}}
+ <div class="flex px-3 py-2 mb-6 rounded-md shadow-sm bg-blue-200">
+ <div>
+ <FaIcon @icon="info-circle" @size="lg" class="text-blue-900 mr-4" />
+ </div>
+ <p class="flex-1 text-sm text-blue-900 dark:text-blue-900">
+ <strong>Don't worry, we've got your back.</strong><br> Enter the email you use to login to {{t "app.name"}} and we will send you a secure link to reset your password.
+ </p>
+ </div>
+
+ <form class="space-y-6" {{on "submit" this.sendSecureLink}}>
+ <div>
+ <label for="email" class="block text-sm font-medium text-gray-700 dark:text-gray-50">
+ Your email address
+ </label>
+ <div class="mt-2">
+ <Input @value={{this.email}} @type="email" id="email" name="email" required class="form-input form-input-lg w-full" placeholder="Your email" />
+ </div>
+ </div>
+
+ <div class="flex flex-row space-x-2">
+ <Button @icon="magic" @type="primary" @buttonType="submit" @text="OK, Send me a magic link!" @onClick={{this.sendSecureLink}} @isLoading={{this.isLoading}} />
+ <Button @buttonType="button" @text="Nevermind" @onClick={{fn (transition-to "auth.login")}} @disabled={{this.isLoading}} />
+ </div>
+ </form>
+ {{/if}}
+</div>
\ No newline at end of file
diff --git a/console/app/templates/auth/login.hbs b/console/app/templates/auth/login.hbs
new file mode 100644
index 00000000..54fdab8a
--- /dev/null
+++ b/console/app/templates/auth/login.hbs
@@ -0,0 +1,57 @@
+<div>
+ <div class="mx-auto w-12 h-12">
+ <LogoIcon @url={{@brand.icon_url}} @size="12" class="mx-auto" />
+ </div>
+ <h2 class="mt-6 mb-3 text-3xl font-extrabold leading-9 text-center text-gray-900 dark:text-gray-100">
+ Sign in to your account
+ </h2>
+</div>
+
+{{#if (gte this.failedAttempts 3)}}
+ <div class="px-3 py-2 my-6 rounded-md shadow-sm bg-yellow-200">
+ <div class="flex mb-5">
+ <div>
+ <FaIcon @icon="exclamation-triangle" @size="lg" class="text-yellow-900 mr-4" />
+ </div>
+ <p class="flex-1 text-sm text-yellow-900 dark:yellow-red-900">
+ <strong>Forgot your password?</strong><br> Click the button below to reset your password.
+ </p>
+ </div>
+ <Button @text="Ok, help me reset!" @type="warning" @onClick={{this.forgotPassword}} />
+ </div>
+{{/if}}
+
+<form class="mt-8" {{on "submit" this.login}}>
+ <input type="hidden" name="remember" value="true" />
+ <div class="rounded-md shadow-sm">
+ <div>
+ <Input @value={{this.email}} aria-label="Email address" name="email" @type="email" autocomplete="username" required class="relative block w-full px-3 py-2 text-gray-900 placeholder-gray-500 border border-gray-300 rounded-none appearance-none rounded-t-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-sm sm:leading-5 dark:text-white dark:bg-gray-700 dark:border-gray-900" placeholder="Email address" disabled={{this.isLoading}} />
+ </div>
+ <div class="-mt-px">
+ <Input @value={{this.password}} aria-label="Password" name="password" @type="password" autocomplete="current-password" required class="relative block w-full px-3 py-2 text-gray-900 placeholder-gray-500 border border-gray-300 rounded-none appearance-none rounded-b-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-sm sm:leading-5 dark:text-white dark:bg-gray-700 dark:border-gray-900" placeholder="Password" disabled={{this.isLoading}} />
+ </div>
+ </div>
+
+ <div class="flex items-center justify-between mt-6">
+ <div class="flex items-center">
+ <Input id="rememberMe" @type="checkbox" @checked={{this.rememberMe}} disabled={{this.isLoading}} class="w-4 h-4 transition duration-150 ease-in-out form-checkbox text-sky-500" />
+ <label for="rememberMe" class="block ml-2 text-sm leading-5 text-gray-900 dark:text-gray-100">
+ Remember me
+ </label>
+ </div>
+
+ <div class="text-sm leading-5">
+ <a href="javascript:;" {{on "click" this.forgotPassword}} disabled={{this.isLoading}} class="font-medium transition duration-150 ease-in-out text-sky-600 hover:text-sky-500 focus:outline-none focus:underline">
+ Forgot your password?
+ </a>
+ </div>
+ </div>
+
+ <div class="mt-6">
+ <Button @buttonType="submit" @type="primary" @text="Sign In" @icon="lock" @wrapperClass="btn-block" @isLoading={{this.isLoading}} @onClick={{this.login}} />
+ </div>
+
+ <div class="mt-3">
+ <Button @text="Create a new Account" @wrapperClass="btn-block" @disabled={{this.isLoading}} @onClick={{fn (transition-to "onboard")}} />
+ </div>
+</form>
\ No newline at end of file
diff --git a/console/app/templates/auth/reset-password.hbs b/console/app/templates/auth/reset-password.hbs
new file mode 100644
index 00000000..24177f8b
--- /dev/null
+++ b/console/app/templates/auth/reset-password.hbs
@@ -0,0 +1,19 @@
+<div class="bg-white dark:bg-gray-800 py-8 px-4 shadow rounded-lg">
+ <div class="mb-4">
+ <Image src={{@model.logo_url}} @fallbackSrc="/images/fleetbase-logo-svg.svg" alt={{t "app.name"}} width="160" height="56" class="w-40 h-14 mx-auto" />
+ <h2 class="text-center text-lg font-extrabold text-gray-900 dark:text-white truncate">
+ Reset your password
+ </h2>
+ </div>
+
+ <form class="space-y-6" {{on "submit" this.resetPassword}}>
+ <InputGroup @name="Your reset code" @value={{this.code}} @inputClass="form-input-lg" @helpText="The verification code you received in your email." />
+ <InputGroup @name="New Password" @value={{this.password}} @type="password" @inputClass="form-input-lg" @helpText="Enter a password at-least 6 characters to continue." />
+ <InputGroup @name="Confirm new Password" @value={{this.password_confirmation}} @type="password" @inputClass="form-input-lg" @helpText="Enter a password at-least 6 characters to continue." />
+
+ <div class="flex space-x-2">
+ <Button @icon="check" @size="lg" @type="primary" @buttonType="submit" @text="Reset Password" @onClick={{this.resetPassword}} @isLoading={{this.isLoading}} />
+ <Button @size="lg" @buttonType="button" @text="Back" @onClick={{fn (transition-to "auth.login")}} @disabled={{this.isLoading}} />
+ </div>
+ </form>
+</div>
\ No newline at end of file
diff --git a/console/app/templates/console.hbs b/console/app/templates/console.hbs
new file mode 100644
index 00000000..d21181db
--- /dev/null
+++ b/console/app/templates/console.hbs
@@ -0,0 +1,15 @@
+{{page-title "Console"}}
+<Layout::Container>
+ <Layout::Header @brand={{@model}} @user={{this.user}} @organizations={{this.organizations}} @menuItems={{this.universe.headerMenuItems}} @extensions={{this.extensions}} @onAction={{this.onAction}} />
+ <Layout::Main>
+ <Layout::Sidebar @onSetup={{this.setSidebarContext}}>
+ <div class="next-sidebar-content-inner">
+ <div role="menu" id="sidebar-menu-items"></div>
+ </div>
+ </Layout::Sidebar>
+ <Layout::Section>
+ {{outlet}}
+ </Layout::Section>
+ </Layout::Main>
+ <Layout::MobileNavbar @brand={{@model}} @user={{this.user}} @organizations={{this.organizations}} @menuItems={{this.universe.headerMenuItems}} @extensions={{this.extensions}} @onAction={{this.onAction}} />
+</Layout::Container>
\ No newline at end of file
diff --git a/console/app/templates/console/account.hbs b/console/app/templates/console/account.hbs
new file mode 100644
index 00000000..1340ac5c
--- /dev/null
+++ b/console/app/templates/console/account.hbs
@@ -0,0 +1,18 @@
+{{page-title "Account"}}
+<EmberWormhole @to="sidebar-menu-items">
+ <Layout::Sidebar::Panel @open={{true}} @title="Account">
+ <Layout::Sidebar::Item @route="console.account.index" @icon="user">Profile</Layout::Sidebar::Item>
+ {{#each this.universe.accountMenuItems as |menuItem|}}
+ <Layout::Sidebar::Item @onClick={{fn this.universe.transitionMenuItem "console.account.virtual" menuItem}} @item={{menuItem}} @icon={{menuItem.icon}}>{{menuItem.title}}</Layout::Sidebar::Item>
+ {{/each}}
+ </Layout::Sidebar::Panel>
+ {{#each this.universe.accountMenuPanels as |menuPanel|}}
+ <Layout::Sidebar::Panel @open={{menuPanel.open}} @title={{menuPanel.title}}>
+ {{#each menuPanel.items as |menuItem|}}
+ <Layout::Sidebar::Item @onClick={{fn this.universe.transitionMenuItem "console.account.virtual" menuItem}} @item={{menuItem}} @icon={{menuItem.icon}}>{{menuItem.title}}</Layout::Sidebar::Item>
+ {{/each}}
+ </Layout::Sidebar::Panel>
+ {{/each}}
+</EmberWormhole>
+
+{{outlet}}
\ No newline at end of file
diff --git a/console/app/templates/console/account/index.hbs b/console/app/templates/console/account/index.hbs
new file mode 100644
index 00000000..472e6836
--- /dev/null
+++ b/console/app/templates/console/account/index.hbs
@@ -0,0 +1,45 @@
+<Layout::Section::Header @title="Profile" />
+
+<Layout::Section::Body class="overflow-y-scroll h-full">
+ <div class="container mx-auto h-screen" {{increase-height-by 500}}>
+ <div class="max-w-3xl my-10 mx-auto">
+ <ContentPanel @title="Your Profile" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
+ <form class="flex flex-col md:flex-row" {{on "submit" this.saveProfile}}>
+ <div class="w-32 flex flex-col justify-center mb-6 mr-6">
+ <Image src={{this.user.avatar_url}} @fallbackSrc={{config "defaultValues.userImage"}} alt={{this.user.name}} class="w-32 h-32 rounded-md" />
+ <FileUpload @name="photos" @accept="image/*" @onFileAdded={{this.uploadNewPhoto}} @labelClass="flex flex-row items-center justify-center" as |queue|>
+ <a tabindex={{0}} class="flex items-center px-0 mt-2 text-xs no-underline truncate btn btn-sm btn-default" disabled={{queue.files.length}}>
+ {{#if queue.files.length}}
+ <div class="mr-1.5">
+ <Spinner />
+ </div>
+ <span>
+ Uploading...
+ </span>
+ {{else}}
+ <FaIcon @icon="image" class="mr-1.5" />
+ <span>
+ Upload new
+ </span>
+ {{/if}}
+ </a>
+ </FileUpload>
+ </div>
+ <div class="flex-1">
+ <div class="grid grid-cols-1 lg:grid-cols-2 gap-2 text-xs dark:text-gray-100">
+ <InputGroup @name="Name" @value={{this.user.name}} />
+ <InputGroup @name="Email" @type="email" @value={{this.user.email}} />
+ <InputGroup @name="Your phone number" @helpText="Your phone number.">
+ <PhoneInput @value={{this.user.phone}} @onInput={{fn (mut this.user.phone)}} class="form-input input-lg w-full" />
+ </InputGroup>
+ <InputGroup @name="Date of Birth" @type="date" @value={{this.user.date_of_birth}} />
+ </div>
+ <div class="mt-3 flex items-center justify-end">
+ <Button @buttonType="submit" @type="primary" @size="lg" @icon="save" @text="Save Changes" @onClick={{this.saveProfile}} @isLoading={{this.isLoading}} />
+ </div>
+ </div>
+ </form>
+ </ContentPanel>
+ </div>
+ </div>
+</Layout::Section::Body>
\ No newline at end of file
diff --git a/console/app/templates/console/account/virtual.hbs b/console/app/templates/console/account/virtual.hbs
new file mode 100644
index 00000000..46c367b6
--- /dev/null
+++ b/console/app/templates/console/account/virtual.hbs
@@ -0,0 +1,10 @@
+{{page-title @model.title}}
+<Layout::Section::Header @title={{@model.title}} />
+
+<Layout::Section::Body class="overflow-y-scroll h-full">
+ <div class="container mx-auto h-screen" {{increase-height-by 300}}>
+ <div class="max-w-3xl my-10 mx-auto space-y-">
+ {{component @model.component [email protected]}}
+ </div>
+ </div>
+</Layout::Section::Body>
\ No newline at end of file
diff --git a/console/app/templates/console/admin.hbs b/console/app/templates/console/admin.hbs
new file mode 100644
index 00000000..0016e8d4
--- /dev/null
+++ b/console/app/templates/console/admin.hbs
@@ -0,0 +1,26 @@
+{{page-title "Admin"}}
+
+<EmberWormhole @to="sidebar-menu-items">
+ <Layout::Sidebar::Item @route="console.admin.index" @icon="rectangle-list">Overview</Layout::Sidebar::Item>
+ <Layout::Sidebar::Item @route="console.admin.branding" @icon="palette">Branding</Layout::Sidebar::Item>
+ {{#each this.universe.adminMenuItems as |menuItem|}}
+ <Layout::Sidebar::Item @onClick={{fn this.universe.transitionMenuItem "console.admin.virtual" menuItem}} @item={{menuItem}} @icon={{menuItem.icon}}>{{menuItem.title}}</Layout::Sidebar::Item>
+ {{/each}}
+ {{#each this.universe.adminMenuPanels as |menuPanel|}}
+ <Layout::Sidebar::Panel @open={{menuPanel.open}} @title={{menuPanel.title}}>
+ {{#each menuPanel.items as |menuItem|}}
+ <Layout::Sidebar::Item @onClick={{fn this.universe.transitionMenuItem "console.admin.virtual" menuItem}} @item={{menuItem}} @icon={{menuItem.icon}}>{{menuItem.title}}</Layout::Sidebar::Item>
+ {{/each}}
+ </Layout::Sidebar::Panel>
+ {{/each}}
+ <Layout::Sidebar::Panel @open={{true}} @title="System Config">
+ <Layout::Sidebar::Item @route="console.admin.config.services" @icon="bell-concierge">Services</Layout::Sidebar::Item>
+ <Layout::Sidebar::Item @route="console.admin.config.mail" @icon="envelope">Mail</Layout::Sidebar::Item>
+ <Layout::Sidebar::Item @route="console.admin.config.filesystem" @icon="hard-drive">Filesystem</Layout::Sidebar::Item>
+ <Layout::Sidebar::Item @route="console.admin.config.queue" @icon="layer-group">Queue</Layout::Sidebar::Item>
+ <Layout::Sidebar::Item @route="console.admin.config.socket" @icon="plug">Socket</Layout::Sidebar::Item>
+ <Layout::Sidebar::Item @route="console.admin.config.notification-channels" @icon="tower-broadcast">Notification Channels</Layout::Sidebar::Item>
+ </Layout::Sidebar::Panel>
+</EmberWormhole>
+
+{{outlet}}
\ No newline at end of file
diff --git a/console/app/templates/console/admin/branding.hbs b/console/app/templates/console/admin/branding.hbs
new file mode 100644
index 00000000..a4aae904
--- /dev/null
+++ b/console/app/templates/console/admin/branding.hbs
@@ -0,0 +1,68 @@
+{{page-title "Branding"}}
+<Layout::Section::Header @title="Branding" />
+
+<Layout::Section::Body class="overflow-y-scroll h-full">
+ <div class="container mx-auto h-screen" {{increase-height-by 300}}>
+ <div class="max-w-3xl my-10 mx-auto space-y-">
+ <ContentPanel @title="Branding" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
+ <form class="flex flex-col" {{on "submit" this.save}}>
+ <div class="input-group">
+ <label>Icon</label>
+ <div class="flex flex-row items-center space-x-2">
+ <Image src={{@model.icon_url}} @fallbackSrc="/images/icon.png" alt={{t "app.name"}} width="32" height="32" class="w-8 h-8 shadow-sm" />
+ <FileUpload @name="icon" @accept="image/*" @onFileAdded={{this.uploadIcon}} @labelClass="flex flex-row items-center justify-center mb-0i" as |queue|>
+ <a tabindex={{0}} class="flex items-center px-0 text-xs no-underline truncate btn btn-sm btn-default" disabled={{queue.files.length}}>
+ {{#if queue.files.length}}
+ <div class="mr-1.5">
+ <Spinner />
+ </div>
+ <span>
+ Uploading...
+ </span>
+ {{else}}
+ <FaIcon @icon="image" class="mr-1.5" />
+ <span>
+ Upload new
+ </span>
+ {{/if}}
+ </a>
+ </FileUpload>
+ </div>
+ <a href="javascript:;" class="text-danger text-xs mt-1" {{on "click" (fn this.unset "icon_url" "/images/icon.png")}}>Reset to default</a>
+ </div>
+ <div class="input-group">
+ <label>Logo</label>
+ <div class="flex flex-row items-center space-x-2">
+ <Image src={{@model.logo_url}} @fallbackSrc="/images/fleetbase-logo-svg.svg" alt={{t "app.name"}} width="160" height="56" class="w-40 h-14" />
+ <FileUpload @name="logo" @accept="image/*" @onFileAdded={{this.uploadLogo}} @labelClass="flex flex-row items-center justify-center mb-0i" as |queue|>
+ <a tabindex={{0}} class="flex items-center px-0 text-xs no-underline truncate btn btn-sm btn-default" disabled={{queue.files.length}}>
+ {{#if queue.files.length}}
+ <div class="mr-1.5">
+ <Spinner />
+ </div>
+ <span>
+ Uploading...
+ </span>
+ {{else}}
+ <FaIcon @icon="image" class="mr-1.5" />
+ <span>
+ Upload new
+ </span>
+ {{/if}}
+ </a>
+ </FileUpload>
+ </div>
+ <a href="javascript:;" class="text-danger text-xs mt-1" {{on "click" (fn this.unset "logo_url" "/images/fleetbase-logo-svg.svg")}}>Reset to default</a>
+ </div>
+ <InputGroup @name="Default Theme">
+ <Select @value={{@model.default_theme}} @onSelect={{this.setTheme}} @options={{this.themeOptions}} />
+ </InputGroup>
+ </form>
+ </ContentPanel>
+
+ <div class="mt-3 flex items-center justify-end">
+ <Button @type="primary" @size="lg" @icon="save" @text="Save Changes" @onClick={{this.save}} @disabled={{this.isLoading}} @isLoading={{this.isLoading}} />
+ </div>
+ </div>
+ </div>
+</Layout::Section::Body>
\ No newline at end of file
diff --git a/console/app/templates/console/admin/config.hbs b/console/app/templates/console/admin/config.hbs
new file mode 100644
index 00000000..ce328715
--- /dev/null
+++ b/console/app/templates/console/admin/config.hbs
@@ -0,0 +1,2 @@
+{{page-title "System Configuration"}}
+{{outlet}}
\ No newline at end of file
diff --git a/console/app/templates/console/admin/config/cache.hbs b/console/app/templates/console/admin/config/cache.hbs
new file mode 100644
index 00000000..8ce6dc9b
--- /dev/null
+++ b/console/app/templates/console/admin/config/cache.hbs
@@ -0,0 +1,2 @@
+{{page-title "Cache"}}
+{{outlet}}
\ No newline at end of file
diff --git a/console/app/templates/console/admin/config/database.hbs b/console/app/templates/console/admin/config/database.hbs
new file mode 100644
index 00000000..1326ac5f
--- /dev/null
+++ b/console/app/templates/console/admin/config/database.hbs
@@ -0,0 +1,10 @@
+{{page-title "Database Configuration"}}
+<Layout::Section::Header @title="Database Configuration" />
+
+<Layout::Section::Body class="overflow-y-scroll h-full">
+ <div class="container mx-auto h-screen" {{increase-height-by 800}}>
+ <div class="max-w-3xl my-10 mx-auto space-y-6">
+ <Configure::Database />
+ </div>
+ </div>
+</Layout::Section::Body>
\ No newline at end of file
diff --git a/console/app/templates/console/admin/config/filesystem.hbs b/console/app/templates/console/admin/config/filesystem.hbs
new file mode 100644
index 00000000..b47e1a70
--- /dev/null
+++ b/console/app/templates/console/admin/config/filesystem.hbs
@@ -0,0 +1,10 @@
+{{page-title "Filesystem Configuration"}}
+<Layout::Section::Header @title="Filesystem Configuration" />
+
+<Layout::Section::Body class="overflow-y-scroll h-full">
+ <div class="container mx-auto h-screen" {{increase-height-by 800}}>
+ <div class="max-w-3xl my-10 mx-auto space-y-6">
+ <Configure::Filesystem />
+ </div>
+ </div>
+</Layout::Section::Body>
\ No newline at end of file
diff --git a/console/app/templates/console/admin/config/mail.hbs b/console/app/templates/console/admin/config/mail.hbs
new file mode 100644
index 00000000..0ab0d574
--- /dev/null
+++ b/console/app/templates/console/admin/config/mail.hbs
@@ -0,0 +1,10 @@
+{{page-title "Mail Configuration"}}
+<Layout::Section::Header @title="Mail Configuration" />
+
+<Layout::Section::Body class="overflow-y-scroll h-full">
+ <div class="container mx-auto h-screen" {{increase-height-by 800}}>
+ <div class="max-w-3xl my-10 mx-auto space-y-6">
+ <Configure::Mail />
+ </div>
+ </div>
+</Layout::Section::Body>
\ No newline at end of file
diff --git a/console/app/templates/console/admin/config/notification-channels.hbs b/console/app/templates/console/admin/config/notification-channels.hbs
new file mode 100644
index 00000000..3df85758
--- /dev/null
+++ b/console/app/templates/console/admin/config/notification-channels.hbs
@@ -0,0 +1,10 @@
+{{page-title "Notification Channels Configuration"}}
+<Layout::Section::Header @title="Notification Channels Configuration" />
+
+<Layout::Section::Body class="overflow-y-scroll h-full">
+ <div class="container mx-auto h-screen" {{increase-height-by 800}}>
+ <div class="max-w-3xl my-10 mx-auto space-y-6">
+ <Configure::NotificationChannels />
+ </div>
+ </div>
+</Layout::Section::Body>
\ No newline at end of file
diff --git a/console/app/templates/console/admin/config/queue.hbs b/console/app/templates/console/admin/config/queue.hbs
new file mode 100644
index 00000000..f7454b1a
--- /dev/null
+++ b/console/app/templates/console/admin/config/queue.hbs
@@ -0,0 +1,10 @@
+{{page-title "Queue Configuration"}}
+<Layout::Section::Header @title="Queue Configuration" />
+
+<Layout::Section::Body class="overflow-y-scroll h-full">
+ <div class="container mx-auto h-screen" {{increase-height-by 800}}>
+ <div class="max-w-3xl my-10 mx-auto space-y-6">
+ <Configure::Queue />
+ </div>
+ </div>
+</Layout::Section::Body>
\ No newline at end of file
diff --git a/console/app/templates/console/admin/config/services.hbs b/console/app/templates/console/admin/config/services.hbs
new file mode 100644
index 00000000..4e5a1645
--- /dev/null
+++ b/console/app/templates/console/admin/config/services.hbs
@@ -0,0 +1,10 @@
+{{page-title "Services Configuration"}}
+<Layout::Section::Header @title="Services Configuration" />
+
+<Layout::Section::Body class="overflow-y-scroll h-full">
+ <div class="container mx-auto h-screen" {{increase-height-by 900}}>
+ <div class="max-w-3xl my-10 mx-auto space-y-6">
+ <Configure::Services />
+ </div>
+ </div>
+</Layout::Section::Body>
\ No newline at end of file
diff --git a/console/app/templates/console/admin/config/socket.hbs b/console/app/templates/console/admin/config/socket.hbs
new file mode 100644
index 00000000..86008a71
--- /dev/null
+++ b/console/app/templates/console/admin/config/socket.hbs
@@ -0,0 +1,10 @@
+{{page-title "Socket Configuration"}}
+<Layout::Section::Header @title="Socket Configuration" />
+
+<Layout::Section::Body class="overflow-y-scroll h-full">
+ <div class="container mx-auto h-screen" {{increase-height-by 900}}>
+ <div class="max-w-3xl my-10 mx-auto space-y-6">
+ <Configure::Socket />
+ </div>
+ </div>
+</Layout::Section::Body>
\ No newline at end of file
diff --git a/console/app/templates/console/admin/index.hbs b/console/app/templates/console/admin/index.hbs
new file mode 100644
index 00000000..8109b2ab
--- /dev/null
+++ b/console/app/templates/console/admin/index.hbs
@@ -0,0 +1,14 @@
+{{page-title "Overview"}}
+<Layout::Section::Header @title="Overview" />
+
+<Layout::Section::Body class="overflow-y-scroll h-full">
+ <div class="container mx-auto h-screen" {{increase-height-by 800}}>
+ <div class="max-w-3xl my-10 mx-auto space-y-6">
+ <div class="grid grid-cols-3 xs:grid-cols-1 gap-4">
+ <StatWidget @title="Total Users" @value={{@model.total_users}} />
+ <StatWidget @title="Total Organizations" @value={{@model.total_organizations}} />
+ <StatWidget @title="Total Transactions" @value={{@model.total_transactions}} />
+ </div>
+ </div>
+ </div>
+</Layout::Section::Body>
\ No newline at end of file
diff --git a/console/app/templates/console/admin/virtual.hbs b/console/app/templates/console/admin/virtual.hbs
new file mode 100644
index 00000000..46c367b6
--- /dev/null
+++ b/console/app/templates/console/admin/virtual.hbs
@@ -0,0 +1,10 @@
+{{page-title @model.title}}
+<Layout::Section::Header @title={{@model.title}} />
+
+<Layout::Section::Body class="overflow-y-scroll h-full">
+ <div class="container mx-auto h-screen" {{increase-height-by 300}}>
+ <div class="max-w-3xl my-10 mx-auto space-y-">
+ {{component @model.component [email protected]}}
+ </div>
+ </div>
+</Layout::Section::Body>
\ No newline at end of file
diff --git a/console/app/templates/console/extensions.hbs b/console/app/templates/console/extensions.hbs
new file mode 100644
index 00000000..5c1c5360
--- /dev/null
+++ b/console/app/templates/console/extensions.hbs
@@ -0,0 +1,12 @@
+{{page-title "Extensions"}}
+<Layout::Section::Body class="overflow-y-scroll h-full pt-6">
+ <div class="container mx-auto h-screen space-y-4">
+ <div class="flex flex-col items-center justify-center pt-14 px-40">
+ <FaIcon @icon="shapes" @size="4x" class="mb-6 text-blue-500" />
+ <h1 class="dark:text-gray-100 text-black text-4xl font-bold mb-4">Extensions are coming soon!</h1>
+ <p class="dark:text-gray-300 text-black text-lg">
+ Please check back in the upcoming versions as we prepare to launch the Extensions repository and marketplace.
+ </p>
+ </div>
+ </div>
+</Layout::Section::Body>
\ No newline at end of file
diff --git a/console/app/templates/console/home.hbs b/console/app/templates/console/home.hbs
new file mode 100644
index 00000000..12a2c391
--- /dev/null
+++ b/console/app/templates/console/home.hbs
@@ -0,0 +1,10 @@
+{{page-title "Dashboard"}}
+<Layout::Section::Body class="overflow-y-scroll h-full pt-6">
+ <div class="container mx-auto h-screen space-y-4" {{increase-height-by 300}}>
+ <div class="grid grid-cols-1 md:grid-cols-12 gap-4">
+ <GithubCard class="lg:col-span-4" />
+ <FleetbaseBlog class="lg:col-span-8" />
+ </div>
+ <Dashboard @sidebar={{this.sidebarContext}} />
+ </div>
+</Layout::Section::Body>
\ No newline at end of file
diff --git a/console/app/templates/console/settings.hbs b/console/app/templates/console/settings.hbs
new file mode 100644
index 00000000..39e5f2ec
--- /dev/null
+++ b/console/app/templates/console/settings.hbs
@@ -0,0 +1,18 @@
+{{page-title "Settings"}}
+<EmberWormhole @to="sidebar-menu-items">
+ <Layout::Sidebar::Panel @open={{true}} @title="Settings">
+ <Layout::Sidebar::Item @route="console.settings.index" @icon="cog">Organization</Layout::Sidebar::Item>
+ {{#each this.universe.settingsMenuItems as |menuItem|}}
+ <Layout::Sidebar::Item @onClick={{fn this.universe.transitionMenuItem "console.settings.virtual" menuItem}} @item={{menuItem}} @icon={{menuItem.icon}}>{{menuItem.title}}</Layout::Sidebar::Item>
+ {{/each}}
+ </Layout::Sidebar::Panel>
+ {{#each this.universe.settingsMenuPanels as |menuPanel|}}
+ <Layout::Sidebar::Panel @open={{menuPanel.open}} @title={{menuPanel.title}}>
+ {{#each menuPanel.items as |menuItem|}}
+ <Layout::Sidebar::Item @onClick={{fn this.universe.transitionMenuItem "console.settings.virtual" menuItem}} @item={{menuItem}} @icon={{menuItem.icon}}>{{menuItem.title}}</Layout::Sidebar::Item>
+ {{/each}}
+ </Layout::Sidebar::Panel>
+ {{/each}}
+</EmberWormhole>
+
+{{outlet}}
\ No newline at end of file
diff --git a/console/app/templates/console/settings/index.hbs b/console/app/templates/console/settings/index.hbs
new file mode 100644
index 00000000..fe04e47d
--- /dev/null
+++ b/console/app/templates/console/settings/index.hbs
@@ -0,0 +1,68 @@
+<Layout::Section::Header @title="Organization Settings" />
+
+<Layout::Section::Body class="overflow-y-scroll h-full">
+ <div class="container mx-auto h-screen" {{increase-height-by 500}}>
+ <div class="max-w-3xl my-10 mx-auto space-y-6">
+ <ContentPanel @title="Organization Settings" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
+ <form {{on "submit" this.saveSettings}}>
+ <InputGroup @name="Organization name" @value={{@model.name}} />
+ <InputGroup @name="Organization description" @value={{@model.description}} />
+ <InputGroup @name="Organization phone number">
+ <PhoneInput @value={{@model.phone}} @onInput={{fn (mut @model.phone)}} class="form-input w-full" />
+ </InputGroup>
+ <InputGroup @name="Organization currency">
+ <CurrencySelect @value={{@model.currency}} @onSelect={{fn (mut @model.currency)}} @triggerClass="w-full form-select" />
+ </InputGroup>
+ <InputGroup @name="Organization ID" @value={{@model.public_id}} @disabled={{true}} />
+ <div class="mt-3 flex items-center justify-end">
+ <Button @buttonType="submit" @type="primary" @size="lg" @icon="save" @text="Save Changes" @isLoading={{this.isLoading}} />
+ </div>
+ </form>
+ </ContentPanel>
+
+ <ContentPanel @title="Organization Branding" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
+ <InputGroup @name="Logo" @helpText="Logo for your organization.">
+ <div class="flex flex-row items-center">
+ <Image src={{@model.logo_url}} @fallbackSrc={{config "defaultValues.placeholderImage"}} alt={{concat @model.name " logo"}} class="h-20 w-64 border dark:border-gray-900 rounded-md mr-4" />
+ <FileUpload @name="logo" @accept="image/*" @onFileAdded={{fn this.uploadFile "logo"}} as |queue|>
+ <a tabindex={{0}} class="flex items-center px-0 mt-2 text-xs no-underline truncate btn btn-sm btn-default">
+ {{#if queue.files.length}}
+ <Spinner class="mr-1" />
+ <span>
+ Uploading...
+ </span>
+ {{else}}
+ <FaIcon @icon="image" class="mr-1" />
+ <span>
+ Upload new logo
+ </span>
+ {{/if}}
+ </a>
+ </FileUpload>
+ </div>
+ </InputGroup>
+
+ <InputGroup @name="Backdrop" @helpText="Optional banner or background image for your organization.">
+ <div class="flex flex-row items-center">
+ <Image src={{@model.backdrop_url}} @fallbackSrc={{config "defaultValues.placeholderImage"}} alt={{concat @model.name " backdrop"}} class="h-20 w-64 border dark:border-gray-900 rounded-md mr-4" />
+ <FileUpload @name="backdrop" @accept="image/*" @onFileAdded={{fn this.uploadFile "backdrop"}} as |queue|>
+ <a tabindex={{0}} class="flex items-center px-0 mt-2 text-xs no-underline truncate btn btn-sm btn-default">
+ {{#if queue.files.length}}
+ <Spinner class="mr-1" />
+ <span>
+ Uploading...
+ </span>
+ {{else}}
+ <FaIcon @icon="image" class="mr-1" />
+ <span>
+ Upload new backdrop
+ </span>
+ {{/if}}
+ </a>
+ </FileUpload>
+ </div>
+ </InputGroup>
+ </ContentPanel>
+ </div>
+ </div>
+</Layout::Section::Body>
\ No newline at end of file
diff --git a/console/app/templates/console/settings/virtual.hbs b/console/app/templates/console/settings/virtual.hbs
new file mode 100644
index 00000000..46c367b6
--- /dev/null
+++ b/console/app/templates/console/settings/virtual.hbs
@@ -0,0 +1,10 @@
+{{page-title @model.title}}
+<Layout::Section::Header @title={{@model.title}} />
+
+<Layout::Section::Body class="overflow-y-scroll h-full">
+ <div class="container mx-auto h-screen" {{increase-height-by 300}}>
+ <div class="max-w-3xl my-10 mx-auto space-y-">
+ {{component @model.component [email protected]}}
+ </div>
+ </div>
+</Layout::Section::Body>
\ No newline at end of file
diff --git a/console/app/templates/console/virtual.hbs b/console/app/templates/console/virtual.hbs
new file mode 100644
index 00000000..46c367b6
--- /dev/null
+++ b/console/app/templates/console/virtual.hbs
@@ -0,0 +1,10 @@
+{{page-title @model.title}}
+<Layout::Section::Header @title={{@model.title}} />
+
+<Layout::Section::Body class="overflow-y-scroll h-full">
+ <div class="container mx-auto h-screen" {{increase-height-by 300}}>
+ <div class="max-w-3xl my-10 mx-auto space-y-">
+ {{component @model.component [email protected]}}
+ </div>
+ </div>
+</Layout::Section::Body>
\ No newline at end of file
diff --git a/console/app/templates/install.hbs b/console/app/templates/install.hbs
new file mode 100644
index 00000000..b3fc16a6
--- /dev/null
+++ b/console/app/templates/install.hbs
@@ -0,0 +1,34 @@
+<div class="max-w-2xl m-auto h-screen overflow-y-scroll">
+ <div class="h-full">
+ <div class="border border-black bg-gray-900 shadow-md rounded-md p-5 mt-12">
+ <div class="w-full flex-col items-center justify-center text-center mb-6">
+ <img src="/images/icon.png" alt={{concat (t "app.name") " Install"}} class="w-12 h-12 mx-auto" width="48" height="48" />
+ <h3 class="mt-2 text-gray-50 font-bold">{{t "app.name"}} Installer</h3>
+ </div>
+ <div class="space-y-4 mb-5">
+ {{#each this.steps as |step|}}
+ <div class="border {{if (eq step.status 'pending') 'border-black bg-gray-800'}} {{if (eq step.status 'in_progress') "border-blue-500 bg-blue-900"}} {{if (eq step.status 'completed') 'border-green-900 bg-green-800'}} {{if (eq step.status 'failed') 'border-red-900 bg-red-800'}} shadow-md px-4 py-2 flex flex-row items-center rounded-xl">
+ <div class="w-12 flex flex-row items-center">
+ <FaIcon @icon="circle-check" class="{{if (eq step.status 'pending') "text-gray-500"}} {{if (eq step.status 'in_progress') "text-blue-200"}} {{if (eq step.status 'completed') "text-green-400"}} {{if (eq step.status 'failed') "text-red-400"}}" />
+ {{#if (eq step.status 'in_progress')}}
+ <div class="ml-2 -mb-0.5">
+ <Spinner />
+ </div>
+ {{/if}}
+ </div>
+ <span class="{{if (eq step.status 'pending') "text-gray-500"}} {{if (eq step.status 'in_progress') "text-blue-200"}} {{if (eq step.status 'completed') "text-green-400"}} {{if (eq step.status 'failed') "text-red-400"}} font-semibold">{{step.name}}</span>
+ </div>
+ {{/each}}
+ </div>
+ <div class="flex flex-col flex-1 my-1">
+ {{#if this.error}}
+ <div class="flex items-center border border-red-900 bg-red-800 text-red-100 px-4 py-1.5 rounded-lg mb-3 shadow-md">
+ <FaIcon @icon="triangle-exclamation" class="text-red-100 mr-2" />
+ <span>The install failed! Click the button below to retry the install.</span>
+ </div>
+ {{/if}}
+ <Button @type="primary" @icon="play" @size="lg" @text={{if this.error "Retry Install" "Start Install"}} @wrapperClass="flex-1" class="w-full" @onClick={{this.startInstall}} @isLoading={{this.install.isRunning}} @disabled={{this.install.isRunning}} />
+ </div>
+ </div>
+ </div>
+</div>
\ No newline at end of file
diff --git a/console/app/templates/invite.hbs b/console/app/templates/invite.hbs
new file mode 100644
index 00000000..b6129030
--- /dev/null
+++ b/console/app/templates/invite.hbs
@@ -0,0 +1,2 @@
+{{page-title "Invite"}}
+{{outlet}}
\ No newline at end of file
diff --git a/console/app/templates/invite/for-driver.hbs b/console/app/templates/invite/for-driver.hbs
new file mode 100644
index 00000000..f2ed0acc
--- /dev/null
+++ b/console/app/templates/invite/for-driver.hbs
@@ -0,0 +1,2 @@
+{{page-title "ForDriver"}}
+{{outlet}}
\ No newline at end of file
diff --git a/console/app/templates/invite/for-user.hbs b/console/app/templates/invite/for-user.hbs
new file mode 100644
index 00000000..6991dfc9
--- /dev/null
+++ b/console/app/templates/invite/for-user.hbs
@@ -0,0 +1,36 @@
+<div class="min-h-screen bg-gray-50 dark:bg-gray-900 flex flex-col justify-center py-12">
+ <div class="mt-8 sm:mx-auto sm:w-full sm:max-w-md">
+ <div class="bg-white dark:bg-gray-800 py-8 px-4 shadow sm:rounded-lg sm:px-10">
+ <div class="mb-8">
+ <img class="mx-auto h-12 w-auto" src={{@brand.icon_url}} alt={{t "app.name"}}>
+ <h2 class="mt-6 text-center text-lg font-extrabold text-gray-900 dark:text-white truncate">
+ You've been invited to join {{@model.name}}
+ </h2>
+ </div>
+
+ <div class="flex px-3 py-2 mb-6 rounded-md shadow-sm bg-blue-200">
+ <div>
+ <FaIcon @icon="info-circle" class="text-blue-900 mr-4" />
+ </div>
+ <p class="flex-1 text-sm text-blue-900 dark:text-blue-900">
+ You've been invited to join the {{@model.name}} organization on {{t "app.name"}}. To accept this invitation, input your invitation code received by email and click continue.
+ </p>
+ </div>
+
+ <form class="space-y-6" {{on "submit" this.acceptInvite}}>
+ <div>
+ <label for="code" class="block text-sm font-medium text-gray-700 dark:text-gray-50">
+ Your invitiation code
+ </label>
+ <div class="mt-2">
+ <Input @value={{this.code}} id="code" name="code" @type="code" required class="form-input form-input-lg w-full" placeholder="Your invitiation code" />
+ </div>
+ </div>
+
+ <div>
+ <Button @icon="check" @size="lg" @type="primary" @buttonType="submit" @text="Accept Invitation" @onClick={{this.acceptInvite}} @isLoading={{this.isLoading}} />
+ </div>
+ </form>
+ </div>
+ </div>
+</div>
\ No newline at end of file
diff --git a/console/app/templates/onboard.hbs b/console/app/templates/onboard.hbs
new file mode 100644
index 00000000..b9d79ecf
--- /dev/null
+++ b/console/app/templates/onboard.hbs
@@ -0,0 +1,5 @@
+<div class="flex items-center justify-center h-screen min-h-screen px-4 py-12 bg-gray-50 dark:bg-gray-900 sm:px-6 lg:px-8 overflow-y-scroll">
+ <div class="w-full max-w-md h-screen flex items-center justify-center py-4" {{increase-height-by 300}}>
+ {{outlet}}
+ </div>
+</div>
\ No newline at end of file
diff --git a/console/app/templates/onboard/index.hbs b/console/app/templates/onboard/index.hbs
new file mode 100644
index 00000000..050990bf
--- /dev/null
+++ b/console/app/templates/onboard/index.hbs
@@ -0,0 +1,36 @@
+<div class="bg-white dark:bg-gray-800 py-5 px-4 shadow rounded-lg w-full">
+ <div class="mb-4">
+ <Image src={{@model.logo_url}} @fallbackSrc="/images/fleetbase-logo-svg.svg" alt={{t "app.name"}} width="160" height="56" class="w-40 h-14 mx-auto" />
+ <h2 class="text-center text-lg font-extrabold text-gray-900 dark:text-white truncate">
+ Create your account
+ </h2>
+ </div>
+
+ <div class="flex px-3 py-2 mb-4 rounded-md shadow-sm bg-blue-200">
+ <div>
+ <FaIcon @icon="hand-spock" @size="lg" class="text-blue-900 mr-4" />
+ </div>
+ <p class="flex-1 text-sm text-blue-900 dark:text-blue-900">
+ <strong>Welcome to {{t "app.name"}}!</strong><br />
+ Complete the details required below to get started.
+ </p>
+ </div>
+
+ <form {{on "submit" this.startOnboard}}>
+ {{#if this.error}}
+ <InfoBlock @icon="exclamation-triangle" @text={{this.error}} class="mb-6 px-3 py-2 bg-red-300 text-red-900" @textClass="text-red-900" />
+ {{/if}}
+ <InputGroup @name="Your full name" @value={{this.name}} @helpText="Your full name." @inputClass="input-lg" />
+ <InputGroup @name="Your email address" @type="email" @value={{this.email}} @helpText="Your email address." @inputClass="input-lg" />
+ <InputGroup @name="Your phone number" @helpText="Your phone number.">
+ <PhoneInput @onInput={{fn (mut this.phone)}} class="form-input input-lg w-full" />
+ </InputGroup>
+ <InputGroup @name="Organization name" @value={{this.organization_name}} @helpText="Your organization name, all your services and resources will be managed under this organization, later you can create as many organizations as you want or need." @inputClass="input-lg" />
+ <InputGroup @name="Enter a password" @value={{this.password}} @type="password" @helpText="Your password, make sure it's a good one." @inputClass="input-lg" />
+ <InputGroup @name="Confirm your password" @value={{this.password_confirmation}} @type="password" @helpText="Just to confirm the password you entered above." @inputClass="input-lg" />
+
+ <div class="flex items-center justify-end mt-5">
+ <Button @icon="check" @iconPrefix="fas" @type="primary" @size="lg" @text="Continue" @isLoading={{this.isLoading}} @disabled={{this.readyToSubmit}} @onClick={{this.startOnboard}} />
+ </div>
+ </form>
+</div>
\ No newline at end of file
diff --git a/console/app/templates/onboard/verify-email.hbs b/console/app/templates/onboard/verify-email.hbs
new file mode 100644
index 00000000..0e42ca76
--- /dev/null
+++ b/console/app/templates/onboard/verify-email.hbs
@@ -0,0 +1,45 @@
+<div class="bg-white dark:bg-gray-800 py-8 px-4 shadow rounded-lg w-full">
+ <div class="mb-8">
+ <img class="mx-auto h-12 w-auto " src="/images/fleetbase-logo-svg.svg" alt={{t "app.name"}}>
+ <h2 class="mt-6 text-center text-lg font-extrabold text-gray-900 dark:text-white truncate">
+ Verify your email address
+ </h2>
+ </div>
+
+ <div class="flex px-3 py-2 mb-6 rounded-md shadow-sm bg-blue-200">
+ <div>
+ <FaIcon @icon="shield-check" @size="lg" class="text-blue-900 mr-4" />
+ </div>
+ <p class="flex-1 text-sm text-blue-900 dark:text-blue-900">
+ <strong>Almost done!</strong><br> Check your email for a verification code.
+ </p>
+ </div>
+
+ <form class="mt-8 space-y-6" {{on "submit" this.verifyCode}}>
+ <InputGroup @type="tel" @name="Verification Code" @value={{this.code}} @helpText="Enter the verification code you received via email." @inputClass="input-lg" {{on "input" this.validateInput}} />
+
+ <div>
+ <Button @icon="check" @iconPrefix="fas" @buttonType="submit" @type="primary" @size="lg" @text="Verify & Continue" @isLoading={{this.isLoading}} @disabled={{this.isNotReadyToSubmit}} @onClick={{this.verifyCode}} />
+ </div>
+
+ {{#if this.stillWaiting}}
+ <div class="bg-yellow-50 rounded shadow-sm border-l-4 border-yellow-400 px-4 py-2">
+ <div class="flex">
+ <div class="flex-shrink-0">
+ <FaIcon @icon="exclamation-triangle" @size="lg" class="text-yellow-400" />
+ </div>
+ <div class="ml-3 flex items-center">
+ <span class="text-lg font-extrabold text-yellow-800">Didn't receive an email yet?</span>
+ </div>
+ </div>
+ <div class="py-3">
+ <p class="text-yellow-700">Use alternaitve options below to verify your account.</p>
+ <div class="flex items-center mt-3">
+ <Button @type="default" class="mr-2" @onClick={{this.resendEmail}}>Resend Email</Button>
+ <Button @type="default" @onClick={{this.resendBySms}}>Send by SMS</Button>
+ </div>
+ </div>
+ </div>
+ {{/if}}
+ </form>
+</div>
\ No newline at end of file
diff --git a/console/app/utils/get-permission-action.js b/console/app/utils/get-permission-action.js
new file mode 100644
index 00000000..97121146
--- /dev/null
+++ b/console/app/utils/get-permission-action.js
@@ -0,0 +1,47 @@
+import { classify } from '@ember/string';
+
+export default function getPermissionAction(permissionName) {
+ const permissionNameParts = permissionName.split(':');
+ const fullActionName = permissionNameParts.lastObject;
+ const actions = [
+ 'create',
+ 'update',
+ 'delete',
+ 'deactivate',
+ 'get',
+ 'list',
+ 'cancel',
+ 'optimize',
+ 'roll',
+ 'export',
+ 'batch_delete',
+ 'batch_cancel',
+ 'notify',
+ 'assign_vehicle',
+ 'assign_order_to',
+ 'dispatch_order_to',
+ 'dispatch',
+ 'assign',
+ 'attach',
+ 'sub_contract',
+ 'create_order_for',
+ ];
+
+ if (permissionName.startsWith('auth')) {
+ return fullActionName;
+ }
+
+ if (fullActionName === '*') {
+ return 'All';
+ }
+
+ for (let i = 0; i < actions.length; i++) {
+ const action = actions.objectAt(i);
+
+ if (fullActionName.toLowerCase().startsWith(classify(action).toLowerCase())) {
+ return classify(action);
+ }
+ }
+
+ return 'N/A';
+}
diff --git a/console/app/utils/get-permission-resource.js b/console/app/utils/get-permission-resource.js
new file mode 100644
index 00000000..f94683ea
--- /dev/null
+++ b/console/app/utils/get-permission-resource.js
@@ -0,0 +1,16 @@
+import getPermissionAction from './get-permission-action';
+import { classify } from '@ember/string';
+import { singularize } from 'ember-inflector';
+
+export default function getPermissionResource(permissionName = '') {
+ if (permissionName.startsWith('auth')) {
+ return 'N/A';
+ }
+
+ const permissionNameParts = permissionName.split(':');
+ const fullActionName = permissionNameParts.lastObject;
+ const actionName = getPermissionAction(permissionName);
+ const resourceName = fullActionName.replace(actionName, '');
+
+ return singularize(classify(resourceName));
+}
diff --git a/console/app/utils/get-service-name.js b/console/app/utils/get-service-name.js
new file mode 100644
index 00000000..006ee528
--- /dev/null
+++ b/console/app/utils/get-service-name.js
@@ -0,0 +1,19 @@
+export default function getServiceName(serviceName) {
+ if (serviceName.toLowerCase().startsWith('fleet')) {
+ return 'Fleet Ops';
+ }
+
+ if (serviceName.toLowerCase().startsWith('iam') || serviceName.toLowerCase().startsWith('identity')) {
+ return 'IAM';
+ }
+
+ if (serviceName.toLowerCase().startsWith('auth')) {
+ return 'Auth';
+ }
+
+ if (serviceName === 'developers' || serviceName.toLowerCase().startsWith('developers')) {
+ return 'Developers Console';
+ }
+
+ return 'N/A';
+}
diff --git a/console/app/validations/onboard.js b/console/app/validations/onboard.js
new file mode 100644
index 00000000..50969c32
--- /dev/null
+++ b/console/app/validations/onboard.js
@@ -0,0 +1,10 @@
+/** @validations onboard */
+import { validatePresence, validateLength, validateConfirmation, validateFormat } from 'ember-changeset-validations/validators';
+
+export default {
+ name: [validatePresence(true)],
+ email: [validatePresence(true), validateFormat({ type: 'email' })],
+ organization_name: [validatePresence(true)],
+ password: [validatePresence(true), validateLength({ min: 8 })],
+ password_confirmation: [validatePresence(true), validateConfirmation({ on: 'password' })],
+};
diff --git a/console/config/dotenv.js b/console/config/dotenv.js
new file mode 100644
index 00000000..71aaa3d8
--- /dev/null
+++ b/console/config/dotenv.js
@@ -0,0 +1,12 @@
+/* eslint-env node */
+
+'use strict';
+
+module.exports = function (env) {
+ return {
+ clientAllowedKeys: ['API_HOST'],
+ fastbootAllowedKeys: [],
+ failOnMissingKey: false,
+ path: `./environments/.env.${env}`,
+ };
+};
diff --git a/console/config/ember-cli-update.json b/console/config/ember-cli-update.json
new file mode 100644
index 00000000..afacb169
--- /dev/null
+++ b/console/config/ember-cli-update.json
@@ -0,0 +1,21 @@
+{
+ "schemaVersion": "1.0.0",
+ "packages": [
+ {
+ "name": "ember-cli",
+ "version": "4.6.0",
+ "blueprints": [
+ {
+ "name": "app",
+ "outputRepo": "https://github.com/ember-cli/ember-new-output",
+ "codemodsSource": "ember-app-codemods-manifest@1",
+ "isBaseBlueprint": true,
+ "options": [
+ "--pnpm",
+ "--ci-provider=github"
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/console/config/ember-intl.js b/console/config/ember-intl.js
new file mode 100644
index 00000000..7cd784b6
--- /dev/null
+++ b/console/config/ember-intl.js
@@ -0,0 +1,95 @@
+/* jshint node:true */
+
+module.exports = function (/* environment */) {
+ return {
+ /**
+ * Merges the fallback locale's translations into all other locales as a
+ * build-time fallback strategy.
+ *
+ * This will **not** prevent missing translation warnings or errors from occurring.
+ * It's meant as safety net when warnings are enabled.
+ * When enabled along with `errorOnMissingTranslations` any fallback attempts will result in an error.
+ *
+ * @property fallbackLocale
+ * @type {String?}
+ * @default "null"
+ */
+ fallbackLocale: null,
+
+ /**
+ * Path where translations are stored. This is relative to the project root.
+ * For example, if your translations are an npm dependency, set this to:
+ *`'./node_modules/path/to/translations'`
+ *
+ * @property inputPath
+ * @type {String}
+ * @default "'translations'"
+ */
+ inputPath: 'translations',
+
+ /**
+ * Prevents the translations from being bundled with the application code.
+ * This enables asynchronously loading the translations for the active locale
+ * by fetching them from the asset folder of the build.
+ *
+ * See: https://ember-intl.github.io/ember-intl/docs/guide/asynchronously-loading-translations
+ *
+ * @property publicOnly
+ * @type {Boolean}
+ * @default "false"
+ */
+ publicOnly: false,
+
+ /**
+ * Add the subdirectories of the translations as a namespace for all keys.
+ *
+ * @property wrapTranslationsWithNamespace
+ * @type {Boolean}
+ * @default "false"
+ */
+ wrapTranslationsWithNamespace: false,
+
+ /**
+ * Cause a build error if ICU argument mismatches are detected between translations
+ * with the same key across all locales.
+ *
+ * @property errorOnNamedArgumentMismatch
+ * @type {Boolean}
+ * @default "false"
+ */
+ errorOnNamedArgumentMismatch: false,
+
+ /**
+ * Cause a build error if missing translations are detected.
+ *
+ * See https://ember-intl.github.io/ember-intl/docs/guide/missing-translations#throwing-a-build-error-on-missing-required-translation
+ *
+ * @property errorOnMissingTranslations
+ * @type {Boolean}
+ * @default "false"
+ */
+ errorOnMissingTranslations: false,
+
+ /**
+ * Removes empty translations from the build output.
+ *
+ * @property stripEmptyTranslations
+ * @type {Boolean}
+ * @default "false"
+ */
+ stripEmptyTranslations: false,
+
+ /**
+ * A function that is called whenever any translation key, from any locale, is missing at build time.
+ *
+ * See https://ember-intl.github.io/ember-intl/docs/guide/missing-translations#requiring-translations
+ *
+ * @property requiresTranslation
+ * @type {Function}
+ * @default "function(key,locale) { return true }"
+ */
+ requiresTranslation(/* key, locale */) {
+ return true;
+ },
+ };
+};
diff --git a/console/config/environment.js b/console/config/environment.js
new file mode 100644
index 00000000..7bcaa3d7
--- /dev/null
+++ b/console/config/environment.js
@@ -0,0 +1,86 @@
+'use strict';
+const toBoolean = require('./utils/to-boolean');
+const getenv = require('./utils/getenv');
+const fixApiHost = require('./utils/fix-api-host');
+
+module.exports = function (environment) {
+ let ENV = {
+ modulePrefix: '@fleetbase/console',
+ environment,
+ rootURL: '/',
+ locationType: 'history',
+ EmberENV: {
+ FEATURES: {
+ // Here you can enable experimental features on an ember canary build
+ // e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true
+ },
+ },
+
+ APP: {
+ showExtensionsLink: toBoolean(getenv('SHOW_EXTENSIONS_LINK', true)),
+ },
+
+ API: {
+ host: fixApiHost(getenv('API_HOST'), getenv('API_SECURE')),
+ namespace: getenv('API_NAMESPACE', 'int/v1'),
+ },
+
+ osrm: {
+ host: getenv('OSRM_HOST', 'https://bundle.routing.fleetbase.io'),
+ servers: getenv('OSRM_SERVERS', '').split(',').filter(Boolean),
+ },
+
+ socket: {
+ path: getenv('SOCKETCLUSTER_PATH', '/socketcluster/'),
+ hostname: getenv('SOCKETCLUSTER_HOST'),
+ secure: toBoolean(getenv('SOCKETCLUSTER_SECURE', false)),
+ port: getenv('SOCKETCLUSTER_PORT', 38000),
+ },
+
+ defaultValues: {
+ categoryImage: getenv('DEFAULT_CATEGORY_IMAGE', 'https://flb-assets.s3.ap-southeast-1.amazonaws.com/images/fallback-placeholder-1.png'),
+ placeholderImage: getenv('DEFAULT_PLACEHOLDER_IMAGE', 'https://flb-assets.s3.ap-southeast-1.amazonaws.com/images/fallback-placeholder-2.png'),
+ driverImage: getenv('DEFAULT_DRIVER_IMAGE', 'https://s3.ap-southeast-1.amazonaws.com/flb-assets/static/no-avatar.png'),
+ userImage: getenv('DEFAULT_USER_IMAGE', 'https://s3.ap-southeast-1.amazonaws.com/flb-assets/static/no-avatar.png'),
+ contactImage: getenv('DEFAULT_CONTACT_IMAGE', 'https://s3.ap-southeast-1.amazonaws.com/flb-assets/static/no-avatar.png'),
+ vehicleImage: getenv('DEFAULT_VEHICLE_IMAGE', 'https://flb-assets.s3.ap-southeast-1.amazonaws.com/static/vehicle-icons/light_commercial_van.svg'),
+ vehicleAvatar: getenv('DEFAUL_VEHICLE_AVATAR', 'https://flb-assets.s3-ap-southeast-1.amazonaws.com/static/vehicle-icons/mini_bus.svg'),
+ },
+
+ 'ember-simple-auth': {
+ routeAfterAuthentication: 'console',
+ },
+
+ 'ember-local-storage': {
+ namespace: '@fleetbase',
+ keyDelimiter: '/',
+ includeEmberDataSupport: true,
+ },
+ };
+
+ if (environment === 'development') {
+ // ENV.APP.LOG_RESOLVER = true;
+ // ENV.APP.LOG_ACTIVE_GENERATION = true;
+ // ENV.APP.LOG_TRANSITIONS = true;
+ // ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
+ // ENV.APP.LOG_VIEW_LOOKUPS = true;
+ }
+
+ if (environment === 'test') {
+ // Testem prefers this...
+ ENV.locationType = 'none';
+
+ // keep test console output quieter
+ ENV.APP.LOG_ACTIVE_GENERATION = false;
+ ENV.APP.LOG_VIEW_LOOKUPS = false;
+
+ ENV.APP.rootElement = '#ember-testing';
+ ENV.APP.autoboot = false;
+ }
+
+ if (environment === 'production') {
+ // here you can enable a production-specific feature
+ }
+
+ return ENV;
+};
diff --git a/console/config/icons.js b/console/config/icons.js
new file mode 100644
index 00000000..b1702e8d
--- /dev/null
+++ b/console/config/icons.js
@@ -0,0 +1,5 @@
+module.exports = function () {
+ return {
+ 'free-solid-svg-icons': 'all',
+ };
+};
diff --git a/console/config/optional-features.json b/console/config/optional-features.json
new file mode 100644
index 00000000..b26286e2
--- /dev/null
+++ b/console/config/optional-features.json
@@ -0,0 +1,6 @@
+{
+ "application-template-wrapper": false,
+ "default-async-observers": true,
+ "jquery-integration": false,
+ "template-only-glimmer-components": true
+}
diff --git a/console/config/targets.js b/console/config/targets.js
new file mode 100644
index 00000000..31c76135
--- /dev/null
+++ b/console/config/targets.js
@@ -0,0 +1,7 @@
+'use strict';
+
+const browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions'];
+
+module.exports = {
+ browsers,
+};
diff --git a/console/config/utils/fix-api-host.js b/console/config/utils/fix-api-host.js
new file mode 100644
index 00000000..ce02d8d8
--- /dev/null
+++ b/console/config/utils/fix-api-host.js
@@ -0,0 +1,16 @@
+const toBoolean = require('./to-boolean');
+
+// This function is a temp hotfix to patch api host
+module.exports = function fixApiHost(apiHost, secure = false) {
+ secure = toBoolean(secure);
+
+ if (typeof apiHost === 'string' && apiHost.length > 4 && !apiHost.startsWith('http')) {
+ if (secure === true) {
+ apiHost = `https://${apiHost}`;
+ } else {
+ apiHost = `http://${apiHost}`;
+ }
+ }
+
+ return apiHost;
+};
diff --git a/console/config/utils/getenv.js b/console/config/utils/getenv.js
new file mode 100644
index 00000000..83333129
--- /dev/null
+++ b/console/config/utils/getenv.js
@@ -0,0 +1,3 @@
+module.exports = function getenv(variable, defaultValue = null) {
+ return process.env[variable] !== undefined ? process.env[variable] : defaultValue;
+};
diff --git a/console/config/utils/to-boolean.js b/console/config/utils/to-boolean.js
new file mode 100644
index 00000000..d5b70fb5
--- /dev/null
+++ b/console/config/utils/to-boolean.js
@@ -0,0 +1,19 @@
+module.exports = function toBoolean(value) {
+ switch (value) {
+ case 'true':
+ case '1':
+ case 1:
+ case true:
+ return true;
+ case 'false':
+ case '0':
+ case 0:
+ case false:
+ case null:
+ case undefined:
+ case '':
+ return false;
+ default:
+ return false;
+ }
+};
diff --git a/console/ember-cli-build.js b/console/ember-cli-build.js
new file mode 100644
index 00000000..98ae4179
--- /dev/null
+++ b/console/ember-cli-build.js
@@ -0,0 +1,77 @@
+'use strict';
+
+/** eslint-disable node/no-unpublished-require */
+const EmberApp = require('ember-cli/lib/broccoli/ember-app');
+const FleetbaseExtensionsIndexer = require('fleetbase-extensions-indexer');
+const postcssImport = require('postcss-import');
+const postcssPresetEnv = require('postcss-preset-env');
+const postcssEach = require('postcss-each');
+const postcssMixins = require('postcss-mixins');
+const postcssConditionals = require('postcss-conditionals-renewed');
+const postcssAtRulesVariables = require('postcss-at-rules-variables');
+const autoprefixer = require('autoprefixer');
+const tailwind = require('tailwindcss');
+
+module.exports = function (defaults) {
+ let app = new EmberApp(defaults, {
+ storeConfigInMeta: false,
+
+ fingerprint: {
+ exclude: ['leaflet/', 'leaflet-images/', 'socketcluster-client.min.js'],
+ },
+
+ liveReload: {
+ options: {
+ ignore: ['app/router.js'],
+ },
+ },
+
+ 'ember-simple-auth': {
+ useSessionSetupMethod: true,
+ },
+
+ postcssOptions: {
+ compile: {
+ enabled: true,
+ cacheInclude: [/.*\.(css|scss|hbs)$/, /.*\/tailwind\/config\.js$/, /.*tailwind\.js$/],
+ plugins: [
+ postcssAtRulesVariables,
+ postcssImport({
+ path: ['node_modules'],
+ plugins: [postcssAtRulesVariables, postcssImport],
+ }),
+ postcssMixins,
+ postcssPresetEnv({ stage: 1 }),
+ postcssEach,
+ tailwind('./tailwind.js'),
+ autoprefixer,
+ ],
+ },
+ filter: {
+ enabled: true,
+ plugins: [postcssAtRulesVariables, postcssMixins, postcssEach, postcssConditionals, tailwind('./tailwind.js')],
+ },
+ },
+
+ babel: {
+ plugins: [require.resolve('ember-auto-import/babel-plugin')],
+ },
+ });
+
+ let extensions = new FleetbaseExtensionsIndexer();
+
+ // Use `app.import` to add additional libraries to the generated
+ // output files.
+ //
+ // If you need to use different assets in different
+ // environments, specify an object as the first parameter. That
+ // object's keys should be the environment name and the values
+ // should be the asset to use in that environment.
+ //
+ // If the library that you are including contains AMD or ES6
+ // modules that you would like to import into your application
+ // please specify an object with the list of modules as keys
+ // along with the exports of each module as its value.
+
+ return app.toTree([extensions]);
+};
diff --git a/console/lib/.gitkeep b/console/lib/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/console/nginx.conf b/console/nginx.conf
new file mode 100644
index 00000000..25d323e0
--- /dev/null
+++ b/console/nginx.conf
@@ -0,0 +1,9 @@
+server {
+ listen 4200;
+ server_name localhost;
+
+ location / {
+ root /usr/share/nginx/html;
+ try_files $uri $uri/ /index.html =404;
+ }
+}
diff --git a/console/package.json b/console/package.json
new file mode 100644
index 00000000..e423b595
--- /dev/null
+++ b/console/package.json
@@ -0,0 +1,148 @@
+{
+ "name": "@fleetbase/console",
+ "version": "0.2.5",
+ "private": true,
+ "description": "Fleetbase Console",
+ "repository": "",
+ "license": "MIT",
+ "author": "",
+ "directories": {
+ "doc": "doc",
+ "test": "tests"
+ },
+ "scripts": {
+ "prebuild": "node prebuild.js",
+ "build": "pnpm run prebuild && ember build --environment=production",
+ "lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
+ "lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
+ "lint:hbs": "ember-template-lint .",
+ "lint:hbs:fix": "ember-template-lint . --fix",
+ "lint:js": "eslint . --cache",
+ "lint:js:fix": "eslint . --fix",
+ "start": "pnpm run prebuild && ember serve",
+ "test": "npm-run-all lint test:*",
+ "test:ember": "ember test"
+ },
+ "dependencies": {
+ "@ember/legacy-built-in-components": "^0.4.1",
+ "@fleetbase/ember-core": "^0.1.4",
+ "@fleetbase/ember-ui": "^0.2.0",
+ "@fleetbase/dev-engine": "^0.1.8",
+ "@fleetbase/iam-engine": "^0.0.6",
+ "@fleetbase/fleetops-engine": "^0.2.7",
+ "@fleetbase/fleetops-data": "^0.1.1",
+ "@fleetbase/storefront-engine": "^0.1.9",
+ "@fleetbase/leaflet-routing-machine": "^3.2.16",
+ "@fortawesome/ember-fontawesome": "^0.4.1",
+ "ember-intl": "^6.0.0-beta.6",
+ "ember-changeset": "^4.1.2",
+ "ember-changeset-validations": "^4.1.1",
+ "ember-composable-helpers": "^5.0.0",
+ "ember-concurrency": "^3.0.0",
+ "ember-concurrency-decorators": "^2.0.3",
+ "ember-math-helpers": "^2.18.2",
+ "ember-power-select": "^6.0.1",
+ "ember-prism": "^0.13.0",
+ "ember-radio-button": "^3.0.0-beta.1",
+ "ember-tag-input": "^3.1.0",
+ "fleetbase-extensions-indexer": "^0.0.4",
+ "postcss-at-rules-variables": "^0.3.0",
+ "postcss-custom-properties": "^12.1.9",
+ "postcss-nth-list": "^1.0.2"
+ },
+ "devDependencies": {
+ "@ember/optional-features": "^2.0.0",
+ "@ember/test-helpers": "^2.8.1",
+ "@fortawesome/fontawesome-svg-core": "^6.4.0",
+ "@fortawesome/free-brands-svg-icons": "^6.4.0",
+ "@fortawesome/free-solid-svg-icons": "^6.4.0",
+ "@glimmer/component": "^1.1.2",
+ "@glimmer/tracking": "^1.1.2",
+ "@tailwindcss/forms": "^0.5.3",
+ "autoprefixer": "^10.4.8",
+ "babel-eslint": "^10.1.0",
+ "broccoli-asset-rev": "^3.0.0",
+ "broccoli-funnel": "^3.0.8",
+ "date-fns": "^2.30.0",
+ "dragula": "^3.7.3",
+ "ember-auto-import": "^2.4.2",
+ "ember-cli": "~4.6.0",
+ "ember-cli-app-version": "^5.0.0",
+ "ember-cli-babel": "^7.26.11",
+ "ember-cli-dependency-checker": "^3.3.1",
+ "ember-cli-dotenv": "^3.1.0",
+ "ember-cli-es6-transform": "^1.0.0",
+ "ember-cli-htmlbars": "^6.1.0",
+ "ember-cli-inject-live-reload": "^2.1.0",
+ "ember-cli-postcss": "^8.2.0",
+ "ember-cli-sri": "^2.1.1",
+ "ember-cli-string-helpers": "^6.1.0",
+ "ember-cli-terser": "^4.0.2",
+ "ember-data": "^4.6.1",
+ "ember-engines": "^0.8.23",
+ "ember-fetch": "^8.1.1",
+ "ember-leaflet": "^5.1.1",
+ "ember-load-initializers": "^2.1.2",
+ "ember-page-title": "^7.0.0",
+ "ember-qunit": "^5.1.5",
+ "ember-resolver": "^8.0.3",
+ "ember-responsive": "^5.0.0",
+ "ember-source": "~4.6.0",
+ "ember-template-lint": "^4.10.1",
+ "ember-wormhole": "^0.6.0",
+ "eslint": "^7.32.0",
+ "eslint-config-prettier": "^8.5.0",
+ "eslint-plugin-ember": "^11.0.2",
+ "eslint-plugin-node": "^11.1.0",
+ "eslint-plugin-prettier": "^4.2.1",
+ "eslint-plugin-qunit": "^7.3.1",
+ "fast-glob": "^3.3.0",
+ "fs": "0.0.1-security",
+ "inter-ui": "^3.19.3",
+ "leaflet": "^1.9.4",
+ "loader.js": "^4.7.0",
+ "normalize.css": "^8.0.1",
+ "npm-run-all": "^4.1.5",
+ "postcss": "^8.4.21",
+ "postcss-conditionals-renewed": "^1.0.0",
+ "postcss-each": "^1.1.0",
+ "postcss-import": "14.1.0",
+ "postcss-mixins": "^9.0.4",
+ "postcss-preset-env": "^7.8.2",
+ "postcss-simple-vars": "^7.0.0",
+ "prettier": "^2.7.1",
+ "qunit": "^2.19.1",
+ "qunit-dom": "^2.0.0",
+ "recast": "^0.23.3",
+ "tailwindcss": "^3.1.8",
+ "webpack": "^5.74.0"
+ },
+ "engines": {
+ "node": "14.* || >= 16"
+ },
+ "ember": {
+ "edition": "octane"
+ },
+ "pnpm": {
+ "overrides": {
+ "@fleetbase/fleetops-data": "^0.1.1",
+ "@fleetbase/ember-core": "^0.1.4",
+ "@fleetbase/ember-ui": "^0.2.0"
+ }
+ },
+ "prettier": {
+ "trailingComma": "es5",
+ "tabWidth": 4,
+ "semi": true,
+ "singleQuote": true,
+ "printWidth": 190,
+ "overrides": [
+ {
+ "files": "*.hbs",
+ "options": {
+ "singleQuote": false
+ }
+ }
+ ]
+ }
+}
diff --git a/console/prebuild.js b/console/prebuild.js
new file mode 100644
index 00000000..61c5931b
--- /dev/null
+++ b/console/prebuild.js
@@ -0,0 +1,127 @@
+const fg = require('fast-glob');
+const fs = require('fs');
+const path = require('path');
+const recast = require('recast');
+const babelParser = require('recast/parsers/babel');
+const builders = recast.types.builders;
+
+function only(subject, props = []) {
+ const keys = Object.keys(subject);
+ const result = {};
+
+ for (let i = 0; i < keys.length; i++) {
+ const key = keys[i];
+
+ if (props.includes(key)) {
+ result[key] = subject[key];
+ }
+ }
+
+ return result;
+}
+
+function getExtensions() {
+ return new Promise((resolve, reject) => {
+ const extensions = [];
+ const seenPackages = new Set();
+
+ return fg(['node_modules/*/package.json', 'node_modules/*/*/package.json'])
+ .then((results) => {
+ for (let i = 0; i < results.length; i++) {
+ const packagePath = results[i];
+ const packageJson = fs.readFileSync(packagePath);
+ let packageData = null;
+
+ try {
+ packageData = JSON.parse(packageJson);
+ } catch (e) {
+ console.warn(`Could not parse package.json at ${packagePath}:`, e);
+ continue;
+ }
+
+ if (!packageData || !packageData.keywords || !packageData.keywords.includes('fleetbase-extension') || !packageData.keywords.includes('ember-engine')) {
+ continue;
+ }
+
+ // If we've seen this package before, skip it
+ if (seenPackages.has(packageData.name)) {
+ continue;
+ }
+
+ seenPackages.add(packageData.name);
+ extensions.push(only(packageData, ['name', 'description', 'version', 'fleetbase', 'keywords', 'license', 'repository']));
+ }
+
+ resolve(extensions);
+ })
+ .catch(reject);
+ });
+}
+
+function getRouterFileContents() {
+ const routerFilePath = path.join(__dirname, 'router.map.js');
+ const routerFileContents = fs.readFileSync(routerFilePath, 'utf-8');
+
+ return routerFileContents;
+}
+
+(async () => {
+ const extensions = await getExtensions();
+ const routerFileContents = getRouterFileContents();
+ const ast = recast.parse(routerFileContents, { parser: babelParser });
+
+ recast.visit(ast, {
+ visitCallExpression(path) {
+ if (path.value.type === 'CallExpression' && path.value.callee.property.name === 'route' && path.value.arguments[0].value === 'console') {
+ let functionExpression;
+
+ // Find the function expression
+ path.value.arguments.forEach((arg) => {
+ if (arg.type === 'FunctionExpression') {
+ functionExpression = arg;
+ }
+ });
+
+ if (functionExpression) {
+ // Check and add the new engine mounts
+ extensions.forEach((extension) => {
+ const mountName = extension.name.split('/')[1];
+ const mountPath = mountName.replace('-engine', '');
+ let route = mountPath;
+
+ if (extension.fleetbase && extension.fleetbase.route) {
+ route = extension.fleetbase.route;
+ }
+
+ // Check if engine is already mounted
+ const isMounted = functionExpression.body.body.some((expressionStatement) => {
+ return expressionStatement.expression.arguments[0].value === extension.name;
+ });
+
+ // If not mounted, append to the function body
+ if (!isMounted) {
+ functionExpression.body.body.push(
+ builders.expressionStatement(
+ builders.callExpression(builders.memberExpression(builders.thisExpression(), builders.identifier('mount')), [
+ builders.literal(extension.name),
+ builders.objectExpression([
+ builders.property('init', builders.identifier('as'), builders.literal(route)),
+ builders.property('init', builders.identifier('path'), builders.literal(route)),
+ ]),
+ ])
+ )
+ );
+ }
+ });
+
+ return false;
+ }
+ }
+
+ this.traverse(path);
+ },
+ });
+
+ const output = recast.print(ast, { quote: 'single' }).code;
+ fs.writeFileSync(path.join(__dirname, 'app/router.js'), output);
+})();
diff --git a/console/public/favicon/android-chrome-192x192.png b/console/public/favicon/android-chrome-192x192.png
new file mode 100644
index 00000000..5bb94579
Binary files /dev/null and b/console/public/favicon/android-chrome-192x192.png differ
diff --git a/console/public/favicon/android-chrome-256x256.png b/console/public/favicon/android-chrome-256x256.png
new file mode 100644
index 00000000..327e653c
Binary files /dev/null and b/console/public/favicon/android-chrome-256x256.png differ
diff --git a/console/public/favicon/apple-touch-icon-114x114.png b/console/public/favicon/apple-touch-icon-114x114.png
new file mode 100644
index 00000000..8ea847ed
Binary files /dev/null and b/console/public/favicon/apple-touch-icon-114x114.png differ
diff --git a/console/public/favicon/apple-touch-icon-120x120.png b/console/public/favicon/apple-touch-icon-120x120.png
new file mode 100644
index 00000000..aabcd6b9
Binary files /dev/null and b/console/public/favicon/apple-touch-icon-120x120.png differ
diff --git a/console/public/favicon/apple-touch-icon-144x144.png b/console/public/favicon/apple-touch-icon-144x144.png
new file mode 100644
index 00000000..539d561c
Binary files /dev/null and b/console/public/favicon/apple-touch-icon-144x144.png differ
diff --git a/console/public/favicon/apple-touch-icon-152x152.png b/console/public/favicon/apple-touch-icon-152x152.png
new file mode 100644
index 00000000..3ca9ab46
Binary files /dev/null and b/console/public/favicon/apple-touch-icon-152x152.png differ
diff --git a/console/public/favicon/apple-touch-icon-180x180.png b/console/public/favicon/apple-touch-icon-180x180.png
new file mode 100644
index 00000000..1727f26f
Binary files /dev/null and b/console/public/favicon/apple-touch-icon-180x180.png differ
diff --git a/console/public/favicon/apple-touch-icon-57x57.png b/console/public/favicon/apple-touch-icon-57x57.png
new file mode 100644
index 00000000..56a23e98
Binary files /dev/null and b/console/public/favicon/apple-touch-icon-57x57.png differ
diff --git a/console/public/favicon/apple-touch-icon-60x60.png b/console/public/favicon/apple-touch-icon-60x60.png
new file mode 100644
index 00000000..b4db2572
Binary files /dev/null and b/console/public/favicon/apple-touch-icon-60x60.png differ
diff --git a/console/public/favicon/apple-touch-icon-72x72.png b/console/public/favicon/apple-touch-icon-72x72.png
new file mode 100644
index 00000000..82ae16a3
Binary files /dev/null and b/console/public/favicon/apple-touch-icon-72x72.png differ
diff --git a/console/public/favicon/apple-touch-icon-76x76.png b/console/public/favicon/apple-touch-icon-76x76.png
new file mode 100644
index 00000000..622bf569
Binary files /dev/null and b/console/public/favicon/apple-touch-icon-76x76.png differ
diff --git a/console/public/favicon/apple-touch-icon.png b/console/public/favicon/apple-touch-icon.png
new file mode 100644
index 00000000..1727f26f
Binary files /dev/null and b/console/public/favicon/apple-touch-icon.png differ
diff --git a/console/public/favicon/browserconfig.xml b/console/public/favicon/browserconfig.xml
new file mode 100644
index 00000000..70cb989d
--- /dev/null
+++ b/console/public/favicon/browserconfig.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<browserconfig>
+ <msapplication>
+ <tile>
+ <square150x150logo src="/favicon/mstile-150x150.png"/>
+ <TileColor>#da532c</TileColor>
+ </tile>
+ </msapplication>
+</browserconfig>
diff --git a/console/public/favicon/favicon-16x16.png b/console/public/favicon/favicon-16x16.png
new file mode 100644
index 00000000..bdcc6c95
Binary files /dev/null and b/console/public/favicon/favicon-16x16.png differ
diff --git a/console/public/favicon/favicon-32x32.png b/console/public/favicon/favicon-32x32.png
new file mode 100644
index 00000000..4b42d679
Binary files /dev/null and b/console/public/favicon/favicon-32x32.png differ
diff --git a/console/public/favicon/favicon.ico b/console/public/favicon/favicon.ico
new file mode 100644
index 00000000..15ba0fe3
Binary files /dev/null and b/console/public/favicon/favicon.ico differ
diff --git a/console/public/favicon/mstile-150x150.png b/console/public/favicon/mstile-150x150.png
new file mode 100644
index 00000000..595fba0c
Binary files /dev/null and b/console/public/favicon/mstile-150x150.png differ
diff --git a/console/public/favicon/safari-pinned-tab.svg b/console/public/favicon/safari-pinned-tab.svg
new file mode 100644
index 00000000..aac7cf9c
--- /dev/null
+++ b/console/public/favicon/safari-pinned-tab.svg
@@ -0,0 +1 @@
+<svg version="1" xmlns="http://www.w3.org/2000/svg" width="346.667" height="346.667" viewBox="0 0 260.000000 260.000000"><path d="M7.2 2.6C-.5 7.2.1-2.3.1 130.4.1 241.9.2 249.3 1.9 252c.9 1.6 3 4 4.6 5.2l3 2.3h240.4l2.8-2.1c1.5-1.1 3.8-3.5 4.9-5.2l2.1-3.1-.1-119.5c-.1-119-.1-119.5-2.2-122.2-1.1-1.5-3.3-3.7-4.8-4.8C249.9.5 249.4.5 130.5.4L11.2.2l-4 2.4z"/></svg>
\ No newline at end of file
diff --git a/console/public/favicon/site.webmanifest b/console/public/favicon/site.webmanifest
new file mode 100644
index 00000000..855b3316
--- /dev/null
+++ b/console/public/favicon/site.webmanifest
@@ -0,0 +1,19 @@
+{
+ "name": "",
+ "short_name": "",
+ "icons": [
+ {
+ "src": "/favicon/android-chrome-192x192.png",
+ "sizes": "192x192",
+ "type": "image/png"
+ },
+ {
+ "src": "/favicon/android-chrome-256x256.png",
+ "sizes": "256x256",
+ "type": "image/png"
+ }
+ ],
+ "theme_color": "#ffffff",
+ "background_color": "#ffffff",
+ "display": "standalone"
+}
diff --git a/console/public/images/fleetbase-logo-svg.svg b/console/public/images/fleetbase-logo-svg.svg
new file mode 100644
index 00000000..141d565f
--- /dev/null
+++ b/console/public/images/fleetbase-logo-svg.svg
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ viewBox="0 0 812 137" style="enable-background:new 0 0 812 137;" xml:space="preserve">
+<style type="text/css">
+ .st0{fill:#FFFFFF;}
+ .st1{fill:#4391EA;}
+ .st2{enable-background:new ;}
+ .st3{fill:none;stroke:#185189;stroke-miterlimit:10;}
+</style>
+<g>
+ <path class="st0" d="M62.1,56.6l-5-5c0.2-0.2,0.5-0.5,0.7-0.7c14-12.8,32.7-20.6,53.1-20.6v-6.8c0,0-84.5,1.4-85.5,89.1H111V91.5
+ c-3.5,0-6.8,1.2-9.4,3.3c-0.3,0.2-0.6,0.4-0.8,0.6l-4.9-4.9c0.2-0.3,0.5-0.5,0.7-0.7c3.9-3.3,8.9-5.3,14.4-5.3v-6.1
+ c-7.2,0.1-13.9,2.5-19.2,6.7c-0.3,0.2-0.6,0.4-0.8,0.6l-5-5c0.3-0.2,0.5-0.4,0.8-0.6c6.6-5.4,15-8.7,24.2-8.7V65
+ c-10.9,0-20.9,3.9-28.7,10.5c-0.3,0.3-0.6,0.5-0.8,0.7l-5-5c0.3-0.3,0.5-0.5,0.8-0.7c9.1-7.8,20.8-12.6,33.7-12.6v-6.6
+ c-14.7,0-28.2,5.5-38.4,14.5c-0.3,0.2-0.6,0.5-0.8,0.7l-4.9-5c0.3-0.3,0.6-0.5,0.8-0.7C79.2,50.6,94.4,44.3,111,44.3v-6.9
+ c-18.5,0-35.4,7-48.2,18.5C62.6,56.1,62.3,56.4,62.1,56.6z"/>
+ <path class="st1" d="M127,0H10C4.5,0,0,4.5,0,10v117c0,5.5,4.5,10,10,10h117c5.5,0,10-4.5,10-10V10C137,4.5,132.5,0,127,0z
+ M111,44.3c-16.6,0-31.8,6.3-43.3,16.5c-0.2,0.2-0.5,0.4-0.8,0.7l4.9,5c0.2-0.2,0.5-0.5,0.8-0.7c10.2-9,23.7-14.5,38.4-14.5v6.6
+ c-12.9,0-24.6,4.8-33.7,12.6c-0.3,0.2-0.5,0.4-0.8,0.7l5,5c0.2-0.2,0.5-0.4,0.8-0.7C90.1,68.9,100.1,65,111,65v6.4
+ c-9.2,0-17.6,3.3-24.2,8.7c-0.3,0.2-0.5,0.4-0.8,0.6l5,5c0.2-0.2,0.5-0.4,0.8-0.6c5.3-4.2,12-6.6,19.2-6.7v6.1
+ c-5.5,0-10.5,2-14.4,5.3c-0.2,0.2-0.5,0.4-0.7,0.7l4.9,4.9c0.2-0.2,0.5-0.4,0.8-0.6c2.6-2.1,5.9-3.3,9.4-3.3v21.1H25.4
+ c1-87.7,85.5-89.1,85.5-89.1v6.8c-20.4,0-39.1,7.8-53.1,20.6c-0.2,0.2-0.5,0.5-0.7,0.7l5,5c0.2-0.2,0.5-0.5,0.7-0.7
+ C75.6,44.4,92.5,37.4,111,37.4V44.3z"/>
+</g>
+<g class="st2">
+ <path class="st1" d="M194.1,115.8V22h63v16h-44.7v24.2h37.2V77h-37.2v38.8H194.1z"/>
+ <path class="st1" d="M267.5,19.4h17.7v73.4c0,5.4,2.4,8.1,7.3,8.1c1,0,2.1-0.2,3.4-0.5c1.3-0.4,2.5-0.7,3.6-1.2l2.4,14.1
+ c-2.4,1.1-5.1,2-8.3,2.6c-3.2,0.6-6,0.9-8.6,0.9c-5.5,0-9.8-1.5-12.9-4.4c-3-2.9-4.6-7.1-4.6-12.6V19.4z"/>
+ <path class="st1" d="M341.7,117.1c-5.5,0-10.6-0.9-15-2.8c-4.5-1.9-8.3-4.5-11.5-7.7c-3.2-3.3-5.6-7-7.3-11.4
+ c-1.7-4.3-2.6-8.8-2.6-13.6c0-4.9,0.8-9.6,2.5-13.9c1.7-4.4,4.1-8.2,7.3-11.5c3.2-3.3,7-5.9,11.6-7.9c4.5-1.9,9.6-2.9,15.2-2.9
+ c5.6,0,10.7,1,15.1,2.9c4.4,1.9,8.2,4.5,11.4,7.8c3.1,3.3,5.5,7,7.1,11.4c1.6,4.3,2.4,8.8,2.4,13.5c0,1.1,0,2.2-0.1,3.3
+ c0,1.1-0.2,1.9-0.3,2.6H324c0.3,2.7,0.9,5.1,2,7.3c1.1,2.1,2.4,3.9,4.1,5.4c1.7,1.5,3.6,2.6,5.7,3.4s4.3,1.2,6.6,1.2
+ c3.5,0,6.8-0.9,10-2.6c3.1-1.7,5.3-4,6.4-6.8l15.2,4.2c-2.6,5.3-6.6,9.6-12.2,13C356.1,115.4,349.5,117.1,341.7,117.1z M359.7,75.4
+ c-0.4-5.2-2.4-9.3-5.7-12.5c-3.4-3.1-7.5-4.7-12.3-4.7c-2.4,0-4.6,0.4-6.7,1.3c-2.1,0.8-3.9,2-5.5,3.5c-1.6,1.5-2.9,3.3-3.9,5.4
+ c-1,2.1-1.6,4.4-1.8,7H359.7z"/>
+ <path class="st1" d="M420.9,117.1c-5.5,0-10.6-0.9-15-2.8c-4.5-1.9-8.3-4.5-11.5-7.7c-3.2-3.3-5.6-7-7.3-11.4
+ c-1.7-4.3-2.6-8.8-2.6-13.6c0-4.9,0.8-9.6,2.5-13.9c1.7-4.4,4.1-8.2,7.3-11.5c3.2-3.3,7-5.9,11.6-7.9c4.5-1.9,9.6-2.9,15.2-2.9
+ c5.6,0,10.7,1,15.1,2.9c4.4,1.9,8.2,4.5,11.4,7.8c3.1,3.3,5.5,7,7.1,11.4c1.6,4.3,2.4,8.8,2.4,13.5c0,1.1,0,2.2-0.1,3.3
+ c0,1.1-0.2,1.9-0.3,2.6h-53.5c0.3,2.7,0.9,5.1,2,7.3c1.1,2.1,2.4,3.9,4.1,5.4c1.7,1.5,3.6,2.6,5.7,3.4c2.1,0.8,4.3,1.2,6.6,1.2
+ c3.5,0,6.8-0.9,10-2.6c3.1-1.7,5.3-4,6.4-6.8l15.2,4.2c-2.6,5.3-6.6,9.6-12.2,13C435.3,115.4,428.7,117.1,420.9,117.1z M438.9,75.4
+ c-0.4-5.2-2.4-9.3-5.7-12.5c-3.4-3.1-7.5-4.7-12.3-4.7c-2.4,0-4.6,0.4-6.7,1.3c-2.1,0.8-3.9,2-5.5,3.5c-1.6,1.5-2.9,3.3-3.9,5.4
+ c-1,2.1-1.6,4.4-1.8,7H438.9z"/>
+ <path class="st1" d="M508.8,112.2c-2.4,1.1-5.3,2.1-8.8,3.2c-3.5,1.1-7.1,1.6-10.9,1.6c-2.5,0-4.8-0.3-6.9-0.9
+ c-2.2-0.6-4-1.6-5.7-3c-1.6-1.4-2.9-3.1-3.9-5.3c-1-2.2-1.5-4.8-1.5-7.9V60.2h-9V46.6h9V24.1h17.7v22.4h14.7v13.6h-14.7V94
+ c0,2.5,0.7,4.2,2,5.2c1.3,1,2.9,1.5,4.8,1.5s3.7-0.3,5.4-0.9c1.8-0.6,3.2-1.1,4.2-1.6L508.8,112.2z"/>
+ <path class="st1" d="M557,117.1c-5.3,0-10-1.2-14.1-3.6c-4.1-2.4-7.4-5.6-9.8-9.8v12h-15.4V19.4h17.7v39.3c2.5-4.2,5.7-7.5,9.7-9.8
+ c4-2.3,8.6-3.5,13.9-3.5c4.5,0,8.6,1,12.3,2.9c3.7,1.9,7,4.5,9.6,7.8c2.7,3.3,4.8,7.1,6.2,11.5c1.5,4.4,2.2,9,2.2,13.9
+ c0,5-0.8,9.7-2.4,14c-1.6,4.3-3.9,8.1-6.8,11.3c-2.9,3.2-6.3,5.7-10.3,7.6C565.8,116.2,561.6,117.1,557,117.1z M552.1,102
+ c2.8,0,5.4-0.5,7.7-1.7c2.3-1.1,4.4-2.6,6.1-4.4c1.7-1.8,3-4,4-6.5c0.9-2.5,1.4-5.1,1.4-7.9c0-2.8-0.4-5.5-1.3-8.1
+ c-0.9-2.6-2.1-4.8-3.8-6.7c-1.6-1.9-3.5-3.5-5.7-4.6c-2.2-1.1-4.6-1.7-7.3-1.7c-4,0-7.5,1.3-10.6,3.9c-3.1,2.6-5.5,5.8-7.2,9.6
+ v16.5c0.6,1.8,1.5,3.3,2.7,4.8c1.2,1.4,2.5,2.6,4,3.6c1.5,1,3.1,1.8,4.9,2.4C548.7,101.7,550.4,102,552.1,102z"/>
+ <path class="st1" d="M620.2,117.1c-3.3,0-6.5-0.6-9.4-1.7s-5.4-2.6-7.5-4.6c-2.1-2-3.8-4.3-5-6.9c-1.2-2.6-1.8-5.5-1.8-8.7
+ c0-3.3,0.7-6.3,2.2-9c1.5-2.8,3.5-5.1,6.1-7.1c2.6-1.9,5.7-3.5,9.3-4.6c3.6-1.1,7.6-1.7,11.9-1.7c3.1,0,6.1,0.3,9,0.8
+ c2.9,0.5,5.6,1.3,7.9,2.2v-4c0-4.6-1.3-8.1-3.9-10.6c-2.6-2.5-6.4-3.7-11.5-3.7c-3.7,0-7.3,0.7-10.8,2c-3.5,1.3-7.1,3.3-10.8,5.8
+ l-5.4-11.2c8.9-5.9,18.5-8.8,28.8-8.8c9.9,0,17.7,2.4,23.2,7.3c5.5,4.9,8.2,11.9,8.2,21.2v21.5c0,1.8,0.4,3.2,1.1,4
+ c0.7,0.8,1.9,1.2,3.7,1.3v15c-1.7,0.4-3.2,0.6-4.7,0.7c-1.5,0.1-2.7,0.2-3.8,0.2c-3.3-0.1-5.9-0.9-7.7-2.3
+ c-1.8-1.5-2.9-3.4-3.3-5.9l-0.4-3.8c-3.1,4-6.8,7.1-11.2,9.2C630,116,625.2,117.1,620.2,117.1z M625.2,104.1c3,0,5.8-0.5,8.5-1.6
+ c2.7-1.1,4.8-2.5,6.3-4.2c1.9-1.5,2.9-3.2,2.9-5v-7.9c-2.1-0.8-4.4-1.4-6.9-1.9c-2.5-0.5-4.8-0.7-7.1-0.7c-4.6,0-8.3,1-11.2,3.1
+ c-2.9,2.1-4.4,4.7-4.4,7.9c0,3,1.1,5.5,3.4,7.5C619.1,103.2,621.9,104.1,625.2,104.1z"/>
+ <path class="st1" d="M704.8,117.1c-2.8,0-5.7-0.2-8.8-0.7c-3-0.4-6-1.1-8.9-1.8c-2.9-0.8-5.7-1.8-8.3-2.9c-2.6-1.1-5-2.4-7-3.8
+ l7.1-12c8.8,5.7,17.3,8.6,25.5,8.6c3.7,0,6.6-0.7,8.7-2c2.1-1.3,3.2-3.2,3.2-5.7c0-2.5-1.3-4.3-3.8-5.5c-2.5-1.2-6.7-2.5-12.6-3.9
+ c-4.5-1.1-8.3-2.2-11.5-3.3c-3.2-1.1-5.7-2.5-7.7-4c-1.9-1.5-3.3-3.2-4.2-5.1c-0.9-1.9-1.3-4.2-1.3-6.9c0-3.5,0.7-6.7,2.1-9.5
+ c1.4-2.8,3.4-5.2,5.9-7.2c2.5-2,5.5-3.5,8.8-4.6c3.4-1.1,7.1-1.6,11-1.6c4.9,0,9.8,0.8,14.7,2.3c4.9,1.5,9.4,3.6,13.7,6.3l-7.3,11
+ c-3.9-2.5-7.5-4.2-11-5.3c-3.4-1.1-6.9-1.7-10.3-1.7c-3.2,0-5.8,0.6-8,1.8c-2.2,1.2-3.2,3.2-3.2,5.9c0,2.4,1,4.1,3.1,5.1
+ c2.1,1.1,5.7,2.2,11,3.6c4.9,1.2,9.1,2.5,12.6,3.7c3.5,1.2,6.3,2.6,8.6,4.2s3.9,3.4,4.9,5.5c1,2.1,1.5,4.6,1.5,7.5
+ c0,3.3-0.7,6.4-2,9.1c-1.4,2.7-3.3,5-5.7,6.9c-2.5,1.9-5.5,3.3-9,4.4C713.1,116.6,709.2,117.1,704.8,117.1z"/>
+ <path class="st1" d="M776.8,117.1c-5.5,0-10.6-0.9-15-2.8c-4.5-1.9-8.3-4.5-11.5-7.7c-3.2-3.3-5.6-7-7.3-11.4
+ c-1.7-4.3-2.6-8.8-2.6-13.6c0-4.9,0.8-9.6,2.5-13.9c1.7-4.4,4.1-8.2,7.3-11.5c3.2-3.3,7-5.9,11.6-7.9c4.5-1.9,9.6-2.9,15.2-2.9
+ c5.6,0,10.7,1,15.1,2.9c4.4,1.9,8.2,4.5,11.4,7.8c3.1,3.3,5.5,7,7.1,11.4c1.6,4.3,2.4,8.8,2.4,13.5c0,1.1,0,2.2-0.1,3.3
+ c0,1.1-0.2,1.9-0.3,2.6h-53.5c0.3,2.7,0.9,5.1,2,7.3c1.1,2.1,2.4,3.9,4.1,5.4c1.7,1.5,3.6,2.6,5.7,3.4c2.1,0.8,4.3,1.2,6.6,1.2
+ c3.5,0,6.8-0.9,10-2.6c3.1-1.7,5.3-4,6.4-6.8L809,99c-2.6,5.3-6.6,9.6-12.2,13C791.2,115.4,784.5,117.1,776.8,117.1z M794.7,75.4
+ c-0.4-5.2-2.4-9.3-5.7-12.5c-3.4-3.1-7.5-4.7-12.3-4.7c-2.4,0-4.6,0.4-6.7,1.3c-2.1,0.8-3.9,2-5.5,3.5c-1.6,1.5-2.9,3.3-3.9,5.4
+ c-1,2.1-1.6,4.4-1.8,7H794.7z"/>
+</g>
+<path class="st3" d="M110.9,424.7c0,0-30.1-0.6-48.4,18.3l-4.9-4.9c0,0,17.2-18.7,53.3-20.5C110.9,417.6,110.9,424.7,110.9,424.7z"
+ />
+</svg>
diff --git a/console/public/images/icon.png b/console/public/images/icon.png
new file mode 100644
index 00000000..219f63b0
Binary files /dev/null and b/console/public/images/icon.png differ
diff --git a/console/public/images/icon.svg b/console/public/images/icon.svg
new file mode 100644
index 00000000..6de9d972
--- /dev/null
+++ b/console/public/images/icon.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 137 137"><defs><style>.cls-1{fill:#fff;}.cls-2{fill:#4391ea;}</style></defs><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><path class="cls-1" d="M62.1,56.6l-5-5,.7-.7a78.54,78.54,0,0,1,53.1-20.6V23.5s-84.5,1.4-85.5,89.1H111V91.5a14.94,14.94,0,0,0-9.4,3.3,5.55,5.55,0,0,0-.8.6l-4.9-4.9a4.62,4.62,0,0,1,.7-.7A22.18,22.18,0,0,1,111,84.5V78.4a31.49,31.49,0,0,0-19.2,6.7,5.55,5.55,0,0,0-.8.6l-5-5c.3-.2.5-.4.8-.6A38.09,38.09,0,0,1,111,71.4V65A44.21,44.21,0,0,0,82.3,75.5c-.3.3-.6.5-.8.7l-5-5a5,5,0,0,1,.8-.7A51.56,51.56,0,0,1,111,57.9V51.3A58,58,0,0,0,72.6,65.8a5.72,5.72,0,0,0-.8.7l-4.9-5c.3-.3.6-.5.8-.7A65.18,65.18,0,0,1,111,44.3V37.4A71.91,71.91,0,0,0,62.8,55.9Z"/><path class="cls-2" d="M127,0H10A10,10,0,0,0,0,10V127a10,10,0,0,0,10,10H127a10,10,0,0,0,10-10V10A10,10,0,0,0,127,0ZM111,44.3A65.18,65.18,0,0,0,67.7,60.8c-.2.2-.5.4-.8.7l4.9,5a5.72,5.72,0,0,1,.8-.7A58,58,0,0,1,111,51.3v6.6A51.56,51.56,0,0,0,77.3,70.5a5,5,0,0,0-.8.7l5,5c.2-.2.5-.4.8-.7A44.21,44.21,0,0,1,111,65v6.4a38.09,38.09,0,0,0-24.2,8.7c-.3.2-.5.4-.8.6l5,5a5.55,5.55,0,0,1,.8-.6A31.49,31.49,0,0,1,111,78.4v6.1a22.18,22.18,0,0,0-14.4,5.3,4.62,4.62,0,0,0-.7.7l4.9,4.9a5.55,5.55,0,0,1,.8-.6,14.94,14.94,0,0,1,9.4-3.3v21.1H25.4c1-87.7,85.5-89.1,85.5-89.1v6.8A78.54,78.54,0,0,0,57.8,50.9l-.7.7,5,5,.7-.7A71.91,71.91,0,0,1,111,37.4Z"/></g></g></svg>
\ No newline at end of file
diff --git a/console/public/robots.txt b/console/public/robots.txt
new file mode 100644
index 00000000..f5916452
--- /dev/null
+++ b/console/public/robots.txt
@@ -0,0 +1,3 @@
+# http://www.robotstxt.org
+User-agent: *
+Disallow:
diff --git a/console/router.map.js b/console/router.map.js
new file mode 100644
index 00000000..ccd4a38b
--- /dev/null
+++ b/console/router.map.js
@@ -0,0 +1,48 @@
+import EmberRouter from '@ember/routing/router';
+import config from '@fleetbase/console/config/environment';
+
+export default class Router extends EmberRouter {
+ location = config.locationType;
+ rootURL = config.rootURL;
+}
+
+Router.map(function () {
+ this.route('auth', function () {
+ this.route('login', { path: '/' });
+ this.route('forgot-password');
+ this.route('reset-password');
+ });
+ this.route('onboard', function () {
+ this.route('verify-email');
+ });
+ this.route('invite', { path: 'join' }, function () {
+ this.route('for-driver', { path: '/fleet/:public_id' });
+ this.route('for-user', { path: '/org/:public_id' });
+ });
+ this.route('console', { path: '/' }, function () {
+ this.route('home', { path: '/' });
+ this.route('extensions');
+ this.route('account', function () {
+ this.route('virtual', { path: '/:slug/:view' });
+ });
+ this.route('settings', function () {
+ this.route('virtual', { path: '/:slug/:view' });
+ });
+ this.route('virtual', { path: '/:slug/:view' });
+ this.route('admin', function () {
+ this.route('config', function () {
+ this.route('database');
+ this.route('cache');
+ this.route('filesystem');
+ this.route('mail');
+ this.route('notification-channels');
+ this.route('queue');
+ this.route('services');
+ this.route('socket');
+ });
+ this.route('branding');
+ this.route('virtual', { path: '/:slug/:view' });
+ });
+ });
+ this.route('install');
+});
diff --git a/console/tailwind.js b/console/tailwind.js
new file mode 100644
index 00000000..03a5c279
--- /dev/null
+++ b/console/tailwind.js
@@ -0,0 +1,114 @@
+/** @type {import('tailwindcss').Config} */
+module.exports = {
+ darkMode: ['class', '[data-theme="dark"]'],
+ content: [
+ './app/**/*.{hbs,js}',
+ './node_modules/@fleetbase/ember-ui/addon/**/*.{hbs,js}',
+ './node_modules/@fleetbase/ember-ui/addon/templates/*.{hbs,js}',
+ './node_modules/@fleetbase/ember-ui/addon/templates/**/*.{hbs,js}',
+ './node_modules/@fleetbase/ember-ui/addon/components/*.{hbs,js}',
+ './node_modules/@fleetbase/ember-ui/addon/components/**/*.{hbs,js}',
+ './node_modules/@fleetbase/ember-core/addon/**/*.{hbs,js}',
+ './node_modules/@fleetbase/fleetops-engine/addon/**/*.{hbs,js}',
+ './node_modules/@fleetbase/storefront-engine/addon/**/*.{hbs,js}',
+ './node_modules/@fleetbase/*-engine/addon/**/*.{hbs,js}',
+ './node_modules/**/*-engine/addon/**/*.{hbs,js}',
+ '../packages/*-engine/addon/**/*.{hbs,js}',
+ ],
+ theme: {
+ extend: {
+ gridTemplateColumns: {
+ span: ['span 1', 'span 2', 'span 3', 'span 4', 'span 5', 'span 6', 'span 7', 'span 8', 'span 9', 'span 10', 'span 11', 'span 12'],
+ },
+ ringColor: {
+ DEFAULT: 'transparent',
+ },
+ colors: {
+ sky: {
+ 100: '#e6f0fb',
+ 200: '#bad5f5',
+ 300: '#8dbbef',
+ 400: '#61a0e8',
+ 500: '#3485e2',
+ 600: '#1c6cc7',
+ 700: '#16539a',
+ 800: '#103b6d',
+ 900: '#092341',
+ },
+ nightsky: {
+ 100: '#0d2f57',
+ 200: '#092340',
+ 300: '#06172a',
+ 400: '#030b14',
+ },
+ night: {
+ 801: '#222C3C',
+ 802: '#202A3A',
+ 803: '#1D2737',
+ 804: '#1B2535',
+ 805: '#182232',
+ 901: '#131B2B',
+ 902: '#111929',
+ 903: '#0E1626',
+ 904: '#0C1424',
+ 905: '#091121',
+ },
+ midnight: {
+ 100: '#555555',
+ 200: '#484848',
+ 300: '#3b3b3b',
+ 400: '#2e2e2e',
+ 500: '#222222',
+ 600: '#151515',
+ 700: '#080808',
+ },
+ moregray: {
+ 750: '#283345',
+ 850: '#212a38',
+ },
+ },
+ boxShadow: {
+ xs: '0 0 0 1px rgba(0,0,0, 0.05)',
+ 'light-xs': '0 0 0 1px rgba(212,220,236, 0.05)',
+ 'light-sm': '0 1px 2px 0 rgba(212,220,236, 0.05)',
+ light: '0 1px 3px 0 rgba(212,220,236, 0.1), 0 1px 2px 0 rgba(212,220,236, 0.06)',
+ 'light-md': '0 4px 6px -1px rgba(212,220,236, 0.1), 0 2px 4px -1px rgba(212,220,236, 0.06)',
+ 'light-lg': '0 10px 15px -3px rgba(212,220,236, 0.1), 0 4px 6px -2px rgba(212,220,236, 0.05)',
+ 'light-xl': '0 20px 25px -5px rgba(212,220,236, 0.1), 0 10px 10px -5px rgba(212,220,236, 0.04)',
+ 'light-2xl': '0 25px 50px -12px rgba(212,220,236, 0.25)',
+ 'light-3xl': '0 35px 60px -15px rgba(212,220,236, 0.3)',
+ pop: '0 0 2.25rem #d4dcec',
+ 'pop-less': '0 0 1rem #d4dcec',
+ 'pop-lesser': '0 0 .5rem #d4dcec',
+ 'pop-least': '0 0 .25rem #d4dcec',
+ 'dark-overlay': '-5px 10px 13px 3px rgba(0,0,0,0.3)',
+ 'dark-overlay-gray': '-5px 10px 13px 3px rgba(26, 32, 44, .5)',
+ 'overlay-inner': 'inset 0 1px 5px 0 rgba(0, 0, 0, 0.3)',
+ 'next-nav': 'rgba(0 0 0 / 35%) 0px 7px 32px',
+ },
+ width: {
+ 70: '18rem',
+ 74: '22rem',
+ 78: '26rem',
+ 82: '28rem',
+ 86: '30rem',
+ },
+ spacing: {
+ 70: '18rem',
+ 74: '22rem',
+ 78: '26rem',
+ 82: '28rem',
+ 86: '30rem',
+ },
+ },
+ },
+ variants: {
+ boxShadow: ['responsive', 'hover', 'focus', 'group-focus', 'dark'],
+ backgroundColor: ['responsive', 'hover', 'focus', 'dark', 'dark-hover', 'dark-group-hover', 'dark-even', 'dark-odd'],
+ borderColor: ['responsive', 'hover', 'focus', 'dark', 'dark-disabled', 'dark-focus', 'dark-focus-within'],
+ border: ['hover', 'focus', 'dark', 'dark-disabled', 'dark-focus'],
+ textColor: ['responsive', 'hover', 'focus', 'dark', 'dark-hover', 'dark-active', 'dark-placeholder'],
+ maxWidth: ['responsive', 'hover', 'focus'],
+ },
+ plugins: [require('@tailwindcss/forms')],
+};
diff --git a/console/testem.js b/console/testem.js
new file mode 100644
index 00000000..633ddb51
--- /dev/null
+++ b/console/testem.js
@@ -0,0 +1,23 @@
+'use strict';
+
+module.exports = {
+ test_page: 'tests/index.html?hidepassed',
+ disable_watching: true,
+ launch_in_ci: ['Chrome'],
+ launch_in_dev: ['Chrome'],
+ browser_start_timeout: 120,
+ browser_args: {
+ Chrome: {
+ ci: [
+ // --no-sandbox is needed when running Chrome inside a container
+ process.env.CI ? '--no-sandbox' : null,
+ '--headless',
+ '--disable-dev-shm-usage',
+ '--disable-software-rasterizer',
+ '--mute-audio',
+ '--remote-debugging-port=0',
+ '--window-size=1440,900',
+ ].filter(Boolean),
+ },
+ },
+};
diff --git a/console/tests/helpers/index.js b/console/tests/helpers/index.js
new file mode 100644
index 00000000..4b9e23f4
--- /dev/null
+++ b/console/tests/helpers/index.js
@@ -0,0 +1,38 @@
+import { setupApplicationTest as upstreamSetupApplicationTest, setupRenderingTest as upstreamSetupRenderingTest, setupTest as upstreamSetupTest } from 'ember-qunit';
+
+// This file exists to provide wrappers around ember-qunit's / ember-mocha's
+// test setup functions. This way, you can easily extend the setup that is
+// needed per test type.
+
+function setupApplicationTest(hooks, options) {
+ upstreamSetupApplicationTest(hooks, options);
+
+ // Additional setup for application tests can be done here.
+ //
+ // For example, if you need an authenticated session for each
+ // application test, you could do:
+ //
+ // hooks.beforeEach(async function () {
+ // await authenticateSession(); // ember-simple-auth
+ // });
+ //
+ // This is also a good place to call test setup functions coming
+ // from other addons:
+ //
+ // setupIntl(hooks); // ember-intl
+ // setupMirage(hooks); // ember-cli-mirage
+}
+
+function setupRenderingTest(hooks, options) {
+ upstreamSetupRenderingTest(hooks, options);
+
+ // Additional setup for rendering tests can be done here.
+}
+
+function setupTest(hooks, options) {
+ upstreamSetupTest(hooks, options);
+
+ // Additional setup for unit tests can be done here.
+}
+
+export { setupApplicationTest, setupRenderingTest, setupTest };
diff --git a/console/tests/index.html b/console/tests/index.html
new file mode 100644
index 00000000..ace0a8da
--- /dev/null
+++ b/console/tests/index.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>@fleetbase/console Tests</title>
+ <meta name="description" content="">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+
+ {{content-for "head"}}
+ {{content-for "test-head"}}
+
+ <link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
+ <link rel="stylesheet" href="{{rootURL}}assets/@fleetbase/console.css">
+ <link rel="stylesheet" href="{{rootURL}}assets/test-support.css">
+
+ {{content-for "head-footer"}}
+ {{content-for "test-head-footer"}}
+ </head>
+ <body>
+ {{content-for "body"}}
+ {{content-for "test-body"}}
+
+ <div id="qunit"></div>
+ <div id="qunit-fixture">
+ <div id="ember-testing-container">
+ <div id="ember-testing"></div>
+ </div>
+ </div>
+
+ <script src="/testem.js" integrity="" data-embroider-ignore></script>
+ <script src="{{rootURL}}assets/vendor.js"></script>
+ <script src="{{rootURL}}assets/test-support.js"></script>
+ <script src="{{rootURL}}assets/@fleetbase/console.js"></script>
+ <script src="{{rootURL}}assets/tests.js"></script>
+
+ {{content-for "body-footer"}}
+ {{content-for "test-body-footer"}}
+ </body>
+</html>
diff --git a/console/tests/integration/.gitkeep b/console/tests/integration/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/console/tests/integration/components/configure/filesystem-test.js b/console/tests/integration/components/configure/filesystem-test.js
new file mode 100644
index 00000000..34c2287c
--- /dev/null
+++ b/console/tests/integration/components/configure/filesystem-test.js
@@ -0,0 +1,26 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from '@fleetbase/console/tests/helpers';
+import { render } from '@ember/test-helpers';
+import { hbs } from 'ember-cli-htmlbars';
+
+module('Integration | Component | configure/filesystem', function (hooks) {
+ setupRenderingTest(hooks);
+
+ test('it renders', async function (assert) {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.set('myAction', function(val) { ... });
+
+ await render(hbs`<Configure::Filesystem />`);
+
+ assert.dom(this.element).hasText('');
+
+ // Template block usage:
+ await render(hbs`
+ <Configure::Filesystem>
+ template block text
+ </Configure::Filesystem>
+ `);
+
+ assert.dom(this.element).hasText('template block text');
+ });
+});
diff --git a/console/tests/integration/components/configure/mail-test.js b/console/tests/integration/components/configure/mail-test.js
new file mode 100644
index 00000000..fd9f7829
--- /dev/null
+++ b/console/tests/integration/components/configure/mail-test.js
@@ -0,0 +1,26 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from '@fleetbase/console/tests/helpers';
+import { render } from '@ember/test-helpers';
+import { hbs } from 'ember-cli-htmlbars';
+
+module('Integration | Component | configure/mail', function (hooks) {
+ setupRenderingTest(hooks);
+
+ test('it renders', async function (assert) {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.set('myAction', function(val) { ... });
+
+ await render(hbs`<Configure::Mail />`);
+
+ assert.dom(this.element).hasText('');
+
+ // Template block usage:
+ await render(hbs`
+ <Configure::Mail>
+ template block text
+ </Configure::Mail>
+ `);
+
+ assert.dom(this.element).hasText('template block text');
+ });
+});
diff --git a/console/tests/integration/components/configure/notification-channels-test.js b/console/tests/integration/components/configure/notification-channels-test.js
new file mode 100644
index 00000000..d79cb8f1
--- /dev/null
+++ b/console/tests/integration/components/configure/notification-channels-test.js
@@ -0,0 +1,26 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from '@fleetbase/console/tests/helpers';
+import { render } from '@ember/test-helpers';
+import { hbs } from 'ember-cli-htmlbars';
+
+module('Integration | Component | configure/notification-channels', function (hooks) {
+ setupRenderingTest(hooks);
+
+ test('it renders', async function (assert) {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.set('myAction', function(val) { ... });
+
+ await render(hbs`<Configure::NotificationChannels />`);
+
+ assert.dom(this.element).hasText('');
+
+ // Template block usage:
+ await render(hbs`
+ <Configure::NotificationChannels>
+ template block text
+ </Configure::NotificationChannels>
+ `);
+
+ assert.dom(this.element).hasText('template block text');
+ });
+});
diff --git a/console/tests/integration/components/configure/queue-test.js b/console/tests/integration/components/configure/queue-test.js
new file mode 100644
index 00000000..66d70e07
--- /dev/null
+++ b/console/tests/integration/components/configure/queue-test.js
@@ -0,0 +1,26 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from '@fleetbase/console/tests/helpers';
+import { render } from '@ember/test-helpers';
+import { hbs } from 'ember-cli-htmlbars';
+
+module('Integration | Component | configure/queue', function (hooks) {
+ setupRenderingTest(hooks);
+
+ test('it renders', async function (assert) {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.set('myAction', function(val) { ... });
+
+ await render(hbs`<Configure::Queue />`);
+
+ assert.dom(this.element).hasText('');
+
+ // Template block usage:
+ await render(hbs`
+ <Configure::Queue>
+ template block text
+ </Configure::Queue>
+ `);
+
+ assert.dom(this.element).hasText('template block text');
+ });
+});
diff --git a/console/tests/integration/components/configure/services-test.js b/console/tests/integration/components/configure/services-test.js
new file mode 100644
index 00000000..3aa2deab
--- /dev/null
+++ b/console/tests/integration/components/configure/services-test.js
@@ -0,0 +1,26 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from '@fleetbase/console/tests/helpers';
+import { render } from '@ember/test-helpers';
+import { hbs } from 'ember-cli-htmlbars';
+
+module('Integration | Component | configure/services', function (hooks) {
+ setupRenderingTest(hooks);
+
+ test('it renders', async function (assert) {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.set('myAction', function(val) { ... });
+
+ await render(hbs`<Configure::Services />`);
+
+ assert.dom(this.element).hasText('');
+
+ // Template block usage:
+ await render(hbs`
+ <Configure::Services>
+ template block text
+ </Configure::Services>
+ `);
+
+ assert.dom(this.element).hasText('template block text');
+ });
+});
diff --git a/console/tests/integration/components/configure/socket-test.js b/console/tests/integration/components/configure/socket-test.js
new file mode 100644
index 00000000..cc258ce4
--- /dev/null
+++ b/console/tests/integration/components/configure/socket-test.js
@@ -0,0 +1,26 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from '@fleetbase/console/tests/helpers';
+import { render } from '@ember/test-helpers';
+import { hbs } from 'ember-cli-htmlbars';
+
+module('Integration | Component | configure/socket', function (hooks) {
+ setupRenderingTest(hooks);
+
+ test('it renders', async function (assert) {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.set('myAction', function(val) { ... });
+
+ await render(hbs`<Configure::Socket />`);
+
+ assert.dom(this.element).hasText('');
+
+ // Template block usage:
+ await render(hbs`
+ <Configure::Socket>
+ template block text
+ </Configure::Socket>
+ `);
+
+ assert.dom(this.element).hasText('template block text');
+ });
+});
diff --git a/console/tests/integration/components/dashboard-test.js b/console/tests/integration/components/dashboard-test.js
new file mode 100644
index 00000000..62b00547
--- /dev/null
+++ b/console/tests/integration/components/dashboard-test.js
@@ -0,0 +1,26 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from '@fleetbase/console/tests/helpers';
+import { render } from '@ember/test-helpers';
+import { hbs } from 'ember-cli-htmlbars';
+
+module('Integration | Component | dashboard', function (hooks) {
+ setupRenderingTest(hooks);
+
+ test('it renders', async function (assert) {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.set('myAction', function(val) { ... });
+
+ await render(hbs`<Dashboard />`);
+
+ assert.dom(this.element).hasText('');
+
+ // Template block usage:
+ await render(hbs`
+ <Dashboard>
+ template block text
+ </Dashboard>
+ `);
+
+ assert.dom(this.element).hasText('template block text');
+ });
+});
diff --git a/console/tests/integration/components/dashboard/count-test.js b/console/tests/integration/components/dashboard/count-test.js
new file mode 100644
index 00000000..b7ccc203
--- /dev/null
+++ b/console/tests/integration/components/dashboard/count-test.js
@@ -0,0 +1,26 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from '@fleetbase/console/tests/helpers';
+import { render } from '@ember/test-helpers';
+import { hbs } from 'ember-cli-htmlbars';
+
+module('Integration | Component | dashboard/count', function (hooks) {
+ setupRenderingTest(hooks);
+
+ test('it renders', async function (assert) {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.set('myAction', function(val) { ... });
+
+ await render(hbs`<Dashboard::Count />`);
+
+ assert.dom(this.element).hasText('');
+
+ // Template block usage:
+ await render(hbs`
+ <Dashboard::Count>
+ template block text
+ </Dashboard::Count>
+ `);
+
+ assert.dom(this.element).hasText('template block text');
+ });
+});
diff --git a/console/tests/integration/components/dashboard/create-test.js b/console/tests/integration/components/dashboard/create-test.js
new file mode 100644
index 00000000..cd765c96
--- /dev/null
+++ b/console/tests/integration/components/dashboard/create-test.js
@@ -0,0 +1,26 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from '@fleetbase/console/tests/helpers';
+import { render } from '@ember/test-helpers';
+import { hbs } from 'ember-cli-htmlbars';
+
+module('Integration | Component | dashboard/create', function (hooks) {
+ setupRenderingTest(hooks);
+
+ test('it renders', async function (assert) {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.set('myAction', function(val) { ... });
+
+ await render(hbs`<Dashboard::Create />`);
+
+ assert.dom(this.element).hasText('');
+
+ // Template block usage:
+ await render(hbs`
+ <Dashboard::Create>
+ template block text
+ </Dashboard::Create>
+ `);
+
+ assert.dom(this.element).hasText('template block text');
+ });
+});
diff --git a/console/tests/integration/components/dashboard/query-params-test.js b/console/tests/integration/components/dashboard/query-params-test.js
new file mode 100644
index 00000000..5af3349b
--- /dev/null
+++ b/console/tests/integration/components/dashboard/query-params-test.js
@@ -0,0 +1,26 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from '@fleetbase/console/tests/helpers';
+import { render } from '@ember/test-helpers';
+import { hbs } from 'ember-cli-htmlbars';
+
+module('Integration | Component | dashboard/query-params', function (hooks) {
+ setupRenderingTest(hooks);
+
+ test('it renders', async function (assert) {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.set('myAction', function(val) { ... });
+
+ await render(hbs`<Dashboard::QueryParams />`);
+
+ assert.dom(this.element).hasText('');
+
+ // Template block usage:
+ await render(hbs`
+ <Dashboard::QueryParams>
+ template block text
+ </Dashboard::QueryParams>
+ `);
+
+ assert.dom(this.element).hasText('template block text');
+ });
+});
diff --git a/console/tests/integration/components/fleetbase-blog-test.js b/console/tests/integration/components/fleetbase-blog-test.js
new file mode 100644
index 00000000..46e7f774
--- /dev/null
+++ b/console/tests/integration/components/fleetbase-blog-test.js
@@ -0,0 +1,26 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from '@fleetbase/console/tests/helpers';
+import { render } from '@ember/test-helpers';
+import { hbs } from 'ember-cli-htmlbars';
+
+module('Integration | Component | fleetbase-blog', function (hooks) {
+ setupRenderingTest(hooks);
+
+ test('it renders', async function (assert) {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.set('myAction', function(val) { ... });
+
+ await render(hbs`<FleetbaseBlog />`);
+
+ assert.dom(this.element).hasText('');
+
+ // Template block usage:
+ await render(hbs`
+ <FleetbaseBlog>
+ template block text
+ </FleetbaseBlog>
+ `);
+
+ assert.dom(this.element).hasText('template block text');
+ });
+});
diff --git a/console/tests/integration/components/github-card-test.js b/console/tests/integration/components/github-card-test.js
new file mode 100644
index 00000000..c09218b5
--- /dev/null
+++ b/console/tests/integration/components/github-card-test.js
@@ -0,0 +1,26 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from '@fleetbase/console/tests/helpers';
+import { render } from '@ember/test-helpers';
+import { hbs } from 'ember-cli-htmlbars';
+
+module('Integration | Component | github-card', function (hooks) {
+ setupRenderingTest(hooks);
+
+ test('it renders', async function (assert) {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.set('myAction', function(val) { ... });
+
+ await render(hbs`<GithubCard />`);
+
+ assert.dom(this.element).hasText('');
+
+ // Template block usage:
+ await render(hbs`
+ <GithubCard>
+ template block text
+ </GithubCard>
+ `);
+
+ assert.dom(this.element).hasText('template block text');
+ });
+});
diff --git a/console/tests/integration/helpers/json-pretty-print-test.js b/console/tests/integration/helpers/json-pretty-print-test.js
new file mode 100644
index 00000000..c5ffc995
--- /dev/null
+++ b/console/tests/integration/helpers/json-pretty-print-test.js
@@ -0,0 +1,17 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from '@fleetbase/console/tests/helpers';
+import { render } from '@ember/test-helpers';
+import { hbs } from 'ember-cli-htmlbars';
+
+module('Integration | Helper | json-pretty-print', function (hooks) {
+ setupRenderingTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it renders', async function (assert) {
+ this.set('inputValue', '1234');
+
+ await render(hbs`{{json-pretty-print this.inputValue}}`);
+
+ assert.dom(this.element).hasText('1234');
+ });
+});
diff --git a/console/tests/test-helper.js b/console/tests/test-helper.js
new file mode 100644
index 00000000..45ae0dfc
--- /dev/null
+++ b/console/tests/test-helper.js
@@ -0,0 +1,12 @@
+import Application from '@fleetbase/console/app';
+import config from '@fleetbase/console/config/environment';
+import * as QUnit from 'qunit';
+import { setApplication } from '@ember/test-helpers';
+import { setup } from 'qunit-dom';
+import { start } from 'ember-qunit';
+
+setApplication(Application.create(config.APP));
+
+setup(QUnit.assert);
+
+start();
diff --git a/console/tests/unit/.gitkeep b/console/tests/unit/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/console/tests/unit/adapters/application-test.js b/console/tests/unit/adapters/application-test.js
new file mode 100644
index 00000000..296eceb4
--- /dev/null
+++ b/console/tests/unit/adapters/application-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Adapter | application', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let adapter = this.owner.lookup('adapter:application');
+ assert.ok(adapter);
+ });
+});
diff --git a/console/tests/unit/adapters/brand-test.js b/console/tests/unit/adapters/brand-test.js
new file mode 100644
index 00000000..a4f55909
--- /dev/null
+++ b/console/tests/unit/adapters/brand-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Adapter | brand', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let adapter = this.owner.lookup('adapter:brand');
+ assert.ok(adapter);
+ });
+});
diff --git a/console/tests/unit/controllers/application-test.js b/console/tests/unit/controllers/application-test.js
new file mode 100644
index 00000000..5a8de59b
--- /dev/null
+++ b/console/tests/unit/controllers/application-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | application', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:application');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/controllers/auth/forgot-password-test.js b/console/tests/unit/controllers/auth/forgot-password-test.js
new file mode 100644
index 00000000..c9035511
--- /dev/null
+++ b/console/tests/unit/controllers/auth/forgot-password-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | auth/forgot-password', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:auth/forgot-password');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/controllers/auth/login-test.js b/console/tests/unit/controllers/auth/login-test.js
new file mode 100644
index 00000000..dc362586
--- /dev/null
+++ b/console/tests/unit/controllers/auth/login-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | auth/login', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:auth/login');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/controllers/auth/reset-password-test.js b/console/tests/unit/controllers/auth/reset-password-test.js
new file mode 100644
index 00000000..4abc1adf
--- /dev/null
+++ b/console/tests/unit/controllers/auth/reset-password-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | auth/reset-password', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:auth/reset-password');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/controllers/console-test.js b/console/tests/unit/controllers/console-test.js
new file mode 100644
index 00000000..d3df3dfc
--- /dev/null
+++ b/console/tests/unit/controllers/console-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | console', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:console');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/controllers/console/account-test.js b/console/tests/unit/controllers/console/account-test.js
new file mode 100644
index 00000000..07398494
--- /dev/null
+++ b/console/tests/unit/controllers/console/account-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | console/account', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:console/account');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/controllers/console/account/index-test.js b/console/tests/unit/controllers/console/account/index-test.js
new file mode 100644
index 00000000..81c8e26f
--- /dev/null
+++ b/console/tests/unit/controllers/console/account/index-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | console/account/index', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:console/account/index');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/controllers/console/admin-test.js b/console/tests/unit/controllers/console/admin-test.js
new file mode 100644
index 00000000..ccb68c6b
--- /dev/null
+++ b/console/tests/unit/controllers/console/admin-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | console/admin', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:console/admin');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/controllers/console/admin/branding-test.js b/console/tests/unit/controllers/console/admin/branding-test.js
new file mode 100644
index 00000000..4f23eb76
--- /dev/null
+++ b/console/tests/unit/controllers/console/admin/branding-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | console/admin/branding', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:console/admin/branding');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/controllers/console/admin/config/cache-test.js b/console/tests/unit/controllers/console/admin/config/cache-test.js
new file mode 100644
index 00000000..f1205ed3
--- /dev/null
+++ b/console/tests/unit/controllers/console/admin/config/cache-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | console/admin/config/cache', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:console/admin/config/cache');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/controllers/console/admin/config/database-test.js b/console/tests/unit/controllers/console/admin/config/database-test.js
new file mode 100644
index 00000000..51d85499
--- /dev/null
+++ b/console/tests/unit/controllers/console/admin/config/database-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | console/admin/config/database', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:console/admin/config/database');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/controllers/console/admin/config/filesystem-test.js b/console/tests/unit/controllers/console/admin/config/filesystem-test.js
new file mode 100644
index 00000000..d0a29829
--- /dev/null
+++ b/console/tests/unit/controllers/console/admin/config/filesystem-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | console/admin/config/filesystem', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:console/admin/config/filesystem');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/controllers/console/admin/config/mail-test.js b/console/tests/unit/controllers/console/admin/config/mail-test.js
new file mode 100644
index 00000000..932d6d15
--- /dev/null
+++ b/console/tests/unit/controllers/console/admin/config/mail-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | console/admin/config/mail', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:console/admin/config/mail');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/controllers/console/admin/config/notification-channels-test.js b/console/tests/unit/controllers/console/admin/config/notification-channels-test.js
new file mode 100644
index 00000000..d21192de
--- /dev/null
+++ b/console/tests/unit/controllers/console/admin/config/notification-channels-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | console/admin/config/notification-channels', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:console/admin/config/notification-channels');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/controllers/console/admin/config/queue-test.js b/console/tests/unit/controllers/console/admin/config/queue-test.js
new file mode 100644
index 00000000..4f5a5d4a
--- /dev/null
+++ b/console/tests/unit/controllers/console/admin/config/queue-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | console/admin/config/queue', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:console/admin/config/queue');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/controllers/console/admin/config/services-test.js b/console/tests/unit/controllers/console/admin/config/services-test.js
new file mode 100644
index 00000000..1cdc8d70
--- /dev/null
+++ b/console/tests/unit/controllers/console/admin/config/services-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | console/admin/config/services', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:console/admin/config/services');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/controllers/console/home-test.js b/console/tests/unit/controllers/console/home-test.js
new file mode 100644
index 00000000..e0ae011f
--- /dev/null
+++ b/console/tests/unit/controllers/console/home-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | console/home', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:console/home');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/controllers/console/settings-test.js b/console/tests/unit/controllers/console/settings-test.js
new file mode 100644
index 00000000..00c98797
--- /dev/null
+++ b/console/tests/unit/controllers/console/settings-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | console/settings', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:console/settings');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/controllers/console/settings/index-test.js b/console/tests/unit/controllers/console/settings/index-test.js
new file mode 100644
index 00000000..8fee832d
--- /dev/null
+++ b/console/tests/unit/controllers/console/settings/index-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | console/settings/index', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:console/settings/index');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/controllers/install-test.js b/console/tests/unit/controllers/install-test.js
new file mode 100644
index 00000000..a86ff81a
--- /dev/null
+++ b/console/tests/unit/controllers/install-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | install', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:install');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/controllers/invite/for-user-test.js b/console/tests/unit/controllers/invite/for-user-test.js
new file mode 100644
index 00000000..168d6a06
--- /dev/null
+++ b/console/tests/unit/controllers/invite/for-user-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | invite/for-user', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:invite/for-user');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/controllers/onboard/index-test.js b/console/tests/unit/controllers/onboard/index-test.js
new file mode 100644
index 00000000..5592353c
--- /dev/null
+++ b/console/tests/unit/controllers/onboard/index-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | onboard/index', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:onboard/index');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/controllers/onboard/verify-email-test.js b/console/tests/unit/controllers/onboard/verify-email-test.js
new file mode 100644
index 00000000..f5729c5d
--- /dev/null
+++ b/console/tests/unit/controllers/onboard/verify-email-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Controller | onboard/verify-email', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:onboard/verify-email');
+ assert.ok(controller);
+ });
+});
diff --git a/console/tests/unit/initializers/initialize-random-uuid-polyfill-test.js b/console/tests/unit/initializers/initialize-random-uuid-polyfill-test.js
new file mode 100644
index 00000000..c1d9f3ca
--- /dev/null
+++ b/console/tests/unit/initializers/initialize-random-uuid-polyfill-test.js
@@ -0,0 +1,37 @@
+import Application from '@ember/application';
+
+import config from '@fleetbase/console/config/environment';
+import { initialize } from '@fleetbase/console/initializers/initialize-random-uuid-polyfill';
+import { module, test } from 'qunit';
+import Resolver from 'ember-resolver';
+import { run } from '@ember/runloop';
+
+module('Unit | Initializer | initialize-random-uuid-polyfill', function (hooks) {
+ hooks.beforeEach(function () {
+ this.TestApplication = class TestApplication extends Application {
+ modulePrefix = config.modulePrefix;
+ podModulePrefix = config.podModulePrefix;
+ Resolver = Resolver;
+ };
+
+ this.TestApplication.initializer({
+ name: 'initializer under test',
+ initialize,
+ });
+
+ this.application = this.TestApplication.create({
+ autoboot: false,
+ });
+ });
+
+ hooks.afterEach(function () {
+ run(this.application, 'destroy');
+ });
+
+ // TODO: Replace this with your real tests.
+ test('it works', async function (assert) {
+ await this.application.boot();
+
+ assert.ok(true);
+ });
+});
diff --git a/console/tests/unit/initializers/load-socketcluster-client-test.js b/console/tests/unit/initializers/load-socketcluster-client-test.js
new file mode 100644
index 00000000..c86eb3e5
--- /dev/null
+++ b/console/tests/unit/initializers/load-socketcluster-client-test.js
@@ -0,0 +1,37 @@
+import Application from '@ember/application';
+
+import config from '@fleetbase/console/config/environment';
+import { initialize } from '@fleetbase/console/initializers/load-socketcluster-client';
+import { module, test } from 'qunit';
+import Resolver from 'ember-resolver';
+import { run } from '@ember/runloop';
+
+module('Unit | Initializer | load-socketcluster-client', function (hooks) {
+ hooks.beforeEach(function () {
+ this.TestApplication = class TestApplication extends Application {
+ modulePrefix = config.modulePrefix;
+ podModulePrefix = config.podModulePrefix;
+ Resolver = Resolver;
+ };
+
+ this.TestApplication.initializer({
+ name: 'initializer under test',
+ initialize,
+ });
+
+ this.application = this.TestApplication.create({
+ autoboot: false,
+ });
+ });
+
+ hooks.afterEach(function () {
+ run(this.application, 'destroy');
+ });
+
+ // TODO: Replace this with your real tests.
+ test('it works', async function (assert) {
+ await this.application.boot();
+
+ assert.ok(true);
+ });
+});
diff --git a/console/tests/unit/instance-initializers/load-extensions-test.js b/console/tests/unit/instance-initializers/load-extensions-test.js
new file mode 100644
index 00000000..ed2350e2
--- /dev/null
+++ b/console/tests/unit/instance-initializers/load-extensions-test.js
@@ -0,0 +1,39 @@
+import Application from '@ember/application';
+
+import config from '@fleetbase/console/config/environment';
+import { initialize } from '@fleetbase/console/instance-initializers/load-extensions';
+import { module, test } from 'qunit';
+import Resolver from 'ember-resolver';
+import { run } from '@ember/runloop';
+
+module('Unit | Instance Initializer | load-extensions', function (hooks) {
+ hooks.beforeEach(function () {
+ this.TestApplication = class TestApplication extends Application {
+ modulePrefix = config.modulePrefix;
+ podModulePrefix = config.podModulePrefix;
+ Resolver = Resolver;
+ };
+
+ this.TestApplication.instanceInitializer({
+ name: 'initializer under test',
+ initialize,
+ });
+
+ this.application = this.TestApplication.create({
+ autoboot: false,
+ });
+
+ this.instance = this.application.buildInstance();
+ });
+ hooks.afterEach(function () {
+ run(this.instance, 'destroy');
+ run(this.application, 'destroy');
+ });
+
+ // TODO: Replace this with your real tests.
+ test('it works', async function (assert) {
+ await this.instance.boot();
+
+ assert.ok(true);
+ });
+});
diff --git a/console/tests/unit/models/brand-test.js b/console/tests/unit/models/brand-test.js
new file mode 100644
index 00000000..15c41a17
--- /dev/null
+++ b/console/tests/unit/models/brand-test.js
@@ -0,0 +1,13 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Model | brand', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let model = store.createRecord('brand', {});
+ assert.ok(model);
+ });
+});
diff --git a/console/tests/unit/models/category-test.js b/console/tests/unit/models/category-test.js
new file mode 100644
index 00000000..13d59e68
--- /dev/null
+++ b/console/tests/unit/models/category-test.js
@@ -0,0 +1,13 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Model | category', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let model = store.createRecord('category', {});
+ assert.ok(model);
+ });
+});
diff --git a/console/tests/unit/models/company-test.js b/console/tests/unit/models/company-test.js
new file mode 100644
index 00000000..9cf72b02
--- /dev/null
+++ b/console/tests/unit/models/company-test.js
@@ -0,0 +1,13 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Model | company', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let model = store.createRecord('company', {});
+ assert.ok(model);
+ });
+});
diff --git a/console/tests/unit/models/extension-test.js b/console/tests/unit/models/extension-test.js
new file mode 100644
index 00000000..dcfd6cee
--- /dev/null
+++ b/console/tests/unit/models/extension-test.js
@@ -0,0 +1,13 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Model | extension', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let model = store.createRecord('extension', {});
+ assert.ok(model);
+ });
+});
diff --git a/console/tests/unit/models/file-test.js b/console/tests/unit/models/file-test.js
new file mode 100644
index 00000000..f848f0fa
--- /dev/null
+++ b/console/tests/unit/models/file-test.js
@@ -0,0 +1,13 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Model | file', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let model = store.createRecord('file', {});
+ assert.ok(model);
+ });
+});
diff --git a/console/tests/unit/models/group-test.js b/console/tests/unit/models/group-test.js
new file mode 100644
index 00000000..61b86095
--- /dev/null
+++ b/console/tests/unit/models/group-test.js
@@ -0,0 +1,13 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Model | group', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let model = store.createRecord('group', {});
+ assert.ok(model);
+ });
+});
diff --git a/console/tests/unit/models/permission-test.js b/console/tests/unit/models/permission-test.js
new file mode 100644
index 00000000..f01e4578
--- /dev/null
+++ b/console/tests/unit/models/permission-test.js
@@ -0,0 +1,13 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Model | permission', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let model = store.createRecord('permission', {});
+ assert.ok(model);
+ });
+});
diff --git a/console/tests/unit/models/policy-test.js b/console/tests/unit/models/policy-test.js
new file mode 100644
index 00000000..de6b5797
--- /dev/null
+++ b/console/tests/unit/models/policy-test.js
@@ -0,0 +1,13 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Model | policy', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let model = store.createRecord('policy', {});
+ assert.ok(model);
+ });
+});
diff --git a/console/tests/unit/models/role-test.js b/console/tests/unit/models/role-test.js
new file mode 100644
index 00000000..51c66b4a
--- /dev/null
+++ b/console/tests/unit/models/role-test.js
@@ -0,0 +1,13 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Model | role', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let model = store.createRecord('role', {});
+ assert.ok(model);
+ });
+});
diff --git a/console/tests/unit/models/setting-test.js b/console/tests/unit/models/setting-test.js
new file mode 100644
index 00000000..560a849f
--- /dev/null
+++ b/console/tests/unit/models/setting-test.js
@@ -0,0 +1,13 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Model | setting', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let model = store.createRecord('setting', {});
+ assert.ok(model);
+ });
+});
diff --git a/console/tests/unit/models/transaction-test.js b/console/tests/unit/models/transaction-test.js
new file mode 100644
index 00000000..9e13026c
--- /dev/null
+++ b/console/tests/unit/models/transaction-test.js
@@ -0,0 +1,13 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Model | transaction', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let model = store.createRecord('transaction', {});
+ assert.ok(model);
+ });
+});
diff --git a/console/tests/unit/models/user-device-test.js b/console/tests/unit/models/user-device-test.js
new file mode 100644
index 00000000..d84e89f2
--- /dev/null
+++ b/console/tests/unit/models/user-device-test.js
@@ -0,0 +1,13 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Model | user device', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let model = store.createRecord('user-device', {});
+ assert.ok(model);
+ });
+});
diff --git a/console/tests/unit/models/user-test.js b/console/tests/unit/models/user-test.js
new file mode 100644
index 00000000..b4dd010e
--- /dev/null
+++ b/console/tests/unit/models/user-test.js
@@ -0,0 +1,13 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Model | user', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let model = store.createRecord('user', {});
+ assert.ok(model);
+ });
+});
diff --git a/console/tests/unit/routes/application-test.js b/console/tests/unit/routes/application-test.js
new file mode 100644
index 00000000..76276180
--- /dev/null
+++ b/console/tests/unit/routes/application-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | application', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:application');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/auth/forgot-password-test.js b/console/tests/unit/routes/auth/forgot-password-test.js
new file mode 100644
index 00000000..87657b84
--- /dev/null
+++ b/console/tests/unit/routes/auth/forgot-password-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | auth/forgot-password', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:auth/forgot-password');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/auth/login-test.js b/console/tests/unit/routes/auth/login-test.js
new file mode 100644
index 00000000..9781e376
--- /dev/null
+++ b/console/tests/unit/routes/auth/login-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | auth/login', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:auth/login');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/auth/reset-password-test.js b/console/tests/unit/routes/auth/reset-password-test.js
new file mode 100644
index 00000000..2a4298fe
--- /dev/null
+++ b/console/tests/unit/routes/auth/reset-password-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | auth/reset-password', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:auth/reset-password');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console-test.js b/console/tests/unit/routes/console-test.js
new file mode 100644
index 00000000..2096aff0
--- /dev/null
+++ b/console/tests/unit/routes/console-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console/account-test.js b/console/tests/unit/routes/console/account-test.js
new file mode 100644
index 00000000..4061f150
--- /dev/null
+++ b/console/tests/unit/routes/console/account-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console/account', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console/account');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console/account/index-test.js b/console/tests/unit/routes/console/account/index-test.js
new file mode 100644
index 00000000..f6294dc0
--- /dev/null
+++ b/console/tests/unit/routes/console/account/index-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console/account/index', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console/account/index');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console/account/virtual-test.js b/console/tests/unit/routes/console/account/virtual-test.js
new file mode 100644
index 00000000..c0ac4d77
--- /dev/null
+++ b/console/tests/unit/routes/console/account/virtual-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console/account/virtual', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console/account/virtual');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console/admin-test.js b/console/tests/unit/routes/console/admin-test.js
new file mode 100644
index 00000000..9652e436
--- /dev/null
+++ b/console/tests/unit/routes/console/admin-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console/admin', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console/admin');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console/admin/branding-test.js b/console/tests/unit/routes/console/admin/branding-test.js
new file mode 100644
index 00000000..11b26668
--- /dev/null
+++ b/console/tests/unit/routes/console/admin/branding-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console/admin/branding', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console/admin/branding');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console/admin/config-test.js b/console/tests/unit/routes/console/admin/config-test.js
new file mode 100644
index 00000000..995652e9
--- /dev/null
+++ b/console/tests/unit/routes/console/admin/config-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console/admin/config', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console/admin/config');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console/admin/config/cache-test.js b/console/tests/unit/routes/console/admin/config/cache-test.js
new file mode 100644
index 00000000..48c1d199
--- /dev/null
+++ b/console/tests/unit/routes/console/admin/config/cache-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console/admin/config/cache', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console/admin/config/cache');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console/admin/config/database-test.js b/console/tests/unit/routes/console/admin/config/database-test.js
new file mode 100644
index 00000000..45293031
--- /dev/null
+++ b/console/tests/unit/routes/console/admin/config/database-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console/admin/config/database', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console/admin/config/database');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console/admin/config/filesystem-test.js b/console/tests/unit/routes/console/admin/config/filesystem-test.js
new file mode 100644
index 00000000..af7ed5d2
--- /dev/null
+++ b/console/tests/unit/routes/console/admin/config/filesystem-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console/admin/config/filesystem', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console/admin/config/filesystem');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console/admin/config/mail-test.js b/console/tests/unit/routes/console/admin/config/mail-test.js
new file mode 100644
index 00000000..a7f4b90a
--- /dev/null
+++ b/console/tests/unit/routes/console/admin/config/mail-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console/admin/config/mail', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console/admin/config/mail');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console/admin/config/notification-channels-test.js b/console/tests/unit/routes/console/admin/config/notification-channels-test.js
new file mode 100644
index 00000000..96a37f13
--- /dev/null
+++ b/console/tests/unit/routes/console/admin/config/notification-channels-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console/admin/config/notification-channels', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console/admin/config/notification-channels');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console/admin/config/queue-test.js b/console/tests/unit/routes/console/admin/config/queue-test.js
new file mode 100644
index 00000000..bc477a1b
--- /dev/null
+++ b/console/tests/unit/routes/console/admin/config/queue-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console/admin/config/queue', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console/admin/config/queue');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console/admin/config/services-test.js b/console/tests/unit/routes/console/admin/config/services-test.js
new file mode 100644
index 00000000..7eef9ebf
--- /dev/null
+++ b/console/tests/unit/routes/console/admin/config/services-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console/admin/config/services', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console/admin/config/services');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console/admin/config/socket-test.js b/console/tests/unit/routes/console/admin/config/socket-test.js
new file mode 100644
index 00000000..a47a3051
--- /dev/null
+++ b/console/tests/unit/routes/console/admin/config/socket-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console/admin/config/socket', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console/admin/config/socket');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console/admin/index-test.js b/console/tests/unit/routes/console/admin/index-test.js
new file mode 100644
index 00000000..e4b0744f
--- /dev/null
+++ b/console/tests/unit/routes/console/admin/index-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console/admin/index', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console/admin/index');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console/admin/virtual-test.js b/console/tests/unit/routes/console/admin/virtual-test.js
new file mode 100644
index 00000000..e5d982b8
--- /dev/null
+++ b/console/tests/unit/routes/console/admin/virtual-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console/admin/virtual', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console/admin/virtual');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console/extensions-test.js b/console/tests/unit/routes/console/extensions-test.js
new file mode 100644
index 00000000..7ccba108
--- /dev/null
+++ b/console/tests/unit/routes/console/extensions-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console/extensions', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console/extensions');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console/home-test.js b/console/tests/unit/routes/console/home-test.js
new file mode 100644
index 00000000..eca6d72e
--- /dev/null
+++ b/console/tests/unit/routes/console/home-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console/home', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console/home');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console/settings-test.js b/console/tests/unit/routes/console/settings-test.js
new file mode 100644
index 00000000..c327b984
--- /dev/null
+++ b/console/tests/unit/routes/console/settings-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console/settings', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console/settings');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console/settings/index-test.js b/console/tests/unit/routes/console/settings/index-test.js
new file mode 100644
index 00000000..88e30c88
--- /dev/null
+++ b/console/tests/unit/routes/console/settings/index-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console/settings/index', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console/settings/index');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console/settings/virtual-test.js b/console/tests/unit/routes/console/settings/virtual-test.js
new file mode 100644
index 00000000..cb4ee47b
--- /dev/null
+++ b/console/tests/unit/routes/console/settings/virtual-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console/settings/virtual', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console/settings/virtual');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/console/virtual-test.js b/console/tests/unit/routes/console/virtual-test.js
new file mode 100644
index 00000000..aedf12b8
--- /dev/null
+++ b/console/tests/unit/routes/console/virtual-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | console/virtual', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:console/virtual');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/install-test.js b/console/tests/unit/routes/install-test.js
new file mode 100644
index 00000000..9d6994f9
--- /dev/null
+++ b/console/tests/unit/routes/install-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | install', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:install');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/invite-test.js b/console/tests/unit/routes/invite-test.js
new file mode 100644
index 00000000..0be17fea
--- /dev/null
+++ b/console/tests/unit/routes/invite-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | invite', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:invite');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/invite/for-driver-test.js b/console/tests/unit/routes/invite/for-driver-test.js
new file mode 100644
index 00000000..cdd48254
--- /dev/null
+++ b/console/tests/unit/routes/invite/for-driver-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | invite/for-driver', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:invite/for-driver');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/invite/for-user-test.js b/console/tests/unit/routes/invite/for-user-test.js
new file mode 100644
index 00000000..dd1d4aa4
--- /dev/null
+++ b/console/tests/unit/routes/invite/for-user-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | invite/for-user', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:invite/for-user');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/onboard-test.js b/console/tests/unit/routes/onboard-test.js
new file mode 100644
index 00000000..d626b6b9
--- /dev/null
+++ b/console/tests/unit/routes/onboard-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | onboard', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:onboard');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/onboard/index-test.js b/console/tests/unit/routes/onboard/index-test.js
new file mode 100644
index 00000000..9f606d62
--- /dev/null
+++ b/console/tests/unit/routes/onboard/index-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | onboard/index', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:onboard/index');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/routes/onboard/verify-email-test.js b/console/tests/unit/routes/onboard/verify-email-test.js
new file mode 100644
index 00000000..8990c8f1
--- /dev/null
+++ b/console/tests/unit/routes/onboard/verify-email-test.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Route | onboard/verify-email', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:onboard/verify-email');
+ assert.ok(route);
+ });
+});
diff --git a/console/tests/unit/serializers/brand-test.js b/console/tests/unit/serializers/brand-test.js
new file mode 100644
index 00000000..3c752a2f
--- /dev/null
+++ b/console/tests/unit/serializers/brand-test.js
@@ -0,0 +1,23 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Serializer | brand', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let serializer = store.serializerFor('brand');
+
+ assert.ok(serializer);
+ });
+
+ test('it serializes records', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let record = store.createRecord('brand', {});
+
+ let serializedRecord = record.serialize();
+
+ assert.ok(serializedRecord);
+ });
+});
diff --git a/console/tests/unit/serializers/category-test.js b/console/tests/unit/serializers/category-test.js
new file mode 100644
index 00000000..e4636f4e
--- /dev/null
+++ b/console/tests/unit/serializers/category-test.js
@@ -0,0 +1,23 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Serializer | category', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let serializer = store.serializerFor('category');
+
+ assert.ok(serializer);
+ });
+
+ test('it serializes records', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let record = store.createRecord('category', {});
+
+ let serializedRecord = record.serialize();
+
+ assert.ok(serializedRecord);
+ });
+});
diff --git a/console/tests/unit/serializers/group-test.js b/console/tests/unit/serializers/group-test.js
new file mode 100644
index 00000000..d98d3e08
--- /dev/null
+++ b/console/tests/unit/serializers/group-test.js
@@ -0,0 +1,23 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Serializer | group', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let serializer = store.serializerFor('group');
+
+ assert.ok(serializer);
+ });
+
+ test('it serializes records', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let record = store.createRecord('group', {});
+
+ let serializedRecord = record.serialize();
+
+ assert.ok(serializedRecord);
+ });
+});
diff --git a/console/tests/unit/serializers/permission-test.js b/console/tests/unit/serializers/permission-test.js
new file mode 100644
index 00000000..0bc575ec
--- /dev/null
+++ b/console/tests/unit/serializers/permission-test.js
@@ -0,0 +1,23 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Serializer | permission', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let serializer = store.serializerFor('permission');
+
+ assert.ok(serializer);
+ });
+
+ test('it serializes records', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let record = store.createRecord('permission', {});
+
+ let serializedRecord = record.serialize();
+
+ assert.ok(serializedRecord);
+ });
+});
diff --git a/console/tests/unit/serializers/policy-test.js b/console/tests/unit/serializers/policy-test.js
new file mode 100644
index 00000000..38c0e936
--- /dev/null
+++ b/console/tests/unit/serializers/policy-test.js
@@ -0,0 +1,23 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Serializer | policy', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let serializer = store.serializerFor('policy');
+
+ assert.ok(serializer);
+ });
+
+ test('it serializes records', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let record = store.createRecord('policy', {});
+
+ let serializedRecord = record.serialize();
+
+ assert.ok(serializedRecord);
+ });
+});
diff --git a/console/tests/unit/serializers/role-test.js b/console/tests/unit/serializers/role-test.js
new file mode 100644
index 00000000..2356417d
--- /dev/null
+++ b/console/tests/unit/serializers/role-test.js
@@ -0,0 +1,23 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Serializer | role', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let serializer = store.serializerFor('role');
+
+ assert.ok(serializer);
+ });
+
+ test('it serializes records', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let record = store.createRecord('role', {});
+
+ let serializedRecord = record.serialize();
+
+ assert.ok(serializedRecord);
+ });
+});
diff --git a/console/tests/unit/serializers/user-test.js b/console/tests/unit/serializers/user-test.js
new file mode 100644
index 00000000..60cf412a
--- /dev/null
+++ b/console/tests/unit/serializers/user-test.js
@@ -0,0 +1,23 @@
+import { module, test } from 'qunit';
+import { setupTest } from '@fleetbase/console/tests/helpers';
+
+module('Unit | Serializer | user', function (hooks) {
+ setupTest(hooks);
+
+ // Replace this with your real tests.
+ test('it exists', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let serializer = store.serializerFor('user');
+
+ assert.ok(serializer);
+ });
+
+ test('it serializes records', function (assert) {
+ let store = this.owner.lookup('service:store');
+ let record = store.createRecord('user', {});
+
+ let serializedRecord = record.serialize();
+
+ assert.ok(serializedRecord);
+ });
+});
diff --git a/console/tests/unit/utils/get-permission-action-test.js b/console/tests/unit/utils/get-permission-action-test.js
new file mode 100644
index 00000000..c7c78fd1
--- /dev/null
+++ b/console/tests/unit/utils/get-permission-action-test.js
@@ -0,0 +1,10 @@
+import getPermissionAction from '@fleetbase/console/utils/get-permission-action';
+import { module, test } from 'qunit';
+
+module('Unit | Utility | get-permission-action', function () {
+ // TODO: Replace this with your real tests.
+ test('it works', function (assert) {
+ let result = getPermissionAction();
+ assert.ok(result);
+ });
+});
diff --git a/console/tests/unit/utils/get-permission-resource-test.js b/console/tests/unit/utils/get-permission-resource-test.js
new file mode 100644
index 00000000..3ffa2168
--- /dev/null
+++ b/console/tests/unit/utils/get-permission-resource-test.js
@@ -0,0 +1,10 @@
+import getPermissionResource from '@fleetbase/console/utils/get-permission-resource';
+import { module, test } from 'qunit';
+
+module('Unit | Utility | get-permission-resource', function () {
+ // TODO: Replace this with your real tests.
+ test('it works', function (assert) {
+ let result = getPermissionResource();
+ assert.ok(result);
+ });
+});
diff --git a/console/tests/unit/utils/get-service-name-test.js b/console/tests/unit/utils/get-service-name-test.js
new file mode 100644
index 00000000..bd9188d7
--- /dev/null
+++ b/console/tests/unit/utils/get-service-name-test.js
@@ -0,0 +1,10 @@
+import getServiceName from '@fleetbase/console/utils/get-service-name';
+import { module, test } from 'qunit';
+
+module('Unit | Utility | get-service-name', function () {
+ // TODO: Replace this with your real tests.
+ test('it works', function (assert) {
+ let result = getServiceName();
+ assert.ok(result);
+ });
+});
diff --git a/console/translations/en-us.yaml b/console/translations/en-us.yaml
new file mode 100644
index 00000000..9ab375e9
--- /dev/null
+++ b/console/translations/en-us.yaml
@@ -0,0 +1,30 @@
+app:
+ name: Fleetbase
+
+layout:
+ header:
+ menus:
+ organization:
+ settings: Organization settings
+ create-or-join: Create or join organizations
+ explore-extensions: Explore extensions
+ user:
+ view-profile: View profile
+ keyboard-shortcuts: Show keyboard shortcuts
+ changelog: Changelog
+
+terms:
+ new: New
+ sort: Sort
+ filter: Filer
+ columns: Columns
+ settings: Settings
+ home: Home
+ admin: Admin
+ logout: Logout
+ dashboard: Dashboard
+ search: Search
+phrases:
+ search-input: Search Input
+
+
diff --git a/console/vendor/.gitkeep b/console/vendor/.gitkeep
new file mode 100644
index 00000000..e69de29b