├── .gitattributes ├── .gitignore ├── .vscode ├── launch.json ├── settings.json └── tasks.json ├── LICENSE.txt ├── NuGet.config ├── Phosphor.build.ps1 ├── README.md ├── appveyor.yml ├── prototype ├── .gitignore ├── src │ ├── Phosphor-App │ │ ├── .gitignore │ │ ├── app │ │ │ ├── app.component.js │ │ │ ├── app.component.js.map │ │ │ ├── app.component.ts │ │ │ ├── collection.component.js │ │ │ ├── collection.component.js.map │ │ │ ├── collection.component.ts │ │ │ ├── css │ │ │ │ ├── app.component.css │ │ │ │ ├── collection.component.css │ │ │ │ ├── dashboard.component.css │ │ │ │ ├── detail.component.css │ │ │ │ ├── hover.css │ │ │ │ └── noun.component.css │ │ │ ├── dashboard.component.js │ │ │ ├── dashboard.component.js.map │ │ │ ├── dashboard.component.ts │ │ │ ├── detail.component.js │ │ │ ├── detail.component.js.map │ │ │ ├── detail.component.ts │ │ │ ├── fonts │ │ │ │ ├── MWFMDL2.1.63.ttf │ │ │ │ └── MWFMDL2.1.63.woff │ │ │ ├── html │ │ │ │ ├── collection.component.html │ │ │ │ ├── dashboard.component.html │ │ │ │ ├── detail.component.html │ │ │ │ └── noun.component.html │ │ │ ├── img │ │ │ │ └── psicon.png │ │ │ ├── main.js │ │ │ ├── main.js.map │ │ │ ├── main.ts │ │ │ ├── noun.component.js │ │ │ ├── noun.component.js.map │ │ │ ├── noun.component.ts │ │ │ ├── services │ │ │ │ ├── collection.service.js │ │ │ │ ├── collection.service.js.map │ │ │ │ ├── collection.service.ts │ │ │ │ ├── noun.service.js │ │ │ │ ├── noun.service.js.map │ │ │ │ ├── noun.service.ts │ │ │ │ ├── verb.service.js │ │ │ │ ├── verb.service.js.map │ │ │ │ └── verb.service.ts │ │ │ └── util │ │ │ │ ├── mock-modules.js │ │ │ │ ├── mock-modules.js.map │ │ │ │ ├── mock-modules.ts │ │ │ │ ├── mock-nouns.js │ │ │ │ ├── mock-nouns.js.map │ │ │ │ ├── mock-nouns.ts │ │ │ │ ├── noun.js │ │ │ │ ├── noun.js.map │ │ │ │ └── noun.ts │ │ ├── index.ejs │ │ ├── modernizr.min.js │ │ ├── mwf-main.min.js │ │ ├── package.json │ │ ├── styles.css │ │ ├── systemjs.config.js │ │ ├── tsconfig.json │ │ ├── typings.json │ │ └── typings │ │ │ ├── globals │ │ │ ├── core-js │ │ │ │ ├── index.d.ts │ │ │ │ └── typings.json │ │ │ ├── jasmine │ │ │ │ ├── index.d.ts │ │ │ │ └── typings.json │ │ │ └── node │ │ │ │ ├── index.d.ts │ │ │ │ └── typings.json │ │ │ └── index.d.ts │ ├── Phosphor-Core │ │ └── push.txt │ ├── Phosphor-Server │ │ ├── package.json │ │ ├── push.txt │ │ ├── server.js │ │ ├── test.ps1 │ │ └── test.txt │ ├── README.md │ └── node1.js └── test │ ├── .gitignore │ ├── app │ ├── app.component.js │ ├── app.component.js.map │ ├── app.component.ts │ ├── collection.component.js │ ├── collection.component.js.map │ ├── collection.component.ts │ ├── css │ │ ├── app.component.css │ │ ├── collection.component.css │ │ ├── dashboard.component.css │ │ ├── detail.component.css │ │ ├── hover.css │ │ └── noun.component.css │ ├── dashboard.component.js │ ├── dashboard.component.js.map │ ├── dashboard.component.ts │ ├── detail.component.js │ ├── detail.component.js.map │ ├── detail.component.ts │ ├── fonts │ │ ├── MWFMDL2.1.63.ttf │ │ └── MWFMDL2.1.63.woff │ ├── html │ │ ├── collection.component.html │ │ ├── dashboard.component.html │ │ ├── detail.component.html │ │ └── noun.component.html │ ├── img │ │ └── psicon.png │ ├── main.js │ ├── main.js.map │ ├── main.ts │ ├── noun.component.js │ ├── noun.component.js.map │ ├── noun.component.ts │ ├── services │ │ ├── collection.service.js │ │ ├── collection.service.js.map │ │ ├── collection.service.ts │ │ ├── noun.service.js │ │ ├── noun.service.js.map │ │ ├── noun.service.ts │ │ ├── verb.service.js │ │ ├── verb.service.js.map │ │ └── verb.service.ts │ └── util │ │ ├── mock-modules.js │ │ ├── mock-modules.js.map │ │ ├── mock-modules.ts │ │ ├── mock-nouns.js │ │ ├── mock-nouns.js.map │ │ ├── mock-nouns.ts │ │ ├── noun.js │ │ ├── noun.js.map │ │ └── noun.ts │ ├── index.html │ ├── liteserver-test-config.json │ ├── modernizr.min.js │ ├── mwf-main.min.js │ ├── package.json │ ├── server │ └── test.js │ ├── src │ ├── 1st.spec.js │ ├── 1st.spec.js.map │ ├── 1st.spec.ts │ └── tsconfig.json │ ├── styles.css │ ├── systemjs.config.js │ ├── test.js │ ├── tsconfig.json │ ├── typings.json │ ├── typings │ ├── globals │ │ ├── core-js │ │ │ ├── index.d.ts │ │ │ └── typings.json │ │ ├── jasmine │ │ │ ├── index.d.ts │ │ │ └── typings.json │ │ └── node │ │ │ ├── index.d.ts │ │ │ └── typings.json │ └── index.d.ts │ └── unit-tests.html └── src ├── Phosphor.Client ├── .gitignore ├── app │ ├── app.component.ts │ ├── collection.component.ts │ ├── css │ │ ├── app.component.css │ │ ├── collection.component.css │ │ ├── dashboard.component.css │ │ ├── detail.component.css │ │ ├── hover.css │ │ └── noun.component.css │ ├── dashboard.component.ts │ ├── detail.component.ts │ ├── fonts │ │ ├── MWFMDL2.1.63.ttf │ │ └── MWFMDL2.1.63.woff │ ├── html │ │ ├── collection.component.html │ │ ├── dashboard.component.html │ │ ├── detail.component.html │ │ └── noun.component.html │ ├── img │ │ └── psicon.png │ ├── main.ts │ ├── noun.component.ts │ ├── services │ │ ├── collection.service.ts │ │ ├── noun.service.ts │ │ ├── session.service.ts │ │ └── verb.service.ts │ └── util │ │ ├── mock-modules.ts │ │ ├── mock-nouns.ts │ │ └── noun.ts ├── electron-shell.js ├── index.html ├── modernizr.min.js ├── mwf-main.min.js ├── package.json ├── styles.css ├── systemjs.config.js ├── tsconfig.json ├── typings.json └── typings │ ├── globals │ ├── core-js │ │ ├── index.d.ts │ │ └── typings.json │ ├── jasmine │ │ ├── index.d.ts │ │ └── typings.json │ └── node │ │ ├── index.d.ts │ │ └── typings.json │ └── index.d.ts └── Phosphor ├── Cmdlets ├── ShowModuleCmdlet.cs └── StartPhosphorSessionCmdlet.cs ├── Controllers ├── ModulesController.cs └── SessionsController.cs ├── Model ├── ModelBase.cs └── ModuleViewModel.cs ├── Phosphor.csproj ├── Phosphor.psd1 ├── Phosphor.psm1 ├── Server ├── PhosphorServer.cs └── PhosphorServerStartup.cs └── Session ├── PhosphorSession.cs └── SessionManager.cs /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | bin/ 4 | obj/ 5 | .dotnet/ -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": ".NET Full Attach", 6 | "type": "clr", 7 | "request": "attach", 8 | "processId": "${command:pickProcess}" 9 | }, 10 | { 11 | "name": ".NET Core Attach", 12 | "type": "coreclr", 13 | "request": "attach", 14 | "processId": "${command:pickProcess}" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "files.exclude": { 4 | "**/.git": true, 5 | "src/Phosphor/bin": true, 6 | "src/Phosphor/obj": true, 7 | "**/.DS_Store": true 8 | } 9 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | 4 | "windows": { 5 | "command": "powershell.exe", 6 | "args": [ "-NoProfile", "-ExecutionPolicy", "Bypass" ] 7 | }, 8 | "linux": { 9 | "command": "/usr/bin/powershell", 10 | "args": [ "-NoProfile" ] 11 | }, 12 | "osx": { 13 | "command": "/usr/local/bin/powershell", 14 | "args": [ "-NoProfile" ] 15 | }, 16 | 17 | "isShellCommand": true, 18 | "showOutput": "always", 19 | 20 | "tasks": [ 21 | { 22 | "taskName": "Install", 23 | "suppressTaskName": true, 24 | "args": [ "Invoke-Build Restore" ] 25 | }, 26 | { 27 | "taskName": "Clean", 28 | "suppressTaskName": true, 29 | "args": [ "Invoke-Build Clean" ] 30 | }, 31 | { 32 | "taskName": "Build Module", 33 | "suppressTaskName": true, 34 | "isBuildCommand": true, 35 | "args": [ "Invoke-Build BuildModule" ] 36 | }, 37 | { 38 | "taskName": "Build Client", 39 | "suppressTaskName": true, 40 | "isBuildCommand": true, 41 | "args": [ "Invoke-Build BuildClient" ] 42 | }, 43 | { 44 | "taskName": "Run Module", 45 | "suppressTaskName": true, 46 | "isBuildCommand": true, 47 | "args": [ "Invoke-Build RunModule" ] 48 | } 49 | ] 50 | } 51 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Phosphor 2 | 3 | Copyright (c) Microsoft Corporation 4 | 5 | All rights reserved. 6 | 7 | MIT License 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 14 | 15 | -------------------------------------------------------------------------------- /NuGet.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: '0.1.0-alpha-{build}' 2 | image: Visual Studio 2017 3 | clone_depth: 10 4 | skip_tags: true 5 | 6 | branches: 7 | only: 8 | - master 9 | 10 | environment: 11 | DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Don't download unneeded packages 12 | DOTNET_CLI_TELEMETRY_OPTOUT: true # Don't send telemetry 13 | 14 | install: 15 | - ps: Install-Product node '6.10.2' 16 | - ps: | 17 | Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force | Out-Null 18 | Install-Module InvokeBuild -RequiredVersion 3.2.1 -Scope CurrentUser -Force | Out-Null 19 | 20 | build_script: 21 | - ps: Invoke-Build 22 | 23 | # The build script takes care of the tests 24 | test: off 25 | -------------------------------------------------------------------------------- /prototype/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/app.component.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 3 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 4 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 5 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 6 | return c > 3 && r && Object.defineProperty(target, key, r), r; 7 | }; 8 | var __metadata = (this && this.__metadata) || function (k, v) { 9 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 10 | }; 11 | var core_1 = require('@angular/core'); 12 | var dashboard_component_1 = require('./dashboard.component'); 13 | var router_deprecated_1 = require('@angular/router-deprecated'); 14 | var AppComponent = (function () { 15 | function AppComponent() { 16 | this.title = 'Phosphor'; 17 | } 18 | AppComponent = __decorate([ 19 | core_1.Component({ 20 | selector: 'my-app', 21 | template: "\n \n ", 22 | styleUrls: ['app/css/app.component.css'], 23 | directives: [router_deprecated_1.ROUTER_DIRECTIVES], 24 | providers: [ 25 | router_deprecated_1.ROUTER_PROVIDERS, 26 | ] 27 | }), 28 | router_deprecated_1.RouteConfig([ 29 | { 30 | path: '/', 31 | name: 'Dashboard', 32 | component: dashboard_component_1.DashboardComponent, 33 | useAsDefault: true 34 | } 35 | ]), 36 | __metadata('design:paramtypes', []) 37 | ], AppComponent); 38 | return AppComponent; 39 | }()); 40 | exports.AppComponent = AppComponent; 41 | //# sourceMappingURL=app.component.js.map -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/app.component.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"app.component.js","sourceRoot":"","sources":["app.component.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,qBAAgC,eAAe,CAAC,CAAA;AAEhD,oCAAmC,uBAAuB,CAAC,CAAA;AAK3D,kCAAiE,4BAA4B,CAAC,CAAA;AAuB9F;IAAA;QACE,UAAK,GAAG,UAAU,CAAC;IACrB,CAAC;IAvBD;QAAC,gBAAS,CAAC;YACT,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,2CAET;YACD,SAAS,EAAE,CAAC,2BAA2B,CAAC;YACxC,UAAU,EAAE,CAAC,qCAAiB,CAAC;YAC/B,SAAS,EAAE;gBACT,oCAAgB;aACjB;SACF,CAAC;QAED,+BAAW,CAAC;YACX;gBACE,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,WAAW;gBACjB,SAAS,EAAE,wCAAkB;gBAC7B,YAAY,EAAE,IAAI;aACnB;SACF,CAAC;;oBAAA;IAIF,mBAAC;AAAD,CAAC,AAFD,IAEC;AAFY,oBAAY,eAExB,CAAA"} -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | import { DashboardComponent } from './dashboard.component'; 4 | 5 | import { NounComponent } from './noun.component'; 6 | import { CollectionComponent } from './collection.component'; 7 | 8 | import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS } from '@angular/router-deprecated'; 9 | 10 | @Component({ 11 | selector: 'my-app', 12 | template: ` 13 | 14 | `, 15 | styleUrls: ['app/css/app.component.css'], 16 | directives: [ROUTER_DIRECTIVES], 17 | providers: [ 18 | ROUTER_PROVIDERS, 19 | ] 20 | }) 21 | 22 | @RouteConfig([ 23 | { 24 | path: '/', 25 | name: 'Dashboard', 26 | component: DashboardComponent, 27 | useAsDefault: true 28 | } 29 | ]) 30 | 31 | export class AppComponent { 32 | title = 'Phosphor'; 33 | } 34 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/collection.component.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"collection.component.js","sourceRoot":"","sources":["collection.component.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,qBAAkC,eAAe,CAAC,CAAA;AAClD,kCAAoC,4BAA4B,CAAC,CAAA;AAEjE,qBAA+B,eAAe,CAAC,CAAA;AAE/C,QAAO,SAAS,CAAC,CAAA;AAGjB,6BAA4B,yBAAyB,CAAC,CAAA;AAEtD,mCAAkC,+BAA+B,CAAC,CAAA;AAOlE;IAIE,mBAAmB;IACnB,6BACU,MAAc,EACd,WAAwB,EACxB,WAAwB,EACxB,IAAU,EACV,iBAAoC;QAJpC,WAAM,GAAN,MAAM,CAAQ;QACd,gBAAW,GAAX,WAAW,CAAa;QACxB,gBAAW,GAAX,WAAW,CAAa;QACxB,SAAI,GAAJ,IAAI,CAAM;QACV,sBAAiB,GAAjB,iBAAiB,CAAmB;IAAI,CAAC;IAWnD,gBAAgB;IAChB,sCAAQ,GAAR;QAAA,iBAUC;QATC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC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,IAAI,CAAC,eAAe,GAAG,MAAM,GAAG,GAAG,CAAC;QACpC,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,eAAe,GAAG,SAAS,CAAC;IAClF,CAAC;IAED,SAAS;IACT,yCAAW,GAAX;QACE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;IAClC,CAAC;IApIH;QAAC,gBAAS,CAAC;YACT,QAAQ,EAAE,kBAAkB;YAC5B,WAAW,EAAE,oCAAoC;YACjD,SAAS,EAAE,CAAC,kCAAkC,CAAC;SAChD,CAAC;;2BAAA;IAkIF,0BAAC;AAAD,CAAC,AAjID,IAiIC;AAjIY,2BAAmB,sBAiI/B,CAAA"} -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/css/app.component.css: -------------------------------------------------------------------------------- 1 | html { 2 | min-height: 626px; 3 | min-width: 1020px; 4 | } 5 | 6 | h1 { 7 | font-size: 2.8em; 8 | color: #999; 9 | margin-bottom: 0; 10 | } 11 | h2 { 12 | font-size: 2em; 13 | margin-top: 0; 14 | padding-top: 0; 15 | } 16 | nav a { 17 | padding: 5px 10px; 18 | text-decoration: none; 19 | margin-top: 10px; 20 | display: inline-block; 21 | background-color: #eee; 22 | border-radius: 4px; 23 | } 24 | nav a:visited, a:link { 25 | color: #607D8B; 26 | } 27 | nav a:hover { 28 | color: #039be5; 29 | background-color: #CFD8DC; 30 | } 31 | nav a.router-link-active { 32 | color: #039be5; 33 | } 34 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/css/collection.component.css: -------------------------------------------------------------------------------- 1 | .select { 2 | color: grey; 3 | margin: 0; 4 | padding-top: 20px; 5 | } 6 | 7 | .collection-blade { 8 | height: 100%; 9 | padding: 0; 10 | /* 11 | background-color: #4D6684; 12 | border: 2px solid #4D6684; 13 | */ 14 | text-align: center; 15 | } 16 | 17 | .item { 18 | margin: 4px; 19 | background-color: white; 20 | cursor: pointer 21 | } 22 | 23 | .item:hover { 24 | -webkit-transition: background-color 100ms ease-out 0.05s; 25 | -moz-transition: background-color 100ms ease-out 0.05s; 26 | -o-transition: background-color 100ms ease-out 0.05s; 27 | transition: background-color 100ms ease-out 0.05s; 28 | 29 | background-color: #CAE0F5; 30 | 31 | } 32 | 33 | .title { 34 | color: white; 35 | background-color: #E81123; 36 | margin-top: 0; 37 | padding-top: 8px; 38 | padding-bottom: 8px; 39 | } 40 | 41 | .scrollView { 42 | overflow: auto; 43 | height: 70%; 44 | width: 100%; 45 | margin-top: 4%; 46 | } 47 | 48 | @media (min-height: 820px) { 49 | .scrollView { 50 | overflow: auto; 51 | height: 80%; 52 | width: 100%; 53 | margin-top: 4%; 54 | } 55 | 56 | } 57 | 58 | 59 | .action { 60 | /* border: solid; */ 61 | margin-top: 2%; 62 | cursor: pointer; 63 | } 64 | 65 | #collection-search { 66 | text-align: center; 67 | width: 100%; 68 | margin-top: 4%; 69 | } 70 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/css/dashboard.component.css: -------------------------------------------------------------------------------- 1 | [class*='col-'] { 2 | float: left; 3 | } 4 | *, *:after, *:before { 5 | -webkit-box-sizing: border-box; 6 | -moz-box-sizing: border-box; 7 | box-sizing: border-box; 8 | } 9 | h3 { 10 | text-align: center; margin-bottom: 0; 11 | } 12 | [class*='col-'] { 13 | padding-right: 20px; 14 | padding-bottom: 20px; 15 | } 16 | [class*='col-']:last-of-type { 17 | padding-right: 0; 18 | } 19 | .grid { 20 | margin: 0; 21 | } 22 | .col-1-4 { 23 | width: 25%; 24 | } 25 | .module { 26 | padding: 20px; 27 | text-align: center; 28 | color: #eee; 29 | max-height: 120px; 30 | min-width: 120px; 31 | background-color: #607D8B; 32 | border-radius: 2px; 33 | } 34 | h4 { 35 | position: relative; 36 | } 37 | .module:hover { 38 | background-color: #EEE; 39 | cursor: pointer; 40 | color: #607d8b; 41 | } 42 | .grid-pad { 43 | padding: 10px 0; 44 | } 45 | .grid-pad > [class*='col-']:last-of-type { 46 | padding-right: 20px; 47 | } 48 | @media (max-width: 600px) { 49 | .module { 50 | font-size: 10px; 51 | max-height: 75px; } 52 | } 53 | @media (max-width: 1024px) { 54 | .grid { 55 | margin: 0; 56 | } 57 | .module { 58 | min-width: 60px; 59 | } 60 | } 61 | 62 | #dash { 63 | text-align: center; 64 | padding: 0; 65 | height: 96%; 66 | } 67 | 68 | .dashboard { 69 | text-align: center; 70 | margin: 0; 71 | /* background-color: #4D6684; */ 72 | } 73 | 74 | #ps-console { 75 | cursor: pointer; 76 | height: 3.5%; 77 | background-color: #315D88; 78 | text-align: left; 79 | color: white; 80 | overflow: auto; 81 | font-size: 1.25em; 82 | } 83 | 84 | .ps-icon { 85 | height: 38px; 86 | width: 38px; 87 | margin-bottom: 3px; 88 | } 89 | 90 | .expanded { 91 | height: 10%; 92 | background-color: #0078D7; 93 | color: white; 94 | } 95 | 96 | .verb { 97 | border: solid thin #4685CC; 98 | margin: 0.5%; 99 | padding: 3px; 100 | padding-left: 8px; 101 | padding-right: 8px; 102 | cursor: pointer; 103 | display: inline; 104 | } 105 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/css/detail.component.css: -------------------------------------------------------------------------------- 1 | .detail-blade { 2 | padding: 0; 3 | text-align: center; 4 | background-color: #F0F1EE; 5 | } 6 | 7 | .verb { 8 | /* border: solid; */ 9 | margin-top: 2%; 10 | cursor: pointer; 11 | } 12 | 13 | .title { 14 | color: white; 15 | background-color: #107C10; 16 | margin-top: 0; 17 | padding-top: 8px; 18 | padding-bottom: 8px; 19 | } 20 | 21 | #details { 22 | padding-left: 5%; 23 | } 24 | 25 | .detailButton { 26 | border: solid thin #4685CC; 27 | margin: 0.5%; 28 | padding: 3px; 29 | padding-left: 8px; 30 | padding-right: 8px; 31 | cursor: pointer; 32 | display: inline; 33 | } 34 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/css/noun.component.css: -------------------------------------------------------------------------------- 1 | .noun-blade { 2 | height: 100%; 3 | padding: 0; 4 | background-color: #EFEFEF; 5 | 6 | /* background-color: #9AADBD; */ 7 | 8 | 9 | text-align: center; 10 | } 11 | 12 | .noun { 13 | margin: 4px; 14 | width: 80%; 15 | 16 | 17 | background-color: #464646; 18 | color: white; 19 | 20 | 21 | /* 22 | background-color: white; 23 | color: #4685CC; 24 | */ 25 | 26 | 27 | overflow-x: hidden; 28 | font-size: 0.9em; 29 | } 30 | 31 | .title { 32 | color: white; 33 | background-color: #0078D7; 34 | margin-top: 0; 35 | padding-top: 8px; 36 | padding-bottom: 8px; 37 | } 38 | 39 | .search { 40 | margin-left: 30px; 41 | margin-right: 30px; 42 | } 43 | 44 | .scrollView { 45 | overflow-y: auto; 46 | overflow-x: hidden; 47 | height: 70%; 48 | width: 100%; 49 | margin-top: 5%; 50 | font-size: 1.25em; 51 | text-align: left; 52 | color: #464646; 53 | padding-left: 4%; 54 | } 55 | 56 | 57 | @media (min-height: 820px) { 58 | 59 | .scrollView { 60 | overflow-y: auto; 61 | overflow-x: hidden; 62 | height: 80%; 63 | width: 100%; 64 | margin-top: 5%; 65 | font-size: 1.25em; 66 | text-align: left; 67 | color: #464646; 68 | padding-left: 4%; 69 | } 70 | 71 | 72 | } 73 | 74 | #module-dropdown { 75 | background-image: none; 76 | background-color: #0078D7; 77 | color: white; 78 | margin: 0; 79 | width: 100%; 80 | } 81 | 82 | .listnoun { 83 | cursor: pointer; 84 | padding-top: 4px; 85 | padding-bottom: 4px; 86 | background-color: white; 87 | } 88 | 89 | .listnoun:hover { 90 | -webkit-transition: background-color 100ms ease-out 0.05s; 91 | -moz-transition: background-color 100ms ease-out 0.05s; 92 | -o-transition: background-color 100ms ease-out 0.05s; 93 | transition: background-color 100ms ease-out 0.05s; 94 | 95 | background-color: #CAE0F5; 96 | 97 | } 98 | 99 | #noun-search { 100 | border-radius: 5px; 101 | width: 80%; 102 | margin-left: 10%; 103 | } 104 | 105 | #search-div { 106 | padding-top: 10%; 107 | padding-bottom: 0; 108 | } 109 | 110 | .module { 111 | margin-top: 5%; 112 | margin-bottom: 5%; 113 | } 114 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/fonts/MWFMDL2.1.63.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/Phosphor/88c736ddb2ad4ce49f78b3119473f813f1f2665d/prototype/src/Phosphor-App/app/fonts/MWFMDL2.1.63.ttf -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/fonts/MWFMDL2.1.63.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/Phosphor/88c736ddb2ad4ce49f78b3119473f813f1f2665d/prototype/src/Phosphor-App/app/fonts/MWFMDL2.1.63.woff -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/html/collection.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | 6 | 7 |
8 | 9 | 10 |
11 | 12 | 13 | 14 |

