mirror of
https://github.com/documize/community.git
synced 2025-07-19 13:19:43 +02:00
Display subscription information
This commit is contained in:
parent
53e4861ded
commit
9ee9526a47
6 changed files with 708 additions and 684 deletions
4
core/env/product.go
vendored
4
core/env/product.go
vendored
|
@ -32,11 +32,13 @@ type License struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Email string `json:"email"`
|
Email string `json:"email"`
|
||||||
Edition string `json:"edition"`
|
Edition string `json:"edition"`
|
||||||
|
Package string `json:"package"`
|
||||||
|
Plan string `json:"plan"`
|
||||||
Start time.Time `json:"start"`
|
Start time.Time `json:"start"`
|
||||||
End time.Time `json:"end"`
|
End time.Time `json:"end"`
|
||||||
Seats int `json:"seats"`
|
Seats int `json:"seats"`
|
||||||
Trial bool `json:"trial"`
|
Trial bool `json:"trial"`
|
||||||
Valid bool
|
Valid bool `json:"valid"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsEmpty determines if we have a license.
|
// IsEmpty determines if we have a license.
|
||||||
|
|
|
@ -59,6 +59,7 @@ func (h *Handler) Meta(w http.ResponseWriter, r *http.Request) {
|
||||||
data.Edition = h.Runtime.Product.License.Edition
|
data.Edition = h.Runtime.Product.License.Edition
|
||||||
data.Valid = h.Runtime.Product.License.Valid
|
data.Valid = h.Runtime.Product.License.Valid
|
||||||
data.ConversionEndpoint = org.ConversionEndpoint
|
data.ConversionEndpoint = org.ConversionEndpoint
|
||||||
|
data.License = h.Runtime.Product.License
|
||||||
|
|
||||||
// Strip secrets
|
// Strip secrets
|
||||||
data.AuthConfig = auth.StripAuthSecrets(h.Runtime, org.AuthProvider, org.AuthConfig)
|
data.AuthConfig = auth.StripAuthSecrets(h.Runtime, org.AuthProvider, org.AuthConfig)
|
||||||
|
|
1324
embed/bindata.go
1324
embed/bindata.go
File diff suppressed because one or more lines are too long
|
@ -12,9 +12,9 @@
|
||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import { htmlSafe } from '@ember/string';
|
import { htmlSafe } from '@ember/string';
|
||||||
import { resolve } from 'rsvp';
|
import { resolve } from 'rsvp';
|
||||||
import Service, { inject as service } from '@ember/service';
|
|
||||||
import miscUtil from '../utils/misc';
|
import miscUtil from '../utils/misc';
|
||||||
import config from '../config/environment';
|
import config from '../config/environment';
|
||||||
|
import Service, { inject as service } from '@ember/service';
|
||||||
|
|
||||||
export default Service.extend({
|
export default Service.extend({
|
||||||
ajax: service(),
|
ajax: service(),
|
||||||
|
@ -29,9 +29,6 @@ export default Service.extend({
|
||||||
version: '',
|
version: '',
|
||||||
message: '',
|
message: '',
|
||||||
edition: 'Community',
|
edition: 'Community',
|
||||||
// for major.minor semver release detection
|
|
||||||
// for bugfix releases, only admin is made aware of new release and end users see no What's New messaging
|
|
||||||
updateAvailable: false,
|
|
||||||
valid: true,
|
valid: true,
|
||||||
allowAnonymousAccess: false,
|
allowAnonymousAccess: false,
|
||||||
authProvider: null,
|
authProvider: null,
|
||||||
|
@ -40,6 +37,10 @@ export default Service.extend({
|
||||||
secureMode: false,
|
secureMode: false,
|
||||||
maxTags: 3,
|
maxTags: 3,
|
||||||
|
|
||||||
|
// for major.minor semver release detection
|
||||||
|
// for bugfix releases, only admin is made aware of new release and end users see no What's New messaging
|
||||||
|
updateAvailable: false,
|
||||||
|
|
||||||
invalidLicense() {
|
invalidLicense() {
|
||||||
return this.valid === false;
|
return this.valid === false;
|
||||||
},
|
},
|
||||||
|
|
|
@ -12,13 +12,29 @@
|
||||||
<div class="view-customize">
|
<div class="view-customize">
|
||||||
<form class="mt-5 ">
|
<form class="mt-5 ">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="product-license-xml">Enterprise Edition license (optional)</label>
|
<label for="product-license-xml">Optional Enterprise Edition License Key</label>
|
||||||
{{textarea id="product-license-xml" value=license rows="18" class=(if LicenseError 'form-control is-invalid' 'form-control')}}
|
{{textarea id="product-license-xml" value=license rows="18" class=(if LicenseError 'form-control is-invalid' 'form-control')}}
|
||||||
<small class="form-text text-muted ">XML format</small>
|
|
||||||
{{#if appMeta.valid}}
|
{{#if appMeta.valid}}
|
||||||
<p class="mt-2 color-green">Valid</p>
|
{{#if (eq appMeta.edition "Enterprise")}}
|
||||||
|
<p class="mt-2 color-green">Registered to {{appMeta.license.email}} @ {{appMeta.license.name}}</p>
|
||||||
|
<p class="mt-2 color-green">{{appMeta.license.package}} package up to {{appMeta.license.seats}} users</p>
|
||||||
|
{{#if appMeta.license.trial}}
|
||||||
|
<p class="mt-2 color-red">Trial expiry {{formatted-date appMeta.license.end}}</p>
|
||||||
|
{{else}}
|
||||||
|
<p class="mt-2 color-green">Subscribed to {{formatted-date appMeta.license.end}}</p>
|
||||||
|
{{/if}}
|
||||||
|
{{else}}
|
||||||
|
<small class="form-text text-muted">License key is XML format and activates Enterprise edition</small>
|
||||||
|
{{/if}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<p class="mt-2 color-red">Invalid</p>
|
<p class="mt-2 color-red">License is not valid — check user count and expirty date</p>
|
||||||
|
<p class="mt-2 color-gray">Registered to {{appMeta.license.email}} @ {{appMeta.license.name}}</p>
|
||||||
|
<p class="mt-2 color-gray">{{appMeta.license.package}} package up to {{appMeta.license.seats}} users</p>
|
||||||
|
{{#if appMeta.license.trial}}
|
||||||
|
<p class="mt-2 color-gray">Trial expiry {{formatted-date appMeta.license.end}}</p>
|
||||||
|
{{else}}
|
||||||
|
<p class="mt-2 color-gray">Subscribed to {{formatted-date appMeta.license.end}}</p>
|
||||||
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="btn btn-success mt-3" {{action 'saveLicense'}}>Save</div>
|
<div class="btn btn-success mt-3" {{action 'saveLicense'}}>Save</div>
|
||||||
|
|
|
@ -11,7 +11,10 @@
|
||||||
|
|
||||||
package org
|
package org
|
||||||
|
|
||||||
import "time"
|
import (
|
||||||
|
"github.com/documize/community/core/env"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
// SitemapDocument details a document that can be exposed via Sitemap.
|
// SitemapDocument details a document that can be exposed via Sitemap.
|
||||||
type SitemapDocument struct {
|
type SitemapDocument struct {
|
||||||
|
@ -24,16 +27,17 @@ type SitemapDocument struct {
|
||||||
|
|
||||||
// SiteMeta holds information associated with an Organization.
|
// SiteMeta holds information associated with an Organization.
|
||||||
type SiteMeta struct {
|
type SiteMeta struct {
|
||||||
OrgID string `json:"orgId"`
|
OrgID string `json:"orgId"`
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
URL string `json:"url"`
|
URL string `json:"url"`
|
||||||
AllowAnonymousAccess bool `json:"allowAnonymousAccess"`
|
AllowAnonymousAccess bool `json:"allowAnonymousAccess"`
|
||||||
AuthProvider string `json:"authProvider"`
|
AuthProvider string `json:"authProvider"`
|
||||||
AuthConfig string `json:"authConfig"`
|
AuthConfig string `json:"authConfig"`
|
||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
MaxTags int `json:"maxTags"`
|
MaxTags int `json:"maxTags"`
|
||||||
Edition string `json:"edition"`
|
Edition string `json:"edition"`
|
||||||
Valid bool `json:"valid"`
|
Valid bool `json:"valid"`
|
||||||
ConversionEndpoint string `json:"conversionEndpoint"`
|
ConversionEndpoint string `json:"conversionEndpoint"`
|
||||||
|
License env.License `json:"license"`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue