mutx 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mutx/API/repo.rb +7 -0
- data/lib/mutx/database/mongo_connector.rb +5 -0
- data/lib/mutx/lib/paths.rb +2 -0
- data/lib/mutx/routes/admin_routes/repositories_routes.rb +11 -0
- data/lib/mutx/version.rb +2 -2
- data/lib/mutx/view/admin/repositories/_form.mote +53 -0
- data/lib/mutx/view/admin/repositories/edit.mote +10 -0
- data/lib/mutx/view/admin/repositories/index.mote +1 -0
- data/lib/mutx/view/admin/repositories/new.mote +8 -67
- data/lib/mutx/view/admin/tasks/_delete_form.mote +1 -1
- data/lib/mutx/view/results/console.mote +2 -2
- data/lib/mutx/view/sections.rb +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdd1c0a2fb4f63c702cbe7b48a1af13eaeb1701e
|
4
|
+
data.tar.gz: 85182685d9d2e7d09d1d630f8bf9a42ffc33c52a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1a2ca775eea60c56bfd60cf78e03d912ffcc6cef40fb7f967102abe3b28a31be374c4bb573c9d5c43697af5d9c0d05c0c1593e0b6445b331a676d6ed5a9cba8
|
7
|
+
data.tar.gz: 1de9e41d68850a10d6b1cb4a2b0d596cacc8e6e9ec67d6a30f825e2b5282b6372b62451b861eddb30085654c5cd60f6f403ffab5b32ec953c95449ac52bd1111
|
data/lib/mutx/API/repo.rb
CHANGED
@@ -79,6 +79,13 @@ module Mutx
|
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
|
+
def self.update_repo_name id, name
|
83
|
+
Mutx::Database::MongoConnector.update_repo_name(id, name)
|
84
|
+
success = true
|
85
|
+
message = "Repo name updated!"
|
86
|
+
{success:success, message:message}
|
87
|
+
end
|
88
|
+
|
82
89
|
def self.delete_repo repo_id
|
83
90
|
Mutx::Database::MongoConnector.delete_repo repo_id
|
84
91
|
success = true
|
@@ -424,6 +424,11 @@ module Mutx
|
|
424
424
|
$repos.update_one({"repo_name" => repo_data["repo_name"]}, {"$set" => {"value" => repo_data["value"], "last_update" => repo_data["last_update"]} }) ) if ( (!res.to_a.empty?) && (res.to_a[0]["repo_token"].eql? repo_data["repo_token"]) )
|
425
425
|
end
|
426
426
|
|
427
|
+
def self.update_repo_name id, name
|
428
|
+
res = $repos.find({"_id" => id})
|
429
|
+
($repos.update_one({"_id" => id}, {"$set" => {"repo_name" => name} }) ) if !res.to_a.empty?
|
430
|
+
end
|
431
|
+
|
427
432
|
def self.repo_data_for_name(name)
|
428
433
|
res = $repos.find({"repo_name" => name})
|
429
434
|
res = res.to_a.first if res.respond_to? :to_a
|
data/lib/mutx/lib/paths.rb
CHANGED
@@ -32,6 +32,8 @@ module Mutx
|
|
32
32
|
admin_repositories_new: '/admin/repositories/new',
|
33
33
|
admin_repositories_create: '/admin/repositories',
|
34
34
|
admin_repositories_delete: '/admin/repositories/:repository_id/delete',
|
35
|
+
admin_repositories_edit: '/admin/repositories/:repository_id/edit',
|
36
|
+
admin_repositories_update: '/admin/repositories/:repository_id',
|
35
37
|
|
36
38
|
|
37
39
|
logs_index: '/logs',
|
@@ -15,6 +15,12 @@ module Mutx
|
|
15
15
|
Mutx::Support::Log.debug "#{response}"
|
16
16
|
res.redirect path_for(:admin_repositories_index)
|
17
17
|
end
|
18
|
+
|
19
|
+
on ':repository_id' do
|
20
|
+
result = Mutx::API::Repo.update_repo_name(post_data["_id"], post_data["name"])
|
21
|
+
flash[:info] = result[:message]
|
22
|
+
res.redirect path_for(:admin_repositories_index)
|
23
|
+
end
|
18
24
|
end
|
19
25
|
|
20
26
|
on get do
|
@@ -28,6 +34,11 @@ module Mutx
|
|
28
34
|
res.redirect path_for(:admin_repositories_index)
|
29
35
|
end
|
30
36
|
|
37
|
+
on ':repository_id/edit' do |repository_id|
|
38
|
+
repo = Mutx::API::Repo.get_data(repository_id)
|
39
|
+
res.write view('Admin Repositories Edit', repo: repo)
|
40
|
+
end
|
41
|
+
|
31
42
|
on root do
|
32
43
|
repositories = Mutx::Database::MongoConnector.all_repos
|
33
44
|
res.write view('Admin Repositories', repositories: repositories)
|
data/lib/mutx/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Mutx
|
2
|
-
VERSION = "0.2.
|
3
|
-
end
|
2
|
+
VERSION = "0.2.4"
|
3
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
<?
|
2
|
+
if action.eql? "edit"
|
3
|
+
name_to_update = repo["repo_name"]
|
4
|
+
id = repo["_id"]
|
5
|
+
path = :admin_repositories_update
|
6
|
+
else
|
7
|
+
path = :admin_repositories_create
|
8
|
+
end
|
9
|
+
?>
|
10
|
+
|
11
|
+
<nav class="navbar navbar-default">
|
12
|
+
<form name="create-repo" id="create-repo" action="{{ path_for(path) }}" method="POST">
|
13
|
+
<div class='form-group'>
|
14
|
+
<br>
|
15
|
+
<label class='col-sm-2 control-label' for='formGroupInputSmall'>
|
16
|
+
Name of repo
|
17
|
+
</label>
|
18
|
+
% if action=="edit"
|
19
|
+
<input class='customParam' {{"required title='This value is Required!'"}} type='text' name='name' id='name' placeholder='{{"Enter value here"}}' value="{{name_to_update}}" />
|
20
|
+
<input type="hidden" name="_id" id="_id" value="{{id}}" />
|
21
|
+
% else
|
22
|
+
<input class='customParam' {{"required title='This value is Required!'"}} type='text' name='name' id='name' placeholder='{{"Enter value here"}}' value="{{name}}" />
|
23
|
+
% end
|
24
|
+
</div>
|
25
|
+
<div class='form-group'>
|
26
|
+
<label class='col-sm-2 control-label' for='formGroupInputSmall'></label>
|
27
|
+
<input type="submit" class="btn btn-success" value="Save"> <a class="btn btn-danger" href="{{ path_for(:admin_repositories_index) }}">Cancel</a>
|
28
|
+
</div>
|
29
|
+
<br>
|
30
|
+
</form>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
<style>
|
34
|
+
#text {
|
35
|
+
display:none
|
36
|
+
}
|
37
|
+
#json {
|
38
|
+
display:none
|
39
|
+
}
|
40
|
+
#select_list {
|
41
|
+
display:none
|
42
|
+
}
|
43
|
+
% if action=="edit"
|
44
|
+
.form-group:hover + #text {
|
45
|
+
display: block;
|
46
|
+
}
|
47
|
+
% end
|
48
|
+
.panel-heading {
|
49
|
+
color: #3c763d;
|
50
|
+
background-color: #dff0d8;
|
51
|
+
border-color: #d6e9c6;
|
52
|
+
}
|
53
|
+
</style>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<div class="panel panel-info">
|
2
|
+
<!-- Default panel contents -->
|
3
|
+
<div class="panel-heading"><h2>Edit Repo</h2></div>
|
4
|
+
|
5
|
+
<div class="panel-warning">
|
6
|
+
<div class="panel-body">
|
7
|
+
{{ partial('admin/repositories/_form', action: 'edit', repo: repo) }}
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
</div>
|
@@ -22,6 +22,7 @@
|
|
22
22
|
<td>{{repo[:repo_name]}}</td>
|
23
23
|
<td>{{repo[:repo_token]}}</td>
|
24
24
|
<td>{{Mutx::Support::TimeHelper.formatted_time_for(repo["last_update"])}}</td>
|
25
|
+
<td><a href="{{ path_for(:admin_repositories_edit, repository_id: repo['_id']) }}">Edit</a></td>
|
25
26
|
<td><a href="{{ path_for(:admin_repositories_delete, repository_id: repo[:_id]) }}">Delete</a></<td>
|
26
27
|
</tr>
|
27
28
|
% end
|
@@ -1,69 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
name = custom_param["name"]
|
5
|
-
type = custom_param["type"]
|
6
|
-
value = custom_param["value"]
|
7
|
-
options = custom_param["options"]
|
8
|
-
required = custom_param["required"]
|
1
|
+
<div class="panel panel-info">
|
2
|
+
<!-- Default panel contents -->
|
3
|
+
<div class="panel-heading"><h2>New Repo</h2></div>
|
9
4
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
value.gsub('"=>"','":"') if type=="json"
|
14
|
-
end
|
15
|
-
|
16
|
-
|
17
|
-
end
|
18
|
-
|
19
|
-
|
20
|
-
name = query_string.name if query_string.name
|
21
|
-
options = query_string.options if query_string.options
|
22
|
-
value = query_string.value if query_string.value
|
23
|
-
type = query_string.type if query_string.type
|
24
|
-
required = query_string.required if query_string.required
|
25
|
-
|
26
|
-
types = Mutx::Tasks::Custom::Param.types
|
27
|
-
types.unshift("Select...") unless types.include? "Select..."
|
28
|
-
|
29
|
-
|
30
|
-
?>
|
31
|
-
<div class="panel-heading"><h2>New Repo</h2></div>
|
32
|
-
<nav class="navbar navbar-default">
|
33
|
-
<form name="create-repo" id="create-repo" action="{{ path_for(:admin_repositories_create) }}" method="POST">
|
34
|
-
<div class='form-group'>
|
35
|
-
<br>
|
36
|
-
<label class='col-sm-2 control-label' for='formGroupInputSmall'>
|
37
|
-
Name of repo
|
38
|
-
</label>
|
39
|
-
<input class='customParam' {{"required title='This value is Required!'"}} type='text' name='name' id='name' placeholder='{{"Enter value here"}}' value="{{name}}" />
|
5
|
+
<div class="panel-success">
|
6
|
+
<div class="panel-body">
|
7
|
+
{{ partial('admin/repositories/_form', action: 'new', repo: nil) }}
|
40
8
|
</div>
|
41
|
-
|
42
|
-
|
43
|
-
<input type="submit" class="btn btn-success" value="Save"> <a class="btn btn-danger" href="{{ path_for(:admin_repositories_index) }}">Cancel</a>
|
44
|
-
</div>
|
45
|
-
<br>
|
46
|
-
</form>
|
47
|
-
</nav>
|
48
|
-
|
49
|
-
<style>
|
50
|
-
#text {
|
51
|
-
display:none
|
52
|
-
}
|
53
|
-
#json {
|
54
|
-
display:none
|
55
|
-
}
|
56
|
-
#select_list {
|
57
|
-
display:none
|
58
|
-
}
|
59
|
-
% if action=="edit"
|
60
|
-
.form-group:hover + #text {
|
61
|
-
display: block;
|
62
|
-
}
|
63
|
-
% end
|
64
|
-
.panel-heading {
|
65
|
-
color: #3c763d;
|
66
|
-
background-color: #dff0d8;
|
67
|
-
border-color: #d6e9c6;
|
68
|
-
}
|
69
|
-
</style>
|
9
|
+
</div>
|
10
|
+
</div>
|
@@ -69,7 +69,7 @@ end
|
|
69
69
|
</div>
|
70
70
|
<br>
|
71
71
|
<div>
|
72
|
-
<a onclick="
|
72
|
+
<a onclick="goClean('{{ path_for(:tasks_show, task_name: result.task['name']) }}');" style="cursor:pointer;" class='label label-default' >Return to task</a>
|
73
73
|
</div>
|
74
74
|
<br>
|
75
75
|
<br>
|
@@ -78,5 +78,5 @@ end
|
|
78
78
|
<h3>There is no result with id: <b>{{result_id}}</b></h3>
|
79
79
|
</div>
|
80
80
|
<br>
|
81
|
-
<a onclick="
|
81
|
+
<a onclick="goClean('{{ path_for(:tasks_show, task_name: result.task['name']) }}');" style="cursor:pointer;" class='label label-default' >Back</a>
|
82
82
|
% end
|
data/lib/mutx/view/sections.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mutx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Rodriguez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -533,6 +533,8 @@ files:
|
|
533
533
|
- lib/mutx/view/admin/custom-params/index.mote
|
534
534
|
- lib/mutx/view/admin/custom-params/new.mote
|
535
535
|
- lib/mutx/view/admin/custom-params/selection_box.mote
|
536
|
+
- lib/mutx/view/admin/repositories/_form.mote
|
537
|
+
- lib/mutx/view/admin/repositories/edit.mote
|
536
538
|
- lib/mutx/view/admin/repositories/index.mote
|
537
539
|
- lib/mutx/view/admin/repositories/new.mote
|
538
540
|
- lib/mutx/view/admin/tasks/_delete_form.mote
|