{{currNoun}}

15 | 16 |
17 | 18 | 19 |
20 | 21 | 30 | 31 | 32 |
33 | 34 | 35 | 36 | 37 | 38 |
39 | 40 | 41 |
42 | 43 | 44 | 45 | 46 | 49 | 50 | 51 | 52 | 53 | 56 | 57 | 58 |
47 | {{header}} 48 |
54 | {{col}} 55 |
59 | 60 |
61 | 62 | 63 | 64 |
65 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/html/dashboard.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | 6 |
7 | 8 | 9 |
10 | 11 |
12 | 13 | 14 |
15 | 16 |
17 | 18 | 19 |

Details

20 | 21 |
22 | 23 |
24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
32 | 33 | 34 | {{verb}} 35 | 36 |
37 |
38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 |
47 | 48 | 53 | 54 | 55 |
56 | 57 |
58 | 59 | Select a module to begin previewing PowerShell commands. Click here to minimize. 60 | 61 |
62 | 63 | 64 | 65 |
66 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/html/detail.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 6 |
7 |
8 | 9 |
10 | 11 |
12 |
13 |

{{input}}

14 | 15 | 16 |
17 | 18 |
19 | 20 |
21 | 22 | {{switch}} 23 | 24 | 25 |
26 |
27 | 28 | 29 |
30 |
31 | 32 | 41 | 42 |
43 | 44 | 46 | 47 |
48 | 49 | 50 | 51 |
52 | < 53 | Run 54 | Exit Output 55 | PS Preview 56 | Copy to Clipboard 57 | > 58 |
59 | 60 | 61 |
62 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/html/noun.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 16 | 17 |
18 |

Modules

