This commit is contained in:
2022-12-25 02:14:06 +00:00
parent 560e64db85
commit 43475bc399
2 changed files with 200 additions and 85 deletions

View File

@@ -235,6 +235,13 @@ export default {
});
break;
case socktype.SubscriptionServer:
vm.$router.push({
name: "subscription-server-edit",
params: { recordid: tid.id }
});
break;
default:
window.$gz.eventBus.$emit(
"notify-warning",

View File

@@ -11,7 +11,7 @@
v-model="obj.name"
dense
:readonly="formState.readOnly"
:label="$sock.t('SubscriptionServerName')"
:label="$sock.t('SubServerName')"
:rules="[form().required(this, 'name')]"
:error-messages="form().serverErrors(this, 'name')"
data-cy="name"
@@ -19,104 +19,188 @@
></v-text-field>
</v-col>
<v-col
v-if="form().showMe(this, 'Vendor')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-pick-list
ref="vendorId"
v-model="obj.vendorId"
:aya-type="sockTypes().Vendor"
ref="customerId"
v-model="obj.customerId"
:aya-type="sockTypes().Customer"
show-edit-icon
:readonly="formState.readOnly"
:label="$sock.t('Vendor')"
:error-messages="form().serverErrors(this, 'vendorId')"
:rules="[form().required(this, 'vendorId')]"
@input="fieldValueChanged('vendorId')"
:label="$sock.t('Customer')"
:error-messages="form().serverErrors(this, 'customerId')"
@input="fieldValueChanged('customerId')"
></gz-pick-list>
</v-col>
<v-col
v-if="form().showMe(this, 'SubscriptionServerVendorCode')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-date-time-picker
ref="created"
v-model="obj.created"
:label="$sock.t('Created')"
:rules="[form().required(this, 'created')]"
:readonly="formState.readOnly"
:error-messages="form().serverErrors(this, 'created')"
data-cy="created"
@input="fieldValueChanged('created')"
></gz-date-time-picker>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="vendorCode"
v-model="obj.vendorCode"
ref="dataCenter"
v-model="obj.dataCenter"
dense
:readonly="formState.readOnly"
:label="$sock.t('SubscriptionServerVendorCode')"
data-cy="vendorCode"
:error-messages="form().serverErrors(this, 'vendorCode')"
:rules="[form().required(this, 'vendorCode')]"
@input="fieldValueChanged('vendorCode')"
:label="$sock.t('SubServerDatacenter')"
data-cy="dataCenter"
:error-messages="form().serverErrors(this, 'dataCenter')"
:rules="[form().required(this, 'dataCenter')]"
@input="fieldValueChanged('dataCenter')"
></v-text-field>
</v-col>
<v-col
v-if="form().showMe(this, 'SubscriptionServerOurCode')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="ourCode"
v-model="obj.ourCode"
ref="timeZone"
v-model="obj.timeZone"
dense
:readonly="formState.readOnly"
:label="$sock.t('SubscriptionServerOurCode')"
data-cy="ourCode"
:error-messages="form().serverErrors(this, 'ourCode')"
:rules="[form().required(this, 'ourCode')]"
@input="fieldValueChanged('ourCode')"
:label="$sock.t('SubServerTimeZone')"
data-cy="timeZone"
:error-messages="form().serverErrors(this, 'timeZone')"
:rules="[form().required(this, 'timeZone')]"
@input="fieldValueChanged('timeZone')"
></v-text-field>
</v-col>
<v-col
v-if="form().showMe(this, 'SubscriptionServerLicenseInterval')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-duration-picker
ref="licenseInterval"
v-model="obj.licenseInterval"
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="dbId"
v-model="obj.dbId"
dense
:readonly="formState.readOnly"
:label="$sock.t('SubscriptionServerLicenseInterval')"
:show-seconds="false"
data-cy="licenseInterval"
:error-messages="form().serverErrors(this, 'licenseInterval')"
@input="fieldValueChanged('licenseInterval')"
></gz-duration-picker>
:label="$sock.t('DatabaseID')"
data-cy="dbId"
:error-messages="form().serverErrors(this, 'dbId')"
@input="fieldValueChanged('dbId')"
></v-text-field>
</v-col>
<v-col
v-if="form().showMe(this, 'SubscriptionServerMaintInterval')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-duration-picker
ref="maintInterval"
v-model="obj.maintInterval"
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-date-time-picker
ref="lastUpdated"
v-model="obj.lastUpdated"
:label="$sock.t('SubServerLastUpdated')"
:readonly="formState.readOnly"
:label="$sock.t('SubscriptionServerMaintInterval')"
:show-seconds="false"
data-cy="maintInterval"
:error-messages="form().serverErrors(this, 'maintInterval')"
@input="fieldValueChanged('maintInterval')"
></gz-duration-picker>
:error-messages="form().serverErrors(this, 'lastUpdated')"
data-cy="lastUpdated"
@input="fieldValueChanged('lastUpdated')"
></gz-date-time-picker>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-date-time-picker
ref="subscriptionExpire"
v-model="obj.subscriptionExpire"
:label="$sock.t('SubServerSubExpire')"
:rules="[form().required(this, 'subscriptionExpire')]"
:readonly="formState.readOnly"
:error-messages="form().serverErrors(this, 'subscriptionExpire')"
data-cy="subscriptionExpire"
@input="fieldValueChanged('subscriptionExpire')"
></gz-date-time-picker>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="operatingSystem"
v-model="obj.operatingSystem"
dense
:readonly="formState.readOnly"
:label="$sock.t('SubServerOperatingSystem')"
data-cy="operatingSystem"
:error-messages="form().serverErrors(this, 'operatingSystem')"
@input="fieldValueChanged('operatingSystem')"
></v-text-field>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="customerSubDomain"
v-model="obj.customerSubDomain"
dense
:readonly="formState.readOnly"
:label="$sock.t('SubServerCustomerDomain')"
data-cy="customerSubDomain"
:error-messages="form().serverErrors(this, 'customerSubDomain')"
@input="fieldValueChanged('customerSubDomain')"
></v-text-field>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-checkbox
ref="trial"
v-model="obj.trial"
dense
:readonly="formState.readOnly"
:label="$sock.t('SubServerTrial')"
data-cy="trial"
:error-messages="form().serverErrors(this, 'trial')"
@change="fieldValueChanged('trial')"
></v-checkbox>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="trialCompany"
v-model="obj.trialCompany"
dense
:readonly="formState.readOnly"
:label="$sock.t('SubServerTrialCompany')"
data-cy="trialCompany"
:error-messages="form().serverErrors(this, 'trialCompany')"
@input="fieldValueChanged('trialCompany')"
></v-text-field>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="trialContact"
v-model="obj.trialContact"
dense
:readonly="formState.readOnly"
:label="$sock.t('SubServerTrialContact')"
data-cy="trialContact"
:error-messages="form().serverErrors(this, 'trialContact')"
@input="fieldValueChanged('trialContact')"
></v-text-field>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-email
ref="trialEmail"
v-model="obj.trialEmail"
:readonly="formState.readOnly"
:label="$sock.t('SubServerTrialEmail')"
data-cy="trialEmail"
:error-messages="form().serverErrors(this, 'trialEmail')"
@input="fieldValueChanged('trialEmail')"
></gz-email>
</v-col>
<v-col v-if="form().showMe(this, 'SubServerNotes')" cols="12">
<v-textarea
ref="notes"
v-model="obj.notes"
dense
:readonly="formState.readOnly"
:label="$sock.t('SubServerNotes')"
:error-messages="form().serverErrors(this, 'notes')"
data-cy="notes"
auto-grow
@input="fieldValueChanged('notes')"
></v-textarea>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-checkbox
ref="active"
@@ -183,7 +267,7 @@ export default {
active: true,
customerId: 0,
notes: null,
created: window.$gz.locale.nowUTC8601String(),
created: window.$gz.locale.nowUTC8601String(),
dataCenter: null,
timeZone: null,
dbId: null,
@@ -659,18 +743,27 @@ async function initForm(vm) {
async function fetchTranslatedText() {
await window.$gz.translation.cacheTranslations([
"SubscriptionServer",
"SubscriptionServerName",
"Vendor",
"SubscriptionServerLicenseInterval",
"SubscriptionServerMaintInterval",
"SubscriptionServerSubscriptionServerOverseerID",
"SubscriptionServerVendorCode",
"SubscriptionServerOurCode"
"SubServerName",
"Customer",
"SubServerNotes",
"Created",
"SubServerDatacenter",
"SubServerTimeZone",
"DatabaseID",
"SubServerLastUpdated",
"SubServerSubExpire",
"SubServerTrial",
"SubServerTrialContact",
"SubServerTrialEmail",
"SubServerTrialCompany",
"SubServerOperatingSystem",
"SubServerCustomerDomain"
]);
}
/*
"CREATE TABLE asubscriptionserver (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, active BOOL NOT NULL DEFAULT true, created TIMESTAMPTZ NOT NULL, "
+ "name TEXT NOT NULL, notes TEXT, datacenter TEXT NOT NULL, timezone TEXT NOT NULL, dbid TEXT, lastupdated TIMESTAMPTZ, subscriptionexpire TIMESTAMPTZ NOT NULL, "
+ "name TEXT NOT NULL, notes TEXT, datacenter TEXT NOT NULL, timezone TEXT NOT NULL,
dbid TEXT, lastupdated TIMESTAMPTZ, subscriptionexpire TIMESTAMPTZ NOT NULL, "
+ "trial BOOL NOT NULL DEFAULT true, trialcontact TEXT, trialemail TEXT, trialcompany TEXT, operatingsystem TEXT, customersubdomain TEXT, "
+ "wiki TEXT, tags VARCHAR(255) ARRAY, customerid BIGINT REFERENCES acustomer(id) )"
[Required]
@@ -709,6 +802,21 @@ await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SE
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'SubServerOperatingSystem', 'OS' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'SubServerCustomerDomain', 'Customer subdomain' FROM atranslation t where t.baselanguage = 'en'");
name: null,
active: true,
customerId: 0,
notes: null,
created: window.$gz.locale.nowUTC8601String(),
dataCenter: null,
timeZone: null,
dbId: null,
lastUpdated: null,
subscriptionExpire: null,
trial: true,
trialContact: null,
trialEmail: null,
trialCompany: null,
operatingSystem: "Ubuntu 22.10",
customerSubDomain: null,
*/
</script>