1
0
mirror of https://github.com/dkmstr/openuds-gui.git synced 2025-01-03 05:17:36 +03:00

Bootstraping

This commit is contained in:
Adolfo Gómez García 2018-05-05 03:23:18 +02:00
parent 6165ca5444
commit 02aa10471f
14 changed files with 82 additions and 25 deletions

View File

@ -8,7 +8,7 @@
"root": "src", "root": "src",
"outDir": "dist", "outDir": "dist",
"assets": [ "assets": [
"assets", "img",
"i18n", "i18n",
"favicon.ico" "favicon.ico"
], ],

View File

@ -1,7 +1,7 @@
{ {
"name": "uds", "name": "uds",
"version": "0.0.0", "version": "3.0.0",
"license": "MIT", "license": "BSD-3-Clause",
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
"start": "ng serve --host 172.27.0.1 --port 9000", "start": "ng serve --host 172.27.0.1 --port 9000",

View File

@ -0,0 +1,3 @@
.container {
margin-top: 64px;
}

View File

@ -9,6 +9,8 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { NavbarComponent } from './navbar/navbar.component'; import { NavbarComponent } from './navbar/navbar.component';
import { TranslateDirective } from './translate.directive'; import { TranslateDirective } from './translate.directive';
// Service providers
import { UdsApiService } from './uds-api.service';
@NgModule({ @NgModule({
declarations: [ declarations: [
@ -22,7 +24,7 @@ import { TranslateDirective } from './translate.directive';
AppRoutingModule, AppRoutingModule,
NgbModule.forRoot() NgbModule.forRoot()
], ],
providers: [], providers: [UdsApiService],
bootstrap: [AppComponent] bootstrap: [AppComponent]
}) })
export class AppModule { } export class AppModule { }

View File

@ -0,0 +1,10 @@
a.dropdown-toggle {
cursor: pointer;
}
.navbar-img {
width: 2em;
margin-top: -8px;
}

View File

@ -1,18 +1,18 @@
<nav class="navbar navbar-expand-md navbar-light bg-light fixed-top"> <nav class="navbar navbar-expand-md navbar-light bg-light fixed-top">
<a class="navbar-brand" href="#"> <a class="navbar-brand" href="#">
<img alt="Universal Desktop Services" src="/assets/udsicon.png" class="navbar-img pull-left"> <img alt="Universal Desktop Services" src="/img/udsicon.png" class="navbar-img pull-left">
Universal Desktop Services Universal Desktop Services
</a> </a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation"> <button class="navbar-toggler" type="button" (click)="isNavbarCollapsed = !isNavbarCollapsed" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
</button> </button>
<div class="collapse navbar-collapse" id="navbarsExampleDefault"> <div [ngbCollapse]="isNavbarCollapsed" class="navbar-collapse" id="navbarsExampleDefault">
<ul class="navbar-nav ml-auto"> <ul class="navbar-nav ml-auto">
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="#">UDS Plugin</a> <a class="nav-link" href="#"><i class="fa fa-download"></i> UDS Plugin</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="#">About</a> <a class="nav-link" href="#"><uds-translate>About</uds-translate></a>
</li> </li>
<li class="nav-item dropdown" ngbDropdown> <li class="nav-item dropdown" ngbDropdown>
<a class="nav-link dropdown-toggle" id="dropdown01" ngbDropdownToggle>{{ lang }}</a> <a class="nav-link dropdown-toggle" id="dropdown01" ngbDropdownToggle>{{ lang }}</a>

View File

@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { UdsApiService, Lang } from '../uds-api.service';
@Component({ @Component({
selector: 'uds-navbar', selector: 'uds-navbar',
@ -7,7 +8,21 @@ import { Component, OnInit } from '@angular/core';
}) })
export class NavbarComponent implements OnInit { export class NavbarComponent implements OnInit {
constructor() { } lang: string; // Current language
langs: Lang[]; // Available languages
isNavbarCollapsed = true;
constructor(api: UdsApiService) {
const lang = api.getCurrentLanguage();
this.langs = [];
for (const l of api.getAvailableLanguages()) {
if (l.id === lang) {
this.lang = l.name;
} else {
this.langs.push(l);
}
}
}
ngOnInit() { ngOnInit() {
} }

View File

@ -0,0 +1,25 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
export interface Lang {
id: string;
name: string;
}
@Injectable()
export class UdsApiService {
constructor(private http: HttpClient) { }
getCurrentLanguage(): string {
return udsConfig.language;
}
getAvailableLanguages(): Lang[] {
const res: Lang[] = [];
for (const entry of udsConfig.available_languages) {
res.push(entry);
}
return res;
}
}

View File

@ -22,6 +22,7 @@
var newcatalog = { var newcatalog = {
"(filtered from _MAX_ total records)": "(registros filtrados de un total de _MAX_)", "(filtered from _MAX_ total records)": "(registros filtrados de un total de _MAX_)",
"(no days)": "(sin d\u00edas)", "(no days)": "(sin d\u00edas)",
"About": "Acerca",
"Accept": "Aceptar", "Accept": "Aceptar",
"Access calendar removal error": "Error en el borrado del calendario de acceso", "Access calendar removal error": "Error en el borrado del calendario de acceso",
"Active": "Activo", "Active": "Activo",

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@ -19,20 +19,20 @@
*/ */
/** IE9, IE10 and IE11 requires all of the following polyfills. **/ /** IE9, IE10 and IE11 requires all of the following polyfills. **/
// import 'core-js/es6/symbol'; import 'core-js/es6/symbol';
// import 'core-js/es6/object'; import 'core-js/es6/object';
// import 'core-js/es6/function'; import 'core-js/es6/function';
// import 'core-js/es6/parse-int'; import 'core-js/es6/parse-int';
// import 'core-js/es6/parse-float'; import 'core-js/es6/parse-float';
// import 'core-js/es6/number'; import 'core-js/es6/number';
// import 'core-js/es6/math'; import 'core-js/es6/math';
// import 'core-js/es6/string'; import 'core-js/es6/string';
// import 'core-js/es6/date'; import 'core-js/es6/date';
// import 'core-js/es6/array'; import 'core-js/es6/array';
// import 'core-js/es6/regexp'; import 'core-js/es6/regexp';
// import 'core-js/es6/map'; import 'core-js/es6/map';
// import 'core-js/es6/weak-map'; import 'core-js/es6/weak-map';
// import 'core-js/es6/set'; import 'core-js/es6/set';
/** IE10 and IE11 requires the following for NgClass support on SVG elements */ /** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`. // import 'classlist.js'; // Run `npm install --save classlist.js`.

View File

@ -1,2 +1,3 @@
/* You can add global styles to this file, and also import other style files */ /* You can add global styles to this file, and also import other style files */
@import "~bootstrap/dist/css/bootstrap.css" @import "~bootstrap/dist/css/bootstrap.css";
@import "~font-awesome/css/font-awesome.css";