19 |
20 | 21 |
22 | 23 | 24 |
25 | 26 | 27 | 28 |
29 | 30 |
31 | 32 | {{module.name}} 33 | 34 | 35 | 42 | 43 | 44 |
45 | 52 |
53 | 54 | 55 |
56 | 57 | 58 | 59 | 60 | 61 |
62 | 63 | 64 |
65 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/img/psicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/Phosphor/88c736ddb2ad4ce49f78b3119473f813f1f2665d/prototype/src/Phosphor-App/app/img/psicon.png -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/main.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var platform_browser_dynamic_1 = require('@angular/platform-browser-dynamic'); 3 | var router_deprecated_1 = require('@angular/router-deprecated'); 4 | var http_1 = require('@angular/http'); 5 | var app_component_1 = require('./app.component'); 6 | var noun_service_1 = require('./services/noun.service'); 7 | var verb_service_1 = require('./services/verb.service'); 8 | var collection_service_1 = require('./services/collection.service'); 9 | require('rxjs/Rx'); 10 | platform_browser_dynamic_1.bootstrap(app_component_1.AppComponent, [ 11 | router_deprecated_1.ROUTER_PROVIDERS, noun_service_1.NounService, verb_service_1.VerbService, collection_service_1.CollectionService, http_1.HTTP_PROVIDERS 12 | ]); 13 | //# sourceMappingURL=main.js.map -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/main.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"main.js","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":";AAAA,yCAAiC,mCAAmC,CAAC,CAAA;AACrE,kCAAiC,4BAA4B,CAAC,CAAA;AAC9D,qBAA+B,eAAe,CAAC,CAAA;AAE/C,8BAAiC,iBAAiB,CAAC,CAAA;AAEnD,6BAA6B,yBAAyB,CAAC,CAAA;AACvD,6BAA6B,yBAAyB,CAAC,CAAA;AACvD,mCAAiC,+BAA+B,CAAC,CAAA;AAEjE,QAAO,SAAS,CAAC,CAAA;AAEjB,oCAAS,CAAC,4BAAY,EAAE;IACtB,oCAAgB,EAAE,0BAAW,EAAE,0BAAW,EAAE,sCAAiB,EAAE,qBAAc;CAC9E,CAAC,CAAC"} -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrap } from '@angular/platform-browser-dynamic'; 2 | import { ROUTER_PROVIDERS } from '@angular/router-deprecated'; 3 | import { HTTP_PROVIDERS } from '@angular/http'; 4 | 5 | import { AppComponent } from './app.component'; 6 | 7 | import { NounService } from './services/noun.service'; 8 | import { VerbService } from './services/verb.service'; 9 | import { CollectionService} from './services/collection.service'; 10 | 11 | import 'rxjs/Rx'; 12 | 13 | bootstrap(AppComponent, [ 14 | ROUTER_PROVIDERS, NounService, VerbService, CollectionService, HTTP_PROVIDERS 15 | ]); 16 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/noun.component.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 3 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 4 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 5 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 6 | return c > 3 && r && Object.defineProperty(target, key, r), r; 7 | }; 8 | var __metadata = (this && this.__metadata) || function (k, v) { 9 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 10 | }; 11 | var core_1 = require('@angular/core'); 12 | var router_deprecated_1 = require('@angular/router-deprecated'); 13 | var noun_service_1 = require('./services/noun.service'); 14 | var verb_service_1 = require('./services/verb.service'); 15 | var NounComponent = (function () { 16 | function NounComponent(router, nounService, verbService) { 17 | this.router = router; 18 | this.nounService = nounService; 19 | this.verbService = verbService; 20 | } 21 | NounComponent.prototype.getNouns = function () { 22 | var _this = this; 23 | this.nounService.getNouns().then(function (nouns) { return _this.nouns = nouns; }); 24 | }; 25 | NounComponent.prototype.getModules = function () { 26 | var _this = this; 27 | this.nounService.getModules().then(function (modules) { 28 | _this.modules = modules; 29 | _this.selectedModule = _this.modules[0]; 30 | }); 31 | }; 32 | NounComponent.prototype.getNounsByModule = function () { 33 | }; 34 | NounComponent.prototype.ngOnInit = function () { 35 | this.getNouns(); 36 | this.getModules(); 37 | }; 38 | NounComponent.prototype.search = function () { 39 | var _this = this; 40 | //This is a bit hacky as we need casting. 41 | var criteria = document.getElementById("noun-search").value; 42 | this.nounService.search(criteria).then(function (modules) { return _this.modules = modules; }); 43 | }; 44 | NounComponent.prototype.setSelected = function (selectedNoun) { 45 | this.nounService.setSelected(selectedNoun); 46 | this.verbService.updateConsole("Get-" + selectedNoun.name); 47 | }; 48 | NounComponent.prototype.selectModule = function (selectedModule) { 49 | this.nouns = selectedModule.nouns; 50 | this.selectedModule = selectedModule; 51 | //DOM manipulation 52 | document.getElementById("module-dropdown").innerHTML = selectedModule.name + ' '; 53 | }; 54 | NounComponent.prototype.toggleModule = function (moduleName) { 55 | console.log(moduleName); 56 | var moduleNouns = document.getElementById(moduleName + "-nouns"); 57 | var moduleClick = document.getElementById(moduleName + "-click"); 58 | if (moduleClick.className.includes("glyphicon-triangle-right")) { 59 | moduleClick.className = "glyphicon glyphicon-triangle-bottom"; 60 | } 61 | else { 62 | moduleClick.className = "glyphicon glyphicon-triangle-right"; 63 | } 64 | if (moduleNouns.style.display === "none") { 65 | moduleNouns.style.display = "block"; 66 | } 67 | else { 68 | moduleNouns.style.display = "none"; 69 | } 70 | }; 71 | NounComponent = __decorate([ 72 | core_1.Component({ 73 | selector: 'noun-blade', 74 | templateUrl: 'app/html/noun.component.html', 75 | styleUrls: ['app/css/noun.component.css'] 76 | }), 77 | __metadata('design:paramtypes', [router_deprecated_1.Router, noun_service_1.NounService, verb_service_1.VerbService]) 78 | ], NounComponent); 79 | return NounComponent; 80 | }()); 81 | exports.NounComponent = NounComponent; 82 | //# sourceMappingURL=noun.component.js.map -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/noun.component.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"noun.component.js","sourceRoot":"","sources":["noun.component.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,qBAAyC,eAAe,CAAC,CAAA;AACzD,kCAAuB,4BAA4B,CAAC,CAAA;AAGpD,6BAA4B,yBAAyB,CAAC,CAAA;AACtD,6BAA4B,yBAAyB,CAAC,CAAA;AAQtD;IAEE,uBACU,MAAc,EACd,WAAwB,EACxB,WAAwB;QAFxB,WAAM,GAAN,MAAM,CAAQ;QACd,gBAAW,GAAX,WAAW,CAAa;QACxB,gBAAW,GAAX,WAAW,CAAa;IAAI,CAAC;IAOvC,gCAAQ,GAAR;QAAA,iBAEC;QADG,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,UAAA,KAAK,IAAI,OAAA,KAAI,CAAC,KAAK,GAAG,KAAK,EAAlB,CAAkB,CAAC,CAAC;IAClE,CAAC;IAED,kCAAU,GAAV;QAAA,iBAKC;QAJG,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,UAAA,OAAO;YACtC,KAAI,CAAC,O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Q,CAAC,CAAC;QAEjE,EAAE,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC;YAC/D,WAAW,CAAC,SAAS,GAAG,qCAAqC,CAAC;QAChE,CAAC;QACD,IAAI,CAAC,CAAC;YACJ,WAAW,CAAC,SAAS,GAAG,oCAAoC,CAAC;QAC/D,CAAC;QAED,EAAE,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC;YACzC,WAAW,CAAC,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;QACtC,CAAC;QACD,IAAI,CAAC,CAAC;YACJ,WAAW,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;QACrC,CAAC;IAGH,CAAC;IA7EH;QAAC,gBAAS,CAAC;YACT,QAAQ,EAAE,YAAY;YACtB,WAAW,EAAE,8BAA8B;YAC3C,SAAS,EAAE,CAAC,4BAA4B,CAAC;SAC1C,CAAC;;qBAAA;IA2EF,oBAAC;AAAD,CAAC,AA1ED,IA0EC;AA1EY,qBAAa,gBA0EzB,CAAA"} -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/noun.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input } from '@angular/core'; 2 | import { Router } from '@angular/router-deprecated'; 3 | 4 | import { Noun } from './util/noun'; 5 | import { NounService } from './services/noun.service'; 6 | import { VerbService } from './services/verb.service'; 7 | import { DetailComponent } from './detail.component'; 8 | 9 | @Component({ 10 | selector: 'noun-blade', 11 | templateUrl: 'app/html/noun.component.html', 12 | styleUrls: ['app/css/noun.component.css'] 13 | }) 14 | export class NounComponent implements OnInit { 15 | 16 | constructor( 17 | private router: Router, 18 | private nounService: NounService, 19 | private verbService: VerbService) { } 20 | 21 | nouns: Noun[]; 22 | modules: any; 23 | selectedModule: any; 24 | selectedNoun: string; 25 | 26 | getNouns() { 27 | this.nounService.getNouns().then(nouns => this.nouns = nouns); 28 | } 29 | 30 | getModules() { 31 | this.nounService.getModules().then(modules => { 32 | this.modules = modules; 33 | this.selectedModule = this.modules[0]; 34 | }); 35 | } 36 | 37 | getNounsByModule() { 38 | 39 | } 40 | 41 | ngOnInit() { 42 | this.getNouns(); 43 | this.getModules(); 44 | } 45 | 46 | search() { 47 | //This is a bit hacky as we need casting. 48 | var criteria = (document.getElementById("noun-search")).value; 49 | this.nounService.search(criteria).then(modules => this.modules = modules); 50 | 51 | } 52 | 53 | setSelected(selectedNoun) { 54 | this.nounService.setSelected(selectedNoun); 55 | this.verbService.updateConsole("Get-" + selectedNoun.name); 56 | } 57 | 58 | selectModule(selectedModule) { 59 | this.nouns = selectedModule.nouns; 60 | this.selectedModule = selectedModule; 61 | 62 | //DOM manipulation 63 | document.getElementById("module-dropdown").innerHTML = selectedModule.name + ' '; 64 | } 65 | 66 | toggleModule(moduleName) { 67 | console.log(moduleName); 68 | var moduleNouns = document.getElementById(moduleName + "-nouns"); 69 | var moduleClick = document.getElementById(moduleName + "-click"); 70 | 71 | if (moduleClick.className.includes("glyphicon-triangle-right")) { 72 | moduleClick.className = "glyphicon glyphicon-triangle-bottom"; 73 | } 74 | else { 75 | moduleClick.className = "glyphicon glyphicon-triangle-right"; 76 | } 77 | 78 | if (moduleNouns.style.display === "none") { 79 | moduleNouns.style.display = "block"; 80 | } 81 | else { 82 | moduleNouns.style.display = "none"; 83 | } 84 | 85 | 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/services/collection.service.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 3 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 4 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 5 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 6 | return c > 3 && r && Object.defineProperty(target, key, r), r; 7 | }; 8 | var __metadata = (this && this.__metadata) || function (k, v) { 9 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 10 | }; 11 | var core_1 = require('@angular/core'); 12 | var mock_nouns_1 = require('../util/mock-nouns'); 13 | var CollectionService = (function () { 14 | function CollectionService() { 15 | //Currently placed here as mock data 16 | this.actions = ['New', 'Tools', 'Batch']; 17 | this.itemSelected$ = new core_1.EventEmitter(); 18 | this.itemClicked$ = new core_1.EventEmitter(); 19 | //Grabbing to initialize first 20 | this.items = mock_nouns_1.MOCKNOUNS[0].items; 21 | } 22 | CollectionService.prototype.getCollectionActions = function () { 23 | return Promise.resolve(this.actions); 24 | }; 25 | //Observer pattern 26 | CollectionService.prototype.setSelected = function (item) { 27 | this.itemSelected$.emit(item); 28 | }; 29 | //Called from noun service to set the items 30 | CollectionService.prototype.setCollection = function (items, rows) { 31 | this.items = items; 32 | this.rows = rows; 33 | //console.log(items); 34 | console.log(rows); 35 | }; 36 | //This is called every keystroke to search using JavaScript's String indexOf method. 37 | CollectionService.prototype.search = function (criteria) { 38 | var result = []; 39 | for (var i = 0; i < this.rows.length; i++) { 40 | var found = false; 41 | if (this.rows[i] != null) { 42 | for (var j = 0; j < this.rows[i].length; j++) { 43 | if (this.rows[i][j].toLowerCase().indexOf(criteria.toLowerCase()) != -1) { 44 | var found = true; 45 | } 46 | } 47 | } 48 | if (found) { 49 | result.push(this.rows[i]); 50 | } 51 | } 52 | /* 53 | for (var i = 0; i < this.items.length; i++) { 54 | if (this.items[i].toLowerCase().indexOf(criteria.toLowerCase()) != -1) { 55 | result.push(this.items[i]); 56 | //console.log(this.items[i]); 57 | } 58 | } 59 | */ 60 | return Promise.resolve(result); 61 | }; 62 | CollectionService.prototype.setItemClick = function (idx) { 63 | console.log("Set Item Clicked"); 64 | this.itemClicked$.emit(idx); 65 | }; 66 | CollectionService = __decorate([ 67 | core_1.Injectable(), 68 | __metadata('design:paramtypes', []) 69 | ], CollectionService); 70 | return CollectionService; 71 | }()); 72 | exports.CollectionService = CollectionService; 73 | //# sourceMappingURL=collection.service.js.map -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/services/collection.service.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"collection.service.js","sourceRoot":"","sources":["collection.service.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,qBAAiD,eAAe,CAAC,CAAA;AAEjE,2BAA0B,oBAAoB,CAAC,CAAA;AAG/C;IAYE;QALA,oCAAoC;QACpC,YAAO,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAKlC,IAAI,CAAC,aAAa,GAAG,IAAI,mBAAY,EAAU,CAAC;QAChD,IAAI,CAAC,YAAY,GAAG,IAAI,mBAAY,EAAO,CAAC;QAC5C,8BAA8B;QAC9B,IAAI,CAAC,KAAK,GAAG,sBAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAClC,CAAC;IAED,gDAAoB,GAApB;QACE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAED,kBAAkB;IAClB,uCAAW,GAAX,UAAY,IAAI;QACd,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,2CAA2C;IAC3C,yCAAa,GAAb,UAAc,KAAK,EAAE,IAAI;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,qBAAqB;QACrB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IAED,oFAAoF;IACpF,kCAAM,GAAN,UAAO,QAAQ;QACb,IAAI,MAAM,GAAG,EAAE,CAAC;QAEhB,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAE1C,IAAI,KAAK,GAAG,KAAK,CAAC;YAElB,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;gBACvB,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC3C,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;wBACxE,IAAI,KAAK,GAAG,IAAI,CAAC;oBACnB,CAAC;gBACL,CAAC;YACL,CAAC;YAED,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;gBACV,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5B,CAAC;QAEH,CAAC;QAED;;;;;;;UAOE;QACF,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAED,wCAAY,GAAZ,UAAa,GAAG;QACd,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAChC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IAzEH;QAAC,iBAAU,EAAE;;yBAAA;IAmFb,wBAAC;AAAD,CAAC,AAlFD,IAkFC;AAlFY,yBAAiB,oBAkF7B,CAAA"} -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/services/collection.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable, EventEmitter, OnInit } from '@angular/core'; 2 | 3 | import { MOCKNOUNS } from '../util/mock-nouns'; 4 | 5 | @Injectable() 6 | export class CollectionService { 7 | 8 | //Observer pattern below 9 | selectedItem: string; 10 | public itemSelected$: EventEmitter; 11 | public itemClicked$: EventEmitter; 12 | 13 | //Currently placed here as mock data 14 | actions = ['New', 'Tools', 'Batch']; 15 | items: string[]; 16 | rows: string[]; 17 | 18 | constructor() { 19 | this.itemSelected$ = new EventEmitter(); 20 | this.itemClicked$ = new EventEmitter(); 21 | //Grabbing to initialize first 22 | this.items = MOCKNOUNS[0].items; 23 | } 24 | 25 | getCollectionActions() { 26 | return Promise.resolve(this.actions); 27 | } 28 | 29 | //Observer pattern 30 | setSelected(item) { 31 | this.itemSelected$.emit(item); 32 | } 33 | 34 | //Called from noun service to set the items 35 | setCollection(items, rows) { 36 | this.items = items; 37 | this.rows = rows; 38 | //console.log(items); 39 | console.log(rows); 40 | } 41 | 42 | //This is called every keystroke to search using JavaScript's String indexOf method. 43 | search(criteria) { 44 | var result = []; 45 | 46 | for (var i = 0; i < this.rows.length; i++) { 47 | 48 | var found = false; 49 | 50 | if (this.rows[i] != null) { 51 | for (var j = 0; j < this.rows[i].length; j++) { 52 | if (this.rows[i][j].toLowerCase().indexOf(criteria.toLowerCase()) != -1) { 53 | var found = true; 54 | } 55 | } 56 | } 57 | 58 | if (found) { 59 | result.push(this.rows[i]); 60 | } 61 | 62 | } 63 | 64 | /* 65 | for (var i = 0; i < this.items.length; i++) { 66 | if (this.items[i].toLowerCase().indexOf(criteria.toLowerCase()) != -1) { 67 | result.push(this.items[i]); 68 | //console.log(this.items[i]); 69 | } 70 | } 71 | */ 72 | return Promise.resolve(result); 73 | } 74 | 75 | setItemClick(idx) { 76 | console.log("Set Item Clicked"); 77 | this.itemClicked$.emit(idx); 78 | } 79 | 80 | //General Algorithm for mapping verbs to images and similar verbs together 81 | 82 | //verbs[any verb] 83 | //if we have a dictionary of similar word relations that would be nice to build from 84 | //From that dictionary, we can then map images to the verbs. 85 | 86 | 87 | 88 | } 89 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/services/noun.service.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"noun.service.js","sourceRoot":"","sources":["noun.service.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,qBAAiD,eAAe,CAAC,CAAA;AACjE,qBAA+B,eAAe,CAAC,CAAA;AAE/C,QAAO,SAAS,CAAC,CAAA;AAMjB,mCAAkC,sBAAsB,CAAC,CAAA;AAGzD;IAQE,qBACU,iBAAoC,EACpC,IAAU;QADV,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,SAAI,GAAJ,IAAI,CAAM;QAGlB,IAAI,CAAC,aAAa,GAAG,IAAI,mBAAY,EAAQ,CAAC;IAChD,CAAC;IAED,8BAAQ,GAAR;IAEA,CAAC;IAED,8BAAQ,GAAR;QACE,IAAI,WAAW,GAAG,EAAE,GAAG,QAAQ,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC;QAEzE,IAAI,QAAQ,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEtC,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAElB,iCAAiC;QACjC,IAAI,SAAS,GAAG;YACd,IAAI,EAAE,KAAK;YACX,KAAK,EAAE,EAAE;SACV,CAAC;QAEF,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAEzC,IAAI,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAEtC,IAAI,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YACvB,IAAI,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YAEzB,IAAI,OAAO,GAAG;gBACZ,IAAI,EAAE,IAAI;gBACV,EAAE,EAAE,CAAC;gBACL,KAAK,EA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CAAC,CACzD,CAAC;QAEF,UAAU,CAAC,CAAC,cAAY,OAAO,CAAC,GAAG,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QAE5F,gCAAgC;IAClC,CAAC;IAED,8CAA8C;IAC9C,iCAAW,GAAX,UAAY,IAAU;QAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9B,mDAAmD;IACvD,CAAC;IA7IH;QAAC,iBAAU,EAAE;;mBAAA;IAgJb,kBAAC;AAAD,CAAC,AA/ID,IA+IC;AA/IY,mBAAW,cA+IvB,CAAA"} -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/services/noun.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable, EventEmitter, OnInit } from '@angular/core'; 2 | import { Http, Response } from '@angular/http'; 3 | import {Headers, RequestOptions} from '@angular/http'; 4 | import 'rxjs/Rx'; 5 | 6 | import { MOCKNOUNS } from '../util/mock-nouns'; 7 | import { MOCKMODULES } from '../util/mock-modules'; 8 | import { Noun } from '../util/noun'; 9 | 10 | import { CollectionService } from './collection.service'; 11 | 12 | @Injectable() 13 | export class NounService { 14 | 15 | selected: Noun; 16 | nouns: any; 17 | modules: any; 18 | 19 | public nounSelected$: EventEmitter; 20 | 21 | constructor( 22 | private collectionService: CollectionService, 23 | private http: Http 24 | ) 25 | { 26 | this.nounSelected$ = new EventEmitter(); 27 | } 28 | 29 | ngOnInit() { 30 | 31 | } 32 | 33 | getNouns() { 34 | var servernouns = "" + document.getElementById("server-nouns").innerHTML; 35 | 36 | var splitted = servernouns.split(","); 37 | 38 | this.nouns = []; 39 | this.modules = []; 40 | 41 | //Module that contains all nouns: 42 | var allModule = { 43 | name: "All", 44 | nouns: [] 45 | }; 46 | 47 | for (var i = 0; i < splitted.length; i++) { 48 | 49 | var separate = splitted[i].split("-"); 50 | 51 | var noun = separate[0]; 52 | var module = separate[1]; 53 | 54 | var newNoun = { 55 | name: noun, 56 | id: i, 57 | items: [], 58 | module: module 59 | }; 60 | 61 | this.nouns.push(newNoun); 62 | 63 | if (!this.modules[module]) { 64 | 65 | var newModule = { 66 | name: module, 67 | nouns: [] 68 | }; 69 | 70 | newModule.nouns.push(newNoun); 71 | 72 | this.modules[module] = newModule; 73 | } 74 | else { 75 | this.modules[module].nouns.push(newNoun); 76 | } 77 | 78 | allModule.nouns.push(newNoun); 79 | } 80 | 81 | this.modules.push(allModule); 82 | 83 | return Promise.resolve(this.nouns); 84 | //return Promise.resolve(MOCKNOUNS); 85 | } 86 | 87 | getModules() { 88 | 89 | var allModules = []; 90 | 91 | for (var k in this.modules) { 92 | allModules.push(this.modules[k]); 93 | } 94 | 95 | return Promise.resolve(allModules); 96 | } 97 | 98 | //This is called every keystroke to search using JavaScript's String indexOf method. 99 | search(criteria) { 100 | var result = []; 101 | 102 | for (var i in this.modules) { 103 | var nouns = this.modules[i].nouns; 104 | 105 | console.log(this.modules[i].name); 106 | 107 | for (var j = 0; j < nouns.length; j++) { 108 | if (this.modules[i].name.toLowerCase().indexOf(criteria.toLowerCase()) != -1 || nouns[j].name.toLowerCase().indexOf(criteria.toLowerCase()) != -1) { 109 | result.push(this.modules[i]); 110 | break; 111 | } 112 | } 113 | 114 | } 115 | 116 | return Promise.resolve(result); 117 | } 118 | 119 | //Gets the items for the selected noun. 120 | getNounItems(name) { 121 | 122 | //TODO Make an HTTP request to grab data from the server on the noun 123 | 124 | /* 125 | var test = this.http.get("/shell").map(function(res) { 126 | console.log(res); 127 | }).catch(function(err, caught) { 128 | console.log(err); 129 | return caught; 130 | }); 131 | 132 | console.log("test: " + test.json()); 133 | */ 134 | 135 | var nounItems; 136 | 137 | this.http.get('/nounitems?' + "noun=" + name) 138 | .subscribe( 139 | res => { console.log(res.json()); nounItems = res.json(); }, 140 | error => { console.log(error); nounItems = null; } 141 | ); 142 | 143 | setTimeout((function() {console.log("HELLO WORLD!" + nounItems); return nounItems;}), 2000); 144 | 145 | //return MOCKNOUNS[2 - 1].items; 146 | } 147 | 148 | //Observer pattern to emit noun to subscribers 149 | setSelected(noun: Noun) { 150 | this.selected = noun; 151 | this.nounSelected$.emit(noun); 152 | //this.collectionService.setCollection(noun.items); 153 | } 154 | 155 | 156 | } 157 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/services/verb.service.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 3 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 4 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 5 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 6 | return c > 3 && r && Object.defineProperty(target, key, r), r; 7 | }; 8 | var __metadata = (this && this.__metadata) || function (k, v) { 9 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 10 | }; 11 | var core_1 = require('@angular/core'); 12 | var VerbService = (function () { 13 | function VerbService() { 14 | //Mock Data 15 | this.verbs = ['set', 'stop', 'add', 'extend', 'modify', 'reduce', '...']; 16 | this.details = ['Name: ', 'DisplayName: ', 'Status: ', 'DependentServices: ', 17 | 'ServicesDependedOn: ', 'CanPauseAndContinue: ']; 18 | this.verbDetailsSelection$ = new core_1.EventEmitter(); 19 | this.previewCommand$ = new core_1.EventEmitter(); 20 | } 21 | //Data wrapped in a Promise 22 | VerbService.prototype.getVerbs = function () { 23 | return Promise.resolve(this.verbs); 24 | }; 25 | VerbService.prototype.getDetails = function (verb) { 26 | return Promise.resolve(this.details); 27 | }; 28 | VerbService.prototype.setVerbDetails = function (verb) { 29 | this.verbDetails = verb; 30 | this.verbDetailsSelection$.emit(verb); 31 | }; 32 | VerbService.prototype.setPreview = function (command) { 33 | this.previewCommand$.emit(command); 34 | }; 35 | VerbService.prototype.updateConsole = function (command) { 36 | var old = document.getElementById("ps-command").innerHTML; 37 | document.getElementById("ps-command").innerHTML = old + '
' + "" + command + ""; 38 | //A way to quickly scroll to the bottom 39 | document.getElementById("ps-console").scrollTop = document.getElementById("ps-console").scrollHeight; 40 | }; 41 | VerbService = __decorate([ 42 | core_1.Injectable(), 43 | __metadata('design:paramtypes', []) 44 | ], VerbService); 45 | return VerbService; 46 | }()); 47 | exports.VerbService = VerbService; 48 | //# sourceMappingURL=verb.service.js.map -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/services/verb.service.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"verb.service.js","sourceRoot":"","sources":["verb.service.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,qBAAyC,eAAe,CAAC,CAAA;AAGzD;IAwBE;QAtBA,WAAW;QACX,UAAK,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;QACpE,YAAO,GAAG,CAAC,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAE,qBAAqB;YAC5D,sBAAsB,EAAE,uBAAuB,CAAC,CAAC;QAiBrD,0BAAqB,GAAsB,IAAI,mBAAY,EAAO,CAAC;QAKxE,IAAI,CAAC,eAAe,GAAG,IAAI,mBAAY,EAAU,CAAC;IACpD,CAAC;IAfD,2BAA2B;IAC3B,8BAAQ,GAAR;QACE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,gCAAU,GAAV,UAAW,IAAI;QACb,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAUD,oCAAc,GAAd,UAAe,IAAI;QACf,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;IAED,gCAAU,GAAV,UAAW,OAAO;QAChB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,mCAAa,GAAb,UAAc,OAAO;QACnB,IAAI,GAAG,GAAG,QAAQ,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC;QAE1D,QAAQ,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG,+GAA+G,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;QAEzM,uCAAuC;QACvC,QAAQ,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,YAAY,CAAC;IACvG,CAAC;IA/CH;QAAC,iBAAU,EAAE;;mBAAA;IA0Db,kBAAC;AAAD,CAAC,AAzDD,IAyDC;AAzDY,mBAAW,cAyDvB,CAAA"} -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/services/verb.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable, EventEmitter } from '@angular/core'; 2 | 3 | @Injectable() 4 | export class VerbService { 5 | 6 | //Mock Data 7 | verbs = ['set', 'stop', 'add', 'extend', 'modify', 'reduce', '...']; 8 | details = ['Name: ', 'DisplayName: ', 'Status: ', 'DependentServices: ', 9 | 'ServicesDependedOn: ', 'CanPauseAndContinue: ']; 10 | 11 | verbDetails: any; 12 | 13 | public currentCommand: string; 14 | 15 | public previewCommand$: EventEmitter; 16 | 17 | //Data wrapped in a Promise 18 | getVerbs() { 19 | return Promise.resolve(this.verbs); 20 | } 21 | 22 | getDetails(verb) { 23 | return Promise.resolve(this.details); 24 | } 25 | 26 | public verbDetailsSelection$: EventEmitter = new EventEmitter(); 27 | 28 | constructor( 29 | ) 30 | { 31 | this.previewCommand$ = new EventEmitter(); 32 | } 33 | 34 | setVerbDetails(verb) { 35 | this.verbDetails = verb; 36 | this.verbDetailsSelection$.emit(verb); 37 | } 38 | 39 | setPreview(command) { 40 | this.previewCommand$.emit(command); 41 | } 42 | 43 | updateConsole(command) { 44 | var old = document.getElementById("ps-command").innerHTML; 45 | 46 | document.getElementById("ps-command").innerHTML = old + '
' + "" + command + ""; 47 | 48 | //A way to quickly scroll to the bottom 49 | document.getElementById("ps-console").scrollTop = document.getElementById("ps-console").scrollHeight; 50 | } 51 | 52 | 53 | //General Algorithm for mapping verbs to images and similar verbs together 54 | 55 | //verbs[any verb] 56 | //if we have a dictionary of similar word relations that would be nice to build from 57 | //From that dictionary, we can then map images to the verbs. 58 | 59 | 60 | 61 | } 62 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/util/mock-modules.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var mock_nouns_1 = require('./mock-nouns'); 3 | exports.MOCKMODULES = []; 4 | exports.all = { 5 | name: "All", 6 | nouns: mock_nouns_1.MOCKNOUNS, 7 | id: 0 8 | }; 9 | exports.moduleA = { 10 | name: "Module A", 11 | nouns: [], 12 | id: 1 13 | }; 14 | exports.moduleB = { 15 | name: "Module B", 16 | nouns: [], 17 | id: 2 18 | }; 19 | exports.moduleC = { 20 | name: "Module C", 21 | nouns: [], 22 | id: 3 23 | }; 24 | for (var i = 0; i < mock_nouns_1.MOCKNOUNS.length / 3; i++) { 25 | exports.moduleA.nouns.push(mock_nouns_1.MOCKNOUNS[i]); 26 | } 27 | for (var i = Math.ceil(mock_nouns_1.MOCKNOUNS.length / 3); i < 2 * mock_nouns_1.MOCKNOUNS.length / 3; i++) { 28 | exports.moduleB.nouns.push(mock_nouns_1.MOCKNOUNS[i]); 29 | } 30 | for (var i = Math.ceil(2 * mock_nouns_1.MOCKNOUNS.length / 3); i < mock_nouns_1.MOCKNOUNS.length; i++) { 31 | exports.moduleC.nouns.push(mock_nouns_1.MOCKNOUNS[i]); 32 | } 33 | exports.MOCKMODULES.push(exports.all); 34 | exports.MOCKMODULES.push(exports.moduleA); 35 | exports.MOCKMODULES.push(exports.moduleB); 36 | exports.MOCKMODULES.push(exports.moduleC); 37 | //# sourceMappingURL=mock-modules.js.map -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/util/mock-modules.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"mock-modules.js","sourceRoot":"","sources":["mock-modules.ts"],"names":[],"mappings":";AACA,2BAA0B,cAAc,CAAC,CAAA;AAE9B,mBAAW,GAAG,EAAE,CAAC;AAEjB,WAAG,GAAG;IACb,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,sBAAS;IAChB,EAAE,EAAE,CAAC;CACR,CAAA;AAEU,eAAO,GAAG;IACnB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,EAAE;IACT,EAAE,EAAE,CAAC;CACN,CAAC;AAES,eAAO,GAAG;IACnB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,EAAE;IACT,EAAE,EAAE,CAAC;CACN,CAAC;AAES,eAAO,GAAG;IACnB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,EAAE;IACT,EAAE,EAAE,CAAC;CACN,CAAC;AAEF,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,sBAAS,CAAC,MAAM,GAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1C,eAAO,CAAC,KAAK,CAAC,IAAI,CAAC,sBAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC;AAED,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,sBAAS,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,sBAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC9E,eAAO,CAAC,KAAK,CAAC,IAAI,CAAC,sBAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC;AAED,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,sBAAS,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,sBAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1E,eAAO,CAAC,KAAK,CAAC,IAAI,CAAC,sBAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC;AAED,mBAAW,CAAC,IAAI,CAAC,WAAG,CAAC,CAAC;AACtB,mBAAW,CAAC,IAAI,CAAC,eAAO,CAAC,CAAC;AAC1B,mBAAW,CAAC,IAAI,CAAC,eAAO,CAAC,CAAC;AAC1B,mBAAW,CAAC,IAAI,CAAC,eAAO,CAAC,CAAC"} -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/util/mock-modules.ts: -------------------------------------------------------------------------------- 1 | import { Noun } from './noun'; 2 | import { MOCKNOUNS } from './mock-nouns'; 3 | 4 | export var MOCKMODULES = []; 5 | 6 | export var all = { 7 | name: "All", 8 | nouns: MOCKNOUNS, 9 | id: 0 10 | } 11 | 12 | export var moduleA = { 13 | name: "Module A", 14 | nouns: [], 15 | id: 1 16 | }; 17 | 18 | export var moduleB = { 19 | name: "Module B", 20 | nouns: [], 21 | id: 2 22 | }; 23 | 24 | export var moduleC = { 25 | name: "Module C", 26 | nouns: [], 27 | id: 3 28 | }; 29 | 30 | for (var i = 0; i < MOCKNOUNS.length/3; i++) { 31 | moduleA.nouns.push(MOCKNOUNS[i]); 32 | } 33 | 34 | for (var i = Math.ceil(MOCKNOUNS.length / 3); i < 2 * MOCKNOUNS.length / 3; i++) { 35 | moduleB.nouns.push(MOCKNOUNS[i]); 36 | } 37 | 38 | for (var i = Math.ceil(2 * MOCKNOUNS.length / 3); i < MOCKNOUNS.length; i++) { 39 | moduleC.nouns.push(MOCKNOUNS[i]); 40 | } 41 | 42 | MOCKMODULES.push(all); 43 | MOCKMODULES.push(moduleA); 44 | MOCKMODULES.push(moduleB); 45 | MOCKMODULES.push(moduleC); 46 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/util/noun.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var Noun = (function () { 3 | function Noun() { 4 | } 5 | return Noun; 6 | }()); 7 | exports.Noun = Noun; 8 | //# sourceMappingURL=noun.js.map -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/util/noun.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"noun.js","sourceRoot":"","sources":["noun.ts"],"names":[],"mappings":";AAAA;IAAA;IAIA,CAAC;IAAD,WAAC;AAAD,CAAC,AAJD,IAIC;AAJY,YAAI,OAIhB,CAAA"} -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/app/util/noun.ts: -------------------------------------------------------------------------------- 1 | export class Noun { 2 | id: number; 3 | name: string; 4 | items: string[]; 5 | } 6 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/index.ejs: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Phosphor 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 39 | 40 | 41 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | Loading... 56 | 59 | 60 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular2-quickstart", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ", 6 | "lite": "lite-server", 7 | "postinstall": "typings install", 8 | "tsc": "tsc", 9 | "tsc:w": "tsc -w", 10 | "typings": "typings" 11 | }, 12 | "license": "ISC", 13 | "dependencies": { 14 | "@angular/common": "2.0.0-rc.1", 15 | "@angular/compiler": "2.0.0-rc.1", 16 | "@angular/core": "2.0.0-rc.1", 17 | "@angular/http": "2.0.0-rc.1", 18 | "@angular/platform-browser": "2.0.0-rc.1", 19 | "@angular/platform-browser-dynamic": "2.0.0-rc.1", 20 | "@angular/router": "2.0.0-rc.1", 21 | "@angular/router-deprecated": "2.0.0-rc.1", 22 | "@angular/upgrade": "2.0.0-rc.1", 23 | 24 | "systemjs": "0.19.27", 25 | "core-js": "^2.4.0", 26 | "reflect-metadata": "^0.1.3", 27 | "rxjs": "5.0.0-beta.6", 28 | "zone.js": "^0.6.12", 29 | 30 | "angular2-in-memory-web-api": "0.0.11", 31 | "bootstrap": "^3.3.6" 32 | }, 33 | "devDependencies": { 34 | "concurrently": "^2.0.0", 35 | "lite-server": "^2.2.0", 36 | "typescript": "^1.8.10", 37 | "typings":"^1.0.4" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/styles.css: -------------------------------------------------------------------------------- 1 | h2 { 2 | color: #444; 3 | font-family: "SegoeUI", Arial, Helvetica, sans-serif; 4 | font-weight: lighter; 5 | } 6 | body { 7 | margin: 0; 8 | } 9 | body, input[text], button { 10 | color: #888; 11 | font-family: "SegoeUI", Cambria, Georgia; 12 | } 13 | button { 14 | font-family: "SegoeUI", Arial; 15 | background-color: #eee; 16 | border: none; 17 | padding: 5px 10px; 18 | border-radius: 4px; 19 | cursor: pointer; 20 | cursor: hand; 21 | } 22 | button:hover { 23 | background-color: #cfd8dc; 24 | } 25 | button:disabled { 26 | background-color: #eee; 27 | color: #aaa; 28 | cursor: auto; 29 | } 30 | /* everywhere else */ 31 | * { 32 | font-family: "SegoeUI", Arial, Helvetica, sans-serif; 33 | } 34 | 35 | /* Hacky fix for search */ 36 | .btn { 37 | margin-top: 0; 38 | } 39 | 40 | input.c-text-field[type=text], input.form-control { 41 | margin-top: 0; 42 | } 43 | 44 | input[type=checkbox] 45 | { 46 | -webkit-appearance:checkbox; 47 | } 48 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/systemjs.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * System configuration for Angular 2 samples 3 | * Adjust as necessary for your application needs. 4 | */ 5 | (function(global) { 6 | 7 | // map tells the System loader where to look for things 8 | var map = { 9 | 'app': 'app', // 'dist', 10 | 11 | '@angular': 'node_modules/@angular', 12 | 'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api', 13 | 'rxjs': 'node_modules/rxjs' 14 | }; 15 | 16 | // packages tells the System loader how to load when no filename and/or no extension 17 | var packages = { 18 | 'app': { main: 'main.js', defaultExtension: 'js' }, 19 | 'rxjs': { defaultExtension: 'js' }, 20 | 'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' }, 21 | }; 22 | 23 | var ngPackageNames = [ 24 | 'common', 25 | 'compiler', 26 | 'core', 27 | 'http', 28 | 'platform-browser', 29 | 'platform-browser-dynamic', 30 | 'router', 31 | 'router-deprecated', 32 | 'upgrade', 33 | ]; 34 | 35 | // Individual files (~300 requests): 36 | function packIndex(pkgName) { 37 | packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' }; 38 | } 39 | 40 | // Bundled (~40 requests): 41 | function packUmd(pkgName) { 42 | packages['@angular/'+pkgName] = { main: pkgName + '.umd.js', defaultExtension: 'js' }; 43 | }; 44 | 45 | // Most environments should use UMD; some (Karma) need the individual index files 46 | var setPackageConfig = System.packageWithIndex ? packIndex : packUmd; 47 | 48 | // Add package entries for angular packages 49 | ngPackageNames.forEach(setPackageConfig); 50 | 51 | var config = { 52 | map: map, 53 | packages: packages 54 | } 55 | 56 | System.config(config); 57 | 58 | })(this); 59 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160317120654", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160505161446", 5 | "node": "registry:dt/node#4.0.0+20160509154515" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/typings/globals/core-js/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/core-js/core-js.d.ts", 5 | "raw": "registry:dt/core-js#0.0.0+20160317120654", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/core-js/core-js.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/typings/globals/jasmine/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/36a1be34dbe202c665b3ddafd50824f78c09eea3/jasmine/jasmine.d.ts", 5 | "raw": "registry:dt/jasmine#2.2.0+20160505161446", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/36a1be34dbe202c665b3ddafd50824f78c09eea3/jasmine/jasmine.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/typings/globals/node/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/6d0e826824da52204c1c93f92cecbc961ac84fa9/node/node.d.ts", 5 | "raw": "registry:dt/node#4.0.0+20160509154515", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/6d0e826824da52204c1c93f92cecbc961ac84fa9/node/node.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-App/typings/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-Core/push.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/Phosphor/88c736ddb2ad4ce49f78b3119473f813f1f2665d/prototype/src/Phosphor-Core/push.txt -------------------------------------------------------------------------------- /prototype/src/Phosphor-Server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "testing", 3 | "version": "1.0.0", 4 | "description": "phosphor merge", 5 | "main": "server.js", 6 | "keywords": [], 7 | "author": "Tommy Nguyen", 8 | "license": "MIT", 9 | 10 | "dependencies": { 11 | "angular2": "2.0.0-beta.1", 12 | "body-parser": "^1.15.2", 13 | "ejs": "^2.4.2", 14 | "es6-promise": "3.0.2", 15 | "es6-shim": "0.33.3", 16 | "express": "4.13.3", 17 | "node-powershell": "^1.1.0", 18 | "reflect-metadata": "0.1.2", 19 | "rxjs": "5.0.0-beta.0", 20 | "systemjs": "0.19.16", 21 | "zone.js": "0.5.10" 22 | }, 23 | "devDependencies": { 24 | "del": "2.2.0" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /prototype/src/Phosphor-Server/push.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/Phosphor/88c736ddb2ad4ce49f78b3119473f813f1f2665d/prototype/src/Phosphor-Server/push.txt -------------------------------------------------------------------------------- /prototype/src/Phosphor-Server/test.ps1: -------------------------------------------------------------------------------- 1 | function List-For { 2 | [CmdletBinding()] 3 | 4 | Param ( 5 | [parameter(Mandatory=$true,Position=0)] 6 | [AllowEmptyString()] 7 | [string]$directory, 8 | 9 | [parameter(Mandatory=$true,Position=1)] 10 | [AllowEmptyString()] 11 | [string]$search 12 | ) 13 | 14 | PROCESS { 15 | $children = Get-ChildItem -Recurse -Path $directory; 16 | 17 | foreach ($child in $children) { 18 | if ($child.Name.Contains($search)) { 19 | Write-Host $child.Name 20 | } 21 | } 22 | 23 | } 24 | } 25 | 26 | Get-Command -------------------------------------------------------------------------------- /prototype/src/Phosphor-Server/test.txt: -------------------------------------------------------------------------------- 1 | hahaha 2 | -------------------------------------------------------------------------------- /prototype/src/README.md: -------------------------------------------------------------------------------- 1 | # NOTE: The contents of this folder are deprecated. They are maintained 2 | # for reference. 3 | 4 | # How to run 5 | - Type "npm install" within the /src folder, /src/Phosphor-App, and /src/Phosphor-Server. 6 | - Within /src/Phosphor-Server, also type in "npm install node-powershell@1.1.0". 7 | - To run the server, navigate to /src/Phosphor-Server and input "node server.js" 8 | - You should then be able to connect to localhost:3000 and see the app. 9 | -------------------------------------------------------------------------------- /prototype/src/node1.js: -------------------------------------------------------------------------------- 1 | var shell = require('node-powershell').Shell; 2 | var ps = new shell('$a = get-process -name powershell;$a') 3 | ps.execute().then(function(output) { console.log(output) }).catch(function(err){console.log(err);}) -------------------------------------------------------------------------------- /prototype/test/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /prototype/test/app/app.component.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 3 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 4 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 5 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 6 | return c > 3 && r && Object.defineProperty(target, key, r), r; 7 | }; 8 | var __metadata = (this && this.__metadata) || function (k, v) { 9 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 10 | }; 11 | var core_1 = require('@angular/core'); 12 | var dashboard_component_1 = require('./dashboard.component'); 13 | var router_deprecated_1 = require('@angular/router-deprecated'); 14 | var AppComponent = (function () { 15 | function AppComponent() { 16 | this.title = 'Phosphor'; 17 | } 18 | AppComponent = __decorate([ 19 | core_1.Component({ 20 | selector: 'my-app', 21 | template: "\n \n ", 22 | styleUrls: ['app/css/app.component.css'], 23 | directives: [router_deprecated_1.ROUTER_DIRECTIVES], 24 | providers: [ 25 | router_deprecated_1.ROUTER_PROVIDERS, 26 | ] 27 | }), 28 | router_deprecated_1.RouteConfig([ 29 | { 30 | path: '/', 31 | name: 'Dashboard', 32 | component: dashboard_component_1.DashboardComponent, 33 | useAsDefault: true 34 | } 35 | ]), 36 | __metadata('design:paramtypes', []) 37 | ], AppComponent); 38 | return AppComponent; 39 | }()); 40 | exports.AppComponent = AppComponent; 41 | //# sourceMappingURL=app.component.js.map -------------------------------------------------------------------------------- /prototype/test/app/app.component.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"app.component.js","sourceRoot":"","sources":["app.component.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,qBAAgC,eAAe,CAAC,CAAA;AAEhD,oCAAmC,uBAAuB,CAAC,CAAA;AAK3D,kCAAiE,4BAA4B,CAAC,CAAA;AAuB9F;IAAA;QACE,UAAK,GAAG,UAAU,CAAC;IACrB,CAAC;IAvBD;QAAC,gBAAS,CAAC;YACT,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,2CAET;YACD,SAAS,EAAE,CAAC,2BAA2B,CAAC;YACxC,UAAU,EAAE,CAAC,qCAAiB,CAAC;YAC/B,SAAS,EAAE;gBACT,oCAAgB;aACjB;SACF,CAAC;QAED,+BAAW,CAAC;YACX;gBACE,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,WAAW;gBACjB,SAAS,EAAE,wCAAkB;gBAC7B,YAAY,EAAE,IAAI;aACnB;SACF,CAAC;;oBAAA;IAIF,mBAAC;AAAD,CAAC,AAFD,IAEC;AAFY,oBAAY,eAExB,CAAA"} -------------------------------------------------------------------------------- /prototype/test/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | import { DashboardComponent } from './dashboard.component'; 4 | 5 | import { NounComponent } from './noun.component'; 6 | import { CollectionComponent } from './collection.component'; 7 | 8 | import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS } from '@angular/router-deprecated'; 9 | 10 | @Component({ 11 | selector: 'my-app', 12 | template: ` 13 | 14 | `, 15 | styleUrls: ['app/css/app.component.css'], 16 | directives: [ROUTER_DIRECTIVES], 17 | providers: [ 18 | ROUTER_PROVIDERS, 19 | ] 20 | }) 21 | 22 | @RouteConfig([ 23 | { 24 | path: '/', 25 | name: 'Dashboard', 26 | component: DashboardComponent, 27 | useAsDefault: true 28 | } 29 | ]) 30 | 31 | export class AppComponent { 32 | title = 'Phosphor'; 33 | } 34 | -------------------------------------------------------------------------------- /prototype/test/app/collection.component.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"collection.component.js","sourceRoot":"","sources":["collection.component.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,qBAAkC,eAAe,CAAC,CAAA;AAClD,kCAAoC,4BAA4B,CAAC,CAAA;AAEjE,qBAA+B,eAAe,CAAC,CAAA;AAE/C,QAAO,SAAS,CAAC,CAAA;AAGjB,6BAA4B,yBAAyB,CAAC,CAAA;AAEtD,mCAAkC,+BAA+B,CAAC,CAAA;AAOlE;IAIE,mBAAmB;IACnB,6BACU,MAAc,EACd,WAAwB,EACxB,WAAwB,EACxB,IAAU,EACV,iBAAoC;QAJpC,WAAM,GAAN,MAAM,CAAQ;QACd,gBAAW,GAAX,WAAW,CAAa;QACxB,gBAAW,GAAX,WAAW,CAAa;QACxB,SAAI,GAAJ,IAAI,CAAM;QACV,sBAAiB,GAAjB,iBAAiB,CAAmB;IAAI,CAAC;IAQnD,gBAAgB;IAChB,sCAAQ,GAAR;QAAA,iBASC;QARC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAErC,kFAAkF;QAClF,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAEjC,IAAI,CAAC,iBAAiB,CAAC,oBAAoB,EAAE,CAAC,IAAI,CAAC,UAAA,OAAO,IAAI,OAAA,KAAI,CAAC,OAAO,GAAG,OAAO,EAAtB,CAAsB,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AAyC;IACzC,yCAAW,GAAX,UAAY,IAAY;QACtB,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,oCAAM,GAAN;QAAA,iBAIC;QAHC,yCAAyC;QACzC,IAAI,QAAQ,GAAsB,QAAQ,CAAC,cAAc,CAAC,mBAAmB,CAAE,CAAC,KAAK,CAAC;QACtF,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,UAAA,KAAK,IAAI,OAAA,KAAI,CAAC,KAAK,GAAG,KAAK,EAAlB,CAAkB,CAAC,CAAC;IAC5E,CAAC;IAED,uCAAS,GAAT,UAAU,GAAG;QACX,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAC3C,CAAC;IAED,SAAS;IACT,yCAAW,GAAX;QACE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;IAClC,CAAC;IA9GH;QAAC,gBAAS,CAAC;YACT,QAAQ,EAAE,kBAAkB;YAC5B,WAAW,EAAE,oCAAoC;YACjD,SAAS,EAAE,CAAC,kCAAkC,CAAC;SAChD,CAAC;;2BAAA;IA4GF,0BAAC;AAAD,CAAC,AA3GD,IA2GC;AA3GY,2BAAmB,sBA2G/B,CAAA"} -------------------------------------------------------------------------------- /prototype/test/app/collection.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Router, RouteParams } from '@angular/router-deprecated'; 3 | 4 | import { Http, Response } from '@angular/http'; 5 | import {Headers, RequestOptions} from '@angular/http'; 6 | import 'rxjs/Rx'; 7 | 8 | import { Noun } from './util/noun'; 9 | import { NounService } from './services/noun.service'; 10 | 11 | import { CollectionService } from './services/collection.service'; 12 | 13 | @Component({ 14 | selector: 'collection-blade', 15 | templateUrl: 'app/html/collection.component.html', 16 | styleUrls: ['app/css/collection.component.css'] 17 | }) 18 | export class CollectionComponent implements OnInit { 19 | 20 | subscription: any; 21 | 22 | //Necessary imports 23 | constructor( 24 | private router: Router, 25 | private nounService: NounService, 26 | private routeParams: RouteParams, 27 | private http: Http, 28 | private collectionService: CollectionService) { } 29 | 30 | //Data for Collection 31 | items: string[]; 32 | headers: string[]; 33 | actions: string[]; 34 | rows: any; 35 | 36 | //Initialization 37 | ngOnInit() { 38 | let id = +this.routeParams.get('id'); 39 | 40 | //May need to fix this. However, simply wrapping items in a promise causes errors. 41 | this.requestNounItems("service"); 42 | 43 | this.collectionService.getCollectionActions().then(actions => this.actions = actions); 44 | 45 | this.subscription = this.nounService.nounSelected$.subscribe(noun => this.onNounSelectionChange(noun)); 46 | } 47 | 48 | onNounSelectionChange(noun: Noun) { 49 | this.items = null; 50 | document.getElementById("listItems").style.display = "none"; 51 | this.requestNounItems(noun.name); 52 | } 53 | 54 | 55 | requestNounItems(noun: string) { 56 | this.http.get('/nounitems?' + "noun=" + noun) 57 | .subscribe( 58 | res => { /* console.log(res.json()); */ 59 | 60 | this.headers = []; 61 | this.rows = []; 62 | 63 | this.items = res.json(); 64 | this.collectionService.setCollection(this.items); 65 | if (this.items.length > 1) { 66 | var currHeader = this.items[1]; 67 | } 68 | this.headers = currHeader.match(/\S+/g); 69 | 70 | var rows = []; 71 | 72 | for (var i = this.headers.length - 1; i < this.items.length; i++) { 73 | //console.log(this.items[i].split(" ")); 74 | var currRow = this.items[i].match(/\S+/g); 75 | 76 | var builder; 77 | 78 | if (currRow != null && currRow.length > this.headers.length) { 79 | builder = currRow[this.headers.length - 1]; 80 | 81 | for (var j = this.headers.length; j < currRow.length; j++) { 82 | builder += " " + currRow[j]; 83 | } 84 | 85 | if (currRow.length > this.headers.length) { 86 | currRow[this.headers.length - 1] = builder; 87 | } 88 | 89 | currRow = currRow.slice(0, this.headers.length); 90 | } 91 | 92 | rows.push(currRow); 93 | 94 | } 95 | 96 | this.rows = rows; 97 | 98 | document.getElementById("listItems").style.display = "block"; 99 | 100 | }, 101 | error => { console.log(error); this.items = null; } 102 | ); 103 | } 104 | 105 | //Wrapper for observer pattern of service 106 | setSelected(item: string) { 107 | this.collectionService.setSelected(item); 108 | } 109 | 110 | search() { 111 | //This is a bit hacky as we need casting. 112 | var criteria = (document.getElementById("collection-search")).value; 113 | this.collectionService.search(criteria).then(items => this.items = items); 114 | } 115 | 116 | itemClick(idx) { 117 | this.collectionService.setItemClick(idx); 118 | } 119 | 120 | //Cleanup 121 | ngOnDestroy() { 122 | this.subscription.unsubscribe(); 123 | } 124 | 125 | } 126 | -------------------------------------------------------------------------------- /prototype/test/app/css/app.component.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | font-size: 2.8em; 3 | color: #999; 4 | margin-bottom: 0; 5 | } 6 | h2 { 7 | font-size: 2em; 8 | margin-top: 0; 9 | padding-top: 0; 10 | } 11 | nav a { 12 | padding: 5px 10px; 13 | text-decoration: none; 14 | margin-top: 10px; 15 | display: inline-block; 16 | background-color: #eee; 17 | border-radius: 4px; 18 | } 19 | nav a:visited, a:link { 20 | color: #607D8B; 21 | } 22 | nav a:hover { 23 | color: #039be5; 24 | background-color: #CFD8DC; 25 | } 26 | nav a.router-link-active { 27 | color: #039be5; 28 | } 29 | -------------------------------------------------------------------------------- /prototype/test/app/css/collection.component.css: -------------------------------------------------------------------------------- 1 | .collection-blade { 2 | height: 100%; 3 | padding: 0; 4 | border: 2px solid #D9D9D9; 5 | text-align: center; 6 | } 7 | 8 | .item { 9 | margin: 4px; 10 | background-color: white; 11 | cursor: pointer 12 | } 13 | 14 | .item:hover { 15 | -webkit-transition: background-color 100ms ease-out 0.05s; 16 | -moz-transition: background-color 100ms ease-out 0.05s; 17 | -o-transition: background-color 100ms ease-out 0.05s; 18 | transition: background-color 100ms ease-out 0.05s; 19 | 20 | background-color: #CAE0F5; 21 | 22 | } 23 | 24 | .title { 25 | color: white; 26 | background-color: #E81123; 27 | margin-top: 0; 28 | padding-top: 8px; 29 | padding-bottom: 8px; 30 | } 31 | 32 | .scrollView { 33 | overflow: auto; 34 | height: 75%; 35 | width: 100%; 36 | margin-top: 4%; 37 | } 38 | 39 | .action { 40 | /* border: solid; */ 41 | margin-top: 2%; 42 | cursor: pointer; 43 | } 44 | 45 | #collection-search { 46 | text-align: center; 47 | width: 80%; 48 | margin-left: 10%; 49 | margin-top: 6%; 50 | } 51 | -------------------------------------------------------------------------------- /prototype/test/app/css/dashboard.component.css: -------------------------------------------------------------------------------- 1 | [class*='col-'] { 2 | float: left; 3 | } 4 | *, *:after, *:before { 5 | -webkit-box-sizing: border-box; 6 | -moz-box-sizing: border-box; 7 | box-sizing: border-box; 8 | } 9 | h3 { 10 | text-align: center; margin-bottom: 0; 11 | } 12 | [class*='col-'] { 13 | padding-right: 20px; 14 | padding-bottom: 20px; 15 | } 16 | [class*='col-']:last-of-type { 17 | padding-right: 0; 18 | } 19 | .grid { 20 | margin: 0; 21 | } 22 | .col-1-4 { 23 | width: 25%; 24 | } 25 | .module { 26 | padding: 20px; 27 | text-align: center; 28 | color: #eee; 29 | max-height: 120px; 30 | min-width: 120px; 31 | background-color: #607D8B; 32 | border-radius: 2px; 33 | } 34 | h4 { 35 | position: relative; 36 | } 37 | .module:hover { 38 | background-color: #EEE; 39 | cursor: pointer; 40 | color: #607d8b; 41 | } 42 | .grid-pad { 43 | padding: 10px 0; 44 | } 45 | .grid-pad > [class*='col-']:last-of-type { 46 | padding-right: 20px; 47 | } 48 | @media (max-width: 600px) { 49 | .module { 50 | font-size: 10px; 51 | max-height: 75px; } 52 | } 53 | @media (max-width: 1024px) { 54 | .grid { 55 | margin: 0; 56 | } 57 | .module { 58 | min-width: 60px; 59 | } 60 | } 61 | 62 | #dash { 63 | text-align: center; 64 | padding: 0; 65 | height: 97.5%; 66 | } 67 | 68 | .dashboard { 69 | text-align: center; 70 | margin: 0; 71 | } 72 | 73 | #ps-console { 74 | cursor: pointer; 75 | height: 2.5%; 76 | background-color: #315D88; 77 | text-align: left; 78 | } 79 | 80 | .expanded { 81 | height: 10%; 82 | background-color: #0078D7; 83 | color: white; 84 | } 85 | 86 | .verb { 87 | border: solid thin #4685CC; 88 | margin: 0.5%; 89 | padding: 3px; 90 | padding-left: 8px; 91 | padding-right: 8px; 92 | cursor: pointer; 93 | display: inline; 94 | } 95 | -------------------------------------------------------------------------------- /prototype/test/app/css/detail.component.css: -------------------------------------------------------------------------------- 1 | .detail-blade { 2 | height: 95%; 3 | padding: 0; 4 | border: 2px solid #D9D9D9; 5 | text-align: center; 6 | } 7 | 8 | .verb { 9 | /* border: solid; */ 10 | margin-top: 2%; 11 | cursor: pointer; 12 | } 13 | 14 | .title { 15 | color: white; 16 | background-color: #107C10; 17 | margin-top: 0; 18 | padding-top: 8px; 19 | padding-bottom: 8px; 20 | } 21 | 22 | #details { 23 | padding-left: 5%; 24 | } 25 | 26 | .detailButton { 27 | border: solid thin #4685CC; 28 | margin: 0.5%; 29 | padding: 3px; 30 | padding-left: 8px; 31 | padding-right: 8px; 32 | cursor: pointer; 33 | display: inline; 34 | } 35 | -------------------------------------------------------------------------------- /prototype/test/app/css/noun.component.css: -------------------------------------------------------------------------------- 1 | .noun-blade { 2 | height: 100%; 3 | padding: 0; 4 | border: 2px solid #D9D9D9; 5 | text-align: center; 6 | } 7 | 8 | .noun { 9 | margin: 4px; 10 | width: 80%; 11 | background-color: #464646; 12 | color: white; 13 | font-size: 1.15em; 14 | } 15 | 16 | .title { 17 | color: white; 18 | background-color: #0078D7; 19 | margin-top: 0; 20 | padding-top: 8px; 21 | padding-bottom: 8px; 22 | } 23 | 24 | .search { 25 | margin-left: 30px; 26 | margin-right: 30px; 27 | } 28 | 29 | .scrollView { 30 | overflow-y: auto; 31 | overflow-x: hidden; 32 | height: 80%; 33 | width: 100%; 34 | margin-top: 12%; 35 | } 36 | 37 | #module-dropdown { 38 | background-image: none; 39 | background-color: #0078D7; 40 | color: white; 41 | margin: 0; 42 | width: 100%; 43 | } 44 | 45 | .listnoun { 46 | cursor: pointer; 47 | padding-top: 4px; 48 | padding-bottom: 4px; 49 | background-color: white; 50 | } 51 | 52 | .listnoun:hover { 53 | -webkit-transition: background-color 100ms ease-out 0.05s; 54 | -moz-transition: background-color 100ms ease-out 0.05s; 55 | -o-transition: background-color 100ms ease-out 0.05s; 56 | transition: background-color 100ms ease-out 0.05s; 57 | 58 | background-color: #CAE0F5; 59 | 60 | } 61 | 62 | #noun-search { 63 | border-radius: 5px; 64 | width: 80%; 65 | margin-left: 10%; 66 | margin-top: 10%; 67 | } 68 | -------------------------------------------------------------------------------- /prototype/test/app/dashboard.component.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"dashboard.component.js","sourceRoot":"","sources":["dashboard.component.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,qBAAyC,eAAe,CAAC,CAAA;AAEzD,kCAAuB,4BAA4B,CAAC,CAAA;AAEpD,qBAA+B,eAAe,CAAC,CAAA;AAE/C,QAAO,SAAS,CAAC,CAAA;AAEjB,+BAA8B,kBAAkB,CAAC,CAAA;AACjD,6BAA4B,yBAAyB,CAAC,CAAA;AAEtD,6BAA4B,yBAAyB,CAAC,CAAA;AAEtD,qCAAoC,wBAAwB,CAAC,CAAA;AAC7D,iCAAgC,oBAAoB,CAAC,CAAA;AAUrD;IAYE,4BACU,MAAc,EACd,IAAU,EACV,WAAwB,EACxB,WAAwB;QAHxB,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAM;QACV,gBAAW,GAAX,WAAW,CAAa;QACxB,gBAAW,GAAX,WAAW,CAAa;QAdlC,aAAQ,GAAY,KAAK,CAAC;IAetB,CAAC;IAEL,qCAAQ,GAAR;QAAA,iBASC;QARC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAElB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,SAAS,CAAC,UAAA,IAAI,IAAI,OAAA,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAnB,CAAmB,CAAC,CAAC;QAE1F,IAAI,CAAC,cAAc,GAAG,IAAI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9B,CAAA"} -------------------------------------------------------------------------------- /prototype/test/app/fonts/MWFMDL2.1.63.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/Phosphor/88c736ddb2ad4ce49f78b3119473f813f1f2665d/prototype/test/app/fonts/MWFMDL2.1.63.ttf -------------------------------------------------------------------------------- /prototype/test/app/fonts/MWFMDL2.1.63.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/Phosphor/88c736ddb2ad4ce49f78b3119473f813f1f2665d/prototype/test/app/fonts/MWFMDL2.1.63.woff -------------------------------------------------------------------------------- /prototype/test/app/html/collection.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | 6 | 7 |
8 | 9 | 10 |
11 | 12 | 13 | 14 |

