diff --git a/.travis.yml b/.travis.yml
index 08fe22d8..5da0c874 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,8 +18,7 @@ branches:
- /^stable\d+(\.\d+)?$/
before_install:
- - nvm install node
- - npm install -g npm@latest
+ - nvm install --lts
- composer install
- wget https://raw.githubusercontent.com/owncloud/administration/master/travis-ci/before_install.sh
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
diff --git a/appinfo/routes.php b/appinfo/routes.php
index cb44ea68..2edcd4b8 100644
--- a/appinfo/routes.php
+++ b/appinfo/routes.php
@@ -33,7 +33,7 @@
['name' => 'market#uninstall', 'url' => '/apps/{appId}/uninstall', 'verb' => 'POST'],
['name' => 'market#getApiKey', 'url' => '/apikey', 'verb' => 'GET'],
['name' => 'market#changeApiKey', 'url' => '/apikey', 'verb' => 'PUT'],
- ['name' => 'market#hasLicenseKey', 'url' => '/has-license-key', 'verb' => 'GET'],
+ ['name' => 'market#getConfig', 'url' => '/config', 'verb' => 'GET'],
['name' => 'market#requestDemoLicenseKeyFromMarket', 'url' => '/request-license-key-from-market', 'verb' => 'GET'],
['name' => 'market#invalidateCache', 'url' => '/cache/invalidate', 'verb' => 'POST'],
// local apps
diff --git a/lib/Controller/MarketController.php b/lib/Controller/MarketController.php
index 9b2fc569..c84029bf 100644
--- a/lib/Controller/MarketController.php
+++ b/lib/Controller/MarketController.php
@@ -29,6 +29,7 @@
use OCP\AppFramework\Http\DataResponse;
use OCP\IL10N;
use OCP\IRequest;
+use OCP\IConfig;
class MarketController extends Controller {
@@ -38,13 +39,18 @@ class MarketController extends Controller {
/** @var IL10N */
private $l10n;
+ /** @var IConfig */
+ private $config;
+
public function __construct($appName,
IRequest $request,
MarketService $marketService,
- IL10N $l10n) {
+ IL10N $l10n,
+ IConfig $config) {
parent::__construct($appName, $request);
$this->marketService = $marketService;
$this->l10n = $l10n;
+ $this->config = $config;
}
/**
@@ -257,22 +263,22 @@ private function enrichApp($app) {
* @return string
* @NoCSRFRequired
*/
- public function hasLicenseKey() {
- if ($this->marketService->hasLicenseKey()) {
- return new DataResponse(
- [
- 'message' => $this->l10n->t('License key available.')
- ],
- Http::STATUS_OK
- );
+ public function getConfig() {
+ $licenseKeyAvailable = $this->marketService->hasLicenseKey();
+ if ($licenseKeyAvailable) {
+ $licenseMessage = $this->l10n->t('License key available.');
+ } else {
+ $licenseMessage = $this->l10n->t('No license key configured.');
}
- return new DataResponse(
- [
- 'message' => $this->l10n->t('No license key configured.')
- ],
- Http::STATUS_NOT_FOUND
- );
+ $config = [
+ 'canInstall' => $this->marketService->canInstall(),
+ 'hasInternetConnection' => $this->config->getSystemValue('has_internet_connection', true),
+ 'licenseKeyAvailable' => $licenseKeyAvailable,
+ 'licenseMessage' => $licenseMessage
+ ];
+
+ return new DataResponse($config, Http::STATUS_OK);
}
/**
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index dd10b872..fe1f6502 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -4596,9 +4596,9 @@
"resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz"
},
"uikit": {
- "version": "3.0.0-beta.30",
- "from": "uikit@3.0.0-beta.30",
- "resolved": "https://registry.npmjs.org/uikit/-/uikit-3.0.0-beta.30.tgz"
+ "version": "3.0.0-beta.34",
+ "from": "uikit@latest",
+ "resolved": "https://registry.npmjs.org/uikit/-/uikit-3.0.0-beta.34.tgz"
},
"undefsafe": {
"version": "0.0.3",
diff --git a/package.json b/package.json
index 9e544802..0fba7c50 100644
--- a/package.json
+++ b/package.json
@@ -42,7 +42,7 @@
"showdown": "^1.7.6",
"style-loader": "0.16.1",
"uglify-js": "3.1.3",
- "uikit": "3.0.0-beta.30",
+ "uikit": "3.0.0-beta.34",
"underscore": "1.8.3",
"vue": "2.4.4",
"vue-gettext": "2.0.23",
diff --git a/src/App.vue b/src/App.vue
index 6f8a67f8..1f186c71 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,35 +1,56 @@
- .uk-padding
- .uk-grid-large(uk-grid)
- aside.uk-width-auto
- navigation
- trial
-
- main.uk-width-expand
- router-view
+ .uk-padding(v-if="config")
+ .uk-grid-large(uk-grid)
+ .uk-width-1-1(v-if="showNotice").uk-animation-slide-top-small
+ .uk-alert-primary(uk-alert)
+ span.uk-alert-close(uk-close, @click.prevent="noticeDismissed = true")
+ h1.uk-h5 {{ t("Installing and updating Apps is not supported!") }}
+ p {{ t("This is a clustered setup or the web server has no permissions to write to the apps folder.") }}
+ aside.uk-width-auto
+ navigation
+ trial
+ main.uk-width-expand
+ router-view
\ No newline at end of file
diff --git a/src/components/Trial.vue b/src/components/Trial.vue
index 68f89224..83d6b6f0 100644
--- a/src/components/Trial.vue
+++ b/src/components/Trial.vue
@@ -1,6 +1,6 @@
- div(v-if="!unborn")
- button.uk-button.uk-button-primary.uk-margin-small-top.uk-width-1-1(v-if="!licenseKeyExists && !loading", @click="openModalStartEnterpriseKey") {{ t('Start Enterprise trial') }}
+ div
+ button.uk-button.uk-button-primary.uk-margin-small-top.uk-width-1-1(v-if="!config.licenseKeyAvailable", @click="openModalStartEnterpriseKey") {{ t('Start Enterprise trial') }}
#start-enterprise-trial(uk-modal='center: true')
.uk-modal-dialog
@@ -8,7 +8,7 @@
.uk-modal-header
h2.uk-modal-title {{ t('Enterprise Trial Version') }}
.uk-modal-body
- div(v-if="!licenseKeyExists")
+ div(v-if="!config.licenseKeyAvailable")
p.intro Take your ownCloud to the next level and start your 30 day ownCloud Enterprise Trial today!
.uk-alert-danger(uk-alert, v-if="!apiKeyExists")
@@ -21,16 +21,13 @@
input.uk-checkbox(v-model="legalChecked", type="checkbox").uk-margin-small-right
| I accept the ownCloud enterprise confidentiality agreement and the ownCloud Commercial License.
- .uk-alert-success(v-if="licenseKeyExists", uk-alert)
+ .uk-alert-success(v-if="config.licenseKeyAvailable", uk-alert)
p.intro
strong {{ t('Awesome! Your 30 day trial is ready to go!') }}
.uk-modal-footer
button.uk-button.uk-button-default.uk-modal-close.uk-margin-small-right(type='button') Close
- button.uk-button.uk-button-primary.uk-position-relative.uk-align-right.uk-margin-remove-bottom(v-if="loading", disabled)
- .uk-position-small.uk-position-center-left(uk-spinner, uk-icon="icon: spinner; ratio: 0.8")
- | {{ t('Loading') }}
- button.uk-button.uk-button-primary.uk-position-relative.uk-align-right.uk-margin-remove-bottom(v-if="!licenseKeyExists && !loading", @click="requestLicenseKey", :disabled="!legalChecked || !apiKeyExists || loading") {{ t('Start trial') }}
+ button.uk-button.uk-button-primary.uk-position-relative.uk-align-right.uk-margin-remove-bottom(v-if="!config.licenseKeyAvailable", @click="requestLicenseKey", :disabled="!legalChecked || !apiKeyExists") {{ t('Start trial') }}
@@ -59,15 +56,12 @@
.then(this.$router.push({ name: 'Bundles' }))
.catch(() => {
console.warn('REQUEST_LICENSE_KEY failed')
- })
+ });
}
},
- mounted () {
- this.$store.dispatch('CHECK_LICENSE_KEY');
- },
computed : {
- licenseKeyExists () {
- return this.$store.state.licenseKey.exists;
+ config() {
+ return this.$store.getters.config
},
apiKeyExists () {
@@ -75,15 +69,7 @@
return this.$store.state.apikey.key.length > 0;
return false;
- },
-
- loading () {
- return this.$store.state.licenseKey.loading;
- },
-
- unborn () {
- return this.$store.state.licenseKey.unborn;
- },
+ }
}
}
diff --git a/src/store.js b/src/store.js
index 973316b8..d54071a0 100644
--- a/src/store.js
+++ b/src/store.js
@@ -6,6 +6,9 @@ import _ from "underscore";
Vue.use(Vuex);
const state = {
+
+ config: {},
+
categories: {
loading: false,
failed: false,
@@ -31,18 +34,17 @@ const state = {
changeable : false
},
- licenseKey : {
- exists : false,
- loading : false,
- unborn: true
- },
-
processing: [],
installed: []
};
// Retrieve computed values from state.
const getters = {
+
+ config (state) {
+ return state.config;
+ },
+
categories (state) {
return state.categories.records;
},
@@ -98,6 +100,11 @@ const getters = {
// Manipulate from the current state.
const mutations = {
+
+ CONFIG (state, changes) {
+ state["config"] = changes;
+ },
+
LOADING_APPLICATIONS (state) {
_.extend(state["applications"], {
loading: true,
@@ -120,10 +127,6 @@ const mutations = {
})
},
- LICENSE_KEY (state, changes) {
- _.extend(state["licenseKey"], changes);
- },
-
SET_APPLICATIONS (state, content) {
_.extend(state["applications"], {
records: content
@@ -281,36 +284,19 @@ const actions = {
});
},
- CHECK_LICENSE_KEY (context) {
- Axios.get(OC.generateUrl("/apps/market/has-license-key"))
- .then(() => {
- context.commit("LICENSE_KEY", { "exists" : true, "unborn" : false });
- })
- .catch(() => {
- context.commit("LICENSE_KEY", { "exists" : false, "unborn" : false });
- });
- },
-
REQUEST_LICENSE_KEY (context) {
- context.commit("LICENSE_KEY", {"loading": true });
-
return Axios.get(OC.generateUrl("/apps/market/request-license-key-from-market"))
.then((response) => {
- context.commit("LICENSE_KEY", {
- "loading": false,
- "exists" : true,
- "unborn" : false
+ context.dispatch('FETCH_CONFIG');
+ UIkit.notification(error.response.data.message, {
+ status : "success",
+ pos : "bottom-right"
});
})
.catch((error) => {
- context.commit("LICENSE_KEY", {
- "loading": false,
- "exists" : false,
- "unborn" : false
- });
UIkit.notification(error.response.data.message, {
- status:"danger",
- pos: "bottom-right"
+ status : "danger",
+ pos : "bottom-right"
});
return Promise.reject(error.response);
@@ -389,6 +375,19 @@ const actions = {
});
},
+ FETCH_CONFIG (context) {
+ Axios.get(OC.generateUrl("/apps/market/config"))
+ .then((response) => {
+ context.commit("CONFIG", response.data);
+ })
+ .catch((error) => {
+ UIkit.notification(error.response.data.message, {
+ status:"danger",
+ pos: "bottom-right"
+ });
+ });
+ },
+
WRITE_APIKEY (context, payload) {
let key = payload;
context.commit("APIKEY", {"loading": true });