-
-
Notifications
You must be signed in to change notification settings - Fork 245
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
13 changed files
with
246 additions
and
20 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
bundles/org.openhab.ui.basic/src/main/resources/OH-INF/addon/addon.xml
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 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<addon:addon id="basicui" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:addon="https://openhab.org/schemas/addon/v1.0.0" | ||
xsi:schemaLocation="https://openhab.org/schemas/addon/v1.0.0 https://openhab.org/schemas/addon-1.0.0.xsd"> | ||
|
||
<type>ui</type> | ||
<name>Basic UI</name> | ||
<description>This is the openHAB Basic UI.</description> | ||
|
||
<service-id>org.openhab.basicui</service-id> | ||
|
||
<config-description-ref uri="ui:basic"/> | ||
|
||
</addon:addon> |
10 changes: 10 additions & 0 deletions
10
bundles/org.openhab.ui.cometvisu.php/src/main/resources/OH-INF/addon/addon.xml
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,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<addon:addon id="cometvisu-php" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:addon="https://openhab.org/schemas/addon/v1.0.0" | ||
xsi:schemaLocation="https://openhab.org/schemas/addon/v1.0.0 https://openhab.org/schemas/addon-1.0.0.xsd"> | ||
|
||
<type>ui</type> | ||
<name>CometVisu PHP Extension</name> | ||
<description>This is the PHP Extension for the CometVisu backend.</description> | ||
|
||
</addon:addon> |
14 changes: 14 additions & 0 deletions
14
bundles/org.openhab.ui.cometvisu/src/main/resources/OH-INF/addon/addon.xml
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 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<addon:addon id="cometvisu" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:addon="https://openhab.org/schemas/addon/v1.0.0" | ||
xsi:schemaLocation="https://openhab.org/schemas/addon/v1.0.0 https://openhab.org/schemas/addon-1.0.0.xsd"> | ||
|
||
<type>ui</type> | ||
<name>CometVisu Backend</name> | ||
<description>This is the backend for the CometVisu.</description> | ||
|
||
<service-id>org.openhab.cometvisu</service-id> | ||
|
||
<config-description-ref uri="ui:cometvisu"/> | ||
|
||
</addon:addon> |
14 changes: 14 additions & 0 deletions
14
bundles/org.openhab.ui.habot/src/main/resources/OH-INF/addon/addon.xml
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 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<addon:addon id="habot" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:addon="https://openhab.org/schemas/addon/v1.0.0" | ||
xsi:schemaLocation="https://openhab.org/schemas/addon/v1.0.0 https://openhab.org/schemas/addon-1.0.0.xsd"> | ||
|
||
<type>ui</type> | ||
<name>HABot</name> | ||
<description>This is the add-on for HABot.</description> | ||
|
||
<service-id>org.openhab.habot</service-id> | ||
|
||
<config-description-ref uri="ui:habot"/> | ||
|
||
</addon:addon> |
10 changes: 10 additions & 0 deletions
10
bundles/org.openhab.ui.habpanel/src/main/resources/OH-INF/addon.xml
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,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<addon:addon id="habpanel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:addon="https://openhab.org/schemas/addon/v1.0.0" | ||
xsi:schemaLocation="https://openhab.org/schemas/addon/v1.0.0 https://openhab.org/schemas/addon-1.0.0.xsd"> | ||
|
||
<type>ui</type> | ||
<name>HABPanel</name> | ||
<description>This is the add-on for HABPanel.</description> | ||
|
||
</addon:addon> |
10 changes: 10 additions & 0 deletions
10
bundles/org.openhab.ui/src/main/resources/OH-INF/addon/addon.xml
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,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<addon:addon id="ui" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:addon="https://openhab.org/schemas/addon/v1.0.0" | ||
xsi:schemaLocation="https://openhab.org/schemas/addon/v1.0.0 https://openhab.org/schemas/addon-1.0.0.xsd"> | ||
|
||
<type>ui</type> | ||
<name>Main UI</name> | ||
<description>This is the openHAB Main UI.</description> | ||
|
||
</addon:addon> |
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
146 changes: 146 additions & 0 deletions
146
bundles/org.openhab.ui/web/src/pages/settings/addons/addon-config.vue
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,146 @@ | ||
<template> | ||
<f7-page> | ||
<f7-navbar :title="'Configure ' + addon.label" back-link="Back"> | ||
<f7-nav-right> | ||
<f7-link @click="save()" v-if="$theme.md" icon-md="material:save" icon-only /> | ||
<f7-link @click="save()" v-if="!$theme.md"> | ||
Save | ||
</f7-link> | ||
</f7-nav-right> | ||
</f7-navbar> | ||
<f7-block form v-if="configDescription && config" class="service-config block-narrow"> | ||
<f7-col> | ||
<f7-block-title medium> | ||
Add-on configuration | ||
</f7-block-title> | ||
<config-sheet | ||
:parameter-groups="configDescription.parameterGroups" | ||
:parameters="configDescription.parameters" | ||
:configuration="config" /> | ||
</f7-col> | ||
</f7-block> | ||
<f7-block form v-if="loggerPackages.length > 0" class="service-config block-narrow"> | ||
<f7-col> | ||
<f7-block-title medium> | ||
Add-on log settings | ||
</f7-block-title> | ||
<f7-list class="col wide"> | ||
<f7-list-item v-for="loggerPackage in loggerPackages" :key="loggerPackage.loggerName" | ||
:title="loggerPackage.loggerName"> | ||
<f7-input type="select" :value="loggerPackage.level" | ||
@input="loggerPackage.level = $event.target.value; loggerPackage.changed = true"> | ||
<option value="DEFAULT"> | ||
Default | ||
</option> | ||
<option value="TRACE"> | ||
Trace | ||
</option> | ||
<option value="DEBUG"> | ||
Debug | ||
</option> | ||
<option value="INFO"> | ||
Info | ||
</option> | ||
<option value="WARN"> | ||
Warning | ||
</option> | ||
<option value="ERROR"> | ||
Error | ||
</option> | ||
</f7-input> | ||
</f7-list-item> | ||
</f7-list> | ||
</f7-col> | ||
</f7-block> | ||
</f7-page> | ||
</template> | ||
|
||
<script> | ||
import ConfigSheet from '@/components/config/config-sheet.vue' | ||
export default { | ||
components: { | ||
ConfigSheet | ||
}, | ||
props: ['addonId'], | ||
data () { | ||
return { | ||
addon: {}, | ||
configDescription: null, | ||
config: null, | ||
bindingId: null, | ||
loggerPackages: [], | ||
serviceId: null, | ||
strippedAddonId: '' | ||
} | ||
}, | ||
methods: { | ||
save () { | ||
let promises = [] | ||
this.loggerPackages.forEach(logger => { | ||
if (logger.changed === true) { | ||
if (logger.level === 'DEFAULT') { | ||
promises.push(this.$oh.api.delete('/rest/logging/' + logger.loggerName)) | ||
} else { | ||
delete logger.changed | ||
promises.push(this.$oh.api.put('/rest/logging/' + logger.loggerName, logger)) | ||
} | ||
} | ||
}) | ||
if (this.configDescription && this.config) { | ||
promises.push(this.$oh.api.put('/rest/addons/' + this.bindingId + '/config', this.config)) | ||
} | ||
Promise.all(promises).then(() => { | ||
this.$f7.toast.create({ | ||
text: 'Saved', | ||
destroyOnClose: true, | ||
closeTimeout: 2000 | ||
}).open() | ||
}) | ||
this.$f7router.back() | ||
} | ||
}, | ||
created () { | ||
let serviceSeparator = this.addonId.indexOf(':') | ||
if (serviceSeparator === -1) { | ||
this.strippedAddonId = this.addonId | ||
} else { | ||
this.strippedAddonId = this.addonId.substring(serviceSeparator + 1) | ||
this.serviceId = this.addonId.substring(0, serviceSeparator) | ||
} | ||
let requestUri = '/rest/addons/' + this.strippedAddonId + (this.serviceId ? '?serviceId=' + this.serviceId : '') | ||
this.$oh.api.get(requestUri).then(data => { | ||
this.addon = data | ||
let configDescriptionURI = this.addon.configDescriptionURI | ||
if (configDescriptionURI) { | ||
this.$oh.api.get('/rest/config-descriptions/' + configDescriptionURI).then(data2 => { | ||
this.configDescription = data2 | ||
this.bindingId = this.strippedAddonId | ||
this.$oh.api.get('/rest/addons/' + this.bindingId + '/config').then(data3 => { | ||
this.config = data3 | ||
}) | ||
}) | ||
} | ||
if (Array.isArray(this.addon.loggerPackages)) { | ||
this.addon.loggerPackages.forEach(loggerPackage => { | ||
this.$oh.api.get('/rest/logging/' + loggerPackage).then(data4 => { | ||
data4.loggers.forEach(logger => this.loggerPackages.push(logger)) | ||
}) | ||
}) | ||
} | ||
}) | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="stylus"> | ||
.service-config | ||
.item-input-info | ||
white-space normal | ||
</style> |
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
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