-
Notifications
You must be signed in to change notification settings - Fork 2
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.2
v0.0.2
- Loading branch information
Showing
39 changed files
with
3,983 additions
and
1,424 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'], | ||
extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'], | ||
}; |
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,19 @@ | ||
{{#if this.configLoaded}} | ||
<ContentPanel @title="Solid Server Config" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800 mb-4"> | ||
<InputGroup @name="Server Host" @value={{this.host}} @placeholder="solid.myserver.com" /> | ||
<InputGroup @name="Server Port" @value={{this.port}} @placeholder="3000" /> | ||
<InputGroup> | ||
<Toggle @isToggled={{this.secure}} @onToggle={{fn (mut this.secure)}}> | ||
<span class="dark:text-gray-100 text-sm ml-2">Secure Server</span> | ||
</Toggle> | ||
</InputGroup> | ||
</ContentPanel> | ||
|
||
<div class="mt-3 flex items-center justify-end"> | ||
<Button @type="primary" @size="lg" @icon="save" @text={{t "common.save-changes"}} @onClick={{perform this.saveServerConfig}} @disabled={{not this.saveServerConfig.isIdle}} @isLoading={{not this.saveServerConfig.isIdle}} /> | ||
</div> | ||
{{else}} | ||
<div class="flex items-center justify-center"> | ||
<Spinner @loadingMessage="Loading server config..." /> | ||
</div> | ||
{{/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import Component from '@glimmer/component'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import { inject as service } from '@ember/service'; | ||
import { task } from 'ember-concurrency'; | ||
|
||
export default class AdminSolidServerConfigComponent extends Component { | ||
@service fetch; | ||
@service notifications; | ||
@tracked configLoaded = false; | ||
@tracked host; | ||
@tracked port; | ||
@tracked secure; | ||
|
||
constructor() { | ||
super(...arguments); | ||
this.loadServerConfig.perform(); | ||
} | ||
|
||
getConfig() { | ||
return { | ||
host: this.host, | ||
port: this.port, | ||
secure: this.secure, | ||
}; | ||
} | ||
|
||
setConfig(config) { | ||
this.host = config.host; | ||
this.port = config.port; | ||
this.secure = config.secure; | ||
} | ||
|
||
@task *loadServerConfig() { | ||
const config = yield this.fetch.get('server-config', {}, { namespace: 'solid/int/v1' }); | ||
if (config) { | ||
this.setConfig(config); | ||
this.configLoaded = true; | ||
} | ||
} | ||
|
||
@task *saveServerConfig() { | ||
try { | ||
const config = yield this.fetch.post('server-config', { server: this.getConfig() }, { namespace: 'solid/int/v1' }); | ||
if (config) { | ||
this.setConfig(config); | ||
this.notifications.success('Solid server config udpated successfully.'); | ||
} | ||
} 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<svg width={{this.width}} height={{this.height}} viewBox="0 0 352 322" xmlns="http://www.w3.org/2000/svg"> | ||
<g fill-rule="nonzero" fill="none"> | ||
<path d="M87.97296 282.3527L27.24133 177.02207c-5.62041-9.75765-5.62041-21.77908 0-31.53674L87.97296 40.2328c5.64643-9.78367 16.08061-15.79439 27.32143-15.79439h121.3852c11.26684 0 21.72704 6.01072 27.32143 15.7944l60.75765 105.30458c5.62041 9.75766 5.62041 21.77909 0 31.53674l-60.73163 105.33061c-5.64643 9.78367-16.08061 15.79439-27.32143 15.79439H115.37245c-11.31888-.05204-21.72704-6.08878-27.3995-15.84643z" fill="#111827" /> | ||
<path d="M93.15102 275.19708l-57.1148-99.0597c-5.30816-9.1852-5.30816-20.50408 0-29.66326l57.1148-99.08572c5.33418-9.21122 15.14388-14.85765 25.73418-14.85765h114.2296c10.5903 0 20.42602 5.64643 25.73418 14.85765l57.16684 99.03368c5.30816 9.1852 5.30816 20.50408 0 29.66326L258.875 275.2231c-5.33418 9.21122-15.14388 14.85765-25.73418 14.85765H118.93724c-10.64234 0-20.45204-5.67245-25.78622-14.88367z" fill="#7C4DFF" /> | ||
<path d="M118.46888 142.2328h117.53418c1.48316 0 2.65408-1.19695 2.65408-2.65409v-22.03928c0-14.6495-11.89132-26.54085-26.54081-26.54085h-70.56735c-20.5301-.026-37.15722 16.60105-37.15722 37.13115-.02594 7.83214 6.271 14.10306 14.07712 14.10306zM129.99592 239.60116H200.225c21.20663 0 38.43214-17.22551 38.43214-38.43214 0-7.07755-5.72449-12.82806-12.82806-12.82806H106.94184c-1.45715 0-2.55005 1.17091-2.55005 2.55v23.05408c-.02597 14.18112 11.47505 25.65612 25.60413 25.65612z" fill="#F7F7F7" /> | ||
<path d="M109.59592 139.3185l87.66275 87.66276c5.80255 5.80255 15.19592 5.80255 20.99847 0l15.19592-15.19592c5.80255-5.80255 5.80255-15.19591 0-20.99847l-87.63673-87.66275c-5.80255-5.80255-15.19592-5.80255-20.99847 0l-15.19592 15.19592c-5.8546 5.80255-5.8546 15.22194-.02602 20.99847z" fill="#F7F7F7" /> | ||
<path fill="#444" opacity=".3" d="M198.6898 228.46443l-51.4944-40.12347h11.39695zM144.35918 101.66698l40.56582 40.56581h13.7648z" /> | ||
</g> | ||
</svg> |
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 Component from '@glimmer/component'; | ||
import { tracked } from '@glimmer/tracking'; | ||
|
||
export default class SolidBrandIconComponent extends Component { | ||
@tracked width = 19; | ||
@tracked height = 19; | ||
constructor(owner, { options }) { | ||
super(...arguments); | ||
const { width = 19, height = 19 } = options || {}; | ||
this.width = width; | ||
this.height = height; | ||
} | ||
} |
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,27 @@ | ||
import Controller from '@ember/controller'; | ||
import { inject as service } from '@ember/service'; | ||
import { task } from 'ember-concurrency'; | ||
|
||
export default class ApplicationController extends Controller { | ||
@service universe; | ||
@service fetch; | ||
|
||
constructor() { | ||
super(...arguments); | ||
this.universe.on('sidebarContext.available', (sidebarContext) => { | ||
sidebarContext.hideNow(); | ||
}); | ||
} | ||
|
||
@task *authenticate() { | ||
const { authenticationUrl, identifier } = yield this.fetch.get('request-authentication', {}, { namespace: 'solid/int/v1' }); | ||
if (authenticationUrl) { | ||
window.location.href = `${authenticationUrl}/${identifier}`; | ||
} | ||
} | ||
|
||
@task *getAccountIndex() { | ||
const response = yield this.fetch.get('account', {}, { namespace: 'solid/int/v1' }); | ||
console.log('[response]', response); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import buildRoutes from 'ember-engines/routes'; | ||
|
||
export default buildRoutes(); | ||
export default buildRoutes(function () {}); |
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,14 @@ | ||
import Route from '@ember/routing/route'; | ||
import getWithDefault from '@fleetbase/ember-core/utils/get-with-default'; | ||
import { inject as service } from '@ember/service'; | ||
|
||
export default class ApplicationRoute extends Route { | ||
@service notifications; | ||
|
||
beforeModel(transition) { | ||
const queryParams = getWithDefault(transition, 'router._lastQueryParams', {}); | ||
if (queryParams.error) { | ||
this.notifications.error(queryParams.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.solid-fleetbase-home-container { | ||
margin: auto; | ||
width: 1200px; | ||
padding: 2rem; | ||
} | ||
|
||
.solid-fleetbase-home-container h1 { | ||
font-size: 1.5rem; | ||
font-weight: 600; | ||
margin-bottom: 0.75rem; | ||
} | ||
|
||
.solid-fleetbase-home-container h2 { | ||
font-size: 1.25rem; | ||
font-weight: 500; | ||
margin-bottom: 0.75rem; | ||
} | ||
|
||
body[data-theme='light'] .solid-fleetbase-home-container a:not([class*='text-']), | ||
body[data-theme='dark'] .solid-fleetbase-home-container a:not([class*='text-']), | ||
.solid-fleetbase-home-container a { | ||
color: #60a5fa; | ||
text-decoration: underline; | ||
text-decoration-line: underline; | ||
} | ||
|
||
.solid-fleetbase-home-container a:hover { | ||
opacity: 0.5; | ||
} |
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 @@ | ||
<Layout::Section::Container class="solid-fleetbase-home"> | ||
<Layout::Section::Header @title="Solid for Fleetbase" /> | ||
|
||
<Layout::Section::Body class="solid-fleetbase-home-container"> | ||
<h1>Welcome to Solid for Fleetbase</h1> | ||
<h2>Getting Started</h2> | ||
<div class="mt-2"> | ||
<p> | ||
<a href="#" {{on "click" (perform this.authenticate)}}>Sign up for an account</a> to get started with your own Pod and WebID. Once you are logged in you can begin to manage your pods and sync data directly from Fleetbase to your Pods. | ||
</p> | ||
</div> | ||
{{!-- <Button @text="Click to Test" @icon="magic" @onClick={{perform this.getAccountIndex}} @wrapperClass="mt-4" /> --}} | ||
</Layout::Section::Body> | ||
{{outlet}} | ||
</Layout::Section::Container> |
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/solid-engine/components/admin/solid-server-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from '@fleetbase/solid-engine/components/solid-brand-icon'; |
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/solid-engine/controllers/application'; |
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/solid-engine/routes/application'; |
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.