Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
snakeye committed Mar 8, 2019
1 parent c9e8799 commit 0640b5f
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 15 deletions.
4 changes: 3 additions & 1 deletion src-js/components/App.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<template>
<div class="container m-auto">
<v-wifi />
<h1>Configuration Manager</h1>

<v-wifi class="mb-8"/>

<v-settings />
</div>
Expand Down
8 changes: 4 additions & 4 deletions src-js/components/Settings.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<div>
App settings
<h2>App settings</h2>

<div v-for="group in groups" :key="`settings-group-${group.name}`">
<v-settings-group :group="group" />
</div>

<div>
<button class="">Reset</button>
<button class="">Save</button>
<div class="text-right">
<button class="btn --secondary mr-4">Reset</button>
<button class="btn --primary ">Save</button>
</div>
</div>
</template>
Expand Down
6 changes: 3 additions & 3 deletions src-js/components/SettingsGroup.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="">
{{ group.label }}
<div class="settings-group">
<h3>{{ group.label }}</h3>

<p>
{{ group.description }}
Expand All @@ -11,7 +11,7 @@
:key="`settings-group-${group.name}-${param.name}`"
class=""
>
<v-settings-param param="param" value="123"/>
<v-settings-param :param="param" value="123"/>
</div>
</div>
</template>
Expand Down
14 changes: 12 additions & 2 deletions src-js/components/SettingsParam.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<template>
<div class="">
<input type="text" v-model="value" class="border"/>
<div v-if="param.type === 'bool'">
<input type="checkbox"/>
<label>{{ param.label }}</label>
</div>
<div v-else class="form-group">
<label>{{ param.label }}</label>
<input type="text" v-model="value" class="form-control"/>
</div>
</template>

Expand All @@ -15,6 +20,11 @@ export default {
type: Number || String || Boolean,
required: true,
}
},
computed: {
isTextInput() {
return type === 'int' || type === 'string';
}
}
};
</script>
Expand Down
27 changes: 22 additions & 5 deletions src-js/components/WiFi.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
<template>
<div>
wifi settings
<div class="">
<h2>WiFi settings</h2>

<p></p>

<div class="settings-group">
<div class="form-group">
<label>Access point</label>
<input type="text" class="form-control" />
</div>

<div class="form-group">
<label>Password</label>
<input type="password" class="form-control" />
</div>
</div>

<div class="text-right">
<button v-if="!connected" class="btn --primary">Connect</button>
<button v-if="connected" class="btn --primary">Disconnect</button>
</div>
</div>
</template>

<script>
export default {
}
export default {};
</script>

<style lang="scss">
Expand Down
20 changes: 20 additions & 0 deletions src-js/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,25 @@ body {
@apply h-full bg-white text-base leading-normal text-black font-sans;
}

.btn {
@apply inline-block text-center border px-2 py-1;

&.--primary {

}

&.--secondary {

}
}

.form-group {
@apply mb-4;
}

.form-control {
@apply block w-full border px-2 py-1;
}

@tailwind utilities;

0 comments on commit 0640b5f

Please sign in to comment.