Select from the list:

15 | 16 |
17 | 18 | 19 |
20 | 21 | 22 | 31 | 32 |
33 | 34 | 35 | 36 | 37 | 38 |
39 | 40 |
41 | 42 | 43 | 44 | 45 | 48 | 49 | 50 | 51 | 52 | 55 | 56 | 57 |
46 | {{header}} 47 |
53 | {{col}} 54 |
58 | 59 |
60 | 61 | 62 | 63 |
64 | -------------------------------------------------------------------------------- /prototype/test/app/html/dashboard.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | 6 |
7 | 8 | 9 |
10 | 11 |
12 | 13 | 14 |
15 | 16 |
17 |
18 |
19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | {{verb}} 30 | 31 |
32 |
33 | 34 | 35 | 36 | 37 |
38 | 39 | 44 | 45 | 46 | 47 |
48 | 49 |
50 | 51 | 52 |
53 | 54 | 55 | 56 |
57 | -------------------------------------------------------------------------------- /prototype/test/app/html/detail.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 6 |
7 |
8 |
9 |

10 | {{detail}} 11 |

12 | 13 |
14 | < metadata > 15 |
16 |
17 |
18 | 19 |
20 |
21 |

{{input}}

22 | 23 | 24 |
25 | 26 |
27 | 28 |
29 | 30 | {{switch}} 31 | 32 | 33 |
34 |
35 | 36 | 37 |
38 |
39 | 40 | 49 | 50 |
51 | 52 | 54 | 55 |
56 | 57 | 58 | 59 |
60 | < 61 | Run 62 | Exit Output 63 | PS Preview 64 | Copy to Clipboard 65 | > 66 |
67 | 68 | 69 |
70 | -------------------------------------------------------------------------------- /prototype/test/app/html/noun.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | 6 |
7 | 8 | 11 |
12 |
13 | 14 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
32 |
33 | 36 |
37 |
38 | 39 | 40 |
41 | 42 | 43 | 44 | 45 | 46 |
47 | 48 | 49 |
50 | -------------------------------------------------------------------------------- /prototype/test/app/img/psicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/Phosphor/88c736ddb2ad4ce49f78b3119473f813f1f2665d/prototype/test/app/img/psicon.png -------------------------------------------------------------------------------- /prototype/test/app/main.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var platform_browser_dynamic_1 = require('@angular/platform-browser-dynamic'); 3 | var router_deprecated_1 = require('@angular/router-deprecated'); 4 | var http_1 = require('@angular/http'); 5 | var app_component_1 = require('./app.component'); 6 | var noun_service_1 = require('./services/noun.service'); 7 | var verb_service_1 = require('./services/verb.service'); 8 | var collection_service_1 = require('./services/collection.service'); 9 | require('rxjs/Rx'); 10 | platform_browser_dynamic_1.bootstrap(app_component_1.AppComponent, [ 11 | router_deprecated_1.ROUTER_PROVIDERS, noun_service_1.NounService, verb_service_1.VerbService, collection_service_1.CollectionService, http_1.HTTP_PROVIDERS 12 | ]); 13 | //# sourceMappingURL=main.js.map -------------------------------------------------------------------------------- /prototype/test/app/main.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"main.js","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":";AAAA,yCAAiC,mCAAmC,CAAC,CAAA;AACrE,kCAAiC,4BAA4B,CAAC,CAAA;AAC9D,qBAA+B,eAAe,CAAC,CAAA;AAE/C,8BAAiC,iBAAiB,CAAC,CAAA;AAEnD,6BAA6B,yBAAyB,CAAC,CAAA;AACvD,6BAA6B,yBAAyB,CAAC,CAAA;AACvD,mCAAiC,+BAA+B,CAAC,CAAA;AAEjE,QAAO,SAAS,CAAC,CAAA;AAEjB,oCAAS,CAAC,4BAAY,EAAE;IACtB,oCAAgB,EAAE,0BAAW,EAAE,0BAAW,EAAE,sCAAiB,EAAE,qBAAc;CAC9E,CAAC,CAAC"} -------------------------------------------------------------------------------- /prototype/test/app/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrap } from '@angular/platform-browser-dynamic'; 2 | import { ROUTER_PROVIDERS } from '@angular/router-deprecated'; 3 | import { HTTP_PROVIDERS } from '@angular/http'; 4 | 5 | import { AppComponent } from './app.component'; 6 | 7 | import { NounService } from './services/noun.service'; 8 | import { VerbService } from './services/verb.service'; 9 | import { CollectionService} from './services/collection.service'; 10 | 11 | import 'rxjs/Rx'; 12 | 13 | bootstrap(AppComponent, [ 14 | ROUTER_PROVIDERS, NounService, VerbService, CollectionService, HTTP_PROVIDERS 15 | ]); 16 | -------------------------------------------------------------------------------- /prototype/test/app/noun.component.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 3 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 4 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 5 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 6 | return c > 3 && r && Object.defineProperty(target, key, r), r; 7 | }; 8 | var __metadata = (this && this.__metadata) || function (k, v) { 9 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 10 | }; 11 | var core_1 = require('@angular/core'); 12 | var router_deprecated_1 = require('@angular/router-deprecated'); 13 | var noun_service_1 = require('./services/noun.service'); 14 | var NounComponent = (function () { 15 | function NounComponent(router, nounService) { 16 | this.router = router; 17 | this.nounService = nounService; 18 | } 19 | NounComponent.prototype.getNouns = function () { 20 | var _this = this; 21 | this.nounService.getNouns().then(function (nouns) { return _this.nouns = nouns; }); 22 | }; 23 | NounComponent.prototype.getModules = function () { 24 | var _this = this; 25 | this.nounService.getModules().then(function (modules) { 26 | _this.modules = modules; 27 | _this.selectedModule = _this.modules[0]; 28 | }); 29 | }; 30 | NounComponent.prototype.getNounsByModule = function () { 31 | }; 32 | NounComponent.prototype.ngOnInit = function () { 33 | this.getNouns(); 34 | this.getModules(); 35 | }; 36 | NounComponent.prototype.search = function () { 37 | var _this = this; 38 | //This is a bit hacky as we need casting. 39 | var criteria = document.getElementById("noun-search").value; 40 | this.nounService.search(criteria, this.selectedModule.nouns).then(function (nouns) { return _this.nouns = nouns; }); 41 | }; 42 | NounComponent.prototype.setSelected = function (selectedNoun) { 43 | this.nounService.setSelected(selectedNoun); 44 | }; 45 | NounComponent.prototype.selectModule = function (selectedModule) { 46 | this.nouns = selectedModule.nouns; 47 | this.selectedModule = selectedModule; 48 | //DOM manipulation 49 | document.getElementById("module-dropdown").innerHTML = selectedModule.name + ' '; 50 | }; 51 | NounComponent = __decorate([ 52 | core_1.Component({ 53 | selector: 'noun-blade', 54 | templateUrl: 'app/html/noun.component.html', 55 | styleUrls: ['app/css/noun.component.css'] 56 | }), 57 | __metadata('design:paramtypes', [router_deprecated_1.Router, noun_service_1.NounService]) 58 | ], NounComponent); 59 | return NounComponent; 60 | }()); 61 | exports.NounComponent = NounComponent; 62 | //# sourceMappingURL=noun.component.js.map -------------------------------------------------------------------------------- /prototype/test/app/noun.component.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"noun.component.js","sourceRoot":"","sources":["noun.component.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,qBAAyC,eAAe,CAAC,CAAA;AACzD,kCAAuB,4BAA4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,cAAc,CAAC,KAAK,CAAC;QAClC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QAErC,kBAAkB;QAClB,QAAQ,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC,SAAS,GAAG,cAAc,CAAC,IAAI,GAAG,gCAAgC,CAAC;IAClH,CAAC;IAnDH;QAAC,gBAAS,CAAC;YACT,QAAQ,EAAE,YAAY;YACtB,WAAW,EAAE,8BAA8B;YAC3C,SAAS,EAAE,CAAC,4BAA4B,CAAC;SAC1C,CAAC;;qBAAA;IAiDF,oBAAC;AAAD,CAAC,AAhDD,IAgDC;AAhDY,qBAAa,gBAgDzB,CAAA"} -------------------------------------------------------------------------------- /prototype/test/app/noun.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input } from '@angular/core'; 2 | import { Router } from '@angular/router-deprecated'; 3 | 4 | import { Noun } from './util/noun'; 5 | import { NounService } from './services/noun.service'; 6 | import { DetailComponent } from './detail.component'; 7 | 8 | @Component({ 9 | selector: 'noun-blade', 10 | templateUrl: 'app/html/noun.component.html', 11 | styleUrls: ['app/css/noun.component.css'] 12 | }) 13 | export class NounComponent implements OnInit { 14 | 15 | constructor( 16 | private router: Router, 17 | private nounService: NounService) { } 18 | 19 | nouns: Noun[]; 20 | modules: any; 21 | selectedModule: any; 22 | 23 | getNouns() { 24 | this.nounService.getNouns().then(nouns => this.nouns = nouns); 25 | } 26 | 27 | getModules() { 28 | this.nounService.getModules().then(modules => { 29 | this.modules = modules; 30 | this.selectedModule = this.modules[0]; 31 | }); 32 | } 33 | 34 | getNounsByModule() { 35 | 36 | } 37 | 38 | ngOnInit() { 39 | this.getNouns(); 40 | this.getModules(); 41 | } 42 | 43 | search() { 44 | //This is a bit hacky as we need casting. 45 | var criteria = (document.getElementById("noun-search")).value; 46 | this.nounService.search(criteria, this.selectedModule.nouns).then(nouns => this.nouns = nouns); 47 | } 48 | 49 | setSelected(selectedNoun) { 50 | this.nounService.setSelected(selectedNoun); 51 | } 52 | 53 | selectModule(selectedModule) { 54 | this.nouns = selectedModule.nouns; 55 | this.selectedModule = selectedModule; 56 | 57 | //DOM manipulation 58 | document.getElementById("module-dropdown").innerHTML = selectedModule.name + ' '; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /prototype/test/app/services/collection.service.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 3 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 4 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 5 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 6 | return c > 3 && r && Object.defineProperty(target, key, r), r; 7 | }; 8 | var __metadata = (this && this.__metadata) || function (k, v) { 9 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 10 | }; 11 | var core_1 = require('@angular/core'); 12 | var mock_nouns_1 = require('../util/mock-nouns'); 13 | var CollectionService = (function () { 14 | function CollectionService() { 15 | //Currently placed here as mock data 16 | this.actions = ['New', 'Tools', 'Batch']; 17 | this.itemSelected$ = new core_1.EventEmitter(); 18 | this.itemClicked$ = new core_1.EventEmitter(); 19 | //Grabbing to initialize first 20 | this.items = mock_nouns_1.MOCKNOUNS[0].items; 21 | } 22 | CollectionService.prototype.getCollectionActions = function () { 23 | return Promise.resolve(this.actions); 24 | }; 25 | //Observer pattern 26 | CollectionService.prototype.setSelected = function (item) { 27 | this.itemSelected$.emit(item); 28 | }; 29 | //Called from noun service to set the items 30 | CollectionService.prototype.setCollection = function (items) { 31 | this.items = items; 32 | console.log(items); 33 | }; 34 | //This is called every keystroke to search using JavaScript's String indexOf method. 35 | CollectionService.prototype.search = function (criteria) { 36 | var result = []; 37 | for (var i = 0; i < this.items.length; i++) { 38 | if (this.items[i].toLowerCase().indexOf(criteria.toLowerCase()) != -1) { 39 | result.push(this.items[i]); 40 | } 41 | } 42 | return Promise.resolve(result); 43 | }; 44 | CollectionService.prototype.setItemClick = function (idx) { 45 | console.log("Set Item Clicked"); 46 | this.itemClicked$.emit(idx - 1); 47 | }; 48 | CollectionService = __decorate([ 49 | core_1.Injectable(), 50 | __metadata('design:paramtypes', []) 51 | ], CollectionService); 52 | return CollectionService; 53 | }()); 54 | exports.CollectionService = CollectionService; 55 | //# sourceMappingURL=collection.service.js.map -------------------------------------------------------------------------------- /prototype/test/app/services/collection.service.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"collection.service.js","sourceRoot":"","sources":["collection.service.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,qBAAiD,eAAe,CAAC,CAAA;AAEjE,2BAA0B,oBAAoB,CAAC,CAAA;AAG/C;IAWE;QAJA,oCAAoC;QACpC,YAAO,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAIlC,IAAI,CAAC,aAAa,GAAG,IAAI,mBAAY,EAAU,CAAC;QAChD,IAAI,CAAC,YAAY,GAAG,IAAI,mBAAY,EAAO,CAAC;QAC5C,8BAA8B;QAC9B,IAAI,CAAC,KAAK,GAAG,sBAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAClC,CAAC;IAED,gDAAoB,GAApB;QACE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAED,kBAAkB;IAClB,uCAAW,GAAX,UAAY,IAAI;QACd,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,2CAA2C;IAC3C,yCAAa,GAAb,UAAc,KAAK;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IAED,oFAAoF;IACpF,kCAAM,GAAN,UAAO,QAAQ;QACb,IAAI,MAAM,GAAG,EAAE,CAAC;QAEhB,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3C,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;gBACtE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAE7B,CAAC;QACH,CAAC;QAED,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAED,wCAAY,GAAZ,UAAa,GAAG;QACd,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAChC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IAClC,CAAC;IAnDH;QAAC,iBAAU,EAAE;;yBAAA;IA6Db,wBAAC;AAAD,CAAC,AA5DD,IA4DC;AA5DY,yBAAiB,oBA4D7B,CAAA"} -------------------------------------------------------------------------------- /prototype/test/app/services/collection.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable, EventEmitter, OnInit } from '@angular/core'; 2 | 3 | import { MOCKNOUNS } from '../util/mock-nouns'; 4 | 5 | @Injectable() 6 | export class CollectionService { 7 | 8 | //Observer pattern below 9 | selectedItem: string; 10 | public itemSelected$: EventEmitter; 11 | public itemClicked$: EventEmitter; 12 | 13 | //Currently placed here as mock data 14 | actions = ['New', 'Tools', 'Batch']; 15 | items: string[]; 16 | 17 | constructor() { 18 | this.itemSelected$ = new EventEmitter(); 19 | this.itemClicked$ = new EventEmitter(); 20 | //Grabbing to initialize first 21 | this.items = MOCKNOUNS[0].items; 22 | } 23 | 24 | getCollectionActions() { 25 | return Promise.resolve(this.actions); 26 | } 27 | 28 | //Observer pattern 29 | setSelected(item) { 30 | this.itemSelected$.emit(item); 31 | } 32 | 33 | //Called from noun service to set the items 34 | setCollection(items) { 35 | this.items = items; 36 | console.log(items); 37 | } 38 | 39 | //This is called every keystroke to search using JavaScript's String indexOf method. 40 | search(criteria) { 41 | var result = []; 42 | 43 | for (var i = 0; i < this.items.length; i++) { 44 | if (this.items[i].toLowerCase().indexOf(criteria.toLowerCase()) != -1) { 45 | result.push(this.items[i]); 46 | //console.log(this.items[i]); 47 | } 48 | } 49 | 50 | return Promise.resolve(result); 51 | } 52 | 53 | setItemClick(idx) { 54 | console.log("Set Item Clicked"); 55 | this.itemClicked$.emit(idx - 1); 56 | } 57 | 58 | //General Algorithm for mapping verbs to images and similar verbs together 59 | 60 | //verbs[any verb] 61 | //if we have a dictionary of similar word relations that would be nice to build from 62 | //From that dictionary, we can then map images to the verbs. 63 | 64 | 65 | 66 | } 67 | -------------------------------------------------------------------------------- /prototype/test/app/services/noun.service.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"noun.service.js","sourceRoot":"","sources":["noun.service.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,qBAAiD,eAAe,CAAC,CAAA;AACjE,qBAA+B,eAAe,CAAC,CAAA;AAE/C,QAAO,SAAS,CAAC,CAAA;AAMjB,mCAAkC,sBAAsB,CAAC,CAAA;AAGzD;IAQE,qBACU,iBAAoC,EACpC,IAAU;QADV,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,SAAI,GAAJ,IAAI,CAAM;QAGlB,IAAI,CAAC,aAAa,GAAG,IAAI,mBAAY,EAAQ,CAAC;IAChD,CAAC;IAED,8BAAQ,GAAR;IAEA,CAAC;IAED,8BAAQ,GAAR;QACE,IAAI,WAAW,GAAG,EAAE,GAAG,QAAQ,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC;QAEzE,IAAI,QAAQ,GAAG,WAAW,CAAC,KAA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AC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAC3D,UAAA,KAAK,IAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CACzD,CAAC;QAEF,UAAU,CAAC,CAAC,cAAY,OAAO,CAAC,GAAG,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QAE5F,gCAAgC;IAClC,CAAC;IAED,8CAA8C;IAC9C,iCAAW,GAAX,UAAY,IAAU;QAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrD,CAAC;IArIH;QAAC,iBAAU,EAAE;;mBAAA;IAwIb,kBAAC;AAAD,CAAC,AAvID,IAuIC;AAvIY,mBAAW,cAuIvB,CAAA"} -------------------------------------------------------------------------------- /prototype/test/app/services/noun.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable, EventEmitter, OnInit } from '@angular/core'; 2 | import { Http, Response } from '@angular/http'; 3 | import {Headers, RequestOptions} from '@angular/http'; 4 | import 'rxjs/Rx'; 5 | 6 | import { MOCKNOUNS } from '../util/mock-nouns'; 7 | import { MOCKMODULES } from '../util/mock-modules'; 8 | import { Noun } from '../util/noun'; 9 | 10 | import { CollectionService } from './collection.service'; 11 | 12 | @Injectable() 13 | export class NounService { 14 | 15 | selected: Noun; 16 | nouns: any; 17 | modules: any; 18 | 19 | public nounSelected$: EventEmitter; 20 | 21 | constructor( 22 | private collectionService: CollectionService, 23 | private http: Http 24 | ) 25 | { 26 | this.nounSelected$ = new EventEmitter(); 27 | } 28 | 29 | ngOnInit() { 30 | 31 | } 32 | 33 | getNouns() { 34 | var servernouns = "" + document.getElementById("server-nouns").innerHTML; 35 | 36 | var splitted = servernouns.split(","); 37 | 38 | this.nouns = []; 39 | this.modules = []; 40 | 41 | //Module that contains all nouns: 42 | var allModule = { 43 | name: "All", 44 | nouns: [] 45 | }; 46 | 47 | for (var i = 0; i < splitted.length; i++) { 48 | 49 | var separate = splitted[i].split("-"); 50 | 51 | var noun = separate[0]; 52 | var module = separate[1]; 53 | 54 | var newNoun = { 55 | name: noun, 56 | id: i, 57 | items: [], 58 | module: module 59 | }; 60 | 61 | this.nouns.push(newNoun); 62 | 63 | if (!this.modules[module]) { 64 | 65 | var newModule = { 66 | name: module, 67 | nouns: [] 68 | }; 69 | 70 | newModule.nouns.push(newNoun); 71 | 72 | this.modules[module] = newModule; 73 | } 74 | else { 75 | this.modules[module].nouns.push(newNoun); 76 | } 77 | 78 | allModule.nouns.push(newNoun); 79 | } 80 | 81 | this.modules.push(allModule); 82 | 83 | return Promise.resolve(this.nouns); 84 | //return Promise.resolve(MOCKNOUNS); 85 | } 86 | 87 | getModules() { 88 | 89 | var allModules = []; 90 | 91 | for (var k in this.modules) { 92 | allModules.push(this.modules[k]); 93 | } 94 | 95 | return Promise.resolve(allModules); 96 | } 97 | 98 | //This is called every keystroke to search using JavaScript's String indexOf method. 99 | search(criteria, nouns) { 100 | var result = []; 101 | 102 | for (var i = 0; i < nouns.length; i++) { 103 | if (nouns[i].name.toLowerCase().indexOf(criteria.toLowerCase()) != -1) { 104 | result.push(nouns[i]); 105 | } 106 | } 107 | 108 | return Promise.resolve(result); 109 | } 110 | 111 | //Gets the items for the selected noun. 112 | getNounItems(name) { 113 | 114 | //TODO Make an HTTP request to grab data from the server on the noun 115 | 116 | /* 117 | var test = this.http.get("/shell").map(function(res) { 118 | console.log(res); 119 | }).catch(function(err, caught) { 120 | console.log(err); 121 | return caught; 122 | }); 123 | 124 | console.log("test: " + test.json()); 125 | */ 126 | 127 | var nounItems; 128 | 129 | this.http.get('/nounitems?' + "noun=" + name) 130 | .subscribe( 131 | res => { console.log(res.json()); nounItems = res.json(); }, 132 | error => { console.log(error); nounItems = null; } 133 | ); 134 | 135 | setTimeout((function() {console.log("HELLO WORLD!" + nounItems); return nounItems;}), 2000); 136 | 137 | //return MOCKNOUNS[2 - 1].items; 138 | } 139 | 140 | //Observer pattern to emit noun to subscribers 141 | setSelected(noun: Noun) { 142 | this.selected = noun; 143 | this.nounSelected$.emit(noun); 144 | this.collectionService.setCollection(noun.items); 145 | } 146 | 147 | 148 | } 149 | -------------------------------------------------------------------------------- /prototype/test/app/services/verb.service.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 3 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 4 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 5 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 6 | return c > 3 && r && Object.defineProperty(target, key, r), r; 7 | }; 8 | var __metadata = (this && this.__metadata) || function (k, v) { 9 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 10 | }; 11 | var core_1 = require('@angular/core'); 12 | var VerbService = (function () { 13 | function VerbService() { 14 | //Mock Data 15 | this.verbs = ['set', 'stop', 'add', 'extend', 'modify', 'reduce', '...']; 16 | this.details = ['Name: ', 'DisplayName: ', 'Status: ', 'DependentServices: ', 17 | 'ServicesDependedOn: ', 'CanPauseAndContinue: ']; 18 | this.verbDetailsSelection$ = new core_1.EventEmitter(); 19 | this.previewCommand$ = new core_1.EventEmitter(); 20 | } 21 | //Data wrapped in a Promise 22 | VerbService.prototype.getVerbs = function () { 23 | return Promise.resolve(this.verbs); 24 | }; 25 | VerbService.prototype.getDetails = function (verb) { 26 | return Promise.resolve(this.details); 27 | }; 28 | VerbService.prototype.setVerbDetails = function (verb) { 29 | this.verbDetails = verb; 30 | this.verbDetailsSelection$.emit(verb); 31 | }; 32 | VerbService.prototype.setPreview = function (command) { 33 | this.previewCommand$.emit(command); 34 | }; 35 | VerbService = __decorate([ 36 | core_1.Injectable(), 37 | __metadata('design:paramtypes', []) 38 | ], VerbService); 39 | return VerbService; 40 | }()); 41 | exports.VerbService = VerbService; 42 | //# sourceMappingURL=verb.service.js.map -------------------------------------------------------------------------------- /prototype/test/app/services/verb.service.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"verb.service.js","sourceRoot":"","sources":["verb.service.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,qBAAyC,eAAe,CAAC,CAAA;AAGzD;IAwBE;QAtBA,WAAW;QACX,UAAK,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;QACpE,YAAO,GAAG,CAAC,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAE,qBAAqB;YAC5D,sBAAsB,EAAE,uBAAuB,CAAC,CAAC;QAiBrD,0BAAqB,GAAsB,IAAI,mBAAY,EAAO,CAAC;QAKxE,IAAI,CAAC,eAAe,GAAG,IAAI,mBAAY,EAAU,CAAC;IACpD,CAAC;IAfD,2BAA2B;IAC3B,8BAAQ,GAAR;QACE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,gCAAU,GAAV,UAAW,IAAI;QACb,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAUD,oCAAc,GAAd,UAAe,IAAI;QACf,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;IAED,gCAAU,GAAV,UAAW,OAAO;QAChB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAtCH;QAAC,iBAAU,EAAE;;mBAAA;IAiDb,kBAAC;AAAD,CAAC,AAhDD,IAgDC;AAhDY,mBAAW,cAgDvB,CAAA"} -------------------------------------------------------------------------------- /prototype/test/app/services/verb.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable, EventEmitter } from '@angular/core'; 2 | 3 | @Injectable() 4 | export class VerbService { 5 | 6 | //Mock Data 7 | verbs = ['set', 'stop', 'add', 'extend', 'modify', 'reduce', '...']; 8 | details = ['Name: ', 'DisplayName: ', 'Status: ', 'DependentServices: ', 9 | 'ServicesDependedOn: ', 'CanPauseAndContinue: ']; 10 | 11 | verbDetails: any; 12 | 13 | public currentCommand: string; 14 | 15 | public previewCommand$: EventEmitter; 16 | 17 | //Data wrapped in a Promise 18 | getVerbs() { 19 | return Promise.resolve(this.verbs); 20 | } 21 | 22 | getDetails(verb) { 23 | return Promise.resolve(this.details); 24 | } 25 | 26 | public verbDetailsSelection$: EventEmitter = new EventEmitter(); 27 | 28 | constructor( 29 | ) 30 | { 31 | this.previewCommand$ = new EventEmitter(); 32 | } 33 | 34 | setVerbDetails(verb) { 35 | this.verbDetails = verb; 36 | this.verbDetailsSelection$.emit(verb); 37 | } 38 | 39 | setPreview(command) { 40 | this.previewCommand$.emit(command); 41 | } 42 | 43 | 44 | //General Algorithm for mapping verbs to images and similar verbs together 45 | 46 | //verbs[any verb] 47 | //if we have a dictionary of similar word relations that would be nice to build from 48 | //From that dictionary, we can then map images to the verbs. 49 | 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /prototype/test/app/util/mock-modules.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var mock_nouns_1 = require('./mock-nouns'); 3 | exports.MOCKMODULES = []; 4 | exports.all = { 5 | name: "All", 6 | nouns: mock_nouns_1.MOCKNOUNS, 7 | id: 0 8 | }; 9 | exports.moduleA = { 10 | name: "Module A", 11 | nouns: [], 12 | id: 1 13 | }; 14 | exports.moduleB = { 15 | name: "Module B", 16 | nouns: [], 17 | id: 2 18 | }; 19 | exports.moduleC = { 20 | name: "Module C", 21 | nouns: [], 22 | id: 3 23 | }; 24 | for (var i = 0; i < mock_nouns_1.MOCKNOUNS.length / 3; i++) { 25 | exports.moduleA.nouns.push(mock_nouns_1.MOCKNOUNS[i]); 26 | } 27 | for (var i = Math.ceil(mock_nouns_1.MOCKNOUNS.length / 3); i < 2 * mock_nouns_1.MOCKNOUNS.length / 3; i++) { 28 | exports.moduleB.nouns.push(mock_nouns_1.MOCKNOUNS[i]); 29 | } 30 | for (var i = Math.ceil(2 * mock_nouns_1.MOCKNOUNS.length / 3); i < mock_nouns_1.MOCKNOUNS.length; i++) { 31 | exports.moduleC.nouns.push(mock_nouns_1.MOCKNOUNS[i]); 32 | } 33 | exports.MOCKMODULES.push(exports.all); 34 | exports.MOCKMODULES.push(exports.moduleA); 35 | exports.MOCKMODULES.push(exports.moduleB); 36 | exports.MOCKMODULES.push(exports.moduleC); 37 | //# sourceMappingURL=mock-modules.js.map -------------------------------------------------------------------------------- /prototype/test/app/util/mock-modules.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"mock-modules.js","sourceRoot":"","sources":["mock-modules.ts"],"names":[],"mappings":";AACA,2BAA0B,cAAc,CAAC,CAAA;AAE9B,mBAAW,GAAG,EAAE,CAAC;AAEjB,WAAG,GAAG;IACb,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,sBAAS;IAChB,EAAE,EAAE,CAAC;CACR,CAAA;AAEU,eAAO,GAAG;IACnB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,EAAE;IACT,EAAE,EAAE,CAAC;CACN,CAAC;AAES,eAAO,GAAG;IACnB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,EAAE;IACT,EAAE,EAAE,CAAC;CACN,CAAC;AAES,eAAO,GAAG;IACnB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,EAAE;IACT,EAAE,EAAE,CAAC;CACN,CAAC;AAEF,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,sBAAS,CAAC,MAAM,GAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1C,eAAO,CAAC,KAAK,CAAC,IAAI,CAAC,sBAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC;AAED,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,sBAAS,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,sBAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC9E,eAAO,CAAC,KAAK,CAAC,IAAI,CAAC,sBAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC;AAED,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,sBAAS,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,sBAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1E,eAAO,CAAC,KAAK,CAAC,IAAI,CAAC,sBAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC;AAED,mBAAW,CAAC,IAAI,CAAC,WAAG,CAAC,CAAC;AACtB,mBAAW,CAAC,IAAI,CAAC,eAAO,CAAC,CAAC;AAC1B,mBAAW,CAAC,IAAI,CAAC,eAAO,CAAC,CAAC;AAC1B,mBAAW,CAAC,IAAI,CAAC,eAAO,CAAC,CAAC"} -------------------------------------------------------------------------------- /prototype/test/app/util/mock-modules.ts: -------------------------------------------------------------------------------- 1 | import { Noun } from './noun'; 2 | import { MOCKNOUNS } from './mock-nouns'; 3 | 4 | export var MOCKMODULES = []; 5 | 6 | export var all = { 7 | name: "All", 8 | nouns: MOCKNOUNS, 9 | id: 0 10 | } 11 | 12 | export var moduleA = { 13 | name: "Module A", 14 | nouns: [], 15 | id: 1 16 | }; 17 | 18 | export var moduleB = { 19 | name: "Module B", 20 | nouns: [], 21 | id: 2 22 | }; 23 | 24 | export var moduleC = { 25 | name: "Module C", 26 | nouns: [], 27 | id: 3 28 | }; 29 | 30 | for (var i = 0; i < MOCKNOUNS.length/3; i++) { 31 | moduleA.nouns.push(MOCKNOUNS[i]); 32 | } 33 | 34 | for (var i = Math.ceil(MOCKNOUNS.length / 3); i < 2 * MOCKNOUNS.length / 3; i++) { 35 | moduleB.nouns.push(MOCKNOUNS[i]); 36 | } 37 | 38 | for (var i = Math.ceil(2 * MOCKNOUNS.length / 3); i < MOCKNOUNS.length; i++) { 39 | moduleC.nouns.push(MOCKNOUNS[i]); 40 | } 41 | 42 | MOCKMODULES.push(all); 43 | MOCKMODULES.push(moduleA); 44 | MOCKMODULES.push(moduleB); 45 | MOCKMODULES.push(moduleC); 46 | -------------------------------------------------------------------------------- /prototype/test/app/util/noun.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var Noun = (function () { 3 | function Noun() { 4 | } 5 | return Noun; 6 | }()); 7 | exports.Noun = Noun; 8 | //# sourceMappingURL=noun.js.map -------------------------------------------------------------------------------- /prototype/test/app/util/noun.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"noun.js","sourceRoot":"","sources":["noun.ts"],"names":[],"mappings":";AAAA;IAAA;IAIA,CAAC;IAAD,WAAC;AAAD,CAAC,AAJD,IAIC;AAJY,YAAI,OAIhB,CAAA"} -------------------------------------------------------------------------------- /prototype/test/app/util/noun.ts: -------------------------------------------------------------------------------- 1 | export class Noun { 2 | id: number; 3 | name: string; 4 | items: string[]; 5 | } 6 | -------------------------------------------------------------------------------- /prototype/test/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Phosphor 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 39 | 40 | 41 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | Loading... 56 | 59 | 60 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /prototype/test/liteserver-test-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "startPath": "unit-tests.html" 3 | } 4 | -------------------------------------------------------------------------------- /prototype/test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular2-quickstart", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ", 6 | "lite": "lite-server", 7 | "postinstall": "typings install", 8 | "tsc": "tsc", 9 | "tsc:w": "tsc -w", 10 | "typings": "typings", 11 | "lite-server-test": "lite-server --config=liteserver-test-config.json", 12 | "test": "tsc && concurrently \"npm run tsc:w\" \"npm run lite-server-test\" " 13 | }, 14 | "license": "ISC", 15 | "dependencies": { 16 | "@angular/common": "2.0.0-rc.1", 17 | "@angular/compiler": "2.0.0-rc.1", 18 | "@angular/core": "2.0.0-rc.1", 19 | "@angular/http": "2.0.0-rc.1", 20 | "@angular/platform-browser": "2.0.0-rc.1", 21 | "@angular/platform-browser-dynamic": "2.0.0-rc.1", 22 | "@angular/router": "2.0.0-rc.1", 23 | "@angular/router-deprecated": "2.0.0-rc.1", 24 | "@angular/upgrade": "2.0.0-rc.1", 25 | "systemjs": "0.19.27", 26 | "core-js": "^2.4.0", 27 | "reflect-metadata": "^0.1.3", 28 | "rxjs": "5.0.0-beta.6", 29 | "zone.js": "^0.6.12", 30 | "angular2-in-memory-web-api": "0.0.11", 31 | "bootstrap": "^3.3.6" 32 | }, 33 | "devDependencies": { 34 | "concurrently": "^2.0.0", 35 | "jasmine-core": "2.4.1", 36 | "lite-server": "^2.2.0", 37 | "supertest": "^1.2.0", 38 | "typescript": "^1.8.10", 39 | "typings": "^1.0.4" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /prototype/test/server/test.js: -------------------------------------------------------------------------------- 1 | var assert = require('chai').assert; 2 | describe('Array', function() { 3 | describe('#indexOf()', function() { 4 | it('should return -1 when the value is not present', function() { 5 | assert.equal(-1, [1,2,3].indexOf(5)); 6 | assert.equal(-1, [1,2,3].indexOf(0)); 7 | }); 8 | }); 9 | }); 10 | 11 | routes = require '../src/routes' 12 | 13 | describe('routes', function() { 14 | describe('#show_create_user_screen', function() { 15 | it('should be a function', function() { 16 | routes.show_create_user_screen.should.be.a["function"]; 17 | }); 18 | it('should return something cool', function() { 19 | var mockReq = null; 20 | var mockRes = { 21 | render: function(viewName) { 22 | viewName.should.exist; 23 | viewName.should.match(/createuser/); 24 | } 25 | }; 26 | routes.show_create_user_screen(mockReq, mockRes); 27 | }); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /prototype/test/src/1st.spec.js: -------------------------------------------------------------------------------- 1 | describe('1st tests', function () { 2 | it('true is true', function () { return expect(true).toEqual(true); }); 3 | it('null is not the same thing as undefined', function () { return expect(null).not.toEqual(undefined); }); 4 | }); 5 | //# sourceMappingURL=1st.spec.js.map -------------------------------------------------------------------------------- /prototype/test/src/1st.spec.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"1st.spec.js","sourceRoot":"","sources":["1st.spec.ts"],"names":[],"mappings":"AAAA,QAAQ,CAAC,WAAW,EAAE;IACpB,EAAE,CAAC,cAAc,EAAE,cAAM,OAAA,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAA1B,CAA0B,CAAC,CAAC;IAErD,EAAE,CAAC,yCAAyC,EAC1C,cAAM,OAAA,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,EAAnC,CAAmC,CAC1C,CAAC;AACJ,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /prototype/test/src/1st.spec.ts: -------------------------------------------------------------------------------- 1 | describe('1st tests', () => { 2 | it('true is true', () => expect(true).toEqual(true)); 3 | 4 | it('null is not the same thing as undefined', 5 | () => expect(null).not.toEqual(undefined) 6 | ); 7 | }); 8 | -------------------------------------------------------------------------------- /prototype/test/src/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "system", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": true, 11 | "suppressImplicitAnyIndexErrors": true 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /prototype/test/styles.css: -------------------------------------------------------------------------------- 1 | h2 { 2 | color: #444; 3 | font-family: "SegoeUI", Arial, Helvetica, sans-serif; 4 | font-weight: lighter; 5 | } 6 | body { 7 | margin: 0; 8 | } 9 | body, input[text], button { 10 | color: #888; 11 | font-family: "SegoeUI", Cambria, Georgia; 12 | } 13 | button { 14 | font-family: "SegoeUI", Arial; 15 | background-color: #eee; 16 | border: none; 17 | padding: 5px 10px; 18 | border-radius: 4px; 19 | cursor: pointer; 20 | cursor: hand; 21 | } 22 | button:hover { 23 | background-color: #cfd8dc; 24 | } 25 | button:disabled { 26 | background-color: #eee; 27 | color: #aaa; 28 | cursor: auto; 29 | } 30 | /* everywhere else */ 31 | * { 32 | font-family: "SegoeUI", Arial, Helvetica, sans-serif; 33 | } 34 | 35 | /* Hacky fix for search */ 36 | .btn { 37 | margin-top: 0; 38 | } 39 | 40 | input.c-text-field[type=text], input.form-control { 41 | margin-top: 0; 42 | } 43 | 44 | input[type=checkbox] 45 | { 46 | -webkit-appearance:checkbox; 47 | } 48 | -------------------------------------------------------------------------------- /prototype/test/systemjs.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * System configuration for Angular 2 samples 3 | * Adjust as necessary for your application needs. 4 | */ 5 | (function(global) { 6 | 7 | // map tells the System loader where to look for things 8 | var map = { 9 | 'app': 'app', // 'dist', 10 | 11 | '@angular': 'node_modules/@angular', 12 | 'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api', 13 | 'rxjs': 'node_modules/rxjs' 14 | }; 15 | 16 | // packages tells the System loader how to load when no filename and/or no extension 17 | var packages = { 18 | 'app': { main: 'main.js', defaultExtension: 'js' }, 19 | 'rxjs': { defaultExtension: 'js' }, 20 | 'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' }, 21 | }; 22 | 23 | var ngPackageNames = [ 24 | 'common', 25 | 'compiler', 26 | 'core', 27 | 'http', 28 | 'platform-browser', 29 | 'platform-browser-dynamic', 30 | 'router', 31 | 'router-deprecated', 32 | 'upgrade', 33 | ]; 34 | 35 | // Individual files (~300 requests): 36 | function packIndex(pkgName) { 37 | packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' }; 38 | } 39 | 40 | // Bundled (~40 requests): 41 | function packUmd(pkgName) { 42 | packages['@angular/'+pkgName] = { main: pkgName + '.umd.js', defaultExtension: 'js' }; 43 | }; 44 | 45 | // Most environments should use UMD; some (Karma) need the individual index files 46 | var setPackageConfig = System.packageWithIndex ? packIndex : packUmd; 47 | 48 | // Add package entries for angular packages 49 | ngPackageNames.forEach(setPackageConfig); 50 | 51 | var config = { 52 | map: map, 53 | packages: packages 54 | } 55 | 56 | System.config(config); 57 | 58 | })(this); 59 | -------------------------------------------------------------------------------- /prototype/test/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160317120654", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160505161446", 5 | "node": "registry:dt/node#4.0.0+20160509154515" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /prototype/test/typings/globals/core-js/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/core-js/core-js.d.ts", 5 | "raw": "registry:dt/core-js#0.0.0+20160317120654", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/core-js/core-js.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /prototype/test/typings/globals/jasmine/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/36a1be34dbe202c665b3ddafd50824f78c09eea3/jasmine/jasmine.d.ts", 5 | "raw": "registry:dt/jasmine#2.2.0+20160505161446", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/36a1be34dbe202c665b3ddafd50824f78c09eea3/jasmine/jasmine.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /prototype/test/typings/globals/node/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/6d0e826824da52204c1c93f92cecbc961ac84fa9/node/node.d.ts", 5 | "raw": "registry:dt/node#4.0.0+20160509154515", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/6d0e826824da52204c1c93f92cecbc961ac84fa9/node/node.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /prototype/test/typings/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | -------------------------------------------------------------------------------- /prototype/test/unit-tests.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ng App Unit Tests 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/Phosphor.Client/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | app/**/*.js 3 | app/**/*.js.map -------------------------------------------------------------------------------- /src/Phosphor.Client/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | import { DashboardComponent } from './dashboard.component'; 4 | 5 | import { NounComponent } from './noun.component'; 6 | import { CollectionComponent } from './collection.component'; 7 | 8 | import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS } from '@angular/router-deprecated'; 9 | 10 | @Component({ 11 | selector: 'my-app', 12 | template: ` 13 | 14 | `, 15 | styleUrls: ['app/css/app.component.css'], 16 | directives: [ROUTER_DIRECTIVES], 17 | providers: [ 18 | ROUTER_PROVIDERS, 19 | ] 20 | }) 21 | 22 | @RouteConfig([ 23 | { 24 | path: '/', 25 | name: 'Dashboard', 26 | component: DashboardComponent, 27 | useAsDefault: true 28 | } 29 | ]) 30 | 31 | export class AppComponent { 32 | title = 'Phosphor'; 33 | } 34 | -------------------------------------------------------------------------------- /src/Phosphor.Client/app/collection.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Router, RouteParams } from '@angular/router-deprecated'; 3 | 4 | import { Http, Response } from '@angular/http'; 5 | import {Headers, RequestOptions} from '@angular/http'; 6 | import 'rxjs/Rx'; 7 | 8 | import { Noun } from './util/noun'; 9 | import { NounService } from './services/noun.service'; 10 | 11 | import { SessionService } from './services/session.service'; 12 | import { CollectionService } from './services/collection.service'; 13 | 14 | @Component({ 15 | selector: 'collection-blade', 16 | templateUrl: 'app/html/collection.component.html', 17 | styleUrls: ['app/css/collection.component.css'] 18 | }) 19 | export class CollectionComponent implements OnInit { 20 | 21 | subscription: any; 22 | 23 | //Necessary imports 24 | constructor( 25 | private router: Router, 26 | private nounService: NounService, 27 | private routeParams: RouteParams, 28 | private http: Http, 29 | private session: SessionService, 30 | private collectionService: CollectionService) { } 31 | 32 | //Data for Collection 33 | items: string[]; 34 | headers: string[]; 35 | actions: string[]; 36 | rows: any; 37 | 38 | currNoun: any; 39 | highlightedNoun: string; 40 | 41 | //Initialization 42 | ngOnInit() { 43 | let id = +this.routeParams.get('id'); 44 | 45 | //As a way to keep the list empty and the spinner from spinning 46 | this.items = []; 47 | this.items.push(" "); 48 | 49 | this.collectionService.getCollectionActions().then(actions => this.actions = actions); 50 | 51 | this.subscription = this.nounService.nounSelected$.subscribe(noun => this.onNounSelectionChange(noun)); 52 | } 53 | 54 | onNounSelectionChange(noun: Noun) { 55 | this.items = null; 56 | document.getElementById("listItems").style.display = "none"; 57 | this.requestNounItems(noun.name); 58 | this.currNoun = noun.name; 59 | } 60 | 61 | 62 | requestNounItems(noun: string) { 63 | this.http.get(this.session.getUrlForSession('modules/items/' + noun)) 64 | .subscribe( 65 | res => { /* console.log(res.json()); */ 66 | 67 | var result = res.json(); 68 | 69 | this.headers = result.headers; 70 | this.items = result.items; 71 | this.rows = []; 72 | 73 | for (var item of this.items) { 74 | var row = []; 75 | 76 | for (var header of this.headers) { 77 | row.push(item[header]); 78 | } 79 | 80 | this.rows.push(row); 81 | } 82 | 83 | this.collectionService.setCollection(this.items, this.rows); 84 | 85 | document.getElementById("listItems").style.display = "block"; 86 | 87 | }, 88 | error => { console.log(error); this.items = null; } 89 | ); 90 | } 91 | 92 | //Wrapper for observer pattern of service 93 | setSelected(item: string) { 94 | this.collectionService.setSelected(item); 95 | } 96 | 97 | search() { 98 | //This is a bit hacky as we need casting. 99 | var criteria = (document.getElementById("collection-search")).value; 100 | this.collectionService.search(criteria).then(rows => this.rows = rows); 101 | } 102 | 103 | itemClick(idx) { 104 | this.collectionService.setItemClick(idx); 105 | 106 | if (this.highlightedNoun) { 107 | document.getElementById(this.highlightedNoun).style.backgroundColor = "transparent"; 108 | } 109 | 110 | this.highlightedNoun = "row-" + idx; 111 | document.getElementById(this.highlightedNoun).style.backgroundColor = "#CAE0F5"; 112 | } 113 | 114 | //Cleanup 115 | ngOnDestroy() { 116 | this.subscription.unsubscribe(); 117 | } 118 | 119 | } 120 | -------------------------------------------------------------------------------- /src/Phosphor.Client/app/css/app.component.css: -------------------------------------------------------------------------------- 1 | html { 2 | min-height: 626px; 3 | min-width: 1020px; 4 | } 5 | 6 | h1 { 7 | font-size: 2.8em; 8 | color: #999; 9 | margin-bottom: 0; 10 | } 11 | h2 { 12 | font-size: 2em; 13 | margin-top: 0; 14 | padding-top: 0; 15 | } 16 | nav a { 17 | padding: 5px 10px; 18 | text-decoration: none; 19 | margin-top: 10px; 20 | display: inline-block; 21 | background-color: #eee; 22 | border-radius: 4px; 23 | } 24 | nav a:visited, a:link { 25 | color: #607D8B; 26 | } 27 | nav a:hover { 28 | color: #039be5; 29 | background-color: #CFD8DC; 30 | } 31 | nav a.router-link-active { 32 | color: #039be5; 33 | } 34 | -------------------------------------------------------------------------------- /src/Phosphor.Client/app/css/collection.component.css: -------------------------------------------------------------------------------- 1 | .select { 2 | color: grey; 3 | margin: 0; 4 | padding-top: 20px; 5 | } 6 | 7 | .collection-blade { 8 | height: 100%; 9 | padding: 0; 10 | /* 11 | background-color: #4D6684; 12 | border: 2px solid #4D6684; 13 | */ 14 | text-align: center; 15 | } 16 | 17 | .item { 18 | margin: 4px; 19 | background-color: white; 20 | cursor: pointer 21 | } 22 | 23 | .item:hover { 24 | -webkit-transition: background-color 100ms ease-out 0.05s; 25 | -moz-transition: background-color 100ms ease-out 0.05s; 26 | -o-transition: background-color 100ms ease-out 0.05s; 27 | transition: background-color 100ms ease-out 0.05s; 28 | 29 | background-color: #CAE0F5; 30 | 31 | } 32 | 33 | .title { 34 | color: white; 35 | background-color: #E81123; 36 | margin-top: 0; 37 | padding-top: 8px; 38 | padding-bottom: 8px; 39 | } 40 | 41 | .scrollView { 42 | overflow: auto; 43 | height: 70%; 44 | width: 100%; 45 | margin-top: 4%; 46 | } 47 | 48 | @media (min-height: 820px) { 49 | .scrollView { 50 | overflow: auto; 51 | height: 80%; 52 | width: 100%; 53 | margin-top: 4%; 54 | } 55 | 56 | } 57 | 58 | 59 | .action { 60 | /* border: solid; */ 61 | margin-top: 2%; 62 | cursor: pointer; 63 | } 64 | 65 | #collection-search { 66 | text-align: center; 67 | width: 100%; 68 | margin-top: 4%; 69 | } 70 | -------------------------------------------------------------------------------- /src/Phosphor.Client/app/css/dashboard.component.css: -------------------------------------------------------------------------------- 1 | [class*='col-'] { 2 | float: left; 3 | } 4 | *, *:after, *:before { 5 | -webkit-box-sizing: border-box; 6 | -moz-box-sizing: border-box; 7 | box-sizing: border-box; 8 | } 9 | h3 { 10 | text-align: center; margin-bottom: 0; 11 | } 12 | [class*='col-'] { 13 | padding-right: 20px; 14 | padding-bottom: 20px; 15 | } 16 | [class*='col-']:last-of-type { 17 | padding-right: 0; 18 | } 19 | .grid { 20 | margin: 0; 21 | } 22 | .col-1-4 { 23 | width: 25%; 24 | } 25 | .module { 26 | padding: 20px; 27 | text-align: center; 28 | color: #eee; 29 | max-height: 120px; 30 | min-width: 120px; 31 | background-color: #607D8B; 32 | border-radius: 2px; 33 | } 34 | h4 { 35 | position: relative; 36 | } 37 | .module:hover { 38 | background-color: #EEE; 39 | cursor: pointer; 40 | color: #607d8b; 41 | } 42 | .grid-pad { 43 | padding: 10px 0; 44 | } 45 | .grid-pad > [class*='col-']:last-of-type { 46 | padding-right: 20px; 47 | } 48 | @media (max-width: 600px) { 49 | .module { 50 | font-size: 10px; 51 | max-height: 75px; } 52 | } 53 | @media (max-width: 1024px) { 54 | .grid { 55 | margin: 0; 56 | } 57 | .module { 58 | min-width: 60px; 59 | } 60 | } 61 | 62 | #dash { 63 | text-align: center; 64 | padding: 0; 65 | height: 96%; 66 | } 67 | 68 | .dashboard { 69 | text-align: center; 70 | margin: 0; 71 | /* background-color: #4D6684; */ 72 | } 73 | 74 | #ps-console { 75 | cursor: pointer; 76 | height: 3.5%; 77 | background-color: #315D88; 78 | text-align: left; 79 | color: white; 80 | overflow: auto; 81 | font-size: 1.25em; 82 | } 83 | 84 | .ps-icon { 85 | height: 38px; 86 | width: 38px; 87 | margin-bottom: 3px; 88 | } 89 | 90 | .expanded { 91 | height: 10%; 92 | background-color: #0078D7; 93 | color: white; 94 | } 95 | 96 | .verb { 97 | border: solid thin #4685CC; 98 | margin: 0.5%; 99 | padding: 3px; 100 | padding-left: 8px; 101 | padding-right: 8px; 102 | cursor: pointer; 103 | display: inline; 104 | } 105 | -------------------------------------------------------------------------------- /src/Phosphor.Client/app/css/detail.component.css: -------------------------------------------------------------------------------- 1 | .detail-blade { 2 | padding: 0; 3 | text-align: center; 4 | background-color: #F0F1EE; 5 | } 6 | 7 | .verb { 8 | /* border: solid; */ 9 | margin-top: 2%; 10 | cursor: pointer; 11 | } 12 | 13 | .title { 14 | color: white; 15 | background-color: #107C10; 16 | margin-top: 0; 17 | padding-top: 8px; 18 | padding-bottom: 8px; 19 | } 20 | 21 | #details { 22 | padding-left: 5%; 23 | } 24 | 25 | .detailButton { 26 | border: solid thin #4685CC; 27 | margin: 0.5%; 28 | padding: 3px; 29 | padding-left: 8px; 30 | padding-right: 8px; 31 | cursor: pointer; 32 | display: inline; 33 | } 34 | -------------------------------------------------------------------------------- /src/Phosphor.Client/app/css/noun.component.css: -------------------------------------------------------------------------------- 1 | .noun-blade { 2 | height: 100%; 3 | padding: 0; 4 | background-color: #EFEFEF; 5 | 6 | /* background-color: #9AADBD; */ 7 | 8 | 9 | text-align: center; 10 | } 11 | 12 | .noun { 13 | margin: 4px; 14 | width: 80%; 15 | 16 | 17 | background-color: #464646; 18 | color: white; 19 | 20 | 21 | /* 22 | background-color: white; 23 | color: #4685CC; 24 | */ 25 | 26 | 27 | overflow-x: hidden; 28 | font-size: 0.9em; 29 | } 30 | 31 | .title { 32 | color: white; 33 | background-color: #0078D7; 34 | margin-top: 0; 35 | padding-top: 8px; 36 | padding-bottom: 8px; 37 | } 38 | 39 | .search { 40 | margin-left: 30px; 41 | margin-right: 30px; 42 | } 43 | 44 | .scrollView { 45 | overflow-y: auto; 46 | overflow-x: hidden; 47 | height: 70%; 48 | width: 100%; 49 | margin-top: 5%; 50 | font-size: 1.25em; 51 | text-align: left; 52 | color: #464646; 53 | padding-left: 4%; 54 | } 55 | 56 | 57 | @media (min-height: 820px) { 58 | 59 | .scrollView { 60 | overflow-y: auto; 61 | overflow-x: hidden; 62 | height: 80%; 63 | width: 100%; 64 | margin-top: 5%; 65 | font-size: 1.25em; 66 | text-align: left; 67 | color: #464646; 68 | padding-left: 4%; 69 | } 70 | 71 | 72 | } 73 | 74 | #module-dropdown { 75 | background-image: none; 76 | background-color: #0078D7; 77 | color: white; 78 | margin: 0; 79 | width: 100%; 80 | } 81 | 82 | .listnoun { 83 | cursor: pointer; 84 | padding-top: 4px; 85 | padding-bottom: 4px; 86 | background-color: white; 87 | } 88 | 89 | .listnoun:hover { 90 | -webkit-transition: background-color 100ms ease-out 0.05s; 91 | -moz-transition: background-color 100ms ease-out 0.05s; 92 | -o-transition: background-color 100ms ease-out 0.05s; 93 | transition: background-color 100ms ease-out 0.05s; 94 | 95 | background-color: #CAE0F5; 96 | 97 | } 98 | 99 | #noun-search { 100 | border-radius: 5px; 101 | width: 80%; 102 | margin-left: 10%; 103 | } 104 | 105 | #search-div { 106 | padding-top: 10%; 107 | padding-bottom: 0; 108 | } 109 | 110 | .module { 111 | margin-top: 5%; 112 | margin-bottom: 5%; 113 | } 114 | -------------------------------------------------------------------------------- /src/Phosphor.Client/app/fonts/MWFMDL2.1.63.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/Phosphor/88c736ddb2ad4ce49f78b3119473f813f1f2665d/src/Phosphor.Client/app/fonts/MWFMDL2.1.63.ttf -------------------------------------------------------------------------------- /src/Phosphor.Client/app/fonts/MWFMDL2.1.63.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/Phosphor/88c736ddb2ad4ce49f78b3119473f813f1f2665d/src/Phosphor.Client/app/fonts/MWFMDL2.1.63.woff -------------------------------------------------------------------------------- /src/Phosphor.Client/app/html/collection.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | 6 | 7 |
8 | 9 | 10 |
11 | 12 | 13 | 14 |

