App-docsisious

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

 - Change name from App::docsisicious to App::docsisious

0.02 2015-10-15T01:49:52+0200
 - Remove scrollbar in default view
 - Fix executable name
 - Fix SnmpMibObject in example config file

0.01 2015-10-15T01:26:02+0200
 - Add "download" config
 - Add "save" config
 - Add "upload" config

lib/App/docsisious/public/icons/flaticon.css  view on Meta::CPAN

	font-family: Flaticon;
        font-size: 20px;
font-style: normal;
margin-left: 20px;
}
.flaticon-download164:before { content: "\e000"; }
.flaticon-fullscreen4:before { content: "\e001"; }
.flaticon-gear39:before { content: "\e002"; }
.flaticon-question58:before { content: "\e003"; }
.flaticon-save28:before { content: "\e004"; }
.flaticon-uploading18:before { content: "\e005"; }

lib/App/docsisious/public/icons/flaticon.html  view on Meta::CPAN

		<div class="glyph-icon flaticon-download164"></div>
		<div class="class-name">.flaticon-download164</div><div class="author-name">Author: <a href="http://www.flaticon.com/free-icon/download-button_60721">Google</a></div></div><div class="glyph">
		<div class="glyph-icon flaticon-fullscreen4"></div>
		<div class="class-name">.flaticon-fullscreen4</div><div class="author-name">Author: <a href="http://www.flaticon.com/free-icon/fullscreen-arrows-symbol_25183">Dave Gandy</a></div></div><div class="glyph">
		<div class="glyph-icon flaticon-gear39"></div>
		<div class="class-name">.flaticon-gear39</div><div class="author-name">Author: <a href="http://www.flaticon.com/free-icon/settings-work-tool_70367">Egor Rumyantsev</a></div></div><div class="glyph">
		<div class="glyph-icon flaticon-question58"></div>
		<div class="class-name">.flaticon-question58</div><div class="author-name">Author: <a href="http://www.flaticon.com/free-icon/question-mark_3711">Daniel Bruce</a></div></div><div class="glyph">
		<div class="glyph-icon flaticon-save28"></div>
		<div class="class-name">.flaticon-save28</div><div class="author-name">Author: <a href="http://www.flaticon.com/free-icon/save-icon_64052">Freepik</a></div></div><div class="glyph">
		<div class="glyph-icon flaticon-uploading18"></div>
		<div class="class-name">.flaticon-uploading18</div><div class="author-name">Author: <a href="http://www.flaticon.com/free-icon/upload-arrow-with-bar_76979">Plainicon</a></div></div></section>

<section class="attribution">

	<div class="usetitle">License and attribution:</div><div class="attrDiv">Font generated by <a href="http://www.flaticon.com">flaticon.com</a>
 under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY</a>. The authors are: <a href="http://www.google.com">Google</a>, <a href="http://fontawesome.io">Dave Gandy</a>, <a href="http://www.behance.com/pio-5">Egor Rumyantsev</a>, <a href="...

<textarea onclick="this.focus();this.select();">Font generated by &lt;a href=&quot;http://www.flaticon.com&quot;&gt;flaticon.com&lt;/a&gt;
 under &lt;a href=&quot;http://creativecommons.org/licenses/by/3.0/&quot;&gt;CC BY&lt;/a&gt;. The authors are: &lt;a href=&quot;http://www.google.com&quot;&gt;Google&lt;/a&gt;, &lt;a href=&quot;http://fontawesome.io&quot;&gt;Dave Gandy&lt;/a&gt;, &lt...

</section>

<section class="iconsuse">
    	<div class="usetitle">Examples:</div>
		<div class="image"><p>&lt;i class=&quot;flaticon-download164&quot;&gt;&lt;/i&gt; <i class="flaticon-download164"></i></p><p>&lt;i class=&quot;flaticon-fullscreen4&quot;&gt;&lt;/i&gt; <i class="flaticon-fullscreen4"></i></p><p>&lt;i class=&quot;flat...
</section>
<div id="footer">
    <div>Generated by <a href="http://www.flaticon.com">flaticon.com</a>
    </div>
</div>
	</body>
</html>

lib/App/docsisious/public/icons/flaticon.svg  view on Meta::CPAN

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg"><defs><font id="flaticon" horiz-adv-x="512"><font-face units-per-em="512" ascent="448" descent="-64" x-height="240" cap-height="480"/><missing-glyph horiz-adv-x="512"/><glyph unicode="&#xE000;" glyph-name="down...

script/docsisious  view on Meta::CPAN

    $c->redirect_to('edit' => id => $id);
  } or do {
    my $err = $@;
    chomp $err;
    $err =~ s! at \S+.*$!!s;
    $c->app->log->debug("Cannot encode config file: $err");
    $c->render(error => "Cannot encode config file: $err", status => 400);
  };
};

