-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from fleetbase/dev-v0.0.3
Dev v0.0.3
- Loading branch information
Showing
20 changed files
with
420 additions
and
381 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,16 @@ | ||
<ContentPanel @title="Registry Configuration" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800"> | ||
<InputGroup @name="Registry Host" @value={{this.registryHost}} disabled={{or this.getConfigValues.isRunning this.saveConfigValues.isRunning}} /> | ||
<InputGroup @name="Registry Token" @value={{this.registryToken}} disabled={{or this.getConfigValues.isRunning this.saveConfigValues.isRunning}} /> | ||
</ContentPanel> | ||
<EmberWormhole @to="next-view-section-subheader-actions"> | ||
<Button | ||
@type="primary" | ||
@size="sm" | ||
@icon="save" | ||
@text="Save Changes" | ||
@onClick={{perform this.saveConfigValues}} | ||
@disabled={{or this.getConfigValues.isRunning this.saveConfigValues.isRunning}} | ||
@isLoading={{this.saveConfigValues.isRunning}} | ||
/> | ||
</EmberWormhole> | ||
<Spacer @height="400px" /> |
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,36 @@ | ||
import Component from '@glimmer/component'; | ||
import { inject as service } from '@ember/service'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import { task } from 'ember-concurrency'; | ||
|
||
export default class RegistryAdminConfigComponent extends Component { | ||
@service fetch; | ||
@service notifications; | ||
@tracked registryHost; | ||
@tracked registryToken; | ||
|
||
constructor() { | ||
super(...arguments); | ||
this.getConfigValues.perform(); | ||
} | ||
|
||
@task *getConfigValues() { | ||
try { | ||
const { host, token } = yield this.fetch.get('registry-extensions/config', {}, { namespace: '~registry/v1' }); | ||
this.registryHost = host; | ||
this.registryToken = token; | ||
} catch (error) { | ||
this.notifications.serverError(error); | ||
} | ||
} | ||
|
||
@task *saveConfigValues() { | ||
try { | ||
const { host, token } = yield this.fetch.post('registry-extensions/config', { host: this.registryHost, token: this.registryToken }, { namespace: '~registry/v1' }); | ||
this.registryHost = host; | ||
this.registryToken = token; | ||
} catch (error) { | ||
this.notifications.serverError(error); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from '@fleetbase/registry-bridge-engine/components/registry-admin-config'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.