improve the advanced options on the device edit card

pull/94/head
Chris Veilleux 2022-09-29 00:55:19 -05:00
parent 94c9276615
commit 1b9e9e09c6
12 changed files with 97 additions and 35 deletions

View File

@ -1,5 +1,4 @@
<mat-card [ngClass]="{'mat-elevation-z0': addDevice}" [formGroup]="deviceForm">
<mat-card-header>
<fa-icon *ngIf="!addDevice" mat-card-avatar [icon]="settingsIcon"></fa-icon>
<mat-card-title *ngIf="addDevice">Device Configuration</mat-card-title>
@ -41,18 +40,20 @@
<mat-divider></mat-divider>
<account-geography-card [geoForm]="deviceForm" [required]="true"></account-geography-card>
<mat-divider></mat-divider>
<account-voice-card [voiceForm]="deviceForm"></account-voice-card>
<mat-divider></mat-divider>
<account-wake-word-card [wakeWordForm]="deviceForm"></account-wake-word-card>
<!-- *** The ability to choose a wake word and voice is being removed until functionality *** -->
<!-- *** is introduced that uses a device's capabilities to determine the possible values. *** -->
<!-- <mat-divider></mat-divider>-->
<!-- <account-voice-card [voiceForm]="deviceForm"></account-voice-card>-->
<!-- <mat-divider></mat-divider>-->
<!-- <account-wake-word-card [wakeWordForm]="deviceForm"></account-wake-word-card>-->
<div *ngIf="pantacorId">
<mat-divider></mat-divider>
<account-software-release-card [softwareReleaseForm]="deviceForm"></account-software-release-card>
<mat-divider></mat-divider>
<account-software-update-card [softwareUpdateForm]="deviceForm"></account-software-update-card>
<mat-divider></mat-divider>
<account-ssh-card [sshForm]="deviceForm"></account-ssh-card>
</div>
<mat-divider></mat-divider>
<account-ssh-card [pantacorDevice]="!!pantacorId" [sshForm]="deviceForm"></account-ssh-card>
</mat-card-content>
<mat-card-actions *ngIf=!addDevice align="end">

View File

@ -33,7 +33,9 @@
}
mat-card {
@include cards.section-card;
@include cards.selene-card;
margin-left: auto;
margin-right: auto;
max-width: 700px;
margin-bottom: 16px;

View File

@ -0,0 +1,21 @@
// *****************************************************************************
// SPDX-License-Identifier: Apache-2.0
//
//
// Copyright (c) Mycroft AI Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at http://www.apache.org/licenses/LICENSE-2.0
//
// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
// WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
// MERCHANTABLITY OR NON-INFRINGEMENT.
//
// See the Apache Version 2.0 License for specific language governing permissions
// and limitations under the License.
// *****************************************************************************
.mat-h3 {
font-weight: bold;
}

View File

@ -1,6 +1,10 @@
<mat-card class="mat-elevation-z0" [formGroup]="softwareReleaseForm">
<mat-card-content>
<h2 class="mat-h2">Software Release</h2>
<h3 class="mat-h3">Software Release</h3>
<p *ngIf="!softwareReleaseForm.get('releaseChannel').value" class="mat-body">
The software release running on this device is no longer supported. Select one of
the options below to update your device to a supported release.
</p>
<account-option-btn
[config]="releaseChannelConfig"
formControlName="releaseChannel"

View File

@ -0,0 +1,25 @@
// *****************************************************************************
// SPDX-License-Identifier: Apache-2.0
//
//
// Copyright (c) Mycroft AI Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at http://www.apache.org/licenses/LICENSE-2.0
//
// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
// WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
// MERCHANTABLITY OR NON-INFRINGEMENT.
//
// See the Apache Version 2.0 License for specific language governing permissions
// and limitations under the License.
// *****************************************************************************
.mat-h3 {
font-weight: bold;
}
.mat-body {
margin-left: 16px;
}

View File

@ -1,6 +1,6 @@
<mat-card class="mat-elevation-z0" [formGroup]="softwareUpdateForm">
<mat-card-content>
<h2 class="mat-h2">Automatic Updates</h2>
<h3 class="mat-h3">Automatic Updates</h3>
<mat-slide-toggle
[color]="'primary'"
[checked]="automaticUpdate"
@ -11,4 +11,3 @@
</mat-slide-toggle>
</mat-card-content>
</mat-card>

View File

@ -16,6 +16,10 @@
// and limitations under the License.
// *****************************************************************************
.mat-h3 {
font-weight: bold;
}
mat-slide-toggle {
padding-left: 32px;
}

View File

@ -1,7 +1,23 @@
<mat-card class="mat-elevation-z0" [formGroup]="sshForm">
<mat-card-content>
<h2 class="mat-h2">Command Line Access</h2>
<mat-form-field appearance="outline">
<h3 class="mat-h3">Advanced Settings</h3>
<p class="mat-body">
This device can be further configured for software development and experimentation
purposes. For example, alternative speech transcription, voice synthesis and wake word
technologies can be specified.
<p class="mat-body">
These advanced settings can be managed by logging into your device and editing a
configuration file. Proceed with caution; a bad configuration file could render your
device unusable.
</p>
<a [href]="'https://mycroft-ai.gitbook.io/docs/using-mycroft-ai/customizations/mycroft-conf'">
Device Configuration Documentation
</a>
<p *ngIf="pantacorDevice" class="mat-body">
To access this device via the command line, provide the public SSH key for the computer
that will be used to access the device below.
</p>
<mat-form-field *ngIf="pantacorDevice" appearance="outline">
<mat-label>Public SSH Key</mat-label>
<textarea matInput formControlName="sshPublicKey"></textarea>
<mat-error *ngIf="sshForm.controls['sshPublicKey'].invalid">

View File

@ -16,10 +16,19 @@
// and limitations under the License.
// *****************************************************************************
mat-slide-toggle {
margin-left: 32px;
a {
margin-left: 16px;
}
.mat-h3 {
font-weight: bold;
}
.mat-body {
margin-left: 16px;
}
mat-form-field {
margin-top: 16px;
margin-left: 32px;
width: 90%;
textarea {

View File

@ -27,6 +27,7 @@ import { MatSlideToggleChange } from '@angular/material/slide-toggle';
})
export class SshCardComponent implements OnInit {
@Input() sshForm: UntypedFormGroup;
@Input() pantacorDevice: boolean;
public sshKeyHint: string;
constructor() {

View File

@ -7,19 +7,4 @@
(saveChanges)="onExit($event)"
>
</account-device-edit-card>
<mat-card>
<mat-card-header>
<fa-icon mat-card-avatar [icon]="advancedSettingsIcon"></fa-icon>
<mat-card-title>Advanced Settings</mat-card-title>
</mat-card-header>
<mat-card-content fxLayout="column" class="section-content">
<div class="mat-body" *ngFor="let paragraph of advancedSettingsDesc">
<p>{{paragraph}}</p>
</div>
</mat-card-content>
<mat-card-actions>
<button mat-button (click)="navigateToDocs()">VIEW DOCUMENTATION</button>
</mat-card-actions>
</mat-card>
</div>

View File

@ -23,10 +23,5 @@
#edit-device {
margin-top: 32px;
}
mat-card {
@include cards.section-card;
max-width: 700px;
margin-bottom: 32px;
margin-top: 32px;
}