This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
26 additions
and
4 deletions.
There are no files selected for viewing
23 changes: 19 additions & 4 deletions
23
ui/app/routes/workspace/projects/project/settings/config-variables.ts
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 |
---|---|---|
@@ -1,7 +1,22 @@ | ||
import Route from '@ember/routing/route'; | ||
import { inject as service } from '@ember/service'; | ||
import ApiService from 'waypoint/services/api'; | ||
import { ConfigGetRequest, Ref } from 'waypoint-pb'; | ||
|
||
export default class WorkspaceProjectsProjectSettingsConfigVariables extends Route.extend({ | ||
// anything which *must* be merged to prototype here | ||
}) { | ||
// normal class body definition here | ||
interface ProjectModelParams { | ||
project_id: string; | ||
} | ||
export default class WorkspaceProjectsProjectSettingsConfigVariables extends Route { | ||
@service api!: ApiService; | ||
|
||
async model() { | ||
let ref = new Ref.Project(); | ||
let params = this.paramsFor('workspace.projects.project') as ProjectModelParams; | ||
ref.setProject(params.project_id); | ||
let req = new ConfigGetRequest(); | ||
req.setProject(ref); | ||
|
||
let config = await this.api.client.getConfig(req, this.api.WithMeta()); | ||
return config?.toObject(); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
ui/app/templates/workspace/projects/project/settings/config-variables.hbs
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 |
---|---|---|
@@ -1 +1,8 @@ | ||
<h3>Config Variables</h3> | ||
{{#if this.model.variablesList.length}} | ||
<ul> | ||
{{#each this.model.variablesList as |variable|}} | ||
<li>{{variable.name}} | {{variable.pb_static}}</li> | ||
{{/each}} | ||
</ul> | ||
{{/if}} |