{{currNoun}}

15 | 16 |
17 | 18 | 19 |
20 | 21 | 30 | 31 | 32 |
33 | 34 | 35 | 36 | 37 | 38 |
39 | 40 | 41 |
42 | 43 | 44 | 45 | 46 | 49 | 50 | 51 | 52 | 53 | 56 | 57 | 58 |
47 | {{header}} 48 |
54 | {{col}} 55 |
59 | 60 |
61 | 62 | 63 | 64 |
65 | -------------------------------------------------------------------------------- /src/Phosphor.Client/app/html/dashboard.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | 6 |
7 | 8 | 9 |
10 | 11 |
12 | 13 | 14 |
15 | 16 |
17 | 18 | 19 |

Details

20 | 21 |
22 | 23 |
24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
32 | 33 | 34 | {{verb}} 35 | 36 |
37 |
38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 |
47 | 48 | 53 | 54 | 55 |
56 | 57 |
58 | 59 | Select a module to begin previewing PowerShell commands. Click here to minimize. 60 | 61 |
62 | 63 | 64 | 65 |
66 | -------------------------------------------------------------------------------- /src/Phosphor.Client/app/html/detail.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 6 |
7 |
8 | 9 |
10 | 11 |
12 |
13 |

{{input}}

14 | 15 | 16 |
17 | 18 |
19 | 20 |
21 | 22 | {{switch}} 23 | 24 | 25 |
26 |
27 | 28 | 29 |
30 |
31 | 32 | 41 | 42 |
43 | 44 | 46 | 47 |
48 | 49 | 50 | 51 |
52 | < 53 | Run 54 | Exit Output 55 | PS Preview 56 | Copy to Clipboard 57 | > 58 |
59 | 60 | 61 |
62 | -------------------------------------------------------------------------------- /src/Phosphor.Client/app/html/noun.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 16 | 17 |
18 |

