forked from emberjs/ember-inspector
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP: Found CLI config object in same object providing info for libraries tab * Add app config tab to Info * Make requested changes from PR comments * Update app/routes/app-config.js * Update app/routes/app-config.js * Update app/routes/app-config.js Co-authored-by: Robert Wagner <[email protected]>
- Loading branch information
Showing
7 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { computed } from '@ember/object'; | ||
import Controller from '@ember/controller'; | ||
|
||
export default class AppConfigController extends Controller { | ||
get columns() { | ||
return [ | ||
{ name: 'Key', valuePath: 'key' }, | ||
{ name: 'Value', valuePath: 'value' }, | ||
]; | ||
} | ||
|
||
@computed('model') | ||
get rows() { | ||
return Object.entries(this.get('model')).map(([key, value]) => { | ||
const obj = { key, value }; | ||
if (typeof obj.value === 'object') { | ||
obj.value = JSON.stringify(obj.value, null, 2); | ||
} | ||
return obj; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import TabRoute from 'ember-inspector/routes/tab'; | ||
|
||
export default TabRoute.extend({ | ||
model() { | ||
const port = this.port; | ||
return new Promise((resolve) => { | ||
port.one('general:emberCliConfig', (message) => { | ||
resolve(message.emberCliConfig); | ||
}); | ||
port.send('general:getEmberCliConfig'); | ||
}); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<EmberTable as |t|> | ||
<t.head @columns={{columns}} @enableReorder={{false}} /> | ||
|
||
<t.body @rows={{rows}} as |b|> | ||
<b.row | ||
class={{ | ||
concat "js-config-row" (if (mod b.rowMeta.index 2) " striped") | ||
}} as |r| | ||
> | ||
<r.cell class={{concat "js-config-" r.columnValue.valuePath}} as |value|> | ||
{{value}} | ||
</r.cell> | ||
</b.row> | ||
</t.body> | ||
</EmberTable> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters