-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
298 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<div class="content no-grow"> | ||
<h2>Mist API Documentation</h2> | ||
<div class="box-links"> | ||
<button class="links" (click)="openTab('postman')"> | ||
Postman | ||
<img class="icon-open" src="assets/open.svg" alt="open"> | ||
</button> | ||
<button class="links" (click)="openTab('openapi')"> | ||
OpenAPI | ||
<img class="icon-open" src="assets/open.svg" alt="open"> | ||
</button> | ||
<button class="links" (click)="openTab('mist')"> | ||
MistAPI | ||
<img class="icon-open" src="assets/open.svg" alt="open"> | ||
</button> | ||
</div> | ||
</div> | ||
|
||
<div class="content no-grow"> | ||
<h2>Extension information</h2> | ||
<div class="box-version"> | ||
<div class="version-info"> | ||
<div class="version-text">Current Version:</div> | ||
<div class="version-value">{{current_version}}</div> | ||
</div> | ||
<div class="version-info"> | ||
<div class="version-text">Lastest Version:</div> | ||
<div class="version-unknown" *ngIf="!last_version"> | ||
<div>Unknown</div> | ||
<img src="assets/question.svg" alt="unknow version"> | ||
</div> | ||
<div class="version-uptodate" *ngIf="last_version && current_version == last_version"> | ||
<div>You have the lastest Version</div> | ||
</div> | ||
<div class="version-newversion" *ngIf="last_version && current_version != last_version"> | ||
<div>New version available ({{last_version}})</div> | ||
<button class="download" (click)="openTab('download_url')"> | ||
<div>Downlaod</div> | ||
<img src="assets/download.svg" alt="download"> | ||
</button> | ||
</div> | ||
</div> | ||
<button class="check-version" (click)="checkNewRelease()">Check For New Version</button> | ||
</div> | ||
<div class="box-links"> | ||
<button class="links" (click)="openTab('github')"> | ||
Extension Page | ||
<img class="icon-open" src="assets/open.svg" alt="open"> | ||
</button> | ||
</div> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
// CONTENAIRS | ||
.content { | ||
margin: 0.5em 1em; | ||
display: flex; | ||
align-items: stretch; | ||
flex-direction: column; | ||
} | ||
|
||
.content.no-grow { | ||
flex-grow: 0; | ||
} | ||
|
||
.content.grow { | ||
flex-grow: 1; | ||
} | ||
|
||
// TITLES | ||
h2 { | ||
font-weight: 200; | ||
margin-left: 0.8em; | ||
} | ||
|
||
// BUTTONS | ||
button { | ||
border: none; | ||
padding: .5em; | ||
width: 80%; | ||
margin: 0.5em; | ||
height: 2.5em; | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
button:disabled { | ||
background-color: #eee; | ||
color: #aaa; | ||
box-shadow: rgb(0 0 0 / 5%) 0px 0px 0px 1px; | ||
} | ||
|
||
// links | ||
.box-links { | ||
align-items: center; | ||
flex-direction: column; | ||
display: flex; | ||
justify-content: flex-start; | ||
margin: 0 2em; | ||
} | ||
|
||
button.links:enabled { | ||
background-color: #84b035; | ||
color: white; | ||
box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px; | ||
transition: background-color 0.2s ease-in-out; | ||
} | ||
|
||
button.links:enabled:hover { | ||
background-color: #649015; | ||
} | ||
|
||
// VERSION | ||
.box-version { | ||
margin: 1em 1em; | ||
display: flex; | ||
align-items: stretch; | ||
flex-direction: column; | ||
border: 1px solid #eee; | ||
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px; | ||
border-radius: 2px; | ||
} | ||
|
||
.version-info { | ||
display: flex; | ||
flex-direction: row; | ||
margin: 0.5em 1em; | ||
} | ||
|
||
.version-text { | ||
font-weight: 200; | ||
margin-right: 1em; | ||
} | ||
|
||
.version-unknown, | ||
.version-uptodate { | ||
display: flex; | ||
flex-direction: row; | ||
} | ||
|
||
.version-newversion { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.version-unknown img { | ||
height: 1.4em; | ||
margin-left: 1em; | ||
filter: invert(42%) sepia(93%) saturate(1352%) hue-rotate(7deg) brightness(90%) contrast(119%); | ||
} | ||
|
||
.version-uptodata img { | ||
height: 1.4em; | ||
margin-left: 1em; | ||
filter: invert(42%) sepia(93%) saturate(1352%) hue-rotate(45deg) brightness(90%) contrast(119%); | ||
} | ||
|
||
.version-newversion img { | ||
height: 1.4em; | ||
margin-left: 1em; | ||
filter: invert(42%) sepia(93%) saturate(1352%) hue-rotate(330deg) brightness(90%) contrast(119%); | ||
} | ||
|
||
.download { | ||
margin: 0.5em 0; | ||
transition: background-color 0.2s ease-in-out; | ||
background-color: #ddd; | ||
} | ||
|
||
.download:hover { | ||
background-color: #bbb; | ||
} | ||
|
||
.check-version { | ||
width: 100%; | ||
margin: 0; | ||
transition: background-color 0.2s ease-in-out; | ||
background-color: #ddd; | ||
} | ||
|
||
.check-version:hover { | ||
background-color: #bbb; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { HttpClient } from '@angular/common/http'; | ||
|
||
export interface linkElement { | ||
url: string, | ||
name: string | ||
} | ||
|
||
@Component({ | ||
selector: 'app-about', | ||
templateUrl: 'about.component.html', | ||
styleUrls: ['about.component.scss'] | ||
}) | ||
export class AboutComponent implements OnInit { | ||
|
||
private github_release_url: string = "https://api.github.com/repos/tmunzer/mist_chrome_extension/releases/latest"; | ||
github_repo_url: string = "https://github.com/tmunzer/mist_chrome_extension"; | ||
current_version: string; | ||
last_version: string; | ||
up_to_date: boolean; | ||
download_url: string; | ||
html_url: string; | ||
constructor(private _http: HttpClient) { } | ||
|
||
ngOnInit(){ | ||
this.current_version = chrome.runtime.getManifest().version; | ||
} | ||
|
||
|
||
checkNewRelease(): void { | ||
this._http.get<any>(this.github_release_url).subscribe(data => { | ||
this.last_version = data.name; | ||
if (this.current_version < this.last_version) { | ||
this.up_to_date = false; | ||
this.html_url = data.html_url; | ||
data.assets.forEach(element => { | ||
if (element.name == "extension-build.zip") { | ||
this.download_url = element.browser_download_url; | ||
} | ||
}) | ||
} else { | ||
this.up_to_date = true; | ||
} | ||
}) | ||
} | ||
|
||
openTab(target: string) { | ||
let dest_url = "" | ||
switch (target) { | ||
case "openapi": | ||
dest_url = "https://doc.mist-lab.fr"; | ||
break; | ||
case "postman": | ||
dest_url = "https://documenter.getpostman.com/view/224925/SzYgQufe"; | ||
break; | ||
case "mist": | ||
dest_url = "https://api.mist.com/api/v1/docs"; | ||
break; | ||
case "html_url": | ||
dest_url = this.html_url; | ||
break; | ||
case "download_url": | ||
dest_url = this.download_url; | ||
break; | ||
case "github": | ||
dest_url = this.github_repo_url; | ||
break; | ||
} | ||
if (dest_url) { | ||
chrome.tabs.create({ url: dest_url }); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.