Modules

19 |
20 | 21 |
22 | 23 | 24 |
25 | 26 | 27 | 28 |
29 | 30 |
31 | 32 | {{module.name}} 33 | 34 | 35 | 42 | 43 | 44 |
45 | 52 |
53 | 54 | 55 |
56 | 57 | 58 | 59 | 60 | 61 |
62 | 63 | 64 |
65 | -------------------------------------------------------------------------------- /src/Phosphor.Client/app/img/psicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/Phosphor/88c736ddb2ad4ce49f78b3119473f813f1f2665d/src/Phosphor.Client/app/img/psicon.png -------------------------------------------------------------------------------- /src/Phosphor.Client/app/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrap } from '@angular/platform-browser-dynamic'; 2 | import { ROUTER_PROVIDERS } from '@angular/router-deprecated'; 3 | import { HTTP_PROVIDERS } from '@angular/http'; 4 | 5 | import { AppComponent } from './app.component'; 6 | 7 | import { NounService } from './services/noun.service'; 8 | import { VerbService } from './services/verb.service'; 9 | import { SessionService } from './services/session.service'; 10 | import { CollectionService} from './services/collection.service'; 11 | 12 | import 'rxjs/Rx'; 13 | 14 | bootstrap(AppComponent, [ 15 | ROUTER_PROVIDERS, NounService, VerbService, SessionService, CollectionService, HTTP_PROVIDERS 16 | ]); 17 | -------------------------------------------------------------------------------- /src/Phosphor.Client/app/noun.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input } from '@angular/core'; 2 | import { Router } from '@angular/router-deprecated'; 3 | 4 | import { Noun } from './util/noun'; 5 | import { NounService } from './services/noun.service'; 6 | import { VerbService } from './services/verb.service'; 7 | import { DetailComponent } from './detail.component'; 8 | 9 | @Component({ 10 | selector: 'noun-blade', 11 | templateUrl: 'app/html/noun.component.html', 12 | styleUrls: ['app/css/noun.component.css'] 13 | }) 14 | export class NounComponent implements OnInit { 15 | 16 | constructor( 17 | private router: Router, 18 | private nounService: NounService, 19 | private verbService: VerbService) { } 20 | 21 | nouns: Noun[]; 22 | modules: any; 23 | selectedModule: any; 24 | selectedNoun: string; 25 | 26 | getNouns() { 27 | this.nounService.getNouns().then(moduleInfo => { 28 | this.nouns = moduleInfo.nouns; 29 | this.modules = moduleInfo.modules; 30 | this.selectedModule = this.modules[0]; 31 | }); 32 | } 33 | 34 | ngOnInit() { 35 | this.getNouns(); 36 | } 37 | 38 | search() { 39 | //This is a bit hacky as we need casting. 40 | var criteria = (document.getElementById("noun-search")).value; 41 | this.nounService.search(criteria).then(modules => this.modules = modules); 42 | 43 | } 44 | 45 | setSelected(selectedNoun) { 46 | this.nounService.setSelected(selectedNoun); 47 | this.verbService.updateConsole("Get-" + selectedNoun.name); 48 | } 49 | 50 | selectModule(selectedModule) { 51 | this.nouns = selectedModule.nouns; 52 | this.selectedModule = selectedModule; 53 | 54 | //DOM manipulation 55 | document.getElementById("module-dropdown").innerHTML = selectedModule.name + ' '; 56 | } 57 | 58 | toggleModule(moduleName) { 59 | var moduleNouns = document.getElementById(moduleName + "-nouns"); 60 | var moduleClick = document.getElementById(moduleName + "-click"); 61 | 62 | if (moduleClick.className.includes("glyphicon-triangle-right")) { 63 | moduleClick.className = "glyphicon glyphicon-triangle-bottom"; 64 | } 65 | else { 66 | moduleClick.className = "glyphicon glyphicon-triangle-right"; 67 | } 68 | 69 | if (moduleNouns.style.display === "none") { 70 | moduleNouns.style.display = "block"; 71 | } 72 | else { 73 | moduleNouns.style.display = "none"; 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/Phosphor.Client/app/services/collection.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable, EventEmitter, OnInit } from '@angular/core'; 2 | 3 | import { MOCKNOUNS } from '../util/mock-nouns'; 4 | 5 | @Injectable() 6 | export class CollectionService { 7 | 8 | //Observer pattern below 9 | selectedItem: string; 10 | public itemSelected$: EventEmitter; 11 | public itemClicked$: EventEmitter; 12 | 13 | //Currently placed here as mock data 14 | actions = ['New', 'Tools', 'Batch']; 15 | items: string[]; 16 | rows: string[]; 17 | 18 | constructor() { 19 | this.itemSelected$ = new EventEmitter(); 20 | this.itemClicked$ = new EventEmitter(); 21 | //Grabbing to initialize first 22 | this.items = MOCKNOUNS[0].items; 23 | } 24 | 25 | getCollectionActions() { 26 | return Promise.resolve(this.actions); 27 | } 28 | 29 | //Observer pattern 30 | setSelected(item) { 31 | this.itemSelected$.emit(item); 32 | } 33 | 34 | //Called from noun service to set the items 35 | setCollection(items, rows) { 36 | this.items = items; 37 | this.rows = rows; 38 | } 39 | 40 | //This is called every keystroke to search using JavaScript's String indexOf method. 41 | search(criteria) { 42 | var result = []; 43 | 44 | for (var i = 0; i < this.rows.length; i++) { 45 | 46 | var found = false; 47 | 48 | if (this.rows[i] != null) { 49 | for (var j = 0; j < this.rows[i].length; j++) { 50 | if (this.rows[i][j].toLowerCase().indexOf(criteria.toLowerCase()) != -1) { 51 | var found = true; 52 | } 53 | } 54 | } 55 | 56 | if (found) { 57 | result.push(this.rows[i]); 58 | } 59 | 60 | } 61 | 62 | /* 63 | for (var i = 0; i < this.items.length; i++) { 64 | if (this.items[i].toLowerCase().indexOf(criteria.toLowerCase()) != -1) { 65 | result.push(this.items[i]); 66 | //console.log(this.items[i]); 67 | } 68 | } 69 | */ 70 | return Promise.resolve(result); 71 | } 72 | 73 | setItemClick(idx) { 74 | this.itemClicked$.emit(idx); 75 | } 76 | 77 | //General Algorithm for mapping verbs to images and similar verbs together 78 | 79 | //verbs[any verb] 80 | //if we have a dictionary of similar word relations that would be nice to build from 81 | //From that dictionary, we can then map images to the verbs. 82 | 83 | 84 | 85 | } 86 | -------------------------------------------------------------------------------- /src/Phosphor.Client/app/services/noun.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable, EventEmitter, OnInit } from '@angular/core'; 2 | import { Http, Response } from '@angular/http'; 3 | import {Headers, RequestOptions} from '@angular/http'; 4 | import 'rxjs/Rx'; 5 | 6 | import { Noun } from '../util/noun'; 7 | 8 | import { SessionService } from './session.service'; 9 | import { CollectionService } from './collection.service'; 10 | 11 | interface VerbJson { 12 | name: string; 13 | } 14 | 15 | interface NounJson { 16 | name: string; 17 | verbs: VerbJson[]; 18 | } 19 | 20 | interface ModuleJson { 21 | name: string; 22 | nouns: NounJson[]; 23 | } 24 | 25 | @Injectable() 26 | export class NounService { 27 | 28 | selected: Noun; 29 | nouns: any; 30 | modules: any; 31 | 32 | public nounSelected$: EventEmitter; 33 | 34 | constructor( 35 | private session: SessionService, 36 | private collectionService: CollectionService, 37 | private http: Http 38 | ) 39 | { 40 | this.nounSelected$ = new EventEmitter(); 41 | } 42 | 43 | ngOnInit() { 44 | 45 | } 46 | 47 | buildModuleInfo(modules: ModuleJson[]): any { 48 | 49 | var moduleInfo = { 50 | nouns: [], 51 | modules: [] 52 | }; 53 | 54 | var allModule = { 55 | name: "All", 56 | nouns: [] 57 | } 58 | 59 | moduleInfo.modules.push(allModule); 60 | 61 | var nounId = 0; 62 | 63 | for (var module of modules) { 64 | 65 | var moduleModel = { 66 | name: module.name, 67 | nouns: [] 68 | }; 69 | 70 | moduleInfo.modules.push(moduleModel); 71 | 72 | for (var noun of module.nouns) { 73 | 74 | var nounModel = { 75 | name: noun.name, 76 | id: nounId++, 77 | items: [], 78 | verbs: noun.verbs.map(verb => verb.name).filter(verb => verb !== "Get"), 79 | module: module.name 80 | } 81 | 82 | moduleInfo.nouns.push(nounModel); 83 | moduleModel.nouns.push(nounModel); 84 | allModule.nouns.push(nounModel); 85 | } 86 | } 87 | 88 | return moduleInfo; 89 | } 90 | 91 | getNouns() { 92 | return this.http 93 | .get(this.session.getUrlForSession('modules')) 94 | .toPromise() 95 | .then((res) => { 96 | var moduleInfo = this.buildModuleInfo(res.json()); 97 | 98 | this.modules = moduleInfo.modules; 99 | this.nouns = moduleInfo.nouns; 100 | 101 | return moduleInfo; 102 | }); 103 | } 104 | 105 | getVerbs(nounName: string) { 106 | return this.nouns.filter(noun => noun.name === nounName)[0].verbs; 107 | } 108 | 109 | //This is called every keystroke to search using JavaScript's String indexOf method. 110 | search(criteria) { 111 | var result = []; 112 | 113 | for (var i in this.modules) { 114 | var nouns = this.modules[i].nouns; 115 | 116 | for (var j = 0; j < nouns.length; j++) { 117 | if (this.modules[i].name.toLowerCase().indexOf(criteria.toLowerCase()) != -1 || nouns[j].name.toLowerCase().indexOf(criteria.toLowerCase()) != -1) { 118 | result.push(this.modules[i]); 119 | break; 120 | } 121 | } 122 | } 123 | 124 | return Promise.resolve(result); 125 | } 126 | 127 | //Observer pattern to emit noun to subscribers 128 | setSelected(noun: Noun) { 129 | this.selected = noun; 130 | this.nounSelected$.emit(noun); 131 | //this.collectionService.setCollection(noun.items); 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /src/Phosphor.Client/app/services/session.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable, EventEmitter, OnInit } from '@angular/core'; 2 | 3 | @Injectable() 4 | export class SessionService { 5 | 6 | private sessionId: number; 7 | 8 | constructor() { 9 | var splitParts = window.location.href.split('='); 10 | if (splitParts.length > 1 && splitParts[0].endsWith("session")) { 11 | this.sessionId = parseInt(splitParts[1]); 12 | } 13 | } 14 | 15 | getSessionId() { 16 | return this.sessionId; 17 | } 18 | 19 | getUrlForSession(subPath: string) { 20 | return `api/sessions/${this.sessionId}/${subPath}`; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Phosphor.Client/app/services/verb.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable, EventEmitter } from '@angular/core'; 2 | 3 | @Injectable() 4 | export class VerbService { 5 | 6 | //Mock Data 7 | verbs = ['set', 'stop', 'add', 'extend', 'modify', 'reduce', '...']; 8 | details = ['Name: ', 'DisplayName: ', 'Status: ', 'DependentServices: ', 9 | 'ServicesDependedOn: ', 'CanPauseAndContinue: ']; 10 | 11 | verbDetails: any; 12 | 13 | public currentCommand: string; 14 | 15 | public previewCommand$: EventEmitter; 16 | 17 | //Data wrapped in a Promise 18 | getVerbs() { 19 | return Promise.resolve(this.verbs); 20 | } 21 | 22 | getDetails(verb) { 23 | return Promise.resolve(this.details); 24 | } 25 | 26 | public verbDetailsSelection$: EventEmitter = new EventEmitter(); 27 | 28 | constructor( 29 | ) 30 | { 31 | this.previewCommand$ = new EventEmitter(); 32 | } 33 | 34 | setVerbDetails(verb) { 35 | this.verbDetails = verb; 36 | this.verbDetailsSelection$.emit(verb); 37 | } 38 | 39 | setPreview(command) { 40 | this.previewCommand$.emit(command); 41 | } 42 | 43 | updateConsole(command) { 44 | var old = document.getElementById("ps-command").innerHTML; 45 | 46 | document.getElementById("ps-command").innerHTML = old + '
' + "" + command + ""; 47 | 48 | //A way to quickly scroll to the bottom 49 | document.getElementById("ps-console").scrollTop = document.getElementById("ps-console").scrollHeight; 50 | } 51 | 52 | 53 | //General Algorithm for mapping verbs to images and similar verbs together 54 | 55 | //verbs[any verb] 56 | //if we have a dictionary of similar word relations that would be nice to build from 57 | //From that dictionary, we can then map images to the verbs. 58 | 59 | 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/Phosphor.Client/app/util/mock-modules.ts: -------------------------------------------------------------------------------- 1 | import { Noun } from './noun'; 2 | import { MOCKNOUNS } from './mock-nouns'; 3 | 4 | export var MOCKMODULES = []; 5 | 6 | export var all = { 7 | name: "All", 8 | nouns: MOCKNOUNS, 9 | id: 0 10 | } 11 | 12 | export var moduleA = { 13 | name: "Module A", 14 | nouns: [], 15 | id: 1 16 | }; 17 | 18 | export var moduleB = { 19 | name: "Module B", 20 | nouns: [], 21 | id: 2 22 | }; 23 | 24 | export var moduleC = { 25 | name: "Module C", 26 | nouns: [], 27 | id: 3 28 | }; 29 | 30 | for (var i = 0; i < MOCKNOUNS.length/3; i++) { 31 | moduleA.nouns.push(MOCKNOUNS[i]); 32 | } 33 | 34 | for (var i = Math.ceil(MOCKNOUNS.length / 3); i < 2 * MOCKNOUNS.length / 3; i++) { 35 | moduleB.nouns.push(MOCKNOUNS[i]); 36 | } 37 | 38 | for (var i = Math.ceil(2 * MOCKNOUNS.length / 3); i < MOCKNOUNS.length; i++) { 39 | moduleC.nouns.push(MOCKNOUNS[i]); 40 | } 41 | 42 | MOCKMODULES.push(all); 43 | MOCKMODULES.push(moduleA); 44 | MOCKMODULES.push(moduleB); 45 | MOCKMODULES.push(moduleC); 46 | -------------------------------------------------------------------------------- /src/Phosphor.Client/app/util/noun.ts: -------------------------------------------------------------------------------- 1 | export class Noun { 2 | id: number; 3 | name: string; 4 | items: string[]; 5 | } 6 | -------------------------------------------------------------------------------- /src/Phosphor.Client/electron-shell.js: -------------------------------------------------------------------------------- 1 | const electron = require('electron') 2 | const app = electron.app 3 | const BrowserWindow = electron.BrowserWindow 4 | 5 | const path = require('path') 6 | 7 | let mainWindow 8 | 9 | function createWindow () { 10 | mainWindow = new BrowserWindow({width: 800, height: 600}) 11 | 12 | mainWindow.loadURL(process.argv[2]); 13 | 14 | // mainWindow.webContents.openDevTools() 15 | 16 | mainWindow.on('closed', function () { 17 | mainWindow = null 18 | }) 19 | } 20 | 21 | app.on('ready', createWindow) 22 | 23 | app.on('window-all-closed', function () { 24 | if (process.platform !== 'darwin') { 25 | app.quit() 26 | } 27 | }) 28 | 29 | app.on('activate', function () { 30 | if (mainWindow === null) { 31 | createWindow() 32 | } 33 | }) 34 | -------------------------------------------------------------------------------- /src/Phosphor.Client/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Phosphor 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 39 | 40 | 41 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | Loading... 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/Phosphor.Client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "phosphor-client", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ", 7 | "lite": "lite-server", 8 | "postinstall": "typings install", 9 | "tsc": "tsc", 10 | "tsc:w": "tsc -w", 11 | "typings": "typings" 12 | }, 13 | "license": "ISC", 14 | "dependencies": { 15 | "@angular/common": "2.0.0-rc.1", 16 | "@angular/compiler": "2.0.0-rc.1", 17 | "@angular/core": "2.0.0-rc.1", 18 | "@angular/http": "2.0.0-rc.1", 19 | "@angular/platform-browser": "2.0.0-rc.1", 20 | "@angular/platform-browser-dynamic": "2.0.0-rc.1", 21 | "@angular/router": "2.0.0-rc.1", 22 | "@angular/router-deprecated": "2.0.0-rc.1", 23 | "@angular/upgrade": "2.0.0-rc.1", 24 | "systemjs": "0.19.27", 25 | "core-js": "^2.4.0", 26 | "reflect-metadata": "^0.1.3", 27 | "rxjs": "5.0.0-beta.6", 28 | "zone.js": "^0.6.12", 29 | "angular2-in-memory-web-api": "0.0.11", 30 | "bootstrap": "^3.3.6" 31 | }, 32 | "devDependencies": { 33 | "concurrently": "^2.0.0", 34 | "electron": "^1.6.2", 35 | "lite-server": "^2.2.0", 36 | "typescript": "^2.0.0", 37 | "typings": "^1.0.4" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Phosphor.Client/styles.css: -------------------------------------------------------------------------------- 1 | h2 { 2 | color: #444; 3 | font-family: "SegoeUI", Arial, Helvetica, sans-serif; 4 | font-weight: lighter; 5 | } 6 | body { 7 | margin: 0; 8 | } 9 | body, input[text], button { 10 | color: #888; 11 | font-family: "SegoeUI", Cambria, Georgia; 12 | } 13 | button { 14 | font-family: "SegoeUI", Arial; 15 | background-color: #eee; 16 | border: none; 17 | padding: 5px 10px; 18 | border-radius: 4px; 19 | cursor: pointer; 20 | cursor: hand; 21 | } 22 | button:hover { 23 | background-color: #cfd8dc; 24 | } 25 | button:disabled { 26 | background-color: #eee; 27 | color: #aaa; 28 | cursor: auto; 29 | } 30 | /* everywhere else */ 31 | * { 32 | font-family: "SegoeUI", Arial, Helvetica, sans-serif; 33 | } 34 | 35 | /* Hacky fix for search */ 36 | .btn { 37 | margin-top: 0; 38 | } 39 | 40 | input.c-text-field[type=text], input.form-control { 41 | margin-top: 0; 42 | } 43 | 44 | input[type=checkbox] 45 | { 46 | -webkit-appearance:checkbox; 47 | } 48 | -------------------------------------------------------------------------------- /src/Phosphor.Client/systemjs.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * System configuration for Angular 2 samples 3 | * Adjust as necessary for your application needs. 4 | */ 5 | (function(global) { 6 | 7 | // map tells the System loader where to look for things 8 | var map = { 9 | 'app': 'app', // 'dist', 10 | 11 | '@angular': 'node_modules/@angular', 12 | 'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api', 13 | 'rxjs': 'node_modules/rxjs' 14 | }; 15 | 16 | // packages tells the System loader how to load when no filename and/or no extension 17 | var packages = { 18 | 'app': { main: 'main.js', defaultExtension: 'js' }, 19 | 'rxjs': { defaultExtension: 'js' }, 20 | 'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' }, 21 | }; 22 | 23 | var ngPackageNames = [ 24 | 'common', 25 | 'compiler', 26 | 'core', 27 | 'http', 28 | 'platform-browser', 29 | 'platform-browser-dynamic', 30 | 'router', 31 | 'router-deprecated', 32 | 'upgrade', 33 | ]; 34 | 35 | // Individual files (~300 requests): 36 | function packIndex(pkgName) { 37 | packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' }; 38 | } 39 | 40 | // Bundled (~40 requests): 41 | function packUmd(pkgName) { 42 | packages['@angular/'+pkgName] = { main: pkgName + '.umd.js', defaultExtension: 'js' }; 43 | }; 44 | 45 | // Most environments should use UMD; some (Karma) need the individual index files 46 | var setPackageConfig = System.packageWithIndex ? packIndex : packUmd; 47 | 48 | // Add package entries for angular packages 49 | ngPackageNames.forEach(setPackageConfig); 50 | 51 | var config = { 52 | map: map, 53 | packages: packages 54 | } 55 | 56 | System.config(config); 57 | 58 | })(this); 59 | -------------------------------------------------------------------------------- /src/Phosphor.Client/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160317120654", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160505161446", 5 | "node": "registry:dt/node#4.0.0+20160509154515" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Phosphor.Client/typings/globals/core-js/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/core-js/core-js.d.ts", 5 | "raw": "registry:dt/core-js#0.0.0+20160317120654", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/core-js/core-js.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Phosphor.Client/typings/globals/jasmine/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/36a1be34dbe202c665b3ddafd50824f78c09eea3/jasmine/jasmine.d.ts", 5 | "raw": "registry:dt/jasmine#2.2.0+20160505161446", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/36a1be34dbe202c665b3ddafd50824f78c09eea3/jasmine/jasmine.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Phosphor.Client/typings/globals/node/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/6d0e826824da52204c1c93f92cecbc961ac84fa9/node/node.d.ts", 5 | "raw": "registry:dt/node#4.0.0+20160509154515", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/6d0e826824da52204c1c93f92cecbc961ac84fa9/node/node.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Phosphor.Client/typings/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | -------------------------------------------------------------------------------- /src/Phosphor/Cmdlets/ShowModuleCmdlet.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft. All rights reserved. 3 | // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. 4 | // 5 | 6 | using System.Diagnostics; 7 | using System.Management.Automation; 8 | using System.Runtime.InteropServices; 9 | using Microsoft.PowerShell.Phosphor.Model; 10 | 11 | namespace Microsoft.PowerShell.Phosphor 12 | { 13 | [Cmdlet(VerbsCommon.Show, "Module")] 14 | public class ShowModuleCmdlet : PSCmdlet 15 | { 16 | private PhosphorSession currentSession; 17 | 18 | [Parameter] 19 | public string[] Module { get; set; } 20 | 21 | [Parameter] 22 | [Alias("OpenInBrowser")] 23 | public SwitchParameter ShowInBrowser { get; set; } 24 | 25 | protected override void ProcessRecord() 26 | { 27 | var getCommandScript = 28 | this.Module != null 29 | ? $"Get-Command -Module {string.Join(", ", this.Module)}" 30 | : "Get-Command"; 31 | 32 | var commandList = this.InvokeCommand.InvokeScript(getCommandScript, true); 33 | 34 | this.currentSession = 35 | SessionManager.Current.StartSession( 36 | new ModuleViewModel(commandList)); 37 | 38 | if (this.ShowInBrowser.IsPresent) 39 | { 40 | Process browserProcess = new Process(); 41 | if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) 42 | { 43 | browserProcess.StartInfo.FileName = "xdg-open"; 44 | browserProcess.StartInfo.Arguments = this.currentSession.Uri.AbsoluteUri; 45 | } 46 | else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) 47 | { 48 | browserProcess.StartInfo.FileName = "open"; 49 | browserProcess.StartInfo.Arguments = this.currentSession.Uri.AbsoluteUri; 50 | } 51 | else 52 | { 53 | // TODO: This won't work on Windows when running in CoreCLR. See this 54 | // code in PowerShell Core: 55 | // https://github.com/PowerShell/PowerShell/blob/7f83c48ca5e39bc98dbb9071d414bd02166cd4af/src/System.Management.Automation/engine/Utils.cs#L1608 56 | browserProcess.StartInfo.FileName = this.currentSession.Uri.AbsoluteUri; 57 | } 58 | 59 | browserProcess.Start(); 60 | } 61 | else 62 | { 63 | string exePath = null; 64 | string urlArgument = this.currentSession.Uri.AbsoluteUri; 65 | 66 | if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) 67 | { 68 | exePath = GetElectronPath("electron"); 69 | } 70 | else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) 71 | { 72 | exePath = GetElectronPath("Electron.app"); 73 | } 74 | else 75 | { 76 | exePath = GetElectronPath("electron.exe"); 77 | } 78 | 79 | Process electronProcess = new Process(); 80 | electronProcess.StartInfo.FileName = exePath; 81 | electronProcess.StartInfo.Arguments = 82 | this.currentSession.GetClientPath("electron-shell.js") 83 | + " " + this.currentSession.Uri.AbsoluteUri; 84 | 85 | electronProcess.Start(); 86 | } 87 | } 88 | 89 | private string GetElectronPath(string electronExeName) 90 | { 91 | return 92 | this.currentSession.GetClientPath( 93 | "node_modules/electron/dist/" + electronExeName); 94 | } 95 | } 96 | } -------------------------------------------------------------------------------- /src/Phosphor/Cmdlets/StartPhosphorSessionCmdlet.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft. All rights reserved. 3 | // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. 4 | // 5 | 6 | using System.Management.Automation; 7 | using Microsoft.PowerShell.Phosphor.Model; 8 | 9 | namespace Microsoft.PowerShell.Phosphor 10 | { 11 | [Cmdlet(VerbsLifecycle.Start, "PhosphorSession")] 12 | public class StartPhosphorSessionCmdlet : Cmdlet 13 | { 14 | [ValidateNotNull] 15 | public ModelBase Model { get; set; } 16 | 17 | protected override void ProcessRecord() 18 | { 19 | this.WriteObject( 20 | SessionManager.Current.StartSession( 21 | this.Model)); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Phosphor/Controllers/SessionsController.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft. All rights reserved. 3 | // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. 4 | // 5 | 6 | using System.Collections.Generic; 7 | using Microsoft.AspNetCore.Mvc; 8 | 9 | namespace Microsoft.PowerShell.Phosphor 10 | { 11 | [Route("api/[controller]")] 12 | public class SessionsController : Controller 13 | { 14 | // GET api/sessions 15 | [HttpGet] 16 | public IEnumerable Get() 17 | { 18 | return SessionManager.Current.Sessions; 19 | } 20 | 21 | // GET api/sessions/5 22 | [HttpGet("{id}")] 23 | public PhosphorSession Get(int id) 24 | { 25 | return SessionManager.Current.GetSession(id); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Phosphor/Model/ModelBase.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft. All rights reserved. 3 | // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. 4 | // 5 | 6 | using Newtonsoft.Json; 7 | using Newtonsoft.Json.Converters; 8 | 9 | namespace Microsoft.PowerShell.Phosphor.Model 10 | { 11 | [JsonConverter(typeof(StringEnumConverter))] 12 | public enum ModelType 13 | { 14 | ModuleView, 15 | } 16 | 17 | public class ModelBase 18 | { 19 | public ModelType Type { get; private set; } 20 | 21 | public ModelBase(ModelType modelType) 22 | { 23 | this.Type = modelType; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /src/Phosphor/Phosphor.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net451;netstandard1.6 5 | $(PackageTargetFallback);dnxcore50;portable-net45+win8 6 | Library 7 | portable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/Phosphor/Phosphor.psd1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/Phosphor/88c736ddb2ad4ce49f78b3119473f813f1f2665d/src/Phosphor/Phosphor.psd1 -------------------------------------------------------------------------------- /src/Phosphor/Phosphor.psm1: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) Microsoft. All rights reserved. 3 | # Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. 4 | # 5 | 6 | if (!$PSVersionTable.PSEdition -or $PSVersionTable.PSEdition -eq "Desktop") { 7 | Import-Module -Name "$PSScriptRoot/bin/Debug/net451/publish/Phosphor.dll" | Out-Null 8 | } 9 | else { 10 | Import-Module -Name "$PSScriptRoot/bin/Debug/netstandard1.6/publish/Phosphor.dll" | Out-Null 11 | } 12 | -------------------------------------------------------------------------------- /src/Phosphor/Server/PhosphorServer.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft. All rights reserved. 3 | // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. 4 | // 5 | 6 | using System; 7 | using System.IO; 8 | using System.Reflection; 9 | using Microsoft.AspNetCore.Hosting; 10 | 11 | #if NETSTANDARD1_6 12 | using System.Runtime.Loader; 13 | #endif 14 | 15 | namespace Microsoft.PowerShell.Phosphor 16 | { 17 | public class PhosphorServer 18 | { 19 | private IWebHost host; 20 | 21 | private string assemblyBasePath; 22 | 23 | public bool IsStarted { get; private set; } 24 | 25 | public Uri ServerBaseUri { get; private set; } 26 | 27 | public void Start() 28 | { 29 | this.assemblyBasePath = Path.GetDirectoryName(this.GetType().GetTypeInfo().Assembly.Location); 30 | 31 | var clientPath = 32 | Path.GetFullPath( 33 | Path.Combine( 34 | Path.GetDirectoryName(this.GetType().GetTypeInfo().Assembly.Location), 35 | "../../../../../Phosphor.Client/")); 36 | 37 | #if NETSTANDARD1_6 38 | AssemblyLoadContext.Default.Resolving += this.OnAssemblyResolve; 39 | #elif NET451 40 | AppDomain.CurrentDomain.AssemblyResolve += this.OnAssemblyResolve; 41 | #endif 42 | 43 | this.ServerBaseUri = new Uri("http://localhost:5001"); 44 | 45 | this.host = new WebHostBuilder() 46 | #if NETSTANDARD1_6 47 | .UseKestrel() 48 | #elif NET451 49 | .UseWebListener() 50 | #endif 51 | .UseContentRoot(clientPath) 52 | .UseSetting("detailedErrors", "true") 53 | .UseStartup() 54 | .CaptureStartupErrors(true) 55 | .UseUrls(this.ServerBaseUri.AbsoluteUri) 56 | .Build(); 57 | 58 | this.host.Start(); 59 | 60 | this.IsStarted = true; 61 | } 62 | 63 | public void Stop() 64 | { 65 | if (this.IsStarted && this.host != null) 66 | { 67 | this.IsStarted = false; 68 | this.host.Dispose(); 69 | } 70 | } 71 | 72 | #if NETSTANDARD1_6 73 | private Assembly OnAssemblyResolve(AssemblyLoadContext assemblyLoadContext, AssemblyName assemblyName) 74 | { 75 | string assemblyNameString = assemblyName.Name; 76 | #elif NET451 77 | private Assembly OnAssemblyResolve(object sender, ResolveEventArgs args) 78 | { 79 | string assemblyNameString = args.Name; 80 | #endif 81 | try 82 | { 83 | if (assemblyNameString.StartsWith("Phosphor")) 84 | { 85 | return this.GetType().GetTypeInfo().Assembly; 86 | } 87 | else 88 | { 89 | // Console.WriteLine("Looking for assembly: " + assemblyName.Name); 90 | 91 | // return 92 | // assemblyLoadContext.LoadFromAssemblyPath( 93 | // Path.Combine( 94 | // this.assemblyBasePath, 95 | // assemblyName.Name + ".dll")); 96 | } 97 | } 98 | catch (Exception e) 99 | { 100 | Console.WriteLine($"Exception while loading assembly {assemblyNameString}:\n\n{e.ToString()}"); 101 | } 102 | 103 | return null; 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /src/Phosphor/Server/PhosphorServerStartup.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft. All rights reserved. 3 | // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. 4 | // 5 | 6 | using System.IO; 7 | using System.Reflection; 8 | using Microsoft.AspNetCore.Builder; 9 | using Microsoft.AspNetCore.Hosting; 10 | using Microsoft.AspNetCore.Http; 11 | using Microsoft.Extensions.Configuration; 12 | using Microsoft.Extensions.DependencyInjection; 13 | using Microsoft.Extensions.FileProviders; 14 | using Microsoft.Extensions.Logging; 15 | 16 | namespace Microsoft.PowerShell.Phosphor 17 | { 18 | internal class PhosphorServerStartup 19 | { 20 | public IConfigurationRoot Configuration { get; } 21 | 22 | public PhosphorServerStartup(IHostingEnvironment env) 23 | { 24 | 25 | var builder = 26 | new ConfigurationBuilder() 27 | .AddEnvironmentVariables(); 28 | 29 | Configuration = builder.Build(); 30 | } 31 | 32 | public void ConfigureServices(IServiceCollection services) 33 | { 34 | services.AddDirectoryBrowser(); 35 | services.AddMvc(); 36 | } 37 | 38 | public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) 39 | { 40 | loggerFactory.AddDebug(LogLevel.Trace); 41 | 42 | var clientPath = 43 | Path.GetFullPath( 44 | Path.Combine( 45 | Path.GetDirectoryName(this.GetType().GetTypeInfo().Assembly.Location), 46 | "../../../../../Phosphor.Client/")); 47 | 48 | app.UseFileServer(new FileServerOptions() 49 | { 50 | FileProvider = new PhysicalFileProvider(clientPath), 51 | RequestPath = new PathString(""), 52 | EnableDirectoryBrowsing = true 53 | }); 54 | 55 | app.UseMvc(); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/Phosphor/Session/PhosphorSession.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft. All rights reserved. 3 | // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. 4 | // 5 | 6 | using System; 7 | using System.IO; 8 | using System.Reflection; 9 | using Microsoft.PowerShell.Phosphor.Model; 10 | 11 | namespace Microsoft.PowerShell.Phosphor 12 | { 13 | public class PhosphorSession 14 | { 15 | private static string ClientPath; 16 | 17 | public int Id { get; private set; } 18 | 19 | public Uri Uri { get; private set; } 20 | 21 | public ModelBase Model { get; private set; } 22 | 23 | public PhosphorSession( 24 | int sessionId, 25 | Uri serverBaseUri, 26 | ModelBase model) 27 | { 28 | this.Id = sessionId; 29 | this.Uri = new Uri(serverBaseUri, $"?session={sessionId}"); 30 | this.Model = model; 31 | } 32 | 33 | public string GetClientPath(string subPath = "") 34 | { 35 | if (ClientPath == null) 36 | { 37 | ClientPath = 38 | Path.GetFullPath( 39 | Path.Combine( 40 | Path.GetDirectoryName(this.GetType().GetTypeInfo().Assembly.Location), 41 | "../../../../../Phosphor.Client/")); 42 | } 43 | 44 | return $"\"{Path.Combine(ClientPath, subPath)}\""; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Phosphor/Session/SessionManager.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft. All rights reserved. 3 | // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. 4 | // 5 | 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using Microsoft.PowerShell.Phosphor.Model; 9 | 10 | namespace Microsoft.PowerShell.Phosphor 11 | { 12 | public class SessionManager 13 | { 14 | #region Private Fields 15 | 16 | private PhosphorServer phosphorServer; 17 | private List sessionList = new List(); 18 | 19 | private static SessionManager currentInstance; 20 | 21 | #endregion 22 | 23 | #region Public Properties 24 | 25 | public static SessionManager Current 26 | { 27 | get 28 | { 29 | if (currentInstance == null) 30 | { 31 | currentInstance = new SessionManager(); 32 | } 33 | 34 | return currentInstance; 35 | } 36 | set 37 | { 38 | currentInstance = value; 39 | } 40 | } 41 | 42 | public IEnumerable Sessions => this.sessionList.Where(s => s != null); 43 | 44 | #endregion 45 | 46 | #region Public Methods 47 | 48 | public PhosphorSession StartSession(ModelBase sessionModel) 49 | { 50 | if (this.phosphorServer == null) 51 | { 52 | this.phosphorServer = new PhosphorServer(); 53 | this.phosphorServer.Start(); 54 | } 55 | 56 | PhosphorSession newSession = 57 | new PhosphorSession( 58 | this.sessionList.Count + 1, 59 | this.phosphorServer.ServerBaseUri, 60 | sessionModel); 61 | 62 | this.sessionList.Add(newSession); 63 | 64 | return newSession; 65 | } 66 | 67 | public void StopSession(PhosphorSession phosphorSession) 68 | { 69 | this.sessionList[phosphorSession.Id - 1] = null; 70 | } 71 | 72 | public PhosphorSession GetSession(int sessionId) 73 | { 74 | return this.sessionList[sessionId - 1]; 75 | } 76 | 77 | #endregion 78 | } 79 | } --------------------------------------------------------------------------------