Skip to content

Commit

Permalink
Merge pull request #1082 from schakrava/858_part2
Browse files Browse the repository at this point in the history
858 part2
  • Loading branch information
schakrava committed Jan 10, 2016
2 parents 90988d4 + 30054d0 commit 67038d2
Show file tree
Hide file tree
Showing 14 changed files with 1,911 additions and 1,128 deletions.

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/rockstor/storageadmin/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
from pool_balance import PoolBalance
from tls_certificate import TLSCertificate
from rockon import (RockOn, DImage, DContainer, DPort, DVolume,
ContainerOption, DCustomConfig, DContainerLink)
ContainerOption, DCustomConfig, DContainerLink,
DContainerEnv)
from smart import (SMARTAttribute, SMARTCapability, SMARTErrorLog,
SMARTErrorLogSummary, SMARTTestLog, SMARTTestLogDetail,
SMARTIdentity, SMARTInfo)
Expand Down
16 changes: 16 additions & 0 deletions src/rockstor/storageadmin/models/rockon.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ class DContainer(models.Model):
dimage = models.ForeignKey(DImage)
name = models.CharField(max_length=1024, unique=True)
launch_order = models.IntegerField(default=1)
#if uid is None, container's owner is not set. defaults to root.
#if it's -1, then owner is set to the owner of first volume, if any.
#if it's an integer other than -1, like 0, then owner is set to that uid.
uid = models.IntegerField(null=True)

class Meta:
app_label = 'storageadmin'
Expand Down Expand Up @@ -131,3 +135,15 @@ class DCustomConfig(models.Model):
class Meta:
unique_together = ('rockon', 'key',)
app_label = 'storageadmin'


class DContainerEnv(models.Model):
container = models.ForeignKey(DContainer)
key = models.CharField(max_length=1024)
val = models.CharField(max_length=1024, null=True)
description = models.CharField(max_length=2048, null=True)
label = models.CharField(max_length=64, null=True)

class Meta:
unique_together = ('container', 'key')
app_label = 'storageadmin'
14 changes: 9 additions & 5 deletions src/rockstor/storageadmin/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@
NFSExportGroup, SFTP, AdvancedNFSExport,
OauthApp, NetatalkShare, Group, PoolBalance,
SambaCustomConfig, TLSCertificate, RockOn,
DVolume, DPort, DCustomConfig, SMARTAttribute,
SMARTCapability, SMARTInfo, SMARTErrorLog,
SMARTErrorLogSummary, SMARTTestLog,
SMARTTestLogDetail, SMARTIdentity,
ConfigBackup, EmailClient, UpdateSubscription)
DVolume, DPort, DCustomConfig, DContainerEnv,
SMARTAttribute, SMARTCapability, SMARTInfo,
SMARTErrorLog, SMARTErrorLogSummary,
SMARTTestLog, SMARTTestLogDetail,
SMARTIdentity, ConfigBackup, EmailClient,
UpdateSubscription)
from django.contrib.auth.models import User as DjangoUser


Expand Down Expand Up @@ -209,6 +210,9 @@ class RockOnCustomConfigSerializer(serializers.ModelSerializer):
class Meta:
model = DCustomConfig

class RockOnEnvironmentSerializer(serializers.ModelSerializer):
class Meta:
model = DContainerEnv

class SMARTCapabilitySerializer(serializers.ModelSerializer):
class Meta:
Expand Down
21 changes: 21 additions & 0 deletions src/rockstor/storageadmin/static/storageadmin/js/models/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,27 @@ var RockOnCustomConfigCollection = RockStorPaginatedCollection.extend({
}
});

var RockOnEnvironment = Backbone.Model.extend({
urlRoot: '/api/rockon/environment/' + this.rid
});

var RockOnEnvironmentCollection = RockStorPaginatedCollection.extend({
model: RockOnEnvironment,
initialize: function(models, options) {
this.constructor.__super__.initialize.apply(this, arguments);
if (options) {
this.rid = options.rid;
}
},
baseUrl: function() {
if (this.rid) {
return '/api/rockons/environment/' + this.rid;
} else {
return '/api/rockons/environment';
}
}
});

var EmailAccount = Backbone.Model.extend({
urlRoot: '/api/email'
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ RockstorWizardPage = Backbone.View.extend({

render: function() {
$(this.el).html(this.template({
model: this.model,
model: this.model
}));
return this;
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{rockonMoreInfo}}
{{{rockonMoreInfo}}}
Loading

0 comments on commit 67038d2

Please sign in to comment.