Skip to content

Commit

Permalink
Merge pull request #168 from matsn0w/feat/landing-page
Browse files Browse the repository at this point in the history
feat: add landing page
  • Loading branch information
matsn0w authored Nov 21, 2023
2 parents 28ddd02 + f1fa254 commit 59631d7
Show file tree
Hide file tree
Showing 40 changed files with 8,795 additions and 10,508 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Configurator deployer
name: Web deployer

on:
push:
Expand All @@ -16,7 +16,7 @@ jobs:

defaults:
run:
working-directory: ./configurator
working-directory: ./web

steps:
- name: Checkout code
Expand All @@ -36,4 +36,4 @@ jobs:
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ./configurator/.output/public
folder: ./web/.output/public
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ If you have any existing VCF files from the [original author](https://github.com

In both cases, it's probably best to re-create them by either writing them yourself OR... use the convient configuration GUI! Using this tool, you can easily generate configuration files for your vehicles. You can find it here:

[![Open VCF Configurator](https://dabuttonfactory.com/button.png?t=MISS+ELS+VCF+Configurator&f=Open+Sans-Bold&ts=16&tc=fff&hp=45&vp=20&c=10&bgt=unicolored&bgc=1a37a8&be=1&bs=1&bc=fff)](https://matsn0w.github.io/MISS-ELS)
[![Open VCF Configurator](https://dabuttonfactory.com/button.png?t=MISS+ELS+VCF+Configurator&f=Open+Sans-Bold&ts=16&tc=fff&hp=45&vp=20&c=10&bgt=unicolored&bgc=1a37a8&be=1&bs=1&bc=fff)](https://matsn0w.github.io/MISS-ELS/configurator)

## 💭 Questions or problems?

Expand Down
103 changes: 0 additions & 103 deletions configurator/components/lights.vue

This file was deleted.

83 changes: 0 additions & 83 deletions configurator/components/statics.vue

This file was deleted.

Binary file removed configurator/public/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/adding_vcfs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
In order to 'install' a new VCF for a vehicle, you have to perform some steps. Don't worry, you'll get it once you've done it a couple of times!

1. Make sure the vehicle has some extras to work with
2. Create a new VCF, either by using [the Configurator](https://matsn0w.github.io/MISS-ELS) or by writing it yourself
2. Create a new VCF, either by using [the Configurator](https://matsn0w.github.io/MISS-ELS/configurator) or by writing it yourself
3. Save the file in `.../your resource/xmlFiles/`, make sure it is an `.xml` file
4. Restart the MISS ELS resource if it was currently running

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion configurator/README.md → web/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MISS ELS VCF Configurator
# MISS-ELS web

Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.

Expand Down
File renamed without changes.
File renamed without changes.
Binary file added web/assets/images/MISS-ELS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
162 changes: 162 additions & 0 deletions web/components/lights.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
<template>
<div class="flex flex-col justify-center h-full">
<header class="px-5 pt-3 flex items-center gap-4">
<h2>Lightables</h2>
<button
class="disabled:!bg-gray-300 disabled:!text-gray-500 disabled:!cursor-not-allowed blue"
type="button"
@click="addLightable('extra')"
:disabled="availableExtraIds.length === 0"
>
New extra
</button>
<button
class="disabled:!bg-gray-300 disabled:!text-gray-500 disabled:!cursor-not-allowed blue"
type="button"
@click="addLightable('misc')"
:disabled="availableMiscIds.length === 0"
>
New misc
</button>
</header>

<div class="p-3 overflow-x-auto">
<table class="table-auto w-full">
<thead class="text-xs font-semibold uppercase text-gray-400 bg-gray-50">
<tr>
<th>Lightable type</th>
<th>Lightable ID</th>
<th>Allow env light</th>
<th>Color</th>
<th></th>
</tr>
</thead>

<tbody class="text-sm divide-y divide-gray-100">
<tr
v-for="(lightable, index) in VCF.configuration.lightables"
:key="lightable.id"
v-if="VCF.configuration.lightables.length"
>
<td class="font-bold">
<select
v-model="lightable.type"
@change="lightable.id = getNewLightableId(lightable)"
>
<option
value="extra"
:disabled="availableExtraIds.length === 0"
>
Extra
</option>
<option value="misc" :disabled="availableMiscIds.length === 0">
Misc
</option>
</select>
</td>
<td>
<select v-model="lightable.id">
<option
v-if="lightable.type === 'extra'"
v-for="id in extraIds"
:key="'extra_' + id"
:value="id"
:disabled="isLightableIdInUse(id)"
>
{{ id }}
</option>
<option
v-else-if="lightable.type === 'misc'"
v-for="id in miscIds"
:key="'misc_' + id"
:disabled="isLightableIdInUse(id)"
:value="id"
>
{{ id }}
</option>
</select>
</td>
<td>
<label class="cb-label">
<input v-model="lightable.allowEnv" type="checkbox" />
</label>
</td>
<td class="flex items-center gap-4">
<div
class="w-8 h-8 px-2 py-1 rounded-md inline-block"
:class="lightable.color"
/>

<select
:class="!lightable.allowEnv ? 'cursor-not-allowed' : ''"
:title="
!lightable.allowEnv
? 'You need to allow env light to change the color'
: ''
"
v-model="lightable.color"
:disabled="!lightable.allowEnv"
>
<option :value="null">Choose...</option>
<option v-for="color in colors" :key="color" :value="color">
{{ color }}
</option>
</select>
</td>
<td>
<button class="red" type="button" @click="removeLightable(index)">
<XMarkIcon class="w-5 h-5" />
</button>
</td>
</tr>
<tr v-else>
<td colspan="5">
<em>
You have not configured any lightables. Create one by clicking
the '
<strong>New extra</strong>
' or '
<strong>New misc</strong>
' button.
</em>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</template>

<script setup lang="ts">
import { XMarkIcon } from "@heroicons/vue/24/solid";
import type { Lightable, lightableType } from "~/types/lights";
const colors = ["blue", "amber", "red", "green", "white"];
const VCF = useVcfConfiguration();
const removeLightable = (index: number) => {
return VCF.value.configuration.lightables.splice(index, 1);
};
const getNewLightableId = (
lightable: Lightable | null = null,
type: lightableType | null = null
) => {
if (type === "extra" || lightable?.type === "extra") {
return availableExtraIds.value[0] ?? null;
} else if (type === "misc" || lightable?.type === "misc") {
return availableMiscIds.value[0] ?? null;
}
};
const addLightable = (type: lightableType = "extra") => {
VCF.value.configuration.lightables.push({
type: type,
id: getNewLightableId(null, type),
enabled: true,
allowEnv: false,
color: null,
});
};
</script>
Loading

0 comments on commit 59631d7

Please sign in to comment.