my $upload = sub {
  my $c      = shift;
  my $binary = $c->req->upload('binary');

  eval {
    my $config = decode_docsis($binary->slurp);
    $c->param(config   => YAML::XS::Dump($config));
    $c->param(filename => basename $binary->filename);
  } or do {
    my $err = $@;
    chomp $err;
    $err =~ s! at \S+.*$!!s;
    $c->render(error => "Cannot decode config file: $err", status => 400);

script/docsisious  view on Meta::CPAN

    $c->param(shared_secret => $data->{shared_secret});
  },
  'edit'
);

post(
  '/' => {layout => 'default', template => 'editor'} => sub {
    my $c = shift;
    return $c->$save     if $c->param('save');
    return $c->$download if $c->param('download');
    return $c->$upload   if $c->req->upload('binary');
    return $c->render(text => "Either download, binary or save need to be present.\n", status => 400);
  },
  'save'
);

helper paste_id => sub {
  my $c = shift;
  my $id = $c->param('id') || Mojo::Util::md5_sum($^T . $$ . steady_time);
  die "Invalid id: $id" unless $id =~ /^\w+$/;
  die "Invalid id: $id" if $id eq 'example';

script/docsisious  view on Meta::CPAN

          settings.style.display = 'none';
          help.style.display = help.style.display == 'block' ? 'none' : 'block';
        });
      }
      else if (btn.className.indexOf('settings') > 0) {
        btn.addEventListener('click', function(e) {
          help.style.display = 'none';
          settings.style.display = settings.style.display == 'block' ? 'none' : 'block';
        });
      }
      else if (btn.className.indexOf('upload') > 0) {
        btn.addEventListener('click', function(e) {
          document.querySelector('[name="binary"]').click();
        });
      }
    })(buttons[i]);
  }

  editor.focus();
  document.querySelector('[name="binary"]').addEventListener('change', function(e) {
    document.querySelector("form").submit();

script/docsisious  view on Meta::CPAN

  resize();
});
@@ css/docsis.css.ep
@font-face { font-family: "Flaticon"; src: url("../../icons/flaticon.eot"); src: url("../../icons/flaticon.eot#iefix") format("embedded-opentype"), url("../../icons/flaticon.woff") format("woff"), url("../../icons/flaticon.ttf") format("truetype"), u...
[class^="flaticon-"]:before, [class*=" flaticon-"]:before, [class^="flaticon-"]:after, [class*=" flaticon-"]:after { font-family: Flaticon; font-style: normal; }
.flaticon-download164:before { content: "\e000"; }
.flaticon-fullscreen4:before { content: "\e001"; }
.flaticon-gear39:before { content: "\e002"; }
.flaticon-question58:before { content: "\e003"; }
.flaticon-save28:before { content: "\e004"; }
.flaticon-uploading18:before { content: "\e005"; }
* { box-sizing: border-box; }
body, html {
  margin: 0;
  padding: 0;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4em;
}
a {
  color: #4C79B3;

script/docsisious  view on Meta::CPAN

</body>
</html>
@@ editor.html.ep
%= form_for "save", enctype => "multipart/form-data", begin
  <div id="header">
    <div id="title_box">&nbsp;</div>
    <h1><%= link_to 'DOCSIS config file editor', 'editor' %></h1>
    <button class="btn" name="save" value="1" title="Save for later."><i class="icon flaticon-save28"></i></button>
    <button class="btn settings" type="button" title="Settings."><i class="icon flaticon-gear39"></i></a>
    <button class="btn" name="download" value="1" title="Download binary config."><i class="icon flaticon-download164"></i></a>
    <button class="btn upload" type="button" title="Upload binary config."><i class="icon flaticon-uploading18"></i></button>
    <button class="btn help" type="button" title="Help and about."><i class="icon flaticon-question58"></i></button>
  % if ($error) {
    <div class="error"><%= $error %></div>
  % }
    <div id="help">
      <p>
        This web application is an online <a href="http://en.wikipedia.com/wiki/DOCSIS">DOCSIS</a>
        config file text editor.
      </p>
      <p>
        Feature list:
      </p>
      <ul>
        <li>Can edit any DOCSIS config file.</li>
        <li>Compatible with DOCSIS 1.x, 2.x and 3.x.</li>
        <li>Can download/upload binary format.</li>
        <li>Can save config for later use.</li>
        <li>Allow setting of shared secret.</li>
        <li><a href="https://github.com/jhthorsen/app-docsisious">Open source</a>.</li>
      </ul>
      <p>
        The program is built on top of the powerful <a href="http://perl.org">Perl</a> based
        <a href="https://metacpan.org/pod/DOCSIS::ConfigFile">DOCSIS::ConfigFile</a> library.
        Have a look at the complete <a href="https://metacpan.org/pod/DOCSIS::ConfigFile::Syminfo#CONFIGURATION-TREE">configuration tree</a>
        to see what is possible or simply try out an <%= link_to 'example config', 'example' %>
        and start editing.



( run in 2.885 seconds using v1.01-cache-2.11-cpan-b16cb0d3907 )